To show statistics nested under IFLA_STATS_LINK_XSTATS_SLAVE or
IFLA_STATS_LINK_XSTATS, one would use "group" to select the top-level
attribute, then "subgroup" to select the link type, which is itself a nest,
and then would lack a way to denote which attribute to select out of the
link-type nest.
To that end, add the selector level "suite", which is filtered in the
userspace.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
static const char *const ipstats_levels[] = {
"group",
"subgroup",
+ "suite",
};
enum {
fprintf(stderr,
"Usage: ip stats help\n"
- " ip stats show [ dev DEV ] [ group GROUP [ subgroup SUBGROUP ] ... ] ...\n"
+ " ip stats show [ dev DEV ] [ group GROUP [ subgroup SUBGROUP [ suite SUITE ] ... ] ... ] ...\n"
" ip stats set dev DEV l3_stats { on | off }\n"
);
continue;
for (j = 0; j < desc->nsubs; j++) {
+ size_t k;
+
if (j == 0)
fprintf(stderr, "%s SUBGROUP := {", desc->name);
else
if (desc->subs[j]->kind != IPSTATS_STAT_DESC_KIND_GROUP)
continue;
+
+ for (k = 0; k < desc->subs[j]->nsubs; k++)
+ fprintf(stderr, " [ suite %s ]",
+ desc->subs[j]->subs[k]->name);
}
if (opened)
fprintf(stderr, " }\n");
.RB "[ " group
.IR GROUP " [ "
.BI subgroup " SUBGROUP"
-.R " ] ... ] ..."
+.RB " [ " suite
+.IR " SUITE" " ] ... ] ... ] ..."
.ti -8
.BR "ip stats set"