Skip to content
Snippets Groups Projects
Commit f1e5245a authored by BinderDavid's avatar BinderDavid Committed by Marge Bot
Browse files

Add RTS option to supress tix file

parent 6a27eb97
No related branches found
No related tags found
No related merge requests found
...@@ -387,6 +387,13 @@ data ParFlags = ParFlags ...@@ -387,6 +387,13 @@ data ParFlags = ParFlags
, Generic -- ^ @since 4.15.0.0 , Generic -- ^ @since 4.15.0.0
) )
-- | Parameters pertaining to Haskell program coverage (HPC)
data HpcFlags = HpcFlags
{ emitTixFile :: Bool
}
deriving (Show
, Generic
)
-- | Parameters of the runtime system -- | Parameters of the runtime system
-- --
-- @since 4.8.0.0 -- @since 4.8.0.0
...@@ -400,6 +407,7 @@ data RTSFlags = RTSFlags ...@@ -400,6 +407,7 @@ data RTSFlags = RTSFlags
, traceFlags :: TraceFlags , traceFlags :: TraceFlags
, tickyFlags :: TickyFlags , tickyFlags :: TickyFlags
, parFlags :: ParFlags , parFlags :: ParFlags
, hpcFlags :: HpcFlags
} deriving ( Show -- ^ @since 4.8.0.0 } deriving ( Show -- ^ @since 4.8.0.0
, Generic -- ^ @since 4.15.0.0 , Generic -- ^ @since 4.15.0.0
) )
...@@ -417,6 +425,7 @@ getRTSFlags = ...@@ -417,6 +425,7 @@ getRTSFlags =
<*> getTraceFlags <*> getTraceFlags
<*> getTickyFlags <*> getTickyFlags
<*> getParFlags <*> getParFlags
<*> getHpcFlags
peekFilePath :: Ptr () -> IO (Maybe FilePath) peekFilePath :: Ptr () -> IO (Maybe FilePath)
peekFilePath ptr peekFilePath ptr
...@@ -488,6 +497,10 @@ getParFlags = do ...@@ -488,6 +497,10 @@ getParFlags = do
<*> (toBool <$> <*> (toBool <$>
(#{peek PAR_FLAGS, setAffinity} ptr :: IO CBool)) (#{peek PAR_FLAGS, setAffinity} ptr :: IO CBool))
getHpcFlags :: IO HpcFlags
getHpcFlags = error "TODO: Implement getHpcFlags"
getConcFlags :: IO ConcFlags getConcFlags :: IO ConcFlags
getConcFlags = do getConcFlags = do
let ptr = (#ptr RTS_FLAGS, ConcFlags) rtsFlagsPtr let ptr = (#ptr RTS_FLAGS, ConcFlags) rtsFlagsPtr
......
...@@ -394,7 +394,7 @@ exitHpc(void) { ...@@ -394,7 +394,7 @@ exitHpc(void) {
#else #else
bool is_subprocess = false; bool is_subprocess = false;
#endif #endif
if (!is_subprocess) { if (!is_subprocess && RtsFlags.HpcFlags.emitTixFile) {
FILE *f = __rts_fopen(tixFilename,"w+"); FILE *f = __rts_fopen(tixFilename,"w+");
writeTix(f); writeTix(f);
} }
......
...@@ -294,6 +294,7 @@ void initRtsFlagsDefaults(void) ...@@ -294,6 +294,7 @@ void initRtsFlagsDefaults(void)
RtsFlags.TickyFlags.showTickyStats = false; RtsFlags.TickyFlags.showTickyStats = false;
RtsFlags.TickyFlags.tickyFile = NULL; RtsFlags.TickyFlags.tickyFile = NULL;
#endif #endif
RtsFlags.HpcFlags.emitTixFile = true;
} }
static const char * static const char *
...@@ -1040,6 +1041,11 @@ error = true; ...@@ -1040,6 +1041,11 @@ error = true;
RtsFlags.GcFlags.nonmovingDenseAllocatorCount = threshold; RtsFlags.GcFlags.nonmovingDenseAllocatorCount = threshold;
} }
} }
else if (strequal("emit-tix-file=false",
&rts_argv[arg][2])) {
OPTION_UNSAFE;
RtsFlags.HpcFlags.emitTixFile = false;
}
#if defined(THREADED_RTS) #if defined(THREADED_RTS)
#if defined(mingw32_HOST_OS) #if defined(mingw32_HOST_OS)
else if (!strncmp("io-manager-threads", else if (!strncmp("io-manager-threads",
......
...@@ -281,6 +281,12 @@ typedef struct _PAR_FLAGS { ...@@ -281,6 +281,12 @@ typedef struct _PAR_FLAGS {
bool setAffinity; /* force thread affinity with CPUs */ bool setAffinity; /* force thread affinity with CPUs */
} PAR_FLAGS; } PAR_FLAGS;
/* See Note [Synchronization of flags and base APIs] */
typedef struct _HPC_FLAGS {
bool emitTixFile; /* Whether the RTS should write a tix
file at the end of execution */
} HPC_FLAGS;
/* See Note [Synchronization of flags and base APIs] */ /* See Note [Synchronization of flags and base APIs] */
typedef struct _TICKY_FLAGS { typedef struct _TICKY_FLAGS {
bool showTickyStats; bool showTickyStats;
...@@ -301,6 +307,7 @@ typedef struct _RTS_FLAGS { ...@@ -301,6 +307,7 @@ typedef struct _RTS_FLAGS {
TRACE_FLAGS TraceFlags; TRACE_FLAGS TraceFlags;
TICKY_FLAGS TickyFlags; TICKY_FLAGS TickyFlags;
PAR_FLAGS ParFlags; PAR_FLAGS ParFlags;
HPC_FLAGS HpcFlags;
} RTS_FLAGS; } RTS_FLAGS;
#if defined(COMPILING_RTS_MAIN) #if defined(COMPILING_RTS_MAIN)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment