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 7CE08459D9; Thu, 19 Sep 2024 17:49:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D99943387; Thu, 19 Sep 2024 17:49:58 +0200 (CEST) Received: from mail-oo1-f54.google.com (mail-oo1-f54.google.com [209.85.161.54]) by mails.dpdk.org (Postfix) with ESMTP id 24BB94026B; Thu, 19 Sep 2024 17:49:57 +0200 (CEST) Received: by mail-oo1-f54.google.com with SMTP id 006d021491bc7-5e1b35030aeso611332eaf.3; Thu, 19 Sep 2024 08:49:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726760996; x=1727365796; 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=I11fVSeQEjuLMERMZ4I+4bcE9nF2faC8fS3ozkPV7ms=; b=TataCNFB5rOt7UPXCrWUHsvOhSxT9cMyiuqImE5FQns0wooOu0i9rBBX5K0FnX0rGs gVJm6G9YHOBiLXKyJHkU+WfykAqza1ArtD/jX4BH4zn8DFeNly9MfqrxOEA12FGz5NLZ HcuXwMA5L5CXX1ykBM3edRw+Y2fcGlS80iAeswvznRNY2LmoLx/jNI5pUr7Kht4HrmI9 yAwUN64JLERkzIjQBOC7LBALGjSPE5//ZCfWFjsH3yz6zum9VkanpNl54bElZo07iC6g ySexrtXDAAnsUxZ1KbGbrDR92kym6s/KIb8apxNL5DoyOw7NWSDDB6SRA+i/JEcY8IQU 76Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726760996; x=1727365796; 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=I11fVSeQEjuLMERMZ4I+4bcE9nF2faC8fS3ozkPV7ms=; b=NU3prZ+WTWjMG4X6/8RLhwKFI/BcfEO8kzNVEz87ZjjyyXmfLzKF6pVummf4ApF6io 4/UcH8m7FgC5KKaH4CRixsEsuuZ4Lj7TIX8+X79UXKrCezsbjNkjrJA0/vLyKk/Ev7YO b0cjz8KPbk0Evc2poj5ly6xwEMPX+PORcae6A36ZOvhxiWYQBu8lYVQvSUnOpw5t5weh +ZLMBCl40EL59V+mZzo1dGm/AmjrLahSlvCFpiLn0YMyacUxDFapn8t8rKF9gVzc1G0U sZpyqdZG68EpYsE0g/Nn/lS75HsbHcxPi5POc7mR1tu0a1RSbxHtA79vHm137Nfx7glc QE8w== X-Forwarded-Encrypted: i=1; AJvYcCUU7hC/HSjLy5jN5w7cwAhPUAdaAhvYDJ58s4lT9B7ptoc/0XgysL45MAAumICBSu1oev4=@dpdk.org, AJvYcCV8Rga5gCgEJOaL5VVx+1oh8atgBwZw4THgCDPRQcXXaVQ+xZEQgG4NIiG02etjyX96E770tIna9gPY@dpdk.org X-Gm-Message-State: AOJu0YyraQv/iw8rJfomf6yLsuBCE0c6nflabP+I76vna0OWZye4h059 lMGwx8/ObnCCjh+yz1+1rEc8yaOWvLm5islgmeZl7X57rwvodTLWZ4GAgel2tVHbxKBchJ7LeJw d7c1M+HlVhW5nJ/th8XHpSdBuj+A= X-Google-Smtp-Source: AGHT+IGd6W7LGBBlmCZBR39pRNqMYMIic4OJf8q97ve+ANS5Pcy2APnMrf8m9kLEpI1jLqrJ/v0c2av+QwrGyHRbXYM= X-Received: by 2002:a05:6358:7209:b0:1b5:fa48:5983 with SMTP id e5c5f4694b2df-1bc974cd1dfmr10672855d.0.1726760996139; Thu, 19 Sep 2024 08:49:56 -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> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F704@smartserver.smartshare.dk> From: Jerin Jacob Date: Thu, 19 Sep 2024 21:19:29 +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: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 bel= ow > > 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 execu= table. > > ~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_o= rder_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. > My method should also omit the trace points themselves, with their names = 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. >