]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
perf test: Use shelldir to refer perf source location
authorNamhyung Kim <namhyung@kernel.org>
Fri, 19 Dec 2025 01:18:18 +0000 (17:18 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 13 Jan 2026 20:21:39 +0000 (17:21 -0300)
It uses tools/perf/include which assumes it's running from the root of
the linux kernel source tree.  But you can run perf from other places
like tools/perf, then the include path won't match.  We can use the
shelldir variable to locate the test script in the tree.

  $ cd tools/perf

  $ ./perf test dlfilter
   63: dlfilter C API                                                  : Ok
  101: perf script --dlfilter tests                                    : Ok

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/shell/script_dlfilter.sh

index 7895ab0309b29dd5f082296c43ee580394cff2a4..aaed92bb78285dfdc233eba98e0bda2b55071600 100755 (executable)
@@ -68,7 +68,7 @@ test_dlfilter() {
        fi
 
        # Build the dlfilter
-       if ! cc -c -I tools/perf/include -fpic -x c "${dlfilter_c}" -o "${dlfilter_so}.o"
+       if ! cc -c -I ${shelldir}/../../include -fpic -x c "${dlfilter_c}" -o "${dlfilter_so}.o"
        then
                echo "Basic --dlfilter test [Skip - failed to build dlfilter object]"
                err=2