]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
perf: Make perf_callchain function static
authorJiri Olsa <jolsa@kernel.org>
Sun, 7 Jan 2018 16:03:49 +0000 (17:03 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 8 Jan 2018 15:33:01 +0000 (12:33 -0300)
And move it to core.c, because there's no caller of this function other
than the one in core.c

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180107160356.28203-6-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
kernel/events/callchain.c
kernel/events/core.c
kernel/events/internal.h

index 1b2be63c85282fdb6f910e145853f97c23d8efb4..772a43fea825c498156c4972c66ee81686abecbe 100644 (file)
@@ -178,21 +178,6 @@ put_callchain_entry(int rctx)
        put_recursion_context(this_cpu_ptr(callchain_recursion), rctx);
 }
 
-struct perf_callchain_entry *
-perf_callchain(struct perf_event *event, struct pt_regs *regs)
-{
-       bool kernel = !event->attr.exclude_callchain_kernel;
-       bool user   = !event->attr.exclude_callchain_user;
-       /* Disallow cross-task user callchains. */
-       bool crosstask = event->ctx->task && event->ctx->task != current;
-       const u32 max_stack = event->attr.sample_max_stack;
-
-       if (!kernel && !user)
-               return NULL;
-
-       return get_perf_callchain(regs, 0, kernel, user, max_stack, crosstask, true);
-}
-
 struct perf_callchain_entry *
 get_perf_callchain(struct pt_regs *regs, u32 init_nr, bool kernel, bool user,
                   u32 max_stack, bool crosstask, bool add_mark)
index 55fb648a32b073eb6fe35a2bef2cfbadae25b2a3..5fc1ded4b450da823874deba4ba2f585316b3eef 100644 (file)
@@ -5980,6 +5980,22 @@ static u64 perf_virt_to_phys(u64 virt)
        return phys_addr;
 }
 
+static struct perf_callchain_entry *
+perf_callchain(struct perf_event *event, struct pt_regs *regs)
+{
+       bool kernel = !event->attr.exclude_callchain_kernel;
+       bool user   = !event->attr.exclude_callchain_user;
+       /* Disallow cross-task user callchains. */
+       bool crosstask = event->ctx->task && event->ctx->task != current;
+       const u32 max_stack = event->attr.sample_max_stack;
+
+       if (!kernel && !user)
+               return NULL;
+
+       return get_perf_callchain(regs, 0, kernel, user,
+                                 max_stack, crosstask, true);
+}
+
 void perf_prepare_sample(struct perf_event_header *header,
                         struct perf_sample_data *data,
                         struct perf_event *event,
index 09b1537ae06cd4645458a12ea111b4cf813038da..6dc725a7e7bc91a866a85b7ac4045d92a610ecaa 100644 (file)
@@ -201,10 +201,6 @@ arch_perf_out_copy_user(void *dst, const void *src, unsigned long n)
 
 DEFINE_OUTPUT_COPY(__output_copy_user, arch_perf_out_copy_user)
 
-/* Callchain handling */
-extern struct perf_callchain_entry *
-perf_callchain(struct perf_event *event, struct pt_regs *regs);
-
 static inline int get_recursion_context(int *recursion)
 {
        int rctx;