Timer lookup via proc

One more thing: interestingly, the Linux kernel allows us to peek deep inside the OS; this is (typically) achieved via the powerful Linux proc filesystem. In our current context, proc allows us to look up all the timers that a given process has. How is this done? By reading the pseudo-file /proc/<PID>/timers. Check it out. The screenshot below illustrates this being performed on the runwalk_timer process:

The terminal window on the left is where the runwalk_timer application runs; while it's running, in the terminal window on the right, we lookup the proc filesystem's pseudo-file /proc/<PID>/timers. The output clearly ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.