From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753818AbdAZPcA (ORCPT ); Thu, 26 Jan 2017 10:32:00 -0500 Received: from terminus.zytor.com ([65.50.211.136]:47906 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753780AbdAZPb5 (ORCPT ); Thu, 26 Jan 2017 10:31:57 -0500 Date: Thu, 26 Jan 2017 07:31:42 -0800 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: mingo@kernel.org, wangnan0@huawei.com, jolsa@kernel.org, dsahern@gmail.com, hpa@zytor.com, acme@redhat.com, tglx@linutronix.de, namhyung@kernel.org, linux-kernel@vger.kernel.org, adrian.hunter@intel.com Reply-To: namhyung@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, adrian.hunter@intel.com, mingo@kernel.org, jolsa@kernel.org, dsahern@gmail.com, wangnan0@huawei.com, hpa@zytor.com, acme@redhat.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf scripting perl: Do not die() when not founding event for a type Git-Commit-ID: 0a87e7bc6c55dd248270ee0ab4212cd0ef8ea04a 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 Commit-ID: 0a87e7bc6c55dd248270ee0ab4212cd0ef8ea04a Gitweb: http://git.kernel.org/tip/0a87e7bc6c55dd248270ee0ab4212cd0ef8ea04a Author: Arnaldo Carvalho de Melo AuthorDate: Tue, 24 Jan 2017 13:19:06 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 26 Jan 2017 11:42:59 -0300 perf scripting perl: Do not die() when not founding event for a type Do just like handling other cases i.e. print some debug message and ignore the sample. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-t7kzlm3cxyvbd7d9n9554ai9@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/scripting-engines/trace-event-perl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c index e55a132..014ecd6 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c @@ -350,8 +350,10 @@ static void perl_process_tracepoint(struct perf_sample *sample, if (evsel->attr.type != PERF_TYPE_TRACEPOINT) return; - if (!event) - die("ug! no event found for type %" PRIu64, (u64)evsel->attr.config); + if (!event) { + pr_debug("ug! no event found for type %" PRIu64, (u64)evsel->attr.config); + return; + } pid = raw_field_value(event, "common_pid", data);