Bazel: analyze-profile: java.util.zip.ZipException: incorrect header check OR out of date profiling documentation

Created on 9 Jul 2019  路  11Comments  路  Source: bazelbuild/bazel

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

In bazel 0.27.0, I try to run a profile like:

$ bazel clean --expunge
$ bazel build --profile=/home/greg/bazel_prof_yo //foo
INFO: Writing tracer profile to '/home/greg/bazel_prof_yo'
INFO: Analyzed target //foo (30 packages loaded, 1998 targets configured).
INFO: Found 1 target...
Target //foo up-to-date:
  bazel-bin/foo
INFO: Elapsed time: 23.230s, Critical Path: 9.99s
INFO: 152 processes: 5 linux-sandbox, 147 local.
INFO: Build completed successfully, 312 total actions

looks good so far. Then I try to analyze the profile and this happens:

$ bazel analyze-profile /home/greg/bazel_prof_yo
WARNING: This information is intended for consumption by Bazel developers only, and may change at any time.  Script against it at your own risk
INFO: Loading /home/greg/bazel_prof_yo
java.util.zip.ZipException: incorrect header check
ERROR: Failed to analyze profile file(s): incorrect header check

What operating system are you running Bazel on?

Ubuntu 18.04

What's the output of bazel info release?

release 0.27.0- (@non-git)

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

nix

Have you found anything relevant by searching the web?

nothing

P1 team-Performance bug

Most helpful comment

@meisterT Curious, why analyze-profile was deprecated? It was really beneficial for us to parse the phase information as part of our CI and publish this in a data-warehouse for analysis-

=== PHASE SUMMARY INFORMATION ===

Total launch phase time          978 ms    2.67%
Total init phase time            178 ms    0.49%
Total loading phase time         381 ms    1.04%
Total analysis phase time       2.618 s    7.15%
Total preparation phase time    46.0 ms    0.13%
Total execution phase time     32.366 s   88.46%
Total finish phase time         19.3 ms    0.05%
Total run time                 36.586 s  100.00%

The trace files are good for diving deeper into an issue, but not well suite for gathering daily CI build stats. We have a large project, with 150 gradle modules. We'd like to monitor when regressions to our build time occurs.

Let me know if you have any other suggestions that I may have missed. Trace files seem to solve a different problem IMO.

Thanks!

All 11 comments

The profile output file is human readable, looks like a json doc. Could the problem be that it is expected to be zipped?

Hmm... this file is compatible with chrome://tracing. Did --experimental_generate_json_trace_profile become standard? If so then the problem is https://docs.bazel.build/versions/master/skylark/performance.html#performance-profiling being out of date.

We do want to make the JSON profile the default, but that should not have happened yet. I'll investigate.

Ah, we already did that, so it's a documentation issue and not a bug.
See https://github.com/bazelbuild/bazel/issues/8312 and https://blog.bazel.build/2019/06/17/bazel-0.27.0.html

@meisterT Curious, why analyze-profile was deprecated? It was really beneficial for us to parse the phase information as part of our CI and publish this in a data-warehouse for analysis-

=== PHASE SUMMARY INFORMATION ===

Total launch phase time          978 ms    2.67%
Total init phase time            178 ms    0.49%
Total loading phase time         381 ms    1.04%
Total analysis phase time       2.618 s    7.15%
Total preparation phase time    46.0 ms    0.13%
Total execution phase time     32.366 s   88.46%
Total finish phase time         19.3 ms    0.05%
Total run time                 36.586 s  100.00%

The trace files are good for diving deeper into an issue, but not well suite for gathering daily CI build stats. We have a large project, with 150 gradle modules. We'd like to monitor when regressions to our build time occurs.

Let me know if you have any other suggestions that I may have missed. Trace files seem to solve a different problem IMO.

Thanks!

@meisterT do you have any insight as to why this information isn't part of BEP?

Is there an alternative way to get the Critical path section's information with the new json profile?

Also, docs for --profile still say to use bazel analyze-profile:

https://docs.bazel.build/versions/master/command-line-reference.html:

If set, profile Bazel and write data to the specified file. Use bazel analyze- profile to analyze the profile.

Curious, why analyze-profile was deprecated? It was really beneficial for us to parse the phase information as part of our CI and publish

Curious about this too.. it seems the two profile modes served different use cases. @meisterT is there a way of getting a simple summary using the new profiler?

Not yet, but I am working on it.

Work will be tracked in #10140

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lisaonduty picture lisaonduty  路  3Comments

GaofengCheng picture GaofengCheng  路  3Comments

kastiglione picture kastiglione  路  3Comments

buchgr picture buchgr  路  3Comments

davidzchen picture davidzchen  路  3Comments