Skip to content

Commit

Permalink
Increases static buffer for calloc to 8MB
Browse files Browse the repository at this point in the history
Change-Id: I9bc031d4766943e98199d7dd7b1bf7829fcc2e5b
  • Loading branch information
emercadal committed Jun 12, 2019
1 parent e091838 commit 5928e78
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ChangeLog
* 11Jun2019 Fixes bug in MPI_Wait where the input request is not copied for later processing
* 25Apr2019 Fixes race conditions between thread creations and PEBS samples
* 17Apr2019 Fixes bug in pebs sampling store misses identification
* 03Jun2019 Increases static buffer for `calloc` to 8MB
* 02Apr2019 Adds support for changing num_threads in OpenMP parallel constructs
* 29Mar2019 Changes order in which MPI env vars are checked to discover process' task id during auto init
* 28Mar2019 Extends support for PEBS sampling on Skylake processors, xml 'period' attribute changed to 'frequency'
Expand Down
4 changes: 4 additions & 0 deletions src/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))

#define KB * 1024
#define MB * 1024 KB
#define GB * 1024 MB

#define MPTRACE_ERROR(x) \
if ( (x) != 0 ) return (-1)

Expand Down
4 changes: 1 addition & 3 deletions src/tracer/wrappers/API/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ unsigned int min_BufferSize = EVT_NUM;
unsigned int buffer_size = EVT_NUM;
unsigned file_size = 0;

#define MBytes *1024*1024

static unsigned current_NumOfThreads = 1;
static unsigned maximum_NumOfThreads = 1;

Expand Down Expand Up @@ -2294,7 +2292,7 @@ int Extrae_Flush_Wrapper (Buffer_t *buffer)
check_size = !hasMinimumTracingTime || (hasMinimumTracingTime && (TIME > MinimumTracingTime+initTracingTime));
if (file_size > 0 && check_size)
{
if ((current_size = Buffer_GetFileSize (buffer)) >= file_size MBytes)
if ((current_size = Buffer_GetFileSize (buffer)) >= file_size MB)
{
if (THREADID == 0)
{
Expand Down
10 changes: 5 additions & 5 deletions src/tracer/wrappers/MALLOC/malloc_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void *malloc (size_t s)
return res;
}

#define DLSYM_CALLOC_SIZE 8192
#define DLSYM_CALLOC_SIZE 8 MB
/*
* Static buffer to return when calloc is called from within dlsym and we don't
* have the pointer to the real calloc function
Expand Down Expand Up @@ -332,10 +332,10 @@ void *calloc (size_t nmemb, size_t size)
/* Check if the requested size fits in the static buffer */
if ((nmemb*size) > DLSYM_CALLOC_SIZE)
{
fprintf (stderr, PACKAGE_NAME
": The size requested by calloc is bigger"
" than DLSYM_CALLOC_SIZE, please increase its"
" value and recompile.\n");
fprintf(stderr, PACKAGE_NAME
": The size requested by calloc (%zu) is bigger"
" than DLSYM_CALLOC_SIZE, please increase its value and"
"recompile.\n", nmemb*size);
abort();
}

Expand Down

0 comments on commit 5928e78

Please sign in to comment.