1、 用户态数据断点
./perf record -e mem:0x410968:w -ag 【w表示写的时候触发, r表示读触发,默认是rw,x表示指令断点】
wp_test 1689 [001] 12228.591637: mem:0x410968:w:
628 main+0xffffffffff800070 (/wp_test)
1f324 __libc_start_main+0xfffe0000cfd1c0dc (/lib/libc-2.24.so)
4b8 _start+0xffffffffff800028 (/wp_test)
wp_test 1697 [001] 12232.229730: mem:0x410968:w:
628 main+0xffffffffff800070 (/wp_test)
1f324 __libc_start_main+0xfffe0000b62060dc (/lib/libc-2.24.so)
4b8 _start+0xffffffffff800028 (/wp_test)
指令断点
60 cat /proc/sys/kernel/perf_event_max_sample_rate
61 echo 2000 > /proc/sys/kernel/perf_event_max_sample_rate
62 cat /proc/sys/kernel/perf_event_max_sample_rate
63 ./perf_arm64_620 record -e mem:0x4005f8:x -p 288 -- sleep 8
2、内核态数据断点
./perf record -e mem:0xffff0000095bccb8 -e mem:0xffff0000095bccc0 -ag
3、 内核态指令断点
/ # ./perf record -e mem:0xffff0000085f1e04/1:x -ag
/ # ./perf script
2478 [unknown] (/bin/busybox)
sh 1586 [003] 580.224257: mem:0xffff0000085f1e04:
ffff0000085f1e04 __handle_sysrq+0x1c ([kernel.kallsyms])
ffff0000085f23f0 write_sysrq_trigger+0x98 ([kernel.kallsyms])
ffff0000082b8d80 proc_reg_write+0x68 ([kernel.kallsyms])
ffff000008246efc __vfs_write+0x34 ([kernel.kallsyms])
ffff000008247204 vfs_write+0xa4 ([kernel.kallsyms])
ffff000008247514 ksys_write+0x64 ([kernel.kallsyms])
ffff0000082475a4 __arm64_sys_write+0x14 ([kernel.kallsyms])
ffff000008095088 el0_svc_common.constprop.0+0xc0 ([kernel.kallsyms])
ffff000008095198 el0_svc_handler+0x28 ([kernel.kallsyms])
ffff000008084090 el0_svc+0x10 ([kernel.kallsyms])
1918 [unknown] (/bin/busybox)
2478 [unknown] (/bin/busybox)
阅读(1212) | 评论(0) | 转发(0) |