This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Issue related to systemtap output in guru mode
- From: "ramya rao" <ba dot ramya at gmail dot com>
- To: systemtap at sources dot redhat dot com
- Date: Tue, 18 Sep 2007 19:50:03 +0530
- Subject: Issue related to systemtap output in guru mode
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=/X5kRb+nzL1URg2zo9tEfdurExLuD5HMNqobHNFXfYk=; b=OwZIo2hiB3kuteYxjXFuyuWic4w99Zbwem1nRlmOpAECJlkAkTCIde/4WTrCgZtiDGpC1IdM/vWfodur0rW1qAB9pmdJElAHfAigNwinTOOetAoWjCuIzw9QUE5S0rv6i5cSJ3CqAHjegNkKKUcI2BECuEHaUPX0r1KFQcdsDpA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=LZRGx3f/KJuyLBZHbhxAXVl5g++i0tEJLM2hRec3jO+rtvXCQPNF/agwjn/b2iL3v6JIXFqLer2ymN2t6IxrHdAwWvTVBwGnNJLIZ73D2T2VHgZRBX2MD8qwS8fpmkcvp1MWVLyacv6UW+9Ws4GOj0DDJMstzSaFhpwBPXpVcIc=
Hi,
We have an issue regarding the usage of systemtap in Guru mode.
When using systemtap in guru mode, we could not use printf statement.
The compilation stage failed. When we checked with more -v options, we
observed that an error was generated because of inclusion of printf
statement.
I would like to illustrate with a simple example as shown below:
Code snippet for hello world program
#!/usr/bin/stap -g
//hello_world.stp - prints hello world
function print_hello() %{
printf ("Hello World\n");
%}
probe begin {
print ("Test program\n")
print_hello()
}
Following observations were made:
1. When we executed the program with -vv option, we observed following
error message:
/tmp/stapivivxS/stap_a2609c1ce06492087c58daddf95c569a_258.c: In
function 'function_print_hello':
/tmp/stapivivxS/stap_a2609c1ce06492087c58daddf95c569a_258.c:105:
error: implicit declaration of function 'printf'
make[1]: *** [/tmp/stapivivxS/stap_a2609c1ce06492087c58daddf95c569a_258.o]
Error 1
make: *** [_module_/tmp/stapivivxS] Error 2
make: Leaving directory `/usr/src/linux-2.6.16.46-0.12'
Pass 4: compiled C into "stap_a2609c1ce06492087c58daddf95c569a_258.ko"
in 480usr/80sys/595real ms.
Pass 4: compilation failed. Try again with more '-v' (verbose) options.
Running rm -rf /tmp/stapivivxS
2. Then we included the stdio.h file as well as shown below
%{ #include <stdio.h> %}
However we observed following error messages:
/tmp/stapaMIET3/stap_a71619a8fd49b440ead016c3a87d8b4e_306.c:94:19:
error: stdio.h: No such file or directory
/tmp/stapaMIET3/stap_a71619a8fd49b440ead016c3a87d8b4e_306.c: In
function 'function_print_hello':
/tmp/stapaMIET3/stap_a71619a8fd49b440ead016c3a87d8b4e_306.c:109:
error: implicit declaration of function 'printf'
make[1]: *** [/tmp/stapaMIET3/stap_a71619a8fd49b440ead016c3a87d8b4e_306.o]
Error 1
make: *** [_module_/tmp/stapaMIET3] Error 2
make: Leaving directory `/usr/src/linux-2.6.16.46-0.12'
Pass 4: compiled C into "stap_a71619a8fd49b440ead016c3a87d8b4e_306.ko"
in 490usr/70sys/575real ms.
Pass 4: compilation failed. Try again with more '-v' (verbose) options.
Running rm -rf /tmp/stapaMIET3
3. However the program works fine if we use printk in place of printf
function, output messages appear in /var/log/messages. But we would
like to have the output to appear on the console.
Can any one please suggest how to display the information on console
when we are using systemtap in Guru Mode.?
Regards,
Ramya