Commit 91a2c3d5 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf script: Process stat config event

Adding processing of stat config event and initialize stat_config
object.
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Tested-by: default avatarKan Liang <kan.liang@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452028152-26762-4-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent cfc8874a
...@@ -36,6 +36,7 @@ static bool print_flags; ...@@ -36,6 +36,7 @@ static bool print_flags;
static bool nanosecs; static bool nanosecs;
static const char *cpu_list; static const char *cpu_list;
static DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS); static DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS);
static struct perf_stat_config stat_config;
unsigned int scripting_max_stack = PERF_MAX_STACK_DEPTH; unsigned int scripting_max_stack = PERF_MAX_STACK_DEPTH;
...@@ -1689,6 +1690,14 @@ static void script__setup_sample_type(struct perf_script *script) ...@@ -1689,6 +1690,14 @@ static void script__setup_sample_type(struct perf_script *script)
} }
} }
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) static int set_maps(struct perf_script *script)
{ {
struct perf_evlist *evlist = script->session->evlist; struct perf_evlist *evlist = script->session->evlist;
...@@ -1774,6 +1783,7 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused) ...@@ -1774,6 +1783,7 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
.auxtrace_info = perf_event__process_auxtrace_info, .auxtrace_info = perf_event__process_auxtrace_info,
.auxtrace = perf_event__process_auxtrace, .auxtrace = perf_event__process_auxtrace,
.auxtrace_error = perf_event__process_auxtrace_error, .auxtrace_error = perf_event__process_auxtrace_error,
.stat_config = process_stat_config_event,
.thread_map = process_thread_map_event, .thread_map = process_thread_map_event,
.cpu_map = process_cpu_map_event, .cpu_map = process_cpu_map_event,
.ordered_events = true, .ordered_events = true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment