Dependence Tracing Algorithm

-- TongxinBai - 21 Jan 2008

The profiling tool is built upon a compile-time instrumentation framework and a separate tool file that contains the realizations of the instrumented functions.

Instrumentation

Each function is instrumented in one of the two modes: DETAIL and SKETCH. A text file named functions.in which is expected to be put in the source directory indicates which functions are to be instrumented in DETAIL mode.
  • In SKETCH mode each memory reference is instrumented.
  • In DETAIL mode, besides memory reference, function entry and exits will be instrumented too.
For each memory reference four items of data are passed as parameters to the instrumentation call.
  • run-time address of the memory access
  • DETAIL/SKETCH mode
  • source file name
  • line number in source code
For each function entry or exit the function name should be provided.

Realizations

The main instrumentation interfaces are:
  • _bop_prof_rec_write,
  • _bop_prof_rec_read,
  • bop_instm_func_entry, and
  • and bop_instm_func_exit

recording write

void _bop_prof_rec_write (unsigned long addr, int sketch_p, char *file_name, int line) {
   update_pseudo_time ();
   if (!sketch_p) update_fronzen_time ();
   update_write (addr, file_name, line);
}
recording read
void _bop_prof_rec_read (unsigned long addr, int sketch_p, char *file_name, int line) {
   update_pseudo_time ();
   if (!sketch_p) update_fronzen_time ();
   w = lookup_write (addr);
   if (!w) return;
   /* not a function level dependence. ignore */
   if (w->frozen_time == current_frozen_time) return;

   output_dependence ();
}
recording function entry
void bop_instm_func_entry (char *file_name, char *func_name) {
   subrt_nest++;
   output_function_entering ();
}
recording function exit
void bop_instm_func_exit (char *func_name) {
   subrt_nest--;
   output_function_leaving ();
}
Edit | Attach | Watch | Print version | History: r6 | r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 2008-01-22 - TongxinBai
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding URCS? Send feedback