This series adds --format json support to five more ovs-appctl commands: fdb/stats-show, upcall/show, dpif-netdev/pmd-sleep-show, dpif-netdev/pmd-perf-show and dpctl/show.
Changes since v5: - 1/5 and 2/5: only picked up the Acked-by, they are otherwise unchanged. - 3/5: blank line after the declaration and the pmd list is now freed outside of the datapath mutex (Eelco). - 4/5: declaration order fixes in pmd_perf_format_overall_stats_json() and in dpif_netdev_pmd_info(), blank lines after the if and for blocks of the JSON helpers, and the man page no longer claims the histograms are selected by -nh, since they are reported unless -nh is given (Eelco). - 4/5: the -nh, -it and -ms test does not grep for a few keys anymore (Eelco). Checking the whole reply would mean 575 lines of expected output, 441 of them the seven histograms, so the test extracts the sections the three options control and compares those: the histogram "averages" object, which lists every histogram, one histogram in full with its constant walls and its cleared bins, and both histories, which is where the number of samples shows up. - 5/5: the two first returns of dps_for_each() are combined and the dpctl/show man page entry is now a two line summary instead of a field by field description that would have to be kept in sync (Eelco). The one comment on v5 not applied is the removal of the "if (enumerror)" check in dps_for_each(). enumerror can be zero there: it only takes a switch where every datapath type enumerates fine and no datapath has been created yet, and dpctl_error() with an errno of zero still appends "enumerating datapaths failed" to the reply, so a successful dpctl/show would grow a bogus error line. The check stays for that reason. Changes since v4: - Only the two tests added in v4 changed, the code is untouched. - 2/5: the second datapath of the upcall/show test now uses the netdev type instead of the system one. --enable-dummy=override only overrides the datapath types that are already registered, and the system type is not registered on the platforms without the kernel datapath, so the bridge failed to be created there. - 5/5: the dpctl/show test does not expect the cache statistics anymore. They are reported only when the datapath reports a non zero mask cache hit count, which a datapath that has not forwarded any packet yet never does, so the check depended on a state the test does not create. Changes since v3: - Rebased on top of the current main. - Series wide: no key is reported with a null value anymore. A key that has no value is simply not reported (Ilya). - Series wide: each patch now carries its own NEWS entry, instead of a single combined one in the last patch (Ilya, v1). - 1/5: dropped the bridge_name argument of both helpers and moved the mac_learning rwlock into them (Eelco). - 2/5: declaration order and blank line fixes (Eelco); added a test covering two datapaths at once (Eelco, v1). - 3/5: declaration order fix, dropped a ds_destroy() on a path where the dynamic string is never written (Eelco). - 4/5: the raw counters and the derived ratios are now computed once by pmd_perf_summarize() and shared by the text and the JSON formatter (Ilya); reworked the JSON schema (Ilya); all the JSON handling moved into the output format check, so the per PMD loop is text only again, plus prototype, declaration order and indentation fixes (Eelco). - 5/5: dropped json_integer_or_null_create(), grouped the cache hit statistics and the cache level configuration under a single "cache" object (Ilya); include order, declaration order and blank line fixes, and dps_for_each() now reports the datapath enumeration failure it used to return silently, which answers "is ds set in all error cases for json?" with "it was not, now it is" (Eelco). Changes since v2: - 4/5: target dpif-netdev/pmd-perf-show instead of dpif-netdev/pmd-stats-show, which was removed in favor of pmd-perf-show. The JSON formatter lives in dpif-netdev-perf.c beside the text formatter, and reports the aggregated "main" thread in addition to the PMD threads. - 5/5: make "caches" an independent field (null when unavailable), matching the "masks" and "cache" fields, so the schema is consistent regardless of datapath capabilities. - 1-3/5 are unchanged since v2. Changes since v1: - All patches: split the main handler into separate text and JSON helper functions (Eelco). - All patches: use dashes (not underscores) in JSON field names, and full words instead of abbreviations (Eelco, Ilya). - All patches: validate the complete pretty-printed JSON output in tests rather than grepping for individual fields (Eelco). - 1/5: use bridge name as the top-level key; group statistics into "entries" and "events" sub-objects (Eelco, Ilya). - 2/5: use datapath name as the top-level key; group flow counters under "flows"; index revalidators by ID as an object (Eelco). - 3/5: use "threads" as the container key and thread names (pmd-cXX) as keys, matching the names visible in system tools like "top" (Ilya, Eelco). Drop the "_id" suffix from field names (Ilya). - 4/5: use thread names as keys (matching 3/5); group average metrics under an "averages" sub-object (Ilya). - 5/5: use datapath name as the top-level key and port name as port key; use "port-number" field name (Eelco, Ilya). Make masks, cache, and statistics independent fields (null when unavailable) for a consistent schema regardless of command-line flags (Eelco). Timothy Redaelli (5): ofproto-dpif: Add JSON output to fdb/stats-show. ofproto-dpif-upcall: Add JSON output to upcall/show. dpif-netdev: Add JSON output to pmd-sleep-show. dpif-netdev: Add JSON output to pmd-perf-show. dpctl: Add JSON output to dpctl/show. NEWS | 8 + lib/dpctl.c | 215 +++++++++++++++- lib/dpctl.h | 11 + lib/dpctl.man | 3 + lib/dpif-netdev-perf.c | 456 ++++++++++++++++++++++++++++++---- lib/dpif-netdev-perf.h | 11 + lib/dpif-netdev-unixctl.man | 9 + lib/dpif-netdev.c | 141 ++++++++++- ofproto/ofproto-dpif-upcall.c | 95 +++++-- ofproto/ofproto-dpif.c | 94 +++++-- tests/dpctl.at | 88 +++++++ tests/ofproto-dpif.at | 64 ++++- tests/pmd.at | 248 ++++++++++++++++++ tests/system-traffic.at | 31 +++ vswitchd/ovs-vswitchd.8.in | 3 + 15 files changed, 1371 insertions(+), 106 deletions(-) base-commit: b30f621502752463807af7bb8bcf3a0c763544cf -- 2.55.0 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
