]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
ftrace: Expose ftrace_hash_empty and ftrace_lookup_ip
authorNamhyung Kim <namhyung@kernel.org>
Fri, 20 Jan 2017 02:44:46 +0000 (11:44 +0900)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 20 Jan 2017 19:50:21 +0000 (14:50 -0500)
It will be used when checking graph filter hashes later.

Link: http://lkml.kernel.org/r/20170120024447.26097-2-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
[ Moved ftrace_hash dec and functions outside of FUNCTION_GRAPH define ]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/ftrace.c
kernel/trace/trace.h

index 37b0e948d9242ab5fce4536dfa72e058a6e52ac9..0470e373b9b4e465b59fd5215d3aa9225635b3fd 100644 (file)
@@ -1110,13 +1110,6 @@ struct ftrace_func_entry {
        unsigned long ip;
 };
 
-struct ftrace_hash {
-       unsigned long           size_bits;
-       struct hlist_head       *buckets;
-       unsigned long           count;
-       struct rcu_head         rcu;
-};
-
 /*
  * We make these constant because no one should touch them,
  * but they are used as the default "empty hash", to avoid allocating
@@ -1192,12 +1185,7 @@ struct ftrace_page {
 static struct ftrace_page      *ftrace_pages_start;
 static struct ftrace_page      *ftrace_pages;
 
-static bool __always_inline ftrace_hash_empty(struct ftrace_hash *hash)
-{
-       return !hash || !hash->count;
-}
-
-static struct ftrace_func_entry *
+struct ftrace_func_entry *
 ftrace_lookup_ip(struct ftrace_hash *hash, unsigned long ip)
 {
        unsigned long key;
index 1ea51ab53edf372924692e78c692f52302280bc1..9001460291bbb64b61790a6373f0f47e1909401f 100644 (file)
@@ -753,6 +753,21 @@ enum print_line_t print_trace_line(struct trace_iterator *iter);
 
 extern char trace_find_mark(unsigned long long duration);
 
+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;
+}
+
 /* Standard output formatting function used for function return traces */
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 
@@ -787,7 +802,6 @@ extern void __trace_graph_return(struct trace_array *tr,
                                 struct ftrace_graph_ret *trace,
                                 unsigned long flags, int pc);
 
-
 #ifdef CONFIG_DYNAMIC_FTRACE
 /* TODO: make this variable */
 #define FTRACE_GRAPH_MAX_FUNCS         32