From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 46170132134; Mon, 3 Jun 2024 17:04:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717434241; cv=none; b=hbh1K8s6KavBiswKfzXKRs/lMuINH4qLL8ZwIWgSMUnk7CB3cCamIdP8MsbxQVL4o6g0GXHK5NnhEShtz50TNvNeImNMD9n/a5/IHQWhaWENg7ibA3M38vyQkeeKJVYEVl5ldYPc6LPGv3PaO+z3GMJ16a7CfXk6Pcm3FMC/LU4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717434241; c=relaxed/simple; bh=G26QvN9xTTTYABXqFBCt3dCEqPCMNmgVPrxa6IIQpDE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=E26njBLYYq6NuGzDE2ymP1a0FyyQgcY6s9Q7SKXi83L9c00HPTqnYsTQVnP9m4SzA7Eenglr0GMBbwBqyOBrc33bxfamZIB23taFv6JEppqGGb9cafrm0R4qwIjjr6wcbrZLaiALI6Go4a66fUB+S0+ymczcXb4aJHrdQhQ8noE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6ADEC2BD10; Mon, 3 Jun 2024 17:03:57 +0000 (UTC) Date: Mon, 3 Jun 2024 13:05:04 -0400 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Mark Rutland , Mathieu Desnoyers , Andrew Morton , Alexei Starovoitov , Florent Revest , Martin KaFai Lau , bpf , Sven Schnelle , Alexei Starovoitov , Jiri Olsa , Arnaldo Carvalho de Melo , Daniel Borkmann , Alan Maguire , Peter Zijlstra , Thomas Gleixner , Guo Ren Subject: Re: [PATCH v2 10/27] ftrace: Add subops logic to allow one ops to manage many Message-ID: <20240603130504.7c572649@gandalf.local.home> In-Reply-To: <20240603114636.63b5abe2189cb732bec2474c@kernel.org> References: <20240602033744.563858532@goodmis.org> <20240602033832.709653366@goodmis.org> <20240603103316.3af9dea3214a5d2bde721cd8@kernel.org> <20240602220613.3f9eac04@gandalf.local.home> <20240603114636.63b5abe2189cb732bec2474c@kernel.org> 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=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 3 Jun 2024 11:46:36 +0900 Masami Hiramatsu (Google) wrote: > > > at the beginning of the loop. > > > Also, at the end of the loop, > > > > > > if (ftrace_hash_empty(new_hash)) { > > > free_ftrace_hash(new_hash); > > > new_hash = EMPTY_HASH; > > > break; > > > } > > And we still need this (I think this should be done in intersect_hash(), we just > need to count the number of entries.) Ah, I see. if it ends with nothing intersecting it should be empty. I added: /* If nothing intersects, make it the empty set */ if (ftrace_hash_empty(*hash)) { free_ftrace_hash(*hash); *hash = EMPTY_HASH; } to the end of intersect_hash(). -- Steve