Merge tag 'v3.14.25' into backport/v3.14.24-ltsi-rc1+v3.14.25/snapshot-merge.wip
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / staging / ktap / samples / userspace / malloc_size_hist.kp
1 #!/usr/bin/env ktap
2
3 # Aggregate system or process malloc size
4
5 # only tested in x86-64 system,
6 # if you run this script in x86_32, change the libc path and register name.
7 #
8 # Examples:
9 #
10 # ktap malloc_size_hist.kp
11 # ktap malloc_size_hist.kp -- ls
12
13 m = {}
14
15 trace probe:/lib64/libc.so.6:malloc size=%di {
16         #arg2 is argument "size" of malloc function
17         m[arg2] += 1
18 }
19
20 trace_end {
21         histogram(m)
22 }