aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorStefano Sanfilippo <ssanfilippo@chromium.org>2016-10-13 06:59:38 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-10-24 10:07:38 -0400
commit7354ec7a86c0cc03bebb7f86af8f20a88b27c262 (patch)
tree8381e55d5132232a44c5e64be7911c10828a28c7 /tools
parent13b9012ab42ee93dabe8555f2e701ca139180f85 (diff)
perf jit: Make perf skip unknown records
The behavior before this commit was to skip the remaining portion of the jitdump in case an unknown record was found, including those records that perf could handle. With this change, parsing a record with an unknown id will cause a warning to be emitted, the record will be skipped and parsing will resume from the next (valid) one. The patch aims at making perf more future proof, by extracting as much information as possible from jitdumps. Signed-off-by: Stefano Sanfilippo <ssanfilippo@chromium.org> Signed-off-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Stephane Eranian <eranian@google.com> Cc: Anton Blanchard <anton@ozlabs.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1476356383-30100-5-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/jitdump.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index f3ed3c963c71..75b66bbf8429 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -263,8 +263,7 @@ jit_get_next_entry(struct jit_buf_desc *jd)
263 return NULL; 263 return NULL;
264 264
265 if (id >= JIT_CODE_MAX) { 265 if (id >= JIT_CODE_MAX) {
266 pr_warning("next_entry: unknown prefix %d, skipping\n", id); 266 pr_warning("next_entry: unknown record type %d, skipping\n", id);
267 return NULL;
268 } 267 }
269 if (bs > jd->bufsize) { 268 if (bs > jd->bufsize) {
270 void *n; 269 void *n;
@@ -322,7 +321,8 @@ jit_get_next_entry(struct jit_buf_desc *jd)
322 break; 321 break;
323 case JIT_CODE_MAX: 322 case JIT_CODE_MAX:
324 default: 323 default:
325 return NULL; 324 /* skip unknown record (we have read them) */
325 break;
326 } 326 }
327 return jr; 327 return jr;
328} 328}