Kernel call graphing

Adam Litke agl at us.ibm.com
Sat Nov 1 10:22:42 EST 2003


Hello,

I have written a tool to generate deterministic function call graphs.
For each function profiled, its callers are listed above (along with
call counts) and its callees (and counts) below.  This is useful for
things like lightweight code coverage analysis and finding out exactly
who's calling expensive functions, etc.

The tool has both a kernel patch and a user-space utility.  Both are
located in the files section of the LSE project at Sourceforge
www.sf.net/projects/lse.  Direct links to the latest releases follow:

http://osdn.dl.sourceforge.net/sourceforge/lse/kcg-2.6.0-test9-2.patch
http://osdn.dl.sourceforge.net/sourceforge/lse/readcg-0.3.tar.gz

I have tried this on an 8-way p650 and it works great.  I have not tried
on iSeries (the usual reason, no hw :) so it almost certainly will not
work.  Please give it a try.  Comments, suggestions, flames? welcomed :)

Here is some sample output taken during a kernel build for the curious:

==================================================
      2675523 .do_anonymous_page
       103048 .do_wp_page
        68635 .do_no_page
        20233 .generic_file_aio_write_nolock
        12209 .do_page_cache_readahead
        10328 .__get_free_pages
         6892 .copy_strings
         2194 .find_or_create_page
          849 .copy_strings32
          194 .do_generic_mapping_read
.__alloc_pages
      2900105 .buffered_rmqueue
==================================================
        21436 do_work
        19769 .cpu_idle
        11371 .pipe_wait
         6283 .io_schedule
         6046 .do_exit
         5187 .sys_wait4
         2266 .worker_thread
         1186 .schedule_timeout
          419 .unmap_vmas
          272 .__down
          134 .do_generic_mapping_read
          131 .schedule_timeout
          127 .interruptible_sleep_on
          100 .do_get_write_access
           97 .ksoftirqd
           65 .kjournald
           45 .generic_file_aio_write_nolock
           25 .__pdflush
           18 .truncate_inode_pages
           17 .journal_commit_transaction
           15 .link_path_walk
            8 .link_path_walk
            5 .wait_for_completion
            4 .migration_thread
            2 .journal_commit_transaction
            2 .journal_stop
            2 .log_wait_commit
.schedule
        75292 .sched_clock
        67071 .__switch_to
        23200 .load_balance
        20292 .recalc_task_prio
         6002 .__mmdrop
            6 .__put_task_struct
            6 .free_task
==================================================
--
Adam Litke (agl at us.ibm.com)
IBM Linux Technology Center
(503) 578 - 3283 t/l 775 - 3283


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list