aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-record.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index d7ebbd757543..9b899ba1b410 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -306,12 +306,11 @@ static void pid_synthesize_mmap_samples(pid_t pid)
306 continue; 306 continue;
307 pbf += n + 3; 307 pbf += n + 3;
308 if (*pbf == 'x') { /* vm_exec */ 308 if (*pbf == 'x') { /* vm_exec */
309 char *execname = strrchr(bf, ' '); 309 char *execname = strchr(bf, '/');
310 310
311 if (execname == NULL || execname[1] != '/') 311 if (execname == NULL)
312 continue; 312 continue;
313 313
314 execname += 1;
315 size = strlen(execname); 314 size = strlen(execname);
316 execname[size - 1] = '\0'; /* Remove \n */ 315 execname[size - 1] = '\0'; /* Remove \n */
317 memcpy(mmap_ev.filename, execname, size); 316 memcpy(mmap_ev.filename, execname, size);