From ec6038d64bf1cc2811045146cba4987be38c0c26 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Sat, 3 Nov 2012 11:42:49 +1100 Subject: [PATCH] trace: use kbasename() Signed-off-by: Andy Shevchenko Cc: Steven Rostedt Cc: Frederic Weisbecker Signed-off-by: Andrew Morton --- kernel/trace/trace_uprobe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index 03003cd7dd96..c7ba4f6f46e9 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "trace_probe.h" @@ -263,16 +264,15 @@ static int create_trace_uprobe(int argc, char **argv) /* setup a probe */ if (!event) { - char *tail = strrchr(filename, '/'); + char *tail; char *ptr; - ptr = kstrdup((tail ? tail + 1 : filename), GFP_KERNEL); - if (!ptr) { + tail = kstrdup(kbasename(filename), GFP_KERNEL); + if (!tail) { ret = -ENOMEM; goto fail_address_parse; } - tail = ptr; ptr = strpbrk(tail, ".-_"); if (ptr) *ptr = '\0'; -- 2.39.5