Changeset 65 for trunk/markup_stats.cxx


Ignore:
Timestamp:
Mar 16, 2008, 5:15:18 AM (11 years ago)
Author:
cameron
Message:

Add CODE_CLOCKING instrumentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/markup_stats.cxx

    r64 r65  
    1717#include <iostream>
    1818using namespace std;
     19
     20#ifdef CODE_CLOCKING
     21#include "codeclocker/clocker/code_clocker_session.h"
     22#include "codeclocker/clocker/code_clocker_session.c"
     23Code_Clocker * total_clocker;
     24#endif
     25
     26
    1927
    2028//#include "src/ilax.h"
     
    220228template <CodeUnit_Base C>
    221229inline void ParsingEngine<C>::FinalizeBuffer_action() {
     230#ifdef CODE_CLOCKING
     231end_Interval (total_clocker, buffer_rel_pos);
     232start_Interval (total_clocker);
     233#endif
    222234}
    223235
     
    225237template <CodeUnit_Base C>
    226238inline void ParsingEngine<C>::DocumentStart_action() {
     239#ifdef CODE_CLOCKING
     240start_Interval (total_clocker);
     241#endif
    227242}
    228243
    229244template <CodeUnit_Base C>
    230245inline void ParsingEngine<C>::DocumentEnd_action() {
     246#ifdef CODE_CLOCKING
     247end_Interval (total_clocker, buffer_rel_pos);
     248#endif
    231249}
    232250
     
    247265        }
    248266        char * filename = argv[1];
     267#ifdef CODE_CLOCKING
     268
     269init_Code_Clocker_Session(8, // num code clockers
     270                         64096, // max individual timestamp measurements
     271                         4ul, // num session parameters
     272                         65536, // num timestamp calibration measurements,
     273                            65534,// num constant time loop executions
     274                         8 // num constant time loop iterations
     275                         );
     276set_Session_Cmd_Line_Args(argv[0]);
     277total_clocker = register_Code_Clocker("Markup_stats_total", "Total markup_stats time\n");
     278#endif
    249279
    250280        for (int run = 0; run < REPEAT_RUNS; run++) {
     
    288318        print_stats("error item", error_item_count, error_item_length);
    289319        printf("Maximum nesting depth = %i\n", max_nesting_depth);
     320#ifdef CODE_CLOCKING
     321        write_XML_File();
     322#endif
    290323       
    291324        return(0);
Note: See TracChangeset for help on using the changeset viewer.