From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752530AbdBCO5W (ORCPT ); Fri, 3 Feb 2017 09:57:22 -0500 Received: from mail.kernel.org ([198.145.29.136]:34358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752404AbdBCO5V (ORCPT ); Fri, 3 Feb 2017 09:57:21 -0500 Date: Fri, 3 Feb 2017 09:57:06 -0500 From: Steven Rostedt To: Namhyung Kim Cc: "linux-kernel@vger.kernel.org" , Ingo Molnar , Andrew Morton Subject: Re: [for-next][PATCH 2/8] ftrace: Create a slight optimization on searching the ftrace_hash Message-ID: <20170203095706.08ea5dad@gandalf.local.home> In-Reply-To: References: <20170203134033.087760237@goodmis.org> <20170203134136.883902464@goodmis.org> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 3 Feb 2017 23:26:46 +0900 Namhyung Kim wrote: > Hi Steve, > > On Fri, Feb 3, 2017 at 10:40 PM, Steven Rostedt wrote: > > From: "Steven Rostedt (VMware)" > > > > This is a micro-optimization, but as it has to deal with a fast path of the > > function tracer, these optimizations can be noticed. > > > > The ftrace_lookup_ip() returns true if the given ip is found in the hash. If > > it's not found or the hash is NULL, it returns false. But there's some cases > > that a NULL hash is a true, and the ftrace_hash_empty() is tested before > > calling ftrace_lookup_ip() in those cases. But as ftrace_lookup_ip() tests > > that first, that adds a few extra unneeded instructions in those cases. > > > > A new static "always_inlined" function is created that does not perform the > > hash empty test. This most only be used by callers that do the check first > > anyway, as an empty or NULL hash could cause a crash if a lookup is > > performed on it. > > > > Also add kernel doc for the ftrace_lookup_ip() main function. > > It'd be nice if ftrace_graph_addr() was changed also. > Yeah, I was looking at that. But I was nervous about placing this function in the header file. -- Steve