summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/string.h
diff options
context:
space:
mode:
authorHitoshi Mitake2009-11-15 12:36:53 +0100
committerIngo Molnar2009-11-15 14:54:23 +0100
commitd2fb8b4151a92223da6a84006f8f248ebeb6677d (patch)
treea25e75e2338f6b678de94b8a5b24a77104f01a02 /tools/perf/util/string.h
parentMerge branches 'perf/powerpc' and 'perf/bench' into perf/core (diff)
downloadkernel-qcow2-linux-d2fb8b4151a92223da6a84006f8f248ebeb6677d.tar.gz
kernel-qcow2-linux-d2fb8b4151a92223da6a84006f8f248ebeb6677d.tar.xz
kernel-qcow2-linux-d2fb8b4151a92223da6a84006f8f248ebeb6677d.zip
perf tools: Add new perf_atoll() function to parse string representing size in bytes
This patch modifies util/string.[ch] to add new function: perf_atoll() to parse string representing size in bytes. This function parses (\d+)(b|B|kb|KB|mb|MB|gb|GB) (e.g. "256MB") and returns its numeric value. (e.g. 268435456) Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <1258285013-4759-1-git-send-email-mitake@dcl.info.waseda.ac.jp> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/string.h')
-rw-r--r--tools/perf/util/string.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/string.h b/tools/perf/util/string.h
index 2c84bf65ba0f..e50b07f80827 100644
--- a/tools/perf/util/string.h
+++ b/tools/perf/util/string.h
@@ -5,6 +5,7 @@
int hex2u64(const char *ptr, u64 *val);
char *strxfrchar(char *s, char from, char to);
+s64 perf_atoll(const char *str);
#define _STR(x) #x
#define STR(x) _STR(x)