Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,13 @@ private String getProfilerConfig() {
ProfilingConfig.PROFILING_DATADOG_PROFILER_WALL_CONTEXT_FILTER,
ProfilingConfig.PROFILING_DATADOG_PROFILER_WALL_CONTEXT_FILTER_DEFAULT),
ProfilingConfig.PROFILING_DATADOG_PROFILER_WALL_CONTEXT_FILTER_DEFAULT);
appendConfig(
sb,
"DDProf force preload jmethodIDs",
configProvider.getBoolean(
ProfilingConfig.PROFILING_DATADOG_PROFILER_FORCE_JMETHODID,
ProfilingConfig.PROFILING_DATADOG_PROFILER_FORCE_JMETHODID_DEFAULT),
ProfilingConfig.PROFILING_DATADOG_PROFILER_FORCE_JMETHODID_DEFAULT);
sb.append("\n=== DDProf Allocation Profiling ===\n");
appendConfig(
sb,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.datadog.profiling.ddprof;

import static com.datadog.profiling.ddprof.DatadogProfilerConfig.forceJMethodID;
import static com.datadog.profiling.ddprof.DatadogProfilerConfig.getAllocationInterval;
import static com.datadog.profiling.ddprof.DatadogProfilerConfig.getCStack;
import static com.datadog.profiling.ddprof.DatadogProfilerConfig.getContextAttributes;
Expand Down Expand Up @@ -276,6 +277,12 @@ String cmdStartProfiling(Path file) throws IllegalStateException {
if (omitLineNumbers(configProvider)) {
cmd.append(",linenumbers=f");
}

// Default is true
if (!forceJMethodID(configProvider)) {
cmd.append(",force_jmethodID=false");
}

if (profilingModes.contains(CPU)) {
// cpu profiling is enabled.
String schedulingEvent = getSchedulingEvent(configProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_CPU_INTERVAL_DEFAULT;
import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_CSTACK;
import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_CSTACK_DEFAULT;
import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_FORCE_JMETHODID;
import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_FORCE_JMETHODID_DEFAULT;
import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_LIBPATH;
import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_LINE_NUMBERS;
import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_LINE_NUMBERS_DEFAULT;
Expand Down Expand Up @@ -439,6 +441,13 @@ public static long getLong(ConfigProvider configProvider, String key) {
return configProvider.getLong(key, configProvider.getLong(normalizeKey(key), -1));
}

public static boolean forceJMethodID(ConfigProvider configProvider) {
return getBoolean(
configProvider,
PROFILING_DATADOG_PROFILER_FORCE_JMETHODID,
PROFILING_DATADOG_PROFILER_FORCE_JMETHODID_DEFAULT);
}

private static String normalizeKey(String key) {
return key.replace(".ddprof.", ".async.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public final class ProfilingConfig {
public static final String PROFILING_UPLOAD_TIMEOUT = "profiling.upload.timeout";
public static final int PROFILING_UPLOAD_TIMEOUT_DEFAULT = 30;

// Experimental feature for reducing jmethoidID allocations
public static final String PROFILING_DATADOG_PROFILER_FORCE_JMETHODID =
"profiling.experimental.ddprof.force_jmethodID";
// The feature is off by default
public static final boolean PROFILING_DATADOG_PROFILER_FORCE_JMETHODID_DEFAULT = true;

/**
* @deprecated Use {@link #PROFILING_DEBUG_UPLOAD_COMPRESSION} instead. This will be removed in a
* future release.
Expand Down
8 changes: 8 additions & 0 deletions metadata/supported-configurations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3409,6 +3409,14 @@
"aliases": []
}
],
"DD_PROFILING_EXPERIMENTAL_DDPROF_FORCE_JMETHODID": [
{
"version": "A",
"type": "boolean",
"default": "true",
"aliases": []
}
],
"DD_PROFILING_URL": [
{
"version": "A",
Expand Down