From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753254AbbH0OP7 (ORCPT ); Thu, 27 Aug 2015 10:15:59 -0400 Received: from mail.kernel.org ([198.145.29.136]:36339 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752895AbbH0OP6 (ORCPT ); Thu, 27 Aug 2015 10:15:58 -0400 Date: Thu, 27 Aug 2015 11:15:54 -0300 From: Arnaldo Carvalho de Melo To: Vlastimil Babka Cc: Steven Rostedt , LKML , Namhyung Kim Subject: Re: [PATCH] tools lib traceeveent: Allow for negative numbers in print format Message-ID: <20150827141554.GB31339@kernel.org> References: <20150827094601.46518bcc@gandalf.local.home> <55DF16EC.7070606@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55DF16EC.7070606@suse.cz> 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 Thu, Aug 27, 2015 at 03:55:56PM +0200, Vlastimil Babka escreveu: > On 08/27/2015 03:46 PM, Steven Rostedt wrote: > > > >It was reported that "%-8s" does not parse well when used in the printk > >format. The '-' is what is throwing it off. Allow that to be included. > > > >Reported-by: Vlastimil Babka > > Reported-and-tested-by: Vlastimil Babka > > Example before: > transhuge-stres-10730 [004] 5897.713989: mm_compaction_finished: node=0 > zone=>-<8s order=-2119871790 ret= > > Example after: > transhuge-stres-4235 [000] 453.149280: mm_compaction_finished: node=0 > zone=ffffffff81815d7a order=9 ret= > > (I will send patches to fix the string handling in the tracepoints so it's > on par with in-kernel printing via trace_pipe:) > > transhuge-stres-10921 [007] ...1 6307.140205: mm_compaction_finished: > node=0 zone=Normal order=9 ret=partial Thanks, applied and added the before/after reporter notes. It is now in my perf/core branch. - Arnaldo > >Signed-off-by: Steven Rostedt > >--- > > tools/lib/traceevent/event-parse.c | 1 + > > 1 file changed, 1 insertion(+) > > > >diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c > >index cc25f059ab3d..3b01ae137d95 100644 > >--- a/tools/lib/traceevent/event-parse.c > >+++ b/tools/lib/traceevent/event-parse.c > >@@ -4754,6 +4754,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event > > case 'z': > > case 'Z': > > case '0' ... '9': > >+ case '-': > > goto cont_process; > > case 'p': > > if (pevent->long_size == 4) > >