summaryrefslogtreecommitdiffstats
path: root/testsuite/buildok
diff options
context:
space:
mode:
authordsmith <dsmith>2006-05-16 18:51:34 +0000
committerdsmith <dsmith>2006-05-16 18:51:34 +0000
commit6e213f58c493be12eeb4f1532da3891c7baafbd5 (patch)
tree80d7812358ae6efaf71f06a2a2495f4c68439b19 /testsuite/buildok
parent0f8b6058e5f31c7318e5d873ad732bc9946ff1b5 (diff)
downloadsystemtap-steved-6e213f58c493be12eeb4f1532da3891c7baafbd5.tar.gz
systemtap-steved-6e213f58c493be12eeb4f1532da3891c7baafbd5.tar.xz
systemtap-steved-6e213f58c493be12eeb4f1532da3891c7baafbd5.zip
2006-05-16 David Smith <dsmith@redhat.com>
* parse.cxx (parser::parser): Added initializer for 'context' member variable. (tt2str): Added support for new tok_keyword type. (operator <<): Ignores keyword content when outputting error message. (lexer::scan): Recognizes keywords, such as 'probe', 'global', 'function', etc. and classifies them as type 'tok_keyword'. This causes keywords to become reserved so they cannot be used for function names, variable names, etc. (parser::parse): Changed tok_identifier to tok_keyword when looking for "probe", "global", or "function". Also sets context member variable which remembers if we're in probe, global, function, or embedded context. (parser::parse_probe, parser::parse_statement) (parser::parse_global, parser::parse_functiondecl) (parser::parse_if_statement, parser::parse_delete_statement) (parser::parse_break_statement, parser::parse_continue_statement) (parser::parse_for_loop, parser::parse_while_loop) (parser::parse_foreach_loop, parser::parse_array_in): Looks for tok_keyword instead of tok_identifier. (parser::parse_probe_point): Allows keywords as part of a probe name, since "return" and "function" are keywords. (parser::parse_return_statement): Looks for tok_keyword instead of tok_identifier. Make sure we're in function context. (parser::parse_next_statement): Looks for tok_keyword instead of tok_identifier. Make sure we're in probe context. * parse.h: Added parse_context enum. Added 'tok_keyword' to token_type enum. Added parse_context 'context' member variable to parser class. * stap.1.in: Because the string() function has been removed, the 'string()' function reference has been changed to a 'sprint()' function reference. * stapex.5.in: Ditto. * stapfuncs.5.in: The description of the string() and hexstring() functions has been removed. * testsuite/buildok/context_test.stp: Calls to the string() function were converted to sprint() function calls. * testsuite/buildok/fifteen.stp: Ditto. * testsuite/buildok/nineteen.stp: Ditto. * testsuite/buildok/process_test.stp: Ditto. * testsuite/buildok/task_test.stp: Ditto. * testsuite/buildok/timestamp.stp: Ditto. * testsuite/buildok/twentyone.stp: Ditto. * testsuite/semok/args.stp: Ditto. * testsuite/semok/seven.stp: Ditto. * testsuite/buildok/fourteen.stp: Calls to log()/string() were converted to a call to printf(). * testsuite/buildok/sixteen.stp: Ditto. * testsuite/buildok/thirteen.stp: Ditto. * testsuite/buildok/twentythree.stp: Ditto. * testsuite/buildok/twentytwo.stp: Ditto. * testsuite/buildok/seven.stp: Calls to the string() function were converted to sprint() calls. Calls to the hexstring() function were converted to sprintf() calls. * testsuite/semok/eleven.stp: Ditto. * testsuite/buildok/seventeen.stp: Calls to log()/hexstring() were converted to a call to printf(). * testsuite/semko/nineteen.stp: Ditto. * testsuite/parseok/three.stp: Because keywords are reserved, a variable named 'string' was renamed to 'str'. * testsuite/parseok/two.stp: Because keywords are reserved, a variable named 'global' was renamed to 'gbl'. * testsuite/transko/two.stp: Because the parser now checks for 'next' and 'return' statement context, a 'next' statement was removed from a function and a 'return' statement was removed from a probe.
Diffstat (limited to 'testsuite/buildok')
-rwxr-xr-xtestsuite/buildok/context_test.stp14
-rwxr-xr-xtestsuite/buildok/fifteen.stp4
-rwxr-xr-xtestsuite/buildok/fourteen.stp2
-rwxr-xr-xtestsuite/buildok/nineteen.stp6
-rwxr-xr-xtestsuite/buildok/process_test.stp16
-rwxr-xr-xtestsuite/buildok/seven.stp8
-rwxr-xr-xtestsuite/buildok/seventeen.stp2
-rwxr-xr-xtestsuite/buildok/sixteen.stp2
-rwxr-xr-xtestsuite/buildok/task_test.stp22
-rwxr-xr-xtestsuite/buildok/thirteen.stp2
-rwxr-xr-xtestsuite/buildok/timestamp.stp2
-rwxr-xr-xtestsuite/buildok/twentyone.stp8
-rwxr-xr-xtestsuite/buildok/twentythree.stp2
-rwxr-xr-xtestsuite/buildok/twentytwo.stp4
14 files changed, 47 insertions, 47 deletions
diff --git a/testsuite/buildok/context_test.stp b/testsuite/buildok/context_test.stp
index c732999d..36bf8ca6 100755
--- a/testsuite/buildok/context_test.stp
+++ b/testsuite/buildok/context_test.stp
@@ -9,14 +9,14 @@ function print_stuff () {
print_stack(bt)
print("\n\n")
log("execname is \"" . execname() . "\"")
- log("pid is " . string(pid()))
- log("tid is " . string(tid()))
+ log("pid is " . sprint(pid()))
+ log("tid is " . sprint(tid()))
log("pexecname is \"" . pexecname() . "\"")
- log("ppid is " . string(ppid()))
- log("uid is " . string(uid()))
- log("euid is " . string(euid()))
- log("gid is " . string(gid()))
- log("egid is " . string(egid()))
+ log("ppid is " . sprint(ppid()))
+ log("uid is " . sprint(uid()))
+ log("euid is " . sprint(euid()))
+ log("gid is " . sprint(gid()))
+ log("egid is " . sprint(egid()))
log("pp is '" . pp() . "'")
}
diff --git a/testsuite/buildok/fifteen.stp b/testsuite/buildok/fifteen.stp
index bf4e0af3..cda79805 100755
--- a/testsuite/buildok/fifteen.stp
+++ b/testsuite/buildok/fifteen.stp
@@ -24,8 +24,8 @@ probe kernel.function("schedule")
probe end
{
log("systemtap ending probe")
- log("count = " . string(count));
- log("count2 = " . string(count));
+ log("count = " . sprint(count));
+ log("count2 = " . sprint(count));
if ( count == count2) {
if ( (count-1) == count2 ) {
log("systemtap test failure");
diff --git a/testsuite/buildok/fourteen.stp b/testsuite/buildok/fourteen.stp
index b7f68afe..8eab2480 100755
--- a/testsuite/buildok/fourteen.stp
+++ b/testsuite/buildok/fourteen.stp
@@ -6,4 +6,4 @@ probe timer.jiffies(100).randomize(100) { j++ }
probe timer.ms(100) { i++ }
probe timer.ms(100).randomize(100) { j++ }
probe timer.profile { i++ }
-probe end { log ("i=" . string(i) . " j=" . string(j)) }
+probe end { printf("i=%d j=%d\n", i, j) }
diff --git a/testsuite/buildok/nineteen.stp b/testsuite/buildok/nineteen.stp
index be12b6f7..2019e209 100755
--- a/testsuite/buildok/nineteen.stp
+++ b/testsuite/buildok/nineteen.stp
@@ -9,13 +9,13 @@ function msg2 (x,y) {
probe begin {
msg1("55");
- msg1(string(55))
+ msg1(sprint(55))
msg2("100", "GOOD")
- msg2("GOOD", string(100))
+ msg2("GOOD", sprint(100))
# the next line caused a compile failure when uncommented; PR 1335
- msg2(string(100), "GOOD")
+ msg2(sprint(100), "GOOD")
exit()
}
diff --git a/testsuite/buildok/process_test.stp b/testsuite/buildok/process_test.stp
index c925980d..8da45378 100755
--- a/testsuite/buildok/process_test.stp
+++ b/testsuite/buildok/process_test.stp
@@ -2,7 +2,7 @@
probe process.create {
log(pp())
- log(string(task))
+ log(sprint(task))
}
probe process.start {
@@ -16,25 +16,25 @@ probe process.exec {
probe process.exec.complete {
log(pp())
- log(string(errno))
- log(string(success))
+ log(sprint(errno))
+ log(sprint(success))
}
probe process.exit {
log(pp())
- log(string(code))
+ log(sprint(code))
}
probe process.release {
log(pp())
- log(string(task))
+ log(sprint(task))
}
probe process.signal.send {
log(pp())
- log(string(signal))
+ log(sprint(signal))
log(signal_name)
- log(string(task))
- log(string(shared))
+ log(sprint(task))
+ log(sprint(shared))
}
diff --git a/testsuite/buildok/seven.stp b/testsuite/buildok/seven.stp
index 2ac6bcd7..25508b61 100755
--- a/testsuite/buildok/seven.stp
+++ b/testsuite/buildok/seven.stp
@@ -8,16 +8,16 @@
probe kernel.function("find_pid")
{
- log ("find_pid (" . string($type) . ","
- . string($nr) . ")")
+ log ("find_pid (" . sprint($type) . ","
+ . sprint($nr) . ")")
}
# second: opaque pointers and enums
probe kernel.function("detach_pid")
{
- log ("detach_pid (" . hexstring($task) . ","
- . string($type) . ")")
+ log ("detach_pid (" . sprintf("0x%x", $task) . ","
+ . sprint($type) . ")")
}
diff --git a/testsuite/buildok/seventeen.stp b/testsuite/buildok/seventeen.stp
index 6ac87815..9adffa48 100755
--- a/testsuite/buildok/seventeen.stp
+++ b/testsuite/buildok/seventeen.stp
@@ -5,5 +5,5 @@
probe kernel.function("pipe_write")
{
- log (hexstring ($write_fifo_fops->llseek))
+ printf("0x%x\n", $write_fifo_fops->llseek)
}
diff --git a/testsuite/buildok/sixteen.stp b/testsuite/buildok/sixteen.stp
index 26932b8e..0e313fa8 100755
--- a/testsuite/buildok/sixteen.stp
+++ b/testsuite/buildok/sixteen.stp
@@ -13,7 +13,7 @@ probe begin {
foreach (k in a) {
log (a[k])
for (i=0; i<10; i++) {
- log ("k=" . string(k) . " i=" . string(i))
+ printf("k=%d i=%d\n", k, i)
if (k % (i+1)) break else continue
}
if (k % 3) { foo() ; next }
diff --git a/testsuite/buildok/task_test.stp b/testsuite/buildok/task_test.stp
index 692745f7..17fa7fb3 100755
--- a/testsuite/buildok/task_test.stp
+++ b/testsuite/buildok/task_test.stp
@@ -2,17 +2,17 @@
probe begin {
c = task_current()
- log(string(task_parent(c)))
- log(string(task_state(c)))
+ log(sprint(task_parent(c)))
+ log(sprint(task_state(c)))
log(task_execname(c))
- log(string(task_pid(c)))
- log(string(task_tid(c)))
- log(string(task_gid(c)))
- log(string(task_egid(c)))
- log(string(task_uid(c)))
- log(string(task_euid(c)))
- log(string(task_prio(c)))
- log(string(task_nice(c)))
- log(string(task_cpu(c)))
+ log(sprint(task_pid(c)))
+ log(sprint(task_tid(c)))
+ log(sprint(task_gid(c)))
+ log(sprint(task_egid(c)))
+ log(sprint(task_uid(c)))
+ log(sprint(task_euid(c)))
+ log(sprint(task_prio(c)))
+ log(sprint(task_nice(c)))
+ log(sprint(task_cpu(c)))
exit()
}
diff --git a/testsuite/buildok/thirteen.stp b/testsuite/buildok/thirteen.stp
index 1113913e..4dffc4b9 100755
--- a/testsuite/buildok/thirteen.stp
+++ b/testsuite/buildok/thirteen.stp
@@ -2,5 +2,5 @@
probe kernel.function("sys_read")
{
- log ("count=" . string($count))
+ printf ("count=%d\n", $count)
}
diff --git a/testsuite/buildok/timestamp.stp b/testsuite/buildok/timestamp.stp
index f273262f..e071e781 100755
--- a/testsuite/buildok/timestamp.stp
+++ b/testsuite/buildok/timestamp.stp
@@ -1,6 +1,6 @@
#! stap -p4
probe begin {
- log(string(get_cycles() + gettimeofday_us() +
+ log(sprint(get_cycles() + gettimeofday_us() +
gettimeofday_ms() + gettimeofday_s()))
}
diff --git a/testsuite/buildok/twentyone.stp b/testsuite/buildok/twentyone.stp
index 052c3a17..367dfe73 100755
--- a/testsuite/buildok/twentyone.stp
+++ b/testsuite/buildok/twentyone.stp
@@ -14,14 +14,14 @@ probe begin {
probe end {
log ("x+ in a")
- foreach (x+ in a) log ("a[" . string(x) . "]=" . string(a[x]))
+ foreach (x+ in a) log ("a[" . sprint(x) . "]=" . sprint(a[x]))
log ("x- in a")
- foreach (x- in a) log ("a[" . string(x) . "]=" . string(a[x]))
+ foreach (x- in a) log ("a[" . sprint(x) . "]=" . sprint(a[x]))
log ("x in a+")
- foreach (x in a+) log ("a[" . string(x) . "]=" . string(a[x]))
+ foreach (x in a+) log ("a[" . sprint(x) . "]=" . sprint(a[x]))
log ("x in a-")
- foreach (x in a-) log ("a[" . string(x) . "]=" . string(a[x]))
+ foreach (x in a-) log ("a[" . sprint(x) . "]=" . sprint(a[x]))
}
diff --git a/testsuite/buildok/twentythree.stp b/testsuite/buildok/twentythree.stp
index 95a6f071..4aebe7bc 100755
--- a/testsuite/buildok/twentythree.stp
+++ b/testsuite/buildok/twentythree.stp
@@ -5,5 +5,5 @@
probe kernel.function("free_task")
{
$tsk->timestamp = 22;
- log("set to 22 => " . string($tsk->timestamp));
+ printf("set to 22 => %d\n", $tsk->timestamp);
}
diff --git a/testsuite/buildok/twentytwo.stp b/testsuite/buildok/twentytwo.stp
index fa45f312..88a0b57b 100755
--- a/testsuite/buildok/twentytwo.stp
+++ b/testsuite/buildok/twentytwo.stp
@@ -4,10 +4,10 @@
probe kernel.function("free_task")
{
- log("timestamp " . string($tsk->timestamp))
+ printf("timestamp %d\n", $tsk->timestamp)
}
probe kernel.function("vfs_llseek")
{
- log("offset " . string($offset))
+ printf("offset %d\n", $offset)
}