{ "disabled", 0 }, /* no bit set */
};
-static void print_hw_stats(const struct rtattr *arg)
+static void print_hw_stats(const struct rtattr *arg, bool print_used)
{
struct nla_bitfield32 *hw_stats_bf = RTA_DATA(arg);
__u8 hw_stats;
hw_stats = hw_stats_bf->value & hw_stats_bf->selector;
print_string(PRINT_FP, NULL, "\t", NULL);
- open_json_array(PRINT_ANY, "hw_stats");
+ open_json_array(PRINT_ANY, print_used ? "used_hw_stats" : "hw_stats");
for (i = 0; i < ARRAY_SIZE(hw_stats_items); i++) {
const struct hw_stats_item *item;
print_string(PRINT_ANY, NULL, " %s", item->str);
}
close_json_array(PRINT_JSON, NULL);
+ print_string(PRINT_FP, NULL, "%s", _SL_);
}
static int parse_hw_stats(const char *str, struct nlmsghdr *n)
print_string(PRINT_FP, NULL, "%s", _SL_);
}
if (tb[TCA_ACT_HW_STATS])
- print_hw_stats(tb[TCA_ACT_HW_STATS]);
+ print_hw_stats(tb[TCA_ACT_HW_STATS], false);
+
+ if (tb[TCA_ACT_USED_HW_STATS])
+ print_hw_stats(tb[TCA_ACT_USED_HW_STATS], true);
return 0;
}