summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Add proc_mem_*_pid tapset function variants.Mark Wielaard2010-03-031-1/+106
| | | | | | * tapset/proc_mem.stp: Add proc_mem_size_pid, proc_mem_rss_pid, proc_mem_shr_pid, proc_mem_txt_pid, proc_mem_data_pid and proc_mem_string_pid functions to tapset.
* git_version.sh: Don't unnecessarily write to builddir during make install.Mark Wielaard2010-03-031-6/+9
| | | | | | | | | | Ideally make install wouldn't touch the src or build dirs. When the build dir is mounted so root cannot write to it a make install would fail because git_version.sh tried to create a temporary file. Fix by creating temporary git_version.h.new file in temp dir. * git_version.sh: Create temp dir and git_version.h.new outside src and build dir. Change all occurances of $outfile.new to $outfilenew.
* PR11004: try / catch error-handling script syntaxFrank Ch. Eigler2010-03-0313-13/+351
| | | | | | | | | | | | | | | * parse.h (try_block): New class. Update basic visitors. * staptree.cxx: Implement basic visitors. * parse.cxx (expect_kw): Fix to actually look for keywords. (parse_try_block): New function. (lexer ctor): Designate 'try' and 'catch' as keywords. * elaborate.cxx (dead_assignment_remover, dead_statmtexpr_remover): Optimize. (other visitors): Implement. * translate.cxx (c_unparser): Implement via super-handy __local__ labels. (emit_probe, emit_function): Make outer out: label also __local__. * testsuite/buildok/fortyone.stp, semko/fortynine.stp, systemtap.base/trycatch.exp: Test it. * NEWS, doc/langref.txt, stap.1.in: Document it.
* PR11246 cont'd: Add options for cache controlJosh Stone2010-03-025-11/+49
| | | | | | | | | | | | | | | | --disable-cache : turn off all caching --clean-cache : clean up stale entries and then quit --poison-cache : force regeneration of items that would have hit the cache These are undocumented for now, until we decide whether they are generally useful. * main.cxx (main): Parse the new options. * session.h (systemtap_session): Add poison_cache; document the others. * clean.cxx (clean_cache): No longer static. (get_stapconf_from_cache, get_script_from_cache): Respect poison. * tapsets.cxx (tracepoint_builder::get_tracequery_module): Ditto. (dwarf_cast_expanding_visitor::filter_special_modules): Ditto.
* PR11246 cont'd: Separate script/stapconf cachingJosh Stone2010-03-027-42/+69
| | | | | | | | | | | I'm separating the caching and creation logic for stapconf, so it can be conditionalized on s.use_cache instead of s.use_script_cache. * session.h (systemtap_session): Store base_hash for better reuse. * hash.cxx (get_base_hash): Get the base from the session, or build it. (find_hash): Split into separate script/stapconf versions. * cache.cxx (add_to_cache, get_from_cache): Ditto. * main.cxx (main): Adapt caller, and delay stapconf until pass-4.
* Move pass-3/4 cache checks after the reported pass-2 endJosh Stone2010-03-021-8/+9
| | | | * main.cxx (main): Reorganize the end of pass-2 a bit.
* PR11246: Add more granular cache controlJosh Stone2010-03-024-12/+17
| | | | | | | | | | | | | | There are some module options that require us to disable caching for the script, but before now this had a global effect. There are some cache objects, like tracepoint and @cast query modules, which we would like to cache even when the script itself needs to be uncached. * session.h (systemtap_session): New use_script_cache flag. * main.cxx (main): -m & -k can just disable the script cache. Failure to create the cache directories still disables all caching. * hash.cxx (create_hashdir): Failure disables all caching. * cache.cxx (add_to_cache): Failure only toggles the script caching. If the stapconf fails though, we don't need to block the .ko reuse.
* Revise the embedded-C.stp example to something more portable.William Cohen2010-03-022-36/+28
|
* Minor clean-up in tutorial.William Cohen2010-03-021-4/+5
|
* Make the inode-watch.stp example work on newer kernels.William Cohen2010-03-022-10/+22
|
* Fixed PR 11336 by using a wait queue to wait on procfs file availability.David Smith2010-03-012-73/+56
| | | | | | | | | | | * runtime/procfs-probes.c: Removed old kernel 2.6.16 code. Simplified _spp_lock macros. (_stp_proc_open_file): If file is busy, use a wait queue to wait on it being available. (_stp_proc_release_file): Decrease open count. * tapset-procfs.cxx (emit_module_init): Updated procfs probe initialization/shutdown routine names. (emit_module_exit): Ditto.
* PR11229: Make parse_kernel_config return int and suggest that the user check ↵Charley Wang2010-03-011-2/+17
| | | | their installation of kernel devel
* Squash elision warnings on synthetic functionsJosh Stone2010-02-267-2/+18
| | | | | | | | | | | | | | * 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.
* Add package check for librpmStan Cox2010-02-262-86/+6
| | | | | * configure (have_librpm): Move to AC_CHECK_LIB * configure.ac: Regenerate.
* Add package check for librpmStan Cox2010-02-262-1/+77
| | | | | * configure (have_librpm): Define. * configure.ac: Regenerate.
* PR11075: -W option to turn warnings into errorsFrank Ch. Eigler2010-02-255-2/+25
| | | | | | | | * session.h * NEWS: Discuss it. * main.cxx: Parse it. * session.h (num_errors): Provide it. * semok/fortyeight.stp, semok/thirtyseven.stp: Test it.
* Expand the comment around @defined pass-throughJosh Stone2010-02-251-4/+6
|
* Ensure that @defined()==1 goes the right wayJosh Stone2010-02-251-10/+10
| | | | | | | We need to poison the false case of valid "@defined(x)?x:y", so we know that the @defined is correctly leading to the true case only. * testsuite/semok/thirtysix.stp: poison false in valid cases.
* Expand @defined to support more casesJosh Stone2010-02-253-1/+34
| | | | | | | | * tapsets.cxx (var_expanding_visitor::visit_defined_op): If no error was raised or replacement made on a target_symbol, then its @defined state is still indeterminate. Some later pass (like @cast) might handle it. * elaborate.cxx (const_folder::visit_defined_op): Squash any escapees. * testsuite/semok/thirtysix.stp: Add more variants.
* PR11326: Make an early check for saved-return-$var validityJosh Stone2010-02-252-36/+43
| | | | | | | | | | We now check validity *before* the entry-probe is generated, so invalid $vars have a chance to be properly optimized without error. * tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol_saved_return): Attempt variable expansion immediately, and skip out on failure. * testsuite/semok/thirtysix.stp: unblock the previously broken part.
* Fixed pr 10690 by adding '.maxsize(NNN)' procfs read probe parameter.David Smith2010-02-259-28/+439
| | | | | | | | | | | | | | | | | | | | | | * tapset-procfs.cxx (procfs_derived_probe::procfs_derived_probe): Added 'maxsize_val' initialization. (procfs_derived_probe::join_group): Updated '_stp_procfs_data' definition and added STP_PROCFS_BUFSIZE. (procfs_derived_probe_group::emit_module_decls): Emits structure to contain procfs file buffers. Initializes '.bufsize' structure member. (procfs_var_expanding_visitor::visit_target_symbol): Uses 'bufsize' for maximum buffer size instead of using MAXSTRINGLEN. (procfs_builder::build): Looks for '.maxsize(NNN)' parameter. (register_tapset_procfs): Added '.maxsize(NNN)' parameter binding. * runtime/procfs-probes.c (stap_procfs_probe): Converted 'buffer' to a pointer and added 'bufsize' member. * testsuite/semko/procfs13.stp: New testcase. * testsuite/semko/procfs14.stp: Ditto. * testsuite/semko/procfs15.stp: Ditto. * testsuite/systemtap.base/procfs_maxsize.exp: Ditto. * testsuite/systemtap.base/procfs.exp: Minor fix. * stapprobes.3stap.in: Added '.maxsize(NNN)' documentation. * stap.1.in: Added STP_PROCFS_BUFSIZE documentation.
* Merge branch 'master' of ssh://sources.redhat.com/git/systemtapCharley Wang2010-02-259-630/+49
|\
| * PR11114: simplify librpm autoconfFrank Ch. Eigler2010-02-259-630/+49
| | | | | | | | | | * configure.ac: Check for -lrpm with simple AC_CHECK_LIB. * Makefile.am: Forget about @rpm_LIBS@
* | PR11224: Documentation for module argumentsCharley Wang2010-02-252-4/+33
|/
* PR11224: added test case for module arguments in testsuite/systemtap.baseCharley Wang2010-02-252-0/+35
|
* PR11005: @defined part 2: clarify/standardize internal handling of ↵Frank Ch. Eigler2010-02-258-357/+400
| | | | | | | | | | | | | | | | | unresolvable $variables * staptree.cxx (target_symbol::chain): New function. * staptree.h: Declare it. * (*): Use it instead of hand-chaining to target_symbol->saved_conversion_error. * tapset-mark.cxx (*::visit_target_symbol): Chain resolution error object, do not throw. * tapset-procfs.cxx (*::visit_target_symbol): Ditto. * tapset-utrace.cxx (*::visit_target_symbol): Ditto. * tapsets.cxx (*::visit_target_symbol): Ditto. (*::visit_defined_op): Explain & enforce the above. * testsuite/semok/thirtysix.stp: Expand. * testsuite/systemtap.base/sdt_misc.exp: Bonus fix: make work with blddir != srcdir.
* PR10719 cont'd: const-fold binary expressionsJosh Stone2010-02-241-2/+97
| | | | | | | | We can compute results between two literals, we can reduce identity elements, and reduce constants if the non-literal side has no side effects. * elaborate.cxx (const_folder::visit_binary_expression): Implement.
* Permit chained unary operatorsJosh Stone2010-02-242-2/+8
| | | | | | | | The operand of a unary may be yet another unary. This is useful for things like boolean normalization, !!x. * parse.cxx (parser::parse_unary): Recurse the operand. * testsuite/parseok/eleven.stp: Add chained unary operators.
* PR10719 cont'd: const-fold logical opsJosh Stone2010-02-241-4/+84
| | | | | | | | | We can compute results between two literals, we can short-circuit some literals on the left ("0&&x", "1||x"), and we can simplify literals on the right if the left has no side effect ("x&&0", "x||1"). * elaborate.cxx (const_folder::visit_logical_or_expr): Implement. (const_folder::visit_logical_and_expr): Implement.
* PR10719 cont'd: const-fold comparisonsJosh Stone2010-02-231-2/+85
| | | | | | | | | | We can compute results between two literals, and we can also compute comparisons to boundary numbers. (We could also check boundary strings, "" and "\377\377...", but even I am not THAT pedantic... yet...) * elaborate.cxx (const_folder::visit_comparison): Implement.
* PR10719 cont'd: const-fold string concatenationJosh Stone2010-02-231-2/+24
| | | | | | We can concat literal strings directly and discard empty strings. * elaborate.cxx (const_folder::visit_concatenation): Implement.
* Merge branch 'master' of ssh://sources.redhat.com/git/systemtapFrank Ch. Eigler2010-02-2315-58/+392
|\ | | | | | | | | | | | | | | | | | | | | | | * 'master' of ssh://sources.redhat.com/git/systemtap: PR10719 part 1: Partial constant folding Simplify null_statement construction Fixed PR 11269 by properly handling mmap syscall 'fd' argument. Removed rvalue operator check. PR 10690 (partial fix). Handle '.=' operator in procfs probes. Conflicts: tapsets.h
| * PR10719 part 1: Partial constant foldingJosh Stone2010-02-231-0/+227
| | | | | | | | | | | | | | | | | | This implements constant folding for if/for/foreach, unary expressions, and ternary expressions. Binary expressions are TODO... * elaborate.cxx (const_folder): New visitor to collapse constants. (semantic_pass_const_fold): Drive everything through const_folder. (semantic_pass_optimize1): Call it.
| * Simplify null_statement constructionJosh Stone2010-02-234-11/+18
| | | | | | | | It only needs a token*, so build that into the constructor.
| * Fixed PR 11269 by properly handling mmap syscall 'fd' argument.David Smith2010-02-238-26/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * testsuite/systemtap.syscall/mmap.c (main): Added mprotect and mremap testing (along with testing of anonymous maps). * tapset/i386/syscalls.stp: In mmap probes, handle the fact that the kernel gets an unsigned long 'fd', but the user-side passes a signed int. * tapset/i386/nd_syscalls.stp: Ditto. * tapset/ia64/syscalls.stp: Ditto. * tapset/powerpc/nd_syscalls.stp: Ditto. * tapset/powerpc/syscalls.stp: Ditto. * tapset/x86_64/nd_syscalls.stp: Ditto. * tapset/x86_64/syscalls.stp: Ditto.
| * Removed rvalue operator check.David Smith2010-02-231-12/+4
| | | | | | | | | | * tapset-procfs.cxx (procfs_var_expanding_visitor::visit_target_symbol): Removed unneeded rvalue operator check.
| * PR 10690 (partial fix). Handle '.=' operator in procfs probes.David Smith2010-02-233-21/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tapsets.h (var_expanding_visitor): Add 'valid_ops' and 'op' member variables. * tapsets.cxx (var_expanding_visitor::var_expanding_visitor): Set 'valid_ops' to '='. By default, var_expanding_visitor classes only handle the '=' operator. (var_expanding_visitor::visit_assignment): Remember what operator we're handling. When an operator is found that isn't in the 'valid_ops' set, error. * tapset-procfs.cxx (procfs_var_expanding_visitor::procfs_var_expanding_visitor): Add '.=' to the 'valid_ops' set. (procfs_var_expanding_visitor::visit_target_symbol): Handle the '.=' operator when the target variable is an lvalue.
* | PR11005: @defined($tvar) predicate, part 1Frank Ch. Eigler2010-02-2312-64/+302
|/ | | | | | | | | | | | | | | | | | * staptree.h (defined_op): New class. * all files: Extend all visitors as appropriate, mostly dummy/pass-through implementation. * parse.cxx (parse_target_symbol): New function, factored out of parse_symbol(). (parse_define_op): New function. * NEWS: Mention it. * parse.h: Corresponding changes. * tapsets.cxx (var_expanding_visitor::visit_defined_op): Implement @defined() semantics. (dwarf_var_expanding_visitor::visit_target_symbol): Adjust. * tapset-utrace.c (visit_target_symbol_arg): Avoid crashes on $argZZZ. * tapsets.cxx (sdt_var_expanding_visitor): Ditto. * semok/thirtysix.stp: New test.
* hashing: add in the -Werror-defeating flagFrank Ch. Eigler2010-02-221-0/+1
|
* Check for/build elfutils iff translator is enabled.Przemyslaw Pawelczyk2010-02-222-26/+30
| | | | * configure.ac: Don't bother with elfutils if $enable_translator = no.
* Prevent accidental global cleanup triggering for syscall test.tcl.Mark Wielaard2010-02-222-34/+34
| | | | | | | | | | | Later tests might trigger a cleanup and might set the global dir variable leading to the syscall test.tcl trying to do an exec rm -rf on whatever dir was set. So rename proc cleanup and global dir in syscall test.tcl to something a bit less likely to clash. * testsuite/systemtap.syscall/test.tcl: Rename proc cleanup to syscall_cleanup and global dir to syscall_dir. * testsuite/systemtap.syscall/test-debug.tcl: Likewise.
* Tweak shared attach sdt test.Stan Cox2010-02-211-40/+70
| | | | * sdt_misc.exp: Make all semaphore references from the .so
* hwbkpt: simplify diagnostics and codeFrank Ch. Eigler2010-02-212-104/+84
| | | | | | | | | | | * tapsets.cxx (hwbkpt_derivedc_probe_group): Lose max_... field. Rename hwbkpt_probes_vector -> hwbkpt_probes. (enroll): Instead set it here, emit normal suppressible warning if exceeded. (emit_*): Use newline(NN) etc. for proper indentation of generated code. (emit_module_init): Defer most potential problems to register_wide_hw_breakpoint() instead of preemptive errors. * translate.cxx (emit_module_init): Assert 0 indentation more frequently.
* Make unprivilegedok/one.stp compatible with vanilla kernelWenji Huang2010-02-211-1/+1
|
* Add explicit timeout to overflow_error testWenji Huang2010-02-211-0/+1
|
* Translator enablement of Hardware breakpoints for s390Prerna Saxena2010-02-211-2/+16
|
* hardware breakpoints: improve error messages for unsupported configurationsFrank Ch. Eigler2010-02-191-17/+22
| | | | | | * tapsets.cxx (hwbkpt_builder::build): Assert needed kernel_configs here, instead of.. (register_standard_tapsets): ... here.
* PR11208: glue adjacent string literals together.Frank Ch. Eigler2010-02-194-2/+37
| | | | | * parse.cxx (lexer::scan): Glue adjacent strings together. * testsuite/parseko/twentyseven.stp, semok/thirtyfive.stp: New tests.
* PR11275: be less verbose in case of command line option parsingFrank Ch. Eigler2010-02-191-18/+23
| | | | | * main.cxx (main): exit() instead of printing usage for most errors. Also support --help.
* Allow CONFIG_foo COMPARISON-OP CONFIG_bar in preprocessor conditionals.Mark Wielaard2010-02-192-2/+43
| | | | | | | * parse.cxx (eval_pp_conditional): If rhs and lhs are both CONFIG_... identifiers try to convert them both to numbers or otherwise threat them both as strings for eval_comparison. * testsuite/semok/config_config.stp: New test.