Patch "perf test bpf: Skip test if kernel-debuginfo is not present" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    perf test bpf: Skip test if kernel-debuginfo is not present

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-test-bpf-skip-test-if-kernel-debuginfo-is-not-p.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a398defc4c1e86e5935c5fc398aa11171b814133
Author: Athira Rajeev <atrajeev@xxxxxxxxxxxxxxxxxx>
Date:   Thu Jan 5 17:47:42 2023 +0530

    perf test bpf: Skip test if kernel-debuginfo is not present
    
    [ Upstream commit 34266f904abd45731bdade2e92d0536c092ee9bc ]
    
    Perf BPF filter test fails in environment where "kernel-debuginfo"
    is not installed.
    
    Test failure logs:
    
      <<>>
      42: BPF filter                            :
      42.1: Basic BPF filtering                 : Ok
      42.2: BPF pinning                         : Ok
      42.3: BPF prologue generation             : FAILED!
      <<>>
    
    Enabling verbose option provided debug logs, which says debuginfo
    needs to be installed. Snippet of verbose logs:
    
      <<>>
      42.3: BPF prologue generation                                       :
      --- start ---
      test child forked, pid 28218
      <<>>
      Rebuild with CONFIG_DEBUG_INFO=y, or install an appropriate debuginfo
      package.
      bpf_probe: failed to convert perf probe events
      Failed to add events selected by BPF
      test child finished with -1
      ---- end ----
      BPF filter subtest 3: FAILED!
      <<>>
    
    Here the subtest "BPF prologue generation" failed and logs shows
    debuginfo is needed. After installing kernel-debuginfo package, testcase
    passes.
    
    The "BPF prologue generation" subtest failed because, the do_test()
    returns TEST_FAIL without checking the error type returned by
    parse_events_load_bpf_obj().
    
    parse_events_load_bpf_obj() can also return error of type -ENODATA
    incase kernel-debuginfo package is not installed. Fix this by adding
    check for -ENODATA error.
    
    Test result after the patch changes:
    
    Test failure logs:
    
      <<>>
      42: BPF filter                 :
      42.1: Basic BPF filtering      : Ok
      42.2: BPF pinning              : Ok
      42.3: BPF prologue generation  : Skip (clang/debuginfo isn't installed or environment missing BPF support)
      <<>>
    
    Fixes: ba1fae431e74bb42 ("perf test: Add 'perf test BPF'")
    Signed-off-by: Athira Rajeev <atrajeev@xxxxxxxxxxxxxxxxxx>
    Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
    Cc: Disha Goel <disgoel@xxxxxxxxxxxxx>
    Cc: Ian Rogers <irogers@xxxxxxxxxx>
    Cc: James Clark <james.clark@xxxxxxx>
    Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
    Cc: Kajol Jain <kjain@xxxxxxxxxxxxx>
    Cc: Madhavan Srinivasan <maddy@xxxxxxxxxxxxxxxxxx>
    Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
    Cc: Nageswara R Sastry <rnsastry@xxxxxxxxxxxxx>
    Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
    Cc: Wang Nan <wangnan0@xxxxxxxxxx>
    Cc: linuxppc-dev@xxxxxxxxxxxxxxxx
    Link: http://lore.kernel.org/linux-perf-users/Y7bIk77mdE4j8Jyi@xxxxxxxxxx
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index 17c023823713d..6a4235a9cf57e 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -126,6 +126,10 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 
 	err = parse_events_load_bpf_obj(&parse_state, &parse_state.list, obj, NULL);
 	parse_events_error__exit(&parse_error);
+	if (err == -ENODATA) {
+		pr_debug("Failed to add events selected by BPF, debuginfo package not installed\n");
+		return TEST_SKIP;
+	}
 	if (err || list_empty(&parse_state.list)) {
 		pr_debug("Failed to add events selected by BPF\n");
 		return TEST_FAIL;
@@ -368,7 +372,7 @@ static struct test_case bpf_tests[] = {
 			"clang isn't installed or environment missing BPF support"),
 #ifdef HAVE_BPF_PROLOGUE
 	TEST_CASE_REASON("BPF prologue generation", bpf_prologue_test,
-			"clang isn't installed or environment missing BPF support"),
+			"clang/debuginfo isn't installed or environment missing BPF support"),
 #else
 	TEST_CASE_REASON("BPF prologue generation", bpf_prologue_test, "not compiled in"),
 #endif



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux