{"thread":{"id":"60037","subject":"[PATCH] perf probe: skip test_uprobe_from_different_cu if there is no gcc","startedAt":"2023-07-28T14:55:05Z","lastAt":"2023-07-28T15:13:41Z","messageCount":2,"participants":["Georg Müller"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"479966","messageId":"20230728145305.449904-2-georgmueller@gmx.net","threadId":"60037","inReplyTo":null,"subject":"[PATCH] perf probe: skip test_uprobe_from_different_cu if there is no gcc","fromName":"Georg Müller","fromEmail":"georgmueller@gmx.net","sentAt":"2023-07-28T14:52:58Z","receivedAt":"2023-07-28T14:55:05Z","isPatch":true,"sender":{"key":"georgmueller@gmx.net","avatar":null},"body":"Without gcc, the test will fail.\n\nOn cleanup, ignore probe removal errors. Otherwise, in case of an error\nadding the probe, the temporary directory is not removed.\n\nFixes: 56cbeacf1435 (\"perf probe: Add test for regression introduced by switch to die_get_decl_file()\")\nCc: Arnaldo Carvalho de Melo <acme@redhat.com>\nCc: Masami Hiramatsu (Google) <mhiramat@kernel.org>\nCc: Adrian Hunter <adrian.hunter@intel.com>\nCc: Alexander Shishkin <alexander.shishkin@linux.intel.com>\nCc: Ian Rogers <irogers@google.com>\nCc: Ingo Molnar <mingo@redhat.com>\nCc: Jiri Olsa <jolsa@kernel.org>\nCc: Mark Rutland <mark.rutland@arm.com>\nCc: Namhyung Kim <namhyung@kernel.org>\nCc: Peter Zijlstra <peterz@infradead.org>\nSigned-off-by: Georg Müller <georgmueller@gmx.net>\nLink: https://lore.kernel.org/r/CAP-5=fUP6UuLgRty3t2=fQsQi3k4hDMz415vWdp1x88QMvZ8ug@mail.gmail.com/\n---\n tools/perf/tests/shell/test_uprobe_from_different_cu.sh | 8 +++++++-\n 1 file changed, 7 insertions(+), 1 deletion(-)\n\ndiff --git a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh\nindex 00d2e0e2e0c2..319f36ebb9a4 100755\n--- a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh\n+++ b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh\n@@ -4,6 +4,12 @@\n\n set -e\n\n+# skip if there's no gcc\n+if ! [ -x \"$(command -v gcc)\" ]; then\n+        echo \"failed: no gcc compiler\"\n+        exit 2\n+fi\n+\n temp_dir=$(mktemp -d /tmp/perf-uprobe-different-cu-sh.XXXXXXXXXX)\n\n cleanup()\n@@ -11,7 +17,7 @@ cleanup()\n \ttrap - EXIT TERM INT\n \tif [[ \"${temp_dir}\" =~ ^/tmp/perf-uprobe-different-cu-sh.*$ ]]; then\n \t\techo \"--- Cleaning up ---\"\n-\t\tperf probe -x ${temp_dir}/testfile -d foo\n+\t\tperf probe -x ${temp_dir}/testfile -d foo || true\n \t\trm -f \"${temp_dir}/\"*\n \t\trmdir \"${temp_dir}\"\n \tfi\n--\n2.41.0\n\n"},{"id":"479968","messageId":"e52ab62e-935a-358d-4728-afaf070a7d27@gmx.net","threadId":"60037","inReplyTo":"20230728145305.449904-2-georgmueller@gmx.net","subject":"Re: [PATCH] perf probe: skip test_uprobe_from_different_cu if there is no gcc","fromName":"Georg Müller","fromEmail":"georgmueller@gmx.net","sentAt":"2023-07-28T15:13:36Z","receivedAt":"2023-07-28T15:13:41Z","isPatch":true,"sender":{"key":"georgmueller@gmx.net","avatar":null},"body":"Sorry, wrong list... :(\n\nAm 28.07.23 um 16:52 schrieb Georg Müller:\n> Without gcc, the test will fail.\n>\n> On cleanup, ignore probe removal errors. Otherwise, in case of an error\n> adding the probe, the temporary directory is not removed.\n>\n> Fixes: 56cbeacf1435 (\"perf probe: Add test for regression introduced by switch to die_get_decl_file()\")\n> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>\n> Cc: Masami Hiramatsu (Google) <mhiramat@kernel.org>\n> Cc: Adrian Hunter <adrian.hunter@intel.com>\n> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>\n> Cc: Ian Rogers <irogers@google.com>\n> Cc: Ingo Molnar <mingo@redhat.com>\n> Cc: Jiri Olsa <jolsa@kernel.org>\n> Cc: Mark Rutland <mark.rutland@arm.com>\n> Cc: Namhyung Kim <namhyung@kernel.org>\n> Cc: Peter Zijlstra <peterz@infradead.org>\n> Signed-off-by: Georg Müller <georgmueller@gmx.net>\n> Link: https://lore.kernel.org/r/CAP-5=fUP6UuLgRty3t2=fQsQi3k4hDMz415vWdp1x88QMvZ8ug@mail.gmail.com/\n> ---\n>   tools/perf/tests/shell/test_uprobe_from_different_cu.sh | 8 +++++++-\n>   1 file changed, 7 insertions(+), 1 deletion(-)\n>\n> diff --git a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh\n> index 00d2e0e2e0c2..319f36ebb9a4 100755\n> --- a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh\n> +++ b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh\n> @@ -4,6 +4,12 @@\n>\n>   set -e\n>\n> +# skip if there's no gcc\n> +if ! [ -x \"$(command -v gcc)\" ]; then\n> +        echo \"failed: no gcc compiler\"\n> +        exit 2\n> +fi\n> +\n>   temp_dir=$(mktemp -d /tmp/perf-uprobe-different-cu-sh.XXXXXXXXXX)\n>\n>   cleanup()\n> @@ -11,7 +17,7 @@ cleanup()\n>   \ttrap - EXIT TERM INT\n>   \tif [[ \"${temp_dir}\" =~ ^/tmp/perf-uprobe-different-cu-sh.*$ ]]; then\n>   \t\techo \"--- Cleaning up ---\"\n> -\t\tperf probe -x ${temp_dir}/testfile -d foo\n> +\t\tperf probe -x ${temp_dir}/testfile -d foo || true\n>   \t\trm -f \"${temp_dir}/\"*\n>   \t\trmdir \"${temp_dir}\"\n>   \tfi\n> --\n> 2.41.0\n>\n"}]}