diff --git a/Makefile b/Makefile index c3c2c7b..15a2ef9 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,8 @@ SRC_DIR = src WRAPPER_DIR = cwrapper INCLUDE_DIR = $(DESTDIR)/include LIB_DIR = $(DESTDIR)/lib -CXXFLAGS=-O3 -DNDEBUG -fPIC -std=c++11 -pthread -CFLAGS=-O3 -DNDEBUG -fPIC -std=gnu99 +CXXFLAGS = $(MACROS) -O3 -DNDEBUG -fPIC -std=c++11 -pthread +CFLAGS = $(MACROS) -O3 -DNDEBUG -fPIC -std=gnu99 INCLUDE=-I$(SRC_DIR) # Stuff needed for make check diff --git a/src/TimeTrace.cc b/src/TimeTrace.cc index fec734b..8524cb2 100644 --- a/src/TimeTrace.cc +++ b/src/TimeTrace.cc @@ -337,8 +337,8 @@ TimeTrace::printInternal(std::vector* buffers, string* s) { // by the sheer size of the cycle counter. char message[200]; snprintf(message, sizeof(message), - "CYCLES_PER_SECOND %f\nSTART_CYCLES %lu\n", - Cycles::perSecond(), startTime); + "CYCLES_PER_SECOND %f\nSTART_CYCLES %lu\nBUFFER_SIZE %u\n", + Cycles::perSecond(), startTime, Buffer::BUFFER_SIZE); if (s != NULL) { s->append(message); } else { diff --git a/src/TimeTrace.h b/src/TimeTrace.h index adb7458..28033af 100644 --- a/src/TimeTrace.h +++ b/src/TimeTrace.h @@ -24,6 +24,10 @@ #include "Atomic.h" #include "Cycles.h" +#ifndef TIMETRACE_BUFFER_SIZE_EXP +#define TIMETRACE_BUFFER_SIZE_EXP 13 +#endif + namespace PerfUtils { // A macro to disallow the copy constructor and operator= functions @@ -173,7 +177,7 @@ class TimeTrace { protected: // Determines the number of events we can retain as an exponent of 2 - static const uint8_t BUFFER_SIZE_EXP = 13; + static const uint8_t BUFFER_SIZE_EXP = TIMETRACE_BUFFER_SIZE_EXP; // Total number of events that we can retain any given time. static const uint32_t BUFFER_SIZE = 1 << BUFFER_SIZE_EXP;