Changeset 8821

Show
Ignore:
Timestamp:
04/26/11 17:00:09 (2 years ago)
Author:
walt
Message:

formatting changes

Location:
branches/Orange-Branch/src
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/Orange-Branch/src/common/misc/pint-perf-counter.c

    r6268 r8821  
    8080    /* allocate time arrays */ 
    8181    pc->start_time_array_ms = 
    82         (uint64_t*)malloc(PERF_DEFAULT_HISTORY_SIZE*sizeof(uint64_t)); 
     82            (uint64_t*)malloc(PERF_DEFAULT_HISTORY_SIZE*sizeof(uint64_t)); 
    8383    if(!pc->start_time_array_ms) 
    8484    { 
     
    8888    } 
    8989    pc->interval_array_ms =  
    90         (uint64_t*)malloc(PERF_DEFAULT_HISTORY_SIZE*sizeof(uint64_t)); 
     90            (uint64_t*)malloc(PERF_DEFAULT_HISTORY_SIZE*sizeof(uint64_t)); 
    9191    if(!pc->interval_array_ms) 
    9292    { 
     
    9797    } 
    9898    memset(pc->start_time_array_ms, 0, 
    99         PERF_DEFAULT_HISTORY_SIZE*sizeof(uint64_t)); 
     99            PERF_DEFAULT_HISTORY_SIZE*sizeof(uint64_t)); 
    100100    memset(pc->interval_array_ms, 0, 
    101         PERF_DEFAULT_HISTORY_SIZE*sizeof(uint64_t)); 
     101            PERF_DEFAULT_HISTORY_SIZE*sizeof(uint64_t)); 
    102102         
    103103    /* allocate value matrix */ 
     
    115115    { 
    116116        pc->value_matrix[i] = 
    117             (int64_t*)malloc(pc->history_size*sizeof(int64_t)); 
     117                (int64_t*)malloc(pc->history_size*sizeof(int64_t)); 
    118118        if(!pc->value_matrix[i]) 
    119119        { 
     
    154154    /* zero out all fields */ 
    155155    memset(pc->start_time_array_ms, 0, 
    156         PERF_DEFAULT_HISTORY_SIZE*sizeof(uint64_t)); 
     156            PERF_DEFAULT_HISTORY_SIZE*sizeof(uint64_t)); 
    157157    memset(pc->interval_array_ms, 0, 
    158         PERF_DEFAULT_HISTORY_SIZE*sizeof(uint64_t)); 
     158            PERF_DEFAULT_HISTORY_SIZE*sizeof(uint64_t)); 
    159159    for(i=0; i<pc->key_count; i++) 
    160160    { 
     
    179179 */ 
    180180void PINT_perf_finalize( 
    181     struct PINT_perf_counter* pc)    /**< pointer to counter instance */ 
     181        struct PINT_perf_counter* pc)    /**< pointer to counter instance */ 
    182182{ 
    183183    int i; 
     
    201201 * \see PINT_perf_count macro 
    202202 */ 
    203 void __PINT_perf_count( 
    204     struct PINT_perf_counter* pc, 
    205     int key,  
    206     int64_t value, 
    207     enum PINT_perf_ops op) 
     203void __PINT_perf_count( struct PINT_perf_counter* pc, 
     204                        int key,  
     205                        int64_t value, 
     206                        enum PINT_perf_ops op) 
    208207{ 
    209208    if(!pc) 
     
    247246 * rolls over the current history window 
    248247 */ 
    249 void PINT_perf_rollover( 
    250     struct PINT_perf_counter* pc) 
     248void PINT_perf_rollover( struct PINT_perf_counter* pc) 
    251249{ 
    252250    int i; 
     
    271269        { 
    272270            memmove(&pc->value_matrix[i][1], &pc->value_matrix[i][0], 
    273                 ((pc->history_size-1)*sizeof(int64_t))); 
     271                    ((pc->history_size-1)*sizeof(int64_t))); 
    274272        } 
    275273        memmove(&pc->interval_array_ms[1], &pc->interval_array_ms[0], 
    276             ((pc->history_size-1)*sizeof(uint64_t))); 
     274                ((pc->history_size-1)*sizeof(uint64_t))); 
    277275        memmove(&pc->start_time_array_ms[1], &pc->start_time_array_ms[0], 
    278             ((pc->history_size-1)*sizeof(uint64_t))); 
     276                ((pc->history_size-1)*sizeof(uint64_t))); 
    279277        if(int_time > pc->start_time_array_ms[1]) 
    280278        { 
     
    305303 * \returns 0 on success, -PVFS_error on failure 
    306304 */ 
    307 int PINT_perf_set_info( 
    308     struct PINT_perf_counter* pc, 
    309     enum PINT_perf_option option, 
    310     unsigned int arg) 
     305int PINT_perf_set_info(  struct PINT_perf_counter* pc, 
     306                         enum PINT_perf_option option, 
     307                         unsigned int arg) 
    311308{ 
    312309    uint64_t* tmp_unsigned; 
     
    335332                 */ 
    336333                PINT_PERF_REALLOC_ARRAY(pc, 
    337                     tmp_unsigned, 
    338                     pc->start_time_array_ms, 
    339                     arg, 
    340                     uint64_t); 
     334                        tmp_unsigned, 
     335                        pc->start_time_array_ms, 
     336                        arg, 
     337                        uint64_t); 
    341338                PINT_PERF_REALLOC_ARRAY(pc, 
    342                     tmp_unsigned, 
    343                     pc->interval_array_ms, 
    344                     arg, 
    345                     uint64_t); 
     339                        tmp_unsigned, 
     340                        pc->interval_array_ms, 
     341                        arg, 
     342                        uint64_t); 
    346343                for(i=0; i<pc->key_count; i++) 
    347344                { 
    348345                    PINT_PERF_REALLOC_ARRAY(pc, 
    349                         tmp_signed, 
    350                         pc->value_matrix[i], 
    351                         arg, 
    352                         int64_t); 
     346                            tmp_signed, 
     347                            pc->value_matrix[i], 
     348                            arg, 
     349                            int64_t); 
    353350                } 
    354351                pc->history_size = arg; 
     
    368365 * \returns 0 on success, -PVFS_error on failure 
    369366 */ 
    370 int PINT_perf_get_info( 
    371     struct PINT_perf_counter* pc, 
    372     enum PINT_perf_option option, 
    373     unsigned int* arg) 
     367int PINT_perf_get_info( struct PINT_perf_counter* pc, 
     368                        enum PINT_perf_option option, 
     369                        unsigned int* arg) 
    374370{ 
    375371    if(!pc) 
     
    401397 */ 
    402398void PINT_perf_retrieve( 
    403     struct PINT_perf_counter* pc,        /**< performance counter */ 
    404     int64_t** value_matrix, /**< 2d matrix to fill in with measurements */ 
    405     uint64_t* start_time_array_ms,       /**< array of start times */ 
    406     uint64_t* interval_array_ms,         /**< array of interval lengths */ 
    407     int max_key,                         /**< max key value (1st dimension) */ 
    408     int max_history)                     /**< max history (2nd dimension) */ 
     399        struct PINT_perf_counter* pc,    /**< performance counter */ 
     400        int64_t** value_matrix, /**< 2d matrix to fill in with measurements */ 
     401        uint64_t* start_time_array_ms,   /**< array of start times */ 
     402        uint64_t* interval_array_ms,     /**< array of interval lengths */ 
     403        int max_key,                     /**< max key value (1st dimension) */ 
     404        int max_history)                 /**< max history (2nd dimension) */ 
    409405{ 
    410406    int i; 
     
    451447    { 
    452448        memcpy(value_matrix[i], pc->value_matrix[i], 
    453             (tmp_max_history*sizeof(int64_t))); 
     449                (tmp_max_history*sizeof(int64_t))); 
    454450    } 
    455451    memcpy(start_time_array_ms, pc->start_time_array_ms, 
    456         (tmp_max_history*sizeof(uint64_t))); 
     452            (tmp_max_history*sizeof(uint64_t))); 
    457453    memcpy(interval_array_ms, pc->interval_array_ms, 
    458         (tmp_max_history*sizeof(uint64_t))); 
     454            (tmp_max_history*sizeof(uint64_t))); 
    459455     
    460456    gen_mutex_unlock(&pc->mutex); 
     
    471467} 
    472468 
    473 char* PINT_perf_generate_text( 
    474     struct PINT_perf_counter* pc, 
    475     int max_size) 
     469char* PINT_perf_generate_text( struct PINT_perf_counter* pc, 
     470                               int max_size) 
    476471{ 
    477472    int total_size = 0; 
     
    522517            position += 10; 
    523518            sprintf(position, ".%03u",  
    524                 (unsigned)(pc->start_time_array_ms[i]%1000)); 
     519                    (unsigned)(pc->start_time_array_ms[i]%1000)); 
    525520            position += 4; 
    526521        } 
     
    554549            position += 10; 
    555550            sprintf(position, ".%03u",  
    556                 (unsigned)(pc->interval_array_ms[i]%1000)); 
     551                    (unsigned)(pc->interval_array_ms[i]%1000)); 
    557552            position += 4; 
    558553        } 
  • branches/Orange-Branch/src/common/misc/pint-perf-counter.h

    r6268 r8821  
    1313 
    1414enum { 
    15 PERF_DEFAULT_TIME_INTERVAL_SECS = 300, 
    16 PERF_DEFAULT_HISTORY_SIZE       = 6, 
     15    PERF_DEFAULT_TIME_INTERVAL_SECS = 300, 
     16    PERF_DEFAULT_HISTORY_SIZE       = 6, 
    1717}; 
    1818 
     
    7676 
    7777struct PINT_perf_counter* PINT_perf_initialize( 
    78     struct PINT_perf_key* key_array); 
     78        struct PINT_perf_key* key_array); 
    7979 
    8080void PINT_perf_finalize( 
    81     struct PINT_perf_counter* pc); 
     81        struct PINT_perf_counter* pc); 
    8282 
    8383void PINT_perf_reset( 
    84     struct PINT_perf_counter* pc); 
     84        struct PINT_perf_counter* pc); 
    8585 
    8686void __PINT_perf_count( 
    87     struct PINT_perf_counter* pc, 
    88     int key,  
    89     int64_t value, 
    90     enum PINT_perf_ops op); 
     87        struct PINT_perf_counter* pc, 
     88        int key,  
     89        int64_t value, 
     90        enum PINT_perf_ops op); 
    9191 
    9292#ifdef __PVFS2_DISABLE_PERF_COUNTERS__ 
     
    9797 
    9898void PINT_perf_rollover( 
    99     struct PINT_perf_counter* pc); 
     99        struct PINT_perf_counter* pc); 
    100100 
    101101int PINT_perf_set_info( 
    102     struct PINT_perf_counter* pc, 
    103     enum PINT_perf_option option, 
    104     unsigned int arg); 
     102        struct PINT_perf_counter* pc, 
     103        enum PINT_perf_option option, 
     104        unsigned int arg); 
    105105 
    106106int PINT_perf_get_info( 
    107     struct PINT_perf_counter* pc, 
    108     enum PINT_perf_option option, 
    109     unsigned int* arg); 
     107        struct PINT_perf_counter* pc, 
     108        enum PINT_perf_option option, 
     109        unsigned int* arg); 
    110110 
    111111void PINT_perf_retrieve( 
    112     struct PINT_perf_counter* pc,         
    113     int64_t** value_matrix, 
    114     uint64_t* start_time_array_ms,        
    115     uint64_t* interval_array_ms,          
    116     int max_key,                          
    117     int max_history);      
     112        struct PINT_perf_counter* pc,         
     113        int64_t** value_matrix, 
     114        uint64_t* start_time_array_ms,        
     115        uint64_t* interval_array_ms,          
     116        int max_key,                          
     117        int max_history);      
    118118 
    119119char* PINT_perf_generate_text( 
    120     struct PINT_perf_counter* pc, 
    121     int max_size); 
     120        struct PINT_perf_counter* pc, 
     121        int max_size); 
    122122 
    123123#endif /* __PINT_PERF_COUNTER_H */ 
  • branches/Orange-Branch/src/proto/endecode-funcs.h

    r8317 r8821  
    8888    u_int32_t len = 0; \ 
    8989    if (*pbuf) \ 
    90         len = strlen(*pbuf); \ 
     90            len = strlen(*pbuf); \ 
    9191    *(u_int32_t *) *(pptr) = htobmi32(len); \ 
    9292    if (len) { \ 
    93         memcpy(*(pptr)+4, *pbuf, len+1); \ 
    94         int pad = roundup8(4 + len + 1) - (4 + len + 1); \ 
    95         *(pptr) += roundup8(4 + len + 1); \ 
    96         memset(*(pptr)-pad, 0, pad); \ 
     93            memcpy(*(pptr)+4, *pbuf, len+1); \ 
     94            int pad = roundup8(4 + len + 1) - (4 + len + 1); \ 
     95            *(pptr) += roundup8(4 + len + 1); \ 
     96            memset(*(pptr)-pad, 0, pad); \ 
    9797    } else { \ 
    98         *(u_int32_t *) (*(pptr)+4) = 0; \ 
    99         *(pptr) += 8; \ 
     98            *(u_int32_t *) (*(pptr)+4) = 0; \ 
     99            *(pptr) += 8; \ 
    100100    } \ 
    101101} while (0) 
     
    104104    u_int32_t len = 0; \ 
    105105    if (*pbuf) \ 
    106         len = strlen(*pbuf); \ 
     106            len = strlen(*pbuf); \ 
    107107    *(u_int32_t *) *(pptr) = htobmi32(len); \ 
    108108    if (len) { \ 
    109         memcpy(*(pptr)+4, *pbuf, len+1); \ 
    110         *(pptr) += roundup8(4 + len + 1); \ 
     109            memcpy(*(pptr)+4, *pbuf, len+1); \ 
     110            *(pptr) += roundup8(4 + len + 1); \ 
    111111    } else { \ 
    112         *(u_int32_t *) *(pptr) = 0; \ 
    113         *(pptr) += 8; \ 
     112            *(u_int32_t *) *(pptr) = 0; \ 
     113            *(pptr) += 8; \ 
    114114    } \ 
    115115} while (0) 
  • branches/Orange-Branch/src/server/perf-mon.sm

    r6621 r8821  
    3030machine pvfs2_perf_mon_sm 
    3131{ 
    32         state prelude 
    33         { 
    34                 jump pvfs2_prelude_sm; 
    35                 default => do_work; 
    36         } 
    37  
    38         state do_work 
    39         { 
    40                 run perf_mon_do_work; 
    41                 default => final_response; 
    42         } 
    43  
    44         state final_response 
    45         { 
    46                 jump pvfs2_final_response_sm; 
    47                 default => cleanup; 
    48         } 
    49  
    50         state cleanup 
    51         { 
    52                 run perf_mon_cleanup; 
    53                 default => terminate; 
    54         } 
     32    state prelude 
     33    { 
     34        jump pvfs2_prelude_sm; 
     35        default => do_work; 
     36    } 
     37 
     38    state do_work 
     39    { 
     40        run perf_mon_do_work; 
     41        default => final_response; 
     42    } 
     43 
     44    state final_response 
     45    { 
     46        jump pvfs2_final_response_sm; 
     47        default => cleanup; 
     48    } 
     49 
     50    state cleanup 
     51    { 
     52        run perf_mon_cleanup; 
     53        default => terminate; 
     54    } 
    5555} 
    5656 
     
    6767    struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 
    6868    if(s_op->resp.u.mgmt_perf_mon.perf_array) 
    69         free(s_op->resp.u.mgmt_perf_mon.perf_array); 
     69        free(s_op->resp.u.mgmt_perf_mon.perf_array); 
    7070 
    7171    return(server_state_machine_complete(smcb)); 
     
    9595    /* allocate memory to hold statistics */ 
    9696    s_op->resp.u.mgmt_perf_mon.perf_array  
    97         = (struct PVFS_mgmt_perf_stat*)malloc(s_op->req->u.mgmt_perf_mon.count * 
    98         sizeof(struct PVFS_mgmt_perf_stat)); 
     97            = (struct PVFS_mgmt_perf_stat*)malloc( 
     98            s_op->req->u.mgmt_perf_mon.count * 
     99            sizeof(struct PVFS_mgmt_perf_stat)); 
    99100    if(!s_op->resp.u.mgmt_perf_mon.perf_array) 
    100101    { 
    101         js_p->error_code = -PVFS_ENOMEM; 
    102         return SM_ACTION_COMPLETE; 
     102        js_p->error_code = -PVFS_ENOMEM; 
     103        return SM_ACTION_COMPLETE; 
    103104    } 
    104105 
     
    106107    gettimeofday(&tv, NULL); 
    107108    s_op->resp.u.mgmt_perf_mon.cur_time_ms = tv.tv_sec*1000 +  
    108         tv.tv_usec/1000; 
     109            tv.tv_usec/1000; 
    109110    s_op->resp.u.mgmt_perf_mon.suggested_next_id  
    110         = s_op->req->u.mgmt_perf_mon.next_id; 
     111            = s_op->req->u.mgmt_perf_mon.next_id; 
    111112    s_op->resp.u.mgmt_perf_mon.perf_array_count 
    112         = s_op->req->u.mgmt_perf_mon.count; 
     113            = s_op->req->u.mgmt_perf_mon.count; 
    113114 
    114115    /* make sure we have scratch memory to use as an intermediate buffer for 
     
    125126 
    126127    PINT_perf_retrieve(PINT_server_pc, 
    127         static_value_matrix, 
    128         static_start_time_array_ms, 
    129         static_interval_array_ms, 
    130         static_key_count, 
    131         static_history_size); 
     128                        static_value_matrix, 
     129                        static_start_time_array_ms, 
     130                        static_interval_array_ms, 
     131                        static_key_count, 
     132                        static_history_size); 
    132133 
    133134    /* work through start times, and find the oldest one that is new enough 
     
    149150         */ 
    150151        if(tmp_next_id != 0 && 
    151             ((tmp_next_id >= s_op->req->u.mgmt_perf_mon.next_id) || 
    152             ((s_op->req->u.mgmt_perf_mon.next_id-tmp_next_id)>(MAX_NEXT_ID/2)))) 
     152                ((tmp_next_id >= s_op->req->u.mgmt_perf_mon.next_id) || 
     153                ((s_op->req->u.mgmt_perf_mon.next_id-tmp_next_id) > 
     154                (MAX_NEXT_ID/2)))) 
    153155        { 
    154156            /* found the first valid timestamp */ 
     
    159161            tmp_next_id = 0; 
    160162            tmp_next_id += (uint32_t)(static_start_time_array_ms[0] % 
    161                 MAX_NEXT_ID); 
     163                    MAX_NEXT_ID); 
    162164            tmp_next_id += 1; 
    163165            s_op->resp.u.mgmt_perf_mon.suggested_next_id = tmp_next_id; 
     
    181183            s_op->resp.u.mgmt_perf_mon.perf_array[idx].valid_flag = 1; 
    182184            s_op->resp.u.mgmt_perf_mon.perf_array[idx].id = 0; 
    183                 s_op->resp.u.mgmt_perf_mon.perf_array[idx].id +=  
    184                 (uint32_t)(static_start_time_array_ms[i] % 1000000000); 
     185                    s_op->resp.u.mgmt_perf_mon.perf_array[idx].id +=  
     186                    (uint32_t)(static_start_time_array_ms[i] % 1000000000); 
    185187            s_op->resp.u.mgmt_perf_mon.perf_array[idx].start_time_ms =  
    186                 static_start_time_array_ms[i]; 
     188                    static_start_time_array_ms[i]; 
    187189            s_op->resp.u.mgmt_perf_mon.perf_array[idx].read =  
    188                 static_value_matrix[PINT_PERF_READ][i]; 
     190                    static_value_matrix[PINT_PERF_READ][i]; 
    189191            s_op->resp.u.mgmt_perf_mon.perf_array[idx].write =  
    190                 static_value_matrix[PINT_PERF_WRITE][i]; 
     192                    static_value_matrix[PINT_PERF_WRITE][i]; 
    191193            s_op->resp.u.mgmt_perf_mon.perf_array[idx].metadata_read =  
    192                 static_value_matrix[PINT_PERF_METADATA_READ][i]; 
     194                    static_value_matrix[PINT_PERF_METADATA_READ][i]; 
    193195            s_op->resp.u.mgmt_perf_mon.perf_array[idx].metadata_write =  
    194                 static_value_matrix[PINT_PERF_METADATA_WRITE][i]; 
     196                    static_value_matrix[PINT_PERF_METADATA_WRITE][i]; 
    195197            s_op->resp.u.mgmt_perf_mon.perf_array[idx].dspace_queue = 
    196                 static_value_matrix[PINT_PERF_METADATA_DSPACE_OPS][i]; 
     198                    static_value_matrix[PINT_PERF_METADATA_DSPACE_OPS][i]; 
    197199            s_op->resp.u.mgmt_perf_mon.perf_array[idx].keyval_queue = 
    198                 static_value_matrix[PINT_PERF_METADATA_KEYVAL_OPS][i]; 
     200                    static_value_matrix[PINT_PERF_METADATA_KEYVAL_OPS][i]; 
    199201        } 
    200202        else 
     
    208210    { 
    209211        s_op->resp.u.mgmt_perf_mon.end_time_ms =  
    210             static_start_time_array_ms[0] + 
    211             static_interval_array_ms[0]; 
     212                static_start_time_array_ms[0] + 
     213                static_interval_array_ms[0]; 
    212214    } 
    213215 
     
    232234    /* how many keys and history intervals do we have in the perf counter? */ 
    233235    ret = PINT_perf_get_info(PINT_server_pc, PINT_PERF_KEY_COUNT,  
    234         &key_count); 
     236            &key_count); 
    235237    if(ret < 0) 
    236238    { 
     
    238240    } 
    239241    ret = PINT_perf_get_info(PINT_server_pc, PINT_PERF_HISTORY_SIZE,  
    240         &history_size); 
     242            &history_size); 
    241243    if(ret < 0) 
    242244    { 
     
    257259        /* reallocate time arrays */ 
    258260        static_start_time_array_ms = 
    259             (uint64_t*)malloc(history_size*sizeof(uint64_t)); 
     261                (uint64_t*)malloc(history_size*sizeof(uint64_t)); 
    260262        if(!static_start_time_array_ms) 
    261263        { 
     
    263265        } 
    264266        static_interval_array_ms =  
    265             (uint64_t*)malloc(history_size*sizeof(uint64_t)); 
     267                (uint64_t*)malloc(history_size*sizeof(uint64_t)); 
    266268        if(!static_interval_array_ms) 
    267269        { 
     
    271273 
    272274        /* the key count shouldn't change once acquired */ 
    273         assert((static_key_count == 0)||(key_count == static_key_count)); 
     275        assert((static_key_count == 0) || (key_count == static_key_count)); 
    274276 
    275277        /* allocate value matrix */ 
     
    277279        { 
    278280            static_value_matrix = 
    279                 (int64_t**)malloc(key_count*sizeof(int64_t*)); 
     281                    (int64_t**)malloc(key_count*sizeof(int64_t*)); 
    280282            if(!static_value_matrix) 
    281283            { 
     
    290292        { 
    291293            static_value_matrix[i] = 
    292                 (int64_t*)malloc(history_size*sizeof(int64_t)); 
     294                    (int64_t*)malloc(history_size*sizeof(int64_t)); 
    293295            if(!static_value_matrix[i]) 
    294296            { 
  • branches/Orange-Branch/src/server/perf-update.sm

    r6617 r8821  
    9494    /* post another timer */ 
    9595    return(job_req_sched_post_timer(user_opts->perf_update_interval, 
    96         smcb, 
    97         0, 
    98         js_p, 
    99         &tmp_id, 
    100         server_job_context)); 
     96                smcb, 
     97                0, 
     98                js_p, 
     99                &tmp_id, 
     100                server_job_context)); 
    101101} 
    102102