log
This document provides an overview of the commands and options available under buck2 log
.
buck2 log
Commands for interacting with buck2 logs
Usage: buck2 log <COMMAND>
Subcommands:
what-ran
: Output everything Buck2 ran from selected invocationwhat-failed
: Outputs every command that failed in the selected invocationpath
: Output the path to the selected logshow
: Outputs the log in JSON format from selected invocationcmd
: Show buck command line arguments from selected invocationwhat-up
: Show the spans that were open when the log endedwhat-materialized
: Outputs materializations from selected invocationwhat-uploaded
: Outputs stats about uploads to RE from the selected invocationcritical-path
: Show the critical path for a selected buildreplay
: Replay an event logshow-user
: Converts the event log from a selected invocation into a user event log, in JSONL formatsummary
: Outputs high level statistics about the builddiff
: Subcommands for diff'ing two buck2 commandsexternal-configs
: Display the values and origins of external configs for a selected command
buck2 log what-ran
Output everything Buck2 ran from selected invocation.
The output is presented as a series of tab-delimited records with the following structure:
The reason for executing a given command. That's either to build or to test.
The identity of this command. This will include the target that ran required it.
The executor for this command. This will either be RE or local.
Details to reproduce it. For RE, that's the action digest. For local, the command.
To reproduce an action that ran on RE, use the following command then follow the instructions. The DIGEST is of the form hash:size
.
frecli cas download-action DIGEST
To reproduce an action that ran locally, make sure your working directory is the project root (if unsure, use buck2 root --kind project
to find it), then run the command. The command is already shell-quoted.
Usage: buck2 log what-ran [OPTIONS] [PATH]
Arguments:
<PATH>
A path to an event-log file to read from
Options:
-
--recent <NUMBER>
Open the event-log file from a recent command -
--trace-id <ID>
Show log by trace id -
--allow-remote
This option does nothing -
--no-remote
Do not allow downloading the log from manifold if it's not found locally -
--format <OUTPUT>
Which output format to use for this command- Default value:
tabulated
- Possible values:
tabulated
json
csv
- Default value:
-
--emit-cache-queries
-
--skip-cache-hits
-
--skip-remote-executions
-
--skip-local-executions
-
--filter-category <FILTER_CATEGORY>
Regular expression to filter commands by given action category (i.e. type of of actions that are similar but operate on different inputs, such as invocations of a C++ compiler (whose category would becxx_compile
)). Matches by full string -
--failed
Show only commands that failed -
--incomplete
Show only commands that were not completed. That is command were running if buck2 process was killed, or command currently running if buck2 is running build now -
--show-std-err
Show also std_err from commands that are run. If the command fails before completing, we display "<command did not finish executing>". If it finishes but there is no error, we display "<stderr is empty>". Otherwise, std_err is shown. For JSON, we show raw values and null for non-completion -
--omit-empty-std-err
Omit commands if their std_err is empty
buck2 log what-failed
Outputs every command that failed in the selected invocation.
Look at the help for what-ran to understand the output format.
Usage: buck2 log what-failed [OPTIONS] [PATH]
Arguments:
<PATH>
A path to an event-log file to read from
Options:
-
--recent <NUMBER>
Open the event-log file from a recent command -
--trace-id <ID>
Show log by trace id -
--allow-remote
This option does nothing -
--no-remote
Do not allow downloading the log from manifold if it's not found locally -
--format <OUTPUT>
Which output format to use for this command- Default value:
tabulated
- Possible values:
tabulated
json
csv
- Default value:
-
--emit-cache-queries
-
--skip-cache-hits
-
--skip-remote-executions
-
--skip-local-executions
-
--filter-category <FILTER_CATEGORY>
Regular expression to filter commands by given action category (i.e. type of of actions that are similar but operate on different inputs, such as invocations of a C++ compiler (whose category would becxx_compile
)). Matches by full string
buck2 log path
Output the path to the selected log
Usage: buck2 log path [OPTIONS] [PATH]
Arguments:
<PATH>
A path to an event-log file to read from
Options:
-
--recent <NUMBER>
Open the event-log file from a recent command -
--trace-id <ID>
Show log by trace id -
--allow-remote
This option does nothing -
--no-remote
Do not allow downloading the log from manifold if it's not found locally -
--all
List all the logs
buck2 log show
Outputs the log in JSON format from selected invocation
Usage: buck2 log show [OPTIONS] [PATH]
Arguments:
<PATH>
A path to an event-log file to read from
Options:
-
--recent <NUMBER>
Open the event-log file from a recent command -
--trace-id <ID>
Show log by trace id -
--allow-remote
This option does nothing -
--no-remote
Do not allow downloading the log from manifold if it's not found locally
buck2 log cmd
Show buck command line arguments from selected invocation.
This command output is not machine readable. Robots, please use buck2 log show
.
Usage: buck2 log cmd [OPTIONS] [PATH]
Arguments:
<PATH>
A path to an event-log file to read from
Options:
-
--recent <NUMBER>
Open the event-log file from a recent command -
--trace-id <ID>
Show log by trace id -
--allow-remote
This option does nothing -
--no-remote
Do not allow downloading the log from manifold if it's not found locally -
--expand
Show @-expanded command line arguments instead of the original command line
buck2 log what-up
Show the spans that were open when the log ended
Usage: buck2 log what-up [OPTIONS] [PATH]
Arguments:
<PATH>
A path to an event-log file to read from
Options:
-
--recent <NUMBER>
Open the event-log file from a recent command -
--trace-id <ID>
Show log by trace id -
--allow-remote
This option does nothing -
--no-remote
Do not allow downloading the log from manifold if it's not found locally -
--after <NUMBER>
Print the actions that where open after certain amount of milliseconds
buck2 log what-materialized
Outputs materializations from selected invocation.
The output is a tab-separated list containing the path, the materialization method, the file count, and the total size (after decompression).
Usage: buck2 log what-materialized [OPTIONS] [PATH]
Arguments:
<PATH>
A path to an event-log file to read from
Options:
-
--recent <NUMBER>
Open the event-log file from a recent command -
--trace-id <ID>
Show log by trace id -
--allow-remote
This option does nothing -
--no-remote
Do not allow downloading the log from manifold if it's not found locally -
-s, --sort-by-size
Sort the output by total bytes in ascending order -
--aggregate-by-ext
Aggregates the output by file extension -
--format <OUTPUT>
Which output format to use for this command- Default value:
tabulated
- Possible values:
tabulated
json
csv
- Default value:
buck2 log what-uploaded
Outputs stats about uploads to RE from the selected invocation
Usage: buck2 log what-uploaded [OPTIONS] [PATH]
Arguments:
<PATH>
A path to an event-log file to read from
Options:
-
--recent <NUMBER>
Open the event-log file from a recent command -
--trace-id <ID>
Show log by trace id -
--allow-remote
This option does nothing -
--no-remote
Do not allow downloading the log from manifold if it's not found locally -
--format <OUTPUT>
Which output format to use for this command- Default value:
tabulated
- Possible values:
tabulated
json
csv
- Default value:
-
--aggregate-by-ext
Aggregates the output by file extension
buck2 log critical-path
Show the critical path for a selected build.
This produces tab-delimited output listing every node on the critical path.
It includes the kind of node, its name, category and identifier, as well as total duration (runtime of this node), user duration (duration the user can improve) and potential improvement before this node stops being on the critical path.
All durations are in microseconds.
Usage: buck2 log critical-path [OPTIONS] [PATH]
Arguments:
<PATH>
A path to an event-log file to read from
Options:
-
--recent <NUMBER>
Open the event-log file from a recent command -
--trace-id <ID>
Show log by trace id -
--allow-remote
This option does nothing -
--no-remote
Do not allow downloading the log from manifold if it's not found locally -
--format <FORMAT>
Which output format to use for this command- Default value:
tabulated
- Possible values:
tabulated
json
csv
- Default value:
buck2 log replay
Replay an event log.
This command allows visualizing an existing event log in a Superconsole.
Usage: buck2 log replay [OPTIONS] [PATH] [OVERRIDE_ARGS]...
Arguments:
-
<PATH>
A path to an event-log file to read from -
<OVERRIDE_ARGS>
Override the arguments
Options:
-
--recent <NUMBER>
Open the event-log file from a recent command -
--trace-id <ID>
Show log by trace id -
--allow-remote
This option does nothing -
--no-remote
Do not allow downloading the log from manifold if it's not found locally -
--speed <NUMBER>
Control the playback speed using a float (i.e. 0.5, 2, etc) -
--preload
Preload the event log. This is typically only useful for benchmarking -
--console <super|simple|...>
Which console to use for this command- Default value:
auto
- Possible values:
auto
none
simple
simplenotty
simpletty
super
- Default value:
-
--ui <UI>
Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dice
debugevents
io
: I/O panelre
: RE panel
- Possible values:
-
--no-interactive-console
Disable console interactions
buck2 log show-user
Converts the event log from a selected invocation into a user event log, in JSONL format
Usage: buck2 log show-user [OPTIONS] [PATH]
Arguments:
<PATH>
A path to an event-log file to read from
Options:
-
--recent <NUMBER>
Open the event-log file from a recent command -
--trace-id <ID>
Show log by trace id -
--allow-remote
This option does nothing -
--no-remote
Do not allow downloading the log from manifold if it's not found locally
buck2 log summary
Outputs high level statistics about the build
Usage: buck2 log summary [OPTIONS] [PATH]
Arguments:
<PATH>
A path to an event-log file to read from
Options:
-
--recent <NUMBER>
Open the event-log file from a recent command -
--trace-id <ID>
Show log by trace id -
--allow-remote
This option does nothing -
--no-remote
Do not allow downloading the log from manifold if it's not found locally
buck2 log diff
Subcommands for diff'ing two buck2 commands
Usage: buck2 log diff <COMMAND>
Subcommands:
action-divergence
: Identifies the first divergent action between two builds. Divergence is identified by the same action having differing outputs. Useful for identifying non-determinismexternal-configs
: Identifies the diff between external buckconfigs between two commands
buck2 log diff action-divergence
Identifies the first divergent action between two builds. Divergence is identified by the same action having differing outputs. Useful for identifying non-determinism
Usage: buck2 log diff action-divergence <--path1 <PATH1>|--trace-id1 <TRACE_ID1>|--recent1 <NUMBER>> <--path2 <PATH2>|--trace-id2 <TRACE_ID2>|--recent2 <NUMBER>>
Options:
-
--path1 <PATH1>
A path to an event-log file of the first command -
--trace-id1 <TRACE_ID1>
Trace id of the first command -
--recent1 <NUMBER>
Open the event-log file from a recent command for the first command -
--path2 <PATH2>
A path to an event-log file of the second command -
--trace-id2 <TRACE_ID2>
Trace id of the second command -
--recent2 <NUMBER>
Open the event-log file from a recent command for the second command
buck2 log diff external-configs
Identifies the diff between external buckconfigs between two commands
Usage: buck2 log diff external-configs <--path1 <PATH1>|--trace-id1 <TRACE_ID1>|--recent1 <NUMBER>> <--path2 <PATH2>|--trace-id2 <TRACE_ID2>|--recent2 <NUMBER>>
Options:
-
--path1 <PATH1>
A path to an event-log file of the first command -
--trace-id1 <TRACE_ID1>
Trace id of the first command -
--recent1 <NUMBER>
Open the event-log file from a recent command for the first command -
--path2 <PATH2>
A path to an event-log file of the second command -
--trace-id2 <TRACE_ID2>
Trace id of the second command -
--recent2 <NUMBER>
Open the event-log file from a recent command for the second command
buck2 log external-configs
Display the values and origins of external configs for a selected command.
Buckconfigs are computed by joining together values from various inputs (repo, well-known directories, CLI flags). Each of these is logged in the given order, with later components overriding earlier ones. For config files originating from the repo (i.e. project-relative paths), except .buckconfig.local, we log the path, not the actual values.
Usage: buck2 log external-configs [OPTIONS] [PATH]
Arguments:
<PATH>
A path to an event-log file to read from
Options:
-
--recent <NUMBER>
Open the event-log file from a recent command -
--trace-id <ID>
Show log by trace id -
--allow-remote
This option does nothing -
--no-remote
Do not allow downloading the log from manifold if it's not found locally -
--format <FORMAT>
Which output format to use for this command- Default value:
tabulated
- Possible values:
tabulated
json
csv
- Default value: