public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [for-next][PATCH 2/8] ftrace: Create a slight optimization on searching the ftrace_hash
Date: Fri, 3 Feb 2017 09:57:06 -0500	[thread overview]
Message-ID: <20170203095706.08ea5dad@gandalf.local.home> (raw)
In-Reply-To: <CAM9d7chdzHv5emyQ_GTmnc51uWWoB-xTuBzRW7ZW9KnrNY3EmQ@mail.gmail.com>

On Fri, 3 Feb 2017 23:26:46 +0900
Namhyung Kim <namhyung@kernel.org> wrote:

> Hi Steve,
> 
> On Fri, Feb 3, 2017 at 10:40 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> > From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> >
> > 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

  reply	other threads:[~2017-02-03 14:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-03 13:40 [for-next][PATCH 0/8] tracing: Clean up hash logic for set_graph_function Steven Rostedt
2017-02-03 13:40 ` [for-next][PATCH 1/8] tracing: Add ftrace_hash_key() helper function Steven Rostedt
2017-02-03 13:40 ` [for-next][PATCH 2/8] ftrace: Create a slight optimization on searching the ftrace_hash Steven Rostedt
2017-02-03 14:26   ` Namhyung Kim
2017-02-03 14:57     ` Steven Rostedt [this message]
2017-02-03 13:40 ` [for-next][PATCH 3/8] ftrace: Replace (void *)1 with a meaningful macro name FTRACE_GRAPH_EMPTY Steven Rostedt
2017-02-03 13:40 ` [for-next][PATCH 4/8] ftrace: Reset fgd->hash in ftrace_graph_write() Steven Rostedt
2017-02-03 14:49   ` Namhyung Kim
2017-02-03 14:57     ` Steven Rostedt
2017-02-03 13:40 ` [for-next][PATCH 5/8] ftrace: Have set_graph_functions handle write with RDWR Steven Rostedt
2017-02-03 13:40 ` [for-next][PATCH 6/8] tracing: Reset parser->buffer to allow multiple "puts" Steven Rostedt
2017-02-03 13:40 ` [for-next][PATCH 7/8] ftrace: Do not hold references of ftrace_graph_{notrace_}hash out of graph_lock Steven Rostedt
2017-02-03 13:40 ` [for-next][PATCH 8/8] ftrace: Have set_graph_function handle multiple functions in one write Steven Rostedt
2017-02-03 15:14 ` [for-next][PATCH 0/8] tracing: Clean up hash logic for set_graph_function Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170203095706.08ea5dad@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox