You are not logged in.
Hi all,
Greeting from me!
My Arch Linux kernel version is 4.19.28-1-lts, and I try to use "perf record" to profile an application:
https://raw.githubusercontent.com/NanXi … h-perf.jpg
We can see the most executed instruction address is 0xffffffff8aa0015f and in kernel module. Is there any method to find the kernel function name through address?
Thanks very much in advance!
Best Regards
Nan Xiao
Mod note: Converted image to url, please adhere to our image posting guidelines -- V1del
Last edited by V1del (2019-03-20 12:41:00)
Offline
Try to compile 4.19.28-1-lts, and find the address from System.map or vmlinux.
~/Projects/kernelbuild/linux-5.0.3 ➭ head -5 System.map
0000000000000000 D __per_cpu_start
0000000000000000 D irq_stack_union
00000000000001e0 A kexec_control_code_size
0000000000004000 D cpu_debug_store
0000000000005000 D cpu_tss_rw
~/Projects/kernelbuild/linux-5.0.3 ➭ nm vmlinux | head -5
ffffffff81376410 T aa_af_perm
ffffffff81367230 T aa_alloc_profile
ffffffff81370f90 T aa_alloc_proxy
ffffffff8270f0a3 T aa_alloc_root_ns
ffffffff8136ee90 T aa_alloc_secid
Thanks for sharing.
Offline
@ nixawk
Thanks for your reply! I am very sorry for my late response!
But I have a question. So is it guaranteed that my own build image has the same system table as official release?
Thanks!
Nan Xiao
Offline
But I have a question. So is it guaranteed that my own build image has the same system table as official release?
In my opinion, it would be unlikely. You might have some luck if you were to build it in a chroot.
I think the unstated assumption is that you would compile the kernel and then install it on your system.
Last edited by ewaller (2019-03-31 15:23:47)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Does the following return any results?
# grep nvidia /proc/kallsyms
Offline
Does the following return any results?
# grep nvidia /proc/kallsyms
@loqs, thanks for your reply!
It actually outputs something:
$ grep nvidia /proc/kallsyms | more
0000000000000000 t nvidia_force_enable_hpet
0000000000000000 t nvidia_force_enable_hpet.cold.4
0000000000000000 t quirk_nvidia_ck804_pcie_aer_ext_cap
0000000000000000 t quirk_nvidia_ck804_msi_ht_cap
0000000000000000 t nvidia_hpet_check
0000000000000000 t nvidia_bugs
0000000000000000 t pci_mmcfg_nvidia_mcp55
0000000000000000 r _note_6 [nvidia_uvm]
0000000000000000 b uvm_debug_prints [nvidia_uvm]
0000000000000000 b g_uvmBaseDev [nvidia_uvm]
0000000000000000 r __FUNCTION__.53470 [nvidia_uvm]
0000000000000000 b bUvmDriverModeChecked.53451 [nvidia_uvm]
0000000000000000 b uvmDriverMode.53452 [nvidia_uvm]
0000000000000000 t uvm_exit [nvidia_uvm]
0000000000000000 r CSWTCH.18 [nvidia_uvm]
......
But how can I map symbols into addresses? Thanks!
Offline
nanxiao wrote:But I have a question. So is it guaranteed that my own build image has the same system table as official release?
In my opinion, it would be unlikely. You might have some luck if you were to build it in a chroot.
I think the unstated assumption is that you would compile the kernel and then install it on your system.
@ewaller Thanks for your reply!
So is there any method to map addresses to symbols? Thanks in advance!
Offline
$ grep nvidia /proc/kallsyms | more
The addresses were zeroed out by the kernel as the command was not run by root.
Offline
$ grep nvidia /proc/kallsyms | more
The addresses were zeroed out by the kernel as the command was not run by root.
@logs, Oh, you are correct! Thanks very much!
Offline