Commit 38e01ae3 authored by Camil Staps's avatar Camil Staps 🐧 Committed by johnvg@science.ru.nl

Add -pg option and extra bit in .comp header to enable callgraph profiling

parent 9f171c0c
......@@ -105,6 +105,7 @@ Bool ParseCommandArgs (int argc, char **argv)
DoProfiling=False;
DoTimeProfiling=False;
DoCallGraphProfiling=False;
DoReuseUniqueNodes=False;
DoFusion=False;
DoGenericFusion=False;
......@@ -157,7 +158,10 @@ Bool ParseCommandArgs (int argc, char **argv)
DoProfiling=True;
else if (strcmp (argv_i,"-pt") == 0)
DoTimeProfiling=True;
else if (strcmp (argv_i,"-wmt") == 0)
else if (strcmp (argv_i,"-pg") == 0){
DoTimeProfiling=True;
DoCallGraphProfiling=True;
} else if (strcmp (argv_i,"-wmt") == 0)
WriteModificationTimes=True;
else if (strcmp (argv_i,"-wmf") == 0)
FunctionMayFailWarningOrError=1;
......
......@@ -55,9 +55,10 @@ static void error_in_function (char *m)
#define N_Do64BitArch 10
#define N_Dynamics 11
#define N_DoGenericFusion 12
#define N_DoCallGraphProfiling 13
#define MINIMUM_N_OPTIONS 9
#define N_OPTIONS 13
#define N_OPTIONS 14
static void ConvertOptionsToString (char *optstring)
{
......@@ -76,11 +77,12 @@ static void ConvertOptionsToString (char *optstring)
optstring[N_DoWarning] = DoWarning ? '1' : '0';
optstring[N_System] = '0';
if (DoFusion || ObjectSizes[RealObj]!=2 || Dynamics || DoGenericFusion){
if (DoFusion || ObjectSizes[RealObj]!=2 || Dynamics || DoGenericFusion || DoCallGraphProfiling){
optstring[N_DoFusion] = DoFusion ? '1' : '0';
optstring[N_Do64BitArch] = ObjectSizes[RealObj]!=2 ? '1' : '0';
optstring[N_Dynamics] = Dynamics ? '1' : '0';
optstring[N_DoGenericFusion] = DoGenericFusion ? '1' : '0';
optstring[N_DoCallGraphProfiling] = DoCallGraphProfiling ? '1' : '0';
optstring[N_OPTIONS]='\0';
} else
optstring[MINIMUM_N_OPTIONS]='\0';
......
......@@ -28,6 +28,7 @@ Bool Dynamics = False;
Bool DoProfiling=False; /* no longer used by memory profiler */
Bool DoTimeProfiling=False;
Bool DoCallGraphProfiling=False;
Bool DoReuseUniqueNodes = False;
Bool DoFusion = False;
......
......@@ -26,6 +26,7 @@ extern Bool Dynamics;
extern Bool DoProfiling;
extern Bool DoTimeProfiling;
extern Bool DoCallGraphProfiling;
extern Bool DoReuseUniqueNodes;
extern Bool DoFusion;
......
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