| 1 |
|
| 2 | #include "sample-raw.h"
|
| 3 |
|
| 4 | #include <elf.h>
|
| 5 | #include <linux/string.h>
|
| 6 |
|
| 7 | #include "env.h"
|
| 8 | #include "evlist.h"
|
| 9 | #include "header.h"
|
| 10 | #include "session.h"
|
| 11 |
|
| 12 | |
| 13 | * Check platform the perf data file was created on and perform platform
|
| 14 | * specific interpretation.
|
| 15 |
|
| 16 | void evlist__init_trace_event_sample_raw(struct evlist *evlist, struct perf_env *env)
|
| 17 | {
|
| 18 | uint16_t e_machine = perf_env__e_machine(env, NULL);
|
| 19 |
|
| 20 | if (e_machine == EM_S390) {
|
| 21 | evlist__set_trace_event_sample_raw(evlist, evlist__s390_sample_raw);
|
| 22 | } else if (e_machine == EM_X86_64 || e_machine == EM_386) {
|
| 23 | const char *cpuid = perf_env__cpuid(env);
|
| 24 |
|
| 25 | if (cpuid && strstarts(cpuid, "AuthenticAMD") && evlist__has_amd_ibs(evlist))
|
| 26 | evlist__set_trace_event_sample_raw(evlist, evlist__amd_sample_raw);
|
| 27 | }
|
| 28 | }
|