From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B087B271471; Fri, 1 Aug 2025 15:56:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754063796; cv=none; b=adogNEUWI0XtXr4vfgaKIGfUrfEix6VMUGAxc2MpEnB/kwpBwKSG6X9b3smLP6PN48a012LbAmogLBr3/C1qr2YkoVnaiTw5xdzNiN7dEHh3lV9R8kEUqpC3Fqsy4AOYd38vQGQEL28khSIhqposZLmkpLZRq5NwDyIdBIafn8o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754063796; c=relaxed/simple; bh=rOlclQzf0MpdDr28TdB3p6yVIA0DUsE5KtkQqdIlTmg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hXfaBLnb3Zwqj+Ph79niI7xR4Oj5hKQU4KAp0VrUlbGsDXO6jORSg0+Dk0/kbRz17BvpUAW7VS19rOyNi7cLtSrZ/gXMDbStFTX/ERwPSI+xD4hpb1K+FqmZkxFmCReIjkJQnRocO44+lxXpO6h+LJZ7p8DR/cWp/PwJvWnJhbM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org Received: from omf11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 93C82803D1; Fri, 1 Aug 2025 15:56:31 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by omf11.hostedemail.com (Postfix) with ESMTPA id 9B8B220029; Fri, 1 Aug 2025 15:56:28 +0000 (UTC) Date: Fri, 1 Aug 2025 11:56:49 -0400 From: Steven Rostedt To: Tomas Glozar Cc: Alexei Starovoitov , LKML , Linux Trace Kernel , bpf , Masami Hiramatsu , Mathieu Desnoyers , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Jiri Olsa , Martin KaFai Lau , Eduard Zingerman , Song Liu , KP Singh Subject: Re: [PATCH] btf: Simplify BTF logic with use of __free(btf_put) Message-ID: <20250801115649.0b31f582@gandalf.local.home> In-Reply-To: References: <20250801071622.63dc9b78@gandalf.local.home> <20250801110705.373c69b4@gandalf.local.home> <20250801111919.13c0620e@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Stat-Signature: rpsw9hw7g9bc5n6ubxi6p5tot8a6r4to X-Rspamd-Server: rspamout01 X-Rspamd-Queue-Id: 9B8B220029 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX18tRMsEs6gIm+onxM9f8CgANtnmJYTEijc= X-HE-Tag: 1754063788-626321 X-HE-Meta: U2FsdGVkX1+Gr69W3MyGy6UZYPyUz65OhHUD3NIjt4gUFiq2d20/gO9X2AJJljJeTSTLRz1REeOLyr5eUkmhf7e+XKhNoMBAX7ZqQ/FyKaGZoqLsyiEFVE/d260oYr5Lv+YFMefScUQHzqewUCV2sKpBQN4sbH61H5zPuXKf7oIO55Lrm7yjtBsxhDSC3Eve9DtiIjs73OijkKCXLEU3pIO48jMjUC1x8T4LZ6pZS0oo0InmPPuEXD9oKHkh0Y29XcDKBvqy0+r1ITqfSubbA9peXyyBvEicfACApVlXZoruv8gTOPO5V77pvl8zkdUm4IiIL841eHqrYJ3oN3uQdo/rIl5Zv2ruB6j5I6Bjw+xfkrwq9GwAnw== On Fri, 1 Aug 2025 17:34:51 +0200 Tomas Glozar wrote: > p=C3=A1 1. 8. 2025 v 17:29 odes=C3=ADlatel Alexei Starovoitov > napsal: > > > > but __free() is imo garbage. It's essence of what's wrong with C++ > > =20 >=20 > Here, you at least can read the beginning of the function though, and > see that a free will be done at the end, like Go's defer, right? I don't know Go, but I'll assume "yes". I prefer the __free() over goto end; where you need to free up a temporary variable on error paths. But regardless. This will just be a difference of opinion, and I respect that Alexei doesn't want to use it in his code. -- Steve