Received: by 10.213.65.68 with SMTP id h4csp2111786imn; Sun, 8 Apr 2018 20:01:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/azAcoQXZo6WE35+ULVtMuwnLsQTBqfqUZfkIxUwVEebsaH2MYva4of/4WMwP99gK5jT2n X-Received: by 2002:a17:902:f44:: with SMTP id 62-v6mr25152881ply.318.1523242874226; Sun, 08 Apr 2018 20:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523242874; cv=none; d=google.com; s=arc-20160816; b=RKQetPT9+S8mlh7y30xZHgS9UaEOkkl8X/vdXeZkG4PAcp/kFv5Nuc6un3Cjfp0EpI /nKPrN2StEhdVy8uwpRGTP+9e5UMLk4x8bfvyuIjnGl7BRpMhRYN3s+/llWkZa/43V7Y 4dCt0XvCc7qiDpyvWR9BJ+rgIB+6PPOaiVu7uYAQEhgOTf4/9OBEU543Vuj1Icf1u3Wt k5FurQTMZvZNf29wP1Z2X/VYTaGYuryWBJp9b3ZCETyzelSrfh9h1bz1OBCbDN6uVb4w iZkyaWBfpehpz95J2dzaK0B0Yp21+CRCUyjb1N/yMEQkU/XqPtgMdI5lCKKsG0ZWo40W cuuQ== 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=elG2ZT+PgKJfD6l2Oxg9Nf0BG4MuVlO3VSEVJMdAaUKZt5Fry4390HWKI5diTZNvyf ywncnqYhHn8Jc9UgevNJKp2FN4wxJCUVAsRaIht4Da2FlHmawV290x8o/CgfMnWWvk+E mp0XRgIa7ephU0CpDJereSQZx9vs7TIwQ+FKo4GwZal0kVWgle1nmatB8GrOb1fJ+3sL hdfYat7ZBelUo4lr/X2+H699Y+eqzQE4BiMaiXH3hkJT3hpL4QEiGgQwpSQ+igjkwkLB LgJ1vCAl0tRP1GOvn23MHYRe1251Hm+wsdH1p8BP1byqPGkRUdGdnQqBm+e5B17GPIBS iotw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=YlxTynpi; 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 g23si12296495pfk.17.2018.04.08.20.00.36; Sun, 08 Apr 2018 20:01:14 -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=YlxTynpi; 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 S1753175AbeDIAR0 (ORCPT + 99 others); Sun, 8 Apr 2018 20:17:26 -0400 Received: from mail-co1nam03on0101.outbound.protection.outlook.com ([104.47.40.101]:48974 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753097AbeDIARP (ORCPT ); Sun, 8 Apr 2018 20:17:15 -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=YlxTynpiiqhy2vvYUmUYthznzK5Vg8tdqdzXNCIXPN1f7PNIhcCDHB0gZNW4ATsqfG4geZKj+w3ogFJxMEk0FjHgXXFNVxJN9kJyXq1mZ8knZ6YP1T37tKp4oHrv/+o+8bSM6eOljTgym2Cs8lIP837NqLJShTx8THpGEVxwuHI= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1127.namprd21.prod.outlook.com (52.132.132.167) 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:17:09 +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:17:09 +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.15 029/189] tools lib traceevent: Simplify pointer print logic and fix %pF Thread-Topic: [PATCH AUTOSEL for 4.15 029/189] tools lib traceevent: Simplify pointer print logic and fix %pF Thread-Index: AQHTz5gZ7p5r7qlp/0mCOghs0h8vJQ== Date: Mon, 9 Apr 2018 00:17:09 +0000 Message-ID: <20180409001637.162453-29-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-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;DM5PR2101MB1127;7:T0dDEO1z6md9EmUJ2KErwwZV3fWy+V/Y8ckASHxZi2/OU5/Nub8QlgyP5Dwq155biKpZw1k1RrLbU9sufSmMVIGjpcKpB3yW0sEJg4ythuw7kQgRWYCeTELfMKxkCV96nur8dFzGGzuPAO2fQ5fBL5tZHiQwvj5DQDMNMdm2xUJDv8HKRG/dsmkKDLHASU1iArsLL1wrsSxrHN5bjevmXuPT9pwb+YR5Y2dvqTbsgBPmv3jeeg79MLXxjQ3xhm+M;20:kZqWSDARCRXrRVLf2WxHUP53Z+W0JToxFuq+C9T98SRIsruj1PxQZZdcKci31bUz4cSiKrCUFuMUrtwnV4p0yR5aUvlidxaizaPPlpRVCnNGdkkeMp6CKhyMh+wpqd1NiZobmx6MfwvUOn2bEq0+rVG/If0a5JbMYxAV7FE5BYA= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 4786fa7d-4c24-42e0-19f9-08d59daf3be2 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1127; x-ms-traffictypediagnostic: DM5PR2101MB1127: 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)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1127;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1127; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(1496009)(396003)(39380400002)(39860400002)(376002)(346002)(366004)(189003)(199004)(105586002)(186003)(66066001)(6486002)(54906003)(7736002)(26005)(575784001)(86362001)(316002)(305945005)(110136005)(478600001)(3280700002)(86612001)(10290500003)(25786009)(5250100002)(2616005)(99286004)(22452003)(5660300001)(966005)(3660700001)(2900100001)(81166006)(3846002)(2906002)(106356001)(6506007)(107886003)(486006)(8676002)(81156014)(14454004)(10090500001)(68736007)(4326008)(6116002)(1076002)(72206003)(102836004)(6306002)(97736004)(11346002)(8936002)(476003)(2501003)(6436002)(6512007)(446003)(76176011)(36756003)(53936002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1127;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 4MUYOT7WfnJO/TvO4UG008QF8kBnB2eitAMq2PYGkSpyToG8I/uO9OCb6cBgSacFIV69O3tq5tuO40FfFQLO7MVnok00f7JVoG0NqJkoOj+Yw+ObVdHGHCzggulkkqta3B0/s3wbwctUF79VVIHQ7nHB5n8gAOzqPEeLZt2bw/bwr1KkUF1ZM/aE/QuTp1ukML7IbiZE7/8a6w/l6aVivwuE0UG3KfZcuR5RxAekbqn1LQk6SVYkoDvbAdddYRyjFpUlBhZM3Z4HKdo/V2yv9aHMvb8zm4WAeNoWhIdFHFMzJPqUp2wil6eXpoO5EtditD28hTqqmciHq5eHx3LBsNvBReuYmXC/PbCjArhQEig+ioPSe7WE23iBXDZujdmaD/ZmCvn2f51JDsBLQx0VkCQPZP/Dk12HF8mtMvJ4fLY= 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: 4786fa7d-4c24-42e0-19f9-08d59daf3be2 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:17:09.1366 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1127 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