Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1573131

Re: [for-next][PATCH 2/8] ftrace: Create a slight optimization on searching the ftrace_hash

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject Re: [for-next][PATCH 2/8] ftrace: Create a slight optimization on searching the ftrace_hash
Date 2017-02-03 16:00 +0100
Message-ID <t6Nvb-2PE-5@gated-at.bofh.it> (permalink)
References <t6Mpr-2cV-7@gated-at.bofh.it> <t6Mps-2cV-33@gated-at.bofh.it> <t6N29-2FM-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[for-next][PATCH 0/8] tracing: Clean up hash logic for set_graph_function Steven Rostedt <rostedt@goodmis.org> - 2017-02-03 14:50 +0100
  [for-next][PATCH 1/8] tracing: Add ftrace_hash_key() helper function Steven Rostedt <rostedt@goodmis.org> - 2017-02-03 14:50 +0100
  [for-next][PATCH 3/8] ftrace: Replace (void *)1 with a meaningful macro name  FTRACE_GRAPH_EMPTY Steven Rostedt <rostedt@goodmis.org> - 2017-02-03 14:50 +0100
  [for-next][PATCH 7/8] ftrace: Do not hold references of ftrace_graph_{notrace_}hash out of  graph_lock Steven Rostedt <rostedt@goodmis.org> - 2017-02-03 14:50 +0100
  [for-next][PATCH 8/8] ftrace: Have set_graph_function handle multiple functions in one  write Steven Rostedt <rostedt@goodmis.org> - 2017-02-03 14:50 +0100
  [for-next][PATCH 4/8] ftrace: Reset fgd->hash in ftrace_graph_write() Steven Rostedt <rostedt@goodmis.org> - 2017-02-03 14:50 +0100
    Re: [for-next][PATCH 4/8] ftrace: Reset fgd->hash in ftrace_graph_write() Namhyung Kim <namhyung@kernel.org> - 2017-02-03 16:00 +0100
      Re: [for-next][PATCH 4/8] ftrace: Reset fgd->hash in  ftrace_graph_write() Steven Rostedt <rostedt@goodmis.org> - 2017-02-03 16:00 +0100
  [for-next][PATCH 2/8] ftrace: Create a slight optimization on searching the ftrace_hash Steven Rostedt <rostedt@goodmis.org> - 2017-02-03 14:50 +0100
    Re: [for-next][PATCH 2/8] ftrace: Create a slight optimization on  searching the ftrace_hash Namhyung Kim <namhyung@kernel.org> - 2017-02-03 15:30 +0100
      Re: [for-next][PATCH 2/8] ftrace: Create a slight optimization on  searching the ftrace_hash Steven Rostedt <rostedt@goodmis.org> - 2017-02-03 16:00 +0100
  [for-next][PATCH 6/8] tracing: Reset parser->buffer to allow multiple "puts" Steven Rostedt <rostedt@goodmis.org> - 2017-02-03 14:50 +0100
  [for-next][PATCH 5/8] ftrace: Have set_graph_functions handle write with RDWR Steven Rostedt <rostedt@goodmis.org> - 2017-02-03 14:50 +0100
  Re: [for-next][PATCH 0/8] tracing: Clean up hash logic for set_graph_function Namhyung Kim <namhyung@kernel.org> - 2017-02-03 16:20 +0100

csiph-web