Changeset 133 for trunk/src


Ignore:
Timestamp:
May 5, 2008, 6:02:00 PM (11 years ago)
Author:
cameron
Message:

PAPI instrumentation of various parabix components.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bitlex.c

    r130 r133  
    992992        printf("Entered AnalyzeBuffer, buffer_limit_pos = %i\n", buffer_limit_pos);
    993993#endif
     994#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == BITLEX_ALL)
     995        code_clocker->cc_start_interval();
     996#endif
    994997        x8basis = basis;
    995998        lexer_base_pos = base_pos; /* for error reporting. */
     
    9971000        buffer_blocks = (buffer_limit_pos + BLOCKSIZE - 1)/BLOCKSIZE;
    9981001        buffer_units = buffer_limit_pos;
    999 #ifdef CODE_CLOCKING
    1000 /*
    1001         start_Interval(char_validation_clocker);
    1002 */
    1003 #endif
     1002#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == CHARSET_VALIDATION)
     1003        code_clocker->cc_start_interval();
     1004#endif
     1005
    10041006        Do_CharsetValidation();
    10051007        /* Ignore error bits before start_pos which only arise
     
    10161018                CharSetValidationError((char *) entity_Info->encoding, lexer_base_pos + err_pos);
    10171019        }
    1018 #ifdef CODE_CLOCKING
    1019 /*
    1020         end_Interval(char_validation_clocker, buffer_blocks * BLOCKSIZE);
    1021 */
    1022 #endif
    1023 #ifdef CODE_CLOCKING
    1024 /*
    1025         start_Interval(WS_Control_clocker);
    1026 */
     1020#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == CHARSET_VALIDATION)
     1021                code_clocker->cc_end_interval(buffer_units);
     1022#endif
     1023#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == WS_CONTROL)
     1024        code_clocker->cc_start_interval();
    10271025#endif
    10281026
     
    10341032        err_pos = bitstream_scan0(validation_stream);
    10351033        if (err_pos < buffer_units) XMLCharacterError(lexer_base_pos + err_pos);
    1036 #ifdef CODE_CLOCKING
    1037 /*
    1038         end_Interval(WS_Control_clocker, BUFFER_SIZE);
    1039 */
    1040 #endif
    1041 #ifdef CODE_CLOCKING
    1042 /*
    1043         start_Interval(MarkupStreams_clocker);
    1044 */
     1034#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == WS_CONTROL)
     1035        code_clocker->cc_end_interval(buffer_units);
     1036#endif
     1037#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == MARKUP_STREAMS)
     1038        code_clocker->cc_start_interval();
    10451039#endif
    10461040        Do_MarkupStreams();
     1041#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == MARKUP_STREAMS)
     1042        code_clocker->cc_end_interval(buffer_units);
     1043#endif
    10471044#ifdef DEBUG
    10481045        printf("Do_MarkupStreams() complete.\n");
    10491046#endif
    1050 #ifdef CODE_CLOCKING
    1051 /*
    1052         end_Interval(MarkupStreams_clocker, BUFFER_SIZE);
    1053 */
    1054 #endif
     1047
    10551048        if (buffer_units < BUFFER_SIZE) {
    10561049                BitBlock final_block_mask =
     
    10631056                }
    10641057        }
    1065 
    1066 }
    1067 
     1058#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == BITLEX_ALL)
     1059                code_clocker->cc_end_interval(buffer_units);
     1060#endif
     1061
     1062}
     1063
  • trunk/src/byteplex.h

    r103 r133  
    6060
    6161/* Define the size of buffer used for lexical analysis/parsing. */
    62 const int BUFFER_BLOCKS = 1024;
     62const int BUFFER_BLOCKS = 781;
    6363const int BUFFER_SIZE = BUFFER_BLOCKS * BLOCKSIZE;
    6464
  • trunk/src/engine.c

    r132 r133  
    186186template <CodeUnit_Base C>
    187187inline void ParsingEngine<C>::AdvanceBuffers(int preserve_pos){
     188#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == ADVANCE_BUFFERS)
     189        code_clocker->cc_start_interval();
     190#endif
    188191
    189192        int advance_amt = min(preserve_pos, text_or_markup_start) - buffer_base_pos;
     
    194197        buffer_limit_pos = min(BUFFER_SIZE, byteplex->units_in_buffer);
    195198        int blocks_in_buffer = (buffer_limit_pos + BLOCKSIZE - 1)/BLOCKSIZE;
     199#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == BYTEPLEX)
     200        code_clocker->cc_start_interval();
     201#endif
    196202        byteplex->DoByteplex();
    197203        byteplex->PreparePseudoASCII_Stream();
     204#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == BYTEPLEX)
     205        code_clocker->cc_end_interval(buffer_limit_pos);
     206#endif
     207#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == BITPLEX)
     208        code_clocker->cc_start_interval();
     209#endif
    198210        bitplex->TransposeToBitStreams(byteplex->x8data, blocks_in_buffer);
    199         lexer->AnalyzeBuffer(bitplex->x8basis, buffer_base_pos, buffer_rel_pos, buffer_limit_pos);
     211#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == BITPLEX)
     212        code_clocker->cc_end_interval(buffer_limit_pos);
     213#endif
     214        lexer->AnalyzeBuffer(bitplex->x8basis, buffer_base_pos, buffer_rel_pos, buffer_limit_pos);
     215#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == ADVANCE_BUFFERS)
     216        code_clocker->cc_end_interval(buffer_limit_pos);
     217#endif
     218
    200219}
    201220
     
    235254#ifndef OMIT_BITBUFFER_LIMIT_TEST_IN_ADVANCE
    236255  if (buffer_rel_pos >= BUFFER_SIZE) {
     256       
    237257        FinalizeBuffer_action(preserve_pos);
    238258        AdvanceBuffers(preserve_pos);
Note: See TracChangeset for help on using the changeset viewer.