aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/profiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/profiler')
-rw-r--r--src/test/java/com/google/devtools/build/lib/profiler/AutoProfilerBenchmark.java18
-rw-r--r--src/test/java/com/google/devtools/build/lib/profiler/ProfilerChartTest.java3
-rw-r--r--src/test/java/com/google/devtools/build/lib/profiler/ProfilerTest.java36
3 files changed, 40 insertions, 17 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/profiler/AutoProfilerBenchmark.java b/src/test/java/com/google/devtools/build/lib/profiler/AutoProfilerBenchmark.java
index 044ae8c0d4..448a21baca 100644
--- a/src/test/java/com/google/devtools/build/lib/profiler/AutoProfilerBenchmark.java
+++ b/src/test/java/com/google/devtools/build/lib/profiler/AutoProfilerBenchmark.java
@@ -27,14 +27,16 @@ public class AutoProfilerBenchmark {
@BeforeExperiment
void startProfiler() throws Exception {
- Profiler.instance().start(
- ProfiledTaskKinds.ALL,
- new InMemoryFileSystem().getPath("/out.dat").getOutputStream(),
- Profiler.Format.BINARY_BAZEL_FORMAT,
- "benchmark",
- false,
- BlazeClock.instance(),
- BlazeClock.instance().nanoTime());
+ Profiler.instance()
+ .start(
+ ProfiledTaskKinds.ALL,
+ new InMemoryFileSystem().getPath("/out.dat").getOutputStream(),
+ Profiler.Format.BINARY_BAZEL_FORMAT,
+ "benchmark",
+ false,
+ BlazeClock.instance(),
+ BlazeClock.instance().nanoTime(),
+ /* enabledCpuUsageProfiling= */ false);
}
@BeforeExperiment
diff --git a/src/test/java/com/google/devtools/build/lib/profiler/ProfilerChartTest.java b/src/test/java/com/google/devtools/build/lib/profiler/ProfilerChartTest.java
index 43d6bbc2d1..468f6bba42 100644
--- a/src/test/java/com/google/devtools/build/lib/profiler/ProfilerChartTest.java
+++ b/src/test/java/com/google/devtools/build/lib/profiler/ProfilerChartTest.java
@@ -258,7 +258,8 @@ public class ProfilerChartTest extends FoundationTestCase {
"basic test",
false,
BlazeClock.instance(),
- BlazeClock.instance().nanoTime());
+ BlazeClock.instance().nanoTime(),
+ /* enabledCpuUsageProfiling= */ false);
// Write from multiple threads to generate multiple rows in the chart.
for (int i = 0; i < noOfRows; i++) {
diff --git a/src/test/java/com/google/devtools/build/lib/profiler/ProfilerTest.java b/src/test/java/com/google/devtools/build/lib/profiler/ProfilerTest.java
index a4b5424c1a..4c1878577e 100644
--- a/src/test/java/com/google/devtools/build/lib/profiler/ProfilerTest.java
+++ b/src/test/java/com/google/devtools/build/lib/profiler/ProfilerTest.java
@@ -79,13 +79,27 @@ public class ProfilerTest {
throws IOException {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
profiler.start(
- kinds, buffer, format, "test", false, BlazeClock.instance(), BlazeClock.nanoTime());
+ kinds,
+ buffer,
+ format,
+ "test",
+ false,
+ BlazeClock.instance(),
+ BlazeClock.nanoTime(),
+ /* enabledCpuUsageProfiling= */ false);
return buffer;
}
private void startUnbuffered(ProfiledTaskKinds kinds) throws IOException {
profiler.start(
- kinds, null, null, "test", false, BlazeClock.instance(), BlazeClock.nanoTime());
+ kinds,
+ null,
+ null,
+ "test",
+ false,
+ BlazeClock.instance(),
+ BlazeClock.nanoTime(),
+ /* enabledCpuUsageProfiling= */ false);
}
@Test
@@ -183,7 +197,8 @@ public class ProfilerTest {
"basic test",
true,
BlazeClock.instance(),
- BlazeClock.instance().nanoTime());
+ BlazeClock.instance().nanoTime(),
+ /* enabledCpuUsageProfiling= */ false);
try (SilentCloseable c = profiler.profile(ProfilerTask.ACTION, "action task")) {
// Next task takes less than 10 ms but should be recorded anyway.
clock.advanceMillis(1);
@@ -212,7 +227,8 @@ public class ProfilerTest {
"test",
true,
BlazeClock.instance(),
- BlazeClock.instance().nanoTime());
+ BlazeClock.instance().nanoTime(),
+ /* enabledCpuUsageProfiling= */ false);
profiler.logSimpleTask(10000, 20000, ProfilerTask.VFS_STAT, "stat");
profiler.logSimpleTask(20000, 30000, ProfilerTask.REMOTE_EXECUTION, "remote execution");
@@ -320,7 +336,8 @@ public class ProfilerTest {
"test",
true,
BlazeClock.instance(),
- BlazeClock.instance().nanoTime());
+ BlazeClock.instance().nanoTime(),
+ /* enabledCpuUsageProfiling= */ false);
profiler.logSimpleTask(10000, 20000, ProfilerTask.VFS_STAT, "stat");
assertThat(ProfilerTask.VFS_STAT.collectsSlowestInstances()).isTrue();
@@ -539,7 +556,8 @@ public class ProfilerTest {
"testResilenceToNonDecreasingNanoTimes",
false,
badClock,
- initialNanoTime);
+ initialNanoTime,
+ /* enabledCpuUsageProfiling= */ false);
profiler.logSimpleTask(badClock.nanoTime(), ProfilerTask.INFO, "some task");
profiler.stop();
}
@@ -589,7 +607,8 @@ public class ProfilerTest {
"basic test",
false,
BlazeClock.instance(),
- BlazeClock.instance().nanoTime());
+ BlazeClock.instance().nanoTime(),
+ /* enabledCpuUsageProfiling= */ false);
profiler.logSimpleTaskDuration(
Profiler.nanoTimeMaybe(), Duration.ofSeconds(10), ProfilerTask.INFO, "foo");
try {
@@ -615,7 +634,8 @@ public class ProfilerTest {
"basic test",
false,
BlazeClock.instance(),
- BlazeClock.instance().nanoTime());
+ BlazeClock.instance().nanoTime(),
+ /* enabledCpuUsageProfiling= */ false);
profiler.logSimpleTaskDuration(
Profiler.nanoTimeMaybe(), Duration.ofSeconds(10), ProfilerTask.INFO, "foo");
try {