mcexec: add --debug-mcexec

We already have debug statements compiled in, add a toggle for it
Also fix case indent for 's'

Change-Id: I1104ee57d571b82ec5e061f22cd44033a5c7fc39
This commit is contained in:
Dominique Martinet
2018-10-16 10:00:45 +09:00
committed by Dominique Martinet
parent fb98664f49
commit 1d6a078afa

View File

@ -1874,6 +1874,12 @@ static struct option mcexec_options[] = {
.flag = &enable_uti,
.val = 1,
},
{
.name = "debug-mcexec",
.has_arg = no_argument,
.flag = &debug,
.val = 1,
},
/* end */
{ NULL, 0, NULL, 0, },
};
@ -2156,9 +2162,11 @@ int main(int argc, char **argv)
/* Parse options ("+" denotes stop at the first non-option) */
#ifdef ADD_ENVS_OPTION
while ((opt = getopt_long(argc, argv, "+c:n:t:M:h:e:s:m:u:", mcexec_options, NULL)) != -1) {
while ((opt = getopt_long(argc, argv, "+c:n:t:M:h:e:s:m:u:",
mcexec_options, NULL)) != -1) {
#else /* ADD_ENVS_OPTION */
while ((opt = getopt_long(argc, argv, "+c:n:t:M:h:s:m:u:", mcexec_options, NULL)) != -1) {
while ((opt = getopt_long(argc, argv, "+c:n:t:M:h:s:m:u:",
mcexec_options, NULL)) != -1) {
#endif /* ADD_ENVS_OPTION */
switch (opt) {
char *tmp;
@ -2205,21 +2213,24 @@ int main(int argc, char **argv)
break;
#endif /* ADD_ENVS_OPTION */
case 's': {
char *token, *dup, *line;
dup = strdup(optarg);
line = dup;
token = strsep(&line, ",");
if (token != NULL && *token != 0) {
stack_premap = atobytes(token);
case 's': {
char *token, *dup, *line;
dup = strdup(optarg);
line = dup;
token = strsep(&line, ",");
if (token != NULL && *token != 0) {
stack_premap = atobytes(token);
}
token = strsep(&line, ",");
if (token != NULL && *token != 0) {
stack_max = atobytes(token);
}
free(dup);
__dprintf("stack_premap=%ld,stack_max=%ld\n",
stack_premap, stack_max);
break;
}
token = strsep(&line, ",");
if (token != NULL && *token != 0) {
stack_max = atobytes(token);
}
free(dup);
__dprintf("stack_premap=%ld,stack_max=%ld\n", stack_premap, stack_max);
break; }
case 'u':
uti_thread_rank = atoi(optarg);