All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lluís Vilanova" <vilanova@ac.upc.edu>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] tracetool: Forbid argument name 'next'
Date: Mon, 12 Mar 2012 13:16:11 +0100	[thread overview]
Message-ID: <8762eakoac.fsf@ginnungagap.bsc.es> (raw)
In-Reply-To: <CAJSP0QVbXh3mqe6KCy1zXTjXrisznjZWg=0R3S34jBMOjNnjgw@mail.gmail.com> (Stefan Hajnoczi's message of "Mon, 12 Mar 2012 11:01:06 +0000")

Stefan Hajnoczi writes:

> On Mon, Mar 12, 2012 at 9:34 AM, Kevin Wolf <kwolf@redhat.com> wrote:
>> It has happened more than once that patches that look perfectly sane
>> and work with simpletrace broke systemtap because they use 'next' as an
>> argument name for a tracing function. However, 'next' is a keyword for
>> systemtap, so we shouldn't use it.
>> 
>> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>> ---
>>  scripts/tracetool |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>> 
>> diff --git a/scripts/tracetool b/scripts/tracetool
>> index 4c9951d..f892af4 100755
>> --- a/scripts/tracetool
>> +++ b/scripts/tracetool
>> @@ -81,6 +81,10 @@ get_args()
>>     args=${1#*\(}
>>     args=${args%%\)*}
>>     echo "$args"
>> +
>> +    if (echo "$args" | grep "[ *]next\($\|[, ]\)" > /dev/null 2>&1); then
>> +        echo -e "\n#error 'next' is a bad argument name (clash with systemtap keyword)\n "
>> +    fi

> Good idea, let's prevent it from being used.

> I don't think this is the way to do it because callers will parse
> stdout and we're not guaranteed to be generating C code where #error
> works.  Instead, we can echo to stderr and do exit 1.

I'd rather wait for the python version of tracetool to be integrated, so that
less patches have to be rebased.

In addition, there's a nice 'error' routine to handle this type of cases.


Lluis

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth

      parent reply	other threads:[~2012-03-12 12:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-12  9:34 [Qemu-devel] [PATCH 1/2] trace-events: Rename 'next' argument Kevin Wolf
2012-03-12  9:34 ` [Qemu-devel] [PATCH 2/2] tracetool: Forbid argument name 'next' Kevin Wolf
2012-03-12 11:01   ` Stefan Hajnoczi
2012-03-12 11:09     ` Kevin Wolf
2012-03-12 12:16     ` Lluís Vilanova [this message]

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=8762eakoac.fsf@ginnungagap.bsc.es \
    --to=vilanova@ac.upc.edu \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.