Message ID | 20230728151812.454806-2-georgmueller@gmx.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp556602vqg; Fri, 28 Jul 2023 09:37:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlHCuG5wgdLeHC/LQyQ2vMUl5p11Bd4sI8SBkLfPqOs/2IWpK8pgsxpdmionuKqyzrM2o3va X-Received: by 2002:a05:6a00:35cf:b0:67c:db:c2f4 with SMTP id dc15-20020a056a0035cf00b0067c00dbc2f4mr3187471pfb.4.1690562270780; Fri, 28 Jul 2023 09:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690562270; cv=none; d=google.com; s=arc-20160816; b=xexbFm/dbxMWqKTj9+VH2+CWlv9h4hyks/4eBFjcwRS0kwlpTOZibnMEqgwAYCTFQy C6yKsGKOawejXtv5fIlhhVqW5xg89hoE+FdsCBOWpmEXqldYCr8gO+n2No/pXXKkVUou vvI9PcIuZuHS6cAKd5z5ZXP/PlDj5vfVFqzo6oUXZQkTORlL3qyU6iRcNxjt3Qes6Hpc U+0eSyepuLL44cal+t0hLJMYmnxqOtoWlmJBm/rabaRe73yqzUp7vz6UqXFBVWII094j CDsKJUk5soavIfIgWG2iGPRPvuq1L4dQhQpHKhqPkmMrUHhA+Fch9iaAvpPcumd3wr3z DaFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=BD5oG/NsGgYqbZnGlD54NtVkaMdU5cZGOY0jri/4JJg=; fh=QxCCB1hveNYOEJbFniAtSvxpHpqVZlvIwNrM1UrP0Qs=; b=B1QMt85CNTv/NAUEBqNQ/NCKfyiHwLfOdzEyW/UMi4JgGGvAblJphFOnHhJv8WkIU6 maPoiIOb2dAac0Vwv9x8JHdyMOh5sMAKMSTt9OuG2E2Tnl7e3Rg12AZe4E8lMMnyt1bt 2v6enxg5fL7D0SvvMEpeyOdnj8IujG0965cxfXkHic4kMCXv22wWsRmEmblSyotx2om5 RAwUkJ63ZzTgitoDSxdTHHjcun+BR5NYPHWu5xwuQqFC4Pg/Fq2/0/O1jMTm7ILYzxjv +QxRvUDJ0h0qYGUNnBwMgSuxIEFwOLnGna/ydmN12lX7w9+PpiBF79CYoQHkgj/1ARO6 FHXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=s31663417 header.b=Au1ml8XD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmx.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q1-20020a056a00150100b00682759c6440si3479924pfu.40.2023.07.28.09.37.37; Fri, 28 Jul 2023 09:37:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=s31663417 header.b=Au1ml8XD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmx.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236527AbjG1PUG (ORCPT <rfc822;hanasaki@gmail.com> + 99 others); Fri, 28 Jul 2023 11:20:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233675AbjG1PUE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 28 Jul 2023 11:20:04 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2371F3580; Fri, 28 Jul 2023 08:20:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1690557577; x=1691162377; i=georgmueller@gmx.net; bh=b3jqgX/FTTLcKkdYTNRXpA+IdOm+qzwJHmsQNLmI1uU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=Au1ml8XDHLXynrUV8DlBalRIcMriKlIfa/JY3oyDsDRFUxYctTyvfFHyTLbqPWP86nQQMRJ sfG0BqIZUF/jauJ0nTh+EGXtvpokFemJSvMxczmd4WN0ChWlD95XFPyOs5U5inK1j8oeew52R I9KfFimeUTO9opBX04yXYfP4Xam97NCwylY2Uzm/LI+Jmz1uh7RI8RmYA9ifgZTVTAkQk08KT oJpff1BuuxwddxcxkqdVmeXJlE3p2FuorJRHToTjSN6qKLNnqeUxwmlgKtu2asdTfcJXZOptL hd0Ms6xR0vrIpF0U58drb8PbwoqnJmBLrfRHqjsCwOPX53bhptEQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from nb-georg.intra.allegro-packets.com ([79.246.95.128]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MNKhm-1qDlUR1VOM-00OmRl; Fri, 28 Jul 2023 17:19:37 +0200 From: =?utf-8?q?Georg_M=C3=BCller?= <georgmueller@gmx.net> To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, =?utf-8?q?Georg_M=C3=BCller?= <georgmueller@gmx.net>, "Masami Hiramatsu (Google)" <mhiramat@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] perf probe: skip test_uprobe_from_different_cu if there is no gcc Date: Fri, 28 Jul 2023 17:18:12 +0200 Message-ID: <20230728151812.454806-2-georgmueller@gmx.net> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:k9aWZpPGLTw7RvMYEc6PyMQraGPcqSqMmqLsqlB27y8SL4tymPT 4U0T4Z0aLLKEDVa5w8FH396x9LvRJwJNSpciBAKf+smlTwcjvoppabzCjWFwduTB1ene+cD 7aYLRhREyOqFjQtlt1F1oXKFIhqRTK1MhVjnP2xBN8UhraMAR0xL8y1ktYZ5MPjs/P3yTIU ho0krwrrCfC71WAFAOyiw== UI-OutboundReport: notjunk:1;M01:P0:6l98EEo7XGA=;nrweatGZcCzoena6WSFTgnmI6zm F9e3quy9tezodLsvqxrCn68geGjN+MWnDI+XiK3NSSVumYveNNgEykIEsiqbgilNeFeviOy5P NdbSB+GZRGHN3Iyu0ZxQg/9U5SZxLr6wmH8Z8ZRoDqmwzb2R1j5n003tJCerNbhgumgEzVSI4 eQHj5heFbOc3Civb0Nk1KYsCMdVbYk0yJofhPtxZzzFDO424mQt+LssqPard6Vqnvz4Y4iwoc vU5z8MoAFAJ53nM6ozjbvfEJNu7qPVwAoDSrH3pwsx+Aj5i6wfuxR4rEZQ7zsM7zbtFG9M2dB Wa8Y/YTZGxPdsTnSFj93I1SBM2/aVLwMWWy/ZqO0bCLsBKI1qsy0Mclb0CsoxewMIQ20zN35G yoaLIRT11vGAaiVKRp3FLC/7ytcno/xpxZFOhBVI3u0uhaUgBtl7o8qZvNK+HomaOm+oHHhzV Lnr2c4k51VmWOY/+/BRxUqVSKfrCGj+tRLHfipUt/WE5lNgxdGGiLCI4H0SizIZgv9jNjc7Ew ZllJ8NHuiAplGyh0plH+3VCDzlmr8fVAEUkjdIn4hgtl4cNU+p0lnqN5DgWbaLJ/YntuJ6/q8 gmZMK2ke8hMmfeO7hPWHgQbdRJ0JmEVB7nsRRBGqv3h9MocJHvoi1pz0sjCmEsDtD8+FVjNQJ 7yuo9NEmuBJBBfYW/LrZP4F9RRZNdyj1ch37n1J+0oquHdAhzQoR85wKyproFd1akHsUO266m dy3wTk8eWKY/kTS+62+yvQxKPFpakdQ9ec9POz1GwIKkpGa7POUot9Uni5QFHGKrYgKhVLg0x t5ZEt0cwxyGL/NF//7E7JBn7dZfYKnZwcTV7oaZet+LnlxCNAMlcINrjbXaWYam90zCxVFAkL 8NFCaN05zAJVP4qHJL3FFox6BQcwcDNwhSzo/yYBbLnXJeq1cE1tBAWL4zsNH+Lxq5sydponE 0c8WIw== X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772682986690443453 X-GMAIL-MSGID: 1772683023746783834 |
Series |
perf probe: skip test_uprobe_from_different_cu if there is no gcc
|
|
Commit Message
Georg Müller
July 28, 2023, 3:18 p.m. UTC
Without gcc, the test will fail.
On cleanup, ignore probe removal errors. Otherwise, in case of an error
adding the probe, the temporary directory is not removed.
Fixes: 56cbeacf1435 ("perf probe: Add test for regression introduced by switch to die_get_decl_file()")
Signed-off-by: Georg Müller <georgmueller@gmx.net>
Link: https://lore.kernel.org/r/CAP-5=fUP6UuLgRty3t2=fQsQi3k4hDMz415vWdp1x88QMvZ8ug@mail.gmail.com/
---
tools/perf/tests/shell/test_uprobe_from_different_cu.sh | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--
2.41.0
Comments
On Fri, 28 Jul 2023 17:18:12 +0200 Georg Müller <georgmueller@gmx.net> wrote: > Without gcc, the test will fail. > > On cleanup, ignore probe removal errors. Otherwise, in case of an error > adding the probe, the temporary directory is not removed. Interesting, so clang will not generate DWARF or perf probe is not able to handle clang generated DWARF? Anyway, this looks good to me. Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> > > Fixes: 56cbeacf1435 ("perf probe: Add test for regression introduced by switch to die_get_decl_file()") > Signed-off-by: Georg Müller <georgmueller@gmx.net> > Link: https://lore.kernel.org/r/CAP-5=fUP6UuLgRty3t2=fQsQi3k4hDMz415vWdp1x88QMvZ8ug@mail.gmail.com/ > --- > tools/perf/tests/shell/test_uprobe_from_different_cu.sh | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh > index 00d2e0e2e0c2..319f36ebb9a4 100755 > --- a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh > +++ b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh > @@ -4,6 +4,12 @@ > > set -e > > +# skip if there's no gcc > +if ! [ -x "$(command -v gcc)" ]; then > + echo "failed: no gcc compiler" > + exit 2 > +fi > + > temp_dir=$(mktemp -d /tmp/perf-uprobe-different-cu-sh.XXXXXXXXXX) > > cleanup() > @@ -11,7 +17,7 @@ cleanup() > trap - EXIT TERM INT > if [[ "${temp_dir}" =~ ^/tmp/perf-uprobe-different-cu-sh.*$ ]]; then > echo "--- Cleaning up ---" > - perf probe -x ${temp_dir}/testfile -d foo > + perf probe -x ${temp_dir}/testfile -d foo || true > rm -f "${temp_dir}/"* > rmdir "${temp_dir}" > fi > -- > 2.41.0 >
Am 29.07.23 um 02:38 schrieb Masami Hiramatsu (Google): > > Interesting, so clang will not generate DWARF or perf probe is not able to > handle clang generated DWARF? > clang does not accept mixed -flto and non-lto CUs and the problem is not reproducible by this sample code using clang if using -flto for all CUs. There might be (bigger?) examples where the same issue is triggered by clang and bigger examples (like systemd on fedora) where I ran into the bug, but this small example only shows the problem when using gcc and mixing -flto and non-lto CUs.
On Sat, 29 Jul 2023 12:59:50 +0200 Georg Müller <georgmueller@gmx.net> wrote: > > Am 29.07.23 um 02:38 schrieb Masami Hiramatsu (Google): > > > > Interesting, so clang will not generate DWARF or perf probe is not able to > > handle clang generated DWARF? > > > > clang does not accept mixed -flto and non-lto CUs and the problem is not > reproducible by this sample code using clang if using -flto for all CUs. > There might be (bigger?) examples where the same issue is triggered by > clang and bigger examples (like systemd on fedora) where I ran into the > bug, but this small example only shows the problem when using gcc and > mixing -flto and non-lto CUs. Thanks for the explanation! So the problem will be in the compiler side (and maybe fixed when it is updated.) Thank you,
diff --git a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh index 00d2e0e2e0c2..319f36ebb9a4 100755 --- a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh +++ b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh @@ -4,6 +4,12 @@ set -e +# skip if there's no gcc +if ! [ -x "$(command -v gcc)" ]; then + echo "failed: no gcc compiler" + exit 2 +fi + temp_dir=$(mktemp -d /tmp/perf-uprobe-different-cu-sh.XXXXXXXXXX) cleanup() @@ -11,7 +17,7 @@ cleanup() trap - EXIT TERM INT if [[ "${temp_dir}" =~ ^/tmp/perf-uprobe-different-cu-sh.*$ ]]; then echo "--- Cleaning up ---" - perf probe -x ${temp_dir}/testfile -d foo + perf probe -x ${temp_dir}/testfile -d foo || true rm -f "${temp_dir}/"* rmdir "${temp_dir}" fi