2.6.37 merge window, part 1
2.6.37 merge window, part 1
Posted Oct 29, 2010 3:01 UTC (Fri) by nevets (subscriber, #11875)In reply to: 2.6.37 merge window, part 1 by i3839
Parent article: 2.6.37 merge window, part 1
You want to see how much stack is being used in the kernel?
Just run the stack_tracer (if enabled).
# mount -t debugfs nodev /sys/kernel/debug
# echo 1 > /proc/sys/kernel/stack_trace_enabled
# cat /sys/kernel/debug/tracing/stack_trace
Depth Size Location (43 entries)
----- ---- --------
0) 4064 112 __slab_alloc+0x38/0x3f1
1) 3952 80 kmem_cache_alloc+0x82/0x103
2) 3872 16 mempool_alloc_slab+0x15/0x17
3) 3856 144 mempool_alloc+0x5e/0x110
4) 3712 16 scsi_sg_alloc+0x48/0x4a [scsi_mod]
5) 3696 112 __sg_alloc_table+0x62/0x103
[...]
38) 768 320 load_elf_binary+0x8a6/0x174a
39) 448 96 search_binary_handler+0xc0/0x24d
40) 352 112 do_execve+0x1d0/0x2ba
41) 240 64 sys_execve+0x43/0x5a
42) 176 176 stub_execve+0x6a/0xc0
I just about hit 4K immediately after enabling it. That first number is the stack depth (4064 bytes). That is 42 calls deep. This also shows the stack size of each function (the Size field).
