Re: [PATCH v3 02/11] perf tools script: Support insn output for normal samples

Andi Kleen
2019-03-04T18:14:53Z

> > + uname(&uts);
> > + if (!strcmp(uts.machine, session->header.env.arch) ||
> > + (!strcmp(uts.machine, "x86_64") &&
> > + !strcmp(session->header.env.arch, "i386")))
>
> why is this check and native_arch bool necessary?
> i386 data will be overed by arch/x86

This is so that e.g. if someone displays an ARM perf.data
on x86 it won't try to decode the ARM instructions as x86
instructions.

It also assumes that noone parses 64bit x86 on 32bit,
but I guess that's ok.

-Andi