mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 14:33:24 -04:00
Now the evlist is reference counted, add reference count checking so that gets and puts are paired and easy to debug. Reference count checking is documented here: https://perfwiki.github.io/main/reference-count-checking/ This large patch is adding accessors to evlist functions and switching to their use. There was some minor renaming as evlist__mmap is now an accessor to the mmap variable, and the original evlist__mmap is renamed to evlist__do_mmap. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alice Rogers <alice.mei.rogers@gmail.com> Cc: Dapeng Mi <dapeng1.mi@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@linaro.org> Cc: Leo Yan <leo.yan@linux.dev> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Richter <tmricht@linux.ibm.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
29 lines
812 B
C
29 lines
812 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#include "sample-raw.h"
|
|
|
|
#include <elf.h>
|
|
#include <linux/string.h>
|
|
|
|
#include "env.h"
|
|
#include "evlist.h"
|
|
#include "header.h"
|
|
#include "session.h"
|
|
|
|
/*
|
|
* Check platform the perf data file was created on and perform platform
|
|
* specific interpretation.
|
|
*/
|
|
void evlist__init_trace_event_sample_raw(struct evlist *evlist, struct perf_env *env)
|
|
{
|
|
uint16_t e_machine = perf_env__e_machine(env, /*e_flags=*/NULL);
|
|
|
|
if (e_machine == EM_S390) {
|
|
evlist__set_trace_event_sample_raw(evlist, evlist__s390_sample_raw);
|
|
} else if (e_machine == EM_X86_64 || e_machine == EM_386) {
|
|
const char *cpuid = perf_env__cpuid(env);
|
|
|
|
if (cpuid && strstarts(cpuid, "AuthenticAMD") && evlist__has_amd_ibs(evlist))
|
|
evlist__set_trace_event_sample_raw(evlist, evlist__amd_sample_raw);
|
|
}
|
|
}
|