diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 1c4a20a284c0688f61cf18f4c13d039661da0973..6d438391bae58d501a9d0f651e3685d9ffdd87eb 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -806,12 +806,12 @@ static char *synthesize_perf_probe_point(struct perf_probe_point *pp) goto error; } if (pp->file) { - len = strlen(pp->file) - 32; + len = strlen(pp->file) - 31; if (len < 0) len = 0; tmp = strchr(pp->file + len, '/'); if (!tmp) - tmp = pp->file + len - 1; + tmp = pp->file + len; ret = e_snprintf(file, 32, "@%s", tmp + 1); if (ret <= 0) goto error;