diff VMS.c @ 110:724c7a0b687f

save counters to file in csv
author Nina Engelhardt
date Wed, 03 Aug 2011 17:05:18 +0200
parents 659299627e70
children 43ea731da94e
line diff
     1.1 --- a/VMS.c	Tue Aug 02 17:16:12 2011 +0200
     1.2 +++ b/VMS.c	Wed Aug 03 17:05:18 2011 +0200
     1.3 @@ -187,7 +187,25 @@
     1.4     MakeTheMeasHists();
     1.5     
     1.6     #ifdef MEAS__PERF_COUNTERS
     1.7 -   printf("Creating HW counters...");
     1.8 +   //printf("Creating HW counters...");
     1.9 +   FILE* output;
    1.10 +   int n;
    1.11 +   char filename[255];    
    1.12 +    for(n=0;n<255;n++)
    1.13 +    {
    1.14 +        sprintf(filename, "./counters/Counters.%d.dat",n);
    1.15 +        output = fopen(filename,"r");
    1.16 +        if(output)
    1.17 +        {
    1.18 +            fclose(output);
    1.19 +        }else{
    1.20 +            break;
    1.21 +        }
    1.22 +    }
    1.23 +    printf("Saving Counter measurements to File: %s ...\n", filename);
    1.24 +    output = fopen(filename,"w+");
    1.25 +   _VMSMasterEnv->counteroutput = output;
    1.26 +    
    1.27     struct perf_event_attr hw_event;
    1.28     memset(&hw_event,0,sizeof(hw_event));
    1.29     	hw_event.type = PERF_TYPE_HARDWARE;
    1.30 @@ -437,8 +455,8 @@
    1.31   * it lets the lang have lang-specific data related to creation transported
    1.32   * to the plugin.
    1.33   */
    1.34 -void
    1.35 -VMS__send_create_procr_req( void *semReqData, VirtProcr *reqstingPr ) __attribute__ ((noinline))
    1.36 +__attribute__ ((noinline)) void
    1.37 +VMS__send_create_procr_req( void *semReqData, VirtProcr *reqstingPr ) 
    1.38  
    1.39   { VMSReqst req;
    1.40  
    1.41 @@ -472,8 +490,8 @@
    1.42   * gets suspended in this call and all the virt processor's state disap-
    1.43   * pears -- making that suspend the last thing in the virt procr's trace.
    1.44   */
    1.45 -void
    1.46 -VMS__send_dissipate_req( VirtProcr *procrToDissipate ) __attribute__ ((noinline))
    1.47 +__attribute__ ((noinline)) void
    1.48 +VMS__send_dissipate_req( VirtProcr *procrToDissipate ) 
    1.49   { VMSReqst req;
    1.50  
    1.51     req.reqType                = dissipate;
    1.52 @@ -532,8 +550,8 @@
    1.53   * to plugin
    1.54   *Then it does suspend, to cause request to be sent.
    1.55   */
    1.56 -/*inline*/ void
    1.57 -VMS__send_sem_request( void *semReqData, VirtProcr *callingPr ) __attribute__ ((noinline))
    1.58 +/*inline*/__attribute__ ((noinline)) void
    1.59 +VMS__send_sem_request( void *semReqData, VirtProcr *callingPr ) 
    1.60   { VMSReqst req;
    1.61  
    1.62     req.reqType         = semantic;
    1.63 @@ -545,8 +563,8 @@
    1.64   }
    1.65  
    1.66  
    1.67 -/*inline*/ void
    1.68 -VMS__send_VMSSem_request( void *semReqData, VirtProcr *callingPr ) __attribute__ ((noinline))
    1.69 +/*inline*/ __attribute__ ((noinline)) void
    1.70 +VMS__send_VMSSem_request( void *semReqData, VirtProcr *callingPr ) 
    1.71  
    1.72   { VMSReqst req;
    1.73