projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a91f408
)
perf evsel: Improve tracepoint constructor setup
author
Arnaldo Carvalho de Melo
<
[email protected]
>
Wed, 26 Sep 2012 15:28:26 +0000
(12:28 -0300)
committer
Arnaldo Carvalho de Melo
<
[email protected]
>
Wed, 26 Sep 2012 15:28:26 +0000
(12:28 -0300)
It needs to properly set the sample_type, sample_period and the KVM
related perf_event_attr fields.
Cc: David Ahern <
[email protected]
>
Cc: Frederic Weisbecker <
[email protected]
>
Cc: Jiri Olsa <
[email protected]
>
Cc: Mike Galbraith <
[email protected]
>
Cc: Namhyung Kim <
[email protected]
>
Cc: Paul Mackerras <
[email protected]
>
Cc: Peter Zijlstra <
[email protected]
>
Cc: Stephane Eranian <
[email protected]
>
Link:
http://lkml.kernel.org/n/
[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <
[email protected]
>
tools/perf/util/evsel.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/evsel.c
b/tools/perf/util/evsel.c
index 00936ad29ff2db0b722d437f5f8767b4d525cc02..2467eaf2968f0804d4f3a211e876b6cc089c0829 100644
(file)
--- 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)
if (evsel != NULL) {
struct perf_event_attr attr = {
- .type = PERF_TYPE_TRACEPOINT,
+ .type = PERF_TYPE_TRACEPOINT,
+ .sample_type = (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME |
+ PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD),
};
evsel->tp_format = event_format__new(sys, name);
if (evsel->tp_format == NULL)
goto out_free;
+ event_attr_init(&attr);
attr.config = evsel->tp_format->id;
+ attr.sample_period = 1;
perf_evsel__init(evsel, &attr, idx);
evsel->name = evsel->tp_format->name;
}