diff options
author | Steve MacLean <Steve.MacLean@microsoft.com> | 2019-09-27 21:41:18 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-09-30 16:29:49 -0400 |
commit | b59711e9b0d22fd47abfa00602fd8c365cdd3ab7 (patch) | |
tree | 30ccf11afb268d5865865cb4730b71ad75830b3a /tools | |
parent | ee212d6ea20887c0ef352be8563ca13dbf965906 (diff) |
perf inject jit: Fix JIT_CODE_MOVE filename
During perf inject --jit, JIT_CODE_MOVE records were injecting MMAP records
with an incorrect filename. Specifically it was missing the ".so" suffix.
Further the JIT_CODE_LOAD record were silently truncating the
jr->load.code_index field to 32 bits before generating the filename.
Make both records emit the same filename based on the full 64 bit
code_index field.
Fixes: 9b07e27f88b9 ("perf inject: Add jitdump mmap injection support")
Cc: stable@vger.kernel.org # v4.6+
Signed-off-by: Steve MacLean <Steve.MacLean@Microsoft.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Brian Robbins <brianrob@microsoft.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Eric Saint-Etienne <eric.saint.etienne@oracle.com>
Cc: John Keeping <john@metanate.com>
Cc: John Salem <josalem@microsoft.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom McDonald <thomas.mcdonald@microsoft.com>
Link: http://lore.kernel.org/lkml/BN8PR21MB1362FF8F127B31DBF4121528F7800@BN8PR21MB1362.namprd21.prod.outlook.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/jitdump.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c index 1bdf4c6ea3e5..e3ccb0ce1938 100644 --- a/tools/perf/util/jitdump.c +++ b/tools/perf/util/jitdump.c | |||
@@ -395,7 +395,7 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr) | |||
395 | size_t size; | 395 | size_t size; |
396 | u16 idr_size; | 396 | u16 idr_size; |
397 | const char *sym; | 397 | const char *sym; |
398 | uint32_t count; | 398 | uint64_t count; |
399 | int ret, csize, usize; | 399 | int ret, csize, usize; |
400 | pid_t pid, tid; | 400 | pid_t pid, tid; |
401 | struct { | 401 | struct { |
@@ -418,7 +418,7 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr) | |||
418 | return -1; | 418 | return -1; |
419 | 419 | ||
420 | filename = event->mmap2.filename; | 420 | filename = event->mmap2.filename; |
421 | size = snprintf(filename, PATH_MAX, "%s/jitted-%d-%u.so", | 421 | size = snprintf(filename, PATH_MAX, "%s/jitted-%d-%" PRIu64 ".so", |
422 | jd->dir, | 422 | jd->dir, |
423 | pid, | 423 | pid, |
424 | count); | 424 | count); |
@@ -529,7 +529,7 @@ static int jit_repipe_code_move(struct jit_buf_desc *jd, union jr_entry *jr) | |||
529 | return -1; | 529 | return -1; |
530 | 530 | ||
531 | filename = event->mmap2.filename; | 531 | filename = event->mmap2.filename; |
532 | size = snprintf(filename, PATH_MAX, "%s/jitted-%d-%"PRIu64, | 532 | size = snprintf(filename, PATH_MAX, "%s/jitted-%d-%" PRIu64 ".so", |
533 | jd->dir, | 533 | jd->dir, |
534 | pid, | 534 | pid, |
535 | jr->move.code_index); | 535 | jr->move.code_index); |