1 Only have cost centres etc if @PROFILING@ defined
6 #if defined (PROFILING) || defined(PAR)
9 %************************************************************************
11 \subsection[timer-interrupts]{Processing of Profiling Timer Signals}
13 %************************************************************************
15 Problem: If we set @HpLim = Hp@ in handler neither can be in registers!
16 Rather add test for flag to Hp check macros.
20 I_ time_profiling = 0; /* Flag to indicate timer/serial profiling */
22 I_ interval_expired = 0; /* Flag tested by HP_CHK routines */
23 I_ current_interval = 1; /* Current interval number -- stored in AGE */
24 I_ interval_ticks = DEFAULT_INTERVAL; /* No of ticks in an interval */
26 I_ previous_ticks = 0; /* ticks in previous intervals */
27 I_ current_ticks = 0; /* ticks in current interval */
30 set_profile_timer(I_ ms)
32 if (initialize_virtual_timer(ms)) {
34 fprintf(stderr, "Can't initialize virtual timer.\n");
40 handle_tick_serial(STG_NO_ARGS)
44 /* fprintf(stderr,"tick for %s\n", CCC->label); */
45 #if defined(PROFILING) && defined(DEBUG)
46 /* Why is this here? --JSM Debugging --WDP */
47 if (CCC == STATIC_CC_REF(CC_OVERHEAD))
51 if (++current_ticks >= interval_ticks && CCC != STATIC_CC_REF(CC_GC)) {
52 #if defined(PROFILING)
53 interval_expired = 1; /* stop to process interval */
55 report_cc_profiling(0 /*partial*/);
56 restart_time_profiler();
63 handle_tick_noserial(STG_NO_ARGS)
72 { /* Stops time profile */
79 restart_time_profiler()
80 { /* Restarts time profile */
81 #if defined(PROFILING)
86 previous_ticks += current_ticks;
94 { /* Starts time profile */
97 set_profile_timer(RTSflags.CcFlags.msecsPerTick);
99 set_profile_timer(TICK_MILLISECS);
106 #endif /* PROFILING || PAR */