ARM-software / gator

Sources for Arm Streamline's gator daemon, part of Arm Mobile Studio suite of performance analysis tools
https://www.arm.com/products/development-tools/graphics/arm-mobile-studio
133 stars 67 forks source link

Metadata within gatord traces. #52

Open lucasauerr opened 2 weeks ago

lucasauerr commented 2 weeks ago

Hello,

I would like to know if it would be possible to implement some sort of user-defined instrumentation data to be carried on with gatord traces. I did not find any information related to it.

Any hints if that is possible/feasible would be appreciated, as well as starting points to modify source code to implement such functionalities.

bengaineyarm commented 2 weeks ago

Hi @lucasauerr

What sort of instrumentation were you thinking of?

If you are looking for a way to dynamically create timeline charts from custom data, custom activity views, or to create simple textual/visual annotations then I'd suggest starting with https://developer.arm.com/documentation/101816/0903/Annotate-your-code/User-space-annotations and the associated https://github.com/ARM-software/gator/tree/main/annotate library. There is also a simplified kernel-annotation api you can use that supports a subset of the features that the userspace annotations support; refer to https://developer.arm.com/documentation/101816/0903/Annotate-your-code/Kernel-space-annotations

Regards Ben

lucasauerr commented 2 weeks ago

Hi @bengaineyarm,

Thanks for your reply and the links you pasted in here, I will have a look on the documentation and codes provided by Arm.

I was considering instrumentation data being captured

Essentially, increase the level of details that can be obtained from the system in comparison with what the Arm Streamline already gives us.

At this moment we are using gatord with Arm Streamline to gather data from the GPU, but we are also interested in obtain data from the SMMU of the system, which is also an ARM IP. If you have any suggestion that might help us with this procedure, it would be greatly appreciated.

Regards, Luca.

bengaineyarm commented 1 week ago

Hi Luca

If you are interested specifically in the SMMU, then that is already supported; you will need to run as root, and you will need to ensure that your target exposes the SMMU device(s) and its PMU(s).

You can check if the SMMU counters are exposed by Linux by

ls /sys/bus/event_source/devices/

which should list a bunch of directories named smmuv3_xxxx.

If you do not see this then you will need to ensure the arm_smmuv3_pmu driver is available and loaded, and that the firmware (or dtb) correctly exposes the SMMU.