lkml.org 
[lkml]   [2007]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] Trace code and documentation
Andrew Morton wrote:

>> +/*
>> + * Based on blktrace code, Copyright (C) 2006 Jens Axboe <axboe@suse.de>
>>
>
> So can we migrate blktrace to using this?
>
Yes, a blktrace patch is comming.

>> + int ret;
>> +
>> + if (trace->flags & TRACE_DISABLE_STATE)
>> + return -EINVAL;
>> +
>> + if (count > sizeof(buf) - 1)
>> + return -EINVAL;
>> +
>> + if (copy_from_user(buf, buffer, count))
>> + return -EFAULT;
>> +
>> + buf[count] = '\0';
>> +
>> + if (strncmp(buf, "start", strlen("start")) == 0 ) {
>> + ret = trace_start(trace);
>> + if (ret)
>> + return ret;
>> + } else if (strncmp(buffer, "stop", strlen("stop")) == 0)
>> + trace_stop(trace);
>> + else
>> + return -EINVAL;
>>
>
> What's the above code doing? Trying to cope with trailing chars after
> "start" or "stop"? Is that actually needed? It's the \n, I assume?
>

Yes, the typical usage is "echo start > state" and echo adds a \n.


Thanks for the comments, I will make the changes and resubmit.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-09-15 06:51    [W:0.075 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site