Received: by 10.213.65.68 with SMTP id h4csp2130699imn; Sun, 8 Apr 2018 20:29:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx48gdTVnHd4WfFcv3p+/VTdDHs27F0VmNkV+HuqSfOBfif+syU7jSYDHHz/T/y9zXbLSGHaL X-Received: by 2002:a17:902:4481:: with SMTP id l1-v6mr37172647pld.43.1523244594208; Sun, 08 Apr 2018 20:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523244594; cv=none; d=google.com; s=arc-20160816; b=DqpcQ7MOCNyO1jDX0Xgw0bdntdLUCapYErvi94oHCwswWKGMVx3lgmkRerCVmvyQav giSWBibdYaS9BS2Zvs8LLAZofMDZYZGMFf4D+cjrvEMVnTj+7NkZHKJ9lIFn9M0LN2l8 JpzTQvLFkAH0efjGVhyLnqNvx8eWXpfIanD4vg/XW7sWNYMo66U5Iocq4ZQBNL3RYAHk hoZSxZrxhw+2mGHt11A4HYMQ6zimBoW2LGWBD6t4YSRbp+CZM9hvnJ8s1dMuATLe01ai I7xvMHpzQ8orMjFRgs3MAGzMIoVqnUWlvDirH4tI0r+ggwnXYSolqXWLdZjaEi6dgOfO 6e5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Efnd2MRltGCABucCEZR3ZyG6PD2bybN7herY4qiqo5o=; b=XAIXB5AaewEu/H5Yea1NNh7A7DUft7VZ9MK5KNwp7ag7tz3xoBHIwHoM5hJHicR0J5 T98lDqUaFgb6XAXwYvTMCviKdNglFLYLm5oXJhjNpZ0VhC5IUTD2AcwkOLiycY+knRXr 6BPibB6ndmI3kh9BAYPgvMVonNfxHSyQbbC5Z4qr+26dfGRgz2hHlDq5kQQysiL2L1kx X8nHh0V93qR7NpbrK7zOPazlEA+5SPTyt+v5Qzx7GlJBRuF3Gkx0Sq5YbOFuwbqAdjt5 UBB3Cq08kyVpcrjVoQpcsPiP6bgIU5XRLLCoXd3Bedy24QN52+Q2L+PHLq0c+757XPef mWjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Rg4bYR7r; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g24si12020659pfe.263.2018.04.08.20.29.16; Sun, 08 Apr 2018 20:29:54 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Rg4bYR7r; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752783AbeDIDZN (ORCPT + 99 others); Sun, 8 Apr 2018 23:25:13 -0400 Received: from mail-sn1nam01on0122.outbound.protection.outlook.com ([104.47.32.122]:20813 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754692AbeDIAWn (ORCPT ); Sun, 8 Apr 2018 20:22:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Efnd2MRltGCABucCEZR3ZyG6PD2bybN7herY4qiqo5o=; b=Rg4bYR7rYJ2ZK0a5r8rdMq52NxOQ/Pvgwd9DPW3ZwqpvB/gjmDhkzSLzCQZQXJ09RH5+LLKK+0UXIfqeV319fJfzaTGBO/TdMjCEUfd/QV42ppLV2zW/7pqhnHiZi1Cn2SHZAqn+/s/lAOyr+K9hGh/TDI8WIz9p2+RlDSL+QPo= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0966.namprd21.prod.outlook.com (52.132.133.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:22:40 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:22:40 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "Steven Rostedt (VMware)" , Andrew Morton , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 025/161] tools lib traceevent: Simplify pointer print logic and fix %pF Thread-Topic: [PATCH AUTOSEL for 4.14 025/161] tools lib traceevent: Simplify pointer print logic and fix %pF Thread-Index: AQHTz5iAdshqWctDSUaqU3W7bp62aA== Date: Mon, 9 Apr 2018 00:20:02 +0000 Message-ID: <20180409001936.162706-25-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0966;7:/3YikyVRWELCZHhk4twk9bC1Hpj4Bft78OGa9ThrkakDFomUruurXcOwxVlduBOj85ZlZ4S4qxUfjR34H7q8RoWVdTlJJgOYQAoXMedRzmx4VVIqegO43RjfrEtwUd2MFkUuKj1+CzKqHa6yAjWgFHW67EMQ9sbhDRl0Dcsh63Tg09e0svIB8GoEBVRqTdyB8vvs4E6p0QSm5EDC+DALnWQQWVgKDNqZyJzfLP8L+LsDMdXwlJx/r00m/8dxUVdw;20:0NzjbE2M+8CM1OQ3aw9f4pBOKgwfd8acDmHKWOeogjH2vf4ZEz4mWo5IocC1LA8z30xZN2mVXrtFRViyzjXK3iHZb5ET6LZ4evrzLs/P1VY+Uei4Aw4ZG1pZi4uLJ6EdafgQ+GmEQvkC33U9I15u8DYQ5QqRC3/LPb0n7xweP8Y= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 369a9bff-2a9d-496e-318b-08d59db00143 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0966; x-ms-traffictypediagnostic: DM5PR2101MB0966: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(42068640409301); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB0966;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0966; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(346002)(39860400002)(39380400002)(396003)(366004)(199004)(189003)(6512007)(316002)(6436002)(186003)(6306002)(6666003)(2900100001)(966005)(8936002)(486006)(6486002)(6506007)(10290500003)(81166006)(22452003)(25786009)(1076002)(81156014)(53936002)(106356001)(10090500001)(5250100002)(107886003)(102836004)(76176011)(8676002)(66066001)(2501003)(446003)(476003)(36756003)(99286004)(575784001)(478600001)(86362001)(72206003)(2616005)(68736007)(5660300001)(305945005)(3846002)(6116002)(26005)(86612001)(14454004)(97736004)(3660700001)(4326008)(2906002)(110136005)(54906003)(3280700002)(105586002)(7736002)(11346002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0966;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 6zvo/VrxjuHbrAEu91VTMlSq812MGpGpBHEvZnXN4tw6yR1UHuKHHGq4m8EmtNxHosYXaOF4/LEHSjgsBBsm3TPLsnYZD/IyuQScme+Kl8Y09spOzwmh/L5d8OHVH7M52knrd/Dh+YxOXSIB/j2e9xB1zeMCTRNH00vt/YUHLholQZURkbJLCWizKSPABKM/E+s068kmPVwfBUiLhrUTqjjBf3vqYqpc1pYBFlrCmF8HT2KrrFuQvRgepa4pZ9iuheXs/qtnDEOpoevgoYEjrsLWe04f4TGhxvQCuQa1iBZmVIQbOamjXiAJo/kBMX0D6WNhe3LzL+lT3/BhEqKrqOLWIDvU4bMKIs/h2l74KfPMvqiPLWVbbLM3dofCRcfg6jyuwWknshxo+Xr5NPnLLa5r2vDEQ4XKCsTAeu1nJfA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 369a9bff-2a9d-496e-318b-08d59db00143 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:20:02.1917 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0966 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- tools/lib/traceevent/event-parse.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/even= t-parse.c index 7ce724fc0544..9a17bc27296e 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -4949,21 +4949,22 @@ static void pretty_print(struct trace_seq *s, void = *data, int size, struct event else ls =3D 2; =20 - if (*(ptr+1) =3D=3D 'F' || *(ptr+1) =3D=3D 'f' || - *(ptr+1) =3D=3D 'S' || *(ptr+1) =3D=3D 's') { + if (isalnum(ptr[1])) ptr++; + + if (*ptr =3D=3D 'F' || *ptr =3D=3D 'f' || + *ptr =3D=3D 'S' || *ptr =3D=3D 's') { show_func =3D *ptr; - } else if (*(ptr+1) =3D=3D 'M' || *(ptr+1) =3D=3D 'm') { - print_mac_arg(s, *(ptr+1), data, size, event, arg); - ptr++; + } else if (*ptr =3D=3D 'M' || *ptr =3D=3D 'm') { + print_mac_arg(s, *ptr, data, size, event, arg); arg =3D arg->next; break; - } else if (*(ptr+1) =3D=3D 'I' || *(ptr+1) =3D=3D 'i') { + } else if (*ptr =3D=3D 'I' || *ptr =3D=3D 'i') { int n; =20 - n =3D print_ip_arg(s, ptr+1, data, size, event, arg); + n =3D print_ip_arg(s, ptr, data, size, event, arg); if (n > 0) { - ptr +=3D n; + ptr +=3D n - 1; arg =3D arg->next; break; } --=20 2.15.1