From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v5] lib/metrics: add unregister api for metrics Date: Tue, 02 Apr 2019 02:27:45 +0200 Message-ID: <1959572.AyLBI85xDo@xps> References: <1550849955-15101-1-git-send-email-wan.junjie@foxmail.com> <1551287944-27314-1-git-send-email-wan.junjie@foxmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, remy.horton@intel.com To: Junjie Wan Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 316C937A8 for ; Tue, 2 Apr 2019 02:27:49 +0200 (CEST) In-Reply-To: <1551287944-27314-1-git-send-email-wan.junjie@foxmail.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 27/02/2019 18:19, Junjie Wan: > From: junka > > 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 > --- > --- 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.