Difference: DTTAlgorithm (1 vs. 6)

Revision 62008-01-22 - ChenDing

Line: 1 to 1
 
META TOPICPARENT name="GccVersion4_1_0"
Changed:
<
<

Dependence Tracing Algorithm

-- TongxinBai - 21 Jan 2008
>
>

Dependence Tracing Algorithm

 
Changed:
<
<
>
>
created by 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.
Line: 87 to 87
 Field file_name and line hold the access level location of the write while field toplev_file_name and toplev_line hold the function level location.

To help record function (top) level locations, two global variables are used, toplev_file_name and toplev_line. The two variables hold the current function level location so that they can be copied to the corresponding two fields in struct _write when a write is to be recorded.

Added:
>
>

Explanations

For a function marked for detailed recording, we would like to record the dependence between any pair of its statements, even though the actual data access happens in a function call to some other functions. The function-level dependence is between two statements of a detail recorded function. The access-level dependence is between the two statements accessing the memory.

The frozen time increments only when a statement in a detail recorded function is executed. The analyzer records a dependence only when the source and the sink happen at different frozen times. It removes from consideration dependences that span an execution without any occurrence of detail recorded statements.

More notes

Revision 52008-01-22 - TongxinBai

Line: 1 to 1
 
META TOPICPARENT name="GccVersion4_1_0"

Dependence Tracing Algorithm

-- TongxinBai - 21 Jan 2008
Line: 43 to 43
  update_pseudo_time (); if (sketch_p) { update_fronzen_time ();
Changed:
<
<
update_toplev_location ();
>
>
update_toplev_location (file_name, line);
  } w = lookup_write (addr); if (w) return;
Line: 69 to 69
  output_function_leaving (); } \ No newline at end of file
Added:
>
>
The data structure for memory write operation is
struct _write
{
   unsigned int addr;
   long long psu_time;
   long long frozen_time;
   char *file_name;
   int line;
   char *toplev_file_name;
   int toplev_line;
   struct _write *hash_next;
};
Field file_name and line hold the access level location of the write while field toplev_file_name and toplev_line hold the function level location.

To help record function (top) level locations, two global variables are used, toplev_file_name and toplev_line. The two variables hold the current function level location so that they can be copied to the corresponding two fields in struct _write when a write is to be recorded.

Revision 42008-01-22 - TongxinBai

Line: 1 to 1
 
META TOPICPARENT name="GccVersion4_1_0"

Dependence Tracing Algorithm

-- TongxinBai - 21 Jan 2008
Added:
>
>
 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

Line: 27 to 30
 
void _bop_prof_rec_write (unsigned long addr, int sketch_p, char *file_name, int line) {
   update_pseudo_time ();
Changed:
<
<
if (sketch_p) update_frozen_time ();
>
>
if (sketch_p) { update_frozen_time (); update_toplev_location (file_name, line); }
  update_write (addr, file_name, line); }
Line: 35 to 41
 
void _bop_prof_rec_read (unsigned long addr, int sketch_p, char *file_name, int line) {
   update_pseudo_time ();
Changed:
<
<
if (sketch_p) update_fronzen_time ();
>
>
if (sketch_p) { update_fronzen_time (); update_toplev_location (); }
  w = lookup_write (addr); if (w) return; /* not a function level dependence. ignore.
Line: 43 to 52
  Frozen time only increments in DETAIL mode */ if (w->frozen_time == current_frozen_time) return;
Changed:
<
<
output_dependence ();
>
>
output_dependence (...);
 } recording function entry

Revision 32008-01-22 - TongxinBai

Line: 1 to 1
 
META TOPICPARENT name="GccVersion4_1_0"
Deleted:
<
<
 

Dependence Tracing Algorithm

-- TongxinBai - 21 Jan 2008
Line: 22 to 21
 
  • _bop_prof_rec_write,
  • _bop_prof_rec_read,
  • bop_instm_func_entry, and
Changed:
<
<
  • and bop_instm_func_exit
>
>
  • 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 ();
Changed:
<
<
if (sketch_p) update_fronzen_time ();
>
>
if (sketch_p) update_frozen_time ();
  update_write (addr, file_name, line); }
Line: 39 to 38
  if (sketch_p) update_fronzen_time (); w = lookup_write (addr); if (w) return;
Changed:
<
<
/* not a function level dependence. ignore */
>
>
/* not a function level dependence. ignore. Here I use frozen time to facilitate recording function level dependences. Frozen time only increments in DETAIL mode */
  if (w->frozen_time == current_frozen_time) return;

output_dependence ();

Revision 22008-01-22 - TongxinBai

Line: 1 to 1
 
META TOPICPARENT name="GccVersion4_1_0"
Deleted:
<
<
 

Dependence Tracing Algorithm

-- TongxinBai - 21 Jan 2008
Line: 18 to 17
 
  • line number in source code
For each function entry or exit the function name should be provided.
Deleted:
<
<

Realization

 \ No newline at end of file
Added:
>
>

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 ();
}
 \ No newline at end of file

Revision 12008-01-21 - TongxinBai

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="GccVersion4_1_0"

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.

Realization

 
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