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 9306D459DA; Thu, 19 Sep 2024 18:35:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 596BB43387; Thu, 19 Sep 2024 18:35:08 +0200 (CEST) Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by mails.dpdk.org (Postfix) with ESMTP id 7D35E4026B; Thu, 19 Sep 2024 18:35:07 +0200 (CEST) Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-4585e25f42bso8758311cf.2; Thu, 19 Sep 2024 09:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726763707; x=1727368507; 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=88InoDebe0aXTx1l+dt2C1lB+zlBk8SBsO4gt5+a5Vg=; b=OYUiaCZgebJqv9DmyWAAjeUVFUX0l0ZHoOKuiIJHSi3e/pgTSjVLcRlOZIblVyaT8F tEgmx0kfQwKZAnj1szxFJUFelGUkVzKTpFdICXB+L1VZS4qvfGMlaEojxUSAxFckcm8b /bGB5F4jK8G5OrdBXkTG1iTg5QnB1NCVegLFmcSbDqlspKPAUpcRemaMFKWxEjv9kvCO /z7SVoBa5B+7ovUPWKBPf5SN4hJ85DDDz9OPuDHtaqHwWa7iEjvxSGw/yD8LfQKjjy1G XYipv8GxFnQK+2DCSEhGAmHhJI4DKzWDyps/2gH2+4qv4YqyvfzWBaMu/a6Cm3aV6bEf BdQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726763707; x=1727368507; 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=88InoDebe0aXTx1l+dt2C1lB+zlBk8SBsO4gt5+a5Vg=; b=hRfVHhw++V5XjOUGf+VoG7rJ5IILvV3ge4HdTwG7FHSh3I+hVasgSlB2orsxpxY8T8 rUYGwiwR5P47bq2Y22+J0hdD1j3tn/qOX3MjZf0jMUKZDbpsDQ6OU5CrTgr5H2AIOLr4 8usgWoCVHcKl4oKcXWWZ4XqML+3lfIzqdk6zDqunSILFPLNdYXQRYnv8/iOSmVgZMRWT RKfreSjuqkfwclsIK+gGs/zzS8hPRojPGYLfPkGUePeIHoYoV3Yu87q/IgbGPsSr+AGV i563uXz9L/wMLgaloHOu2TM8GJMxDEwz7zNHsVovGoNJGpqrdni0jN8uW6AHHUjjGr/x p14Q== X-Forwarded-Encrypted: i=1; AJvYcCWtqqJKnlYeybS2mNlC//SGJ6SwcxdXX+VV+mElP0WQsK7BP24zhZqUZm6Wi+G336sV5aBsj8bEG2eh@dpdk.org, AJvYcCXUDMeJTkI8ohyQ76Qj2xlwyXzW1EbcTRWKduQoymTHm3hbrmp/cIYzeJ5jRnlAsHBDa7U=@dpdk.org X-Gm-Message-State: AOJu0YzZhrQbWr4mR+IQuo2Tt1O9jWJ/6/U9FtOEkS5lJc+cHR9fhxF8 n1w8+P/z+7Rk/TkcHhCfeYhXwTzTb4IeLzSZ6iPLG6wqX2BHa8ciVNd4Dg3L+mZEAtFMyLTht1y qVBBwggF6IRLDCrIqSD1Nzrj4iYQ= X-Google-Smtp-Source: AGHT+IEuK6h2zPDkfWMr8L0vgUip93DnFrfgMA68A18juCI+8+AN8CfNSiHkfaQsyCNCvoTiczahbFMV+Kftmh0gJQQ= X-Received: by 2002:ac8:5f53:0:b0:458:37c6:46fa with SMTP id d75a77b69052e-45b205103afmr1461371cf.28.1726763706679; Thu, 19 Sep 2024 09:35:06 -0700 (PDT) MIME-Version: 1.0 References: <20240918085551.231015-1-mb@smartsharesystems.com> <20240919080658.252532-1-mb@smartsharesystems.com> <98CBD80474FA8B44BF855DF32C47DC35E9F702@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35E9F704@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35E9F705@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F705@smartserver.smartshare.dk> From: Jerin Jacob Date: Thu, 19 Sep 2024 22:04:40 +0530 Message-ID: Subject: Re: [PATCH v2] 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, techboard@dpdk.org, Ferruh Yigit 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 Thu, Sep 19, 2024 at 9:38=E2=80=AFPM Morten Br=C3=B8rup wrote: > > > From: Jerin Jacob [mailto:jerinjacobk@gmail.com] > > Sent: Thursday, 19 September 2024 17.49 > > > > On Thu, Sep 19, 2024 at 9:05=E2=80=AFPM Morten Br=C3=B8rup > > wrote: > > > > > > > Could you share data with a real-world application of the elf size? > > > > 1)Without any change > > > > > > Size of the statically linked executable on the target file system: > > > 3,800,528 byte > > > > > > > 2)Only disabling via __rte_trace_point_emit_header_generic() .. aka= below > > > > patch. > > > > > > 3,572,032 byte > > > > > > > 3)Full disable. > > > > > > 3,572,032 byte > > > > > > > > > > > I think, size command will spit out with different section's size. > > > > This data can be used to take decision and to know how much % it > > > > adding up? > > > > > > I.e. trace adds 228,496 byte =3D 6.4 % to the size of this specific > > executable. > > > > > > ~200 KB might not seem as much, but this is just omitting one module. > > > If other unused modules also add ~200 KB, it adds up. > > > > > > And I haven't done any significant additional memory footprint tuning= . > > > > > > > > > > > > #define __rte_trace_point_emit_header_generic(t) \ > > > > > > void *mem; \ > > > > > > do { \ > > > > > > + if (RTE_TRACE =3D=3D 0) \ > > > > > > + return \ > > > > > > Tested without the RTE_TRACE=3D=3D0 check, simply: > > > void *mem; \ > > > do { \ > > > + return; \ > > > const uint64_t val =3D rte_atomic_load_explicit(t, > > rte_memory_order_acquire); \ > > > > > > > > > const uint64_t val =3D rte_atomic_load_explicit(t, > > > > > > rte_memory_order_acquire); \ > > > > > > if (likely(!(val & __RTE_TRACE_FIELD_ENABLE_MASK))) \ > > > > > > return; \ > > > > > > mem =3D __rte_trace_mem_get(val); \ > > > > > > if (unlikely(mem =3D=3D NULL)) \ > > > > > > return; \ > > > > > > mem =3D __rte_trace_point_emit_ev_header(mem, val); \ > > > > > > } while (0) > > > > > > I don't understand why your method uses as little memory as mine... > > > > Compiler is start enough to understand those functions are NOP. > > Yes, I understand why the compiler understands that this code is NOP. > > But I don't understand why the tracepoints' values and names are not regi= stered by the unmodified RTE_TRACE_POINT_REGISTER(). My best _guess_ is __rte_trace_point_register()'s register_fn() execution comes as NOP. > > > > > > > > My method should also omit the trace points themselves, with their na= mes and > > numbers, and their initialization. > > > > > > I haven't looked deeper into it. > > > > > > If your method of omitting trace is as efficient as all my ifdefs, I = also > > prefer your method. > > > Simpler is better. > > >