1 Only have cost centres etc if @USE_COST_CENTRES@ defined
6 #if defined (USE_COST_CENTRES) || defined(GUM)
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 I_ tick_millisecs; /* milliseconds per timer tick */
37 if (initialize_virtual_timer(ms)) {
39 fprintf(stderr, "Can't initialize virtual timer.\n");
45 handle_tick_serial(STG_NO_ARGS)
49 /* fprintf(stderr,"tick for %s\n", CCC->label); */
50 #if defined(USE_COST_CENTRES) && defined(DEBUG)
51 /* Why is this here? --JSM Debugging --WDP */
52 if (CCC == STATIC_CC_REF(CC_OVERHEAD))
56 if (++current_ticks >= interval_ticks && CCC != STATIC_CC_REF(CC_GC)) {
57 #if defined(USE_COST_CENTRES)
58 interval_expired = 1; /* stop to process interval */
60 report_cc_profiling(0 /*partial*/);
61 restart_time_profiler();
68 handle_tick_noserial(STG_NO_ARGS)
76 { /* Stops time profile */
83 restart_time_profiler()
84 { /* Restarts time profile */
85 #if defined(USE_COST_CENTRES)
90 previous_ticks += current_ticks;
98 { /* Starts time profile */
101 set_profile_timer(tick_millisecs);
103 set_profile_timer(TICK_MILLISECS);
110 #endif /* USE_COST_CENTRES || GUM */