Reputation: 12616
I am interested in profiling a module for the Linux Kernel. I tried it this way:
CONFIG_PROFILING=y
profile=2
echo 123 > /proc/profile
ioctl
calls. The test app worked as expected so the module was working OK.readprofile -p /proc/profile -m System.map
where System.app was generated along with the kernel.So far, so good. Almost everything worked as expected. What did not work however, is that I didn't get any info about my module, i.e. there was no mention of any function from the module.
However, on second thoughts, I remebered that I forgot to recompile the module using the CONFIG_PROFILING=y
.
So, my question is: Did the module not show up in the profiling log because it had not been compiled with the CONFIG_PROFILING=y
or is there some other more obvious reason that I don't know of?
If one wonders, why I am asking rather than trying it straight away, that is because, I can't do it at home and I'd rather like to hear what the knowledgable would say before I get access to the code again.
Upvotes: 12
Views: 7616
Reputation: 12616
It doesn't seem possible for modules to be profiled in this way as they are loaded dynamically, which means that they are missing from the System.map file.
A solution would be to build the driver into the kernel. Unfortunately, this does not always work as the system may be designed to run only with the driver built into a module.
Upvotes: 6