Bug 836943 - do not use next as a variable name in qemu-kvm systemtap tapset
do not use next as a variable name in qemu-kvm systemtap tapset
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
Unspecified Linux
medium Severity unspecified
: rc
: ---
Assigned To: Hai Huang
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-02 05:31 EDT by langfang
Modified: 2013-01-15 14:22 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-15 14:22:40 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description langfang 2012-07-02 05:31:44 EDT
Description of problem:
I got error following tapset error with qemu_vmalloc.stp output while probing 



Version-Release number of selected component (if applicable):
#uanme -r
3.3.0-0.15.el7.x86_64
#rpm -q qemu-kvm
qemu-kvm-1.0-17.1.el7.x86_64
# rpm -q systemtap
systemtap-1.8-1.el7.x86_64


How reproducible:

100%

Steps to Reproduce:
1. stap qemu_vmalloc.stp
  

#cat qemu_vmalloc.stp
probe qemu.kvm.qemu_vmalloc
{
 printf("size is %zu \n",size); 
}


Actual results:
parse error: invalid or missing conversion specifier
	saw: string 'size is %zu \n' at qemu_vmalloc.stp:3:9
     source:  printf("size is %zu \n",size); 
                     ^
1 parse error.
parse error: expected statement
	saw: keyword at /usr/share/systemtap/tapset/qemu-kvm.stp:1139:3
     source:   in = $arg3;
               ^
parse error: expected literal string or number
	saw: operator '=' at /usr/share/systemtap/tapset/qemu-kvm.stp:2078:8
     source:   next = $arg1;
                    ^
2 parse errors.
WARNING: tapset '/usr/share/systemtap/tapset/qemu-kvm.stp' has errors, and will be skipped.
parse error: expected statement
	saw: keyword at /usr/share/systemtap/tapset/qemu-system-i386.stp:1139:3
     source:   in = $arg3;
               ^
parse error: expected literal string or number
	saw: operator '=' at /usr/share/systemtap/tapset/qemu-system-i386.stp:2078:8
     source:   next = $arg1;
                    ^
2 parse errors.
WARNING: tapset '/usr/share/systemtap/tapset/qemu-system-i386.stp' has errors, and will be skipped.
parse error: expected statement
	saw: keyword at /usr/share/systemtap/tapset/qemu-system-x86_64.stp:1139:3
     source:   in = $arg3;
               ^
parse error: expected literal string or number
	saw: operator '=' at /usr/share/systemtap/tapset/qemu-system-x86_64.stp:2078:8
     source:   next = $arg1;
                    ^
2 parse errors.
WARNING: tapset '/usr/share/systemtap/tapset/qemu-system-x86_64.stp' has errors, and will be skipped.
Pass 1: parse failed.  Try again with another '--vp 1' option.
[root@localhost tracing-script]# cat qemu_vmalloc.stp 
probe qemu.kvm.qemu_vmalloc
{
 printf("size is %zu \n",size); 
}


Expected results:


Additional info:
Comment 3 Hai Huang 2013-01-15 14:22:40 EST
The problem is with the printf format specifier %zu.
Change "%zu" to "%lu", then the stap probe operation will work as expected:

# cat  qemu_vmalloc.stp
probe qemu.kvm.qemu_vmalloc { printf("size is %lu \n",size) }


# stap qemu_vmalloc.stp
size is 1073741824 
size is 131072 
size is 131072 
size is 67108864 
size is 8192 
size is 67108864 
size is 65536 
size is 65536

Note You need to log in before you can comment on or make changes to this bug.