Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1500162 > unrolled thread

[PATCH 4/9] perf/jit: make perf skip unknown records

Started byStephane Eranian <eranian@google.com>
First post2016-10-13 13:10 +0200
Last post2016-10-24 21:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4/9] perf/jit: make perf skip unknown records Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
    [tip:perf/core] perf jit: Make perf skip unknown records tip-bot for Stefano Sanfilippo <tipbot@zytor.com> - 2016-10-24 21:10 +0200

#1500162 — [PATCH 4/9] perf/jit: make perf skip unknown records

FromStephane Eranian <eranian@google.com>
Date2016-10-13 13:10 +0200
Subject[PATCH 4/9] perf/jit: make perf skip unknown records
Message-ID<srM3D-2I3-7@gated-at.bofh.it>
From: Stefano Sanfilippo <ssanfilippo@chromium.org>

The behaviour 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>
---
 tools/perf/util/jitdump.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 95f0884aae02..5db2feb90060 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)
 		return NULL;
 
 	if (id >= JIT_CODE_MAX) {
-		pr_warning("next_entry: unknown prefix %d, skipping\n", id);
-		return NULL;
+		pr_warning("next_entry: unknown record type %d, skipping\n", id);
 	}
 	if (bs > jd->bufsize) {
 		void *n;
@@ -322,7 +321,8 @@ jit_get_next_entry(struct jit_buf_desc *jd)
 		break;
 	case JIT_CODE_MAX:
 	default:
-		return NULL;
+		/* skip unknown record (we have read them) */
+		break;
 	}
 	return jr;
 }
-- 
1.9.1

[toc] | [next] | [standalone]


#1507612 — [tip:perf/core] perf jit: Make perf skip unknown records

Fromtip-bot for Stefano Sanfilippo <tipbot@zytor.com>
Date2016-10-24 21:10 +0200
Subject[tip:perf/core] perf jit: Make perf skip unknown records
Message-ID<svSNb-3nI-9@gated-at.bofh.it>
In reply to#1500162
Commit-ID:  7354ec7a86c0cc03bebb7f86af8f20a88b27c262
Gitweb:     http://git.kernel.org/tip/7354ec7a86c0cc03bebb7f86af8f20a88b27c262
Author:     Stefano Sanfilippo <ssanfilippo@chromium.org>
AuthorDate: Thu, 13 Oct 2016 03:59:38 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 24 Oct 2016 11:07:38 -0300

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>
---
 tools/perf/util/jitdump.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index f3ed3c9..75b66bb 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)
 		return NULL;
 
 	if (id >= JIT_CODE_MAX) {
-		pr_warning("next_entry: unknown prefix %d, skipping\n", id);
-		return NULL;
+		pr_warning("next_entry: unknown record type %d, skipping\n", id);
 	}
 	if (bs > jd->bufsize) {
 		void *n;
@@ -322,7 +321,8 @@ jit_get_next_entry(struct jit_buf_desc *jd)
 		break;
 	case JIT_CODE_MAX:
 	default:
-		return NULL;
+		/* skip unknown record (we have read them) */
+		break;
 	}
 	return jr;
 }

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web