diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-05-17 22:26:53 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-05-18 00:35:23 -0400 |
commit | f0218b3e9974f06014b61be8987159f4a20e011e (patch) | |
tree | 29a593c4d71ab18cb0c450a34e79bf6bea66877e /tools/perf/util/string.c | |
parent | 1eaa4787a774c4896518c81f24e8bccaa2244924 (diff) | |
parent | 9d192e118a094087494997ea1c8a2faf39af38c5 (diff) |
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip into trace/tip/tracing/core-6
Conflicts:
include/trace/ftrace.h
kernel/trace/trace_kprobe.c
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/perf/util/string.c')
-rw-r--r-- | tools/perf/util/string.c | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c index a175949ed216..0409fc7c0058 100644 --- a/tools/perf/util/string.c +++ b/tools/perf/util/string.c | |||
@@ -1,48 +1,5 @@ | |||
1 | #include "string.h" | ||
2 | #include "util.h" | 1 | #include "util.h" |
3 | 2 | #include "string.h" | |
4 | static int hex(char ch) | ||
5 | { | ||
6 | if ((ch >= '0') && (ch <= '9')) | ||
7 | return ch - '0'; | ||
8 | if ((ch >= 'a') && (ch <= 'f')) | ||
9 | return ch - 'a' + 10; | ||
10 | if ((ch >= 'A') && (ch <= 'F')) | ||
11 | return ch - 'A' + 10; | ||
12 | return -1; | ||
13 | } | ||
14 | |||
15 | /* | ||
16 | * While we find nice hex chars, build a long_val. | ||
17 | * Return number of chars processed. | ||
18 | */ | ||
19 | int hex2u64(const char *ptr, u64 *long_val) | ||
20 | { | ||
21 | const char *p = ptr; | ||
22 | *long_val = 0; | ||
23 | |||
24 | while (*p) { | ||
25 | const int hex_val = hex(*p); | ||
26 | |||
27 | if (hex_val < 0) | ||
28 | break; | ||
29 | |||
30 | *long_val = (*long_val << 4) | hex_val; | ||
31 | p++; | ||
32 | } | ||
33 | |||
34 | return p - ptr; | ||
35 | } | ||
36 | |||
37 | char *strxfrchar(char *s, char from, char to) | ||
38 | { | ||
39 | char *p = s; | ||
40 | |||
41 | while ((p = strchr(p, from)) != NULL) | ||
42 | *p++ = to; | ||
43 | |||
44 | return s; | ||
45 | } | ||
46 | 3 | ||
47 | #define K 1024LL | 4 | #define K 1024LL |
48 | /* | 5 | /* |