Commit 0f0c8317 authored by Alastair Robertson's avatar Alastair Robertson

README: Add profile example

parent ba038b23
...@@ -20,7 +20,7 @@ kretprobe:sys_read / @start[tid] / ...@@ -20,7 +20,7 @@ kretprobe:sys_read / @start[tid] /
} }
``` ```
``` ```
Running... press Ctrl-C to stop Attaching 2 probes...
^C ^C
@start[9134]: 6465933686812 @start[9134]: 6465933686812
...@@ -53,7 +53,7 @@ kprobe:sys_open / comm == "bash" / ...@@ -53,7 +53,7 @@ kprobe:sys_open / comm == "bash" /
} }
``` ```
``` ```
Running... press Ctrl-C to stop Attaching 1 probe...
^C ^C
@[/usr/lib/libnsl.so.1]: 1 @[/usr/lib/libnsl.so.1]: 1
...@@ -66,29 +66,51 @@ Running... press Ctrl-C to stop ...@@ -66,29 +66,51 @@ Running... press Ctrl-C to stop
... ...
``` ```
Record where malloc is called from for a particular process ID (userland stack tracing will try to resolve symbols in the future): Whole system profiling (TODO make example check if kernel is on-cpu before recording):
``` ```
uprobe:/lib/libc-2.25.so:malloc / pid == 15201 / profile:hz:99
{ {
@[ustack] = count() @[stack] = count()
} }
``` ```
``` ```
Running... press Ctrl-C to stop Attaching 1 probe...
^C ^C
...
@[
_raw_spin_unlock_irq+23
finish_task_switch+117
__schedule+574
schedule_idle+44
do_idle+333
cpu_startup_entry+113
start_secondary+344
verify_cpu+0
]: 83
@[ @[
0x7fe223fdff40 queue_work_on+41
0x40058a tty_flip_buffer_push+43
0x7fe223f8343a pty_write+83
0x82e258d4c544155 n_tty_write+434
]: 271276 tty_write+444
__vfs_write+55
vfs_write+177
sys_write+85
entry_SYSCALL_64_fastpath+26
]: 97
@[ @[
0x7fe223fdff40 cpuidle_enter_state+299
0x40058f cpuidle_enter+23
0x7fe223f8343a call_cpuidle+35
0x82e258d4c544155 do_idle+394
]: 135637 cpu_startup_entry+113
rest_init+132
start_kernel+1083
x86_64_start_reservations+41
x86_64_start_kernel+323
verify_cpu+0
]: 150
``` ```
## Probe types ## Probe types
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment