Skip to content

Commit

Permalink
Updating rix output to new standard.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy@galois.com committed Dec 14, 2006
1 parent 7d8b8c2 commit 80578b7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion includes/RtsExternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion rts/Exception.cmm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions rts/Hpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,17 @@ 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);
}
}

/*
* 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,
Expand All @@ -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);
}
}

Expand Down
3 changes: 3 additions & 0 deletions rts/Schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 80578b7

Please sign in to comment.