only check file descriptor in tracemark() function

If the tracemark_fd is >= 0, then we know we can write to the
trace_marker file. We only need to check that and not version of
the kernel or anything else at every instance of calling tracemark().

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
Steven Rostedt 2011-09-01 21:26:59 -04:00 committed by Steven Rostedt
parent 8c1e851bfe
commit ae357be2e8
1 changed files with 1 additions and 1 deletions

View File

@ -340,7 +340,7 @@ static void tracemark(char *comment)
{ {
/* bail out if we're not tracing */ /* bail out if we're not tracing */
/* or if the kernel doesn't support trace_mark */ /* or if the kernel doesn't support trace_mark */
if (!tracelimit || kernelversion < KV_26_33 || tracemark_fd < 0) if (tracemark_fd < 0)
return; return;
write(tracemark_fd, comment, strlen(comment)); write(tracemark_fd, comment, strlen(comment));
} }