diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java index a7b1a96a0c..cb7dd06472 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java @@ -272,7 +272,15 @@ public final class BlazeRuntime { ProfiledTaskKinds profiledTasks = ProfiledTaskKinds.NONE; try { - if (options.profilePath != null) { + if (options.enableTracer) { + Path profilePath = options.profilePath != null + ? env.getWorkspace().getRelative(options.profilePath) + : env.getOutputBase().getRelative("command.profile"); + recordFullProfilerData = false; + out = profilePath.getOutputStream(); + env.getReporter().handle(Event.info("Writing tracer profile to '" + profilePath + "'")); + profiledTasks = ProfiledTaskKinds.ALL_FOR_TRACE; + } else if (options.profilePath != null) { Path profilePath = env.getWorkspace().getRelative(options.profilePath); recordFullProfilerData = options.recordFullProfilerData; |