Howto Профилирование Linux
Различия
Здесь показаны различия между двумя версиями данной страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия Следующая версия Следующая версия справа и слева | ||
howto:howto_kernel:howto_профилирование_linux [08.10.2018 13:45] admin Approved(admin 2018/10/08 13:45) |
howto:howto_kernel:howto_профилирование_linux [19.10.2018 09:44] admin Approved(admin 2018/10/19 09:44) |
||
---|---|---|---|
Строка 1: | Строка 1: | ||
===== Введение ===== | ===== Введение ===== | ||
+ | * **Начать с**: yum --enablerepo='base-debuginfo' install kernel-debuginfo kernel-devel perf oprofile gdb kexec-tools crash | ||
+ | |||
**если по быстрому** | **если по быстрому** | ||
- | * perf top | + | * perf top - не точно показывает адрес топ фукнции |
* https://perf.wiki.kernel.org/index.php/Tutorial#Sampling_with_perf_record | * https://perf.wiki.kernel.org/index.php/Tutorial#Sampling_with_perf_record | ||
* perf top -d 5 -U | * perf top -d 5 -U | ||
* perf top -d 5 -g -U | * perf top -d 5 -g -U | ||
+ | * perf stat -e task-clock,cycles,instructions,cache-references,cache-misses sleep 5 | ||
+ | * **perf record -a sleep 5** и **потом perf report** | ||
* powertop | * powertop | ||
**если всерьез** | **если всерьез** | ||
Строка 204: | Строка 208: | ||
opcontrol --init | opcontrol --init | ||
opcontrol --reset | opcontrol --reset | ||
- | opcontrol --start --vmlinux=/boot/vmlinux | + | opcontrol --start --vmlinux=/usr/lib/debug/lib/modules/2.6.32-642.el6.x86_64/vmlinux |
# но иногда можно и --no-vmlinux если нам не важно про ядро, а только про юспейс | # но иногда можно и --no-vmlinux если нам не важно про ядро, а только про юспейс | ||
# если баг Failed to open profile device: Device or resource busy, то стопаем все виртуалки KVM, одна из них залочила nmi | # если баг Failed to open profile device: Device or resource busy, то стопаем все виртуалки KVM, одна из них залочила nmi | ||
Строка 250: | Строка 254: | ||
==== Отчета о кастомном модуле ==== | ==== Отчета о кастомном модуле ==== | ||
+ | opreport -l -w -p /lib/modules/2.6.32-642.el6.x86_64/kernel/drivers/net/i40e/\\ | ||
opreport -l -w -p **/node/bin** 2>&1| head -n 100 | grep flas\\ | opreport -l -w -p **/node/bin** 2>&1| head -n 100 | grep flas\\ | ||
0000000000007d30 5385 1.3249 flashcache.ko flashcache flashcache_hash_lookup\\ | 0000000000007d30 5385 1.3249 flashcache.ko flashcache flashcache_hash_lookup\\ |