Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932533AbbGUMfH (ORCPT ); Tue, 21 Jul 2015 08:35:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50457 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932260AbbGUMd1 (ORCPT ); Tue, 21 Jul 2015 08:33:27 -0400 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , David Ahern , Ingo Molnar , Namhyung Kim , Peter Zijlstra Subject: [PATCH 42/47] perf script: Process stat config event Date: Tue, 21 Jul 2015 14:32:02 +0200 Message-Id: <1437481927-29538-43-git-send-email-jolsa@kernel.org> In-Reply-To: <1437481927-29538-1-git-send-email-jolsa@kernel.org> References: <1437481927-29538-1-git-send-email-jolsa@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2033 Lines: 60 Adding processing of stat config event and initialize stat_config object. Link: http://lkml.kernel.org/n/tip-1m1s8mahzq38foo32qb7p2a5@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/builtin-script.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 051177d5daed..b64e4cdc29e2 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -19,6 +19,7 @@ #include "util/auxtrace.h" #include "util/cpumap.h" #include "util/thread_map.h" +#include "util/stat.h" #include #include "asm/bug.h" @@ -33,6 +34,7 @@ static bool system_wide; static bool print_flags; static const char *cpu_list; static DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS); +static struct perf_stat_config stat_config; enum perf_output_field { PERF_OUTPUT_COMM = 1U << 0, @@ -1541,6 +1543,14 @@ static int have_cmd(int argc, const char **argv) return 0; } +static int process_stat_config_event(struct perf_tool *tool __maybe_unused, + union perf_event *event, + struct perf_session *session __maybe_unused) +{ + perf_event__read_stat_config(&stat_config, &event->stat_config); + return 0; +} + static int set_maps(struct perf_script *script) { struct perf_evlist *evlist = script->session->evlist; @@ -1625,6 +1635,7 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused) .auxtrace_info = perf_event__process_auxtrace_info, .auxtrace = perf_event__process_auxtrace, .auxtrace_error = perf_event__process_auxtrace_error, + .stat_config = process_stat_config_event, .thread_map = process_thread_map_event, .cpu_map = process_cpu_map_event, .ordered_events = true, -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/