Staging
v0.8.1
swh:1:snp:a902887e4be9191b7c6c4406aa06b31c1ce2c7cc
Raw File
Tip revision: 52a93d39b17dc7eb98b6aa3edb93943248e03b2f authored by Linus Torvalds on 06 August 2023, 22:07:51 UTC
Linux 6.5-rc5
Tip revision: 52a93d3
sample-raw.c
/* SPDX-License-Identifier: GPL-2.0 */

#include <string.h>
#include <linux/string.h>
#include "evlist.h"
#include "env.h"
#include "header.h"
#include "sample-raw.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)
{
	const char *arch_pf = perf_env__arch(evlist->env);
	const char *cpuid = perf_env__cpuid(evlist->env);

	if (arch_pf && !strcmp("s390", arch_pf))
		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;
	}
}
back to top