Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 CLI Documentation | 2025.2

# p4 diagnostics

Generate diagnostic data about the P4 Server.

## Syntax

    p4 g-opts diagnostics [-D] [-j] [-J [-L limit]]
    p4 g-opts diagnostics [-D] [-l] [-s [--strace-runtime secs]] [-p] [-t]
                          [-a [-J [-L limit]] ]

Syntax and naming conventions

## Description

The first form of the command generates the basic diagnostic data, and downloads a compressed tar file (`.tgz`) that contains these files:

- `diags` - basic configuration details, configuration, configuration history, server setting.

- `info` - tagged output from the `p4 info` and `p4 servers -J` commands, and a list of all non-default configurables.

- `monitor` - the monitor records, if monitoring is enabled.

- `topology` - a textual description of the network that contains this server. Servers that do not have a serverID are ignored.

The second form of the command provides information that might take more time and require more server resources.

## Options

Option | Description
--- | ---
`-D` | Create a new directory and download the requested uncompressed individual files into this new directory. Without this option, download a single compressed tar file.
`-J` | Download a copy of the current journal file and log file, using the configured names of these files.
`-L limit` | Limit the download size of the journal and log files to the last `limit` number of bytes of these files, subject to buffer rounding. The `limit` is in bytes and can be suffixed with a single character to designate a unit multiplier: `k` or `K` for kilobytes, `m` or `M` for megabytes, `g` or `G` for gigabytes, and `t` or `T` for terabytes.
`-j` | Request that the `diags` and `monitor` files are encoded in JSON format. These output files are named `diags.json` and `monitor.json`. Any non-UFT8 sequences in a string are replaced by U+FFFD in the JSON output.
`-l` | Request that the `/usr/bin/lsof` be run to provide locking details of all files in use by P4 Servers on this system. The data from this operation is downloaded into a file named `manuallocks`. This option is not supported on Windows.
`-s` | Run an `strace` command on the server processes for 20 seconds. The data from this operation is downloaded into a file named `strace`. The `strace` Linux command is not supported on Windows.
`-t` | Run the `top` program and returns its output.
`-p` | Run the `ps` program and returns its output.
-a | Request that the basic diagnostic files of `p4 `g-opts` diagnostics [-L limit]` be produced. Without this option, those files are omitted with the `-l`, `-t`, `-p`, and `-s` options.

## Usage notes

Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required
--- | --- | ---
N/A | N/A | `admin` available to an operator user

## Examples

Command | Output
--- | ---
`p4 diagnostics` | `The diagnostics command has created the 'diagnostics_20250923053358-0700.tgz' compressed tar file containing: diags, topology, monitor, topology.dot, info.` where 20250923 is in `yyyymmdd` format.
`p4 diagnostics -D` | `The diagnostics command has created the 'diagnostics_20250923053930-0700' directory containing: diags, topology, monitor, topology.dot, info.`
`p4 diagnostics -s` | `The diagnostics command has created the 'diagnostics_20250923054917-0700.tgz' compressed tar file containing: strace.`

Your search for returned results