From 59de45f155d78e08f55e5ee5e16c24af40f20e5a Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 26 Feb 2010 16:25:45 -0800 Subject: Squash elision warnings on synthetic functions * staptree.h (functiondecl): Add a synthetic flag. * elaborate.cxx (semantic_pass_opt1): Don't warn about synthetic funcs. * tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol): Mark the new function as synthetic. (dwarf_cast_expanding_visitor::visit_cast_op): Ditto. (tracepoint_var_expanding_visitor::visit_target_symbol_arg): Ditto. * tapset-perfmon.cxx (perfmon_var_expanding_visitor::visit_target_symbol): Ditto. * tapset-procfs.cxx (procfs_var_expanding_visitor::visit_target_symbol): Ditto. * testsuite/semok/thirtyeight.stp: New check with -W and @defined. --- testsuite/semok/thirtyeight.stp | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 testsuite/semok/thirtyeight.stp (limited to 'testsuite') diff --git a/testsuite/semok/thirtyeight.stp b/testsuite/semok/thirtyeight.stp new file mode 100755 index 00000000..aedbab08 --- /dev/null +++ b/testsuite/semok/thirtyeight.stp @@ -0,0 +1,10 @@ +#! stap -Wp2 + +# Each of the @defined should be a valid symbol, and sometimes their expansion +# leads to a new function declaration. We don't want to get warnings when such +# functions turn out to be unused and are elided. + +probe kernel.function("sys_open") { println(@defined($mode) ? 1 : $nosuchvar) } +probe kernel.trace("sched_switch")? { println(@defined($next->pid) ? 1 : $nosuchvar) } +probe procfs.write { println(@defined($value) ? 1 : $nosuchvar) } +probe begin { println(@defined(@cast(0, "task_struct")->pid) ? 1 : $nosuchvar) } -- cgit