From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759969AbcBYGaJ (ORCPT ); Thu, 25 Feb 2016 01:30:09 -0500 Received: from torg.zytor.com ([198.137.202.12]:54856 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759379AbcBYG1M (ORCPT ); Thu, 25 Feb 2016 01:27:12 -0500 Date: Wed, 24 Feb 2016 21:43:39 -0800 From: tip-bot for Jiri Olsa Message-ID: Cc: eranian@google.com, a.p.zijlstra@chello.nl, dsahern@gmail.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com, jolsa@kernel.org, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com, ak@linux.intel.com Reply-To: jolsa@kernel.org, mingo@kernel.org, ak@linux.intel.com, hpa@zytor.com, tglx@linutronix.de, namhyung@kernel.org, dsahern@gmail.com, a.p.zijlstra@chello.nl, eranian@google.com, acme@redhat.com, linux-kernel@vger.kernel.org In-Reply-To: <1455525293-8671-22-git-send-email-jolsa@kernel.org> References: <1455525293-8671-22-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf script: Add data_src and weight column definitions Git-Commit-ID: 94ddddfab521423d94d6066879b514b9431e5cae 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: 94ddddfab521423d94d6066879b514b9431e5cae Gitweb: http://git.kernel.org/tip/94ddddfab521423d94d6066879b514b9431e5cae Author: Jiri Olsa AuthorDate: Mon, 15 Feb 2016 09:34:51 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 23 Feb 2016 12:20:02 -0300 perf script: Add data_src and weight column definitions Adding data_src and weight column definitions, so it's displayed for related sample types. Signed-off-by: Jiri Olsa Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1455525293-8671-22-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-script.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index c691214..b7f1e8e 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -58,6 +58,8 @@ enum perf_output_field { PERF_OUTPUT_IREGS = 1U << 14, PERF_OUTPUT_BRSTACK = 1U << 15, PERF_OUTPUT_BRSTACKSYM = 1U << 16, + PERF_OUTPUT_DATA_SRC = 1U << 17, + PERF_OUTPUT_WEIGHT = 1U << 18, }; struct output_option { @@ -81,6 +83,8 @@ struct output_option { {.str = "iregs", .field = PERF_OUTPUT_IREGS}, {.str = "brstack", .field = PERF_OUTPUT_BRSTACK}, {.str = "brstacksym", .field = PERF_OUTPUT_BRSTACKSYM}, + {.str = "data_src", .field = PERF_OUTPUT_DATA_SRC}, + {.str = "weight", .field = PERF_OUTPUT_WEIGHT}, }; /* default set to maintain compatibility with current format */ @@ -242,6 +246,16 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel, PERF_OUTPUT_ADDR, allow_user_set)) return -EINVAL; + if (PRINT_FIELD(DATA_SRC) && + perf_evsel__check_stype(evsel, PERF_SAMPLE_DATA_SRC, "DATA_SRC", + PERF_OUTPUT_DATA_SRC)) + return -EINVAL; + + if (PRINT_FIELD(WEIGHT) && + perf_evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT, "WEIGHT", + PERF_OUTPUT_WEIGHT)) + return -EINVAL; + if (PRINT_FIELD(SYM) && !PRINT_FIELD(IP) && !PRINT_FIELD(ADDR)) { pr_err("Display of symbols requested but neither sample IP nor " "sample address\nis selected. Hence, no addresses to convert " @@ -673,6 +687,12 @@ static void process_event(struct perf_script *script, union perf_event *event, if (PRINT_FIELD(ADDR)) print_sample_addr(event, sample, thread, attr); + if (PRINT_FIELD(DATA_SRC)) + printf("%16" PRIx64, sample->data_src); + + if (PRINT_FIELD(WEIGHT)) + printf("%16" PRIu64, sample->weight); + if (PRINT_FIELD(IP)) { if (!symbol_conf.use_callchain) printf(" ");