diff options
author | florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2015-02-13 19:08:26 +0000 |
---|---|---|
committer | florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2015-02-13 19:08:26 +0000 |
commit | 1e802b6a8d0d4b7b630d2a1dd9683c7c889b01a3 (patch) | |
tree | 5b919deeca941ed82288047e47aed586100663ba /callgrind | |
parent | 5fdb28c51986bc251430f802afb81bae898df697 (diff) | |
download | valgrind-1e802b6a8d0d4b7b630d2a1dd9683c7c889b01a3.tar.gz |
Add command line flag --max-threads=<integer> to increase the number of
threads that valgrind can handle. No recompile is needed.
Part of fixing BZ #337869.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14932 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'callgrind')
-rw-r--r-- | callgrind/main.c | 10 | ||||
-rw-r--r-- | callgrind/threads.c | 7 |
2 files changed, 13 insertions, 4 deletions
diff --git a/callgrind/main.c b/callgrind/main.c index d4b3679b7..5e501bc41 100644 --- a/callgrind/main.c +++ b/callgrind/main.c @@ -1703,9 +1703,9 @@ Bool CLG_(handle_client_request)(ThreadId tid, UWord *args, UWord *ret) /* struct timeval syscalltime[VG_N_THREADS]; */ #if CLG_MICROSYSTIME -ULong syscalltime[VG_N_THREADS]; +ULong *syscalltime; #else -UInt syscalltime[VG_N_THREADS]; +UInt *syscalltime; #endif static @@ -2071,6 +2071,12 @@ void CLG_(pre_clo_init)(void) VG_(track_post_deliver_signal)( & CLG_(post_signal) ); CLG_(set_clo_defaults)(); + + syscalltime = CLG_MALLOC("cl.main.pci.1", + VG_N_THREADS * sizeof syscalltime[0]); + for (UInt i = 0; i < VG_N_THREADS; ++i) { + syscalltime[i] = 0; + } } VG_DETERMINE_INTERFACE_VERSION(CLG_(pre_clo_init)) diff --git a/callgrind/threads.c b/callgrind/threads.c index 023009f00..7dca771f0 100644 --- a/callgrind/threads.c +++ b/callgrind/threads.c @@ -61,7 +61,7 @@ static exec_stack current_states; /* current running thread */ ThreadId CLG_(current_tid); -static thread_info* thread[VG_N_THREADS]; +static thread_info** thread; thread_info** CLG_(get_threads)() { @@ -75,7 +75,10 @@ thread_info* CLG_(get_current_thread)() void CLG_(init_threads)() { - Int i; + UInt i; + + thread = CLG_MALLOC("cl.threads.it.1", VG_N_THREADS * sizeof thread[0]); + for(i=0;i<VG_N_THREADS;i++) thread[i] = 0; CLG_(current_tid) = VG_INVALID_THREADID; |