[PATCH v8] app/procinfo: display eventdev xstats
Pattan, Reshma
reshma.pattan at intel.com
Wed Mar 15 15:24:21 CET 2023
> -----Original Message-----
> From: Sevincer, Abdullah <abdullah.sevincer at intel.com>
> +static void
> +get_eventdev_xstats(uint8_t dev_id,
You can separate this function (basically the code inside this function) into 3 functions, one for reset and one for display stats values.
And move the common code(stats storage calculation logic and getting stats name logic) to a another function, so you can call that function from reset and display functions.
> +
> + if (enable_dump_eventdev_xstats) {
> + ret = rte_event_dev_dump(evdev_id, stdout);
> + if (ret)
> + rte_panic("dump failed with err=%d\n", ret);
> + }
> +
> + process_eventdev_xstats(false);
> +
> + if (enable_eventdev_reset_xstats)
> + process_eventdev_xstats(true);
For easy code readability, I would say have a sperate function for reset stats, do not mix display and resets by just passing reset bool value.
Thanks,
Reshma
More information about the dev
mailing list