lkml.org 
[lkml]   [2015]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 30/52] perf stat record: Initialize record features
Date
Disabling all non stat related features.

Link: http://lkml.kernel.org/n/tip-0av5yfkwyywwgoiali88w4hi@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/builtin-stat.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index b65cc6a46226..3f470345e4fa 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1217,6 +1217,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;
@@ -1239,6 +1252,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;
--
2.4.3


\
 
 \ /
  Last update: 2015-10-25 16:21    [W:0.427 / U:3.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site