From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9764145A7E; Tue, 1 Oct 2024 18:06:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D134402A7; Tue, 1 Oct 2024 18:06:55 +0200 (CEST) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by mails.dpdk.org (Postfix) with ESMTP id 235A640299 for ; Tue, 1 Oct 2024 18:06:54 +0200 (CEST) Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-4585e25f42bso56637941cf.2 for ; Tue, 01 Oct 2024 09:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727798813; x=1728403613; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oVsMyzAnAxcmrpeDjnQDRbjVShwEF2FFhIFk/82Pyz4=; b=QXtDJX2JmmdRICTFxdq/dpen3JLi9xZ/1IH7PMYmousUPDSmb7n0Czgi5HpMtfDG0o tax2k7dIZTH6Dp+TGPO+4C3rssr8aPJGuvvNoCWiEc4w1LOWmdBJfwWrENhmvnOcp6fh QJpA7oTNDIQeURhhFJXLHk6LYuZERPVd2ydzabxDMoP6QhBrhpQP01k/gvJ8g0jPUBgK eyMeQwAoJ1q0RHvvExSrylov2EP+chF66JsgTJDjiEUHtKFwQSZ3vY4FgiWYNAGnqeBt uiEfEhbrSOnxTG3JbCFxNGHNJdDse3bZHXu3fdEljqUSEOWOBS+Ykl1P+DzZ2kq2Ydn0 oC8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727798813; x=1728403613; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oVsMyzAnAxcmrpeDjnQDRbjVShwEF2FFhIFk/82Pyz4=; b=MghcX4cUg6Fbifk61TO1cDR8rzx4DZdc/ladhB/VDWQXhvNmiAH4M6A3Qr9AwAPgqq b5lyN2rN/TufGK6RWws/pMjmP1wHImM4999a1HpU2IRUfXvM2drXFi8ZdpYllQRxFFz7 imSsDUV0NlU39pC4BMP81+gEEG/O7WjX86+zUrM5GY5iZ2/ceM+1xIiZb9jl7C1JYAES iA2Pi2yNEORH4vDPFLm6M5LLc6b/LM3njAVH5OMwqLmqPV0ovPGQGNZBx/VGm87jxmLl dob/wo7KocZn85Kux0UZQ3cc+O3cVaxUy+u/uIPcpGR4zrfKCPxbI8VgP4COSSSuixfH iTYQ== X-Forwarded-Encrypted: i=1; AJvYcCWms+qn3Bp4nwTwCNlrXuxH49QL/PcaOTYNgQstFRAWpALzDjnzjyNwmGZIG1C2KqdGEAk=@dpdk.org X-Gm-Message-State: AOJu0Yy8MhNO4GeuEyw4i6j8J1l4c1NrUv+3NNzxdwUYpct8l6IsiO3d mg9fVTWI6C08EhmuzEoiBQNyKxAP5Zmo7FgykKpLevzgFURWJeyH6/7mn1bpnFIuilXF/mq3ZOw GJxQL+zXz4CgOtNPkPeCGOliFgdM= X-Google-Smtp-Source: AGHT+IELMu/1Ens0NBFTbDBc6dZJnx4z5u5q9ba3WltY/s//PbecgqoLOXqOrR61Kd/SfqV1HcJhIUDp6zymars5zRg= X-Received: by 2002:a05:622a:1a8c:b0:458:4c86:4559 with SMTP id d75a77b69052e-45d8056d0d2mr886181cf.53.1727798813389; Tue, 01 Oct 2024 09:06:53 -0700 (PDT) MIME-Version: 1.0 References: <20240918085551.231015-1-mb@smartsharesystems.com> <20240924133957.1505113-1-mb@smartsharesystems.com> <98CBD80474FA8B44BF855DF32C47DC35E9F72A@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35E9F74B@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35E9F74C@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35E9F74D@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F74D@smartserver.smartshare.dk> From: Jerin Jacob Date: Tue, 1 Oct 2024 21:36:27 +0530 Message-ID: Subject: Re: [PATCH v4] eal: add build-time option to omit trace To: =?UTF-8?Q?Morten_Br=C3=B8rup?= Cc: Jerin Jacob , Sunil Kumar Kori , dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Tue, Oct 1, 2024 at 9:32=E2=80=AFPM Morten Br=C3=B8rup wrote: > > > From: Jerin Jacob [mailto:jerinjacobk@gmail.com] > > Sent: Tuesday, 1 October 2024 17.02 > > > > On Tue, Oct 1, 2024 at 7:44=E2=80=AFPM Morten Br=C3=B8rup > > wrote: > > > > > > > From: Jerin Jacob [mailto:jerinjacobk@gmail.com] > > > > Sent: Tuesday, 1 October 2024 16.05 > > > > > > > > On Tue, Oct 1, 2024 at 7:19=E2=80=AFPM Morten Br=C3=B8rup > > > > > > wrote: > > > > > > > > > > Jerin, > > > > > > > > > > If you have no further comments, please add review/ack tag, to > > help > > > > Thomas see that the patch has been accepted by the maintainer, and > > can > > > > be merged. > > > > > > > > There was a comment to make the function as rte_trace_is_enabled() > > and > > > > remove internal. The rest looks good to me. I will Ack in the next > > > > version. > > > > > > Perhaps my reply to that comment was unclear... such a public > > function already exists in the previous API: > > > > I see. It was not clear. > > > > > > > https://elixir.bootlin.com/dpdk/v24.07/source/lib/eal/include/rte_trace > > .h#L36 > > > > > > That function tells if trace enabled at both build time and runtime, > > and returns false if not. > > > > > > A separate public function to tell if trace is enabled at build time > > seems like overkill to me. Is that what you are asking for? > > > > No. Just use rte_trace_is_enabled() in app/test instead of > > __rte_trace_point_generic_is_enabled() as it is internal. > > Just tested it, and it didn't have the wanted effect. > I think rte_trace_is_enabled() returns false until at least one tracepoin= t has been enabled, which seems like a good optimization. > But it also means that we cannot use it to replace __rte_trace_point_gene= ric_is_enabled() in test/app, because no tracepoints have been enabled at t= his point of execution, so it returns false here. > > I looked around in the code, and cannot find a method without looking at = internals, or duplicating a test case. > > I could test if rte_trace_point_lookup("app.dpdk.test.tp") returns non-NU= LL, but that would duplicate the same test in test_trace_points_lookup(). > > What do you think... > Keep using internal function __rte_trace_point_generic_is_enabled(), > test rte_trace_point_lookup("app.dpdk.test.tp") !=3D NULL, > or any other idea? How about the following, it is anyway the correct thing to do bool rte_trace_is_enabled(void) { + if (__rte_trace_point_generic_is_enabled() =3D=3D false) + return false; return rte_atomic_load_explicit(&trace.status, rte_memory_order_acquire) !=3D 0; } >