From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753503AbcBVUXM (ORCPT ); Mon, 22 Feb 2016 15:23:12 -0500 Received: from smtprelay0210.hostedemail.com ([216.40.44.210]:49717 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752095AbcBVUXK (ORCPT ); Mon, 22 Feb 2016 15:23:10 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2380:2393:2553:2559:2562:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3871:3873:4321:4362:5007:6261:6671:7809:7875:8603:9040:10004:10400:10848:10967:11026:11232:11658:11914:12043:12296:12438:12517:12519:12555:12740:13007:14096:14097:14659:21080:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: mind68_555e689f6ea20 X-Filterd-Recvd-Size: 3346 Date: Mon, 22 Feb 2016 15:23:03 -0500 From: Steven Rostedt To: Daniel Bristot de Oliveira Cc: Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Juri Lelli , Arnaldo Carvalho de Melo , LKML , linux-rt-users Subject: Re: [PATCH 4/4] tools lib traceevent: Implements '%' operation Message-ID: <20160222152303.02f79376@gandalf.local.home> In-Reply-To: <5c96a395c56cea6d3d13d949051bdece86cc26e0.1456157869.git.bristot@redhat.com> References: <5c96a395c56cea6d3d13d949051bdece86cc26e0.1456157869.git.bristot@redhat.com> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 22 Feb 2016 14:08:22 -0300 Daniel Bristot de Oliveira wrote: > The operation '%' is not implemented on event-parse.c, causing > an error on the parse of events with '%' operation on its > printk format. For example, > > # perf record -e sched:sched_deadline_yield ~/y > Warning: [sched:sched_deadline_yield] unknown op '%' > .... > # perf script > Warning: [sched:sched_deadline_yield] unknown op '%' > y 1641 [006] 3364.109319: sched:sched_deadline_yield: \ > [FAILED TO PARSE] now=3364109314595 \ > deadline=3364139295135 runtime=19975597 > > This patch implements the '%' operation. With this patch, we see the > correct output: > > # perf record -e sched:sched_deadline_yield ~/y > No Warning > > # perf script > y 4005 [001] 4623.650978: sched:sched_deadline_yield: \ > now=4623.650974050 \ > deadline=4623.680957364 remaining_runtime=19979611 > > Signed-off-by: Daniel Bristot de Oliveira Arnaldo, This patch is not dependent on the rest of the series and looks like a good general fix. Can you pull this one into your tree, and please add my: Reviewed-by: Steven Rostedt Thanks! -- Steve > --- > tools/lib/traceevent/event-parse.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c > index c3bd294..575e751 100644 > --- a/tools/lib/traceevent/event-parse.c > +++ b/tools/lib/traceevent/event-parse.c > @@ -1951,6 +1951,7 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok) > strcmp(token, "*") == 0 || > strcmp(token, "^") == 0 || > strcmp(token, "/") == 0 || > + strcmp(token, "%") == 0 || > strcmp(token, "<") == 0 || > strcmp(token, ">") == 0 || > strcmp(token, "<=") == 0 || > @@ -3689,6 +3690,9 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg > case '/': > val = left / right; > break; > + case '%': > + val = left % right; > + break; > case '*': > val = left * right; > break;