This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
>>>>> "MH" == Martin Hunt <hunt@redhat.com> writes:
MH> You wrote that "valid types are limited to string ("%s") and
MH> integer ("%d")"
MH> That makes it sound like you can only use "%s" and "%d" in
MH> printf. You can also use the standard flags and conversion
MH> specifiers from C printf.
Gotcha. Fixed.
>> Is there a difference in SystemTap's handling of printing binary
>> streams versus C standard syntax? Thanks.
MH> Yes, C printf does not do binary output. Systemtap's printf does
MH> the following:
MH> %1n, %2n, %4n, %n - These functions instruct printf to write a
MH> binary length at this location that is the total length of the
MH> string written by the printf. The field width is the number of
MH> bytes to write. The default is "2".
MH> %1b, %2b, %4b, %8b, %b - binary write. The field width specifies
MH> the number of bytes to write. Default is 4 (32-bits).
MH> Examples:
MH> stap -e 'probe begin{for(i=97;i<123;i++) printf("%3d:
MH> %1b%1b%1b\n",i,i,i-32,i-64); exit()}'
MH>> stap -e 'probe begin{printf("%1n%b%b", 0xc0dedbad,
MH>> 0x12345678);exit()}' | hexdump -C
MH> 00000000 08 ad db de c0 78 56 34 12 |.....xV4.|
MH>> stap -e 'probe begin{printf("%1b%1b%1blo %1b%1brld\n",
MH>> 72,101,108,87,111);exit()}'
MH> Hello World
Thank you for taking the time to make it clear to me. I've put your
reply into the Language Reference mostly verbatim.
Here's a fresh copy for review. I'll be on vacation after today, until
January 2nd, so look for updates and content development next year.
Attachment:
SystemTap-Language-Ref-2006-12-06.tex.gz
Description: SystemTap-Language-Ref-2006-12-06.tex.gz
Attachment:
SystemTap-Language-Ref-2006-12-06.ps.gz
Description: SystemTap-Language-Ref-2006-12-06.ps.gz
Regards, Robb - -- Robb Romans (512) 838-0419 Linux Commando T/L 678-0419 robb@linux.vnet.ibm.com ARS NA5TT .-- - ..-. ..--.. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/> iD8DBQFFdxVaZyOifwSFgjQRAhfqAKC3F2sqoRCpzWW1KFtXp77Qrjl2+QCgkA+p llFqaccpRceuImoEo1a3Ipg= =4Khx -----END PGP SIGNATURE-----
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |