Received: by 10.213.65.68 with SMTP id h4csp2200652imn; Sun, 8 Apr 2018 22:20:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx48H7q+QeiEVIkjINeMdmeBSxf4EcVvQEwasiLiIm00+SkS6ghIOKVayeP9QKMgfTHddWI3y X-Received: by 10.99.167.6 with SMTP id d6mr23505469pgf.287.1523251257830; Sun, 08 Apr 2018 22:20:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523251257; cv=none; d=google.com; s=arc-20160816; b=W11q3+2JiG8f0shEu4B3CiXEdHiwb8oEyl3D8/vlToOIzoI9cjG+Lke//qJ1Kl4jlJ grU01tprclu0rnEXEUYZ14pjnZMDgovokHRo3c8rUHNyga7PCvuVwfPa6nU9puV2D24K 5WaTm9A2mfsmPGWhgpm5NErPhVC1v2yLBcuEfe28v3i+DHvNW/1lj1GsnW1S2wNfaClT f/mFVvNTeYqSAwPEyvfHtrTwZzjLigKADn9ztukilWZJphHwT0EE7E/icZJbP/PwBIor o+t6bmHON+N6QNkugJk8CJGD+1SCSkTH45ZJGWmsV4AO7soEnmU4+6OTvOawZGGnNdb/ YxRg== 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=15sbMWLtcuffJKQoULtixh+kYoymTwmogK2MBxtOI6g=; b=VFN8alEIC1NkWqBUDillsosyPuYelACanFg1qBtffCwIHgMBzIXsXs+HK+CR7BKhVL TFSEK6AjyK32PL8WY5hHBN7vpNMLtAiKSEbBLahmzSHriBqmn69oTeN3brDq1GW09l0F 3xcDwtavLyGeFbM8oAXAczI3JIo6zVi3cR4n7UL2HT0841KhJz/GsDQJe5yMJny54adV b1z5WKCWB6DKgdRnR/nEsIhe620oBta6OxTEmjCPxWOR281PJzk4P9ar7vH6XJtf602e Y2XQ0NDvvcBweEGgXg1ONPS48hpLLZ7AQnPxBfID7hA9E6op4gJd9rnWi6gvUowP3tWR yDEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=bUso4Yv5; 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 g64si8357114pgc.749.2018.04.08.22.20.21; Sun, 08 Apr 2018 22:20:57 -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=bUso4Yv5; 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 S1754553AbeDIAV5 (ORCPT + 99 others); Sun, 8 Apr 2018 20:21:57 -0400 Received: from mail-sn1nam02on0123.outbound.protection.outlook.com ([104.47.36.123]:35872 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753163AbeDIAVy (ORCPT ); Sun, 8 Apr 2018 20:21:54 -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=15sbMWLtcuffJKQoULtixh+kYoymTwmogK2MBxtOI6g=; b=bUso4Yv5iSfGyxQ6JOQuhgcSC9/c4gEkAejc1DCsTEoWmrRo3nRnBdPU6smDhfGt5h9KGhuIv5z2e8R9xvYNaGa/SJU012WcweVB4Z7vEfmwDLnCOvaoN1DmaSoC0F/6TJm8syT6sTs585HZV21ur4El67A9rUU5p1x/fRgLr/M= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0936.namprd21.prod.outlook.com (52.132.131.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.3; Mon, 9 Apr 2018 00:21:51 +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:21:51 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Thomas Richter , Heiko Carstens , Martin Schwidefsky , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 186/189] perf test: Fix test trace+probe_libc_inet_pton.sh for s390x Thread-Topic: [PATCH AUTOSEL for 4.15 186/189] perf test: Fix test trace+probe_libc_inet_pton.sh for s390x Thread-Index: AQHTz5hknvSra5ShM06s8q3FJMI0rQ== Date: Mon, 9 Apr 2018 00:19:15 +0000 Message-ID: <20180409001637.162453-186-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;DM5PR2101MB0936;7:Od6eFKTM7WuqPsWM53psgQJ8KPyqhRrRH7JSB5rQS7JknuClG308N6MNUUVz+xEbP++5ZLT7Ou/QF6ORth81Nkzbhkpcu91cMbj1d4KT7S3mw3rprh9l41lQ6KO7mWMOWzQa8Rjjhg/lNHpkXmfXd+IzYrc9taJuKz2RNBfG0z4K0hQuqdmtiOZ+eWNqi6Y1iRqF9FVAkTzZcXW/5Dg/hJTSZgYeJj+vTmziCXjjs2BzeyoHRxi+M9C+MUxQsJuL;20:Wf6rxJVd5Lw/kCfq0bUbVL51HO8uH4gHLs8SN+bMk6I7sWvpTadVk35BiagrBEwtKwd1VzHqLWaWHpsGh5RpdCjKXdZZINs3p8hv6fm9lps2y5GxI/f8ULNixtV4Y9J2ycDnGrT5Oj2dL6lMAfeYhhIsTZuOr+xnoODwFiML5+k= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: f529da2a-6e0d-4e18-ed11-08d59dafe455 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0936; x-ms-traffictypediagnostic: DM5PR2101MB0936: 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)(190383065149520)(42068640409301)(104084551191319); 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)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0936;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0936; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39380400002)(39860400002)(396003)(376002)(366004)(199004)(189003)(3660700001)(36756003)(2501003)(76176011)(10290500003)(2616005)(5250100002)(3280700002)(478600001)(1076002)(72206003)(6436002)(53936002)(486006)(6306002)(476003)(4326008)(6486002)(107886003)(5660300001)(54906003)(110136005)(102836004)(2906002)(6116002)(3846002)(86612001)(81156014)(81166006)(6666003)(8936002)(305945005)(8676002)(2900100001)(6506007)(68736007)(14454004)(106356001)(105586002)(25786009)(966005)(6512007)(86362001)(99286004)(446003)(10090500001)(11346002)(316002)(26005)(7736002)(66066001)(186003)(22452003)(97736004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0936;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: vI81/3Y5w22kjJsK5T2EYZpuDas8/zC0C4Ekyu+9bShIAhePAeuxEYA4fhUmEQMQix+hv2TCLqwe+K6THSe9LWiBj7Mx3U0tRumEmFxo8NgSf+NcVtS1SwvurEp6j1o7GtgD17jEh4quvemyjuu4nYzJUJBbhkGRpKJiWKdMeO6KT61rKqE3Q/Jss2jmTWPjHnXFQFgb0Zb0TC6K8fjNhC07/YCBGQt4SHRLvwHd+HuZF8lv9yELMXhJZJNkcBwljH3WuMDvYWUCW/byI5YXMmNfMHaX7yJbpgdhd4g6YqEQ3xHWGoS9YImpSyhaYHfGF4mA01W0H9q9PZdFrWyGZBtYzicHLwglIdKmt6Uu8HzCtESSQewssn7FTA3u293KK1oWP1PjnjJ8PRgRrUFm83TGDgNVSOaZEpFWXcTSyY8= 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: f529da2a-6e0d-4e18-ed11-08d59dafe455 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:19:15.8299 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0936 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Richter [ Upstream commit 7a92453620d42c3a5fea94a864dc6aa04c262b93 ] On Intel test case trace+probe_libc_inet_pton.sh succeeds and the output is: [root@f27 perf]# ./perf trace --no-syscalls -e probe_libc:inet_pton/max-stack=3D3/ ping -6 -c 1 ::1 PING ::1(::1) 56 data bytes 64 bytes from ::1: icmp_seq=3D1 ttl=3D64 time=3D0.037 ms --- ::1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev =3D 0.037/0.037/0.037/0.000 ms 0.000 probe_libc:inet_pton:(7fa40ac618a0)) __GI___inet_pton (/usr/lib64/libc-2.26.so) getaddrinfo (/usr/lib64/libc-2.26.so) main (/usr/bin/ping) The kernel stack unwinder is used, it is specified implicitly as call-graph=3Dfp (frame pointer). On s390x only dwarf is available for stack unwinding. It is also done in user space. This requires different parameter setup and result checking for s390x and Intel. This patch adds separate perf trace setup and result checking for Intel and s390x. On s390x specify this command line to get a call-graph and handle the different call graph result checking: [root@s35lp76 perf]# ./perf trace --no-syscalls -e probe_libc:inet_pton/call-graph=3Ddwarf/ ping -6 -c 1 ::1 PING ::1(::1) 56 data bytes 64 bytes from ::1: icmp_seq=3D1 ttl=3D64 time=3D0.041 ms --- ::1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev =3D 0.041/0.041/0.041/0.000 ms 0.000 probe_libc:inet_pton:(3ffb9942060)) __GI___inet_pton (/usr/lib64/libc-2.26.so) gaih_inet (inlined) __GI_getaddrinfo (inlined) main (/usr/bin/ping) __libc_start_main (/usr/lib64/libc-2.26.so) _start (/usr/bin/ping) [root@s35lp76 perf]# Before: [root@s8360047 perf]# ./perf test -vv 58 58: probe libc's inet_pton & backtrace it with ping : --- start --- test child forked, pid 26349 PING ::1(::1) 56 data bytes 64 bytes from ::1: icmp_seq=3D1 ttl=3D64 time=3D0.079 ms --- ::1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev =3D 0.079/0.079/0.079/0.000 ms 0.000 probe_libc:inet_pton:(3ff925c2060)) test child finished with -1 ---- end ---- probe libc's inet_pton & backtrace it with ping: FAILED! [root@s8360047 perf]# After: [root@s35lp76 perf]# ./perf test -vv 57 57: probe libc's inet_pton & backtrace it with ping : --- start --- test child forked, pid 38708 PING ::1(::1) 56 data bytes 64 bytes from ::1: icmp_seq=3D1 ttl=3D64 time=3D0.038 ms --- ::1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev =3D 0.038/0.038/0.038/0.000 ms 0.000 probe_libc:inet_pton:(3ff87342060)) __GI___inet_pton (/usr/lib64/libc-2.26.so) gaih_inet (inlined) __GI_getaddrinfo (inlined) main (/usr/bin/ping) __libc_start_main (/usr/lib64/libc-2.26.so) _start (/usr/bin/ping) test child finished with 0 ---- end ---- probe libc's inet_pton & backtrace it with ping: Ok [root@s35lp76 perf]# On Intel the test case runs unchanged and succeeds. Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Tested-by: Arnaldo Carvalho de Melo Cc: Heiko Carstens Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20180117083831.101001-1-tmricht@linux.vnet.i= bm.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- .../perf/tests/shell/trace+probe_libc_inet_pton.sh | 23 +++++++++++++++++-= ---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh b/tools/p= erf/tests/shell/trace+probe_libc_inet_pton.sh index 8b3da21a08f1..c446c894b297 100755 --- a/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh +++ b/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh @@ -22,10 +22,23 @@ trace_libc_inet_pton_backtrace() { expected[4]=3D"rtt min.*" expected[5]=3D"[0-9]+\.[0-9]+[[:space:]]+probe_libc:inet_pton:\([[:xdigit= :]]+\)" expected[6]=3D".*inet_pton[[:space:]]\($libc\)$" - expected[7]=3D"getaddrinfo[[:space:]]\($libc\)$" - expected[8]=3D".*\(.*/bin/ping.*\)$" - - perf trace --no-syscalls -e probe_libc:inet_pton/max-stack=3D3/ ping -6 -= c 1 ::1 2>&1 | grep -v ^$ | while read line ; do + case "$(uname -m)" in + s390x) + eventattr=3D'call-graph=3Ddwarf' + expected[7]=3D"gaih_inet[[:space:]]\(inlined\)$" + expected[8]=3D"__GI_getaddrinfo[[:space:]]\(inlined\)$" + expected[9]=3D"main[[:space:]]\(.*/bin/ping.*\)$" + expected[10]=3D"__libc_start_main[[:space:]]\($libc\)$" + expected[11]=3D"_start[[:space:]]\(.*/bin/ping.*\)$" + ;; + *) + eventattr=3D'max-stack=3D3' + expected[7]=3D"getaddrinfo[[:space:]]\($libc\)$" + expected[8]=3D".*\(.*/bin/ping.*\)$" + ;; + esac + + perf trace --no-syscalls -e probe_libc:inet_pton/$eventattr/ ping -6 -c 1= ::1 2>&1 | grep -v ^$ | while read line ; do echo $line echo "$line" | egrep -q "${expected[$idx]}" if [ $? -ne 0 ] ; then @@ -33,7 +46,7 @@ trace_libc_inet_pton_backtrace() { exit 1 fi let idx+=3D1 - [ $idx -eq 9 ] && break + [ -z "${expected[$idx]}" ] && break done } =20 --=20 2.15.1