Commit 3c22fb21 authored by simonmar's avatar simonmar
Browse files

[project @ 2001-11-28 14:55:34 by simonmar]

The curly braces around heap profile selectors are now optional (and
deprecated).

Two reasons: having to quote the options is a real PITA and gets even
worse when trying to use them from a Makefile, and this also brings us
closer to nhc's option format.
parent 4746806f
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* $Id: RtsFlags.c,v 1.53 2001/11/26 16:54:21 simonmar Exp $ * $Id: RtsFlags.c,v 1.54 2001/11/28 14:55:34 simonmar Exp $
* *
* (c) The AQUA Project, Glasgow University, 1994-1997 * (c) The AQUA Project, Glasgow University, 1994-1997
* (c) The GHC Team, 1998-1999 * (c) The GHC Team, 1998-1999
...@@ -426,12 +426,12 @@ usage_text[] = { ...@@ -426,12 +426,12 @@ usage_text[] = {
" r = retainer", " r = retainer",
" b = biography (LAG,DRAG,VOID,USE)", " b = biography (LAG,DRAG,VOID,USE)",
" A subset of closures may be selected thusly:", " A subset of closures may be selected thusly:",
" -hc{cc,cc ...} specific cost centre(s) (NOT STACKS!)", " -hc<cc>,... specific cost centre(s) (NOT STACKS!)",
" -hm{mod,mod...} all cost centres from the specified modules(s)", " -hm<mod>... all cost centres from the specified modules(s)",
" -hd{des,des...} closures with specified closure descriptions", " -hd<des>,... closures with specified closure descriptions",
" -hy{typ,typ...} closures with specified type descriptions", " -hy<typ>... closures with specified type descriptions",
" -hr{cc,cc...} closures with specified retainers", " -hr<cc>... closures with specified retainers",
" -hb{bio,bio...} closures with specified biographies (lag,drag,void,use)", " -hb<bio>... closures with specified biographies (lag,drag,void,use)",
"", "",
" -R<size> Set the maximum retainer set size (default: 8)", " -R<size> Set the maximum retainer set size (default: 8)",
"", "",
...@@ -875,46 +875,49 @@ error = rtsTrue; ...@@ -875,46 +875,49 @@ error = rtsTrue;
{ {
char *left = strchr(rts_argv[arg], '{'); char *left = strchr(rts_argv[arg], '{');
char *right = strrchr(rts_argv[arg], '}'); char *right = strrchr(rts_argv[arg], '}');
if (! left || ! right ||
strrchr(rts_argv[arg], '{') != left || // curly braces are optional, for
strchr(rts_argv[arg], '}') != right) { // backwards compat.
prog_belch( if (left)
"Invalid heap profiling selection bracketing\n %s\n", left = left+1;
rts_argv[arg]); else
error = rtsTrue; left = rts_argv[arg] + 3;
} else {
*right = '\0'; if (!right)
switch (rts_argv[arg][2]) { right = rts_argv[arg] + strlen(rts_argv[arg]);
case 'C':
case 'c': // cost centre label select *right = '\0';
RtsFlags.ProfFlags.ccSelector = left + 1;
break; switch (rts_argv[arg][2]) {
case 'M': case 'C':
case 'm': // cost centre module select case 'c': // cost centre label select
RtsFlags.ProfFlags.modSelector = left + 1; RtsFlags.ProfFlags.ccSelector = left;
break; break;
case 'D': case 'M':
case 'd': // closure descr select case 'm': // cost centre module select
RtsFlags.ProfFlags.descrSelector = left + 1; RtsFlags.ProfFlags.modSelector = left;
break; break;
case 'Y': case 'D':
case 'y': // closure type select case 'd': // closure descr select
RtsFlags.ProfFlags.typeSelector = left + 1; RtsFlags.ProfFlags.descrSelector = left;
break; break;
case 'R': case 'Y':
case 'r': // retainer select case 'y': // closure type select
RtsFlags.ProfFlags.retainerSelector = left + 1; RtsFlags.ProfFlags.typeSelector = left;
break; break;
case 'B': case 'R':
case 'b': // biography select case 'r': // retainer select
RtsFlags.ProfFlags.bioSelector = left + 1; RtsFlags.ProfFlags.retainerSelector = left;
break; break;
} case 'B':
case 'b': // biography select
RtsFlags.ProfFlags.bioSelector = left;
break;
} }
} }
break; break;
} }
if (RtsFlags.ProfFlags.doHeapProfile != 0) { if (RtsFlags.ProfFlags.doHeapProfile != 0) {
prog_belch("multiple heap profile options"); prog_belch("multiple heap profile options");
error = rtsTrue; error = rtsTrue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment