On 25 Sep 2026, at 12:16, Timothy Redaelli wrote:

> When --format json is passed to ovs-appctl, pmd-perf-show returns a
> JSON object keyed by thread identifier ("pmd-cNN" for PMD threads,
> "main" for the main thread).  Each entry contains:
>
>   - "core" (only for PMD threads) and "numa"
>   - "measurement-duration-s" (seconds as real)
>   - "iterations" (iteration counts and times, only for PMD threads)
>   - "packets" (received, recirculated, transmitted and tx batches)
>   - "cycles" (idle and processing cycles, only for PMD threads)
>   - "flow-cache-hits" and "upcalls" (only if packets were received)
>   - "averages" (per packet, per batch and per upcall ratios)
>
> Keys are omitted when the value is not available for a thread, rather
> than being reported as null.
>
> When the detailed metrics are enabled, the command options select the
> same additional sections as in text mode: "histograms" unless -nh is
> given, "iteration-history" for -it and "millisecond-history" for -ms.
> Each histogram is an object with a "walls" array of upper bin bounds
> and a "bins" array of sample counts, one element longer than "walls"
> because the last bin collects everything above the last wall.  The two
> histories are arrays with the most recent sample first.
>
> The counters are read and the arithmetic is done in a single place:
> pmd_perf_format_overall_stats_json() builds the JSON object and
> pmd_perf_format_overall_stats() renders the text output from it, so
> the two formats cannot drift apart.
>
> Example output:
>   {"pmd-c03": {"core": 3, "numa": 0,
>                "measurement-duration-s": 1.0,
>                "packets": {"received": 20, "recirculated": 0,
>                            "transmitted": 20, "tx-batches": 20},
>                "cycles": {"idle": {"count": 0, "percentage": 0},
>                           "processing": {"count": 8, "percentage": 100}},
>                "flow-cache-hits": {"partial-hardware-offload": 0,
>                                    "simple": 0, "exact": 19,
>                                    "signature": 0, "megaflow": 0},
>                "upcalls": {"success": 1, "failure": 0},
>                "averages": {"datapath-passes-per-packet": 1,
>                             "packets-per-tx-batch": 1}}}

Thanks for the rework Timothy. The Changes look good to me.

Acked-by: Eelco Chaudron <[email protected]>

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to