@@ -889,6 +889,28 @@ void mapped_ariel_output_stats()
889889 tunnel->writeMessage (remap_id[thr], ac);
890890}
891891
892+ void mapped_ariel_output_stats_begin_region (const char * name)
893+ {
894+ THREADID thr = PIN_ThreadId ();
895+ ArielCommand ac;
896+ ac.command = ARIEL_OUTPUT_STATS_BEGIN_REGION;
897+ ac.instPtr = (uint64_t ) 0 ;
898+ strncpy ((char *)ac.inst .payload , name, ARIEL_MAX_PAYLOAD_SIZE - 1 );
899+ ac.inst .payload [ARIEL_MAX_PAYLOAD_SIZE-1 ]=' \0 ' ;
900+ tunnel->writeMessage (remap_id[thr], ac);
901+ }
902+ void mapped_ariel_output_stats_end_region (const char * name)
903+
904+ {
905+ THREADID thr = PIN_ThreadId ();
906+ ArielCommand ac;
907+ ac.command = ARIEL_OUTPUT_STATS_END_REGION;
908+ ac.instPtr = (uint64_t ) 0 ;
909+ strncpy ((char *)ac.inst .payload , name, ARIEL_MAX_PAYLOAD_SIZE - 1 );
910+ ac.inst .payload [ARIEL_MAX_PAYLOAD_SIZE-1 ]=' \0 ' ;
911+ tunnel->writeMessage (remap_id[thr], ac);
912+ }
913+
892914// same effect as mapped_ariel_output_stats(), but it also sends a user-defined reference number back
893915void mapped_ariel_output_stats_buoy (uint64_t marker)
894916{
@@ -1401,6 +1423,16 @@ VOID InstrumentRoutine(RTN rtn, VOID* args)
14011423 RTN_Replace (rtn, (AFUNPTR) mapped_ariel_output_stats);
14021424 fprintf (stderr, " Replacement complete\n " );
14031425 return ;
1426+ } else if (RTN_Name (rtn) == " ariel_output_stats_begin_region" || RTN_Name (rtn) == " _ariel_output_stats_begin_region" || RTN_Name (rtn) == " __arielfort_MOD_ariel_output_stats_begin_region" ) {
1427+ fprintf (stderr, " Identified routine: ariel_output_stats_begin_region, replacing with Ariel equivalent..\n " );
1428+ RTN_Replace (rtn, (AFUNPTR) mapped_ariel_output_stats_begin_region);
1429+ fprintf (stderr, " Replacement complete\n " );
1430+ return ;
1431+ } else if (RTN_Name (rtn) == " ariel_output_stats_end_region" || RTN_Name (rtn) == " _ariel_output_stats_end_region" || RTN_Name (rtn) == " __arielfort_MOD_ariel_output_stats_end_region" ) {
1432+ fprintf (stderr, " Identified routine: ariel_output_stats_end_region, replacing with Ariel equivalent..\n " );
1433+ RTN_Replace (rtn, (AFUNPTR) mapped_ariel_output_stats_end_region);
1434+ fprintf (stderr, " Replacement complete\n " );
1435+ return ;
14041436 } else if (RTN_Name (rtn) == " ariel_output_stats_buoy" || RTN_Name (rtn) == " _ariel_output_stats_buoy" ) {
14051437 fprintf (stderr, " Identified routine: ariel_output_stats_buoy, replacing with Ariel equivalent..\n " );
14061438 RTN_Replace (rtn, (AFUNPTR) mapped_ariel_output_stats_buoy);
0 commit comments