Skip to content

Instantly share code, notes, and snippets.

@hiboma
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save hiboma/9865994 to your computer and use it in GitHub Desktop.

Select an option

Save hiboma/9865994 to your computer and use it in GitHub Desktop.
perf 計測生データ
perf 計測生データ
* perf record -p <pid> で profile を取る
* bash と sshd を対象とする
* sshd は TCPソケットでホストOSからのパケットを受け取ってシェルプロンプトに文字を書くのを請け負っている
* ネットワーク割り込みが直接関係するのは、たぶん、sshd
* エンターキー押しっぱなし、適当なキーを押しっぱなしにしてる状態の profile を取る
@hiboma
Copy link
Author

hiboma commented Mar 30, 2014

HPET on + sshd + /proc/irq/19/smp_affinity が (f) デフォルト

  • _spin_unlock_irqrestore が下がってるのかな ?
# ========
# captured on: Sun Mar 30 03:03:08 2014
# hostname : vagrant-centos65.vagrantup.com
# os release : 2.6.32-431.el6.x86_64
# perf version : 2.6.32-431.11.2.el6.x86_64.debug
# arch : x86_64
# nrcpus online : 4
# nrcpus avail : 4
# cpudesc : Intel(R) Core(TM) i7-4558U CPU @ 2.80GHz
# cpuid : GenuineIntel,6,69,1
# total memory : 603168 kB
# cmdline : /usr/bin/perf record -p 1577 
# event : name = cpu-clock, type = 1, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, excl_host = 0, excl_guest = 1, precise_ip = 0, id = { 30 }
# HEADER_CPU_TOPOLOGY info available, use -I to display
# HEADER_NUMA_TOPOLOGY info available, use -I to display
# pmu mappings: tracepoint = 2, software = 1
# ========
#
# Samples: 382  of event 'cpu-clock'
# Event count (approx.): 382
#
# Overhead  Command        Shared Object                           Symbol
# ........  .......  ...................  ...............................
#
    22.25%     sshd  [kernel.kallsyms]    [k] finish_task_switch         
     9.42%     sshd  sshd                 [.] 0x00000000000160cf         
     7.59%     sshd  [kernel.kallsyms]    [k] iowrite16                  
     7.33%     sshd  libcrypto.so.1.0.1e  [.] vpaes_encrypt              
     6.28%     sshd  libcrypto.so.1.0.1e  [.] 0x00000000000e3671         
     2.88%     sshd  libz.so.1.2.3        [.] 0x00000000000071be         
     2.36%     sshd  [kernel.kallsyms]    [k] _spin_unlock_irqrestore    
     1.83%     sshd  [kernel.kallsyms]    [k] __do_softirq               
     1.57%     sshd  [kernel.kallsyms]    [k] handle_IRQ_event           
     1.31%     sshd  libz.so.1.2.3        [.] inflate                    
     1.31%     sshd  [kernel.kallsyms]    [k] kfree                      
     1.05%     sshd  libcrypto.so.1.0.1e  [.] EVP_Cipher                 
     1.05%     sshd  libc-2.12.so         [.] memcpy                     
     1.05%     sshd  libc-2.12.so         [.] __GI___libc_read           
     1.05%     sshd  [kernel.kallsyms]    [k] __audit_syscall_exit       
     1.05%     sshd  [kernel.kallsyms]    [k] do_select                  
     1.05%     sshd  [kernel.kallsyms]    [k] copy_user_generic_string   
     1.05%     sshd  [kernel.kallsyms]    [k] n_tty_poll                 
     1.05%     sshd  [kernel.kallsyms]    [k] sock_poll                  
     0.79%     sshd  libcrypto.so.1.0.1e  [.] EVP_EncryptUpdate          
     0.79%     sshd  libc-2.12.so         [.] __memset_sse2              
     0.79%     sshd  [kernel.kallsyms]    [k] sigprocmask                
     0.79%     sshd  [kernel.kallsyms]    [k] pipe_poll                  
     0.52%     sshd  libcrypto.so.1.0.1e  [.] FIPS_selftest_check        
     0.52%     sshd  libc-2.12.so         [.] sigemptyset                
     0.52%     sshd  libc-2.12.so         [.] malloc                     
     0.52%     sshd  [virtio_pci]         [k] vp_notify                  
     0.52%     sshd  [kernel.kallsyms]    [k] mod_timer                  
     0.52%     sshd  [kernel.kallsyms]    [k] add_wait_queue             
     0.52%     sshd  [kernel.kallsyms]    [k] current_kernel_time        
     0.52%     sshd  [kernel.kallsyms]    [k] audit_syscall_entry        
     0.52%     sshd  [kernel.kallsyms]    [k] do_sync_read               
     0.52%     sshd  [kernel.kallsyms]    [k] poll_select_copy_remaining 
     0.52%     sshd  [kernel.kallsyms]    [k] copy_from_user             
     0.52%     sshd  [kernel.kallsyms]    [k] n_tty_read                 
     0.52%     sshd  [kernel.kallsyms]    [k] tty_chars_in_buffer        
     0.52%     sshd  [kernel.kallsyms]    [k] tty_audit_add_data         
     0.52%     sshd  [kernel.kallsyms]    [k] skb_copy_datagram_iovec    
     0.52%     sshd  [kernel.kallsyms]    [k] ip_finish_output           
     0.52%     sshd  [kernel.kallsyms]    [k] tcp_poll                   
     0.52%     sshd  [kernel.kallsyms]    [k] schedule_hrtimeout_range   
     0.52%     sshd  [kernel.kallsyms]    [k] _spin_lock_irqsave         
     0.26%     sshd  sshd                 [.] __errno_location@plt       
     0.26%     sshd  sshd                 [.] memset@plt                 
     0.26%     sshd  sshd                 [.] read@plt                   
     0.26%     sshd  sshd                 [.] memcpy@plt                 
     0.26%     sshd  libz.so.1.2.3        [.] adler32                    
     0.26%     sshd  libz.so.1.2.3        [.] _tr_align                  
     0.26%     sshd  libcrypto.so.1.0.1e  [.] HMAC_Update                
     0.26%     sshd  libcrypto.so.1.0.1e  [.] HMAC_Init_ex               
     0.26%     sshd  libcrypto.so.1.0.1e  [.] HMAC_Init                  
     0.26%     sshd  libcrypto.so.1.0.1e  [.] EVP_MD_CTX_copy_ex         
     0.26%     sshd  libc-2.12.so         [.] __errno_location           
     0.26%     sshd  libc-2.12.so         [.] __GI___libc_write          
     0.26%     sshd  libc-2.12.so         [.] __select                   
     0.26%     sshd  [virtio_ring]        [k] virtqueue_add_buf          
     0.26%     sshd  [kernel.kallsyms]    [k] system_call                
     0.26%     sshd  [kernel.kallsyms]    [k] sys_rt_sigprocmask         
     0.26%     sshd  [kernel.kallsyms]    [k] flush_work                 
     0.26%     sshd  [kernel.kallsyms]    [k] rcu_sched_qs               
     0.26%     sshd  [kernel.kallsyms]    [k] put_page                   
     0.26%     sshd  [kernel.kallsyms]    [k] kmem_cache_alloc_node_trace
     0.26%     sshd  [kernel.kallsyms]    [k] do_sync_write              
     0.26%     sshd  [kernel.kallsyms]    [k] vfs_write                  
     0.26%     sshd  [kernel.kallsyms]    [k] vfs_read                   
     0.26%     sshd  [kernel.kallsyms]    [k] fput                       
     0.26%     sshd  [kernel.kallsyms]    [k] path_put                   
     0.26%     sshd  [kernel.kallsyms]    [k] free_poll_entry            
     0.26%     sshd  [kernel.kallsyms]    [k] core_sys_select            
     0.26%     sshd  [kernel.kallsyms]    [k] fsnotify                   
     0.26%     sshd  [kernel.kallsyms]    [k] inotify_inode_queue_event  
     0.26%     sshd  [kernel.kallsyms]    [k] tty_paranoia_check         
     0.26%     sshd  [kernel.kallsyms]    [k] tty_poll                   
     0.26%     sshd  [kernel.kallsyms]    [k] n_tty_write                
     0.26%     sshd  [kernel.kallsyms]    [k] pty_write_room             
     0.26%     sshd  [kernel.kallsyms]    [k] sock_aio_write             
     0.26%     sshd  [kernel.kallsyms]    [k] sock_update_classid        
     0.26%     sshd  [kernel.kallsyms]    [k] lock_sock_nested           
     0.26%     sshd  [kernel.kallsyms]    [k] __skb_to_sgvec             
     0.26%     sshd  [kernel.kallsyms]    [k] __kfree_skb                
     0.26%     sshd  [kernel.kallsyms]    [k] memcpy_toiovec             
     0.26%     sshd  [kernel.kallsyms]    [k] dev_hard_start_xmit        
     0.26%     sshd  [kernel.kallsyms]    [k] dev_queue_xmit             
     0.26%     sshd  [kernel.kallsyms]    [k] dst_release                
     0.26%     sshd  [kernel.kallsyms]    [k] sk_run_filter              
     0.26%     sshd  [kernel.kallsyms]    [k] ip_queue_xmit              
     0.26%     sshd  [kernel.kallsyms]    [k] ip_output                  
     0.26%     sshd  [kernel.kallsyms]    [k] tcp_recvmsg                
     0.26%     sshd  [kernel.kallsyms]    [k] tcp_transmit_skb           
     0.26%     sshd  [kernel.kallsyms]    [k] tcp_event_new_data_sent    
     0.26%     sshd  [kernel.kallsyms]    [k] tcp_write_xmit             
     0.26%     sshd  [kernel.kallsyms]    [k] inet_recvmsg               
     0.26%     sshd  [kernel.kallsyms]    [k] _cond_resched              
     0.26%     sshd  [kernel.kallsyms]    [k] mutex_unlock               
     0.26%     sshd  [kernel.kallsyms]    [k] mutex_trylock              
     0.26%     sshd  [kernel.kallsyms]    [k] _spin_lock                 
     0.26%     sshd  [kernel.kallsyms]    [k] _spin_lock_bh              


#
# (For a higher level overview, try: perf report --sort comm,dso)
#

@hiboma
Copy link
Author

hiboma commented Mar 30, 2014

HPET on + bash + /proc/irq/19/smp_affinity が (f) デフォルト

  • acpi_pm_read が消えた !!!
# ========
# captured on: Sun Mar 30 03:07:25 2014
# hostname : vagrant-centos65.vagrantup.com
# os release : 2.6.32-431.el6.x86_64
# perf version : 2.6.32-431.11.2.el6.x86_64.debug
# arch : x86_64
# nrcpus online : 4
# nrcpus avail : 4
# cpudesc : Intel(R) Core(TM) i7-4558U CPU @ 2.80GHz
# cpuid : GenuineIntel,6,69,1
# total memory : 603168 kB
# cmdline : /usr/bin/perf record -p 1578 
# event : name = cpu-clock, type = 1, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, excl_host = 0, excl_guest = 1, precise_ip = 0, id = { 32 }
# HEADER_CPU_TOPOLOGY info available, use -I to display
# HEADER_NUMA_TOPOLOGY info available, use -I to display
# pmu mappings: tracepoint = 2, software = 1
# ========
#
# Samples: 36  of event 'cpu-clock'
# Event count (approx.): 36
#
# Overhead  Command      Shared Object                               Symbol
# ........  .......  .................  ...................................
#
    16.67%     bash  libc-2.12.so       [.] __strlen_sse2                  
    16.67%     bash  bash               [.] 0x000000000004b57e             
     8.33%     bash  libc-2.12.so       [.] __GI___strcmp_ssse3            
     5.56%     bash  libc-2.12.so       [.] __gconv_transform_utf8_internal
     5.56%     bash  libc-2.12.so       [.] __mbrtowc                      
     2.78%     bash  libc-2.12.so       [.] malloc                         
     2.78%     bash  libc-2.12.so       [.] __wcslen                       
     2.78%     bash  libc-2.12.so       [.] _dl_mcount_wrapper_check       
     2.78%     bash  bash               [.] yyparse                        
     2.78%     bash  bash               [.] dispose_fd_bitmap              
     2.78%     bash  bash               [.] hash_search                    
     2.78%     bash  bash               [.] rl_prep_terminal               
     2.78%     bash  bash               [.] _rl_start_using_history        
     2.78%     bash  bash               [.] _rl_adjust_point               
     2.78%     bash  [kernel.kallsyms]  [k] finish_task_switch             
     2.78%     bash  [kernel.kallsyms]  [k] bit_waitqueue                  
     2.78%     bash  [kernel.kallsyms]  [k] kmem_cache_alloc_node_trace    
     2.78%     bash  [kernel.kallsyms]  [k] kfree                          
     2.78%     bash  [kernel.kallsyms]  [k] vfs_ioctl                      
     2.78%     bash  [kernel.kallsyms]  [k] inotify_inode_queue_event      
     2.78%     bash  [kernel.kallsyms]  [k] tty_flip_buffer_push           
     2.78%     bash  [kernel.kallsyms]  [k] netlink_table_ungrab           


#
# (For a higher level overview, try: perf report --sort comm,dso)
#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment