On 13 Mar 2026, at 21:51, Timothy Redaelli via dev wrote:

> When --format json is passed to ovs-appctl, pmd-stats-show returns a
> JSON array with one object per PMD thread (plus an object for the main
> thread, identified by "type":"main").  Each object contains packet
> counts, cache hit counters, cycle usage and their derived percentages.
> All floating-point fields are always present even when the divisor is
> zero (they are reported as 0.0 in that case).
>
> Example output (abbreviated):
>   [{"type":"pmd","numa_id":0,"core_id":3,
>     "packets_received":1000,"emc_hits":500,
>     "megaflow_hits":400,"miss_with_success_upcall":100,
>     "idle_cycles_pct":90.0,"processing_cycles_pct":10.0,...}]
>
> Signed-off-by: Timothy Redaelli <[email protected]>


Hi Timothy,

For this patch, please index the PMDs by their core_id rather than using
an array. This is consistent with the approach used in patch 3
(pmd-sleep-show). Here's the suggested structure:

{
  "pmds": {
    "3": {
      "numa_id": 0,
      "packets_received": 1000,
      "packet_recirculations": 50,
      "avg_datapath_passes_per_packet": 1.05,
      "phwol_hits": 100,
      "mfex_opt_hits": 200,
      "simple_match_hits": 150,
      "emc_hits": 500,
      "smc_hits": 100,
      "megaflow_hits": 400,
      "avg_subtable_lookups_per_megaflow_hit": 1.2,
      "miss_with_success_upcall": 100,
      "miss_with_failed_upcall": 0,
      "avg_packets_per_output_batch": 32.5,
      "idle_cycles": 900000,
      "idle_cycles_percentage": 90.0,
      "processing_cycles": 100000,
      "processing_cycles_percentage": 10.0,
      "avg_cycles_per_packet": 1000.0,
      "avg_processing_cycles_per_packet": 100.0
    },
    "5": {
      "numa_id": 0,
      ...
    }
  }
}

You can skip the type variable, and also it would be wise to group related
counters. Maybe packet, hit, cycle counters, etc.?

Cheers,

Eelco

[...]

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

Reply via email to