Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941235AbcJXTA2 (ORCPT ); Mon, 24 Oct 2016 15:00:28 -0400 Received: from terminus.zytor.com ([198.137.202.10]:46790 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938853AbcJXTAU (ORCPT ); Mon, 24 Oct 2016 15:00:20 -0400 Date: Mon, 24 Oct 2016 11:59:37 -0700 From: tip-bot for Stefano Sanfilippo Message-ID: Cc: acme@redhat.com, peterz@infradead.org, namhyung@kernel.org, jolsa@redhat.com, mingo@kernel.org, anton@ozlabs.org, linux-kernel@vger.kernel.org, rmcilroy@chromium.org, hpa@zytor.com, eranian@google.com, tglx@linutronix.de, ssanfilippo@chromium.org Reply-To: rmcilroy@chromium.org, linux-kernel@vger.kernel.org, eranian@google.com, tglx@linutronix.de, ssanfilippo@chromium.org, hpa@zytor.com, peterz@infradead.org, acme@redhat.com, jolsa@redhat.com, namhyung@kernel.org, mingo@kernel.org, anton@ozlabs.org In-Reply-To: <1476356383-30100-5-git-send-email-eranian@google.com> References: <1476356383-30100-5-git-send-email-eranian@google.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf jit: Make perf skip unknown records Git-Commit-ID: 7354ec7a86c0cc03bebb7f86af8f20a88b27c262 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2037 Lines: 57 Commit-ID: 7354ec7a86c0cc03bebb7f86af8f20a88b27c262 Gitweb: http://git.kernel.org/tip/7354ec7a86c0cc03bebb7f86af8f20a88b27c262 Author: Stefano Sanfilippo AuthorDate: Thu, 13 Oct 2016 03:59:38 -0700 Committer: Arnaldo Carvalho de Melo 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 Signed-off-by: Ross McIlroy Reviewed-by: Stephane Eranian Cc: Anton Blanchard Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1476356383-30100-5-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo --- 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; }