Re: [PATCH] tracing/events: Add module tracepoints

Li Zefan
2009-07-22T07:50:33Z

Rusty Russell wrote:
> On Tue, 21 Jul 2009 06:26:33 pm Li Zefan wrote:
>> Add trace points to trace module_load, module_free, module_get,
>> module_put and module_request, and use trace_event facility
>> to get the trace output.
>
> Hi Li Zefan,
>
> I don't know anything about tracing, but the module code changes look
> simple and fine to me.
>

I guess I can take this as an ack. :)

Tracing is used to have a deep insight into the system, analyse
performance issue, help debugging, dump info at system panic,
etc..

And those module trace events also can be used with other trace
events and tracers, an example below:

# mount -t debugfs xxx /mnt
# cd /mnt/tracing
# echo module > set_event
# echo scsi_device_get > set_graph_function
# echo scsi_device_put >> set_graph_function
# mount /dev/sda1 /media
# cat trace
# tracer: function_graph
#
# CPU DURATION FUNCTION CALLS
# | | | | | | |
0) | scsi_device_get() {
0) 1.215 us | get_device();
0) | ftrace_raw_event_module_get() {
0) 0.870 us | strlen();
0) | /* module_get: sata_sis call_site=scsi_device_get refcnt=9 */
0) 1.003 us | strcpy();
0) 5.821 us | }
0) + 17.304 us | }
1) | scsi_device_put() {
1) 1.807 us | module_refcount();
1) | module_put() {
1) | ftrace_raw_event_module_put() {
1) 0.748 us | strlen();
1) | /* module_put: sata_sis call_site=return_to_handler refcnt=-6 */
1) 0.856 us | strcpy();
1) 4.799 us | }
1) 6.799 us | }
1) 0.771 us | put_device();
1) + 17.464 us | }
------------------------------------------
1) mount-2452 => mount.n-2453
------------------------------------------