[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-v9x3q9rv4caxtox7wtjpchq5@git.kernel.org>
Date: Fri, 28 Sep 2012 09:25:41 -0700
From: tip-bot for Arnaldo Carvalho de Melo <acme@...hat.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, eranian@...gle.com, paulus@...ba.org,
acme@...hat.com, hpa@...or.com, mingo@...nel.org,
peterz@...radead.org, efault@....de, namhyung@...il.com,
jolsa@...hat.com, fweisbec@...il.com, dsahern@...il.com,
tglx@...utronix.de
Subject: [tip:perf/core] perf evsel: Improve tracepoint constructor setup
Commit-ID: 0b80f8b32f31f80e001fb6355fd86769555c4a3c
Gitweb: http://git.kernel.org/tip/0b80f8b32f31f80e001fb6355fd86769555c4a3c
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Wed, 26 Sep 2012 12:28:26 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 26 Sep 2012 12:28:26 -0300
perf evsel: Improve tracepoint constructor setup
It needs to properly set the sample_type, sample_period and the KVM
related perf_event_attr fields.
Cc: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Mike Galbraith <efault@....de>
Cc: Namhyung Kim <namhyung@...il.com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/n/tip-v9x3q9rv4caxtox7wtjpchq5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/evsel.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 00936ad..2467eaf 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)
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;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists