public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Guilherme Cox <cox@computer.org>
Subject: Re: [PATCH 0/9] tools lib traceevent: Pulling in updates from trace-cmd
Date: Tue, 24 Mar 2015 12:26:37 -0300	[thread overview]
Message-ID: <20150324152637.GG5447@kernel.org> (raw)
In-Reply-To: <20150324110428.486d3293@gandalf.local.home>

Em Tue, Mar 24, 2015 at 11:04:28AM -0400, Steven Rostedt escreveu:
> On Tue, 24 Mar 2015 11:57:27 -0300
> Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
> > Em Tue, Mar 24, 2015 at 09:57:48AM -0400, Steven Rostedt escreveu:
> > > Arnaldo,
> > > 
> > > I took a look at the differences between what I have in trace-cmd and
> > > what is sitting in tools/lib/traceevent, and I put together a patch set
> > > that brings in fixes and updates to libtraceevent.
> > 
> > Thanks, will process now.
> 
> I just added this one too...

ok, but who is the author? Is Guilherme just the reporter or was it him
that sent the patch but hasn't provided a S-o-B?

- Arnaldo
 
> -- Steve
> 
> From fe80b2e9396fa6b8dc66a6dfd4c7a426e1685424 Mon Sep 17 00:00:00 2001
> From: Guilherme Cox <cox@computer.org>
> Date: Fri, 20 Feb 2015 19:10:34 -0500
> Subject: [PATCH] tools lib traceevent: Zero should not be considered "not
>  found" in eval_flag()
> 
> Guilherme Cox found that:
>  There is, however, a potential bug if there is an item with code zero
>  that is not the first one in the symbol list, since eval_flag(..)
>  returns 0 when it doesn't find anything.
> 
> Reported-by: Guilherme Cox <cox@computer.org>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>  tools/lib/traceevent/event-parse.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> index aff743710001..f2fb50141703 100644
> --- a/tools/lib/traceevent/event-parse.c
> +++ b/tools/lib/traceevent/event-parse.c
> @@ -3576,7 +3576,7 @@ static const struct flag flags[] = {
>  	{ "HRTIMER_RESTART", 1 },
>  };
>  
> -static unsigned long long eval_flag(const char *flag)
> +static long long eval_flag(const char *flag)
>  {
>  	int i;
>  
> @@ -3592,7 +3592,7 @@ static unsigned long long eval_flag(const char *flag)
>  		if (strcmp(flags[i].name, flag) == 0)
>  			return flags[i].value;
>  
> -	return 0;
> +	return -1LL;
>  }
>  
>  static void print_str_to_seq(struct trace_seq *s, const char *format,
> @@ -3666,7 +3666,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
>  	struct print_flag_sym *flag;
>  	struct format_field *field;
>  	struct printk_map *printk;
> -	unsigned long long val, fval;
> +	long long val, fval;
>  	unsigned long addr;
>  	char *str;
>  	unsigned char *hex;
> @@ -3725,11 +3725,11 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
>  		print = 0;
>  		for (flag = arg->flags.flags; flag; flag = flag->next) {
>  			fval = eval_flag(flag->value);
> -			if (!val && !fval) {
> +			if (!val && fval < 0) {
>  				print_str_to_seq(s, format, len_arg, flag->str);
>  				break;
>  			}
> -			if (fval && (val & fval) == fval) {
> +			if (fval > 0 && (val & fval) == fval) {
>  				if (print && arg->flags.delim)
>  					trace_seq_puts(s, arg->flags.delim);
>  				print_str_to_seq(s, format, len_arg, flag->str);
> -- 
> 1.8.3.1

  parent reply	other threads:[~2015-03-24 15:26 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 13:57 [PATCH 0/9] tools lib traceevent: Pulling in updates from trace-cmd Steven Rostedt
2015-03-24 13:57 ` [PATCH 1/9] tools lib traceevent: Handle NULL comm name Steven Rostedt
2015-03-24 16:33   ` [tip:perf/core] " tip-bot for Josef Bacik
2015-03-24 13:57 ` [PATCH 2/9] tools lib traceevent: Copy trace_clock and free it Steven Rostedt
2015-03-24 15:14   ` Arnaldo Carvalho de Melo
2015-03-24 15:43     ` Steven Rostedt
2015-03-24 16:33   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2015-03-24 13:57 ` [PATCH 3/9] tools lib traceevent: Handle %z in bprint format Steven Rostedt
2015-03-24 16:33   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2015-03-24 13:57 ` [PATCH 4/9] tools lib traceevent: Add pevent_data_pid_from_comm() Steven Rostedt
2015-03-24 15:16   ` Arnaldo Carvalho de Melo
2015-03-24 16:34   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2015-03-24 13:57 ` [PATCH 5/9] tools lib traceevent: Fix whitespace error Steven Rostedt
2015-03-24 15:19   ` Arnaldo Carvalho de Melo
2015-03-24 15:37     ` Steven Rostedt
2015-03-24 13:57 ` [PATCH 6/9] tools lib traceevent: Make plugin options either string or boolean Steven Rostedt
2015-03-24 16:34   ` [tip:perf/core] " tip-bot for Steven Rostedt
2015-03-24 13:57 ` [PATCH 7/9] tools lib traceevent kbuffer: Remove extra update to data pointer in PADDING Steven Rostedt
2015-03-24 16:34   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2015-03-24 13:57 ` [PATCH 8/9] tools lib traceevent: Add way to find sub buffer boundary Steven Rostedt
2015-03-24 16:35   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2015-03-24 13:57 ` [PATCH 9/9] tools lib traceevent: Free filter tokens in process_filter() Steven Rostedt
2015-03-24 16:35   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2015-03-24 14:57 ` [PATCH 0/9] tools lib traceevent: Pulling in updates from trace-cmd Arnaldo Carvalho de Melo
2015-03-24 15:04   ` Steven Rostedt
2015-03-24 15:25     ` Arnaldo Carvalho de Melo
2015-03-24 15:26     ` Arnaldo Carvalho de Melo [this message]
2015-03-24 15:44       ` Steven Rostedt
2015-03-24 15:45         ` Steven Rostedt
2015-03-24 15:51           ` Arnaldo Carvalho de Melo
2015-03-24 16:19             ` Steven Rostedt

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=20150324152637.GG5447@kernel.org \
    --to=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cox@computer.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    /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