Skip to content
Merged
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
20 changes: 6 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
strategy:
matrix:
java_version: [8u362+9, 11.0.18+10, 17.0.6+10, 20.0.1+10]
minfo_cache: ['none', 'transient', 'full']
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
Expand All @@ -65,7 +64,7 @@ jobs:
export JAVA_TEST_HOME=$(pwd)/test_jdk
export BUILD_TYPE=SanitizedDebug
chmod a+x ddprof-lib/test.sh
./gradlew :ddprof-test:test -Pddprof.minfocache=${{ matrix.minfo_cache }} --info
./gradlew :ddprof-test:test --info
./gradlew :ddprof-stresstest:runStressTests -x cppTest --info
- name: Post or update PR comment
if: ${{ github.event_name == 'pull_request' }}
Expand Down Expand Up @@ -98,7 +97,6 @@ jobs:
strategy:
matrix:
java_version: [11, 17]
minfo_cache: ['none', 'transient', 'full']
runs-on: ubuntu-22.04
timeout-minutes: 180
steps:
Expand All @@ -122,7 +120,7 @@ jobs:
export JAVA_HOME=$JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH
export BUILD_TYPE=SanitizedDebug
./gradlew :ddprof-test:test -Pddprof.minfocache=${{ matrix.minfo_cache }} --info
./gradlew :ddprof-test:test --info
./gradlew :ddprof-stresstest:runStressTests -x cppTest --info
- name: Post or update PR comment
if: ${{ github.event_name == 'pull_request' }}
Expand Down Expand Up @@ -155,7 +153,6 @@ jobs:
strategy:
matrix:
java_version: [8, 11, 17]
minfo_cache: ['none', 'transient', 'full']
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
Expand All @@ -180,7 +177,7 @@ jobs:
export BUILD_TYPE=SanitizedDebug
chmod a+x gradlew
chmod a+x ddprof-lib/test.sh
./gradlew :ddprof-test:test -Pddprof.minfocache=${{ matrix.minfo_cache }} --info
./gradlew :ddprof-test:test --info
- name: Upload logs
uses: actions/upload-artifact@v3
if: always()
Expand All @@ -201,9 +198,6 @@ jobs:
test-linux-glibc-oracle8:
needs: check-for-pr
if: needs.check-for-pr.outputs.skip != 'true'
strategy:
matrix:
minfo_cache: [ 'none', 'transient', 'full' ]
runs-on: ubuntu-22.04
timeout-minutes: 180
steps:
Expand Down Expand Up @@ -231,7 +225,7 @@ jobs:
export JAVA_HOME=$JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH
export BUILD_TYPE=SanitizedDebug
./gradlew :ddprof-test:test -Pddprof.minfocache=${{ matrix.minfo_cache }} --info
./gradlew :ddprof-test:test --info
./gradlew :ddprof-stresstest:runStressTests -x cppTest --info
- name: Post or update PR comment
if: ${{ github.event_name == 'pull_request' }}
Expand Down Expand Up @@ -264,7 +258,6 @@ jobs:
strategy:
matrix:
java_version: [8u362+9, 11.0.18+10, 17.0.6+10, 20.0.1+10]
minfo_cache: ['none', 'transient', 'full']
runs-on: ubuntu-latest
timeout-minutes: 10
container:
Expand Down Expand Up @@ -294,7 +287,7 @@ jobs:
export LIBC=musl
export JAVA_TEST_HOME=$(pwd)/test_jdk
chmod a+x ddprof-lib/test.sh
./gradlew :ddprof-test:test -Pddprof.minfocache=${{ matrix.minfo_cache }} --info
./gradlew :ddprof-test:test --info
./gradlew :ddprof-stresstest:runStressTests -x cppTest --info
- name: Post or update PR comment
if: ${{ github.event_name == 'pull_request' }}
Expand Down Expand Up @@ -327,7 +320,6 @@ jobs:
strategy:
matrix:
java_version: [ 8, 11, 17 ]
minfo_cache: ['none', 'transient', 'full']
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
Expand Down Expand Up @@ -365,7 +357,7 @@ jobs:
export JAVA_HOME=$JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH
export BUILD_TYPE=SanitizedDebug
./gradlew :ddprof-test:test -Pddprof.minfocache=${{ matrix.minfo_cache }} --info
./gradlew :ddprof-test:test --info
./gradlew :ddprof-stresstest:runStressTests -x cppTest --info
- name: Post or update PR comment
if: ${{ github.event_name == 'pull_request' }}
Expand Down
11 changes: 0 additions & 11 deletions ddprof-lib/src/main/cpp/arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,6 @@ Error Arguments::parse(const char* args) {
_track_class_unload = true;
}

CASE("minfocache")
if (value == NULL || value[0] == 0) {
msg = "expecting 'minfocache=<threshold>:<retention>";
} else {
char* retention = value ? strchr(value, ':') : NULL;
if (retention) {
*(retention++) = 0; // terminate the 'value' string and update the pointer to the 'retention' section
_method_info_cache_retention = (int)strtol(retention, NULL, 0);
}
_method_info_cache_threshold = (int)strtol(value, NULL, 0);
}
CASE("event")
if (value == NULL || value[0] == 0) {
msg = "event must not be empty";
Expand Down
6 changes: 2 additions & 4 deletions ddprof-lib/src/main/cpp/arguments.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,13 @@ class Arguments {
bool _record_heap_usage;
int _jstackdepth;
int _safe_mode;
int _method_info_cache_threshold;
int _method_info_cache_retention;
bool _track_class_unload;
const char* _file;
const char* _log;
const char* _loglevel;
const char* _unknown_arg;
const char* _filter;
unsigned char _mcache;
CStack _cstack;
int _jfr_options;
std::vector<std::string> _context_attributes;
Expand All @@ -164,14 +163,13 @@ class Arguments {
_record_heap_usage(false),
_jstackdepth(DEFAULT_JSTACKDEPTH),
_safe_mode(0),
_method_info_cache_threshold(-1),
_method_info_cache_retention(-1), // set the method info cache to pass-through by default
_track_class_unload(false),
_file(NULL),
_log(NULL),
_loglevel(NULL),
_unknown_arg(NULL),
_filter(NULL),
_mcache(0),
_cstack(CSTACK_DEFAULT),
_jfr_options(0),
_context_attributes({}),
Expand Down
7 changes: 0 additions & 7 deletions ddprof-lib/src/main/cpp/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ void Contexts::initialize(int pageIndex) {
}
}

void Contexts::reset() {
for (int i = 0; i < _max_pages; i++) {
Context* page = (Context*)__atomic_exchange_n(&_pages[i], NULL, __ATOMIC_SEQ_CST);
free(page);
}
}

ContextPage Contexts::getPage(int tid) {
int pageIndex = tid >> DD_CONTEXT_PAGE_SHIFT;
initialize(pageIndex);
Expand Down
3 changes: 0 additions & 3 deletions ddprof-lib/src/main/cpp/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ class Contexts {
// not to be called except to share with Java callers as a DirectByteBuffer
static ContextPage getPage(int tid);
static int getMaxPages(int maxTid = OS::getMaxThreadId());

// this *MUST* be called only when the profiler is completely stopped
static void reset();
};

#endif /* _CONTEXT_H */
21 changes: 1 addition & 20 deletions ddprof-lib/src/main/cpp/counters.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,18 @@
X(DICTIONARY_CLASSES_BYTES, "dictionary_classes_bytes") \
X(DICTIONARY_ENDPOINTS_BYTES, "dictionary_endpoints_bytes") \
X(DICTIONARY_CONTEXT_BYTES, "dictionary_context_bytes") \
X(DICTIONARY_MICACHE_STRINGS_BYTES, "dictionary_micache_strings_bytes") \
X(DICTIONARY_PAGES, "dictionary_pages") \
X(DICTIONARY_CLASSES_PAGES, "dictionary_classes_pages") \
X(DICTIONARY_ENDPOINTS_PAGES, "dictionary_endpoints_pages") \
X(DICTIONARY_CONTEXT_PAGES, "dictionary_context_pages") \
X(DICTIONARY_MICACHE_STRINGS_PAGES, "dictionary_micache_strings_pages") \
X(DICTIONARY_KEYS, "dictionary_keys") \
X(DICTIONARY_CLASSES_KEYS, "dictionary_classes_keys") \
X(DICTIONARY_ENDPOINTS_KEYS, "dictionary_endpoints_keys") \
X(DICTIONARY_CONTEXT_KEYS, "dictionary_context_keys") \
X(DICTIONARY_MICACHE_STRINGS_KEYS, "dictionary_micache_strings_keys") \
X(DICTIONARY_KEYS_BYTES, "dictionary_keys_bytes") \
X(DICTIONARY_CLASSES_KEYS_BYTES, "dictionary_classes_keys_bytes") \
X(DICTIONARY_ENDPOINTS_KEYS_BYTES, "dictionary_endpoints_keys_bytes") \
X(DICTIONARY_CONTEXT_KEYS_BYTES, "dictionary_context_keys_bytes") \
X(DICTIONARY_MICACHE_STRINGS_KEYS_BYTES, "dictionary_micache_strings_keys_bytes") \
X(CONTEXT_STORAGE_BYTES, "context_storage_bytes") \
X(CONTEXT_STORAGE_PAGES, "context_storage_pages") \
X(CONTEXT_BOUNDS_MISS_INITS, "context_bounds_miss_inits") \
Expand All @@ -52,10 +48,7 @@
X(THREAD_IDS_COUNT, "thread_ids_count") \
X(THREAD_NAMES_COUNT, "thread_names_count") \
X(THREAD_FILTER_PAGES, "thread_filter_pages") \
X(THREAD_FILTER_BYTES, "thread_filter_bytes") \
X(JMETHODID_MAP_BYTES, "jmethodid_map_bytes") \
X(JMETHODID_MAP_MISS, "jmethodid_map_miss") \
X(JMETHODID_MAP_PURGED_ITEMS, "jmethodid_map_purged_items")
X(THREAD_FILTER_BYTES, "thread_filter_bytes")
#define X_ENUM(a, b) a,
typedef enum CounterId : int {
DD_COUNTER_TABLE(X_ENUM) DD_NUM_COUNTERS
Expand All @@ -81,19 +74,7 @@ class Counters {
void operator=(Counters const&) = delete;

static long long* getCounters() {
#ifdef COUNTERS
return const_cast<long long*>(Counters::instance()._counters);
#else
return nullptr;
#endif // COUNTERS
}

static long long getCounter(CounterId counter, int offset = 0) {
#ifdef COUNTERS
return Counters::instance()._counters[(static_cast<int>(counter) + offset) * 8];
#else
return 0;
#endif // COUNTERS
}

static constexpr int size() {
Expand Down
Loading