Received: by 10.213.65.68 with SMTP id h4csp2117840imn; Sun, 8 Apr 2018 20:08:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+sK8Sv+R4K8BMqLZ0NJTpli5UOrVhMvxbEdTR8HewTebAwspTBag2FEoxy5FSZrJj/vecS X-Received: by 2002:a17:902:227:: with SMTP id 36-v6mr35772901plc.134.1523243339703; Sun, 08 Apr 2018 20:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243339; cv=none; d=google.com; s=arc-20160816; b=DyXpINKUVlG8w2Fc1px3uVm2EEsnt+NKOwMWLDdv9LzY2vnmj/r/DheeMKRlviSsWj ZVmEpdyoxpILAbeYO8B1TT609OhLZSJRHpFhg1He1SOtYJsGu+VbMZ8e6mnrvZuxCZA6 moBnJUw2TliWzid2nddV7HJ492G9AOhg11ehBSfU7Xy8hCRGZXgkrCdatgN4yFnkO4Km BlX0llWmAnbpI1G2Mshb98Q8ID1I5MwVjte8G1PEHGGi19BaUlXGXA2J7+GDwH0JTnK8 4YeFy4tq4dOfWRg8eaUtDXUrmh08ZWZZMrYeybxmsWDpWk04LJUbjEC/8NxGgEGyz/Oq OsqQ== 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=KznR2mhkcjSok9wVH67zZeIi3AhGggXrYp7HUZQPcL8=; b=AFngMuzrQTUhjOarGuMsY5xRSYF3/j+T/08IySMDS51Lqfrw78kAbcnk06PnjaCfF5 YlPOvdsOPoTbDn5uU3zrDeCpwgYjBRO7GJrXdu8WMf1M23Cn+VrjXVObJUiSkeuSxgGp xS5V5E2od5SS6ODEfSjwihZXdL2ByN3EVDOwxK3dmXrmIyJdplUVBtk5JIncias+gIwd eHv8fv4Tm1LN0+o1JCT06A4ps07dvYEUzhZYjVjcdRqrhzv5xruVjziZcVFosITLxnox E5nmTendJyhT2alXUnFIcpdWD1Y8PUv7zosXtekotO9NugDl+NWTXIgxRnjgpTNih14T xHMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=iXodTy4C; 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 w19-v6si13294058plq.156.2018.04.08.20.08.22; Sun, 08 Apr 2018 20:08:59 -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=iXodTy4C; 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 S932346AbeDIB4d (ORCPT + 99 others); Sun, 8 Apr 2018 21:56:33 -0400 Received: from mail-by2nam01on0100.outbound.protection.outlook.com ([104.47.34.100]:61248 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932165AbeDIAcz (ORCPT ); Sun, 8 Apr 2018 20:32:55 -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=KznR2mhkcjSok9wVH67zZeIi3AhGggXrYp7HUZQPcL8=; b=iXodTy4CTJYJz0a2QH3WTjaPM+Z4W1hhJYcYPVrdIMOrGgm0R0K93eCstLtv4hhGsdK/KZCF0CX7Sb3bE/MEwowCA6oeoNNz+UW7rp763TADFqIN8SCA7cZcKDpGP5j38oiuB8FTgrvII6iedDQAQNGk7r42yGjTkD5ik29J2W0= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0998.namprd21.prod.outlook.com (52.132.133.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.0; Mon, 9 Apr 2018 00:32:52 +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:32:52 +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.9 221/293] tools lib traceevent: Simplify pointer print logic and fix %pF Thread-Topic: [PATCH AUTOSEL for 4.9 221/293] tools lib traceevent: Simplify pointer print logic and fix %pF Thread-Index: AQHTz5lNzk3xGdBTN06JRaISO4nY5A== Date: Mon, 9 Apr 2018 00:25:46 +0000 Message-ID: <20180409002239.163177-221-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-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;DM5PR2101MB0998;7:o4rQparaU/3WSoLgZ/r2xlpN1gH/qvPZVXQ2GL53+b6QNgYugVsm1zZ9XZ/pQri82XXMwYiKnBwMMZ//dWDcl5B8QJXaEdjNX+SyBVAOEA/UQiMQT7l6zDv3a/Q5vG+4FDBmqKCNL0zMeVrlFDZP4X34phLjWsEldrPWKoTc/PD6SxzJXgMMSAdZT+WsBNjYwdBN53/8EcwtRaiWEjUoFvuwmYGb0Yv47+JTEkspsjGnd0XkVcTX4gmQ9ifx/ri4;20:Q6xTn3h5au8nD0yNh/9WscCOaS69wP/TOceUG9eFYyefUSUCUWZMQbbyxqCnOxACtM2LnLed+TINTWBPPrjEHD/UfDJq0BRzwcT9abjTPsgzgFLTQaO+d5Yp9HZxgaKE8yry2UIfCdWjXhLkpMnw/uaQgbGEUHjzxuUODsxf7YM= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 39baa282-cb31-42fc-2c7b-08d59db16de3 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0998; x-ms-traffictypediagnostic: DM5PR2101MB0998: 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:DM5PR2101MB0998;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0998; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39380400002)(376002)(396003)(366004)(39860400002)(189003)(199004)(25786009)(105586002)(14454004)(76176011)(68736007)(2906002)(316002)(97736004)(8676002)(966005)(86612001)(3660700001)(3280700002)(102836004)(6116002)(4326008)(8936002)(36756003)(22452003)(81166006)(81156014)(54906003)(6506007)(10090500001)(2501003)(6512007)(186003)(6666003)(3846002)(486006)(5660300001)(6306002)(26005)(7736002)(5250100002)(305945005)(99286004)(2900100001)(110136005)(1076002)(6436002)(53936002)(106356001)(575784001)(107886003)(72206003)(86362001)(476003)(446003)(66066001)(11346002)(478600001)(10290500003)(2616005)(6486002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0998;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: W+iGvfxeEe9Ip7d0Bc/q5Qy9/E3LUgsjPUcgnt7vmp2shNfEysmKowcaWdmeEJl3EbDlVe9LhOHVrmokjVv85Z12X8lZ9lvTznVHlbPndP1V7+46MzTgGLbbVwEJNOadYp6tgiQ0MfntqsPsijxGtfJ+WZ/NgLRBPyZyGmWBIbbdfRtZh3gmxe7cl3mJt4LzRYtfPHbR2KpwET/b6eYbMV5aIL9ulT9ny10UC3x+l1NIVxU0BlTcLT/jP6xcHw8TgxxpHDWUOrsmm+b33cW2f5eIbzJiI+9jtF4tByCJmsuF5hxu+2v2eLOwjqM36y/Eruf15e0u52UWHOelX9qYUTxrQGGmHYFxbYDkNuNA/9lxiKg5pp8J4ZGm2CoSB1TDvS4MKYMU8lXQvLM595tehOxmNs9mMU+t64myMofmjso= 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: 39baa282-cb31-42fc-2c7b-08d59db16de3 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:25:46.6910 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0998 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 664c90c8e22b..669475300ba8 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -4927,21 +4927,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