0

I'd like to be able to monitor some linux system events (scheduling : cpu-migration, thread scheduling...) in my application written in C.

Is there a way to plug my application on kernel event like perf tool (https://perf.wiki.kernel.org/index.php/Main_Page) would do ?

Joker
  • 247
  • 3
  • 7
  • It's not clear exactly what you want to do (there are lots of ways to "monitor" something). But have a look at [systemtap](https://sourceware.org/systemtap/) to see if that does what you need. – kaylum Oct 02 '15 at 11:40
  • @AlanAu I want my program to be warn (by callback for example) when a thread migrate from one cpu to another or when a thread is preempt by another. I want to correlate these events with the behaviour of my own program. – Joker Oct 02 '15 at 11:58
  • Then yes, have a look at systemtap. It can do exactly that. You can hook code to be executed at many places such as when a function enters/exist, when a kernel syscall is made and even within the kernel itself. – kaylum Oct 02 '15 at 12:00

0 Answers0