From 40fad390e3d115b71a647e0957081b7dd15f1a25 Mon Sep 17 00:00:00 2001 From: Richard Startin Date: Wed, 17 Jul 2024 12:22:14 +0100 Subject: [PATCH] jvmti based wallclock sampler --- ddprof-lib/src/main/cpp/arguments.cpp | 12 ++ ddprof-lib/src/main/cpp/arguments.h | 9 +- ddprof-lib/src/main/cpp/profiler.cpp | 27 ++++- ddprof-lib/src/main/cpp/profiler.h | 5 + ddprof-lib/src/main/cpp/reservoir_sampler.h | 59 +++++++++ ddprof-lib/src/main/cpp/threadState.h | 28 +++++ ddprof-lib/src/main/cpp/wallClock.cpp | 20 +--- ddprof-lib/src/main/cpp/wallClock.h | 2 +- ddprof-lib/src/main/cpp/wallClock_jvmti.cpp | 112 ++++++++++++++++++ ddprof-lib/src/main/cpp/wallClock_jvmti.h | 77 ++++++++++++ .../ContendedWallclockSamplesTest.java | 1 - .../JvmtiBasedContextWallClockTest.java | 9 ++ .../JvmtiBasedWallclockThreadFilterTest.java | 9 ++ .../wallclock/MegamorphicCallTest.java | 1 - gradle/configurations.gradle | 9 +- 15 files changed, 356 insertions(+), 24 deletions(-) create mode 100644 ddprof-lib/src/main/cpp/reservoir_sampler.h create mode 100644 ddprof-lib/src/main/cpp/wallClock_jvmti.cpp create mode 100644 ddprof-lib/src/main/cpp/wallClock_jvmti.h create mode 100644 ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/JvmtiBasedContextWallClockTest.java create mode 100644 ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/JvmtiBasedWallclockThreadFilterTest.java diff --git a/ddprof-lib/src/main/cpp/arguments.cpp b/ddprof-lib/src/main/cpp/arguments.cpp index b29809dce4..48caabb787 100644 --- a/ddprof-lib/src/main/cpp/arguments.cpp +++ b/ddprof-lib/src/main/cpp/arguments.cpp @@ -290,6 +290,18 @@ Error Arguments::parse(const char* args) { } } + CASE("wallsampler") + if (value != NULL) { + switch (value[0]) { + case 'j': + _wallclock_sampler = JVMTI; + break; + case 'a': + default: + _wallclock_sampler = ASGCT; + } + } + DEFAULT() if (_unknown_arg == NULL) _unknown_arg = arg; } diff --git a/ddprof-lib/src/main/cpp/arguments.h b/ddprof-lib/src/main/cpp/arguments.h index 720c43aabc..4fef6821f6 100644 --- a/ddprof-lib/src/main/cpp/arguments.h +++ b/ddprof-lib/src/main/cpp/arguments.h @@ -85,6 +85,11 @@ enum JfrOption { JFR_SYNC_OPTS = NO_SYSTEM_INFO | NO_SYSTEM_PROPS | NO_NATIVE_LIBS | NO_CPU_LOAD }; +enum WallclockSampler { + ASGCT, + JVMTI +}; + struct Multiplier { char symbol; @@ -134,6 +139,7 @@ class Arguments { long _wall; bool _wall_collapsing; int _wall_threads_per_tick; + WallclockSampler _wallclock_sampler; long _memory; bool _record_allocations; bool _record_liveness; @@ -178,7 +184,8 @@ class Arguments { _cstack(CSTACK_DEFAULT), _jfr_options(0), _context_attributes({}), - _lightweight(false) { + _lightweight(false), + _wallclock_sampler(ASGCT){ } ~Arguments(); diff --git a/ddprof-lib/src/main/cpp/profiler.cpp b/ddprof-lib/src/main/cpp/profiler.cpp index ffa927e669..9d14d2ff1a 100644 --- a/ddprof-lib/src/main/cpp/profiler.cpp +++ b/ddprof-lib/src/main/cpp/profiler.cpp @@ -30,6 +30,7 @@ #include "perfEvents.h" #include "objectSampler.h" #include "wallClock.h" +#include "wallClock_jvmti.h" #include "j9Ext.h" #include "j9WallClock.h" #include "ctimer.h" @@ -60,6 +61,7 @@ static Engine noop_engine; static PerfEvents perf_events; static WallClock wall_engine; static J9WallClock j9_engine; +static WallClock jvmti_wall_engine; static ITimer itimer; static CTimer ctimer; @@ -117,6 +119,9 @@ void Profiler::onThreadStart(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) { } updateThreadName(jvmti, jni, thread, true); + MutexLocker jtm(_jthread_mutex); + _jthreads.insert(std::make_pair(tid, thread)); + _cpu_engine->registerThread(tid); _wall_engine->registerThread(tid); } @@ -128,6 +133,9 @@ void Profiler::onThreadEnd(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) { } updateThreadName(jvmti, jni, thread, true); + MutexLocker jtm(_jthread_mutex); + _jthreads.erase(tid); + _cpu_engine->unregisterThread(tid); // unregister here because JNI callers generally don't know about thread exits _wall_engine->unregisterThread(tid); @@ -143,6 +151,16 @@ void Profiler::unregisterThread(int tid) { _instance->_wall_engine->unregisterThread(tid); } +void Profiler::getThreads(const vector& tids, std::vector& threads) { + MutexLocker ml(_jthread_mutex); + for (int tid : tids) { + const auto& it = _jthreads.find(tid); + if (it != _jthreads.end()) { + threads.push_back(it->second); + } + } +} + const char* Profiler::asgctError(int code) { switch (code) { case ticks_no_Java_frame: @@ -987,7 +1005,14 @@ Engine* Profiler::selectWallEngine(Arguments& args) { Log::warn("Safe jmethodID access is not available on this JVM. Using wallclock profiler on your own risk."); } } - return (Engine*)&wall_engine; + switch (args._wallclock_sampler) { + case JVMTI: + return (Engine*)&jvmti_wall_engine; + case ASGCT: + default: + return (Engine*)&wall_engine; + } + } Engine* Profiler::selectAllocEngine(Arguments& args) { diff --git a/ddprof-lib/src/main/cpp/profiler.h b/ddprof-lib/src/main/cpp/profiler.h index 28d91a53cc..8fb2831bd9 100644 --- a/ddprof-lib/src/main/cpp/profiler.h +++ b/ddprof-lib/src/main/cpp/profiler.h @@ -37,6 +37,7 @@ #include "vmEntry.h" #include "objectSampler.h" #include "thread.h" +#include // avoid linking against newer symbols here for wide compatibility #ifdef __GLIBC__ @@ -113,6 +114,9 @@ class Profiler { int _safe_mode; CStack _cstack; + Mutex _jthread_mutex; + map _jthreads; + volatile jvmtiEventMode _thread_events_state; SpinLock _stubs_lock; @@ -272,6 +276,7 @@ class Profiler { static int registerThread(int tid); static void unregisterThread(int tid); + void getThreads(const vector& tids, std::vector& threads); // CompiledMethodLoad is also needed to enable DebugNonSafepoints info by default static void JNICALL CompiledMethodLoad(jvmtiEnv* jvmti, jmethodID method, diff --git a/ddprof-lib/src/main/cpp/reservoir_sampler.h b/ddprof-lib/src/main/cpp/reservoir_sampler.h new file mode 100644 index 0000000000..2324634656 --- /dev/null +++ b/ddprof-lib/src/main/cpp/reservoir_sampler.h @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Datadog + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef RESERVOIR_SAMPLER_H +#define RESERVOIR_SAMPLER_H + +#include +#include +#include + + +template +class ReservoirSampler { +private: + const int size; + std::mt19937 generator; + std::uniform_real_distribution uniform; + std::uniform_int_distribution random_index; + std::vector reservoir; + +public: + ReservoirSampler(const int size) : + size(size), + generator((std::random_device())()), + uniform(1e-16, 1.0), + random_index(0, size - 1) { + reservoir.reserve(size); + } + + std::vector& sample(const std::vector &input) { + reservoir.clear(); + for (int i = 0; i < size && i < input.size(); i++) { + reservoir.push_back(input[i]); + } + double weight = exp(log(uniform(generator)) / size); + int target = size + (int) (log(uniform(generator)) / log(1 - weight)); + while (target < input.size()) { + reservoir[random_index(generator)] = input[target]; + weight *= exp(log(uniform(generator)) / size); + target += (int) (log(uniform(generator)) / log(1 - weight)); + } + return reservoir; + } +}; + +#endif //RESERVOIR_SAMPLER_H diff --git a/ddprof-lib/src/main/cpp/threadState.h b/ddprof-lib/src/main/cpp/threadState.h index b58b2af4e1..65143a3749 100644 --- a/ddprof-lib/src/main/cpp/threadState.h +++ b/ddprof-lib/src/main/cpp/threadState.h @@ -16,6 +16,30 @@ enum class ThreadState : int { SYSCALL = 9 // does not originate in the JVM, used when the current frame is known to be a syscall }; +static ThreadState convertJvmtiThreadState(int state) { + switch (state & 0xFFFF) { + case JVMTI_THREAD_STATE_ALIVE: + return ThreadState::NEW; + case JVMTI_THREAD_STATE_TERMINATED: + return ThreadState::TERMINATED; + case JVMTI_THREAD_STATE_RUNNABLE: + return ThreadState::RUNNABLE; + case JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER: + return ThreadState::MONITOR_WAIT; + case JVMTI_THREAD_STATE_WAITING: + case JVMTI_THREAD_STATE_WAITING_INDEFINITELY: + case JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT: + case JVMTI_THREAD_STATE_PARKED: + return ThreadState::CONDVAR_WAIT; + case JVMTI_THREAD_STATE_SLEEPING: + return ThreadState::SLEEPING; + case JVMTI_THREAD_STATE_IN_OBJECT_WAIT: + return ThreadState::OBJECT_WAIT; + default: + return ThreadState::UNKNOWN; + } +} + enum class ExecutionMode : int { UNKNOWN = 0, @@ -45,4 +69,8 @@ static ExecutionMode convertJvmExecutionState(int state) { } } +static ExecutionMode getExecutionModeFromJvmtiThreadState(int state) { + return (state & 0x400000) == 0x400000 ? ExecutionMode::NATIVE : ExecutionMode::JAVA; +} + #endif //JAVA_PROFILER_LIBRARY_THREAD_STATE_H diff --git a/ddprof-lib/src/main/cpp/wallClock.cpp b/ddprof-lib/src/main/cpp/wallClock.cpp index b0de356213..e968c8a579 100644 --- a/ddprof-lib/src/main/cpp/wallClock.cpp +++ b/ddprof-lib/src/main/cpp/wallClock.cpp @@ -25,6 +25,7 @@ #include "thread.h" #include "tsc.h" #include "vmStructs.h" +#include "reservoir_sampler.h" std::atomic WallClock::_enabled{false}; @@ -139,10 +140,9 @@ void WallClock::timerLoop() { if (!_enabled.load(std::memory_order_acquire)) { return; } + ReservoirSampler reservoir(_reservoir_size); std::vector tids; tids.reserve(_reservoir_size); - std::vector reservoir; - reservoir.reserve(_reservoir_size); int self = OS::threadId(); ThreadFilter* thread_filter = Profiler::instance()->threadFilter(); thread_filter->remove(self); @@ -168,21 +168,12 @@ void WallClock::timerLoop() { } delete thread_list; } - for (int i = 0; i < _reservoir_size && i < tids.size(); i++) { - reservoir.push_back(tids[i]); - } - double weight = exp(log(uniform(generator)) / _reservoir_size); - int target = _reservoir_size + (int) (log(uniform(generator)) / log(1 - weight)); - while (target < tids.size()) { - reservoir[random_index(generator)] = tids[target]; - weight *= exp(log(uniform(generator)) / _reservoir_size); - target += (int) (log(uniform(generator)) / log(1 - weight)); - } int num_failures = 0; int threads_already_exited = 0; int permission_denied = 0; - for (int tid : reservoir) { + std::vector sample = reservoir.sample(tids); + for (int tid : sample) { if (!OS::sendSignalToThread(tid, SIGVTALRM)) { num_failures++; if (errno != 0) { @@ -202,7 +193,7 @@ void WallClock::timerLoop() { epoch.updateNumSamplableThreads(tids.size()); epoch.updateNumFailedSamples(num_failures); - epoch.updateNumSuccessfulSamples(reservoir.size() - num_failures); + epoch.updateNumSuccessfulSamples(sample.size() - num_failures); epoch.updateNumExitedThreads(threads_already_exited); epoch.updateNumPermissionDenied(permission_denied); u64 endTime = TSC::ticks(); @@ -216,7 +207,6 @@ void WallClock::timerLoop() { epoch.clean(); } - reservoir.clear(); tids.clear(); OS::sleep(_interval); } diff --git a/ddprof-lib/src/main/cpp/wallClock.h b/ddprof-lib/src/main/cpp/wallClock.h index 9d0772a55b..72e399eec8 100644 --- a/ddprof-lib/src/main/cpp/wallClock.h +++ b/ddprof-lib/src/main/cpp/wallClock.h @@ -66,7 +66,7 @@ class WallClock : public Engine { } const char* name() { - return "WallClock"; + return "WallClock - AsyncGetCallTrace"; } long interval() const { diff --git a/ddprof-lib/src/main/cpp/wallClock_jvmti.cpp b/ddprof-lib/src/main/cpp/wallClock_jvmti.cpp new file mode 100644 index 0000000000..3b52bf9c93 --- /dev/null +++ b/ddprof-lib/src/main/cpp/wallClock_jvmti.cpp @@ -0,0 +1,112 @@ +/* + * Copyright 2018 Andrei Pangin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include "debugSupport.h" +#include "wallClock_jvmti.h" +#include "profiler.h" +#include "stackFrame.h" +#include "context.h" +#include "log.h" +#include "thread.h" +#include "tsc.h" +#include "vmStructs.h" +#include "reservoir_sampler.h" +#include + +std::atomic JvmtiWallClockSampler::_enabled{false}; + +Error JvmtiWallClockSampler::start(Arguments &args) { + int interval = args._event != NULL ? args._interval : args._wall; + if (interval < 0) { + return Error("interval must be positive"); + } + _interval = interval ? interval : DEFAULT_WALL_INTERVAL; + + _reservoir_size = + args._wall_threads_per_tick ? + args._wall_threads_per_tick : + DEFAULT_WALL_THREADS_PER_TICK; + + _running = true; + + if (pthread_create(&_thread, NULL, threadEntry, this) != 0) { + return Error("Unable to create timer thread"); + } + + return Error::OK; +} + +void JvmtiWallClockSampler::stop() { + _running.store(false); + // the thread join ensures we wait for the thread to finish before returning (and possibly removing the object) + pthread_kill(_thread, WAKEUP_SIGNAL); + int res = pthread_join(_thread, NULL); + if(res != 0) { + Log::warn("Unable to join WallClock thread on stop %d", res); + } +} + +void JvmtiWallClockSampler::timerLoop() { + ThreadFilter* thread_filter = Profiler::instance()->threadFilter(); + if (!_enabled.load(std::memory_order_acquire) || !thread_filter->enabled()) { + return; + } + JNIEnv* jni = VM::attachThread("datadog-wallclock-sampler"); + jvmtiEnv* jvmti = VM::jvmti(); + const int max_frames = Profiler::instance()->max_stack_depth(); + jvmtiFrameInfo* frames = frames = new jvmtiFrameInfo[max_frames]; + std::vector tids; + tids.reserve(_reservoir_size); + std::vector javaThreads; + javaThreads.reserve(_reservoir_size); + ReservoirSampler reservoir(_reservoir_size); + int self = OS::threadId(); + u64 counter = 0; + + + while (_running.load(std::memory_order_relaxed)) { + int numFailures = 0; + int threadsAlreadyExited = 0; + std::vector sample = reservoir.sample(tids); + Profiler::instance()->getThreads(sample, javaThreads); + for (int i = 0; i < sample.size(); i++) { + int tid = sample[i]; + jthread javaThread = javaThreads[i]; + if (javaThread != nullptr) { + jint depth; + jint error = jvmti->GetStackTrace(javaThread, 0, max_frames, frames, &depth); + if (error == 0 && depth > 0) { + ExecutionEvent event; + event._execution_mode = ExecutionMode::JAVA; + event._thread_state = ThreadState::UNKNOWN; + jint state; + if (jvmti->GetThreadState(javaThread, &state) == 0) { + event._thread_state = convertJvmtiThreadState(state); + event._execution_mode = getExecutionModeFromJvmtiThreadState(state); + } + Profiler::instance()->recordExternalSample(0, tid, frames, depth, false, BCI_WALL, &event); + } + } else { + threadsAlreadyExited++; + } + } + tids.clear(); + OS::sleep(_interval); + } + VM::detachThread(); +} diff --git a/ddprof-lib/src/main/cpp/wallClock_jvmti.h b/ddprof-lib/src/main/cpp/wallClock_jvmti.h new file mode 100644 index 0000000000..77bee141c8 --- /dev/null +++ b/ddprof-lib/src/main/cpp/wallClock_jvmti.h @@ -0,0 +1,77 @@ +/* + * Copyright 2024 Datadog + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _WALLCLOCK_JVMTI_H +#define _WALLCLOCK_JVMTI_H + +#include +#include +#include +#include +#include "engine.h" +#include "os.h" +#include "threadState.h" + +class JvmtiWallClockSampler : public Engine { + private: + static std::atomic _enabled; + + long _interval; + + // Maximum number of threads sampled in one iteration. This limit serves as a throttle + // when generating profiling signals. Otherwise applications with too many threads may + // suffer from a big profiling overhead. Also, keeping this limit low enough helps + // to avoid contention on a spin lock inside Profiler::recordSample(). + int _reservoir_size; + + std::atomic _running; + pthread_t _thread; + + void timerLoop(); + + static void* threadEntry(void* wall_clock) { + ((JvmtiWallClockSampler*)wall_clock)->timerLoop(); + return NULL; + } + + public: + JvmtiWallClockSampler() : + _interval(LONG_MAX), + _reservoir_size(0), + _running(false), + _thread(0) {} + + const char* units() { + return "ns"; + } + + const char* name() { + return "WallClock - JVMTI"; + } + + long interval() const { + return _interval; + } + + Error start(Arguments& args); + void stop(); + + inline void enableEvents(bool enabled) { + _enabled.store(enabled, std::memory_order_release); + } +}; + +#endif // _WALLCLOCK_JVMTI_H diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/ContendedWallclockSamplesTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/ContendedWallclockSamplesTest.java index f4123ba36c..35bc9d8189 100644 --- a/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/ContendedWallclockSamplesTest.java +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/ContendedWallclockSamplesTest.java @@ -4,7 +4,6 @@ import com.datadoghq.profiler.Platform; import com.datadoghq.profiler.context.ContextExecutor; import org.junit.jupiter.api.Assumptions; -import org.junit.jupiter.api.Test; import org.junitpioneer.jupiter.RetryingTest; import org.openjdk.jmc.common.item.IItem; import org.openjdk.jmc.common.item.IItemIterable; diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/JvmtiBasedContextWallClockTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/JvmtiBasedContextWallClockTest.java new file mode 100644 index 0000000000..a9e1fa9a6d --- /dev/null +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/JvmtiBasedContextWallClockTest.java @@ -0,0 +1,9 @@ +package com.datadoghq.profiler.wallclock; + +public class JvmtiBasedContextWallClockTest extends ContextWallClockTest { + + @Override + protected String getProfilerCommand() { + return super.getProfilerCommand() + ";wallsampler=jvmti"; + } +} diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/JvmtiBasedWallclockThreadFilterTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/JvmtiBasedWallclockThreadFilterTest.java new file mode 100644 index 0000000000..25d29218df --- /dev/null +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/JvmtiBasedWallclockThreadFilterTest.java @@ -0,0 +1,9 @@ +package com.datadoghq.profiler.wallclock; + +public class JvmtiBasedWallclockThreadFilterTest extends WallclockThreadFilterTest { + + @Override + protected String getProfilerCommand() { + return super.getProfilerCommand() + ";wallsampler=jvmti"; + } +} diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/MegamorphicCallTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/MegamorphicCallTest.java index dfa1b9996c..50b29b3783 100644 --- a/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/MegamorphicCallTest.java +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/MegamorphicCallTest.java @@ -3,7 +3,6 @@ import com.datadoghq.profiler.AbstractProfilerTest; import com.datadoghq.profiler.Platform; import org.junit.jupiter.api.Assumptions; -import org.junit.jupiter.api.Test; import org.junitpioneer.jupiter.RetryingTest; import org.openjdk.jmc.common.item.IItem; import org.openjdk.jmc.common.item.IItemCollection; diff --git a/gradle/configurations.gradle b/gradle/configurations.gradle index c689a9bb41..0480d1417f 100644 --- a/gradle/configurations.gradle +++ b/gradle/configurations.gradle @@ -58,7 +58,7 @@ def locateLibasan() { } def locateLibtsan() { - return locateLibrary('libtsan') + return locateLibrary('libtsan') } ext.libasan = locateLibasan() @@ -116,7 +116,7 @@ def commonLinuxCompilerArgs = [ "-DCOUNTERS" ] -def commonLinuxLinkerArgs = ["-ldl", "-Wl,-z,defs", "--verbose", "-lpthread", "-lm", "-lrt", "-v"] +def commonLinuxLinkerArgs = ["-ldl", "-Wl,-z,defs", "--verbose", "-lpthread", "-lm", "-lrt"] def commonMacosCompilerArgs = commonLinuxCompilerArgs + ["-D_XOPEN_SOURCE", "-D_DARWIN_C_SOURCE"] @@ -206,7 +206,8 @@ addBuildConfiguration 'release', 'linux', 'x64', "-static-libstdc++", "-static-libgcc", "-Wl,--exclude-libs,ALL", - "-Wl,--gc-sections" + "-Wl,--gc-sections", + "-v" ] addBuildConfiguration 'debug', 'linux', 'x64', ['-O0', '-g', '-DDEBUG'] + commonLinuxCompilerArgs, @@ -251,4 +252,4 @@ addBuildConfiguration 'release', 'macos', 'arm64', [] addBuildConfiguration 'debug', 'macos', 'arm64', commonMacosCompilerArgs + ['-O0', '-g', '-DDEBUG'], - [] \ No newline at end of file + []