Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools/deadlock: Add an option to set the maximum number of stack traces
Commit 77f5252 ("tools/deadlock: support specifies maxnum of threads and edge cases (iovisor#3455)") allow to set the maximum number of threads and edge cases to be able to reduce the memory usage of the deadlock tool. It however let the size of the map of stack traces fixed. It's current size, 640k (actually rounded up to 1M) takes 1Gb of vmalloced kernel memory. This patch adds an option to make the maximum number of stack traces user defined. It also set the default value to 64k, in line with the current default for the number of edge cases and threads. It fix the following issue on system with limited memory ressources: could not open bpf map: stack_traces, error: Cannot allocate memory Traceback (most recent call last): File "/tmp/./deadlock.py", line 577, in <module> main() File "/tmp/./deadlock.py", line 489, in main bpf = BPF(text=text) File "/usr/lib/python3.9/site-packages/bcc/__init__.py", line 479, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> Signed-off-by: Jerome Marchand <[email protected]>
- Loading branch information