Changeset 27 for trunk


Ignore:
Timestamp:
2006-05-26T04:30:20+02:00 (8 years ago)
Author:
moo
Message:

rename coverage -> coverager

Location:
trunk
Files:
3 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/config.m4

    r26 r27  
    3030  XCACHE_MODULES="cacher" 
    3131  XCACHE_OPTION([optimizer],    [optimizer   ], [XCACHE_OPTIMIZER],    [(N/A)]) 
    32   XCACHE_OPTION([coverage],     [coverage    ], [XCACHE_COVERAGE],     [Enable code coverage dumper, NOT for production server]) 
     32  XCACHE_OPTION([coverager],    [coverager   ], [XCACHE_COVERAGER],    [Enable code coverage dumper, NOT for production server]) 
    3333  XCACHE_OPTION([assembler],    [assembler   ], [XCACHE_ASSEMBLER],    [(N/A)]) 
    3434  XCACHE_OPTION([disassembler], [disassembler], [XCACHE_DISASSEMBLER], [Enable opcode to php variable dumper, NOT for production server]) 
  • trunk/config.w32

    r26 r27  
    1717    // {{{ add sources on enabled 
    1818    ARG_ENABLE("xcache-optimizer",    "(N/A)", "no"); 
    19     ARG_ENABLE("xcache-coverage",     "Enable code coverage dumper, NOT for production server", "no"); 
     19    ARG_ENABLE("xcache-coverager",    "Enable code coverage dumper, NOT for production server", "no"); 
    2020    ARG_ENABLE("xcache-assembler",    "(N/A)", "no"); 
    2121    ARG_ENABLE("xcache-disassembler", "Enable opcode to php variable dumper, NOT for production server", "no"); 
     
    2525    var XCACHE_MODULES = "cacher"; 
    2626    var options = ["optimizer", 
    27                    "coverage", 
     27                   "coverager", 
    2828                   "assembler", "disassembler", 
    2929                   "encoder", "decoder"]; 
  • trunk/coverager.c

    r17 r27  
    1111#include "stack.h" 
    1212#include "xcache_globals.h" 
    13 #include "coverage.h" 
     13#include "coverager.h" 
    1414#include "utils.h" 
    15 typedef HashTable *coverage_t; 
     15typedef HashTable *coverager_t; 
    1616#define PCOV_HEADER_MAGIC 0x564f4350 
    1717 
     
    2323static void xc_destroy_coverage(void *pDest) /* {{{ */ 
    2424{ 
    25     coverage_t cov = *(coverage_t*) pDest; 
     25    coverager_t cov = *(coverager_t*) pDest; 
    2626#ifdef DEBUG 
    2727    fprintf(stderr, "destroy %p\n", cov); 
     
    6565} 
    6666/* }}} */ 
    67 static void xc_coverage_save_cov(char *srcfile, char *outfilename, coverage_t cov TSRMLS_DC) /* {{{ */ 
     67static void xc_coverager_save_cov(char *srcfile, char *outfilename, coverager_t cov TSRMLS_DC) /* {{{ */ 
    6868{ 
    6969    long *buf = NULL, *p; 
     
    193193} 
    194194/* }}} */ 
    195 void xc_coverage_request_init(TSRMLS_D) /* {{{ */ 
     195void xc_coverager_request_init(TSRMLS_D) /* {{{ */ 
    196196{ 
    197197    if (XG(coveragedumper)) { 
     
    201201} 
    202202/* }}} */ 
    203 void xc_coverage_request_shutdown(TSRMLS_D) /* {{{ */ 
    204 { 
    205     coverage_t *pcov; 
     203void xc_coverager_request_shutdown(TSRMLS_D) /* {{{ */ 
     204{ 
     205    coverager_t *pcov; 
    206206    zstr s; 
    207207    char *outfilename; 
     
    231231            fprintf(stderr, "outfilename %s\n", outfilename); 
    232232#endif 
    233             xc_coverage_save_cov(ZSTR_S(s), outfilename, *pcov TSRMLS_CC); 
     233            xc_coverager_save_cov(ZSTR_S(s), outfilename, *pcov TSRMLS_CC); 
    234234            zend_hash_move_forward(XG(coverages)); 
    235235        } 
     
    243243 
    244244/* helper func to store hits into coverages */ 
    245 static coverage_t xc_coverage_get(char *filename TSRMLS_DC) /* {{{ */ 
     245static coverager_t xc_coverager_get(char *filename TSRMLS_DC) /* {{{ */ 
    246246{ 
    247247    int len = strlen(filename) + 1; 
    248     coverage_t cov, *pcov; 
     248    coverager_t cov, *pcov; 
    249249 
    250250    if (zend_hash_find(XG(coverages), filename, len, (void **) &pcov) == SUCCESS) { 
     
    265265} 
    266266/* }}} */ 
    267 static void xc_coverage_add_hits(HashTable *cov, long line, long hits TSRMLS_DC) /* {{{ */ 
     267static void xc_coverager_add_hits(HashTable *cov, long line, long hits TSRMLS_DC) /* {{{ */ 
    268268{ 
    269269    long *poldhits; 
     
    285285/* }}} */ 
    286286 
    287 static int xc_coverage_get_op_array_size_no_tail(zend_op_array *op_array) /* {{{ */ 
     287static int xc_coverager_get_op_array_size_no_tail(zend_op_array *op_array) /* {{{ */ 
    288288{ 
    289289    zend_uint size; 
     
    309309 
    310310/* prefill */ 
    311 static int xc_coverage_init_op_array(zend_op_array *op_array TSRMLS_DC) /* {{{ */ 
     311static int xc_coverager_init_op_array(zend_op_array *op_array TSRMLS_DC) /* {{{ */ 
    312312{ 
    313313    zend_uint size; 
    314     coverage_t cov; 
     314    coverager_t cov; 
    315315    zend_uint i; 
    316316 
     
    319319    } 
    320320 
    321     size = xc_coverage_get_op_array_size_no_tail(op_array); 
    322     cov = xc_coverage_get(op_array->filename TSRMLS_CC); 
     321    size = xc_coverager_get_op_array_size_no_tail(op_array); 
     322    cov = xc_coverager_get(op_array->filename TSRMLS_CC); 
    323323    for (i = 0; i < size; i ++) { 
    324324        switch (op_array->opcodes[i].opcode) { 
     
    328328            case ZEND_EXT_FCALL_END: 
    329329#endif 
    330                 xc_coverage_add_hits(cov, op_array->opcodes[i].lineno, -1 TSRMLS_CC); 
     330                xc_coverager_add_hits(cov, op_array->opcodes[i].lineno, -1 TSRMLS_CC); 
    331331                break; 
    332332        } 
     
    335335} 
    336336/* }}} */ 
    337 static void xc_coverage_init_compile_result(zend_op_array *op_array TSRMLS_DC) /* {{{ */ 
     337static void xc_coverager_init_compile_result(zend_op_array *op_array TSRMLS_DC) /* {{{ */ 
    338338{ 
    339339    xc_compile_result_t cr; 
    340340 
    341341    xc_compile_result_init_cur(&cr, op_array TSRMLS_CC); 
    342     xc_apply_op_array(&cr, (apply_func_t) xc_coverage_init_op_array TSRMLS_CC); 
     342    xc_apply_op_array(&cr, (apply_func_t) xc_coverager_init_op_array TSRMLS_CC); 
    343343    xc_compile_result_free(&cr); 
    344344} 
     
    350350    op_array = origin_compile_file(h, type TSRMLS_CC); 
    351351    if (XG(coveragedumper) && XG(coverages)) { 
    352         xc_coverage_init_compile_result(op_array TSRMLS_CC); 
     352        xc_coverager_init_compile_result(op_array TSRMLS_CC); 
    353353    } 
    354354    return op_array; 
     
    357357 
    358358/* hits */ 
    359 void xc_coverage_handle_ext_stmt(zend_op_array *op_array, zend_uchar op) /* {{{ */ 
     359void xc_coverager_handle_ext_stmt(zend_op_array *op_array, zend_uchar op) /* {{{ */ 
    360360{ 
    361361    TSRMLS_FETCH(); 
    362362 
    363363    if (XG(coveragedumper) && XG(coverages)) { 
    364         int size = xc_coverage_get_op_array_size_no_tail(op_array); 
     364        int size = xc_coverager_get_op_array_size_no_tail(op_array); 
    365365        int oplineno = (*EG(opline_ptr)) - op_array->opcodes; 
    366366        if (oplineno < size) { 
    367             xc_coverage_add_hits(xc_coverage_get(op_array->filename TSRMLS_CC), (*EG(opline_ptr))->lineno, 1 TSRMLS_CC); 
     367            xc_coverager_add_hits(xc_coverager_get(op_array->filename TSRMLS_CC), (*EG(opline_ptr))->lineno, 1 TSRMLS_CC); 
    368368        } 
    369369    } 
     
    372372 
    373373/* init/destroy */ 
    374 int xc_coverage_init(int module_number TSRMLS_DC) /* {{{ */ 
     374int xc_coverager_init(int module_number TSRMLS_DC) /* {{{ */ 
    375375{ 
    376376    if (xc_coveragedump_dir) { 
     
    390390} 
    391391/* }}} */ 
    392 void xc_coverage_destroy() /* {{{ */ 
     392void xc_coverager_destroy() /* {{{ */ 
    393393{ 
    394394    if (origin_compile_file == xc_compile_file_for_coverage) { 
     
    403403 
    404404/* user api */ 
    405 PHP_FUNCTION(xcache_coverage_decode) /* {{{ */ 
     405PHP_FUNCTION(xcache_coverager_decode) /* {{{ */ 
    406406{ 
    407407    char *str; 
     
    422422    if (*p++ != PCOV_HEADER_MAGIC) { 
    423423#ifdef DEBUG 
    424         fprintf(stderr, "wrong magic in xcache_coverage_decode"); 
     424        fprintf(stderr, "wrong magic in xcache_coverager_decode"); 
    425425#endif 
    426426        return; 
  • trunk/coverager.h

    r17 r27  
    44extern char *xc_coveragedump_dir; 
    55 
    6 void xc_coverage_handle_ext_stmt(zend_op_array *op_array, zend_uchar op); 
    7 int xc_coverage_init(int module_number TSRMLS_DC); 
    8 void xc_coverage_destroy(); 
    9 void xc_coverage_request_init(TSRMLS_D); 
    10 void xc_coverage_request_shutdown(TSRMLS_D); 
    11 PHP_FUNCTION(xcache_coverage_decode); 
     6void xc_coverager_handle_ext_stmt(zend_op_array *op_array, zend_uchar op); 
     7int xc_coverager_init(int module_number TSRMLS_DC); 
     8void xc_coverager_destroy(); 
     9void xc_coverager_request_init(TSRMLS_D); 
     10void xc_coverager_request_shutdown(TSRMLS_D); 
     11PHP_FUNCTION(xcache_coverager_decode); 
  • trunk/xcache.c

    r26 r27  
    1717#include "xcache.h" 
    1818#include "optimizer.h" 
    19 #include "coverage.h" 
     19#include "coverager.h" 
    2020#include "disassembler.h" 
    2121#include "align.h" 
     
    10161016#endif 
    10171017    } 
    1018 #ifdef HAVE_XCACHE_COVERAGE 
    1019     xc_coverage_request_init(TSRMLS_C); 
     1018#ifdef HAVE_XCACHE_COVERAGER 
     1019    xc_coverager_request_init(TSRMLS_C); 
    10201020#endif 
    10211021} 
     
    10241024{ 
    10251025    xc_entry_unholds(TSRMLS_C); 
    1026 #ifdef HAVE_XCACHE_COVERAGE 
    1027     xc_coverage_request_shutdown(TSRMLS_C); 
     1026#ifdef HAVE_XCACHE_COVERAGER 
     1027    xc_coverager_request_shutdown(TSRMLS_C); 
    10281028#endif 
    10291029} 
     
    16211621    PHP_FE(xcache_decode_string,     NULL) 
    16221622#endif 
    1623 #ifdef HAVE_XCACHE_COVERAGE 
    1624     PHP_FE(xcache_coverage_decode,   NULL) 
     1623#ifdef HAVE_XCACHE_COVERAGER 
     1624    PHP_FE(xcache_coverager_decode,  NULL) 
    16251625#endif 
    16261626    PHP_FE(xcache_get_special_value, NULL) 
     
    17351735    STD_PHP_INI_BOOLEAN("xcache.optimizer",              "0", PHP_INI_ALL,    OnUpdateBool,        optimizer,         zend_xcache_globals, xcache_globals) 
    17361736#endif 
    1737 #ifdef HAVE_XCACHE_COVERAGE 
     1737#ifdef HAVE_XCACHE_COVERAGER 
    17381738    PHP_INI_ENTRY1     ("xcache.coveragedump_directory",  "", PHP_INI_SYSTEM, xc_OnUpdateString,   &xc_coveragedump_dir) 
    17391739    STD_PHP_INI_BOOLEAN("xcache.coveragedumper" ,        "1", PHP_INI_ALL,    OnUpdateBool,        coveragedumper,    zend_xcache_globals, xcache_globals) 
     
    18361836    } 
    18371837 
    1838 #ifdef HAVE_XCACHE_COVERAGE 
    1839     xc_coverage_init(module_number TSRMLS_CC); 
     1838#ifdef HAVE_XCACHE_COVERAGER 
     1839    xc_coverager_init(module_number TSRMLS_CC); 
    18401840#endif 
    18411841 
     
    18581858    } 
    18591859 
    1860 #ifdef HAVE_XCACHE_COVERAGE 
    1861     xc_coverage_destroy(); 
     1860#ifdef HAVE_XCACHE_COVERAGER 
     1861    xc_coverager_destroy(); 
    18621862#endif 
    18631863 
     
    19471947ZEND_DLEXPORT void xcache_statement_handler(zend_op_array *op_array) /* {{{ */ 
    19481948{ 
    1949 #ifdef HAVE_XCACHE_COVERAGE 
    1950     xc_coverage_handle_ext_stmt(op_array, ZEND_EXT_STMT); 
     1949#ifdef HAVE_XCACHE_COVERAGER 
     1950    xc_coverager_handle_ext_stmt(op_array, ZEND_EXT_STMT); 
    19511951#endif 
    19521952} 
     
    19551955{ 
    19561956#if 0 
    1957     xc_coverage_handle_ext_stmt(op_array, ZEND_EXT_FCALL_BEGIN); 
     1957    xc_coverager_handle_ext_stmt(op_array, ZEND_EXT_FCALL_BEGIN); 
    19581958#endif 
    19591959} 
     
    19621962{ 
    19631963#if 0 
    1964     xc_coverage_handle_ext_stmt(op_array, ZEND_EXT_FCALL_END); 
     1964    xc_coverager_handle_ext_stmt(op_array, ZEND_EXT_FCALL_END); 
    19651965#endif 
    19661966} 
Note: See TracChangeset for help on using the changeset viewer.