Temporarily add a -S flag to limit the number of threads.

This commit is contained in:
christos 2014-03-09 19:14:15 +00:00
parent e946daf13f
commit cf96d463d6
1 changed files with 6 additions and 2 deletions

View File

@ -217,6 +217,7 @@ static char *tmpname = NULL;
static int dynsym;
int debug_level = DEBUG_LEVEL;
static size_t maxpgsize = 0x400000;
static int maxslots = MERGE_PHASE1_MAX_SLOTS;
void
@ -641,7 +642,7 @@ wq_init(workqueue_t *wq, int nfiles)
if (getenv("CTFMERGE_MAX_SLOTS"))
nslots = atoi(getenv("CTFMERGE_MAX_SLOTS"));
else
nslots = MERGE_PHASE1_MAX_SLOTS;
nslots = maxslots;
if (getenv("CTFMERGE_PHASE1_BATCH_SIZE"))
wq->wq_maxbatchsz = atoi(getenv("CTFMERGE_PHASE1_BATCH_SIZE"));
@ -776,7 +777,7 @@ main(int argc, char **argv)
debug_level = atoi(getenv("CTFMERGE_DEBUG_LEVEL"));
err = 0;
while ((c = getopt(argc, argv, ":cd:D:fgl:L:o:tvw:s")) != EOF) {
while ((c = getopt(argc, argv, ":cd:D:fgl:L:o:tvw:sS:")) != EOF) {
switch (c) {
case 'c':
docopy = 1;
@ -824,6 +825,9 @@ main(int argc, char **argv)
/* use the dynsym rather than the symtab */
dynsym = CTF_USE_DYNSYM;
break;
case 'S':
maxslots = atoi(optarg);
break;
default:
usage();
exit(2);