Received: by 10.192.165.148 with SMTP id m20csp573609imm; Wed, 25 Apr 2018 04:30:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx49tS8ONWAJf6l308J42jg+IGTx6zzvpB39w4F7TsIa1Fk9KJaH45Qgk2koJ1O4BhIkW+WWk X-Received: by 10.99.103.6 with SMTP id b6mr23441317pgc.214.1524655844288; Wed, 25 Apr 2018 04:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524655844; cv=none; d=google.com; s=arc-20160816; b=q1GFT28rK30ePFV/x3nUhe4utmC6aHZREDQHKmTwIJmm+njWvT6U58pRvDeGCQTrGD u5ztjZZuYpkYIQ0mOzh764+VR6Q+Mv4vxVAMuq5zaUtp4WSvxH+d2ig59p0Qsm8ecq07 a5lIRRzu0D+1F5XmVInMXr9KV3vQ/q2H/F+16uM/h/9sLlFH3Xx5i6nT9P3jOR6J5r7l MtQOeHgR3yKkuM3XCsl/snic0j7edT/99Dyy3pmdUUs3lixmpFYVw6UzwniWYrLCh904 twC3184LcwvRPWOzGfLoNK9v43zQ1szOnOVaVWlO4xAc87RxQtHZKb7q7z7/4yT1Rjt0 jYAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=MEFHhIsURMYD3dN3QyShixJQC0fc265c4Dq/IYAl3lw=; b=FnlMiqQ6azsfZDx7L/hk1j1Rbbl9SazjIhBfFWvj4glTSBKac9fEGtwEkawJoFv/w9 R5nGrHbJwn+NQ95vP90fVzbxzqZF2+x7DSHFGcy8hu3hIiCAYb4VR6Mnaldlz5QVgMZW 6Tj7Kcl5wsQEQRo8H7xS5AAi2tKz9p96MQOVK9DDJ7PzB3+kPoChisvGZDVcISK2N5XZ //bPcC4HZ8OrL85teogVDvWTRWGMepOpvhob3hNaEfpCoPv4Qi0h5Wu3Cfad/uM8TKIk aFGV+W0lvUfER8yCaIIzMuKIrnBpHce432FsbTA7W+0f0HXrThj3TVPeuEV0IgHOUvRu DBsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1-v6si15551627pld.152.2018.04.25.04.30.29; Wed, 25 Apr 2018 04:30:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753686AbeDYL2p (ORCPT + 99 others); Wed, 25 Apr 2018 07:28:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51382 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752665AbeDYKiX (ORCPT ); Wed, 25 Apr 2018 06:38:23 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2675636; Wed, 25 Apr 2018 10:38:23 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steven Rostedt , Namhyung Kim , Andrew Morton , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.14 039/183] tools lib traceevent: Simplify pointer print logic and fix %pF Date: Wed, 25 Apr 2018 12:34:19 +0200 Message-Id: <20180425103244.147200447@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Steven Rostedt (VMware)" [ Upstream commit 38d70b7ca1769f26c0b79f3c08ff2cc949712b59 ] When processing %pX in pretty_print(), simplify the logic slightly by incrementing the ptr to the format string if isalnum(ptr[1]) is true. This follows the logic a bit more closely to what is in the kernel. Also, this fixes a small bug where %pF was not giving the offset of the function. Signed-off-by: Steven Rostedt Acked-by: Namhyung Kim Cc: Andrew Morton Link: http://lkml.kernel.org/r/20180112004822.260262257@goodmis.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/lib/traceevent/event-parse.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -4949,21 +4949,22 @@ static void pretty_print(struct trace_se else ls = 2; - if (*(ptr+1) == 'F' || *(ptr+1) == 'f' || - *(ptr+1) == 'S' || *(ptr+1) == 's') { + if (isalnum(ptr[1])) ptr++; + + if (*ptr == 'F' || *ptr == 'f' || + *ptr == 'S' || *ptr == 's') { show_func = *ptr; - } else if (*(ptr+1) == 'M' || *(ptr+1) == 'm') { - print_mac_arg(s, *(ptr+1), data, size, event, arg); - ptr++; + } else if (*ptr == 'M' || *ptr == 'm') { + print_mac_arg(s, *ptr, data, size, event, arg); arg = arg->next; break; - } else if (*(ptr+1) == 'I' || *(ptr+1) == 'i') { + } else if (*ptr == 'I' || *ptr == 'i') { int n; - n = print_ip_arg(s, ptr+1, data, size, event, arg); + n = print_ip_arg(s, ptr, data, size, event, arg); if (n > 0) { - ptr += n; + ptr += n - 1; arg = arg->next; break; }