/* * auxtrace.c: AUX area tracing support * Copyright (c) 2013-2014, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * */ #include #include "../../util/header.h" #include "../../util/debug.h" #include "../../util/pmu.h" #include "../../util/auxtrace.h" #include "../../util/intel-pt.h" #include "../../util/intel-bts.h" #include "../../util/evlist.h" static struct auxtrace_record *auxtrace_record__init_intel(struct perf_evlist *evlist, int *err) { struct perf_pmu *intel_pt_pmu; struct perf_pmu *intel_bts_pmu; struct perf_evsel *evsel; bool found_pt = false; bool found_bts = false; intel_pt_pmu = perf_pmu__find(INTEL_PT_PMU_NAME); intel_bts_pmu = perf_pmu__find(INTEL_BTS_PMU_NAME); if (evlist) { evlist__for_each_entry(evlist, evsel) { if (intel_pt_pmu && evsel->attr.type == intel_pt_pmu->type) found_pt = true; if (intel_bts_pmu && evsel->attr.type == intel_bts_pmu->type) found_bts = true; } } if (found_pt && found_bts) { pr_err("intel_pt and intel_bts may not be used together\n"); *err = -EINVAL; return NULL; } if (found_pt) return intel_pt_recording_init(err); if (found_bts) return intel_bts_recording_init(err); return NULL; } struct auxtrace_record *auxtrace_record__init(struct perf_evlist *evlist, int *err) { char buffer[64]; int ret; *err = 0; ret = get_cpuid(buffer, sizeof(buffer)); if (ret) { *err = ret; return NULL; } if (!strncmp(buffer, "GenuineIntel,", 13)) return auxtrace_record__init_intel(evlist, err); return NULL; } 8d3d86a6f9d3d8b654'>commitdiff
path: root/tools/perf/arch/x86/util/perf_regs.c
ary='commit info' class='commit-info'>
AgeCommit message (Expand)AuthorFilesLines
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-09-01 11:00:23 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-09-01 12:42:24 -0300
commit432746f8e0b6a82ba832b771afe31abd51af6752 (patch)
treefd97512e09ccf8aefea9e68620835f850e146f00
parentc97b40e4d15f13a36cd037d598e45cbe9e1e5757 (diff)
perf symbols: Fixup symbol sizes before picking best ones
When we call symbol__fixup_duplicate() we use algorithms to pick the "best" symbols for cases where there are various functions/aliases to an address, and those check zero size symbols, which, before calling symbol__fixup_end() are _all_ symbols in a just parsed kallsyms file. So first fixup the end, then fixup the duplicates. Found while trying to figure out why 'perf test vmlinux' failed, see the output of 'perf test -v vmlinux' to see cases where the symbols picked as best for vmlinux don't match the ones picked for kallsyms. Cc: Anton Blanchard <anton@samba.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Fixes: 694bf407b061 ("perf symbols: Add some heuristics for choosing the best duplicate symbol") Link: http://lkml.kernel.org/n/tip-rxqvdgr0mqjdxee0kf8i2ufn@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>