summaryrefslogtreecommitdiff
path: root/tools/perf/util/util.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2016-04-07 09:11:11 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-04-07 10:21:49 -0300
commit7d6a7e782558323364bc0ae59f3523175c10b258 (patch)
tree1a075bc23db673a60d0095071c798f41057b581d /tools/perf/util/util.h
parentd1d438a3b1eb64eb99fc918d13a52ded3e941d67 (diff)
perf tools: Introduce trim function
To be used in cases for both sides trim. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Andreas Hollmann <hollmann@in.tum.de> Cc: David Ahern <dsahern@gmail.com> Cc: Milian Wolff <milian.wolff@kdab.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1460013073-18444-1-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/util.h')
-rw-r--r--tools/perf/util/util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 8298d607c738..3bf3de86d429 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -254,6 +254,11 @@ int hex2u64(const char *ptr, u64 *val);
char *ltrim(char *s);
char *rtrim(char *s);
+static inline char *trim(char *s)
+{
+ return ltrim(rtrim(s));
+}
+
void dump_stack(void);
void sighandler_dump_stack(int sig);