mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 13:52:50 +01: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 <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alice Rogers <[email protected]> Cc: Dapeng Mi <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: James Clark <[email protected]> Cc: Leo Yan <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Richter <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
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);
|
|
}
|
|
}
|