richardp
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am

TVHeadend Performance

Sun May 05, 2013 10:25 am

After getting TVHeadend working *yay* I notice that it uses alot of CPU cycles for doing almost nothing

running perf -g tvheadend shows the below.. input_dvr seems to have an ugly epoll and the raw_dispatch is using quite a bit of cycles... even when there are no services tuned. Is background scanning happening? (I dont see any TUNE statements)

Code: Select all

Events: 15K cpu-clock                                                                                                                
+  18.85%  tvheadend  [kernel.kallsyms]   [k] finish_task_switch.constprop.67
+  13.34%  tvheadend  [kernel.kallsyms]   [k] memcpy
+   3.30%  tvheadend  [kernel.kallsyms]   [k] try_to_wake_up
    3.08%  tvheadend  tvheadend           [.] dvb_adapter_input_dvr
+   2.90%  tvheadend  [kernel.kallsyms]   [k] sys_epoll_wait
+   2.67%  tvheadend  libc-2.13.so        [.] 0x6ba20
+   2.62%  tvheadend  [dvb_core]          [k] dvb_ringbuffer_read_user
+   2.54%  tvheadend  [dvb_core]          [k] dvb_dmxdev_buffer_read.isra.5
+   2.42%  tvheadend  [kernel.kallsyms]   [k] __copy_to_user_memcpy
+   2.17%  tvheadend  tvheadend           [.] dvb_table_raw_dispatch
+   1.77%  tvheadend  [kernel.kallsyms]   [k] ep_scan_ready_list.isra.11
+   1.47%  tvheadend  libpthread-2.13.so  [.] pthread_mutex_lock
+   1.43%  tvheadend  [kernel.kallsyms]   [k] __down_read
+   1.35%  tvheadend  [kernel.kallsyms]   [k] do_futex
+   1.32%  tvheadend  [kernel.kallsyms]   [k] fget_light
+   1.24%  tvheadend  [kernel.kallsyms]   [k] vfs_read
+   1.23%  tvheadend  [kernel.kallsyms]   [k] vector_swi
+   1.17%  tvheadend  libpthread-2.13.so  [.] __pthread_mutex_unlock_usercnt
+   1.11%  tvheadend  libcofi_rpi.so      [.] memcpy
+   1.10%  tvheadend  [kernel.kallsyms]   [k] ep_send_events_proc
+   1.08%  tvheadend  [kernel.kallsyms]   [k] rw_verify_area
+   1.06%  tvheadend  [kernel.kallsyms]   [k] __do_softirq
+   1.04%  tvheadend  [dvb_core]          [k] dvb_dvr_poll
+   0.95%  tvheadend  tvheadend           [.] 0x2e68
RaspberryPi's galore
Solid run CuBox
ODroid U2

richardp
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am

Re: TVHeadend Performance

Sun May 05, 2013 2:09 pm

Changing the epoll a bit.. it got a bit better, but still the system is heavy on strcpy() and some other operations.

Code: Select all

+  14.43%  tvheadend  [kernel.kallsyms]   [k] memcpy
+  11.30%  tvheadend  [kernel.kallsyms]   [k] finish_task_switch.constprop.67
+   6.71%  tvheadend  [kernel.kallsyms]   [k] __do_softirq
+   4.51%  tvheadend  tvheadend           [.] dvb_table_raw_dispatch
+   4.16%  tvheadend  [kernel.kallsyms]   [k] try_to_wake_up
+   2.76%  tvheadend  libc-2.13.so        [.] 0x95cc8
+   2.49%  tvheadend  tvheadend           [.] _eit_callback
    2.44%  tvheadend  tvheadend           [.] dvb_adapter_input_dvr
+   1.65%  tvheadend  tvheadend           [.] tvh_crc32
+   1.53%  tvheadend  [kernel.kallsyms]   [k] do_futex
+   1.47%  tvheadend  [kernel.kallsyms]   [k] __hrtimer_start_range_ns
+   1.46%  tvheadend  libcofi_rpi.so      [.] memcpy
+   1.46%  tvheadend  libc-2.13.so        [.] strcmp
+   1.32%  tvheadend  [kernel.kallsyms]   [k] ep_scan_ready_list.isra.11
+   1.32%  tvheadend  libpthread-2.13.so  [.] pthread_mutex_lock
+   1.28%  tvheadend  tvheadend           [.] _lang_code_get.part.0
+   1.19%  tvheadend  [kernel.kallsyms]   [k] sys_epoll_wait
+   1.17%  tvheadend  [kernel.kallsyms]   [k] ep_send_events_proc
+   0.99%  tvheadend  [kernel.kallsyms]   [k] __wake_up
+   0.92%  tvheadend  [kernel.kallsyms]   [k] vector_swi
+   0.91%  tvheadend  [dvb_core]          [k] dvb_dmx_swfilter_packet
+   0.84%  tvheadend  [dvb_core]          [k] dvb_dvr_poll
+   0.80%  tvheadend  tvheadend           [.] 0x2e6c
+   0.74%  tvheadend  tvheadend           [.] psi_section_reassemble
+   0.74%  tvheadend  libpthread-2.13.so  [.] __pthread_mutex_unlock_usercnt
+   0.71%  tvheadend  [kernel.kallsyms]   [k] __copy_to_user_memcpy
+   0.68%  tvheadend  libpthread-2.13.so  [.] [email protected]@GLIBC_2.4
+   0.62%  tvheadend  tvheadend           [.] psi_parse_pmt
+   0.61%  tvheadend  [kernel.kallsyms]   [k] sys_futex
+   0.58%  tvheadend  [dvb_core]          [k] dvb_dmxdev_buffer_read.isra.5
+   0.57%  tvheadend  [kernel.kallsyms]   [k] vfs_read
+   0.55%  tvheadend  libc-2.13.so        [.] free
+   0.54%  tvheadend  libc-2.13.so        [.] malloc
+   0.53%  tvheadend  [dvb_core]          [k] dvb_dmxdev_ts_callback
+   0.52%  tvheadend  [kernel.kallsyms]   [k] futex_wait
+   0.51%  tvheadend  [kernel.kallsyms]   [k] fget_light
+   0.49%  tvheadend  [kernel.kallsyms]   [k] fget
+   0.49%  tvheadend  [dvb_core]          [k] dvb_dmx_swfilter
+   0.47%  tvheadend  libpthread-2.13.so  [.] __pthread_disable_asynccancel
+   0.46%  tvheadend  [kernel.kallsyms]   [k] rcu_preempt_note_context_switch
+   0.46%  tvheadend  [kernel.kallsyms]   [k] __schedule
+   0.45%  tvheadend  tvheadend           [.] dvb_bat_callback.isra.1
    0.45%  tvheadend  libc-2.13.so        [.] epoll_wait
                                                                ▒
RaspberryPi's galore
Solid run CuBox
ODroid U2

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5307
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: TVHeadend Performance

Mon May 06, 2013 11:15 am


Return to “Media centres”