iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.36k stars 3.86k forks source link

tools/old/profile.py: Backport the page_offset from tools/profile.py #4979

Closed bernhardkaindl closed 4 months ago

bernhardkaindl commented 5 months ago

Fix tools/old/profile.py for older kernels like 4.19 (tested):

This is done using a plain an unmodified backport the of the preprocessor conditions for getting the page_offset for different kernel versions and architectures from tools/profile.py.

It should fix getting the page_offset for the full range of versions and architectures supported by the conditions from tools/profile.py, but I can't test all of them.

However, as tools/profile.py is the default profile tool packaged by distros like Fedora, the method used in tools/profile.py should be a lot better than the very limited old method of getting the page_offset.

yonghong-song commented 4 months ago

Because of this, I'm open to closing it if you'd rather not like to change tools/old/profile.py Yes, it would be great if you can just use tools/profile.py instead of tools/old/profile.py.