[PATCH v8] app/procinfo: display eventdev xstats

Sevincer, Abdullah abdullah.sevincer at intel.com
Sat Mar 18 19:49:32 CET 2023




> +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.
    This can be done, but we will have 2 API calls for each now, if we have this flag we will be able to reset withing one API call. 


> +
> +		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. 
    Same for this one as above, one API call to the xstats instead of two separate calls if we use this flag. 

Thanks,
Reshma



More information about the dev mailing list