You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
(5) |
2
(5) |
3
(17) |
4
(21) |
5
(24) |
6
(14) |
7
(14) |
|
8
(14) |
9
(18) |
10
(13) |
11
(15) |
12
(12) |
13
(4) |
14
(11) |
|
15
(10) |
16
(6) |
17
(14) |
18
(16) |
19
(10) |
20
(3) |
21
(12) |
|
22
(12) |
23
(11) |
24
(19) |
25
(15) |
26
(14) |
27
(16) |
28
(12) |
Author: florian
Date: Fri Feb 13 19:08:26 2015
New Revision: 14932
Log:
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.
Modified:
trunk/NEWS
trunk/callgrind/main.c
trunk/callgrind/threads.c
trunk/coregrind/m_main.c
trunk/coregrind/m_options.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_syswrap/syswrap-main.c
trunk/coregrind/m_threadstate.c
trunk/coregrind/pub_core_options.h
trunk/coregrind/pub_core_threadstate.h
trunk/drd/drd_thread.c
trunk/drd/drd_thread.h
trunk/exp-sgcheck/sg_main.c
trunk/helgrind/tests/locked_vs_unlocked2.stderr.exp
trunk/include/pub_tool_threadstate.h
trunk/none/tests/cmdline1.stdout.exp
trunk/none/tests/cmdline2.stdout.exp
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Fri Feb 13 19:08:26 2015
@@ -26,6 +26,10 @@
searching/extracting errors in output files mixing valgrind
errors with program output.
+* New Option --max-threads=<number> can be used to increase the
+ number of threads valgrind can handle. The default is 500 threads
+ which should be more than enough for most applications.
+
* ==================== FIXED BUGS ====================
The following bugs have been fixed or resolved. Note that "n-i-bz"
Modified: trunk/callgrind/main.c
==============================================================================
--- trunk/callgrind/main.c (original)
+++ trunk/callgrind/main.c Fri Feb 13 19:08:26 2015
@@ -1703,9 +1703,9 @@
/* 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 @@
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))
Modified: trunk/callgrind/threads.c
==============================================================================
--- trunk/callgrind/threads.c (original)
+++ trunk/callgrind/threads.c Fri Feb 13 19:08:26 2015
@@ -61,7 +61,7 @@
/* 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 @@
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;
Modified: trunk/coregrind/m_main.c
==============================================================================
--- trunk/coregrind/m_main.c (original)
+++ trunk/coregrind/m_main.c Fri Feb 13 19:08:26 2015
@@ -212,6 +212,8 @@
" recovered by stack scanning [5]\n"
" --resync-filter=no|yes|verbose [yes on MacOS, no on other OSes]\n"
" attempt to avoid expensive address-space-resync operations\n"
+" --max-threads=<number> maximum number of threads that valgrind can\n"
+" handle [%d]\n"
"\n";
const HChar usage2[] =
@@ -317,7 +319,8 @@
default_redzone_size /* char* */,
VG_(clo_vgdb_poll) /* int */,
VG_(vgdb_prefix_default)() /* char* */,
- N_SECTORS_DEFAULT /* int */
+ N_SECTORS_DEFAULT /* int */,
+ MAX_THREADS_DEFAULT /* int */
);
if (VG_(details).name) {
VG_(printf)(" user options for %s:\n", VG_(details).name);
@@ -394,6 +397,9 @@
else if VG_INT_CLO(str, "--max-stackframe", VG_(clo_max_stackframe)) {}
else if VG_INT_CLO(str, "--main-stacksize", VG_(clo_main_stacksize)) {}
+ // Set up VG_(clo_max_threads); needed for VG_(tl_pre_clo_init)
+ else if VG_INT_CLO(str, "--max-threads", VG_(clo_max_threads)) {}
+
// Set up VG_(clo_sim_hints). This is needed a.o. for an inner
// running in an outer, to have "no-inner-prefix" enabled
// as early as possible.
@@ -403,6 +409,9 @@
"no-nptl-pthread-stackcache",
VG_(clo_sim_hints)) {}
}
+
+ /* For convenience */
+ VG_N_THREADS = VG_(clo_max_threads);
}
/* The main processing for command line options. See comments above
@@ -539,6 +548,7 @@
else if VG_STREQ( arg, "-d") {}
else if VG_STREQN(17, arg, "--max-stackframe=") {}
else if VG_STREQN(17, arg, "--main-stacksize=") {}
+ else if VG_STREQN(14, arg, "--max-threads=") {}
else if VG_STREQN(12, arg, "--sim-hints=") {}
else if VG_STREQN(15, arg, "--profile-heap=") {}
else if VG_STREQN(20, arg, "--core-redzone-size=") {}
Modified: trunk/coregrind/m_options.c
==============================================================================
--- trunk/coregrind/m_options.c (original)
+++ trunk/coregrind/m_options.c Fri Feb 13 19:08:26 2015
@@ -126,6 +126,7 @@
Bool VG_(clo_show_below_main)= False;
Bool VG_(clo_show_emwarns) = False;
Word VG_(clo_max_stackframe) = 2000000;
+UInt VG_(clo_max_threads) = MAX_THREADS_DEFAULT;
Word VG_(clo_main_stacksize) = 0; /* use client's rlimit.stack */
Bool VG_(clo_wait_for_gdb) = False;
VgSmc VG_(clo_smc_check) = Vg_SmcStack;
Modified: trunk/coregrind/m_scheduler/scheduler.c
==============================================================================
--- trunk/coregrind/m_scheduler/scheduler.c (original)
+++ trunk/coregrind/m_scheduler/scheduler.c Fri Feb 13 19:08:26 2015
@@ -247,9 +247,9 @@
return i;
}
}
- VG_(printf)("vg_alloc_ThreadState: no free slots available\n");
- VG_(printf)("Increase VG_N_THREADS, rebuild and try again.\n");
- VG_(core_panic)("VG_N_THREADS is too low");
+ VG_(printf)("Use --max-threads=INT to specify a larger number of threads\n"
+ "and rerun valgrind\n");
+ VG_(core_panic)("Max number of threads is too low");
/*NOTREACHED*/
}
Modified: trunk/coregrind/m_syswrap/syswrap-main.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-main.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-main.c Fri Feb 13 19:08:26 2015
@@ -49,6 +49,7 @@
#include "pub_core_signals.h" // For VG_SIGVGKILL, VG_(poll_signals)
#include "pub_core_syscall.h"
#include "pub_core_machine.h"
+#include "pub_core_mallocfree.h"
#include "pub_core_syswrap.h"
#include "priv_types_n_macros.h"
@@ -1364,13 +1365,13 @@
}
SyscallInfo;
-SyscallInfo syscallInfo[VG_N_THREADS];
-
+SyscallInfo *syscallInfo;
/* The scheduler needs to be able to zero out these records after a
fork, hence this is exported from m_syswrap. */
void VG_(clear_syscallInfo) ( Int tid )
{
+ vg_assert(syscallInfo);
vg_assert(tid >= 0 && tid < VG_N_THREADS);
VG_(memset)( & syscallInfo[tid], 0, sizeof( syscallInfo[tid] ));
syscallInfo[tid].status.what = SsIdle;
@@ -1383,6 +1384,9 @@
if (init_done)
return;
init_done = True;
+
+ syscallInfo = VG_(malloc)("scinfo", VG_N_THREADS * sizeof syscallInfo[0]);
+
for (i = 0; i < VG_N_THREADS; i++) {
VG_(clear_syscallInfo)( i );
}
Modified: trunk/coregrind/m_threadstate.c
==============================================================================
--- trunk/coregrind/m_threadstate.c (original)
+++ trunk/coregrind/m_threadstate.c Fri Feb 13 19:08:26 2015
@@ -32,6 +32,7 @@
#include "pub_core_vki.h"
#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
+#include "pub_core_mallocfree.h" // VG_(malloc)
#include "pub_core_libcassert.h"
#include "pub_core_inner.h"
#if defined(ENABLE_INNER_CLIENT_REQUEST)
@@ -44,8 +45,8 @@
ThreadId VG_(running_tid) = VG_INVALID_THREADID;
-ThreadState VG_(threads)[VG_N_THREADS]
- __attribute__((aligned(LibVEX_GUEST_STATE_ALIGN)));
+ThreadState *VG_(threads);
+UInt VG_N_THREADS;
/*------------------------------------------------------------*/
/*--- Operations. ---*/
@@ -54,6 +55,14 @@
void VG_(init_Threads)(void)
{
ThreadId tid;
+ UChar *addr, *aligned_addr;
+
+ addr = VG_(malloc)("init_Threads",
+ VG_N_THREADS * sizeof VG_(threads)[0] + LibVEX_GUEST_STATE_ALIGN - 1);
+
+ // Align
+ aligned_addr = addr + (Addr)addr % LibVEX_GUEST_STATE_ALIGN;
+ VG_(threads) = (ThreadState *)aligned_addr;
for (tid = 1; tid < VG_N_THREADS; tid++) {
INNER_REQUEST(
Modified: trunk/coregrind/pub_core_options.h
==============================================================================
--- trunk/coregrind/pub_core_options.h (original)
+++ trunk/coregrind/pub_core_options.h Fri Feb 13 19:08:26 2015
@@ -295,6 +295,10 @@
be? */
extern Word VG_(clo_main_stacksize);
+/* The maximum number of threads we support. */
+#define MAX_THREADS_DEFAULT 500
+extern UInt VG_(clo_max_threads);
+
/* If the same IP is found twice in a backtrace in a sequence of max
VG_(clo_merge_recursive_frames) frames, then the recursive call
is merged in the backtrace.
Modified: trunk/coregrind/pub_core_threadstate.h
==============================================================================
--- trunk/coregrind/pub_core_threadstate.h (original)
+++ trunk/coregrind/pub_core_threadstate.h Fri Feb 13 19:08:26 2015
@@ -362,7 +362,7 @@
/* A statically allocated array of threads. NOTE: [0] is
never used, to simplify the simulation of initialisers for
LinuxThreads. */
-extern ThreadState VG_(threads)[VG_N_THREADS];
+extern ThreadState *VG_(threads);
// The running thread. m_scheduler should be the only other module
// to write to this.
Modified: trunk/drd/drd_thread.c
==============================================================================
--- trunk/drd/drd_thread.c (original)
+++ trunk/drd/drd_thread.c Fri Feb 13 19:08:26 2015
@@ -65,7 +65,7 @@
static ULong s_conflict_set_bitmap2_creation_count;
static ThreadId s_vg_running_tid = VG_INVALID_THREADID;
DrdThreadId DRD_(g_drd_running_tid) = DRD_INVALID_THREADID;
-ThreadInfo DRD_(g_threadinfo)[DRD_N_THREADS];
+ThreadInfo* DRD_(g_threadinfo);
struct bitmap* DRD_(g_conflict_set);
Bool DRD_(verify_conflict_set);
static Bool s_trace_context_switches = False;
@@ -142,6 +142,12 @@
void DRD_(thread_init)(void)
{
+ DRD_(g_threadinfo) = VG_(malloc)("drd.main.ti.1",
+ DRD_N_THREADS * sizeof DRD_(g_threadinfo)[0]);
+ for (UInt i = 0; i < DRD_N_THREADS; ++i) {
+ static ThreadInfo initval;
+ DRD_(g_threadinfo)[i] = initval;
+ }
}
/**
@@ -152,7 +158,7 @@
*/
DrdThreadId DRD_(VgThreadIdToDrdThreadId)(const ThreadId tid)
{
- int i;
+ UInt i;
if (tid == VG_INVALID_THREADID)
return DRD_INVALID_THREADID;
@@ -172,7 +178,7 @@
/** Allocate a new DRD thread ID for the specified Valgrind thread ID. */
static DrdThreadId DRD_(VgThreadIdToNewDrdThreadId)(const ThreadId tid)
{
- int i;
+ UInt i;
tl_assert(DRD_(VgThreadIdToDrdThreadId)(tid) == DRD_INVALID_THREADID);
@@ -218,7 +224,7 @@
/** Convert a POSIX thread ID into a DRD thread ID. */
DrdThreadId DRD_(PtThreadIdToDrdThreadId)(const PThreadId tid)
{
- int i;
+ UInt i;
if (tid != INVALID_POSIX_THREADID)
{
@@ -336,7 +342,7 @@
static void DRD_(thread_delayed_delete)(const DrdThreadId tid)
{
- int j;
+ UInt j;
DRD_(g_threadinfo)[tid].vg_thread_exists = False;
DRD_(g_threadinfo)[tid].posix_thread_exists = False;
@@ -476,9 +482,9 @@
Int DRD_(thread_get_threads_on_alt_stack)(void)
{
- int i, n = 0;
+ int n = 0;
- for (i = 1; i < DRD_N_THREADS; i++)
+ for (UInt i = 1; i < DRD_N_THREADS; i++)
n += DRD_(g_threadinfo)[i].on_alt_stack;
return n;
}
Modified: trunk/drd/drd_thread.h
==============================================================================
--- trunk/drd/drd_thread.h (original)
+++ trunk/drd/drd_thread.h Fri Feb 13 19:08:26 2015
@@ -113,7 +113,7 @@
*/
extern DrdThreadId DRD_(g_drd_running_tid);
/** Per-thread information managed by DRD. */
-extern ThreadInfo DRD_(g_threadinfo)[DRD_N_THREADS];
+extern ThreadInfo* DRD_(g_threadinfo);
/** Conflict set for the currently running thread. */
extern struct bitmap* DRD_(g_conflict_set);
extern Bool DRD_(verify_conflict_set);
@@ -323,7 +323,7 @@
static __inline__
Bool DRD_(thread_address_on_any_stack)(const Addr a)
{
- int i;
+ UInt i;
for (i = 1; i < DRD_N_THREADS; i++)
{
Modified: trunk/exp-sgcheck/sg_main.c
==============================================================================
--- trunk/exp-sgcheck/sg_main.c (original)
+++ trunk/exp-sgcheck/sg_main.c Fri Feb 13 19:08:26 2015
@@ -1038,11 +1038,11 @@
* a shadow stack of StackFrames, which is a double-linked list
* an stack block interval tree
*/
-static struct _StackFrame* shadowStacks[VG_N_THREADS];
+static struct _StackFrame** shadowStacks;
-static WordFM* /* StackTreeNode */ siTrees[VG_N_THREADS];
+static WordFM** /* StackTreeNode */ siTrees;
-static QCache qcaches[VG_N_THREADS];
+static QCache* qcaches;
/* Additionally, there is one global variable interval tree
@@ -1062,9 +1062,16 @@
static void ourGlobals_init ( void )
{
Word i;
+
+ shadowStacks = sg_malloc( "di.sg_main.oGi.2",
+ VG_N_THREADS * sizeof shadowStacks[0] );
+ siTrees = sg_malloc( "di.sg_main.oGi.3", VG_N_THREADS * sizeof siTrees[0] );
+ qcaches = sg_malloc( "di.sg_main.oGi.4", VG_N_THREADS * sizeof qcaches[0] );
+
for (i = 0; i < VG_N_THREADS; i++) {
shadowStacks[i] = NULL;
siTrees[i] = NULL;
+ qcaches[i] = (QCache){};
}
invalidate_all_QCaches();
giTree = VG_(newFM)( sg_malloc, "di.sg_main.oGi.1", sg_free,
Modified: trunk/helgrind/tests/locked_vs_unlocked2.stderr.exp
==============================================================================
--- trunk/helgrind/tests/locked_vs_unlocked2.stderr.exp (original)
+++ trunk/helgrind/tests/locked_vs_unlocked2.stderr.exp Fri Feb 13 19:08:26 2015
@@ -16,13 +16,13 @@
Lock at 0x........ was first observed
at 0x........: pthread_mutex_init (hg_intercepts.c:...)
- by 0x........: main (locked_vs_unlocked2.c:58)
- Address 0x........ is 0 bytes inside data symbol "mx2a"
+ by 0x........: main (locked_vs_unlocked2.c:59)
+ Address 0x........ is 0 bytes inside data symbol "mx2b"
Lock at 0x........ was first observed
at 0x........: pthread_mutex_init (hg_intercepts.c:...)
- by 0x........: main (locked_vs_unlocked2.c:59)
- Address 0x........ is 0 bytes inside data symbol "mx2b"
+ by 0x........: main (locked_vs_unlocked2.c:58)
+ Address 0x........ is 0 bytes inside data symbol "mx2a"
Lock at 0x........ was first observed
at 0x........: pthread_mutex_init (hg_intercepts.c:...)
Modified: trunk/include/pub_tool_threadstate.h
==============================================================================
--- trunk/include/pub_tool_threadstate.h (original)
+++ trunk/include/pub_tool_threadstate.h Fri Feb 13 19:08:26 2015
@@ -33,12 +33,8 @@
#include "pub_tool_basics.h" // ThreadID
-/* The maximum number of pthreads that we support. This is
- deliberately not very high since our implementation of some of the
- scheduler algorithms is surely O(N) in the number of threads, since
- that's simple, at least. And (in practice) we hope that most
- programs do not need many threads. */
-#define VG_N_THREADS 500
+/* The maximum number of pthreads that we support. */
+extern UInt VG_N_THREADS;
/* Special magic value for an invalid ThreadId. It corresponds to
LinuxThreads using zero as the initial value for
Modified: trunk/none/tests/cmdline1.stdout.exp
==============================================================================
--- trunk/none/tests/cmdline1.stdout.exp (original)
+++ trunk/none/tests/cmdline1.stdout.exp Fri Feb 13 19:08:26 2015
@@ -125,6 +125,8 @@
recovered by stack scanning [5]
--resync-filter=no|yes|verbose [yes on MacOS, no on other OSes]
attempt to avoid expensive address-space-resync operations
+ --max-threads=<number> maximum number of threads that valgrind can
+ handle [500]
user options for Nulgrind:
(none)
Modified: trunk/none/tests/cmdline2.stdout.exp
==============================================================================
--- trunk/none/tests/cmdline2.stdout.exp (original)
+++ trunk/none/tests/cmdline2.stdout.exp Fri Feb 13 19:08:26 2015
@@ -125,6 +125,8 @@
recovered by stack scanning [5]
--resync-filter=no|yes|verbose [yes on MacOS, no on other OSes]
attempt to avoid expensive address-space-resync operations
+ --max-threads=<number> maximum number of threads that valgrind can
+ handle [500]
user options for Nulgrind:
(none)
|
|
From: <sv...@va...> - 2015-02-13 17:06:18
|
Author: florian
Date: Fri Feb 13 17:05:57 2015
New Revision: 14931
Log:
More use of LibVEX_GUEST_STATE_ALIGN.
Modified:
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/pub_core_threadstate.h
Modified: trunk/coregrind/m_scheduler/scheduler.c
==============================================================================
--- trunk/coregrind/m_scheduler/scheduler.c (original)
+++ trunk/coregrind/m_scheduler/scheduler.c Fri Feb 13 17:05:57 2015
@@ -691,8 +691,8 @@
layout requirements. See libvex.h for details, but in short the
requirements are: There must be no holes in between the primary
guest state, its two copies, and the spill area. In short, all 4
- areas must have a 16-aligned size and be 16-aligned, and placed
- back-to-back. */
+ areas must be aligned on the LibVEX_GUEST_STATE_ALIGN boundary and
+ be placed back-to-back without holes in between. */
static void do_pre_run_checks ( volatile ThreadState* tst )
{
Addr a_vex = (Addr) & tst->arch.vex;
@@ -712,15 +712,15 @@
(void*)a_vexsh2, sz_vexsh2,
(void*)a_spill, sz_spill );
- vg_assert(VG_IS_16_ALIGNED(sz_vex));
- vg_assert(VG_IS_16_ALIGNED(sz_vexsh1));
- vg_assert(VG_IS_16_ALIGNED(sz_vexsh2));
- vg_assert(VG_IS_16_ALIGNED(sz_spill));
-
- vg_assert(VG_IS_16_ALIGNED(a_vex));
- vg_assert(VG_IS_16_ALIGNED(a_vexsh1));
- vg_assert(VG_IS_16_ALIGNED(a_vexsh2));
- vg_assert(VG_IS_16_ALIGNED(a_spill));
+ vg_assert(sz_vex % LibVEX_GUEST_STATE_ALIGN == 0);
+ vg_assert(sz_vexsh1 % LibVEX_GUEST_STATE_ALIGN == 0);
+ vg_assert(sz_vexsh2 % LibVEX_GUEST_STATE_ALIGN == 0);
+ vg_assert(sz_spill % LibVEX_GUEST_STATE_ALIGN == 0);
+
+ vg_assert(a_vex % LibVEX_GUEST_STATE_ALIGN == 0);
+ vg_assert(a_vexsh1 % LibVEX_GUEST_STATE_ALIGN == 0);
+ vg_assert(a_vexsh2 % LibVEX_GUEST_STATE_ALIGN == 0);
+ vg_assert(a_spill % LibVEX_GUEST_STATE_ALIGN == 0);
/* Check that the guest state and its two shadows have the same
size, and that there are no holes in between. The latter is
Modified: trunk/coregrind/pub_core_threadstate.h
==============================================================================
--- trunk/coregrind/pub_core_threadstate.h (original)
+++ trunk/coregrind/pub_core_threadstate.h Fri Feb 13 17:05:57 2015
@@ -92,9 +92,9 @@
/* Note that for code generation reasons, we require that the
guest state area, its two shadows, and the spill area, are
- 16-aligned and have 16-aligned sizes, and there are no holes
- in between. This is checked by do_pre_run_checks() in
- scheduler.c. */
+ aligned on LibVEX_GUEST_STATE_ALIGN and have sizes, such that
+ there are no holes in between. This is checked by do_pre_run_checks()
+ in scheduler.c. */
/* Saved machine context. */
VexGuestArchState vex __attribute__((aligned(LibVEX_GUEST_STATE_ALIGN)));
|
|
From: <sv...@va...> - 2015-02-13 16:26:54
|
Author: florian
Date: Fri Feb 13 16:26:44 2015
New Revision: 14930
Log:
Use LibVEX_GUEST_STATE_ALIGN introduced in VEX r3091.
Modified:
trunk/coregrind/m_threadstate.c
trunk/coregrind/pub_core_threadstate.h
Modified: trunk/coregrind/m_threadstate.c
==============================================================================
--- trunk/coregrind/m_threadstate.c (original)
+++ trunk/coregrind/m_threadstate.c Fri Feb 13 16:26:44 2015
@@ -44,7 +44,8 @@
ThreadId VG_(running_tid) = VG_INVALID_THREADID;
-ThreadState VG_(threads)[VG_N_THREADS] __attribute__((aligned(16)));
+ThreadState VG_(threads)[VG_N_THREADS]
+ __attribute__((aligned(LibVEX_GUEST_STATE_ALIGN)));
/*------------------------------------------------------------*/
/*--- Operations. ---*/
Modified: trunk/coregrind/pub_core_threadstate.h
==============================================================================
--- trunk/coregrind/pub_core_threadstate.h (original)
+++ trunk/coregrind/pub_core_threadstate.h Fri Feb 13 16:26:44 2015
@@ -97,14 +97,17 @@
scheduler.c. */
/* Saved machine context. */
- VexGuestArchState vex __attribute__((aligned(16)));
+ VexGuestArchState vex __attribute__((aligned(LibVEX_GUEST_STATE_ALIGN)));
/* Saved shadow context (2 copies). */
- VexGuestArchState vex_shadow1 __attribute__((aligned(16)));
- VexGuestArchState vex_shadow2 __attribute__((aligned(16)));
+ VexGuestArchState vex_shadow1
+ __attribute__((aligned(LibVEX_GUEST_STATE_ALIGN)));
+ VexGuestArchState vex_shadow2
+ __attribute__((aligned(LibVEX_GUEST_STATE_ALIGN)));
/* Spill area. */
- UChar vex_spill[LibVEX_N_SPILL_BYTES] __attribute__((aligned(16)));
+ UChar vex_spill[LibVEX_N_SPILL_BYTES]
+ __attribute__((aligned(LibVEX_GUEST_STATE_ALIGN)));
/* --- END vex-mandated guest state --- */
}
|
|
From: <sv...@va...> - 2015-02-13 16:25:50
|
Author: florian
Date: Fri Feb 13 16:25:41 2015
New Revision: 3091
Log:
Add symbolic constant LibVEX_GUEST_STATE_ALIGN.
Use it.
Modified:
trunk/priv/host_generic_reg_alloc2.c
trunk/priv/main_main.c
trunk/pub/libvex.h
Modified: trunk/priv/host_generic_reg_alloc2.c
==============================================================================
--- trunk/priv/host_generic_reg_alloc2.c (original)
+++ trunk/priv/host_generic_reg_alloc2.c Fri Feb 13 16:25:41 2015
@@ -399,8 +399,8 @@
not at each insn processed. */
Bool do_sanity_check;
- vassert(0 == (guest_sizeB % 16));
- vassert(0 == (LibVEX_N_SPILL_BYTES % 16));
+ vassert(0 == (guest_sizeB % LibVEX_GUEST_STATE_ALIGN));
+ vassert(0 == (LibVEX_N_SPILL_BYTES % LibVEX_GUEST_STATE_ALIGN));
vassert(0 == (N_SPILL64S % 2));
/* The live range numbers are signed shorts, and so limiting the
Modified: trunk/priv/main_main.c
==============================================================================
--- trunk/priv/main_main.c (original)
+++ trunk/priv/main_main.c Fri Feb 13 16:25:41 2015
@@ -480,7 +480,7 @@
offB_HOST_EvC_COUNTER = offsetof(VexGuestX86State,host_EvC_COUNTER);
offB_HOST_EvC_FAILADDR = offsetof(VexGuestX86State,host_EvC_FAILADDR);
vassert(vta->archinfo_guest.endness == VexEndnessLE);
- vassert(0 == sizeof(VexGuestX86State) % 16);
+ vassert(0 == sizeof(VexGuestX86State) % LibVEX_GUEST_STATE_ALIGN);
vassert(sizeof( ((VexGuestX86State*)0)->guest_CMSTART) == 4);
vassert(sizeof( ((VexGuestX86State*)0)->guest_CMLEN ) == 4);
vassert(sizeof( ((VexGuestX86State*)0)->guest_NRADDR ) == 4);
@@ -500,7 +500,7 @@
offB_HOST_EvC_COUNTER = offsetof(VexGuestAMD64State,host_EvC_COUNTER);
offB_HOST_EvC_FAILADDR = offsetof(VexGuestAMD64State,host_EvC_FAILADDR);
vassert(vta->archinfo_guest.endness == VexEndnessLE);
- vassert(0 == sizeof(VexGuestAMD64State) % 16);
+ vassert(0 == sizeof(VexGuestAMD64State) % LibVEX_GUEST_STATE_ALIGN);
vassert(sizeof( ((VexGuestAMD64State*)0)->guest_CMSTART ) == 8);
vassert(sizeof( ((VexGuestAMD64State*)0)->guest_CMLEN ) == 8);
vassert(sizeof( ((VexGuestAMD64State*)0)->guest_NRADDR ) == 8);
@@ -520,7 +520,7 @@
offB_HOST_EvC_COUNTER = offsetof(VexGuestPPC32State,host_EvC_COUNTER);
offB_HOST_EvC_FAILADDR = offsetof(VexGuestPPC32State,host_EvC_FAILADDR);
vassert(vta->archinfo_guest.endness == VexEndnessBE);
- vassert(0 == sizeof(VexGuestPPC32State) % 16);
+ vassert(0 == sizeof(VexGuestPPC32State) % LibVEX_GUEST_STATE_ALIGN);
vassert(sizeof( ((VexGuestPPC32State*)0)->guest_CMSTART ) == 4);
vassert(sizeof( ((VexGuestPPC32State*)0)->guest_CMLEN ) == 4);
vassert(sizeof( ((VexGuestPPC32State*)0)->guest_NRADDR ) == 4);
@@ -541,7 +541,7 @@
offB_HOST_EvC_FAILADDR = offsetof(VexGuestPPC64State,host_EvC_FAILADDR);
vassert(vta->archinfo_guest.endness == VexEndnessBE ||
vta->archinfo_guest.endness == VexEndnessLE );
- vassert(0 == sizeof(VexGuestPPC64State) % 16);
+ vassert(0 == sizeof(VexGuestPPC64State) % LibVEX_GUEST_STATE_ALIGN);
vassert(sizeof( ((VexGuestPPC64State*)0)->guest_CMSTART ) == 8);
vassert(sizeof( ((VexGuestPPC64State*)0)->guest_CMLEN ) == 8);
vassert(sizeof( ((VexGuestPPC64State*)0)->guest_NRADDR ) == 8);
@@ -562,7 +562,7 @@
offB_HOST_EvC_COUNTER = offsetof(VexGuestS390XState,host_EvC_COUNTER);
offB_HOST_EvC_FAILADDR = offsetof(VexGuestS390XState,host_EvC_FAILADDR);
vassert(vta->archinfo_guest.endness == VexEndnessBE);
- vassert(0 == sizeof(VexGuestS390XState) % 16);
+ vassert(0 == sizeof(VexGuestS390XState) % LibVEX_GUEST_STATE_ALIGN);
vassert(sizeof( ((VexGuestS390XState*)0)->guest_CMSTART ) == 8);
vassert(sizeof( ((VexGuestS390XState*)0)->guest_CMLEN ) == 8);
vassert(sizeof( ((VexGuestS390XState*)0)->guest_NRADDR ) == 8);
@@ -582,7 +582,7 @@
offB_HOST_EvC_COUNTER = offsetof(VexGuestARMState,host_EvC_COUNTER);
offB_HOST_EvC_FAILADDR = offsetof(VexGuestARMState,host_EvC_FAILADDR);
vassert(vta->archinfo_guest.endness == VexEndnessLE);
- vassert(0 == sizeof(VexGuestARMState) % 16);
+ vassert(0 == sizeof(VexGuestARMState) % LibVEX_GUEST_STATE_ALIGN);
vassert(sizeof( ((VexGuestARMState*)0)->guest_CMSTART) == 4);
vassert(sizeof( ((VexGuestARMState*)0)->guest_CMLEN ) == 4);
vassert(sizeof( ((VexGuestARMState*)0)->guest_NRADDR ) == 4);
@@ -602,7 +602,7 @@
offB_HOST_EvC_COUNTER = offsetof(VexGuestARM64State,host_EvC_COUNTER);
offB_HOST_EvC_FAILADDR = offsetof(VexGuestARM64State,host_EvC_FAILADDR);
vassert(vta->archinfo_guest.endness == VexEndnessLE);
- vassert(0 == sizeof(VexGuestARM64State) % 16);
+ vassert(0 == sizeof(VexGuestARM64State) % LibVEX_GUEST_STATE_ALIGN);
vassert(sizeof( ((VexGuestARM64State*)0)->guest_CMSTART) == 8);
vassert(sizeof( ((VexGuestARM64State*)0)->guest_CMLEN ) == 8);
vassert(sizeof( ((VexGuestARM64State*)0)->guest_NRADDR ) == 8);
@@ -623,7 +623,7 @@
offB_HOST_EvC_FAILADDR = offsetof(VexGuestMIPS32State,host_EvC_FAILADDR);
vassert(vta->archinfo_guest.endness == VexEndnessLE
|| vta->archinfo_guest.endness == VexEndnessBE);
- vassert(0 == sizeof(VexGuestMIPS32State) % 16);
+ vassert(0 == sizeof(VexGuestMIPS32State) % LibVEX_GUEST_STATE_ALIGN);
vassert(sizeof( ((VexGuestMIPS32State*)0)->guest_CMSTART) == 4);
vassert(sizeof( ((VexGuestMIPS32State*)0)->guest_CMLEN ) == 4);
vassert(sizeof( ((VexGuestMIPS32State*)0)->guest_NRADDR ) == 4);
@@ -644,7 +644,7 @@
offB_HOST_EvC_FAILADDR = offsetof(VexGuestMIPS64State,host_EvC_FAILADDR);
vassert(vta->archinfo_guest.endness == VexEndnessLE
|| vta->archinfo_guest.endness == VexEndnessBE);
- vassert(0 == sizeof(VexGuestMIPS64State) % 16);
+ vassert(0 == sizeof(VexGuestMIPS64State) % LibVEX_GUEST_STATE_ALIGN);
vassert(sizeof( ((VexGuestMIPS64State*)0)->guest_CMSTART) == 8);
vassert(sizeof( ((VexGuestMIPS64State*)0)->guest_CMLEN ) == 8);
vassert(sizeof( ((VexGuestMIPS64State*)0)->guest_NRADDR ) == 8);
Modified: trunk/pub/libvex.h
==============================================================================
--- trunk/pub/libvex.h (original)
+++ trunk/pub/libvex.h Fri Feb 13 16:25:41 2015
@@ -531,6 +531,8 @@
#define LibVEX_N_SPILL_BYTES 4096
+/* The size of the guest state must be a multiple of this number. */
+#define LibVEX_GUEST_STATE_ALIGN 16
/*-------------------------------------------------------*/
/*--- Initialisation of the library ---*/
|