Red Hat ENTERPRISE LINUX 5.4 - SYSTEMTAP LANGUAGE Reference Manual page 48

Systemtap language reference
Hide thumbs Also See for ENTERPRISE LINUX 5.4 - SYSTEMTAP LANGUAGE:
Table of Contents

Advertisement

Chapter 9. Predefined functions
The printf function takes a formatting string as an argument, and a number of values of corresponding
types, and prints them all. The format must be a literal string constant. The printf formatting directives
are similar to those of C, except that they are fully checked for type by the translator.
The formatting string can contain tags that are defined as follows:
%[flags][width][.precision][length]specifier
Where specifier is required and defines the type and the interpretation of the value of the
corresponding argument. The following table shows the details of the specifier parameter:
Specifier
d or i
o
s
u
x
X
p
b
%
Table 9.1. printf specifier values
The tag can also contain flags, width, .precision and modifiers sub-specifiers, which are
optional and follow these specifications:
Flags
- (minus sign)
+ (plus sign)
(space)
40
Output
Signed decimal
Unsigned octal
String
Unsigned decimal
Unsigned hexadecimal
(lowercase letters)
Unsigned hexadecimal
(uppercase letters)
Pointer address
Writes a binary value as text.
The field width specifies the
number of bytes to write. Valid
specifications are %b, %1b,
%2b, %4b and %8b. The
default width is 8 (64-bits).
A % followed by another %
character will write % to stdout.
Description
Left-justify within the given
field width. Right justification
is the default (see width sub-
specifier).
Precede the result with a plus
or minus sign even for positive
numbers. By default, only
negative numbers are preceded
with a minus sign.
If no sign is going to be written,
a blank space is inserted before
the value.
Example
392
610
sample
7235
7fa
7FA
0x0000000000bc614e
See below
%

Advertisement

Table of Contents
loading

Table of Contents