[dpdk-dev] [PATCH v5] lib/metrics: add unregister api for metrics
Thomas Monjalon
thomas at monjalon.net
Tue Apr 2 02:27:45 CEST 2019
27/02/2019 18:19, Junjie Wan:
> From: junka <wan.junjie at foxmail.com>
>
> The bitmap will help maintain the metrics. We can dynamically
> add and remove metrics data. For example, after uninit latency lib,
> it could remove itself from the metrics. This could make the result
> from rte_metrics_get_names much more simple to display the wanted
> metrics data only.
>
> Signed-off-by: Junjie Wan <wan.junjie at foxmail.com>
> ---
> --- a/lib/librte_metrics/rte_metrics.h
> +++ b/lib/librte_metrics/rte_metrics.h
> /**
> + * Unregister set of metrics.
> + *
> + * Remove the metrics previously registered
> + *
> + * @param key
> + * Id of metrics to remove
> + *
> + * @param count
> + * Number of metrics
> + *
> + * @return
> + * - Zero: Success
> + * - -EIO: Error, unable to access metrics shared memory
> + * (rte_metrics_init() not called)
> + * - -EINVAL: Error, invalid parameters
> + * - -ERANGE: Error, oversized
> + */
> +int
> +rte_metrics_unreg_values(uint16_t key, uint16_t count);
The rule is to add new API as experimental for some time.
Please check how other new API functions are introduced.
You will need to add the function in rte_metrics_version.map
to make it work in a shared library.
More information about the dev
mailing list