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 C98E4460E8; Wed, 22 Jan 2025 18:36:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F216340665; Wed, 22 Jan 2025 18:36:02 +0100 (CET) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id 4203540657 for ; Wed, 22 Jan 2025 18:35:56 +0100 (CET) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2166f1e589cso174515325ad.3 for ; Wed, 22 Jan 2025 09:35:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737567355; x=1738172155; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tAn3hU3sqLOPSELwLMIcRu64apcDdihhWviEC0pIxfk=; b=bLBb60JiMdT0YG7ARTxqiuSDX5n/wAOx6huXwJ6M9o24cysyV8nImSCUuhi3c9uViI HZH+nCZ6VauPacA1uEmsTqD/Wn/J/eRRKFAiN7mG/iQav4PSzfTG09kPcJJ0LIcl22pB 3xp4JJTqASPPQUWd+gpaq8d/mvdKANDlGNMo5gIajl5nWwE62zCxJjQxaKbclLYVSIdl u0bIid+jehQX/hnoyc088umrZsybZDgjMx6dH7oGaX+70ucd+ClvvYnlc8GbteDCp35s izxYErxq/mEG6fUN8TBttV5kr3dmDCPhFgzmQK3wYqEsY+tQ7oJUwCpeh8XFPg6tT0mN YVdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737567355; x=1738172155; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tAn3hU3sqLOPSELwLMIcRu64apcDdihhWviEC0pIxfk=; b=c7maNBofYIG9fhYHh40+j9AvSDIvbZSJ60Sfe+LhTlaB4RpeS2XKwXYJs9/+sO/dn8 kuI947X12UieUBY4eRKvyf35+N2e1R6pomJzUrUWBO2ttCGLDTwmj0DT8PEiz3Ek2dQO xF29ZGPuEHOKEf+LyAglDEmD4oo12lzUi+lbkl7l1PwDp8Abq+l19tcFw5BoRZjzlnAe HK6XR4wt6FuFHR4odM2KWuGdOXTc95ERWxRx78BKL9x+vrM+xPE+cAih007AMSllcR3A fX1Qu3fK2Bb5piPplFyXkmz4Yw0+QXsy3CY5sMEcjPVVqt6iCeflDA6dt90VAeeNuEz6 Zonw== X-Gm-Message-State: AOJu0YyaSSWDNvjR/rs7VlQ1yEpcJDpQShEuleft7mXgEvktgQfSdCry dIYvGPNQv7mhVT8eP6tTKelOdnUjceGCzXay82UvlQB94UYooIx8uhjF9qkQ8GMiKBSAkfMz7tU Y X-Gm-Gg: ASbGncvyAoQM0UHvbFwA3RT7Am75lwzvst17RHwZBpwiCM1dh/1j6D9tJuJLJnlp6OE dJyb1yeb6o1XVAYfQ5n/RLyuWoYGbQ2iy9qPclJatdyNSCJ8c97HP+Fy5srzQswKMTgodINX5PW gLUBmj5HvOPJb891fX+krhsF0W62uMXjj4D1Mjyt9mIeBznyk0Dqb3bQNQi4CNtceKXKkQ2zkhQ FmQAqyd6U3/FWc7LFAXE/ba0NBf4RrWp4vClLwbgL69pZ1gXuQz6VjmNQF3pCr68TNvmXhcTg+N 1CubO4F0TU6KXQodgBevDVAD4EBdeKlRX3C+obOPfHwZEJE= X-Google-Smtp-Source: AGHT+IGyGFCxLM+eeUPIPfDdE4wuoBBmm/fhBa84evZhpE7MxLZClQbYLuq5U068xJLKYBS8JiyUgg== X-Received: by 2002:a17:902:e948:b0:215:6f9b:e447 with SMTP id d9443c01a7336-21c35621db7mr331771685ad.30.1737567355436; Wed, 22 Jan 2025 09:35:55 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3bc64dsm97469285ad.122.2025.01.22.09.35.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2025 09:35:55 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v2 07/15] bitratestats: add allocation function attributes Date: Wed, 22 Jan 2025 09:32:51 -0800 Message-ID: <20250122173521.305108-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250122173521.305108-1-stephen@networkplumber.org> References: <20250120180550.198121-1-stephen@networkplumber.org> <20250122173521.305108-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Use function attributes to catch cases where bitratestats is allocated but not freed correctly. Signed-off-by: Stephen Hemminger --- lib/bitratestats/rte_bitrate.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bitratestats/rte_bitrate.h b/lib/bitratestats/rte_bitrate.h index 979a712837..0cd3a6227c 100644 --- a/lib/bitratestats/rte_bitrate.h +++ b/lib/bitratestats/rte_bitrate.h @@ -17,7 +17,6 @@ extern "C" { */ struct rte_stats_bitrates; - /** * Allocate a bitrate statistics structure * @@ -25,7 +24,8 @@ struct rte_stats_bitrates; * - Pointer to structure on success * - NULL on error (zmalloc failure) */ -struct rte_stats_bitrates *rte_stats_bitrate_create(void); +struct rte_stats_bitrates *rte_stats_bitrate_create(void) + __rte_malloc __rte_dealloc(rte_stats_bitrate_free, 1); /** * Free bitrate statistics structure -- 2.45.2