Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,7 @@ Testing
.settings

/bin/

.project
.cproject

8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ A usable and honest profiler for the JVM. For documentation please refer to

* [Download the Binary](http://insightfullogic.com/honest-profiler.zip)
* [How to Build](https://github.com/RichardWarburton/honest-profiler/wiki/How-to-build)
UNITTEST_INCLUDE_DIRS="/usr/local/Cellar/unittest-cpp/2.0.0/include/UnitTest++/" UNITTEST_LIBRARIES="UnitTest++" cmake CMakeLists.txt

[MAC]
# Use brew to install unittest++

# make sure unittest++ available to compliers : export paths
export LIBRARY_PATH=/usr/local/Cellar/unittest-cpp/2.0.0/lib/
export CPLUS_INCLUDE_PATH="/usr/local/Cellar/unittest-cpp/2.0.0/include/"
4 changes: 4 additions & 0 deletions src/main/cpp/agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ static void parseArguments(char *options, ConfigurationOptions &configuration) {
configuration.samplingIntervalMax = atoi(value);
} else if (strstr(key, "interval") == key) {
configuration.samplingIntervalMin = configuration.samplingIntervalMax = atoi(value);
} else if (strstr(key, "rotateNum") == key) {
configuration.rotateNum = atoi(value);
} else if (strstr(key, "rotateSizeMB") == key) {
configuration.rotateSizeMB = atoi(value);
} else if (strstr(key, "logPath") == key) {
configuration.logFilePath.assign(value, STR_SIZE(value, next));
} else if (strstr(key, "start") == key) {
Expand Down
8 changes: 8 additions & 0 deletions src/main/cpp/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ void setProfiler(Profiler *p);
const int DEFAULT_SAMPLING_INTERVAL = 1;
const int DEFAULT_MAX_FRAMES_TO_CAPTURE = 128;
const int MAX_FRAMES_TO_CAPTURE = 2048;
const int DEFAULT_ROTATE_SIZE_MB = 5;
const int DEFAULT_ROTATE_NUM = 5;

#if defined(STATIC_ALLOCATION_ALLOCA)
#define STATIC_ARRAY(NAME, TYPE, SIZE, MAXSZ) TYPE *NAME = (TYPE*)alloca((SIZE) * sizeof(TYPE))
Expand All @@ -41,6 +43,8 @@ char *safe_copy_string(const char *value, const char *next);
struct ConfigurationOptions {
/** Interval in microseconds */
int samplingIntervalMin, samplingIntervalMax;
/** RotateSize in MB */
int rotateNum, rotateSizeMB;
std::string logFilePath;
std::string host;
std::string port;
Expand All @@ -50,6 +54,8 @@ struct ConfigurationOptions {
ConfigurationOptions() :
samplingIntervalMin(DEFAULT_SAMPLING_INTERVAL),
samplingIntervalMax(DEFAULT_SAMPLING_INTERVAL),
rotateNum(DEFAULT_ROTATE_NUM),
rotateSizeMB(DEFAULT_ROTATE_SIZE_MB),
logFilePath(""),
host(""),
port(""),
Expand All @@ -60,6 +66,8 @@ struct ConfigurationOptions {
ConfigurationOptions(const ConfigurationOptions &config) :
samplingIntervalMin(config.samplingIntervalMin),
samplingIntervalMax(config.samplingIntervalMax),
rotateNum(config.rotateNum),
rotateSizeMB(config.rotateSizeMB),
logFilePath(config.logFilePath),
host(config.host),
port(config.port),
Expand Down
Loading