Is there any way I can log the CPU activities, like "time-stamp: actual activity" (like context switching, etc.)? It should be like syslog, sar or top, however with more fine grained time values (in nano seconds).
Please let me know if there is a tool which can do this else I am ready for recompiling the Kernel code as well.
I have read a related SO question in this context, where the discussion was mainly related to threads and checked other questions too, however did not get any lead..
Thank you.
[EDIT]: I am looking for a tool(API)/code-change suggestion which can work only at Kernel level, as my context has nothing to do with Application/User space.
[EDIT2]: Brief background: I modified Linux/Android SDIO UART driver and performed benchmarking tests on it (metrics: data transfer speed). The changes which I did indeed improved the performance, however it posed a few questions too. Theoretically the data write time should have been approx 50ns however I observed it to be approx 200ns. In the quest to understand the latency/delay of 150ns, would like to track what CPU does so that I get some cues/answer.
Now, my hopes are on systemtap.