sample-raw.c 769 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <string.h>
  3. #include <linux/string.h>
  4. #include "evlist.h"
  5. #include "env.h"
  6. #include "header.h"
  7. #include "sample-raw.h"
  8. #include "session.h"
  9. /*
  10. * Check platform the perf data file was created on and perform platform
  11. * specific interpretation.
  12. */
  13. void evlist__init_trace_event_sample_raw(struct evlist *evlist, struct perf_env *env)
  14. {
  15. const char *arch_pf = perf_env__arch(env);
  16. const char *cpuid = perf_env__cpuid(env);
  17. if (arch_pf && !strcmp("s390", arch_pf))
  18. evlist->trace_event_sample_raw = evlist__s390_sample_raw;
  19. else if (arch_pf && !strcmp("x86", arch_pf) &&
  20. cpuid && strstarts(cpuid, "AuthenticAMD") &&
  21. evlist__has_amd_ibs(evlist)) {
  22. evlist->trace_event_sample_raw = evlist__amd_sample_raw;
  23. }
  24. }