summaryrefslogtreecommitdiffstats
path: root/runtime/vsprintf.c
diff options
context:
space:
mode:
authorElliott Baron <ebaron@toriamos.yyz.redhat.com>2008-12-19 10:03:35 -0500
committerElliott Baron <ebaron@toriamos.yyz.redhat.com>2008-12-19 10:03:35 -0500
commit30c94a80d5f7bef33450bd1a7e090c8e99b6db89 (patch)
tree17860ed41e259e5c12bc748968ee895d376644cf /runtime/vsprintf.c
parent0b7f181e1096f8833e24a60a7c0f97ecc063b9f4 (diff)
downloadsystemtap-steved-30c94a80d5f7bef33450bd1a7e090c8e99b6db89.tar.gz
systemtap-steved-30c94a80d5f7bef33450bd1a7e090c8e99b6db89.tar.xz
systemtap-steved-30c94a80d5f7bef33450bd1a7e090c8e99b6db89.zip
First attempt at printf kernel memory hex dump
Diffstat (limited to 'runtime/vsprintf.c')
-rw-r--r--runtime/vsprintf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/vsprintf.c b/runtime/vsprintf.c
index 831b7a2b..fbd90a83 100644
--- a/runtime/vsprintf.c
+++ b/runtime/vsprintf.c
@@ -283,6 +283,7 @@ int _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
continue;
case 's':
+ case 'M':
case 'm':
s = va_arg(args, char *);
if ((unsigned long)s < PAGE_SIZE)
@@ -303,8 +304,12 @@ int _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
}
}
for (i = 0; i < len; ++i) {
- if (str <= end)
+ if (str <= end) {
+ if (*fmt == 'M')
+ str = number(str, str + 2, (uint64_t)(unsigned char) *s, 16, 2, 2, STP_SPACE);
+ else
*str = *s;
+ }
++str; ++s;
}
while (len < field_width--) {