Re: Keeping track of entering and leaving the kernel

From: dek_ml@adsl-63-193-244-224.dsl.snfc21.pacbell.net
Date: Fri Apr 21 2000 - 01:38:40 EST


Chris Wedgwood writes:
>> I am trying to figure out how to modify the kernel such that I can
>> keep track of when code inside the kernel is run. In other words, I
>> would like to insert a piece of code that gets called when there is
>> a transition from user mode to kernel mode and vice versa. I am
>> using a recent version of the 2.3 kernel.
>
>Under intel there are various msr that can count various events for
>ring 0 and ring 3 (you have two counters which you can configure). I
>guess you should be able to count ring 3 cycles vs ring 0 cycles.

I've written a tool, PerfWatcher, which iterates over all the interesting
counters and can be configured to observe ring3, ring0 , and ring3+ring0.

The code will need some modification to do exactly what you want, but may be
of general interest as well:

http://picasso.nmr.ucsf.edu/~dek/content_download.html

Dave
-----------------------------------------------------------------------------
Email: dek@cgl.ucsf.edu David Konerding WWW: http://picasso.ucsf.edu/~dek
-----------------------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:18 EST