Merge tag 'trace-v6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux...
[linux-2.6-microblaze.git] / kernel / trace / trace_uprobe.c
index c3dc4f8..fb58e86 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/namei.h>
 #include <linux/string.h>
 #include <linux/rculist.h>
+#include <linux/filter.h>
 
 #include "trace_dynevent.h"
 #include "trace_probe.h"
@@ -312,7 +313,8 @@ static bool trace_uprobe_match(const char *system, const char *event,
 {
        struct trace_uprobe *tu = to_trace_uprobe(ev);
 
-       return strcmp(trace_probe_name(&tu->tp), event) == 0 &&
+       return (event[0] == '\0' ||
+               strcmp(trace_probe_name(&tu->tp), event) == 0) &&
           (!system || strcmp(trace_probe_group_name(&tu->tp), system) == 0) &&
           trace_uprobe_match_command_head(tu, argc, argv);
 }
@@ -532,7 +534,7 @@ end:
 
 /*
  * Argument syntax:
- *  - Add uprobe: p|r[:[GRP/]EVENT] PATH:OFFSET[%return][(REF)] [FETCHARGS]
+ *  - Add uprobe: p|r[:[GRP/][EVENT]] PATH:OFFSET[%return][(REF)] [FETCHARGS]
  */
 static int __trace_uprobe_create(int argc, const char **argv)
 {
@@ -540,6 +542,7 @@ static int __trace_uprobe_create(int argc, const char **argv)
        const char *event = NULL, *group = UPROBE_EVENT_SYSTEM;
        char *arg, *filename, *rctr, *rctr_end, *tmp;
        char buf[MAX_EVENT_NAME_LEN];
+       char gbuf[MAX_EVENT_NAME_LEN];
        enum probe_print_type ptype;
        struct path path;
        unsigned long offset, ref_ctr_offset;
@@ -644,11 +647,13 @@ static int __trace_uprobe_create(int argc, const char **argv)
        /* setup a probe */
        trace_probe_log_set_index(0);
        if (event) {
-               ret = traceprobe_parse_event_name(&event, &group, buf,
+               ret = traceprobe_parse_event_name(&event, &group, gbuf,
                                                  event - argv[0]);
                if (ret)
                        goto fail_address_parse;
-       } else {
+       }
+
+       if (!event) {
                char *tail;
                char *ptr;
 
@@ -1342,15 +1347,15 @@ static void __uprobe_perf_func(struct trace_uprobe *tu,
        int size, esize;
        int rctx;
 
+#ifdef CONFIG_BPF_EVENTS
        if (bpf_prog_array_valid(call)) {
                u32 ret;
 
-               preempt_disable();
-               ret = trace_call_bpf(call, regs);
-               preempt_enable();
+               ret = bpf_prog_run_array_sleepable(call->prog_array, regs, bpf_prog_run);
                if (!ret)
                        return;
        }
+#endif /* CONFIG_BPF_EVENTS */
 
        esize = SIZEOF_TRACE_ENTRY(is_ret_probe(tu));