]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - kernel/trace/trace_kprobe.c
Merge tag 'backlight-for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / kernel / trace / trace_kprobe.c
index 9ba3f43f580e7c97594df670e0bbf55ad33e279f..d0ce590f06e17a34c61c3d5c1ab805bb1b633c61 100644 (file)
@@ -1135,11 +1135,15 @@ static void
 kprobe_perf_func(struct trace_kprobe *tk, struct pt_regs *regs)
 {
        struct ftrace_event_call *call = &tk->tp.call;
+       struct bpf_prog *prog = call->prog;
        struct kprobe_trace_entry_head *entry;
        struct hlist_head *head;
        int size, __size, dsize;
        int rctx;
 
+       if (prog && !trace_call_bpf(prog, regs))
+               return;
+
        head = this_cpu_ptr(call->perf_events);
        if (hlist_empty(head))
                return;
@@ -1166,11 +1170,15 @@ kretprobe_perf_func(struct trace_kprobe *tk, struct kretprobe_instance *ri,
                    struct pt_regs *regs)
 {
        struct ftrace_event_call *call = &tk->tp.call;
+       struct bpf_prog *prog = call->prog;
        struct kretprobe_trace_entry_head *entry;
        struct hlist_head *head;
        int size, __size, dsize;
        int rctx;
 
+       if (prog && !trace_call_bpf(prog, regs))
+               return;
+
        head = this_cpu_ptr(call->perf_events);
        if (hlist_empty(head))
                return;
@@ -1287,7 +1295,7 @@ static int register_kprobe_event(struct trace_kprobe *tk)
                kfree(call->print_fmt);
                return -ENODEV;
        }
-       call->flags = 0;
+       call->flags = TRACE_EVENT_FL_KPROBE;
        call->class->reg = kprobe_register;
        call->data = tk;
        ret = trace_add_event_call(call);