Skip to content

Commit 67ef66b

Browse files
athira-rajeevacmel
authored andcommitted
perf probe: Update the exit error codes in function try_to_find_probe_trace_event
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 <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Disha Goel <[email protected]> Cc: Ian Rogers <[email protected]> Cc: James Clark <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kajol Jain <[email protected]> Cc: Madhavan Srinivasan <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Nageswara R Sastry <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 4e84631 commit 67ef66b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/perf/util/probe-event.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
917917
dinfo = open_debuginfo(pev->target, pev->nsi, !need_dwarf);
918918
if (!dinfo) {
919919
if (need_dwarf)
920-
return -ENOENT;
920+
return -ENODATA;
921921
pr_debug("Could not open debuginfo. Try to use symbols.\n");
922922
return 0;
923923
}
@@ -956,7 +956,7 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
956956
if (ntevs == 0) { /* No error but failed to find probe point. */
957957
pr_warning("Probe point '%s' not found.\n",
958958
synthesize_perf_probe_point(&pev->point));
959-
return -ENOENT;
959+
return -ENODEV;
960960
} else if (ntevs < 0) {
961961
/* Error path : ntevs < 0 */
962962
pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs);

0 commit comments

Comments
 (0)