linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] tools/perf: Update the exit error codes in function try_to_find_probe_trace_event
@ 2023-01-05 12:17 Athira Rajeev
  2023-01-05 12:17 ` [PATCH 2/2] perf test bpf: Skip test if kernel-debuginfo is not present Athira Rajeev
  0 siblings, 1 reply; 6+ messages in thread
From: Athira Rajeev @ 2023-01-05 12:17 UTC (permalink / raw)
  To: acme, jolsa
  Cc: irogers, ak, rnsastry, linux-perf-users, maddy, james.clark,
	kjain, namhyung, disgoel, linuxppc-dev

The function "try_to_find_probe_trace_events" uses return
error code as ENOENT in two places. First place is after
"open_debuginfo" when opening debuginfo fails and secondly,
after when not finding the probe point. This function is
invoked during bpf load and there are other exit points in
this code path which returns ENOENT. This makes it difficult
to understand the exact reason for exit.

Patches changes the exit code from ENOENT to:
- ENODATA when it fails to find debuginfo
- ENODEV when it fails to find probe point

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
---
 tools/perf/util/probe-event.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 0c24bc7afbca..881d94f65a6b 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -917,7 +917,7 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
 	dinfo = open_debuginfo(pev->target, pev->nsi, !need_dwarf);
 	if (!dinfo) {
 		if (need_dwarf)
-			return -ENOENT;
+			return -ENODATA;
 		pr_debug("Could not open debuginfo. Try to use symbols.\n");
 		return 0;
 	}
@@ -956,7 +956,7 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
 	if (ntevs == 0)	{	/* No error but failed to find probe point. */
 		pr_warning("Probe point '%s' not found.\n",
 			   synthesize_perf_probe_point(&pev->point));
-		return -ENOENT;
+		return -ENODEV;
 	} else if (ntevs < 0) {
 		/* Error path : ntevs < 0 */
 		pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] perf test bpf: Skip test if kernel-debuginfo is not present
  2023-01-05 12:17 [PATCH 1/2] tools/perf: Update the exit error codes in function try_to_find_probe_trace_event Athira Rajeev
@ 2023-01-05 12:17 ` Athira Rajeev
  2023-01-05 12:54   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 6+ messages in thread
From: Athira Rajeev @ 2023-01-05 12:17 UTC (permalink / raw)
  To: acme, jolsa
  Cc: irogers, ak, rnsastry, linux-perf-users, maddy, james.clark,
	kjain, namhyung, disgoel, linuxppc-dev

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 subtest, "BPF prologue generation" failed and
logs shows debuginfo is needed. After installing
kernel-debuginfo package, testcase passes.

Subtest "BPF prologue generation" failed because, the "do_test"
function returns "TEST_FAIL" without checking the error type
returned by "parse_events_load_bpf_obj" function.
Function 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: ba1fae431e74 ("perf test: Add 'perf test BPF'")
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
---
Note: This is dependent on patch 1:
 tools/perf: Update the exit error codes in function
 try_to_find_probe_trace_event

 tools/perf/tests/bpf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index 17c023823713..6a4235a9cf57 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
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] perf test bpf: Skip test if kernel-debuginfo is not present
  2023-01-05 12:17 ` [PATCH 2/2] perf test bpf: Skip test if kernel-debuginfo is not present Athira Rajeev
@ 2023-01-05 12:54   ` Arnaldo Carvalho de Melo
  2023-01-09 13:16     ` Athira Rajeev
  2023-02-06 13:58     ` Athira Rajeev
  0 siblings, 2 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-01-05 12:54 UTC (permalink / raw)
  To: Athira Rajeev
  Cc: irogers, ak, rnsastry, linux-perf-users, maddy, james.clark,
	jolsa, kjain, namhyung, disgoel, linuxppc-dev

Em Thu, Jan 05, 2023 at 05:47:42PM +0530, Athira Rajeev escreveu:
> Perf BPF filter test fails in environment where "kernel-debuginfo"
> is not installed.

I'll apply this to perf/core, for the next merge window, as its more an
improvement than a fix, i.e. we know why it fails, we're just improving
the user reporting to make that clear at first sight.

- Arnaldo
 
> 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 subtest, "BPF prologue generation" failed and
> logs shows debuginfo is needed. After installing
> kernel-debuginfo package, testcase passes.
> 
> Subtest "BPF prologue generation" failed because, the "do_test"
> function returns "TEST_FAIL" without checking the error type
> returned by "parse_events_load_bpf_obj" function.
> Function 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: ba1fae431e74 ("perf test: Add 'perf test BPF'")
> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
> ---
> Note: This is dependent on patch 1:
>  tools/perf: Update the exit error codes in function
>  try_to_find_probe_trace_event
> 
>  tools/perf/tests/bpf.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
> index 17c023823713..6a4235a9cf57 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
> -- 
> 2.31.1

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] perf test bpf: Skip test if kernel-debuginfo is not present
  2023-01-05 12:54   ` Arnaldo Carvalho de Melo
@ 2023-01-09 13:16     ` Athira Rajeev
  2023-02-06 13:58     ` Athira Rajeev
  1 sibling, 0 replies; 6+ messages in thread
From: Athira Rajeev @ 2023-01-09 13:16 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ian Rogers, Andi Kleen, Nageswara Sastry, kjain,
	linux-perf-users, maddy, james.clark, jolsa, namhyung, disgoel,
	linuxppc-dev



> On 05-Jan-2023, at 6:24 PM, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
> Em Thu, Jan 05, 2023 at 05:47:42PM +0530, Athira Rajeev escreveu:
>> Perf BPF filter test fails in environment where "kernel-debuginfo"
>> is not installed.
> 
> I'll apply this to perf/core, for the next merge window, as its more an
> improvement than a fix, i.e. we know why it fails, we're just improving
> the user reporting to make that clear at first sight.
> 
> - Arnaldo

Hi Arnaldo,

Sure, Thanks for checking

Athira
> 
>> 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 subtest, "BPF prologue generation" failed and
>> logs shows debuginfo is needed. After installing
>> kernel-debuginfo package, testcase passes.
>> 
>> Subtest "BPF prologue generation" failed because, the "do_test"
>> function returns "TEST_FAIL" without checking the error type
>> returned by "parse_events_load_bpf_obj" function.
>> Function 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: ba1fae431e74 ("perf test: Add 'perf test BPF'")
>> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
>> ---
>> Note: This is dependent on patch 1:
>> tools/perf: Update the exit error codes in function
>> try_to_find_probe_trace_event
>> 
>> tools/perf/tests/bpf.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>> 
>> diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
>> index 17c023823713..6a4235a9cf57 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
>> -- 
>> 2.31.1
> 
> -- 
> 
> - Arnaldo


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] perf test bpf: Skip test if kernel-debuginfo is not present
  2023-01-05 12:54   ` Arnaldo Carvalho de Melo
  2023-01-09 13:16     ` Athira Rajeev
@ 2023-02-06 13:58     ` Athira Rajeev
  2023-02-06 18:10       ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 6+ messages in thread
From: Athira Rajeev @ 2023-02-06 13:58 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ian Rogers, Andi Kleen, Nageswara Sastry, linux-perf-users,
	maddy, James Clark, Jiri Olsa, Kajol Jain, Namhyung Kim, disgoel,
	linuxppc-dev



> On 05-Jan-2023, at 6:24 PM, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
> Em Thu, Jan 05, 2023 at 05:47:42PM +0530, Athira Rajeev escreveu:
>> Perf BPF filter test fails in environment where "kernel-debuginfo"
>> is not installed.
> 
> I'll apply this to perf/core, for the next merge window, as its more an
> improvement than a fix, i.e. we know why it fails, we're just improving
> the user reporting to make that clear at first sight.
> 
> - Arnaldo
> 

Hi Arnaldo,

Just wanted to check when we can have these two patches in perf/core.
I didn't find these in https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/?h=tmp.perf/core
Not sure if I missed.

Thanks
Athira

>> 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 subtest, "BPF prologue generation" failed and
>> logs shows debuginfo is needed. After installing
>> kernel-debuginfo package, testcase passes.
>> 
>> Subtest "BPF prologue generation" failed because, the "do_test"
>> function returns "TEST_FAIL" without checking the error type
>> returned by "parse_events_load_bpf_obj" function.
>> Function 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: ba1fae431e74 ("perf test: Add 'perf test BPF'")
>> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
>> ---
>> Note: This is dependent on patch 1:
>> tools/perf: Update the exit error codes in function
>> try_to_find_probe_trace_event
>> 
>> tools/perf/tests/bpf.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>> 
>> diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
>> index 17c023823713..6a4235a9cf57 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
>> -- 
>> 2.31.1
> 
> -- 
> 
> - Arnaldo


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] perf test bpf: Skip test if kernel-debuginfo is not present
  2023-02-06 13:58     ` Athira Rajeev
@ 2023-02-06 18:10       ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-02-06 18:10 UTC (permalink / raw)
  To: Athira Rajeev
  Cc: Ian Rogers, Andi Kleen, Nageswara Sastry, linux-perf-users,
	maddy, James Clark, Jiri Olsa, Kajol Jain, Namhyung Kim, disgoel,
	linuxppc-dev

Em Mon, Feb 06, 2023 at 07:28:49PM +0530, Athira Rajeev escreveu:
> 
> 
> > On 05-Jan-2023, at 6:24 PM, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > 
> > Em Thu, Jan 05, 2023 at 05:47:42PM +0530, Athira Rajeev escreveu:
> >> Perf BPF filter test fails in environment where "kernel-debuginfo"
> >> is not installed.
> > 
> > I'll apply this to perf/core, for the next merge window, as its more an
> > improvement than a fix, i.e. we know why it fails, we're just improving
> > the user reporting to make that clear at first sight.
> > 
> > - Arnaldo
> > 
> 
> Hi Arnaldo,
> 
> Just wanted to check when we can have these two patches in perf/core.
> I didn't find these in https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/?h=tmp.perf/core
> Not sure if I missed.

Thanks for the reminder, applied those now.

- Arnaldo
 
> Thanks
> Athira
> 
> >> 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 subtest, "BPF prologue generation" failed and
> >> logs shows debuginfo is needed. After installing
> >> kernel-debuginfo package, testcase passes.
> >> 
> >> Subtest "BPF prologue generation" failed because, the "do_test"
> >> function returns "TEST_FAIL" without checking the error type
> >> returned by "parse_events_load_bpf_obj" function.
> >> Function 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: ba1fae431e74 ("perf test: Add 'perf test BPF'")
> >> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
> >> ---
> >> Note: This is dependent on patch 1:
> >> tools/perf: Update the exit error codes in function
> >> try_to_find_probe_trace_event
> >> 
> >> tools/perf/tests/bpf.c | 6 +++++-
> >> 1 file changed, 5 insertions(+), 1 deletion(-)
> >> 
> >> diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
> >> index 17c023823713..6a4235a9cf57 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
> >> -- 
> >> 2.31.1
> > 
> > -- 
> > 
> > - Arnaldo
> 

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-06 18:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-05 12:17 [PATCH 1/2] tools/perf: Update the exit error codes in function try_to_find_probe_trace_event Athira Rajeev
2023-01-05 12:17 ` [PATCH 2/2] perf test bpf: Skip test if kernel-debuginfo is not present Athira Rajeev
2023-01-05 12:54   ` Arnaldo Carvalho de Melo
2023-01-09 13:16     ` Athira Rajeev
2023-02-06 13:58     ` Athira Rajeev
2023-02-06 18:10       ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).