[PATCH] perf scripts python arm-cs-trace-disasm.py: Skip disasm if address continuity is broken
Leo Yan
leo.yan at arm.com
Thu Aug 8 00:54:20 PDT 2024
On 8/6/2024 5:14 PM, James Clark wrote:
[...]
>>> Although one change we should make to the script is change the example
>>> to use kcore. We can leave in one vmlinux one as an example if kcore
>>> isn't available, but add a note that it will fail if any patched code is
>>> traced (which is almost always).
>>
>> James, you may recall the year old thread
>> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fall%2Fed8cea4c-a261-60ca-f4e1-333ec73cca8f%40os.amperecomputing.com&data=05%7C02%7Cleo.yan%40arm.com%7C263b6739000948cc6b1308dcb632df73%7Cf34e597957d94aaaad4db122a662184d%7C0%7C0%7C638585576843676468%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=kYXL6KuIv3n1UwA%2BxmEbm6V2E0g2fOtt7Iv%2B%2BMb%2B%2FQ0%3D&reserved=0.
>> I described there an awkward workaround Ampere has used to solve the
>> patched code problem. At the time, it sounded like the maintainers were
>> interested in getting away from using the python script, mostly for
>> speed purposes. I didn't see the discussion go any further.
>>
>
> Oh yes thanks for the reminder. I wasn't thinking about the source code
> lines and debug symbols in this thread. I suppose your merging of kcore
> and vmlinux gives both the correct image and the symbols, but I was only
> focused on the image being correct, so only kcore was enough.
>
> It looks like everything we want to do from your previous thread is in
> addition to the fixes from this one. Even if we auto merge kcore +
> symbols and move the disassembly into Perf, we still want to detect
> decode issues earlier and not have IPs jumping backwards. Whether it's
> the script or Perf doing that the behavior should be the same.
>
> To summarise I think these are the changes to make:
>
> * Improve bad decode detection in OpenCSD
> * Get the script to auto merge kcore and vmlinux
> * Maybe we could get Perf to do this if both a kcore folder and -k
> vmlinux are used?
We need firstly make clear what's the purpose for using kcore and vmlinux.
The kcore contains the latest instructions, so it is used for disassembly.
The vmlinux contains the debug info for locating source file and lines.
If so, this is a common issue for perf, it might not necessary to merge
two files. Alternatively, we need to check how the perf to use kcore
and vmlinux at the same time.
Thanks,
Leo
> * Improve the performance, either in the script or move more
> functionality into Perf
More information about the linux-arm-kernel
mailing list