bool is_return = false;
        char *symbol = NULL, *tmp = NULL;
        const char *event = NULL, *group = KPROBE_EVENT_SYSTEM;
+       enum probe_print_type ptype;
        int maxactive = 0;
        long offset = 0;
        void *addr = NULL;
                        goto error;     /* This can be -ENOMEM */
        }
 
-       ret = traceprobe_set_print_fmt(&tk->tp, is_return);
+       ptype = is_return ? PROBE_PRINT_RETURN : PROBE_PRINT_NORMAL;
+       ret = traceprobe_set_print_fmt(&tk->tp, ptype);
        if (ret < 0)
                goto error;
 
 create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
                          bool is_return)
 {
+       enum probe_print_type ptype;
        struct trace_kprobe *tk;
        int ret;
        char *event;
 
        init_trace_event_call(tk);
 
-       if (traceprobe_set_print_fmt(&tk->tp, trace_kprobe_is_return(tk)) < 0) {
+       ptype = trace_kprobe_is_return(tk) ?
+               PROBE_PRINT_RETURN : PROBE_PRINT_NORMAL;
+       if (traceprobe_set_print_fmt(&tk->tp, ptype) < 0) {
                ret = -ENOMEM;
                goto error;
        }
 
 /* When len=0, we just calculate the needed length */
 #define LEN_OR_ZERO (len ? len - pos : 0)
 static int __set_print_fmt(struct trace_probe *tp, char *buf, int len,
-                          bool is_return)
+                          enum probe_print_type ptype)
 {
        struct probe_arg *parg;
        int i, j;
        int pos = 0;
        const char *fmt, *arg;
 
-       if (!is_return) {
+       switch (ptype) {
+       case PROBE_PRINT_NORMAL:
                fmt = "(%lx)";
                arg = "REC->" FIELD_STRING_IP;
-       } else {
+               break;
+       case PROBE_PRINT_RETURN:
                fmt = "(%lx <- %lx)";
                arg = "REC->" FIELD_STRING_FUNC ", REC->" FIELD_STRING_RETIP;
+               break;
+       default:
+               WARN_ON_ONCE(1);
+               return 0;
        }
 
        pos += snprintf(buf + pos, LEN_OR_ZERO, "\"%s", fmt);
 }
 #undef LEN_OR_ZERO
 
-int traceprobe_set_print_fmt(struct trace_probe *tp, bool is_return)
+int traceprobe_set_print_fmt(struct trace_probe *tp, enum probe_print_type ptype)
 {
        struct trace_event_call *call = trace_probe_event_call(tp);
        int len;
        char *print_fmt;
 
        /* First: called with 0 length to calculate the needed length */
-       len = __set_print_fmt(tp, NULL, 0, is_return);
+       len = __set_print_fmt(tp, NULL, 0, ptype);
        print_fmt = kmalloc(len + 1, GFP_KERNEL);
        if (!print_fmt)
                return -ENOMEM;
 
        /* Second: actually write the @print_fmt */
-       __set_print_fmt(tp, print_fmt, len + 1, is_return);
+       __set_print_fmt(tp, print_fmt, len + 1, ptype);
        call->print_fmt = print_fmt;
 
        return 0;
 
 int traceprobe_parse_event_name(const char **pevent, const char **pgroup,
                                char *buf, int offset);
 
-extern int traceprobe_set_print_fmt(struct trace_probe *tp, bool is_return);
+enum probe_print_type {
+       PROBE_PRINT_NORMAL,
+       PROBE_PRINT_RETURN,
+};
+
+extern int traceprobe_set_print_fmt(struct trace_probe *tp, enum probe_print_type ptype);
 
 #ifdef CONFIG_PERF_EVENTS
 extern struct trace_event_call *
 
        const char *event = NULL, *group = UPROBE_EVENT_SYSTEM;
        char *arg, *filename, *rctr, *rctr_end, *tmp;
        char buf[MAX_EVENT_NAME_LEN];
+       enum probe_print_type ptype;
        struct path path;
        unsigned long offset, ref_ctr_offset;
        bool is_return = false;
                        goto error;
        }
 
-       ret = traceprobe_set_print_fmt(&tu->tp, is_ret_probe(tu));
+       ptype = is_ret_probe(tu) ? PROBE_PRINT_RETURN : PROBE_PRINT_NORMAL;
+       ret = traceprobe_set_print_fmt(&tu->tp, ptype);
        if (ret < 0)
                goto error;
 
 create_local_trace_uprobe(char *name, unsigned long offs,
                          unsigned long ref_ctr_offset, bool is_return)
 {
+       enum probe_print_type ptype;
        struct trace_uprobe *tu;
        struct path path;
        int ret;
        tu->filename = kstrdup(name, GFP_KERNEL);
        init_trace_event_call(tu);
 
-       if (traceprobe_set_print_fmt(&tu->tp, is_ret_probe(tu)) < 0) {
+       ptype = is_ret_probe(tu) ? PROBE_PRINT_RETURN : PROBE_PRINT_NORMAL;
+       if (traceprobe_set_print_fmt(&tu->tp, ptype) < 0) {
                ret = -ENOMEM;
                goto error;
        }