summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-stat.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2015-11-05 15:40:47 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-12-17 15:15:17 -0300
commit3ba78bd00e508bf46a6aa2b8e296dc8287ea4c29 (patch)
treed7fb49a89d65dd40b7497bdff22808822877ac4e /tools/perf/builtin-stat.c
parent4979d0c7d0c73a3e799d4dcfbacd3cd11cc55638 (diff)
downloadlinux-stable-3ba78bd00e508bf46a6aa2b8e296dc8287ea4c29.tar.gz
linux-stable-3ba78bd00e508bf46a6aa2b8e296dc8287ea4c29.tar.bz2
linux-stable-3ba78bd00e508bf46a6aa2b8e296dc8287ea4c29.zip
perf stat record: Initialize record features
Disabling all non stat related features. Also as we now enable STAT feature in the data file, adding code to instruct session open to skip sample type checking for stat data files. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Tested-by: Kan 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/1446734469-11352-4-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r--tools/perf/builtin-stat.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index af2a3bf659f7..c9c896a94fee 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1310,6 +1310,19 @@ static const char * const recort_usage[] = {
NULL,
};
+static void init_features(struct perf_session *session)
+{
+ int feat;
+
+ for (feat = HEADER_FIRST_FEATURE; feat < HEADER_LAST_FEATURE; feat++)
+ perf_header__set_feat(&session->header, feat);
+
+ perf_header__clear_feat(&session->header, HEADER_BUILD_ID);
+ perf_header__clear_feat(&session->header, HEADER_TRACING_DATA);
+ perf_header__clear_feat(&session->header, HEADER_BRANCH_STACK);
+ perf_header__clear_feat(&session->header, HEADER_AUXTRACE);
+}
+
static int __cmd_record(int argc, const char **argv)
{
struct perf_session *session;
@@ -1331,6 +1344,8 @@ static int __cmd_record(int argc, const char **argv)
if (perf_stat.file.is_pipe)
return -EINVAL;
+ init_features(session);
+
session->evlist = evsel_list;
perf_stat.session = session;
perf_stat.record = true;