perf
Compil perf tool and copy it under /system/bin:
> make perf > adb remount ; adb push out/target/product/<platform>/system/bin/perf /system/bin/
Top consumer functions:
# perf top -a [-p <pid>] PerfTop: 441 irqs/sec kernel:53.3% exact: 0.0% [1000Hz cycles], (target_pid: 2086) ------------------------------------------------------------------------------- samples pcnt function DSO _______ _____ __________________________________________ _________ 89.00 7.0% dvmAsmInstructionStartCode [vdso] 53.00 4.1% memcpy [vdso] 46.00 3.6% copy_user_enhanced_fast_string [kernel] 33.00 2.6% intel_pmu_enable_all [kernel] 28.00 2.2% add_preempt_count [kernel] 28.00 2.2% processMarkStack(GcMarkContext*) [vdso] 21.00 1.6% hsCheckPointer2AppHeap(Object*, Object*) [vdso] 18.00 1.4% sub_preempt_count [kernel] 15.00 1.2% kmem_cache_alloc [kernel] 14.00 1.1% do_raw_spin_lock [kernel] 13.00 1.0% dvmJitGetTraceAddrThread [vdso] 11.00 0.9% debug_smp_processor_id [kernel] 10.00 0.8% dvmBitVectorIteratorNext(BitVectorIterator [vdso] 10.00 0.8% kmem_cache_free [kernel] 10.00 0.8% __might_sleep [kernel] 10.00 0.8% pthread_mutex_lock [vdso]
Task/module/fct repartition Recording (create /data/perf.data):
# perf record -a [-p <pid>] sleep 10
then, for post-analysis on Host:
$ cd out/target/product/<platform>/ $ adb pull /data/perf.data $ perf report perf.data --symfs=symbols --vmlinux=linux/kernel/vmlinux