# llvm: Add support for collecting time trace \(\#8546\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/83e0a49ba4938fb90b27c01ce9adc3dbe2984164)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 83e0a49ba4938fb90b27c01ce9adc3dbe2984164

Requested commit: 83e0a49ba4938fb90b27c01ce9adc3dbe2984164

Commit: 83e0a49ba4938fb90b27c01ce9adc3dbe2984164

Tree: 92a7463ec5c24c5edacafbf1f46517c38f6b913f

Author: Min-Yih Hsu

Committer: GitHub

## Message

```
llvm: Add support for collecting time trace (#8546)

LLVM time profiler can collect time traces and present them in a
hierarchical view. Which breakdowns the time spent in each Pass or even
IR unit. The result is also exported into a format that can be easily
visualized by the Chrome browser.

Currently this features is controlled by the following environment
variables:
 - `ZIG_LLVM_TIME_TRACE_FILE` toggles this feature and specifies the
   output time trace file.
 - `ZIG_LLVM_TIME_TRACE_GRANULARITY` controls the time granularity in
   ms (default to 500).
```

## Parents

- [9c08a33b2226239b8e0cf08ebcef17d710a54d8a](https://git.cafe/gitcafe/zig/commit/9c08a33b2226239b8e0cf08ebcef17d710a54d8a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/83e0a49ba4938fb90b27c01ce9adc3dbe2984164?format=markdown)
