Binary output with byte granularity
Frank Ch. Eigler
fche@redhat.com
Mon Oct 15 20:42:00 GMT 2007
Hi -
> >>Is there a way in SystemTap to output binary data with byte
> >>granularity? [...]
> >printf ("%1b", value)
>
> That prints one byte. How do I print all the bytes of binary data in a
> buffer of arbitrary length? [...]
Well, we don't have buffers of arbitrary length in the script
language, so this issue doesn't arise there. (But see bug #4706.)
If the buffer excluded \0, then one could use ordinary %s to format
it; if we needed a programmable substring length, we could add a "*"
width specifier as in libc -- printf("%*s", 40, "foo"). Worthwhile?
- FChE
More information about the Systemtap
mailing list