分类: LINUX
2009-06-02 16:29:45
# mount -t debugfs debugfs /debug(不用换行,直接输入就行)
# echo 1 > /debug/tracing/tracing_enabled;
echo function_graph > /debug/tracing/current_tracer;
echo "ddstart" > /debug/tracing/trace_marker;
dd if=/dev/sda of=/dev/null bs=1k count=5000 skip=2000;
echo "ddstop" > /debug/tracing/trace_marker; echo 0 >tracing_enabled
# cat /debug/tracing/trace > /tmp/trace
以下就是dd的一个读的调用关系图
0) dd-4516 | | sys_read() {
0) dd-4516 | 0.591 us | fget_light();
0) dd-4516 | | vfs_read() {
0) dd-4516 | | rw_verify_area() {
0) dd-4516 | | security_file_permission() {
0) dd-4516 | 0.581 us | cap_file_permission();
0) dd-4516 | 1.738 us | }
0) dd-4516 | 2.905 us | }
0) dd-4516 | | do_sync_read() {
0) dd-4516 | | generic_file_aio_read() {
0) dd-4516 | 0.606 us | generic_segment_checks();
0) dd-4516 | 0.566 us | _cond_resched();
0) dd-4516 | | find_get_page() {
0) dd-4516 | | file_read_actor() {
0) dd-4516 | | kmap_atomic() {
0) dd-4516 | | kmap_atomic_prot() {
0) dd-4516 | 0.626 us | page_address();
0) dd-4516 | 1.844 us | }
0) dd-4516 | 3.031 us | }
0) dd-4516 | 0.997 us | __copy_to_user_ll();
0) dd-4516 | | kunmap_atomic() {
0) dd-4516 | 0.696 us | arch_flush_lazy_mmu_mode();
0) dd-4516 | 1.899 us | }
0) dd-4516 | 8.351 us | }
0) dd-4516 | 0.612 us | put_page();
0) dd-4516 | | touch_atime() {
0) dd-4516 | | mnt_want_write() {
0) dd-4516 | 0.646 us | _spin_lock();
0) dd-4516 | 0.577 us | __mnt_is_readonly();
0) dd-4516 | 7.169 us | }
0) dd-4516 | | current_fs_time() {
0) dd-4516 | 0.661 us | current_kernel_time();
0) dd-4516 | 0.576 us | timespec_trunc();
0) dd-4516 | 2.996 us | }
0) dd-4516 | | mnt_drop_write() {
0) dd-4516 | 0.616 us | _spin_lock();
0) dd-4516 | 1.814 us | }
0) dd-4516 | + 14.313 us | }
0) dd-4516 | + 29.347 us | }
0) dd-4516 | + 30.540 us | }
0) dd-4516 | | dnotify_parent() {
0) dd-4516 | 0.591 us | _spin_lock();
0) dd-4516 | 1.773 us | }
0) dd-4516 | 0.581 us | inotify_dentry_parent_queue_event();
0) dd-4516 | 0.596 us | inotify_inode_queue_event();
0) dd-4516 | + 39.913 us | }
0) dd-4516 | + 42.287 us | }