0

I want to profile the time during the Bazel build, when i set --experimental_generate_json_trace_profile in command line, it output ERROR: Unrecognized option: --experimental_generate_json_trace_profile. it can show cost when i set --profile=<file.gz> and profile by bazel analyze-profile <file.gz>, but it can't show in chrome://tracing/ when upload <file.gz>. So, how to generate the right file that can upload chrome://tracing/ and draw the right profile chart?

bazel version
WARNING: ignoring http_proxy in environment.
Build label: 0.10.0
Build target: bazel-out/k8-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Nov 9 04:43:10 +50056 (1517474666590)
Build timestamp: 1517474666590
Build timestamp as int: 1517474666590

2 Answers2

3

Bazel 0.10.0 is an very old release and does not have JSON trace profile support. Try the latest release! (In fact, that option has been enabled by default in recent years.)

Benjamin Peterson
  • 19,297
  • 6
  • 32
  • 39
  • you are right, i find a solution: using flag `--profile=` and `bazel analyze-profile --html` can generate html and show time cost. – GuangJun Liu Aug 22 '23 at 01:54
0

The experimental prefix was dropped some time ago. Now it is only:

--generate_json_trace_profile

See also: https://bazel.build/reference/command-line-reference#flag--generate_json_trace_profile

lummax
  • 333
  • 8