From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752635AbbKPWZX (ORCPT ); Mon, 16 Nov 2015 17:25:23 -0500 Received: from smtprelay0196.hostedemail.com ([216.40.44.196]:33135 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752213AbbKPWZT (ORCPT ); Mon, 16 Nov 2015 17:25:19 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2693:3138:3139:3140:3141:3142:3352:3865:3867:3868:3871:3872:4321:5007:6261:8603:9121:10004:10400:10848:11658:11914:12296:12517:12519:12555:13069:13255:13311:13357:14096:14097:14394:14659:21080:21088:30012:30054:30056:30070,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: suit93_686419e53e515 X-Filterd-Recvd-Size: 1891 Date: Mon, 16 Nov 2015 17:25:16 -0500 From: Steven Rostedt To: Arnaldo Carvalho de Melo Cc: LKML , Ingo Molnar , Namhyung Kim Subject: [PATCH v2] tools lib traceevents: Fix output of %llu for 64 bit values read on 32 bit machines Message-ID: <20151116172516.4b79b109@gandalf.local.home> In-Reply-To: <20151116172302.0a9326b5@gandalf.local.home> References: <20151116153310.326c1558@gandalf.local.home> <20151116172302.0a9326b5@gandalf.local.home> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; 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 When a long value is read on 32 bit machines for 64 bit output, the parsing needs to change "%lu" into "%llu", as the value is read natively. Unfortunately, if "%llu" is already there, the code will add another "l" to it and fail to parse it properly. Cc: stable@vger.kernel.org Signed-off-by: Steven Rostedt --- diff --git a/event-parse.c b/event-parse.c index 0a30253..ee5b720 100644 --- a/event-parse.c +++ b/event-parse.c @@ -4828,13 +4828,12 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event sizeof(long) != 8) { char *p; - ls = 2; /* make %l into %ll */ - p = strchr(format, 'l'); - if (p) + if (ls == 1 && (p = strchr(format, 'l'))) memmove(p+1, p, strlen(p)+1); else if (strcmp(format, "%p") == 0) strcpy(format, "0x%llx"); + ls = 2; } switch (ls) { case -2: