Upload build.trace.gz for user builds.
Bug: 340206057 Test: Manually verified build.trace.gz was uploaded to build server. Change-Id: I9c071188343baf7c11c30a5c4c1d1ca7bcaac06b
This commit is contained in:
parent
aac481527e
commit
f2615e923e
1 changed files with 15 additions and 10 deletions
|
@ -155,7 +155,6 @@ func main() {
|
|||
|
||||
// Create a new trace file writer, making it log events to the log instance.
|
||||
trace := tracer.New(log)
|
||||
defer trace.Close()
|
||||
|
||||
// Create a new Status instance, which manages action counts and event output channels.
|
||||
stat := &status.Status{}
|
||||
|
@ -194,14 +193,29 @@ func main() {
|
|||
soongMetricsFile := filepath.Join(logsDir, c.logsPrefix+"soong_metrics")
|
||||
rbeMetricsFile := filepath.Join(logsDir, c.logsPrefix+"rbe_metrics.pb")
|
||||
soongBuildMetricsFile := filepath.Join(logsDir, c.logsPrefix+"soong_build_metrics.pb")
|
||||
buildTraceFile := filepath.Join(logsDir, c.logsPrefix+"build.trace.gz")
|
||||
|
||||
metricsFiles := []string{
|
||||
buildErrorFile, // build error strings
|
||||
rbeMetricsFile, // high level metrics related to remote build execution.
|
||||
soongMetricsFile, // high level metrics related to this build system.
|
||||
soongBuildMetricsFile, // high level metrics related to soong build
|
||||
buildTraceFile,
|
||||
}
|
||||
|
||||
defer func() {
|
||||
stat.Finish()
|
||||
criticalPath.WriteToMetrics(met)
|
||||
met.Dump(soongMetricsFile)
|
||||
if !config.SkipMetricsUpload() {
|
||||
build.UploadMetrics(buildCtx, config, c.simpleOutput, buildStarted, metricsFiles...)
|
||||
}
|
||||
}()
|
||||
|
||||
// This has to come after the metrics uploading function, so that
|
||||
// build.trace.gz is closed and ready for upload.
|
||||
defer trace.Close()
|
||||
|
||||
os.MkdirAll(logsDir, 0777)
|
||||
|
||||
log.SetOutput(filepath.Join(logsDir, c.logsPrefix+"soong.log"))
|
||||
|
@ -222,16 +236,7 @@ func main() {
|
|||
config = freshConfig()
|
||||
}
|
||||
|
||||
defer func() {
|
||||
stat.Finish()
|
||||
criticalPath.WriteToMetrics(met)
|
||||
met.Dump(soongMetricsFile)
|
||||
if !config.SkipMetricsUpload() {
|
||||
build.UploadMetrics(buildCtx, config, c.simpleOutput, buildStarted, metricsFiles...)
|
||||
}
|
||||
}()
|
||||
c.run(buildCtx, config, args)
|
||||
|
||||
}
|
||||
|
||||
// This function must not modify config, since product config may cause us to recreate the config,
|
||||
|
|
Loading…
Reference in a new issue