Changeset 65 for trunk/src


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

Add CODE_CLOCKING instrumentation.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bitlex.c

    r63 r65  
    1111
    1212
     13#ifdef CODE_CLOCKING
     14#include "../codeclocker/clocker/code_clocker_session.h"
     15Code_Clocker * transpose_clocker;
     16Code_Clocker * WS_Control_clocker;
     17Code_Clocker * MarkupStreams_clocker;
     18Code_Clocker * char_validation_clocker;
     19#endif
     20
     21
    1322Lexer_Interface::Lexer_Interface(XML_Buffer_Interface *b, LexicalStreamSet *l) {
    1423        xml_buf = b;
     
    3847template <>
    3948Lexer_Interface * Lexer<ASCII>::LexerFactory(XML_Buffer_Interface *b, LexicalStreamSet *l) {
     49#ifdef CODE_CLOCKING
     50transpose_clocker = register_Code_Clocker("s2p", "transposition to parallel bit streams\n");
     51WS_Control_clocker = register_Code_Clocker("WS", "WhiteSpace/Control\n");
     52MarkupStreams_clocker = register_Code_Clocker("bitlex", "Markup streams\n");
     53char_validation_clocker = register_Code_Clocker("charcheck", "Character validation\n");
     54
     55#endif
    4056        if (!(b->has_encoding_decl)) {
    4157                // Must be UTF-8 or UTF-16; UTF-16 requires a ByteOrderMark.
     
    884900
    885901void Lexer_Interface::TransposeToBitStreams() {
     902#ifdef CODE_CLOCKING
     903start_Interval(transpose_clocker);
     904#endif
    886905        BytePack * pseudoASCII_src = &(xml_buf->x8data[lexer_base_pos/PACKSIZE]);
    887906        for (int blk = 0; blk < buffer_blocks; blk++) {
    888907                s2p_bytepack(&pseudoASCII_src[blk*8], x8basis[blk].bit);
    889908        }
     909#ifdef CODE_CLOCKING
     910end_Interval(transpose_clocker, buffer_blocks * BLOCKSIZE);
     911#endif
    890912}
    891913
     
    921943        printf("Transposition to bit streams complete.\n");
    922944#endif
     945#ifdef CODE_CLOCKING
     946start_Interval(WS_Control_clocker);
     947#endif
    923948        if (xml_buf->version == XML_1_1) Do_XML_11_WS_Control();
    924949        else Do_XML_10_WS_Control();
     950#ifdef CODE_CLOCKING
     951end_Interval(WS_Control_clocker, buffer_blocks * BLOCKSIZE);
     952#endif
     953#ifdef CODE_CLOCKING
     954start_Interval(MarkupStreams_clocker);
     955#endif
    925956        Do_MarkupStreams();
     957#ifdef CODE_CLOCKING
     958end_Interval(MarkupStreams_clocker, buffer_blocks * BLOCKSIZE);
     959#endif
     960
    926961#ifdef DEBUG
    927962        printf("Markup streams complete.\n");
    928963#endif
     964#ifdef CODE_CLOCKING
     965//start_Interval(char_validation_clocker);
     966#endif
    929967        Do_CharsetValidation();
     968#ifdef CODE_CLOCKING
     969//end_Interval(char_validation_clocker, buffer_blocks * BLOCKSIZE);
     970#endif
    930971#ifdef DEBUG
    931972        printf("Validation complete.\n");
  • trunk/src/xmlbuffer.h

    r54 r65  
    159159public:
    160160        U32_Buffer(BytePack * src, int lgth, int BOM);
    161     ~U32_Buffer();
     161        ~U32_Buffer();
    162162        virtual void DoByteplex() = 0;
    163163        void PreparePseudoASCII_Stream();
Note: See TracChangeset for help on using the changeset viewer.