From 66851476906ef99627a2ee8e9c5a08a64b7159f9 Mon Sep 17 00:00:00 2001 From: Cristian Hancila Date: Mon, 14 Feb 2022 17:02:23 -0800 Subject: [PATCH] Add `target_label` member to SpawnExec in the action log. --- .../com/google/devtools/build/lib/exec/SpawnLogContext.java | 5 +++++ src/main/protobuf/spawn.proto | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/com/google/devtools/build/lib/exec/SpawnLogContext.java b/src/main/java/com/google/devtools/build/lib/exec/SpawnLogContext.java index 1ca1e83eb33f70..ff4196bbe7334c 100644 --- a/src/main/java/com/google/devtools/build/lib/exec/SpawnLogContext.java +++ b/src/main/java/com/google/devtools/build/lib/exec/SpawnLogContext.java @@ -156,6 +156,11 @@ public void logSpawn( } builder.setMnemonic(spawn.getMnemonic()); builder.setWalltime(Durations.fromNanos(result.getMetrics().executionWallTime().toNanos())); + + if (spawn.getTargetLabel() != null) { + builder.setTargetLabel(spawn.getTargetLabel()); + } + executionLog.write(builder.build()); } diff --git a/src/main/protobuf/spawn.proto b/src/main/protobuf/spawn.proto index 039a5613d8e60c..af3286a1cf0be6 100644 --- a/src/main/protobuf/spawn.proto +++ b/src/main/protobuf/spawn.proto @@ -132,4 +132,7 @@ message SpawnExec { // The wall time it took to execute the Spawn. This is only the time spent in // the subprocess, not including the time doing setup and teardown. google.protobuf.Duration walltime = 17; + + // Canonical label of the target that emitted this spawn, may not always be set. + string target_label = 18; }