Commit bb2795db authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Merge branch 'master' of http://darcs.haskell.org/ghc

parents 60b86b04 089cb621
This diff is collapsed.
/* -----------------------------------------------------------------------------
*
* (c) The GHC Team 2000-2005
*
* RTS GTK Front Panel
*
* ---------------------------------------------------------------------------*/
#ifndef FRONTPANEL_H
#define FRONTPANEL_H
#include "BeginPrivate.h"
#ifdef RTS_GTK_FRONTPANEL
#include "Rts.h" /* needed because this file gets included by
* auto-generated code */
void initFrontPanel( void );
void stopFrontPanel( void );
void updateFrontPanelBeforeGC( nat N );
void updateFrontPanelAfterGC( nat N, W_ live );
void updateFrontPanel( void );
/* --------- PRIVATE ----------------------------------------- */
#include <gdk/gdktypes.h>
typedef enum { BeforeGC, AfterGC, BeforeAfterGC, Continuous } UpdateMode;
extern UpdateMode update_mode;
extern gboolean continue_now, stop_now, quit;
#endif /* RTS_GTK_FRONTPANEL */
#include "EndPrivate.h"
#endif /* FRONTPANEL_H */
......@@ -52,7 +52,7 @@ wchar_t **win32_prog_argv = NULL;
#endif
/*
* constants, used later
* constants, used later
*/
#define RTS 1
#define PGM 0
......@@ -111,9 +111,6 @@ void initRtsFlagsDefaults(void)
RtsFlags.GcFlags.compact = rtsFalse;
RtsFlags.GcFlags.compactThreshold = 30.0;
RtsFlags.GcFlags.sweep = rtsFalse;
#ifdef RTS_GTK_FRONTPANEL
RtsFlags.GcFlags.frontpanel = rtsFalse;
#endif
RtsFlags.GcFlags.idleGCDelayTime = USToTime(300000); // 300ms
#ifdef THREADED_RTS
RtsFlags.GcFlags.doIdleGC = rtsTrue;
......@@ -260,9 +257,6 @@ usage_text[] = {
" -t[<file>] One-line GC statistics (if <file> omitted, uses stderr)",
" -s[<file>] Summary GC statistics (if <file> omitted, uses stderr)",
" -S[<file>] Detailed GC statistics (if <file> omitted, uses stderr)",
#ifdef RTS_GTK_FRONTPANEL
" -f Display front panel (requires X11 & GTK+)",
#endif
"",
"",
" -Z Don't squeeze out update frames on stack overflow",
......@@ -292,7 +286,7 @@ usage_text[] = {
" -hb<bio>... closures with specified biographies (lag,drag,void,use)",
"",
" -R<size> Set the maximum retainer set size (default: 8)",
"",
"",
" -L<chars> Maximum length of a cost-centre stack in a heap profile",
" (default: 25)",
"",
......@@ -438,9 +432,9 @@ static void splitRtsFlags(const char *s)
while (isspace(*c1)) { c1++; };
c2 = c1;
while (!isspace(*c2) && *c2 != '\0') { c2++; };
if (c1 == c2) { break; }
t = stgMallocBytes(c2-c1+1, "RtsFlags.c:splitRtsFlags()");
strncpy(t, c1, c2-c1);
t[c2-c1] = '\0';
......@@ -449,7 +443,7 @@ static void splitRtsFlags(const char *s)
c1 = c2;
} while (*c1 != '\0');
}
/* -----------------------------------------------------------------------------
Parse the command line arguments, collecting options for the RTS.
......@@ -780,15 +774,15 @@ error = rtsTrue;
case 'F':
OPTION_UNSAFE;
RtsFlags.GcFlags.oldGenFactor = atof(rts_argv[arg]+2);
if (RtsFlags.GcFlags.oldGenFactor < 0)
bad_option( rts_argv[arg] );
break;
case 'D':
OPTION_SAFE;
DEBUG_BUILD_ONLY(
{
{
char *c;
for (c = rts_argv[arg] + 2; *c != '\0'; c++) {
......@@ -908,13 +902,6 @@ error = rtsTrue;
}
break;
#ifdef RTS_GTK_FRONTPANEL
case 'f':
OPTION_UNSAFE;
RtsFlags.GcFlags.frontpanel = rtsTrue;
break;
#endif
case 'I': /* idle GC delay */
OPTION_UNSAFE;
if (rts_argv[arg][2] == '\0') {
......@@ -951,7 +938,7 @@ error = rtsTrue;
goto stats;
stats:
{
{
int r;
if (rts_argv[arg][2] != '\0') {
OPTION_UNSAFE;
......@@ -1060,7 +1047,7 @@ error = rtsTrue;
RtsFlags.ProfFlags.modSelector = left;
break;
case 'D':
case 'd': // closure descr select
case 'd': // closure descr select
RtsFlags.ProfFlags.descrSelector = left;
break;
case 'Y':
......@@ -1114,12 +1101,12 @@ error = rtsTrue;
break;
}
break;
default:
errorBelch("invalid heap profile option: %s",rts_argv[arg]);
error = rtsTrue;
}
)
)
#endif /* PROFILING */
break;
......@@ -1266,7 +1253,7 @@ error = rtsTrue;
RtsFlags.TickyFlags.showTickyStats = rtsTrue;
{
{
int r;
if (rts_argv[arg][2] != '\0') {
OPTION_UNSAFE;
......@@ -1426,7 +1413,7 @@ static void normaliseRtsOpts (void)
if (RtsFlags.ProfFlags.heapProfileInterval > 0) {
RtsFlags.ProfFlags.heapProfileIntervalTicks =
RtsFlags.ProfFlags.heapProfileInterval /
RtsFlags.ProfFlags.heapProfileInterval /
RtsFlags.MiscFlags.tickInterval;
} else {
RtsFlags.ProfFlags.heapProfileIntervalTicks = 0;
......@@ -1538,7 +1525,7 @@ decodeSize(const char *flag, nat offset, StgWord64 min, StgWord64 max)
m = atof(s);
c = s[strlen(s)-1];
if (c == 'g' || c == 'G')
if (c == 'g' || c == 'G')
m *= 1024*1024*1024;
else if (c == 'm' || c == 'M')
m *= 1024*1024;
......@@ -1801,7 +1788,7 @@ void
setWin32ProgArgv(int argc, wchar_t *argv[])
{
int i;
freeWin32ProgArgv();
win32_prog_argc = argc;
......@@ -1809,7 +1796,7 @@ setWin32ProgArgv(int argc, wchar_t *argv[])
win32_prog_argv = NULL;
return;
}
win32_prog_argv = stgCallocBytes(argc + 1, sizeof (wchar_t *),
"setWin32ProgArgv 1");
for (i = 0; i < argc; i++) {
......
......@@ -38,10 +38,6 @@
#include "FileLock.h"
void exitLinker( void ); // there is no Linker.h file to include
#if defined(RTS_GTK_FRONTPANEL)
#include "FrontPanel.h"
#endif
#if defined(PROFILING)
# include "ProfHeap.h"
# include "RetainerProfile.h"
......@@ -237,17 +233,11 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
initDefaultHandlers();
}
#endif
#if defined(mingw32_HOST_OS) && !defined(THREADED_RTS)
startupAsyncIO();
#endif
#ifdef RTS_GTK_FRONTPANEL
if (RtsFlags.GcFlags.frontpanel) {
initFrontPanel();
}
#endif
#if X86_INIT_FPU
x86_init_fpu();
#endif
......@@ -293,7 +283,7 @@ hs_add_root(void (*init_root)(void) STG_UNUSED)
* False ==> threads doing foreign calls may return in the
* future, but will immediately block on a mutex.
* (capability->lock).
*
*
* If this RTS is a DLL that we're about to unload, then you want
* safe=True, otherwise the thread might return to code that has been
* unloaded. If this is a standalone program that is about to exit,
......@@ -317,7 +307,7 @@ hs_exit_(rtsBool wait_foreign)
/* start timing the shutdown */
stat_startExit();
OnExitHook();
flushStdHandles();
......@@ -336,7 +326,7 @@ hs_exit_(rtsBool wait_foreign)
/* run C finalizers for all active weak pointers */
runAllCFinalizers(weak_ptr_list);
#if defined(RTS_USER_SIGNALS)
if (RtsFlags.MiscFlags.install_signal_handlers) {
freeSignalHandlers();
......@@ -348,7 +338,7 @@ hs_exit_(rtsBool wait_foreign)
exitTimer(wait_foreign);
// set the terminal settings back to what they were
#if !defined(mingw32_HOST_OS)
#if !defined(mingw32_HOST_OS)
resetTerminalSettings();
#endif
......@@ -357,14 +347,14 @@ hs_exit_(rtsBool wait_foreign)
/* stop timing the shutdown, we're about to print stats */
stat_endExit();
/* shutdown the hpc support (if needed) */
exitHpc();
// clean up things from the storage manager's point of view.
// also outputs the stats (+RTS -s) info.
exitStorage();
/* free the tasks */
freeScheduler();
......@@ -385,13 +375,7 @@ hs_exit_(rtsBool wait_foreign)
freeThreadLabelTable();
#endif
#ifdef RTS_GTK_FRONTPANEL
if (RtsFlags.GcFlags.frontpanel) {
stopFrontPanel();
}
#endif
#if defined(PROFILING)
#if defined(PROFILING)
reportCCSProfiling();
#endif
......@@ -479,15 +463,15 @@ shutdownHaskellAndSignal(int sig)
}
#endif
/*
/*
* called from STG-land to exit the program
*/
void (*exitFn)(int) = 0;
void
void
stg_exit(int n)
{
{
if (exitFn)
(*exitFn)(n);
exit(n);
......
This diff is collapsed.
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