lkml.org 
[lkml]   [2017]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] ftrace: Expose ftrace_hash_empty and ftrace_lookup_ip
On Fri, 20 Jan 2017 11:44:46 +0900
Namhyung Kim <namhyung@kernel.org> wrote:


> --- a/kernel/trace/trace.h
> +++ b/kernel/trace/trace.h
> @@ -787,6 +787,20 @@ extern void __trace_graph_return(struct trace_array *tr,
> struct ftrace_graph_ret *trace,
> unsigned long flags, int pc);
>
> +struct ftrace_hash {
> + unsigned long size_bits;
> + struct hlist_head *buckets;
> + unsigned long count;
> + struct rcu_head rcu;
> +};
> +
> +struct ftrace_func_entry *
> +ftrace_lookup_ip(struct ftrace_hash *hash, unsigned long ip);
> +
> +static bool __always_inline ftrace_hash_empty(struct ftrace_hash *hash)
> +{
> + return !hash || !hash->count;
> +}

Note, I had to modify this patch and move this declaration outside of
the #ifdef CONFIG_FUNCTION_GRAPH_TRACER, as it failed to build when
function graph wasn't enabled. Function tracer uses this too.

-- Steve

>
> #ifdef CONFIG_DYNAMIC_FTRACE
> /* TODO: make this variable */

\
 
 \ /
  Last update: 2017-01-20 20:55    [W:0.071 / U:1.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site