summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.printf/memory1.stp
diff options
context:
space:
mode:
authorWenji Huang <wenji.huang@oracle.com>2009-04-27 05:38:18 -0400
committerWenji Huang <wenji.huang@oracle.com>2009-04-26 23:05:04 -0400
commitc4f51a54acff992cf19902ffd56e8338158c5811 (patch)
treee09944d29060011dfc91c95748f07f673432df96 /testsuite/systemtap.printf/memory1.stp
parent40fc3e43cea224623400ac07b6f03c700d209dec (diff)
downloadsystemtap-steved-c4f51a54acff992cf19902ffd56e8338158c5811.tar.gz
systemtap-steved-c4f51a54acff992cf19902ffd56e8338158c5811.tar.xz
systemtap-steved-c4f51a54acff992cf19902ffd56e8338158c5811.zip
PR10099: Extend %M directive to support hexdumping large buffers
This patch will make %M directive dump the variable width buffer in hex format instead of returning uint64_t number as before. * runtime/vsprintf.c: Modify %M directive. * stap.1.in: Update description. * testsuite/systemtap.printf/memory1.stp: Add test case.
Diffstat (limited to 'testsuite/systemtap.printf/memory1.stp')
-rw-r--r--testsuite/systemtap.printf/memory1.stp14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/systemtap.printf/memory1.stp b/testsuite/systemtap.printf/memory1.stp
index f9cbf60b..15aa565b 100644
--- a/testsuite/systemtap.printf/memory1.stp
+++ b/testsuite/systemtap.printf/memory1.stp
@@ -113,6 +113,20 @@ probe syscall.open {
success = 0;
}
+ expected_16_actual = sprintf (" %02x%02x%02x%02x%02x%02x",
+ stringat(filename, 0),
+ stringat(filename, 1),
+ stringat(filename, 2),
+ stringat(filename, 3),
+ stringat(filename, 4),
+ stringat(filename, 5));
+ testName = "%M dynamic width larger than dynamic precision";
+ result = sprintf ("%*.*M", 14, 6, $filename);
+ if (result != expected_16_actual) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
if (success)
print ("Test passed\n");