aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/evsel.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 00936ad29ff2..2467eaf2968f 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -117,14 +117,18 @@ struct perf_evsel *perf_evsel__newtp(const char *sys, const char *name, int idx)
117 117
118 if (evsel != NULL) { 118 if (evsel != NULL) {
119 struct perf_event_attr attr = { 119 struct perf_event_attr attr = {
120 .type = PERF_TYPE_TRACEPOINT, 120 .type = PERF_TYPE_TRACEPOINT,
121 .sample_type = (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME |
122 PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD),
121 }; 123 };
122 124
123 evsel->tp_format = event_format__new(sys, name); 125 evsel->tp_format = event_format__new(sys, name);
124 if (evsel->tp_format == NULL) 126 if (evsel->tp_format == NULL)
125 goto out_free; 127 goto out_free;
126 128
129 event_attr_init(&attr);
127 attr.config = evsel->tp_format->id; 130 attr.config = evsel->tp_format->id;
131 attr.sample_period = 1;
128 perf_evsel__init(evsel, &attr, idx); 132 perf_evsel__init(evsel, &attr, idx);
129 evsel->name = evsel->tp_format->name; 133 evsel->name = evsel->tp_format->name;
130 } 134 }