perf probe: Set default kprobe group name if it is not given
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Tue, 26 Apr 2016 09:04:13 +0000 (18:04 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 26 Apr 2016 16:14:58 +0000 (13:14 -0300)
Set kprobe group name as "probe" if it is not given.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20160426090413.11891.95640.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/probe-event.c

index 97b7f8e5fe69e24fd00f39edc70e5ca350b22bd2..0de5d10dda71c1840bc897f2033f841e736a7902 100644 (file)
@@ -2748,9 +2748,13 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev,
 {
        int ret;
 
-       if (pev->uprobes && !pev->group) {
-               /* Replace group name if not given */
-               ret = convert_exec_to_group(pev->target, &pev->group);
+       if (!pev->group) {
+               /* Set group name if not given */
+               if (!pev->uprobes) {
+                       pev->group = strdup(PERFPROBE_GROUP);
+                       ret = pev->group ? 0 : -ENOMEM;
+               } else
+                       ret = convert_exec_to_group(pev->target, &pev->group);
                if (ret != 0) {
                        pr_warning("Failed to make a group name.\n");
                        return ret;