diff options
| author | andy@galois.com <unknown> | 2006-12-14 23:52:10 +0000 |
|---|---|---|
| committer | andy@galois.com <unknown> | 2006-12-14 23:52:10 +0000 |
| commit | 80578b7defea703ad24efa908534a13e2ebc880b (patch) | |
| tree | 2b4463e07e3d2fe2f6f335942bfcdb4d5eade0b3 | |
| parent | 7d8b8c2b314a98171678d037fbf5f9aadff13390 (diff) | |
| download | haskell-80578b7defea703ad24efa908534a13e2ebc880b.tar.gz | |
Updating rix output to new standard.
| -rw-r--r-- | includes/RtsExternal.h | 2 | ||||
| -rw-r--r-- | rts/Exception.cmm | 2 | ||||
| -rw-r--r-- | rts/Hpc.c | 8 | ||||
| -rw-r--r-- | rts/Schedule.c | 3 |
4 files changed, 9 insertions, 6 deletions
diff --git a/includes/RtsExternal.h b/includes/RtsExternal.h index b917dcf141..a105194487 100644 --- a/includes/RtsExternal.h +++ b/includes/RtsExternal.h @@ -69,7 +69,7 @@ extern void freeHaskellFunctionPtr(void* ptr); /* Hpc stuff */ extern int hs_hpc_module(char *modName,int modCount,StgWord64 *tixArr); extern void hs_hpc_tick(int globIx,struct StgTSO_ *current_tso); -extern void hs_hpc_throw(struct StgTSO_ *current_tso); +extern void hs_hpc_event(char *msg,struct StgTSO_ *current_tso); #if defined(mingw32_HOST_OS) diff --git a/rts/Exception.cmm b/rts/Exception.cmm index 641459b330..ae123f9421 100644 --- a/rts/Exception.cmm +++ b/rts/Exception.cmm @@ -338,7 +338,7 @@ raisezh_fast #endif /* Inform the Hpc that an exception has been thrown */ - foreign "C" hs_hpc_throw(CurrentTSO); + foreign "C" hs_hpc_event("Raise",CurrentTSO); retry_pop_stack: StgTSO_sp(CurrentTSO) = Sp; @@ -251,9 +251,9 @@ send_ThreadId(StgTSO *current_tso) { // This assumes that there is no real thread 0. StgThreadID tid = (current_tso == 0) ? 0 : current_tso->id; if (tid != previous_tid) { - previous_tid = current_tso->id; + previous_tid = tid; // How do we print StgWord32's without a cast? - fprintf(rixFile,"Thread %d\n",(unsigned int)tid); + fprintf(rixFile,"Thread Switch %d\n",(unsigned int)tid); } } @@ -261,7 +261,7 @@ send_ThreadId(StgTSO *current_tso) { * Called on *every* exception thrown */ void -hs_hpc_throw(StgTSO *current_tso) { +hs_hpc_event(char *msg,StgTSO *current_tso) { // Assumes that we have had at least *one* tick first. // All exceptions before the first tick are not reported. // The only time this might be an issue is in bootstrapping code, @@ -272,7 +272,7 @@ hs_hpc_throw(StgTSO *current_tso) { if (rixFile != NULL) { assert(hpc_inited != 0); send_ThreadId(current_tso); - fprintf(rixFile,"Throw\n"); + fprintf(rixFile,"%s\n",msg); } } diff --git a/rts/Schedule.c b/rts/Schedule.c index c61e623a03..8ebedd4279 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -1808,6 +1808,9 @@ scheduleHandleThreadFinished (Capability *cap STG_UNUSED, Task *task, StgTSO *t) debugTrace(DEBUG_sched, "--++ thread %lu (%s) finished", (unsigned long)t->id, whatNext_strs[t->what_next]); + /* Inform the Hpc that a thread has finished */ + hs_hpc_event("Thread Finished",t); + #if defined(GRAN) endThread(t, CurrentProc); // clean-up the thread #elif defined(PARALLEL_HASKELL) |
