From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753215AbbCXP0l (ORCPT ); Tue, 24 Mar 2015 11:26:41 -0400 Received: from mail.kernel.org ([198.145.29.136]:52791 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753192AbbCXP0h (ORCPT ); Tue, 24 Mar 2015 11:26:37 -0400 Date: Tue, 24 Mar 2015 12:26:37 -0300 From: Arnaldo Carvalho de Melo To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Jiri Olsa , Namhyung Kim , Andrew Morton , Guilherme Cox Subject: Re: [PATCH 0/9] tools lib traceevent: Pulling in updates from trace-cmd Message-ID: <20150324152637.GG5447@kernel.org> References: <20150324135748.506437888@goodmis.org> <20150324145727.GA5447@kernel.org> <20150324110428.486d3293@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150324110428.486d3293@gandalf.local.home> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 > 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 > Signed-off-by: Steven Rostedt > --- > 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