# HG changeset patch # User Sean Halle # Date 1347264714 25200 # Node ID 2341dd0490359a567c9d1f1967e844c9c1d2b462 # Parent e7d2f8fad13da337c8d424923d01a9ccdad8a8a7 Updated default branch to working versions of all the sub repos diff -r e7d2f8fad13d -r 2341dd049035 HW_Dependent_Primitives/VMS__HW_measurement.c --- a/HW_Dependent_Primitives/VMS__HW_measurement.c Fri Aug 31 18:26:07 2012 +0200 +++ b/HW_Dependent_Primitives/VMS__HW_measurement.c Mon Sep 10 01:11:54 2012 -0700 @@ -35,7 +35,7 @@ ); if (_VMSMasterEnv->cycles_counter_fd[coreIdx]<0){ fprintf(stderr,"On core %d: ",coreIdx); - perror("Failed to open cycles counter"); + perror("Failed to open cycles counter (does counters dir exist?)"); } hw_event.type = PERF_TYPE_HARDWARE; hw_event.config = PERF_COUNT_HW_INSTRUCTIONS; //instrs diff -r e7d2f8fad13d -r 2341dd049035 Services_Offered_by_VMS/Measurement_and_Stats/probes.h --- a/Services_Offered_by_VMS/Measurement_and_Stats/probes.h Fri Aug 31 18:26:07 2012 +0200 +++ b/Services_Offered_by_VMS/Measurement_and_Stats/probes.h Mon Sep 10 01:11:54 2012 -0700 @@ -120,7 +120,7 @@ // This means probes have zero impact on performance when off //============================================================= -#ifdef PROBES__TURN_ON_STATS_PROBES +#ifdef SERVICE__TURN_ON_STATS_PROBES #define PROBES__Create_Probe_Bookkeeping_Vars \ _VMSMasterEnv->dynIntervalProbesInfo = \ @@ -188,7 +188,7 @@ #define VMS_WL__print_stats_of_probe( probeID ) ; /* do nothing */ #define VMS_WL__print_stats_of_all_probes() ;/* do nothing */ -#endif /* defined PROBES__TURN_ON_STATS_PROBES */ +#endif /* defined SERVICE__TURN_ON_STATS_PROBES */ #endif /* _PROBES_H */ diff -r e7d2f8fad13d -r 2341dd049035 Services_Offered_by_VMS/Memory_Handling/vmalloc.c --- a/Services_Offered_by_VMS/Memory_Handling/vmalloc.c Fri Aug 31 18:26:07 2012 +0200 +++ b/Services_Offered_by_VMS/Memory_Handling/vmalloc.c Mon Sep 10 01:11:54 2012 -0700 @@ -7,17 +7,18 @@ * Created on November 14, 2009, 9:07 PM */ + #include -#include #include #include #include #include +#include "Histogram/Histogram.h" #include "VMS_impl/VMS.h" -#include "Histogram/Histogram.h" -#include +#include "vmalloc.h" + #define MAX_UINT64 0xFFFFFFFFFFFFFFFF @@ -268,7 +269,11 @@ //Mark as allocated foundChunk->prevChunkInFreeList = NULL; + + #ifdef SERVICE__TURN_ON_VALGRIND VALGRIND_MAKE_MEM_UNDEFINED(foundChunk + 1,sizeRequested); + #endif + return foundChunk + 1; } @@ -287,7 +292,11 @@ MEAS__Capture_Post_Malloc_Point //skip over the prolog by adding its size to the pointer return + + #ifdef SERVICE__TURN_ON_VALGRIND VALGRIND_MAKE_MEM_UNDEFINED(foundChunk + 1,sizeRequested); + #endif + return foundChunk + 1; } @@ -335,7 +344,11 @@ } size_t chunkSize = getChunkSize(chunkToFree); + + #ifdef SERVICE__TURN_ON_VALGRIND VALGRIND_MAKE_MEM_UNDEFINED(chunkToFree,chunkSize); + #endif + if(chunkSize < BIG_LOWER_BOUND) { containerIdx = (chunkSize/SMALL_CHUNK_SIZE)-1; @@ -388,7 +401,11 @@ //Create first element in lastContainer MallocProlog *firstChunk = malloc( MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE ); if( firstChunk == NULL ) {printf("Can't allocate initial memory\n"); exit(1);} + + #ifdef SERVICE__TURN_ON_VALGRIND VALGRIND_MAKE_MEM_NOACCESS(firstChunk,MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE); + #endif + freeLists->memSpace = firstChunk; //Touch memory to avoid page faults diff -r e7d2f8fad13d -r 2341dd049035 Services_Offered_by_VMS/Memory_Handling/vmalloc.h --- a/Services_Offered_by_VMS/Memory_Handling/vmalloc.h Fri Aug 31 18:26:07 2012 +0200 +++ b/Services_Offered_by_VMS/Memory_Handling/vmalloc.h Mon Sep 10 01:11:54 2012 -0700 @@ -9,11 +9,15 @@ #ifndef _VMALLOC_H #define _VMALLOC_H +#include +#include -#include -#include #include "VMS_impl/VMS_primitive_data_types.h" +#ifdef SERVICE__TURN_ON_VALGRIND +#include Valgrind/memcheck.h +#endif + #define SMALL_CHUNK_SIZE 32 #define SMALL_CHUNK_COUNT 4 #define LOWER_BOUND 128 //Biggest chunk size that is created for the small chunks diff -r e7d2f8fad13d -r 2341dd049035 VMS__int.c --- a/VMS__int.c Fri Aug 31 18:26:07 2012 +0200 +++ b/VMS__int.c Mon Sep 10 01:11:54 2012 -0700 @@ -187,7 +187,7 @@ VMS_int__reset_slaveVP_to_TopLvlFn( newSlv, fnPtr, dataParam ); //============================= MEASUREMENT STUFF ======================== - #ifdef PROBES__TURN_ON_STATS_PROBES + #ifdef SERVICE__TURN_ON_STATS_PROBES //TODO: make this TSCHiLow or generic equivalent //struct timeval timeStamp; //gettimeofday( &(timeStamp), NULL); diff -r e7d2f8fad13d -r 2341dd049035 VMS__startup_and_shutdown.c --- a/VMS__startup_and_shutdown.c Fri Aug 31 18:26:07 2012 +0200 +++ b/VMS__startup_and_shutdown.c Mon Sep 10 01:11:54 2012 -0700 @@ -582,7 +582,7 @@ VMS_int__free( _VMSMasterEnv->allAnimSlots ); //============================= MEASUREMENT STUFF ======================== - #ifdef PROBES__TURN_ON_STATS_PROBES + #ifdef SERVICE__TURN_ON_STATS_PROBES freeDynArrayDeep( _VMSMasterEnv->dynIntervalProbesInfo, &VMS_WL__free_probe); #endif //========================================================================