diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2009-03-06 11:21:46 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-06 11:39:04 -0500 |
commit | 4370aa4aa75391a5e2e06bccb0919109f725ed8e (patch) | |
tree | 602a6ea4e404d17e610d4a9979d615ff2d0bfd98 /include/linux/string.h | |
parent | f036be96dd9ce442ffb9ab33e3c165f5178815c0 (diff) |
vsprintf: add binary printf
Impact: add new APIs for binary trace printk infrastructure
vbin_printf(): write args to binary buffer, string is copied
when "%s" is occurred.
bstr_printf(): read from binary buffer for args and format a string
[fweisbec@gmail.com: rebase]
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <1236356510-8381-2-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/string.h')
-rw-r--r-- | include/linux/string.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index d18fc198aa2f..27ac31784ad2 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/compiler.h> /* for inline */ | 10 | #include <linux/compiler.h> /* for inline */ |
11 | #include <linux/types.h> /* for size_t */ | 11 | #include <linux/types.h> /* for size_t */ |
12 | #include <linux/stddef.h> /* for NULL */ | 12 | #include <linux/stddef.h> /* for NULL */ |
13 | #include <stdarg.h> | ||
13 | 14 | ||
14 | extern char *strndup_user(const char __user *, long); | 15 | extern char *strndup_user(const char __user *, long); |
15 | 16 | ||
@@ -111,6 +112,12 @@ extern void argv_free(char **argv); | |||
111 | 112 | ||
112 | extern bool sysfs_streq(const char *s1, const char *s2); | 113 | extern bool sysfs_streq(const char *s1, const char *s2); |
113 | 114 | ||
115 | #ifdef CONFIG_BINARY_PRINTF | ||
116 | int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); | ||
117 | int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf); | ||
118 | int bprintf(u32 *bin_buf, size_t size, const char *fmt, ...) __printf(3, 4); | ||
119 | #endif | ||
120 | |||
114 | extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, | 121 | extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, |
115 | const void *from, size_t available); | 122 | const void *from, size_t available); |
116 | 123 | ||