summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/parse-events.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-09-19 07:13:36 +0200
committerIngo Molnar <mingo@kernel.org>2014-09-19 07:13:36 +0200
commit4f7cf3a992cc0c15c97d2e34ea08a1cb7faace39 (patch)
treef65a2e146bbb838b882128e17d06a1b34e8fe63c /tools/perf/util/parse-events.c
parentc88f2096136416b261bd3647cc260935f6e95805 (diff)
parente5685730e2c620f97bc12380e9370e857e5bd7a7 (diff)
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: User visible changes: o Add +field argument support for --sort option (Jiri Olsa) o Do not access kallsyms when analyzing user binaries with 'probe' (Masami Hiramatsu) o Ignore stripped vmlinux and fallback to kallsyms (Anton Blanchard) o Add path to Ubuntu kernel debuginfo file (Anton Blanchard) o Disable kernel symbol demangling by default (Avi Kivity) Infrastructure changes: o More intel PT prep work, from Adrian Hunter, including: - Let a user specify a PMU event without any config terms - Add perf-with-kcore script - Let default config be defined for a PMU - Add perf_pmu__scan_file() o "perf kvm stat report" improvements by Alexander Yarygin: o Save pid string in opts.target.pid o Enable the target.system_wide flag o Unify the title bar output o Fix build issue on powerpc when DWARF support is disabled (Anton Blanchard) o Allow to specify lib compile variable for spec usage (Jiri Olsa) o Fix build on ARM (Stephane Eranian) o Fix build on powerpc when DWARF support is disabled (Anton Blanchard) o Don't include sys/poll.h directly (Arnaldo Carvalho de Melo) o Use ring buffer consume method to look like other tools (Arnaldo Carvalho de Melo) o Allow to specify lib compile variable for spec usage (Jiri Olsa) o Fix GNU-only grep usage in Makefile (John Spencer) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r--tools/perf/util/parse-events.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index e34c81a0bcf..61be3e695ec 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -643,7 +643,18 @@ int parse_events_add_pmu(struct list_head *list, int *idx,
if (!pmu)
return -EINVAL;
- memset(&attr, 0, sizeof(attr));
+ if (pmu->default_config) {
+ memcpy(&attr, pmu->default_config,
+ sizeof(struct perf_event_attr));
+ } else {
+ memset(&attr, 0, sizeof(attr));
+ }
+
+ if (!head_config) {
+ attr.type = pmu->type;
+ evsel = __add_event(list, idx, &attr, NULL, pmu->cpus);
+ return evsel ? 0 : -ENOMEM;
+ }
if (perf_pmu__check_alias(pmu, head_config, &unit, &scale))
return -EINVAL;