changeset 255:2341dd049035 Common_Ancestor

Updated default branch to working versions of all the sub repos
author Sean Halle <seanhalle@yahoo.com>
date Mon, 10 Sep 2012 01:11:54 -0700
parents e7d2f8fad13d
children 2bcf37fd50c6
files HW_Dependent_Primitives/VMS__HW_measurement.c Services_Offered_by_VMS/Measurement_and_Stats/probes.h Services_Offered_by_VMS/Memory_Handling/vmalloc.c Services_Offered_by_VMS/Memory_Handling/vmalloc.h VMS__int.c VMS__startup_and_shutdown.c
diffstat 6 files changed, 31 insertions(+), 10 deletions(-) [+]
line diff
     1.1 --- a/HW_Dependent_Primitives/VMS__HW_measurement.c	Fri Aug 31 18:26:07 2012 +0200
     1.2 +++ b/HW_Dependent_Primitives/VMS__HW_measurement.c	Mon Sep 10 01:11:54 2012 -0700
     1.3 @@ -35,7 +35,7 @@
     1.4  	);
     1.5          if (_VMSMasterEnv->cycles_counter_fd[coreIdx]<0){
     1.6              fprintf(stderr,"On core %d: ",coreIdx);
     1.7 -            perror("Failed to open cycles counter");
     1.8 +            perror("Failed to open cycles counter (does counters dir exist?)");
     1.9          }
    1.10          hw_event.type = PERF_TYPE_HARDWARE;
    1.11          hw_event.config = PERF_COUNT_HW_INSTRUCTIONS; //instrs
     2.1 --- a/Services_Offered_by_VMS/Measurement_and_Stats/probes.h	Fri Aug 31 18:26:07 2012 +0200
     2.2 +++ b/Services_Offered_by_VMS/Measurement_and_Stats/probes.h	Mon Sep 10 01:11:54 2012 -0700
     2.3 @@ -120,7 +120,7 @@
     2.4  // This means probes have zero impact on performance when off
     2.5  //=============================================================
     2.6  
     2.7 -#ifdef PROBES__TURN_ON_STATS_PROBES
     2.8 +#ifdef SERVICE__TURN_ON_STATS_PROBES
     2.9  
    2.10     #define PROBES__Create_Probe_Bookkeeping_Vars \
    2.11        _VMSMasterEnv->dynIntervalProbesInfo = \
    2.12 @@ -188,7 +188,7 @@
    2.13     #define VMS_WL__print_stats_of_probe( probeID ) ; /* do nothing */
    2.14     #define VMS_WL__print_stats_of_all_probes() ;/* do nothing */
    2.15  
    2.16 -#endif   /* defined PROBES__TURN_ON_STATS_PROBES */
    2.17 +#endif   /* defined SERVICE__TURN_ON_STATS_PROBES */
    2.18  
    2.19  #endif	/* _PROBES_H */
    2.20  
     3.1 --- a/Services_Offered_by_VMS/Memory_Handling/vmalloc.c	Fri Aug 31 18:26:07 2012 +0200
     3.2 +++ b/Services_Offered_by_VMS/Memory_Handling/vmalloc.c	Mon Sep 10 01:11:54 2012 -0700
     3.3 @@ -7,17 +7,18 @@
     3.4   * Created on November 14, 2009, 9:07 PM
     3.5   */
     3.6  
     3.7 +
     3.8  #include <malloc.h>
     3.9 -#include <inttypes.h>
    3.10  #include <stdlib.h>
    3.11  #include <stdio.h>
    3.12  #include <string.h>
    3.13  #include <math.h>
    3.14  
    3.15 +#include "Histogram/Histogram.h"
    3.16  #include "VMS_impl/VMS.h"
    3.17 -#include "Histogram/Histogram.h"
    3.18  
    3.19 -#include <valgrind/memcheck.h>
    3.20 +#include "vmalloc.h"
    3.21 +
    3.22  
    3.23  #define MAX_UINT64 0xFFFFFFFFFFFFFFFF
    3.24  
    3.25 @@ -268,7 +269,11 @@
    3.26         
    3.27        //Mark as allocated
    3.28        foundChunk->prevChunkInFreeList = NULL;  
    3.29 +
    3.30 +      #ifdef SERVICE__TURN_ON_VALGRIND
    3.31        VALGRIND_MAKE_MEM_UNDEFINED(foundChunk + 1,sizeRequested);
    3.32 +      #endif
    3.33 +
    3.34        return foundChunk + 1;
    3.35      }
    3.36     
    3.37 @@ -287,7 +292,11 @@
    3.38           MEAS__Capture_Post_Malloc_Point
    3.39     
    3.40     //skip over the prolog by adding its size to the pointer return
    3.41 +           
    3.42 +   #ifdef SERVICE__TURN_ON_VALGRIND
    3.43     VALGRIND_MAKE_MEM_UNDEFINED(foundChunk + 1,sizeRequested);
    3.44 +   #endif
    3.45 +         
    3.46     return foundChunk + 1;
    3.47   }
    3.48  
    3.49 @@ -335,7 +344,11 @@
    3.50     }
    3.51     
    3.52     size_t chunkSize = getChunkSize(chunkToFree);
    3.53 +
    3.54 +   #ifdef SERVICE__TURN_ON_VALGRIND
    3.55     VALGRIND_MAKE_MEM_UNDEFINED(chunkToFree,chunkSize);
    3.56 +   #endif 
    3.57 +
    3.58     if(chunkSize < BIG_LOWER_BOUND)
    3.59     {
    3.60         containerIdx =  (chunkSize/SMALL_CHUNK_SIZE)-1;
    3.61 @@ -388,7 +401,11 @@
    3.62     //Create first element in lastContainer 
    3.63     MallocProlog *firstChunk = malloc( MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE );
    3.64     if( firstChunk == NULL ) {printf("Can't allocate initial memory\n"); exit(1);}
    3.65 +
    3.66 +   #ifdef SERVICE__TURN_ON_VALGRIND
    3.67     VALGRIND_MAKE_MEM_NOACCESS(firstChunk,MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE);
    3.68 +   #endif
    3.69 +
    3.70     freeLists->memSpace = firstChunk;
    3.71     
    3.72     //Touch memory to avoid page faults
     4.1 --- a/Services_Offered_by_VMS/Memory_Handling/vmalloc.h	Fri Aug 31 18:26:07 2012 +0200
     4.2 +++ b/Services_Offered_by_VMS/Memory_Handling/vmalloc.h	Mon Sep 10 01:11:54 2012 -0700
     4.3 @@ -9,11 +9,15 @@
     4.4  
     4.5  #ifndef _VMALLOC_H
     4.6  #define	_VMALLOC_H
     4.7 +#include <inttypes.h>
     4.8 +#include <stddef.h>
     4.9  
    4.10 -#include <malloc.h>
    4.11 -#include <inttypes.h>
    4.12  #include "VMS_impl/VMS_primitive_data_types.h"
    4.13  
    4.14 +#ifdef SERVICE__TURN_ON_VALGRIND
    4.15 +#include Valgrind/memcheck.h
    4.16 +#endif
    4.17 +
    4.18  #define SMALL_CHUNK_SIZE 32
    4.19  #define SMALL_CHUNK_COUNT 4
    4.20  #define LOWER_BOUND     128  //Biggest chunk size that is created for the small chunks
     5.1 --- a/VMS__int.c	Fri Aug 31 18:26:07 2012 +0200
     5.2 +++ b/VMS__int.c	Mon Sep 10 01:11:54 2012 -0700
     5.3 @@ -187,7 +187,7 @@
     5.4     VMS_int__reset_slaveVP_to_TopLvlFn( newSlv, fnPtr, dataParam );
     5.5             
     5.6     //============================= MEASUREMENT STUFF ========================
     5.7 -   #ifdef PROBES__TURN_ON_STATS_PROBES
     5.8 +   #ifdef SERVICE__TURN_ON_STATS_PROBES
     5.9     //TODO: make this TSCHiLow or generic equivalent
    5.10     //struct timeval timeStamp;
    5.11     //gettimeofday( &(timeStamp), NULL);
     6.1 --- a/VMS__startup_and_shutdown.c	Fri Aug 31 18:26:07 2012 +0200
     6.2 +++ b/VMS__startup_and_shutdown.c	Mon Sep 10 01:11:54 2012 -0700
     6.3 @@ -582,7 +582,7 @@
     6.4     VMS_int__free( _VMSMasterEnv->allAnimSlots );
     6.5     
     6.6     //============================= MEASUREMENT STUFF ========================
     6.7 -   #ifdef PROBES__TURN_ON_STATS_PROBES
     6.8 +   #ifdef SERVICE__TURN_ON_STATS_PROBES
     6.9     freeDynArrayDeep( _VMSMasterEnv->dynIntervalProbesInfo, &VMS_WL__free_probe);
    6.10     #endif
    6.11     //========================================================================