From patchwork Tue Oct 25 09:00:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 119088 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2CE90A0543; Tue, 25 Oct 2022 11:01:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2068F42BD7; Tue, 25 Oct 2022 11:01:14 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 77CFD400D5 for ; Tue, 25 Oct 2022 11:01:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666688471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t/mwW+piz4kBY4AZW+Me1Ju0bmpcPyYe9qSCPE8YXH4=; b=JN9DYzBPpRGZiYiqefzIwjIexMOgi3GaKExGWbgf8SlHM21/ZM8iqrjKkeEobSOioYYC62 5KfrHvQEwEq26f0hQdv501jjn35ZC5IR1OEyBLoeMfj1lqnj/OJBXNbZPVHhvOyPZUTqXz YiGSnDjVQn3Da+AMUGVZ33e0MHK4XV0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-157-hL9Ze0eYNqK-OpQAR4uh4w-1; Tue, 25 Oct 2022 05:01:09 -0400 X-MC-Unique: hL9Ze0eYNqK-OpQAR4uh4w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 55CEA38164C5; Tue, 25 Oct 2022 09:01:09 +0000 (UTC) Received: from localhost.localdomain (ovpn-193-2.brq.redhat.com [10.40.193.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84A0BC15BAB; Tue, 25 Oct 2022 09:01:08 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Bruce Richardson , Ciara Power Subject: [PATCH v3 2/4] telemetry: extend valid command characters Date: Tue, 25 Oct 2022 11:00:50 +0200 Message-Id: <20221025090052.429232-3-david.marchand@redhat.com> In-Reply-To: <20221025090052.429232-1-david.marchand@redhat.com> References: <20221013074928.3062458-1-david.marchand@redhat.com> <20221025090052.429232-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The trace framework wants to reference trace point names as keys in dicts. Those names can contain '.', so add it to the list of valid characters in the telemetry library. Signed-off-by: David Marchand Acked-by: Bruce Richardson Acked-by: Ciara Power --- lib/telemetry/rte_telemetry.h | 10 +++++----- lib/telemetry/telemetry_data.c | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/telemetry/rte_telemetry.h b/lib/telemetry/rte_telemetry.h index e7f6c2ae43..5bd0fc323e 100644 --- a/lib/telemetry/rte_telemetry.h +++ b/lib/telemetry/rte_telemetry.h @@ -68,7 +68,7 @@ rte_tel_data_start_array(struct rte_tel_data *d, enum rte_tel_value_type type); * * Dictionaries consist of key-values pairs to be returned, where the keys, * or names, are strings and the values can be any of the types supported by telemetry. - * Name strings may only contain alphanumeric characters as well as '_' or '/' + * Name strings may only contain alphanumeric characters as well as '_', '/' or '.' * * @param d * The data structure passed to the callback @@ -181,7 +181,7 @@ rte_tel_data_add_array_bool(struct rte_tel_data *d, bool x); * The data structure passed to the callback * @param name * The name the value is to be stored under in the dict - * Must contain only alphanumeric characters or the symbols: '_' or '/' + * Must contain only alphanumeric characters or the symbols: '_', '/' or '.' * @param val * The string to be stored in the dict * @return @@ -200,7 +200,7 @@ rte_tel_data_add_dict_string(struct rte_tel_data *d, const char *name, * The data structure passed to the callback * @param name * The name the value is to be stored under in the dict - * Must contain only alphanumeric characters or the symbols: '_' or '/' + * Must contain only alphanumeric characters or the symbols: '_', '/' or '.' * @param val * The number to be stored in the dict * @return @@ -217,7 +217,7 @@ rte_tel_data_add_dict_int(struct rte_tel_data *d, const char *name, int val); * The data structure passed to the callback * @param name * The name the value is to be stored under in the dict - * Must contain only alphanumeric characters or the symbols: '_' or '/' + * Must contain only alphanumeric characters or the symbols: '_', '/' or '.' * @param val * The number to be stored in the dict * @return @@ -237,7 +237,7 @@ rte_tel_data_add_dict_u64(struct rte_tel_data *d, * The data structure passed to the callback * @param name * The name the value is to be stored under in the dict. - * Must contain only alphanumeric characters or the symbols: '_' or '/' + * Must contain only alphanumeric characters or the symbols: '_', '/' or '.' * @param val * The pointer to the container to be stored in the dict. * @param keep diff --git a/lib/telemetry/telemetry_data.c b/lib/telemetry/telemetry_data.c index 13a7ce7034..4f81f71e03 100644 --- a/lib/telemetry/telemetry_data.c +++ b/lib/telemetry/telemetry_data.c @@ -119,6 +119,7 @@ valid_name(const char *name) ['a' ... 'z'] = 1, ['_'] = 1, ['/'] = 1, + ['.'] = 1, }; while (*name != '\0') { if ((size_t)*name >= RTE_DIM(allowed) || allowed[(int)*name] == 0)