diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | elaborate.cxx | 2 | ||||
-rw-r--r-- | tapset/ChangeLog | 4 | ||||
-rw-r--r-- | tapset/signal.stp | 47 | ||||
-rw-r--r-- | tapsets.cxx | 9 | ||||
-rw-r--r-- | testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | testsuite/lib/stap_run.exp | 1 | ||||
-rw-r--r-- | testsuite/systemtap.base/uprobes.exp | 5 | ||||
-rwxr-xr-x | testsuite/systemtap.base/uprobes.stp | 4 | ||||
-rw-r--r-- | translate.cxx | 5 |
10 files changed, 62 insertions, 35 deletions
@@ -5,6 +5,17 @@ on calls to 'expr'. * systemtap.spec: client and server sub packages require avahi. +2008-09-12 Wenji Huang <wenji.huang@oracle.com> + + * elaborate.cxx (add_global_var_display): Don't, in listing mode. + +2008-09-11 Frank Ch. Eigler <fche@elastic.org> + + 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 <joshua.i.stone@intel.com> * main.cxx (printscript): Ensure no variables are printed in probe lists 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<s.probes.size(); i++) { diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 3e2ebaf7..97801a20 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,7 @@ +2008-09-12 Wenji Huang <wenji.huang@oracle.com> + + * signal.stp: Initialize __sig in a function. + 2008-09-09 Masami Hiramatsu <mhiramat@redhat.com> * 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] } 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); diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 288705b1..18f04bbf 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2008-09-11 David Smith <dsmith@redhat.com> + + * lib/stap_run.exp: Ignore new warning. + +2008-09-11 Frank Ch. Eigler <fche@elastic.org> + + PR 6871. + * systemtap.base/uprobes.*: Energize. + 2008-09-10 Josh Stone <joshua.i.stone@intel.com> * systemtap.base/probe_list.exp: New test for correct probe listing. 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} 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) } 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++) |