adding slabwatch
This commit is contained in:
parent
b0c41b4d6f
commit
e47e1103e9
1 changed files with 31 additions and 0 deletions
31
stp/slabwatch.stp
Normal file
31
stp/slabwatch.stp
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env stap
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
global slabs
|
||||||
|
global freed
|
||||||
|
|
||||||
|
probe vm.kmem_cache_alloc {
|
||||||
|
slabs [execname(), bytes_alloc, ptr, gfp_flag_name]<<<1
|
||||||
|
}
|
||||||
|
|
||||||
|
probe vm.kmem_cache_free {
|
||||||
|
freed [execname(), ptr, name]<<<1
|
||||||
|
}
|
||||||
|
|
||||||
|
probe begin {
|
||||||
|
print("\"TYPE\",\"PROCESS\",\"POINTER\",\"BYTES\",\"FLAGS/NAME\"\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
probe timer.ms(10000) {
|
||||||
|
foreach ([name, bytes, ptr, flags] in slabs) {
|
||||||
|
printf("\"ALLOC\",\"%s\",\"%p\",\"%d\",\"%s\"\n",
|
||||||
|
name, ptr, bytes, flags);
|
||||||
|
}
|
||||||
|
foreach ([execname, ptr, name] in freed) {
|
||||||
|
printf("\"FREE\",\"%s\",\"%p\",\"\",\"%s\"\n",
|
||||||
|
execname, ptr, name);
|
||||||
|
}
|
||||||
|
delete slabs
|
||||||
|
delete freed
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue