????4.??????——??λ???????perf record && perf report

????4.1???????????????

????perf record – e cpu-clock ./test1

????perf report

????3??????

????1??perfδ???λ????????????symbol?????????????0x000003d4?????????????

????2????????????????????Щ???????????????Щ??????????????????????У???????????????????????????????Щ?????е?????????/

????3????ο??????????????????????????????????????????????????????????????????????????????????????-r??????????????

????????????2?????????????perf record -F count ???????????????????

<SPAN style="FONT-SIZE: 14px">root@hyk-linux:/home/hyk/program/cprogram# perf record -F 50000 -e cpu-clock ./test1
[ perf record: Woken up 3 times to write data ]
[ perf record: Captured and wrote 0.532 MB perf.data (~23245 samples) ]
root@hyk-linux:/home/hyk/program/cprogram# perf report
# ========
# captured on: Mon Aug 26 09:54:45 2013
# hostname : hyk-linux
# os release : 3.10.9
# perf version : 3.10.9
# arch : i686
# nrcpus online : 4
# nrcpus avail : 4
# cpudesc : Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz
# cpuid : GenuineIntel??6??42??7
# total memory : 4084184 kB
# cmdline : /media/usr/src/linux-3.10.9/tools/perf/perf record -F 50000 -e cpu-c
# event : name = cpu-clock?? type = 1?? config = 0x0?? config1 = 0x0?? config2 = 0x0
# HEADER_CPU_TOPOLOGY info available?? use -I to display
# pmu mappings: cpu = 4?? software = 1?? tracepoint = 2?? uncore_cbox_0 = 6?? uncore
# ========
#
# Samples: 13K of event 'cpu-clock'
# Event count (approx.): 273580000
#
# Overhead  Command      Shared Object                           Symbol
# ........  .......  .................  ...............................
#
    99.77%    test1  test1              [.] 0x000003c3               
     0.07%    test1  ld-2.15.so         [.] 0x00004c99               
     0.02%    test1  [kernel.kallsyms]  [k] __wake_up_bit            
     0.01%    test1  [kernel.kallsyms]  [k] __kunmap_atomic          
     0.01%    test1  [kernel.kallsyms]  [k] load_elf_binary          
     0.01%    test1  [kernel.kallsyms]  [k] _raw_spin_unlock_irqrestore
     0.01%    test1  libc-2.15.so       [.] 0x00097d8e               
     0.01%    test1  [kernel.kallsyms]  [k] exit_itimers             
     0.01%    test1  [kernel.kallsyms]  [k] profile_munmap           
     0.01%    test1  [kernel.kallsyms]  [k] get_page_from_freelist   
     0.01%    test1  [kernel.kallsyms]  [k] vma_interval_tree_remove 
     0.01%    test1  [kernel.kallsyms]  [k] change_protection        
     0.01%    test1  [kernel.kallsyms]  [k] link_path_walk           
     0.01%    test1  [kernel.kallsyms]  [k] prepend_path             
     0.01%    test1  [kernel.kallsyms]  [k] __inode_wait_for_writeback
     0.01%    test1  [kernel.kallsyms]  [k] aa_free_task_context     
     0.01%    test1  [kernel.kallsyms]  [k] radix_tree_lookup_element
     0.01%    test1  [kernel.kallsyms]  [k] _raw_spin_lock   </SPAN>