public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Wilder <dwilder@us.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, SystemTAP <systemtap@sources.redhat.com>
Subject: Re: [PATCH 1/2] Trace code and documentation
Date: Fri, 14 Sep 2007 21:47:32 -0700	[thread overview]
Message-ID: <46EB63E4.8060107@us.ibm.com> (raw)
In-Reply-To: <20070914180840.579627ab.akpm@linux-foundation.org>

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.


  parent reply	other threads:[~2007-09-15  4:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-13 23:43 [PATCH 1/2] Trace code and documentation David Wilder
2007-09-14  4:12 ` Randy Dunlap
2007-09-14 17:50 ` Sam Ravnborg
2007-09-15  4:49   ` David Wilder
2007-09-15  5:18     ` Sam Ravnborg
2007-09-15  1:08 ` Andrew Morton
2007-09-15  1:40   ` Randy Dunlap
2007-09-15  4:47   ` David Wilder [this message]
2007-09-15 16:01 ` Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46EB63E4.8060107@us.ibm.com \
    --to=dwilder@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox