Brooklyn/tools/perf/util/sample-raw.c

27 lines
742 B
C
Raw Normal View History

2021-05-27 00:09:36 +05:00
/* SPDX-License-Identifier: GPL-2.0 */
#include <string.h>
2021-10-02 21:09:28 +05:00
#include <linux/string.h>
2021-05-27 00:09:36 +05:00
#include "evlist.h"
#include "env.h"
2021-10-02 21:09:28 +05:00
#include "header.h"
2021-05-27 00:09:36 +05:00
#include "sample-raw.h"
/*
* Check platform the perf data file was created on and perform platform
* specific interpretation.
*/
2021-10-02 21:09:28 +05:00
void evlist__init_trace_event_sample_raw(struct evlist *evlist)
2021-05-27 00:09:36 +05:00
{
const char *arch_pf = perf_env__arch(evlist->env);
2021-10-02 21:09:28 +05:00
const char *cpuid = perf_env__cpuid(evlist->env);
2021-05-27 00:09:36 +05:00
if (arch_pf && !strcmp("s390", arch_pf))
2021-10-02 21:09:28 +05:00
evlist->trace_event_sample_raw = evlist__s390_sample_raw;
else if (arch_pf && !strcmp("x86", arch_pf) &&
cpuid && strstarts(cpuid, "AuthenticAMD") &&
evlist__has_amd_ibs(evlist)) {
evlist->trace_event_sample_raw = evlist__amd_sample_raw;
}
2021-05-27 00:09:36 +05:00
}