From 9c98fb062af789df50ab98284ff2c6da3e220343 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 10 Sep 2008 23:10:39 -0400 Subject: PR6876 testsuite regression tweak --- testsuite/systemtap.base/optim_arridx.exp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testsuite/systemtap.base/optim_arridx.exp b/testsuite/systemtap.base/optim_arridx.exp index 89282d1b..bef4d2b4 100644 --- a/testsuite/systemtap.base/optim_arridx.exp +++ b/testsuite/systemtap.base/optim_arridx.exp @@ -9,15 +9,15 @@ elide_idx1:long elide_global_a:long elide_global_b:long # functions -fna:long (a:long) -return a -fnb:long (a:long, b:long) -return (a) + (b) exit:unknown () %{ atomic_set (&session_state, STAP_SESSION_STOPPING); _stp_exit (); %} +fna:long (a:long) +return a +fnb:long (a:long, b:long) +return (a) + (b) # probes begin /* <- begin */ # locals -- cgit From eacb10cec9899c79ae1e122a7b6e50106928a295 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 10 Sep 2008 23:11:30 -0400 Subject: parser/scanner speedup --- ChangeLog | 5 +++++ parse.cxx | 35 +++++++++++++++++++---------------- parse.h | 3 ++- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c575535..ae88d653 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-10 Frank Ch. Eigler + + * parse.cxx, parse.h: Rewrite scanner lookahead data structure + to a simple ~fixed vector. + 2008-09-10 Frank Ch. Eigler PR6876: translator speedup for many $vars diff --git a/parse.cxx b/parse.cxx index 00991022..1c1772f6 100644 --- a/parse.cxx +++ b/parse.cxx @@ -15,6 +15,7 @@ #include "util.h" #include + #include #include #include @@ -24,6 +25,8 @@ #include #include #include +#include + extern "C" { #include } @@ -576,20 +579,23 @@ parser::peek_kw (std::string const & kw) lexer::lexer (istream& i, const string& in, systemtap_session& s): - input (i), input_name (in), cursor_suspend_count(0), + input (i), input_name (in), + input_pointer (0), cursor_suspend_count(0), cursor_line (1), cursor_column (1), session(s) -{ } +{ + char c; + while(input.get(c)) + input_contents.push_back(c); +} int lexer::input_peek (unsigned n) { - while (lookahead.size() <= n) - { - int c = input.get (); - lookahead.push_back (input ? c : -1); - } - return lookahead[n]; + if (input_contents.size() > (input_pointer + n)) + return (int)(unsigned char)input_contents[input_pointer+n]; + else + return -1; } @@ -597,7 +603,7 @@ int lexer::input_get () { int c = input_peek (0); - lookahead.erase (lookahead.begin ()); + input_pointer ++; if (c < 0) return c; // EOF @@ -617,6 +623,7 @@ lexer::input_get () cursor_column ++; } + // clog << "[" << (char)c << "]"; return c; } @@ -624,13 +631,9 @@ lexer::input_get () void lexer::input_put (const string& chars) { - // clog << "[put:" << chars << "]"; - for (int i=chars.size()-1; i>=0; i--) - { - int c = chars[i]; - lookahead.insert (lookahead.begin(), c); - cursor_suspend_count ++; - } + // clog << "[put:" << chars << " @" << input_pointer << "]"; + input_contents.insert (input_contents.begin() + input_pointer, chars.begin(), chars.end()); + cursor_suspend_count += chars.size(); } diff --git a/parse.h b/parse.h index 25c42931..50b1507d 100644 --- a/parse.h +++ b/parse.h @@ -79,7 +79,8 @@ private: int input_peek (unsigned n=0); std::istream& input; std::string input_name; - std::vector lookahead; + std::vector input_contents; + int input_pointer; // index into input_contents unsigned cursor_suspend_count; unsigned cursor_line; unsigned cursor_column; -- cgit From 41a6bdc97595066a4f8fd3147102cc36b54c5822 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 11 Sep 2008 16:10:50 -0400 Subject: comment out new "WARNING: unwind data not found ..." --- translate.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/translate.cxx b/translate.cxx index 64308fe3..e92c8483 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4517,8 +4517,13 @@ dump_unwindsyms (Dwfl_Module *m, } else { + // There would be only a small benefit to warning. A user + // likely can't do anything about this; backtraces for the + // affected module would just get all icky heuristicy. +#if 0 c->session.print_warning ("No unwind data for " + modname + ", " + dwfl_errmsg (-1)); +#endif } for (unsigned secidx = 0; secidx < seclist.size(); secidx++) -- cgit From 35dc8b0471eb566a2e15a1ed24e9ad26362cf6b1 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 11 Sep 2008 16:16:25 -0400 Subject: PR6871: sadly, reenable prologue searching for user-space function probes --- ChangeLog | 7 +++++++ tapsets.cxx | 9 ++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2329f1c0..ce4b3844 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-09-11 Frank Ch. Eigler + + PR 6871. + * tapsets.cxx (query_cu): Search for prologues for user-space probes. + (query_func_info): Use prologue_end if available; silently back down + to entrypc probing if needed. + 2008-09-10 Josh Stone * main.cxx (printscript): Ensure no variables are printed in probe lists diff --git a/tapsets.cxx b/tapsets.cxx index 308cef1f..4d47dca1 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -3458,13 +3458,8 @@ query_func_info (Dwarf_Addr entrypc, } else { - if (q->sess.prologue_searching - && !q->has_statement_str && !q->has_statement_num - && !q->sess.ignore_vmlinux && !q->sess.ignore_dwarf) // PR 2608 + if (fi.prologue_end != 0) { - if (fi.prologue_end == 0) - throw semantic_error("could not find prologue-end " - "for probed function '" + fi.name + "'"); query_statement (fi.name, fi.decl_file, fi.decl_line, &fi.die, fi.prologue_end, q); } @@ -3718,7 +3713,7 @@ query_cu (Dwarf_Die * cudie, void * arg) if (rc != DWARF_CB_OK) q->query_done = true; - if (q->sess.prologue_searching + if ((q->sess.prologue_searching || q->has_process) // PR 6871 && !q->has_statement_str && !q->has_statement_num) // PR 2608 if (! q->filtered_functions.empty()) q->dw.resolve_prologue_endings (q->filtered_functions); -- cgit From 5249b0e41d82bf0ad175662637101cc925de7ba2 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 11 Sep 2008 16:23:16 -0400 Subject: PR6871: test case --- testsuite/ChangeLog | 5 +++++ testsuite/systemtap.base/uprobes.exp | 5 +++-- testsuite/systemtap.base/uprobes.stp | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 288705b1..59d8de5a 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-09-11 Frank Ch. Eigler + + PR 6871. + * systemtap.base/uprobes.*: Energize. + 2008-09-10 Josh Stone * systemtap.base/probe_list.exp: New test for correct probe listing. diff --git a/testsuite/systemtap.base/uprobes.exp b/testsuite/systemtap.base/uprobes.exp index 8fbe6da6..391f5028 100644 --- a/testsuite/systemtap.base/uprobes.exp +++ b/testsuite/systemtap.base/uprobes.exp @@ -8,6 +8,7 @@ set fp [open $path "w"] puts $fp "int main (int argc, char *argv[])" puts $fp "{" puts $fp "if (argc > 1) main (argc - 1, argv);" +puts $fp "return 0;" puts $fp "}" close $fp @@ -30,8 +31,8 @@ expect { -re {^Disabling[^\r\n]*\r\n} { exp_continue } -re {^Uprobes[^\r\n]*\r\n} { exp_continue } -re {^Cache[^\r\n]*\r\n} { exp_continue } - -re {^process[^\r\n]*jennie[^\r\n]*main[^\r\n]*call\r\n} { incr ok; exp_continue } - -re {^process[^\r\n]*jennie[^\r\n]*main[^\r\n]*return\r\n} { incr ok; exp_continue } + -re {^process[^\r\n]*jennie[^\r\n]*main[^\r\n]*call argc=0x[1-5][^\r\n]*\r\n} { incr ok; exp_continue } + -re {^process[^\r\n]*jennie[^\r\n]*main[^\r\n]*return return=0x0[^\r\n]*\r\n} { incr ok; exp_continue } -timeout 30 timeout { } eof { } diff --git a/testsuite/systemtap.base/uprobes.stp b/testsuite/systemtap.base/uprobes.stp index 8e7dbe9d..32bc1a70 100755 --- a/testsuite/systemtap.base/uprobes.stp +++ b/testsuite/systemtap.base/uprobes.stp @@ -1,3 +1,3 @@ #! stap -p4 -probe process("./jennie").function("main").call { log(pp()/*." ".$$parms*/) } -probe process("./jennie").function("main").return { log(pp()/*." ".$$return*/) } +probe process("./jennie").function("main").call { log(pp()." ".$$parms) } +probe process("./jennie").function("main").return { log(pp()." ".$$return) } -- cgit From aed575d2380dcca0d8212d3dde9bb13f1302562a Mon Sep 17 00:00:00 2001 From: David Smith Date: Thu, 11 Sep 2008 15:24:05 -0500 Subject: Ignore new warning. 2008-09-11 David Smith * lib/stap_run.exp: Ignore new warning. --- testsuite/ChangeLog | 4 ++++ testsuite/lib/stap_run.exp | 1 + 2 files changed, 5 insertions(+) diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 59d8de5a..18f04bbf 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-09-11 David Smith + + * lib/stap_run.exp: Ignore new warning. + 2008-09-11 Frank Ch. Eigler PR 6871. diff --git a/testsuite/lib/stap_run.exp b/testsuite/lib/stap_run.exp index c0027e95..a4beaa12 100644 --- a/testsuite/lib/stap_run.exp +++ b/testsuite/lib/stap_run.exp @@ -34,6 +34,7 @@ proc stap_run { TEST_NAME {LOAD_GEN_FUNCTION ""} {OUTPUT_CHECK_STRING ""} args } expect { -timeout 180 -re {^WARNING: cannot find module [^\r]*DWARF[^\r]*\r\n} {exp_continue} + -re {^WARNING: No unwind data for /.+\r\n} {exp_continue} -re {^Pass\ ([1234]):[^\r]*\ in\ ([0-9]+)usr/([0-9]+)sys/([0-9]+)real\ ms\.\r\n} {set pass$expect_out(1,string) "\t$expect_out(2,string)\t$expect_out(3,string)\t$expect_out(4,string)"; exp_continue} -re {^Pass\ ([34]): using cached [^\r]+\r\n} -- cgit From 3438f38f647db43bfc06b12930b7dfc14af7d67d Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Fri, 12 Sep 2008 08:14:39 -0400 Subject: Fix redundant implicit probe points in listing mode --- ChangeLog | 4 ++++ elaborate.cxx | 2 ++ tapset/ChangeLog | 4 ++++ tapset/signal.stp | 47 +++++++++++++++++++++++------------------------ 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index ce4b3844..0f3d02e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-09-12 Wenji Huang + + * elaborate.cxx (add_global_var_display): Don't, in listing mode. + 2008-09-11 Frank Ch. Eigler PR 6871. diff --git a/elaborate.cxx b/elaborate.cxx index 552ef338..b476948b 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -1147,6 +1147,8 @@ semantic_pass_symbols (systemtap_session& s) // Keep unread global variables for probe end value display. void add_global_var_display (systemtap_session& s) { + if (s.listing_mode) return; // avoid end probe in listings_mode + varuse_collecting_visitor vut; for (unsigned i=0; i + + * signal.stp: Initialize __sig in a function. + 2008-09-09 Masami Hiramatsu * utrace.stp: Added _utrace_syscall_return(). diff --git a/tapset/signal.stp b/tapset/signal.stp index 1128e6fb..66de767e 100644 --- a/tapset/signal.stp +++ b/tapset/signal.stp @@ -103,14 +103,14 @@ probe signal.send.return = _signal.send.*.return retstr = returnstr(1) } -/* +/* * Return values for "__group_send_sig_info" and "specific_send_sig_info" * - * - return 0 if the signal is sucessfully sent to a process, + * - return 0 if the signal is sucessfully sent to a process, * which means the following: * <1> the signal is ignored by receiving process * <2> this is a non-RT signal and we already have one queued - * <3> the signal is successfully added into the sigqueue of + * <3> the signal is successfully added into the sigqueue of * receiving process * * - return -EAGAIN if the sigqueue is overflow the signal was RT @@ -133,7 +133,7 @@ probe _signal.send.part4.return = kernel.function("specific_send_sig_info").retu %( kernel_v <= "2.6.25" %? /* - * - return 0 if the signal is either sucessfully added into the + * - return 0 if the signal is either sucessfully added into the * sigqueue of receiving process or a SI_TIMER entry is already * queued so just increment the overrun count * @@ -149,7 +149,7 @@ probe _signal.send.part2.return = kernel.function("send_group_sigqueue").return %) /* - * - return 0 if the signal is either sucessfully added into the + * - return 0 if the signal is either sucessfully added into the * sigqueue of receiving process or a SI_TIMER entry is already * queued so just increment the overrun count * @@ -189,14 +189,14 @@ probe signal.checkperm = kernel.function("check_kill_permission") si_code="SI_KERNEL (SIGFPE, SIGSEGV, SIGTRAP, SIGCHLD, SIGPOLL)" else if (sinfo <= 0) si_code="SI_USER or SI_TIMER or SI_ASYNCIO" -} +} probe signal.checkperm.return = kernel.function("check_kill_permission").return { name = "signal.checkperm" retstr = returnstr(1) } - + /* probe signal.wakeup * @@ -205,10 +205,10 @@ probe signal.checkperm.return = kernel.function("check_kill_permission").return * Argument: * sig_pid: pid of the process to be woke up * pid_name: name of the process to be woke up - * resume: indicate whether to wake up a task in STOPPED or + * resume: indicate whether to wake up a task in STOPPED or TRACED state - * state_mask: a string representation indicates the mask - * of task states that can be woken + * state_mask: a string representation indicates the mask + * of task states that can be woken */ probe signal.wakeup = kernel.function("signal_wake_up") { @@ -246,7 +246,7 @@ probe signal.check_ignored.return = kernel.function("sig_ignored").return ? /* probe signal.handle_stop * * For now, just comment it out since at the time handle_stop_signal() - * is called, it doesn't know whether current signal is STOP/COUNT. + * is called, it doesn't know whether current signal is STOP/COUNT. * So the calling of handle_stop_signal() doesn't mean that the Kernel * is now processing the STOP/COUNT signal * @@ -367,7 +367,7 @@ probe signal.send_sig_queue.return = /* probe signal.pending * - * Used to examine the set of signals that are pending for + * Used to examine the set of signals that are pending for * delivery to the calling thread * * long do_sigpending(void __user *set, unsigned long sigsetsize) @@ -395,8 +395,8 @@ probe signal.pending.return = kernel.function("do_sigpending").return * sinfo : address of siginfo table. * ka_addr : Address of the k_sigaction table associated with the signal * oldset_addr : Address of a bit mask array of blocked signals - * regs : Address in the Kernel Mode stack area - * + * regs : Address in the Kernel Mode stack area + * */ probe signal.handle = kernel.function("handle_signal") { @@ -409,7 +409,7 @@ probe signal.handle = kernel.function("handle_signal") regs = $regs // Check whether the signal is a User Mode or Kernel mode Signal. - + if (sinfo == 0 && sig_code <= 0) sig_mode = "User Mode Signal" else if (sinfo >= 1) @@ -506,7 +506,7 @@ probe signal.procmask.return = kernel.function("sigprocmask").return /* * probe signal.flush - * + * * Flush all pending signals for a task. * * void flush_signals(struct task_struct *t) @@ -517,16 +517,16 @@ probe signal.flush = kernel.function("flush_signals") task = $t sig_pid = $t->pid pid_name = kernel_string($t->comm) -} +} function get_sa_flags:long (act:long) %{ /* pure */ - struct k_sigaction *act = (struct k_sigaction *)((long)THIS->act); + struct k_sigaction *act = (struct k_sigaction *)((long)THIS->act); THIS->__retvalue = kread(&act->sa.sa_flags); CATCH_DEREF_FAULT(); %} function get_sa_handler:long (act:long) %{ /* pure */ - struct k_sigaction *act = (struct k_sigaction *)((long)THIS->act); + struct k_sigaction *act = (struct k_sigaction *)((long)THIS->act); THIS->__retvalue = (long)kread(&act->sa.sa_handler); CATCH_DEREF_FAULT(); %} @@ -608,13 +608,10 @@ function sa_handler_str(handler) { /* * Signals start from 1 not 0. */ -function signal_str(num) { - return __sig[num] -} - global __sig[64] -probe begin(-1) { +function signal_str(num) { + if (!(64 in __sig)) { __sig[1] = "HUP" __sig[2] = "INT" __sig[3] = "QUIT" @@ -679,4 +676,6 @@ probe begin(-1) { __sig[62] = "RTMIN+30" __sig[63] = "RTMIN+31" __sig[64] = "RTMIN+32" + } + return __sig[num] } -- cgit From 2c92c3026644f70f2628949a5cc0f94506a46ff5 Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Fri, 12 Sep 2008 11:24:05 -0400 Subject: fixes for stap-find-servers and systemtap.spec --- ChangeLog | 7 +++++++ stap-find-servers | 28 +++++++++++++++++++--------- systemtap.spec | 4 ++-- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2329f1c0..bcbca79e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-09-12 Dave Brolley + + * stap-find-servers (match_server): Don't read past the start of the + next server description. Don't use '^' at the start of the regexp + on calls to 'expr'. + * systemtap.spec: client and server sub packages require avahi. + 2008-09-10 Josh Stone * main.cxx (printscript): Ensure no variables are printed in probe lists diff --git a/stap-find-servers b/stap-find-servers index fea645bd..3038c54e 100755 --- a/stap-find-servers +++ b/stap-find-servers @@ -50,19 +50,27 @@ function match_server { local rc=1 # not found yet # Loop over the avahi service descriptors. - while read + read || exit $rc + while test "X$REPLY" != "X" do + server_name= + server_ip= + server_port= + server_sysinfo= + # Examine the next service descriptor # Is it a stap server? - (echo $REPLY | grep -q "^=.*_stap") || continue + if ! echo $REPLY | grep -q "=.* .* IPv4 .*_stap"; then + read || exit $rc + continue + fi + REPLY= # Get the details of the service - local service_tag equal data + local service_tag equal service_data while read service_tag equal service_data do case $service_tag in - '=' ) - break ;; hostname ) server_name=`expr "$service_data" : '\[\([^]]*\)\]'` ;; @@ -74,12 +82,12 @@ function match_server { local attempt for ((attempt=0; $attempt < 5; ++attempt)) do - server_ip=`expr "$server_ip" : '^\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\)$'` + server_ip=`expr "$server_ip" : '\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\)$'` if test "X$server_ip" != "X"; then break fi # Resolve the server.domain to an ip address. - server_ip=`avahi-resolve-host-name $hostname` + server_ip=`avahi-resolve-host-name $server_name` server_ip=`expr "$server_ip" : '.* \(.*\)$'` done ;; @@ -90,7 +98,9 @@ function match_server { server_sysinfo=`expr "$service_data" : '\[.*\"\(sysinfo=[^]]*\)\"\]'` ;; * ) - break ;; + REPLY="$service_tag $equal $service_data" + break + ;; esac done @@ -100,7 +110,7 @@ function match_server { fi # It's compatible, or we're finding all servers. Print a summary line - echo $server_name $server_ip $server_port "'$server_sysinfo'" + echo "$server_name $server_ip $server_port '$server_sysinfo'" rc=0 done diff --git a/systemtap.spec b/systemtap.spec index 4a7d2b4a..1a967cf1 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -81,7 +81,7 @@ Group: Development/System License: GPLv2+ URL: http://sourceware.org/systemtap/ Requires: systemtap-runtime = %{version}-%{release} -Requires: avahi-tools nc mktemp +Requires: avahi avahi-tools nc mktemp %description client SystemTap client is the client component of an instrumentation @@ -94,7 +94,7 @@ Group: Development/System License: GPLv2+ URL: http://sourceware.org/systemtap/ Requires: systemtap -Requires: avahi-tools nc net-tools mktemp +Requires: avahi avahi-tools nc net-tools mktemp %description server SystemTap server is the server component of an instrumentation -- cgit From 8807cc2bee27f6528a23a0267eb2d3e3e6dd0628 Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Fri, 12 Sep 2008 11:33:48 -0400 Subject: Formatting problems in sta-server.8.in --- ChangeLog | 5 ++++ stap-server.8.in | 69 ++++++++++++++++++++++++++++---------------------------- 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5c63184..5e137fe7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-12 Dave Brolley + PR6881. + From Eugeniy Meshcheryakov eugen@debian.org: + * stap-server.8.in: Correct formatting problems. + 2008-09-12 Dave Brolley * stap-find-servers (match_server): Don't read past the start of the diff --git a/stap-server.8.in b/stap-server.8.in index 9bfaa789..ffee8dfa 100644 --- a/stap-server.8.in +++ b/stap-server.8.in @@ -6,19 +6,19 @@ stap-server \- systemtap server and related utilities .SH SYNOPSIS .br -.B stap-start-server +.B stap\-start\-server .br -.B stap-find-servers +.B stap\-find\-servers [ -.B --all +.B \-\-all ] .br -.B stap-find-or-start-server +.B stap\-find\-or\-start\-server .br -.B stap-stop-server +.B stap\-stop\-server .I PID .br -.B stap-client +.B stap\-client [ .I ARGUMENTS ] @@ -26,17 +26,16 @@ stap-server \- systemtap server and related utilities .SH DESCRIPTION The systemtap server listens for connections from -.I stap-client +.I stap\-client on the local network and accepts requests to run the .I stap front end. .PP The -.I stap-start-server -program attempts to start a systemtap server ( -.I stap-serverd -) on the local host. Upon +.I stap\-start\-server +program attempts to start a systemtap server (\fIstap-serverd\fP) +on the local host. Upon successful startup, the server listens for connections on a random port and advertises its presence on the local network using the .I avahi @@ -45,71 +44,71 @@ echoed to stdout and the exit code is 0. Otherwise, nothing is echoed and the ex .PP The -.I stap-find-servers +.I stap\-find\-servers program attempts to find systemtap servers running on the local network. The details of any servers found are echoed to stdout. If servers are found, then the exit code is 0, otherwise it is 1. .PP The -.I stap-find-or-start-server +.I stap\-find\-or\-start\-server program attempts to find a compatible systemtap server running on the local network using -.I stap-find-servers. +.IR stap\-find\-servers . If a compatible server is found, -.I stap-find-or-start-server +.I stap\-find\-or\-start\-server echos '0' to stdout and the exit code is 0. Otherwise -.I stap-find-or-start-server +.I stap\-find\-or\-start\-server attempts to start a server on the local network using -.I stap-start-server. +.IR stap\-start\-server . If successful, the process id of the new server is echoed to stdout and the exit code is 0. If no server can be found or started, nothing is echoed to stdout and the exit code is 1. .PP The -.I stap-stop-server +.I stap\-stop\-server program verifies that the given process id is that of a running systemtap server on the local host and, if so, attempts to shut down the server by sending it the SIGTERM signal. If a process id is provided and it is that of a running systemtap server, the exit code is 0. Otherwise the exit code is 1. -.I stap-stop-server +.I stap\-stop\-server does not verify that the server actually shuts down. .PP The -.I stap-client +.I stap\-client program is analagous to the .I stap front end except that it attempts to find a compatible systemtap server on the local network and then attempts to use that server for actions related to passes 1 through 4. Pass 5 actions, if requested, are performed on the localhost using -.I staprun -. Upon successful completion, the exit code is 0. Otherwise the exit code +.IR staprun . +Upon successful completion, the exit code is 0. Otherwise the exit code is 1. .SH OPTIONS The -.I stap-find-servers +.I stap\-find\-servers program supports the following option. Any other option is ignored. .TP -.B \--all +.B \-\-all Instructs -.I stap-find-servers +.I stap\-find\-servers to report all systemtap servers on the local network regardless of compatibility. The default behavior is to report only servers which are compatible with systemtap on the local host. .SH ARGUMENTS The -.I stap-stop-server +.I stap\-stop\-server program requires a process id argument which identifies the server to be stopped. .PP The -.I stap-client +.I stap\-client program accepts the same arguments and options as the .I stap front end. @@ -120,33 +119,33 @@ See the manual page for a collection of sample scripts. .PP Here is a very basic example of how to use -.I stap-client. +.IR stap\-client . .PP To find out if a compatible systemtap server is running on your local network .PP -\& $ stap-find-servers +\& $ stap\-find\-servers .PP If no servers are reported, you can start one using .PP -\& $ stap-start-server +\& $ stap\-start\-server .PP You could also have accomplished both of the previous two steps using .PP -\& $ stap-find-or-start-server +\& $ stap\-find\-or\-start\-server .PP To compile and execute a simple example using the server .PP -\& $ stap-client \-e \[aq]probe begin { printf("Hello World!\\n"); exit() }\[aq] +\& $ stap\-client \-e \[aq]probe begin { printf("Hello World!\\n"); exit() }\[aq] .br \& Hello World! .PP If a process id was echoed by -.I stap-start-server +.I stap\-start\-server or -.I stap-find-or-start-server +.I stap\-find\-or\-start\-server then you can stop the server using .PP -\& $ stap-stop-server PID +\& $ stap\-stop\-server PID .PP where PID is the process id that was echoed. -- cgit From 3a4e19b8a7d12cb7e3b82b523bd47b9ae9ff9487 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 12 Sep 2008 13:20:10 -0400 Subject: gcc 4.4 build compatibility tweaks --- ChangeLog | 12 ++++++++++++ Makefile.am | 4 ++-- Makefile.in | 4 ++-- doc/Makefile.in | 4 ++-- parse.h | 2 +- tapsets.cxx | 2 +- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e137fe7..ca04745f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,16 @@ +2008-09-12 Frank Ch. Eigler + + GCC 4.4 (var-tracking) build-compatilibity. + * parse.h: #include . + * tapsets.cxx (utrace_...::visit_target_symbol_arg): Use + lex_cast(foo) instead of atoi(foo.c_str()) for simpler + c++ object lifetime. + * Makefile.am (staprun_CFLAGS, stapio_CFLAGS): Add + -fno-strict-aliasing, since that code is too casual with pointers. + * Makefile.in: Regenerated. + 2008-09-12 Dave Brolley + PR6881. From Eugeniy Meshcheryakov eugen@debian.org: * stap-server.8.in: Correct formatting problems. diff --git a/Makefile.am b/Makefile.am index c1bcd11e..1e356a4f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -100,14 +100,14 @@ staprun_SOURCES = runtime/staprun/staprun.c runtime/staprun/staprun_funcs.c\ runtime/staprun/ctl.c runtime/staprun/common.c staprun_CPPFLAGS = $(AM_CPPFLAGS) -staprun_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) -DSINGLE_THREADED +staprun_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) -DSINGLE_THREADED -fno-strict-aliasing staprun_LDADD = @PROCFLAGS@ stapio_SOURCES = runtime/staprun/stapio.c \ runtime/staprun/mainloop.c runtime/staprun/common.c \ runtime/staprun/ctl.c \ runtime/staprun/relay.c runtime/staprun/relay_old.c -stapio_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) +stapio_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) -fno-strict-aliasing stapio_LDADD = @PROCFLAGS@ -lpthread install-exec-hook: diff --git a/Makefile.in b/Makefile.in index 08d82151..22336ec0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -292,14 +292,14 @@ staprun_SOURCES = runtime/staprun/staprun.c runtime/staprun/staprun_funcs.c\ runtime/staprun/ctl.c runtime/staprun/common.c staprun_CPPFLAGS = $(AM_CPPFLAGS) -staprun_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) -DSINGLE_THREADED +staprun_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) -DSINGLE_THREADED -fno-strict-aliasing staprun_LDADD = @PROCFLAGS@ stapio_SOURCES = runtime/staprun/stapio.c \ runtime/staprun/mainloop.c runtime/staprun/common.c \ runtime/staprun/ctl.c \ runtime/staprun/relay.c runtime/staprun/relay_old.c -stapio_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) +stapio_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) -fno-strict-aliasing stapio_LDADD = @PROCFLAGS@ -lpthread loc2c_test_SOURCES = loc2c-test.c loc2c.c loc2c_test_CPPFLAGS = $(stap_CPPFLAGS) diff --git a/doc/Makefile.in b/doc/Makefile.in index aed03ee2..c003c742 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/parse.h b/parse.h index 50b1507d..cf31f4f8 100644 --- a/parse.h +++ b/parse.h @@ -16,7 +16,7 @@ #include #include #include - +#include struct source_loc { diff --git a/tapsets.cxx b/tapsets.cxx index 4d47dca1..f25c671c 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -5927,7 +5927,7 @@ void utrace_var_expanding_copy_visitor::visit_target_symbol_arg (target_symbol* e) { string argnum_s = e->base_name.substr(4,e->base_name.length()-4); - int argnum = atoi (argnum_s.c_str()); + int argnum = lex_cast(argnum_s); if (flags != UDPF_SYSCALL) throw semantic_error ("only \"process(PATH_OR_PID).syscall\" support $argN.", e->tok); -- cgit From ee928e1461d33322e9485f4736ba2f979a3331b5 Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 12 Sep 2008 13:18:15 -0500 Subject: BZ 6755 fix. Wait until all callbacks are finished. 2008-09-12 David Smith BZ 6755 * task_finder.c: Added 'inuse' count to know when handlers are still running. (__stp_utrace_task_finder_report_clone): If state isn't correct, detach. Increase 'inuse' count when starting, decrement when exiting. (__stp_utrace_task_finder_report_exec): Ditto. (__stp_utrace_task_finder_target_death): Ditto. (__stp_utrace_task_finder_target_quiesce): Increase 'inuse' count when starting, decrement when exiting. (__stp_utrace_task_finder_target_syscall_entry): Ditto. (__stp_utrace_task_finder_target_syscall_exit): Ditto. (stap_stop_task_finder): Wait until all callbacks are finished. --- runtime/ChangeLog | 16 ++++++++++++++ runtime/task_finder.c | 61 +++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 70 insertions(+), 7 deletions(-) diff --git a/runtime/ChangeLog b/runtime/ChangeLog index 97b1a0c0..6740ea4e 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,19 @@ +2008-09-12 David Smith + + BZ 6755 + * task_finder.c: Added 'inuse' count to know when handlers are still + running. + (__stp_utrace_task_finder_report_clone): If state isn't correct, + detach. Increase 'inuse' count when starting, decrement when + exiting. + (__stp_utrace_task_finder_report_exec): Ditto. + (__stp_utrace_task_finder_target_death): Ditto. + (__stp_utrace_task_finder_target_quiesce): Increase 'inuse' count + when starting, decrement when exiting. + (__stp_utrace_task_finder_target_syscall_entry): Ditto. + (__stp_utrace_task_finder_target_syscall_exit): Ditto. + (stap_stop_task_finder): Wait until all callbacks are finished. + 2008-09-10 Frank Ch. Eigler * runtime.h (STP_USE_FRAME_POINTER): Remove architecture #if's. diff --git a/runtime/task_finder.c b/runtime/task_finder.c index cbb10d35..493ca6f7 100644 --- a/runtime/task_finder.c +++ b/runtime/task_finder.c @@ -23,6 +23,10 @@ struct stap_task_finder_target; #define __STP_TF_STOPPING 2 #define __STP_TF_STOPPED 3 atomic_t __stp_task_finder_state = ATOMIC_INIT(__STP_TF_STARTING); +atomic_t __stp_inuse_count = ATOMIC_INIT (0); + +#define __stp_tf_handler_start() (atomic_inc(&__stp_inuse_count)) +#define __stp_tf_handler_end() (atomic_dec(&__stp_inuse_count)) #ifdef DEBUG_TASK_FINDER atomic_t __stp_attach_count = ATOMIC_INIT (0); @@ -30,7 +34,9 @@ atomic_t __stp_attach_count = ATOMIC_INIT (0); #define debug_task_finder_attach() (atomic_inc(&__stp_attach_count)) #define debug_task_finder_detach() (atomic_dec(&__stp_attach_count)) #define debug_task_finder_report() (_stp_dbug(__FUNCTION__, __LINE__, \ - "attach count: %d\n", atomic_read(&__stp_attach_count))) + "attach count: %d, inuse count: %d\n", \ + atomic_read(&__stp_attach_count), \ + atomic_read(&__stp_inuse_count))) #else #define debug_task_finder_attach() /* empty */ #define debug_task_finder_detach() /* empty */ @@ -587,17 +593,24 @@ __stp_utrace_task_finder_report_clone(enum utrace_resume_action action, char *mmpath_buf; char *mmpath; - if (atomic_read(&__stp_task_finder_state) != __STP_TF_RUNNING) - return UTRACE_RESUME; + if (atomic_read(&__stp_task_finder_state) != __STP_TF_RUNNING) { + debug_task_finder_detach(); + return UTRACE_DETACH; + } + + __stp_tf_handler_start(); // On clone, attach to the child. rc = stap_utrace_attach(child, engine->ops, 0, __STP_TASK_FINDER_EVENTS); - if (rc != 0 && rc != EPERM) + if (rc != 0 && rc != EPERM) { + __stp_tf_handler_end(); return UTRACE_RESUME; + } __stp_utrace_attach_match_tsk(parent, child, 1, (clone_flags & CLONE_THREAD) == 0); + __stp_tf_handler_end(); return UTRACE_RESUME; } @@ -622,8 +635,12 @@ __stp_utrace_task_finder_report_exec(enum utrace_resume_action action, struct stap_task_finder_target *tgt; int found_node = 0; - if (atomic_read(&__stp_task_finder_state) != __STP_TF_RUNNING) - return UTRACE_RESUME; + if (atomic_read(&__stp_task_finder_state) != __STP_TF_RUNNING) { + debug_task_finder_detach(); + return UTRACE_DETACH; + } + + __stp_tf_handler_start(); // When exec'ing, we need to let callers detach from the // parent thread (if necessary). For instance, assume @@ -646,6 +663,7 @@ __stp_utrace_task_finder_report_exec(enum utrace_resume_action action, // relative. __stp_utrace_attach_match_tsk(tsk, tsk, 1, 1); + __stp_tf_handler_end(); return UTRACE_RESUME; } @@ -682,6 +700,7 @@ __stp_utrace_task_finder_target_death(struct utrace_attached_engine *engine, return UTRACE_DETACH; } + __stp_tf_handler_start(); // The first implementation of this added a // UTRACE_EVENT(DEATH) handler to // __stp_utrace_task_finder_ops. However, dead threads don't @@ -703,6 +722,7 @@ __stp_utrace_task_finder_target_death(struct utrace_attached_engine *engine, (int)tsk->pid, rc); } } + __stp_tf_handler_end(); debug_task_finder_detach(); return UTRACE_DETACH; } @@ -727,8 +747,12 @@ __stp_utrace_task_finder_target_quiesce(enum utrace_resume_action action, return UTRACE_DETACH; } - if (tgt == NULL) + if (tgt == NULL) { + debug_task_finder_detach(); return UTRACE_DETACH; + } + + __stp_tf_handler_start(); // Turn off quiesce handling rc = utrace_set_events(tsk, engine, @@ -807,6 +831,7 @@ __stp_utrace_task_finder_target_quiesce(enum utrace_resume_action action, } utftq_out: + __stp_tf_handler_end(); return UTRACE_RESUME; } @@ -865,6 +890,7 @@ __stp_utrace_task_finder_target_syscall_entry(enum utrace_resume_action action, && syscall_no != MUNMAP_SYSCALL_NO(tsk)) return UTRACE_RESUME; + __stp_tf_handler_start(); // We need the first syscall argument to see what address // we're operating on. @@ -889,6 +915,7 @@ __stp_utrace_task_finder_target_syscall_entry(enum utrace_resume_action action, mmput(mm); } } + __stp_tf_handler_end(); return UTRACE_RESUME; } @@ -1003,6 +1030,7 @@ __stp_utrace_task_finder_target_syscall_exit(enum utrace_resume_action action, : "UNKNOWN")))), arg0, rv); #endif + __stp_tf_handler_start(); // Try to find the vma info we might have saved. if (arg0 != (unsigned long)NULL) @@ -1110,6 +1138,7 @@ __stp_utrace_task_finder_target_syscall_exit(enum utrace_resume_action action, // Cleanup by deleting the saved vma info. __stp_tf_remove_vma_entry(entry); } + __stp_tf_handler_end(); return UTRACE_RESUME; } @@ -1232,12 +1261,30 @@ stap_start_task_finder(void) static void stap_stop_task_finder(void) { +#ifdef DEBUG_TASK_FINDER + int i = 0; +#endif + atomic_set(&__stp_task_finder_state, __STP_TF_STOPPING); debug_task_finder_report(); stap_utrace_detach_ops(&__stp_utrace_task_finder_ops); __stp_task_finder_cleanup(); debug_task_finder_report(); atomic_set(&__stp_task_finder_state, __STP_TF_STOPPED); + + /* Now that all the engines are detached, make sure + * all the callbacks are finished. If they aren't, we'll + * crash the kernel when the module is removed. */ + while (atomic_read(&__stp_inuse_count) != 0) { + schedule(); +#ifdef DEBUG_TASK_FINDER + i++; +#endif + } +#ifdef DEBUG_TASK_FINDER + if (i > 0) + printk(KERN_ERR "it took %d polling loops to quit.\n", i); +#endif } -- cgit From 739828c29912961414ab42e4780bbddb35fc5278 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 12 Sep 2008 14:29:12 -0400 Subject: add gmon.out to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ad272dc6..72fca2ed 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ autom4te.* cscope.files cscope*out +gmon.out config.h config.log config.status -- cgit From 82e5a20c33f5c0746720e83a551bf499661475d1 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Fri, 12 Sep 2008 14:40:00 -0400 Subject: PR6028: use ip instead of pp for probe identification. --- ChangeLog | 6 ++++++ runtime/ChangeLog | 6 ++++++ runtime/regs-ia64.c | 8 ++++---- tapsets.cxx | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca04745f..96bf7747 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-09-12 Masami Hiramatsu + + BZ 6028 + * tapsets.cxx (dwarf_derived_probe::emit_probe_local_init): Use REG_IP + instead of pp to check probe address. + 2008-09-12 Frank Ch. Eigler GCC 4.4 (var-tracking) build-compatilibity. diff --git a/runtime/ChangeLog b/runtime/ChangeLog index 6740ea4e..6ad7e51f 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,9 @@ +2008-09-12 Masami Hiramatsu + + BZ 6028 + * regs-ia64.c (bspcache): Use REG_IP instead of pp to check probe + address. + 2008-09-12 David Smith BZ 6755 diff --git a/runtime/regs-ia64.c b/runtime/regs-ia64.c index 8ce3e4c3..b0eb9829 100644 --- a/runtime/regs-ia64.c +++ b/runtime/regs-ia64.c @@ -39,10 +39,10 @@ static void ia64_stap_get_arbsp(struct unw_frame_info *info, void *arg) * bspcache: get cached unwound address and * set a probe local cache of the offset of unwound address. */ -#define bspcache(cache, regs, pp)\ +#define bspcache(cache, regs)\ if(regs) {\ static unsigned __offset = 0; /* probe local cache */\ - static const char * __pp = NULL; /* reference probe point */\ + static void * __ip = NULL; /* reference ip */\ unsigned long *bsp;\ asm volatile("{ flushrs }\n"); /* flushrs for fixing bsp */\ bsp = (void*)ia64_getreg(_IA64_REG_AR_BSP);\ @@ -53,10 +53,10 @@ static void ia64_stap_get_arbsp(struct unw_frame_info *info, void *arg) if (pa.address != 0) {\ __offset = ia64_rse_num_regs(pa.address, bsp)\ -(regs->cr_ifs & 127);\ - __pp = (const char *)pp;\ + __ip = (void *)REG_IP(regs);\ cache = pa.address;\ }\ - } else if (pp == __pp)\ + } else if ((void *)REG_IP(regs) == __ip)\ cache = ia64_rse_skip_regs(bsp,\ -(__offset + (regs->cr_ifs & 127)));\ } diff --git a/tapsets.cxx b/tapsets.cxx index f25c671c..85505084 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -4747,7 +4747,7 @@ void dwarf_derived_probe::emit_probe_local_init(translator_output * o) { // emit bsp cache setup - o->newline() << "bspcache(c->unwaddr, c->regs, c->probe_point);"; + o->newline() << "bspcache(c->unwaddr, c->regs);"; } // ------------------------------------------------------------------------ -- cgit From d52261ec3e39326ebc7c571487f0a443903072af Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Fri, 12 Sep 2008 15:05:38 -0400 Subject: Ensure $first_stap is not empty in staprun_PATH --- stap-client | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stap-client b/stap-client index f4ccb033..0ac9bd68 100755 --- a/stap-client +++ b/stap-client @@ -659,6 +659,12 @@ function staprun_PATH { # staprun may invoke 'stap'. So we can use the current PATH if we were # not invoked as 'stap' or we are not the first 'stap' on the PATH. local first_stap=`which stap 2>/dev/null` + + if test "X$first_stap" = "X"; then + echo "$PATH" + return + fi + if test `which $0 2>/dev/null` != $first_stap; then echo "$PATH" return -- cgit From 06764a063364bfd97d168dd3d7d2621b818b3437 Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Fri, 12 Sep 2008 15:07:39 -0400 Subject: ChangeLog entry for previous commit. --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 96bf7747..ffbe0646 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-09-12 Dave Brolley + + * stap-client (staprun_PATH): Ensure that $first_stap is not empty. + 2008-09-12 Masami Hiramatsu BZ 6028 -- cgit From 9149a029841ce3447a4936610f1af8c61fe282fb Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 12 Sep 2008 16:08:28 -0400 Subject: fix bspcache regression typo --- runtime/regs-ia64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/regs-ia64.c b/runtime/regs-ia64.c index b0eb9829..f884c5f8 100644 --- a/runtime/regs-ia64.c +++ b/runtime/regs-ia64.c @@ -126,7 +126,7 @@ static void ia64_store_register(int regno, #else /* if defined __ia64__ */ -#define bspcache(cache, regs, pp) do {} while(0) +#define bspcache(cache, regs) do {} while(0) #endif /* if defined __ia64__ */ -- cgit From 5f29217589bee67f5ded4136c264a18ed3e9b34e Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Fri, 12 Sep 2008 16:32:15 -0400 Subject: Use ps to check for server startup on stap-start-server --- ChangeLog | 1 + stap-start-server | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ffbe0646..0ee737c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2008-09-12 Dave Brolley * stap-client (staprun_PATH): Ensure that $first_stap is not empty. + * stap-start-server: Use 'ps' to check that the server started. 2008-09-12 Masami Hiramatsu diff --git a/stap-start-server b/stap-start-server index eea86526..aa2850b5 100755 --- a/stap-start-server +++ b/stap-start-server @@ -19,7 +19,7 @@ server_pid=$! # Make sure the server is started for ((attempt=0; $attempt < 5; ++attempt)) do - stap-find-servers >/dev/null 2>&1 && echo $server_pid && exit 0 + (ps -a | grep $server_pid) >/dev/null 2>&1 && echo $server_pid && exit 0 sleep 1 done -- cgit From 8b524b8e33e94007b15f33546819056b56435cf2 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 12 Sep 2008 17:14:18 -0400 Subject: testsuite tweaks for rhel5 --- testsuite/ChangeLog | 5 +++++ testsuite/systemtap.base/uprobes.stp | 4 ++-- testsuite/systemtap.examples/ChangeLog | 5 +++++ testsuite/systemtap.examples/general/para-callgraph.meta | 4 ++-- testsuite/systemtap.examples/io/traceio2.stp | 4 +++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 18f04bbf..bc8af108 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-09-12 Frank Ch. Eigler + + * systemtap.base/uprobes.stp: Use printf in case pp() is long enough + to overflow MAXSTRINGLEN. + 2008-09-11 David Smith * lib/stap_run.exp: Ignore new warning. diff --git a/testsuite/systemtap.base/uprobes.stp b/testsuite/systemtap.base/uprobes.stp index 32bc1a70..b609f3a1 100755 --- a/testsuite/systemtap.base/uprobes.stp +++ b/testsuite/systemtap.base/uprobes.stp @@ -1,3 +1,3 @@ #! stap -p4 -probe process("./jennie").function("main").call { log(pp()." ".$$parms) } -probe process("./jennie").function("main").return { log(pp()." ".$$return) } +probe process("./jennie").function("main").call { printf("%s %s\n",pp(),$$parms) } +probe process("./jennie").function("main").return { printf("%s %s\n",pp(),$$return) } diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog index af641ba7..8d434357 100644 --- a/testsuite/systemtap.examples/ChangeLog +++ b/testsuite/systemtap.examples/ChangeLog @@ -1,3 +1,8 @@ +2008-09-12 Frank Ch. Eigler + + * io/traceio2.stp: Make compatible with RHEL5. + * general/para-callgraph.meta: Tweak quoting for dejagnu passage. + 2008-08-15 Frank Ch. Eigler * general/para-callgraph*: Extend. diff --git a/testsuite/systemtap.examples/general/para-callgraph.meta b/testsuite/systemtap.examples/general/para-callgraph.meta index 740ed5ce..9fcf26c6 100644 --- a/testsuite/systemtap.examples/general/para-callgraph.meta +++ b/testsuite/systemtap.examples/general/para-callgraph.meta @@ -3,5 +3,5 @@ name: para-callgraph.stp keywords: trace callgraph subsystem: general description: Print a timed per-thread callgraph, complete with function parameters and return values. The first parameter names the function probe points to trace. The optional second parameter names the probe points for trigger functions, which acts to enable tracing for only those functions that occur while the current thread is nested within the trigger. -test_check: stap -p4 para-callgraph.stp 'kernel.function("*@fs/proc*.c")' 'kernel.function("sys_read")' -test_installcheck: stap para-callgraph.stp 'kernel.function("*@fs/proc*.c")' 'kernel.function("sys_read")' -c 'cat /proc/sys/vm/*' +test_check: stap -p4 para-callgraph.stp kernel.function("*@fs/proc*.c") kernel.function("sys_read") +test_installcheck: stap para-callgraph.stp kernel.function("*@fs/proc*.c") kernel.function("sys_read") -c 'cat /proc/sys/vm/*' diff --git a/testsuite/systemtap.examples/io/traceio2.stp b/testsuite/systemtap.examples/io/traceio2.stp index 656c38b3..988ea36c 100755 --- a/testsuite/systemtap.examples/io/traceio2.stp +++ b/testsuite/systemtap.examples/io/traceio2.stp @@ -12,7 +12,9 @@ probe begin { probe kernel.function ("vfs_write"), kernel.function ("vfs_read") { - dev_nr = $file->f_path->dentry->d_inode->i_sb->s_dev + dev_nr = $file-> + %( kernel_v < "2.6.19" %? f_dentry %: f_path->dentry %) + ->d_inode->i_sb->s_dev if (dev_nr == device_of_interest) printf ("%s(%d) %s 0x%x\n", -- cgit