sample-raw.c 742 字节
Newer Older
1 2 3
/* SPDX-License-Identifier: GPL-2.0 */

#include <string.h>
4
#include <linux/string.h>
5 6
#include "evlist.h"
#include "env.h"
7
#include "header.h"
8 9 10 11 12 13
#include "sample-raw.h"

/*
 * Check platform the perf data file was created on and perform platform
 * specific interpretation.
 */
14
void evlist__init_trace_event_sample_raw(struct evlist *evlist)
15 16
{
	const char *arch_pf = perf_env__arch(evlist->env);
17
	const char *cpuid = perf_env__cpuid(evlist->env);
18 19

	if (arch_pf && !strcmp("s390", arch_pf))
20
		evlist->trace_event_sample_raw = evlist__s390_sample_raw;
21 22 23 24 25
	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;
	}
26
}