From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753884AbbH0N4A (ORCPT ); Thu, 27 Aug 2015 09:56:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:33635 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752826AbbH0Nz7 (ORCPT ); Thu, 27 Aug 2015 09:55:59 -0400 Subject: Re: [PATCH] tools lib traceeveent: Allow for negative numbers in print format To: Steven Rostedt , Arnaldo Carvalho de Melo References: <20150827094601.46518bcc@gandalf.local.home> Cc: LKML , Namhyung Kim From: Vlastimil Babka Message-ID: <55DF16EC.7070606@suse.cz> Date: Thu, 27 Aug 2015 15:55:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150827094601.46518bcc@gandalf.local.home> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > 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) >