Commit 67ef66ba authored by Athira Rajeev's avatar Athira Rajeev Committed by Arnaldo Carvalho de Melo

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: default avatarAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Disha Goel <disgoel@linux.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nageswara R Sastry <rnsastry@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230105121742.92249-1-atrajeev@linux.vnet.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 4e846311
...@@ -917,7 +917,7 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev, ...@@ -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); dinfo = open_debuginfo(pev->target, pev->nsi, !need_dwarf);
if (!dinfo) { if (!dinfo) {
if (need_dwarf) if (need_dwarf)
return -ENOENT; return -ENODATA;
pr_debug("Could not open debuginfo. Try to use symbols.\n"); pr_debug("Could not open debuginfo. Try to use symbols.\n");
return 0; return 0;
} }
...@@ -956,7 +956,7 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev, ...@@ -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. */ if (ntevs == 0) { /* No error but failed to find probe point. */
pr_warning("Probe point '%s' not found.\n", pr_warning("Probe point '%s' not found.\n",
synthesize_perf_probe_point(&pev->point)); synthesize_perf_probe_point(&pev->point));
return -ENOENT; return -ENODEV;
} else if (ntevs < 0) { } else if (ntevs < 0) {
/* Error path : ntevs < 0 */ /* Error path : ntevs < 0 */
pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs); pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment