From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752661AbcGMHZw (ORCPT ); Wed, 13 Jul 2016 03:25:52 -0400 Received: from terminus.zytor.com ([198.137.202.10]:42178 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752600AbcGMHZm (ORCPT ); Wed, 13 Jul 2016 03:25:42 -0400 Date: Wed, 13 Jul 2016 00:25:26 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: jolsa@kernel.org, hpa@zytor.com, namhyung@kernel.org, tglx@linutronix.de, acme@redhat.com, dsahern@gmail.com, mingo@kernel.org, a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org Reply-To: jolsa@kernel.org, hpa@zytor.com, namhyung@kernel.org, acme@redhat.com, tglx@linutronix.de, dsahern@gmail.com, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, mingo@kernel.org In-Reply-To: <1468148882-10362-3-git-send-email-jolsa@kernel.org> References: <1468148882-10362-3-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Introduce trace_event__tp_format_id() Git-Commit-ID: 71fe1052af98fc5b615c067425aeb6fe39a0368c 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: 71fe1052af98fc5b615c067425aeb6fe39a0368c Gitweb: http://git.kernel.org/tip/71fe1052af98fc5b615c067425aeb6fe39a0368c Author: Jiri Olsa AuthorDate: Sun, 10 Jul 2016 13:07:54 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 12 Jul 2016 16:14:52 -0300 perf tools: Introduce trace_event__tp_format_id() To get struct event_format object from tracepoint ID. It will be used in following patches. Signed-off-by: Jiri Olsa Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1468148882-10362-3-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/trace-event.c | 8 ++++++++ tools/perf/util/trace-event.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/tools/perf/util/trace-event.c b/tools/perf/util/trace-event.c index 8ae051e..c330780 100644 --- a/tools/perf/util/trace-event.c +++ b/tools/perf/util/trace-event.c @@ -105,3 +105,11 @@ trace_event__tp_format(const char *sys, const char *name) return tp_format(sys, name); } + +struct event_format *trace_event__tp_format_id(int id) +{ + if (!tevent_initialized && trace_event__init2()) + return ERR_PTR(-ENOMEM); + + return pevent_find_event(tevent.pevent, id); +} diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h index bce5b1d..b0af9c8 100644 --- a/tools/perf/util/trace-event.h +++ b/tools/perf/util/trace-event.h @@ -23,6 +23,8 @@ int trace_event__register_resolver(struct machine *machine, struct event_format* trace_event__tp_format(const char *sys, const char *name); +struct event_format *trace_event__tp_format_id(int id); + int bigendian(void); void event_format__fprintf(struct event_format *event,