Skip to content

Commit

Permalink
Standardize some of the profiler sampling frequencies
Browse files Browse the repository at this point in the history
  • Loading branch information
MattAlp committed Nov 14, 2024
1 parent 9246b9f commit 695065f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.datadog.profiling.utils.ProfilingMode;
import com.datadoghq.profiler.ContextSetter;
import com.datadoghq.profiler.JavaProfiler;
import datadog.trace.api.Platform;
import datadog.trace.api.config.ProfilingConfig;
import datadog.trace.api.profiling.RecordingData;
import datadog.trace.bootstrap.config.provider.ConfigProvider;
Expand Down Expand Up @@ -258,6 +259,8 @@ String cmdStartProfiling(Path file) throws IllegalStateException {
}
if (profilingModes.contains(CPU)) {
// cpu profiling is enabled.
final int DEFAULT_J9_CPU_SAMPLING_FREQUENCY = 50;

String schedulingEvent = getSchedulingEvent(configProvider);
if (schedulingEvent != null && !schedulingEvent.isEmpty()) {
// using a user-specified event, e.g. L1-dcache-load-misses
Expand All @@ -268,7 +271,12 @@ String cmdStartProfiling(Path file) throws IllegalStateException {
}
} else {
// using cpu time schedule
cmd.append(",cpu=").append(getCpuInterval(configProvider)).append('m');
cmd.append(",cpu=")
.append(
Platform.isJ9()
? DEFAULT_J9_CPU_SAMPLING_FREQUENCY
: getCpuInterval(configProvider))
.append('m');
}
}
if (profilingModes.contains(WALL)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public final class ProfilingConfig {
public static final boolean PROFILING_DATADOG_PROFILER_WALL_ENABLED_DEFAULT = true;
public static final String PROFILING_DATADOG_PROFILER_WALL_INTERVAL =
"profiling.ddprof.wall.interval.ms";
public static final int PROFILING_DATADOG_PROFILER_WALL_INTERVAL_DEFAULT = 10;
public static final int PROFILING_DATADOG_PROFILER_WALL_INTERVAL_DEFAULT = 50;

public static final String PROFILING_DATADOG_PROFILER_WALL_COLLAPSING =
"profiling.ddprof.wall.collapsing";
Expand Down

0 comments on commit 695065f

Please sign in to comment.