Chapter 5. Understanding SystemTap Errors
This chapter explains the most common errors you may encounter while using SystemTap.
These types of errors occur while SystemTap attempts to parse and translate the script into C, prior to being converted into a kernel module. For example type errors result from operations that assign invalid values to variables or arrays.
foo, saw barThe following invalid SystemTap script is missing its probe handlers:
probe vfs.read probe vfs.write
It results in the following error message showing that the parser was expecting something other than the probe keyword in column 1 of line 2:
parse error: expected one of '. , ( ? ! { = +='
saw: keyword at perror.stp:2:1
1 parse error(s).
%{ %}. SystemTap allows you to embed C code in a script, which is useful if there are no tapsets to suit your purposes. However, embedded C constructs are not be safe; as such, SystemTap warns you with this error if such constructs appear in the script.
If you are sure of the safety of any similar constructs in the script and are member of stapdev group (or have root privileges), run the script in "guru" mode by using the option -g (i.e. stap -g ).
script
foo' ... string vs. longfoo in the script used the wrong type (i.e. %s or %d). This error will present itself in Example 5.1, “error-variable.stp”, because the function execname() returns a string the format specifier should be a %s, not %d.
probe syscall.open
{
printf ("%d(%d) open\n", execname(), pid())
}foo'printf statement while the script never assigns a value to the variable.
probe begin { printf("x") = 1 }
N function, semantic error: unresolved function callfoo’ modified during ’foreach’ iterationfoo is being modifed (being assigned to or deleted from) within an active foreach loop. This error also displays if an operation within the script performs a function call within the foreach loop.
N, while resolving probe point foofoo refers to. This usually means that SystemTap could not find a match for foo in the tapset library. The N refers to the line and column of the error.
foofoo could not be resolved altogether, for a variety of reasons. This error occurs when the script contains the event kernel.function("blah"), and blah does not exist. In some cases, the error could also mean the script contains an invalid kernel file name or source line number.
kernel-debuginfo RPM whose version does not match the probed kernel exactly. The installed kernel-debuginfo RPM itself may have some consistency / correctness problems.
foo debuginfokernel-debuginfo at all.