免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4358 | 回复: 0
打印 上一主题 下一主题

oprofile工具的使用问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-04-02 23:07 |只看该作者 |倒序浏览
用oprifile测试2.6.28内核各个进程的资源使用情况,用opreport -l命令查看,结果如下:

CPU: Core 2, speed 1200 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 10000
Samples on CPU 0
Samples on CPU 1
samples  %        samples  %        image name               app name                 symbol name
35925    15.5723  49441    32.0743  libfb.so                 libfb.so                 /usr/lib/xorg/modules/libfb.so
13294     5.7625  2324      1.5077  oprofiled                oprofiled                find_kernel_image
12429     5.3876  492       0.3192  libc-2.5.so              libc-2.5.so              __gconv_transform_utf8_internal
11875     5.1474  13516     8.7684  Xorg                     Xorg                     /usr/bin/Xorg
9814      4.2540  8962      5.8140  libvte.so.9.1.5          libvte.so.9.1.5          /usr/lib/libvte.so.9.1.5
8906      3.8605  3296      2.1382  libstdc++.so.6.0.8       libstdc++.so.6.0.8       /usr/lib/libstdc++.so.6.0.8
8833      3.8288  325       0.2108  libc-2.5.so              libc-2.5.so              mbrtowc
8793      3.8115  119       0.0772  libc-2.5.so              libc-2.5.so              re_search_internal
7631      3.3078  10051     6.5205  libglib-2.0.so.0.1200.3  libglib-2.0.so.0.1200.3  /lib/libglib-2.0.so.0.1200.3
7340      3.1816  11297     7.3288  oprofile                 oprofile                 /oprofile
4525      1.9614  39        0.0253  libc-2.5.so              libc-2.5.so              re_string_reconstruct
4207      1.8236  776       0.5034  oprofiled                oprofiled                pop_buffer_value
3723      1.6138  660       0.4282  oprofiled                oprofiled                odb_update_node
3685      1.5973  3235      2.0987  libgobject-2.0.so.0.1200.3 libgobject-2.0.so.0.1200.3 /lib/libgobject-2.0.so.0.1200.3
3652      1.5830  2083      1.3513  libc-2.5.so              libc-2.5.so              _int_malloc
3534      1.5319  893       0.5793  jbd                      jbd                      /jbd
3208      1.3906  1546      1.0030  ext3                     ext3                     /ext3
2786      1.2076  1178      0.7642  libcairo.so.2.9.2        libcairo.so.2.9.2        /usr/lib/libcairo.so.2.9.2
2778      1.2042  484       0.3140  libc-2.5.so              libc-2.5.so              __i686.get_pc_thunk.bx
2701      1.1708  543       0.3523  oprofiled                oprofiled                opd_process_samples
2640      1.1444  480       0.3114  oprofiled                oprofiled                sfile_find
2430      1.0533  1921      1.2462  libgdk-x11-2.0.so.0.1000.4 libgdk-x11-2.0.so.0.1000.4 /usr/lib/libgdk-x11-2.0.so.0.1000.4
2204      0.9554  15        0.0097  libata                   libata                   /libata
1982      0.8591  2392      1.5518  intel_drv.so             intel_drv.so             /usr/lib/xorg/modules/drivers/intel_drv.so
1977      0.8570  186       0.1207  libc-2.5.so              libc-2.5.so              memmove
1739      0.7538  1116      0.7240  libc-2.5.so              libc-2.5.so              malloc
1678      0.7274  3088      2.0033  libpthread-2.5.so        libpthread-2.5.so        pthread_mutex_lock
1657      0.7183  1281      0.8310  libc-2.5.so              libc-2.5.so              memcpy
1481      0.6420  1889      1.2255  libxaa.so                libxaa.so                /usr/lib/xorg/modules/libxaa.so
1431      0.6203  2469      1.6017  libpthread-2.5.so        libpthread-2.5.so        __pthread_mutex_unlock_usercnt
1365      0.5917  2105      1.3656  libX11.so.6.2.0          libX11.so.6.2.0          /usr/lib/libX11.so.6.2.0
1347      0.5839  808       0.5242  libc-2.5.so              libc-2.5.so              free
1324      0.5739  863       0.5599  libc-2.5.so              libc-2.5.so              _int_free
1305      0.5657  1091      0.7078  libXft.so.2.1.2          libXft.so.2.1.2          /usr/lib/libXft.so.2.1.2
1181      0.5119  85        0.0551  scsi_mod                 scsi_mod                 /scsi_mod
1180      0.5115  16        0.0104  libc-2.5.so              libc-2.5.so              strncpy
1098      0.4759  48        0.0311  libc-2.5.so              libc-2.5.so              _dl_mcount_wrapper_check
1090      0.4725  696       0.4515  libgtk-x11-2.0.so.0.1000.4 libgtk-x11-2.0.so.0.1000.4 /usr/lib/libgtk-x11-2.0.so.0.1000.4
1074      0.4655  0              0  opreport                 opreport                 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, unsigned long long>, std::_Select1st<std::pair<unsigned long long const, unsigned long long> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, unsigned long long> > >::find(unsigned long long const&
1065      0.4616  0              0  opreport                 opreport                 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, unsigned long long>, std::_Select1st<std::pair<unsigned long long const, unsigned long long> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, unsigned long long> > >::insert_unique(std::pair<unsigned long long const, unsigned long long> const&
1021      0.4426  331       0.2147  libc-2.5.so              libc-2.5.so              malloc_consolidate
1019      0.4417  366       0.2374  libc-2.5.so              libc-2.5.so              strlen
994       0.4309  519       0.3367  libc-2.5.so              libc-2.5.so              memset
976       0.4231  719       0.4664  bash                     bash                     /bin/bash
975       0.4226  223       0.1447  libc-2.5.so              libc-2.5.so              _IO_vfscanf
876       0.3797  20        0.0130  libc-2.5.so              libc-2.5.so              re_string_elem_size_at
777       0.3368  978       0.6345  libextmod.so             libextmod.so             /usr/lib/xorg/modules/extensions/libextmod.so
695       0.3013  12        0.0078  libc-2.5.so              libc-2.5.so              merge_state_with_log
673       0.2917  16        0.0104  libc-2.5.so              libc-2.5.so              check_node_accept_bytes
662       0.2870  437       0.2835  libXrender.so.1.3.0      libXrender.so.1.3.0      /usr/lib/libXrender.so.1.3.0
648       0.2809  140       0.0908  oprofiled                oprofiled                odb_open_count
625       0.2709  0              0  opreport                 opreport                 interesting_symbol(bfd_symbol*)
620       0.2687  769       0.4989  libdbus-1.so.3.2.0       libdbus-1.so.3.2.0       /lib/libdbus-1.so.3.2.0
616       0.2670  0              0  opreport                 opreport                 std::_Rb_tree<stored_filename, std::pair<stored_filename const, unique_storage<image_name_tag, stored_filename>::id_value>, std::_Select1st<std::pair<stored_filename const, unique_storage<image_name_tag, stored_filename>::id_value> >, std::less<stored_filename>, std::allocator<std::pair<stored_filename const, unique_storage<image_name_tag, stored_filename>::id_value> > >::insert_unique(std::pair<stored_filename const, unique_storage<image_name_tag, stored_filename>::id_value> const&
607       0.2631  134       0.0869  oprofiled                oprofiled                sfile_log_sample
600       0.2601  128       0.0830  oprofiled                oprofiled                get_file
578       0.2505  149       0.0967  libc-2.5.so              libc-2.5.so              vfprintf
573       0.2484  0              0  opreport                 opreport                 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, unsigned long long>, std::_Select1st<std::pair<unsigned long long const, unsigned long long> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, unsigned long long> > >::lower_bound(unsigned long long const& const
570       0.2471  118       0.0766  oprofiled                oprofiled                do_match
528       0.2289  598       0.3879  dbus-daemon              dbus-daemon              /bin/dbus-daemon
523       0.2267  0              0  libusb-0.1.so.4.4.4      libusb-0.1.so.4.4.4      /usr/lib/libusb-0.1.so.4.4.4
488       0.2115  89        0.0577  oprofiled                oprofiled                enough_remaining
480       0.2081  403       0.2614  libdri.so                libdri.so                /usr/lib/xorg/modules/extensions/libdri.so
475       0.2059  478       0.3101  [vdso] (tgid:8720 range:0xb7fa1000-0xb7fa2000) Xorg                     [vdso] (tgid:8720 range:0xb7fa1000-0xb7fa2000)
434       0.1881  93        0.0603  oprofiled                oprofiled                clear_trans_current
393       0.1704  4         0.0026  libc-2.5.so              libc-2.5.so              iswalnum
365       0.1582  0              0  opreport                 opreport                 std::_Rb_tree<stored_name, std::pair<stored_name const, unique_storage<symbol_name_tag, stored_name>::id_value>, std::_Select1st<std::pair<stored_name const, unique_storage<symbol_name_tag, stored_name>::id_value> >, std::less<stored_name>, std::allocator<std::pair<stored_name const, unique_storage<symbol_name_tag, stored_name>::id_value> > >::insert_unique(std::pair<stored_name const, unique_storage<symbol_name_tag, stored_name>::id_value> const&
345       0.1495  0              0  opreport                 opreport                 std::list<op_bfd_symbol, std::allocator<op_bfd_symbol> >::merge(std::list<op_bfd_symbol, std::allocator<op_bfd_symbol> >&
341       0.1478  303       0.1966  libc-2.5.so              libc-2.5.so              strcmp
323       0.1400  80        0.0519  opreport                 opreport                 .plt
318       0.1378  0              0  ehci_hcd                 ehci_hcd                 /ehci_hcd
308       0.1335  371       0.2407  libpcsclite.so.1.0.0     libpcsclite.so.1.0.0     /usr/lib/libpcsclite.so.1.0.0
282       0.1222  0              0  opreport                 opreport                 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, unsigned long long>, std::_Select1st<std::pair<unsigned long long const, unsigned long long> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, unsigned long long> > >::_M_erase(std::_Rb_tree_node<std::pair<unsigned long long const, unsigned long long> >*)
280       0.1214  0              0  opreport                 opreport                 op_bfd_symbol:perator<(op_bfd_symbol const& const
276       0.1196  5         0.0032  libc-2.5.so              libc-2.5.so              _IO_file_xsputn@@GLIBC_2.1
256       0.1110  1        6.5e-04  libc-2.5.so              libc-2.5.so              __printf_fp
253       0.1097  43        0.0279  libc-2.5.so              libc-2.5.so              _IO_default_xsputn
246       0.1066  118       0.0766  mouse_drv.so             mouse_drv.so             /usr/lib/xorg/modules/input/mouse_drv.so
241       0.1045  0              0  opreport                 opreport                 op_bfd::get_symbols(std::list<op_bfd_symbol, std::allocator<op_bfd_symbol> >&
239       0.1036  24        0.0156  [vdso] (tgid:8225 range:0xb8085000-0xb8086000) pcscd                    [vdso] (tgid:8225 range:0xb8085000-0xb8086000)
228       0.0988  351       0.2277  libpthread-2.5.so        libpthread-2.5.so        pthread_mutex_unlock
224       0.0971  0              0  opreport                 opreport                 profile_container::add(profile_t const&, op_bfd const&, std::string const&, unsigned int)
218       0.0945  29        0.0188  oprofiled                oprofiled                code_ctx_switch
215       0.0932  3         0.0019  libc-2.5.so              libc-2.5.so              match_ctx_clean
210       0.0910  53        0.0344  oprofiled                oprofiled                sfile_get
202       0.0876  319       0.2069  libgthread-2.0.so.0.1200.3 libgthread-2.0.so.0.1200.3 /lib/libgthread-2.0.so.0.1200.3
199       0.0863  0              0  opreport                 opreport                 profile_t::add_sample_file(std::string const&
196       0.0850  0              0  opreport                 opreport                 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, unsigned long long>, std::_Select1st<std::pair<unsigned long long const, unsigned long long> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, unsigned long long> > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<unsigned long long const, unsigned long long> const&
195       0.0845  48        0.0311  oprofiled                oprofiled                code_cookie_switch
191       0.0828  43        0.0279  oprofiled                oprofiled                sfile_put
188       0.0815  410       0.2660  scim-bridge              scim-bridge              /usr/bin/scim-bridge
185       0.0802  210       0.1362  [vdso] (tgid:8976 range:0xb80fc000-0xb80fd000) gnome-terminal           [vdso] (tgid:8976 range:0xb80fc000-0xb80fd000)
183       0.0793  0              0  opreport                 opreport                 std::_Rb_tree<unsigned int, std::pair<unsigned int const, unsigned long long>, std::_Select1st<std::pair<unsigned int const, unsigned long long> >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned long long> > >::find(unsigned int const&) const
181       0.0785  168       0.1090  acpi_cpufreq             acpi_cpufreq             /acpi_cpufreq
181       0.0785  7         0.0045  ld-2.5.so                ld-2.5.so                _dl_lookup_symbol_x
177       0.0767  26        0.0169  libc-2.5.so              libc-2.5.so              mempcpy
177       0.0767  0              0  opreport                 opreport                 bfd_elf_string_from_elf_section
175       0.0759  0              0  opreport                 opreport                 profile_t::samples_range(unsigned long long, unsigned long long) const
173       0.0750  313       0.2031  opreport                 opreport                 separate_token(std::string const&, char)
171       0.0741  340       0.2206  libpthread-2.5.so        libpthread-2.5.so        pthread_getspecific
166       0.0720  141       0.0915  libXfont.so.1.4.1        libXfont.so.1.4.1        /usr/lib/libXfont.so.1.4.1
165       0.0715  0              0  opreport                 opreport                 bfd_elf32_slurp_symbol_table
164       0.0711  17        0.0110  ld-2.5.so                ld-2.5.so                do_lookup_x
163       0.0707  58        0.0376  libc-2.5.so              libc-2.5.so              fgetc
157       0.0681  56        0.0363  libm-2.5.so              libm-2.5.so              floor
155       0.0672  0              0  opreport                 opreport                 (anonymous namespace)::symbol_compare:perator()(symbol_entry const&, symbol_entry const&) const
154       0.0668  2         0.0013  libc-2.5.so              libc-2.5.so              readdir
149       0.0646  139       0.0902  libc-2.5.so              libc-2.5.so              realloc
147       0.0637  257       0.1667  libpthread-2.5.so        libpthread-2.5.so        __i686.get_pc_thunk.bx
141       0.0611  38        0.0247  libc-2.5.so              libc-2.5.so              msort_with_tmp
137       0.0594  153       0.0993  libc-2.5.so              libc-2.5.so              gettimeofday
136       0.0590  32        0.0208  [vdso] (tgid:12334 range:0xb7fd2000-0xb7fd3000) opreport                 [vdso] (tgid:12334 range:0xb7fd2000-0xb7fd3000)
134       0.0581  87        0.0564  libc-2.5.so              libc-2.5.so              strchr

........
如果我想查看某些想看到的函数占用的CPU资源,应该怎么看呢,比如我想查看do_irq()函数的使用情况,应该怎么样才能看到呢?

如果我想查看某些想看到的函数占用的CPU资源,应该怎么看呢,比如我想查看do_irq()函数的使用情况,应该怎么样才能看到呢?
谢谢回答!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP