summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base
Commit message (Collapse)AuthorAgeFilesLines
* Added atomic_read() embedded-C function and tests.David Smith2010-04-061-12/+74
| | | | | | | | * tapset/atomic.stp: Added atomic_read(). * testsuite/buildok/atomic.stp: Added atomic_read() compile test. * testsuite/systemtap.base/atomic.exp: Added atomic_read() tests. * testsuite/lib/stap_run_error.exp (stap_run_error): Logs stap command and tries to ensure inferior process is killed.
* Add set_kernel_* bad-address testsJosh Stone2010-04-011-0/+30
| | | | * testsuite/systemtap.base/set_kernel.stp: try/catch addresses of -1.
* Test that all of the set_kernel_* functions workJosh Stone2010-04-012-0/+93
| | | | | * testsuite/buildok/set_kernel.stp: Test that all can build. * testsuite/systemtap.base/set_kernel.stp: Test that values are all set.
* Improved atomic.exp testcase by removing the need for an external module.David Smith2010-03-243-118/+21
| | | | | | | | * testsuite/systemtap.base/atomic.exp: Removed the need for the external module by putting the atomic_long_t inside the stap module. * testsuite/systemtap.base/atomic_module.c: Removed. * testsuite/systemtap.base/atomic_module.makefile: Ditto. * testsuite/lib/stap_run_error.exp (stap_run_error): Better error handling.
* testuite: modargs.exp shouldn't execute things without installcheckFrank Ch. Eigler2010-03-181-2/+5
|
* Fixed PR 11372 by removing (most) embedded-C from proc_mem.stp.David Smith2010-03-163-0/+178
| | | | | | | | | * tapset/proc_mem.stp: Tried to remove as much embedded-C as possible. * tapset/atomic.stp: New file. * testsuite/buildok/atomic.stp: New file. * testsuite/systemtap.base/atomic.exp: Ditto. * testsuite/systemtap.base/atomic_module.c: Ditto. * testsuite/systemtap.base/atomic_module.makefile: Ditto.
* Move common code from {maxmemory.exp,overload.exp} into stap_run_error.exp.David Smith2010-03-162-113/+7
| | | | | | | | * testsuite/lib/stap_run_error.exp: New file. * testsuite/config/unix.exp: Loads stap_run_error.exp. * testsuite/systemtap.base/maxmemory.exp: Uses stap_run_error function instead of local code. * testsuite/systemtap.base/overload.exp: Ditto.
* Fix the edge-case of MAXTRYLOCK=0Josh Stone2010-03-111-1/+7
| | | | | | | | | | | | | | | | | We didn't really have good semantics for what is meant by MAXTRYLOCK=0, so when skipped.exp tried it, we ended up locking the variable and then reporting a skip without ever unlocking it. This is now cleaning up the semantics such that MAXTRYLOCK defines how many times we should loop if the lock is busy. Thus MAXTRYLOCK=0 means we try only once and fail immediately. The testcase was accidentally creating contention due to the broken unlock behavior. We now have to try a bit harder to create real contention, so some lengthy delays are inserted to hoard the lock. * runtime/probe_lock.h (stp_probe_lock): Fix the skip behavior. * testsuite/systemtap.base/skipped.exp: Add a big udelay.
* Update tests to check for uprobes instead of utrace.David Smith2010-03-091-12/+13
| | | | | | | * testsuite/systemtap.context/uprobe_stmt_num.exp: Change utrace test to uprobes test. * testsuite/systemtap.context/uprobe_uaddr.exp: Ditto. * testsuite/systemtap.base/bz5274.exp: Ditto.
* PR11004: try / catch error-handling script syntaxFrank Ch. Eigler2010-03-031-0/+41
| | | | | | | | | | | | | | | * 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.
* Fixed pr 10690 by adding '.maxsize(NNN)' procfs read probe parameter.David Smith2010-02-252-1/+289
| | | | | | | | | | | | | | | | | | | | | | * 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.
* 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-251-1/+1
| | | | | | | | | | | | | | | | | 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.
* Tweak shared attach sdt test.Stan Cox2010-02-211-40/+70
| | | | * sdt_misc.exp: Make all semaphore references from the .so
* Add explicit timeout to overflow_error testWenji Huang2010-02-211-0/+1
|
* PR11296: switch to "sys/sdt.h" in test casesFrank Ch. Eigler2010-02-1811-15/+15
|
* Fixed BZ559643 by doing 'spawn;expect;wait' instead of 'spawn;wait;expect'.David Smith2010-02-081-17/+26
| | | | | | * testsuite/systemtap.base/labels.exp: Corrected order of 'spawn;expect;wait' calls. Added 'wait' calls when needed. Also, doesn't run the "labels exe .label" test if uprobes isn't supported.
* Revert "PR11234: Ensure __get_argv doesn't overflow"Josh Stone2010-02-042-67/+0
| | | | This reverts commit f75409719f120a3dbee66d761cf23a64092d1414.
* Fix procfs_write.exp so that it will pass under RHELl5.David Smith2010-02-021-2/+2
| | | | | | | * testsuite/systemtap.base/procfs_write.exp: Small changes for RHEL5 support. * testsuite/lib/stap_run.exp (stap_run): Increase maximum number of characters to match against.
* Fix uninitialization error on gcc 4.1.xWenji Huang2010-02-011-1/+1
| | | | * testsuite/systemtap.base/overflow-get_argv.stp: Initialize var.
* PR11234: Ensure __get_argv doesn't overflowJosh Stone2010-01-282-0/+67
| | | | | | | That function was calling strlcpy as if the return value was the number of bytes copied, but strlcpy actually returns the length of the input string. We now use min() to handle the case when it's bigger than the buffer length, and drop out of the loop when that happens.
* PR6954: make ++/-- operation trigger automatic global printingWenji Huang2010-01-282-2/+5
| | | | | | | * staptree.cxx (varuse_collecting_visitor::visit_arrayindex): Regard operations as pure writes. * testsuite/systemtap.base/global_end.exp: Add test case. * testsuite/systemtap.base/global_end.stp: Ditto.
* Fixed PR 11223 by null terminating strings in procfs write probes.David Smith2010-01-261-0/+135
| | | | | | * tapset-procfs.cxx (procfs_var_expanding_visitor::visit_target_symbol): Correctly null terminate strings in procfs write probes. * testsuite/systemtap.base/procfs_write.exp: New test.
* Fixed PR 11220 by setting MAP_STRING_LENGTH to MAXSTRINGLEN.David Smith2010-01-251-0/+45
| | | | | | * runtime/map.h: Set MAP_STRING_LENGTH to MAXSTRINGLEN so that large strings can be stored in arrays. * testsuite/systemtap.base/array_string.exp: New testcase.
* Relax sdt address check for attach to running process case.Stan Cox2010-01-151-3/+8
| | | | * uprobes-common.c (stap_uprobe_change_plus): Relax VM_EXEC check.
* Add attach to live process tests.Stan Cox2010-01-121-30/+169
| | | | | | | * sdt_misc.exp (sdt_misc.c): New funcs loop_check, int_handler, alrm_handler. (sdt_misc.sdt): Add timer.ms (test attach to a running process): New. (test attach to a running process with .so markers): New.
* Make sure testcase debug output is correct.David Smith2010-01-071-2/+3
| | | | | * testsuite/systemtap.base/sdt_misc.exp: Make sure debug output of what we're about to execute actually matches what we're about to execute.
* Partial PR 10848 fix. Added testcase for STP_MAXMEMORY.David Smith2010-01-071-0/+86
| | | | | | | | | * runtime/alloc.c (_stp_kmalloc): Renamed 'MAXMEMORY' to 'STP_MAXMEMORY'. (_stp_kzalloc): Ditto. (_stp_vmalloc): Ditto. (_stp_alloc_percpu): Ditto. (_stp_kmalloc_node): Ditto. * testsuite/systemtap.base/maxmemory.exp: New test for STP_MAXMEMORY.
* PR10732 declaration.exp empty-struct fails, resolve-fail passes erroneously.Mark Wielaard2010-01-051-20/+0
| | | | * testsuite/systemtap.base/declaration.exp: Remove test.
* Purge sdt utrace support.Stan Cox2010-01-042-4/+4
| | | | | | | | | | | | | | | * sdt.h (UTRACE_SDT): Remove. * tapset-utrace.cxx (utrace_derived_probe): Remove has_library and library. (utrace_derived_probe_group::emit_probe_decl): Remove mmap_callback, sdt_sem_offset, and sdt_sem_address. (utrace_derived_probe_group::emit_module_decls): Remove sdt_sem_offset and sdt_sem_address support. * tapsets.cxx (sdt_var_expanding_visitor): Remove utrace_probe. (sdt_query::handle_query_module) Remove utrace_type. (sdt_query::convert_probe): Likewise. * postgres.exp: Remove utrace testing. * sdt.exp: Likewise. * sdt_misc.exp: Likewise.
* Extend skipped.exp test timeout for slower machines.Mark Wielaard2009-12-281-1/+1
|
* Fix test output for PR10849 make MAXSKIPPED overflow trigger an error messageMark Wielaard2009-12-281-5/+8
|
* XFAIL PR10732 declaration.exp empty-struct always fails.Mark Wielaard2009-12-281-0/+1
|
* Remove externalvar.exp .exe and .so after test done.Mark Wielaard2009-12-191-1/+1
|
* Add .library("lib").mark("mark") and use it for .mark semaphores.Stan Cox2009-12-081-38/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | tapset-utrace.cxx (TOK_LIBRARY): New. (utrace_derived_probe::utrace_derived_probe): Add library and has_library. (utrace_builder::build): Handle library. (utrace_derived_probe_group::emit_probe_decl): Add sdt_sem_offset to emitted stap_utrace_probes. Add stap_task_finder_target mmap_callback for handling shared library. Handle sdt_sem_offset in emitted_stp_utrace_probe_cb. Add stap_utrace_mmap_found. (register_tapset_utrace): Handle .library tapset-utrace.cxx (TOK_LIBRARY): New. (base_query::base_query): Add path and has_library. (dwarf_derived_probe::dwarf_derived_probe) Likewise. (dwarf_derived_probe::register_patterns): Handle .library (sdt_query::convert_location): Likewise. (dwarf_builder::build): Likewise. (uprobe_derived_probe_group::emit_module_decls): Emit sdt_sem_address. Add sdt_sem_offset to emitted stap_uprobe_spec. Add offset and vm_flags to signature of stap_uprobe_change_plus, and handle sdt_sem_offset. Allow writeable segments in emitted stap_uprobe_mmap_found. sdt_misc.exp: Test .library util.cxx (find_executable): Add env_path to sig and use it in getenv. util.h (find_executable): Likewise. Make "PATH" the default. dtrace.in (provider): Turn on semaphores. sdt.h: Likewise.
* Add dtrace -I support.Mark Wielaard2009-12-081-13/+59
| | | | | | | | dtrace -I is used to pass through include paths to cpp when run. Thanks to David Malcolm <dmalcolm@redhat.com> for python coding and testing. * dtrace.in: Add -I support. * testsuite/systemtap.base/dtrace.exp: Add testcases for -C -I and -G -I.
* Tweak cu-decl testWenji Huang2009-11-231-3/+5
| | | | | * testsuite/systemtap.base/cu-decl.exp: Check utrace. * testsuite/lib/stap_compile.exp: Make catch after wait.
* Test cross-CU type discoveryJosh Stone2009-11-173-0/+50
| | | | | Check that we can dereference a type declaration that is defined in a separate CU from the function.
* Add testcase for retrieving $global vars from execs and shared libs.Mark Wielaard2009-11-164-0/+204
| | | | | | | | | Explicit testcase for PR10010 and PR10622. * testsuite/systemtap.base/externalvar.c: New file. * testsuite/systemtap.base/externalvar.exp: New file. * testsuite/systemtap.base/externalvar.stp: New file. * testsuite/systemtap.base/externalvar_lib.c: New file.
* PR5916: Exploit kretprobe data storage areaJosh Stone2009-11-102-0/+74
| | | | | | | | | | | | | | | | | | | | Since 2.6.25, kretprobes can carry a data packet to be filled in an entry_handler. This patch lets us store our implicitly-saved $target variables in .return probes in that data area. * tapset/kretprobe.stp: New get/set functions for kretprobe data. * translate.cxx (c_unparser::emit_common_header): Add context->pi_longs. * tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol_saved_return): Switch between the old and new methods of saving $vars in .return probes. (dwarf_var_expanding_visitor::gen_mapped_saved_return): The old way. (dwarf_var_expanding_visitor::gen_kretprobe_saved_return): The new way. (dwarf_derived_probe::join_group): Don't register paired entry-handlers. (dwarf_derived_probe::dwarf_derived_probe): Remember saved-var details. (dwarf_derived_probe_group::emit_module_decls): Output saved-var details. Also split the kretprobe handler whether we're on entry or return. (dwarf_derived_probe_group::emit_module_init): Prepare the entry handler. * testsuite/systemtap.base/kretprobe-vars.stp: Test implicit $var saving.
* reorganize app tests; rewrite tcl as sample of improvementsFrank Ch. Eigler2009-10-314-808/+0
| | | | | | | | | | | | | | | * testsuite/configure.ac (--enable-testapps): New option. * testsuite/Makefile.am (TESTAPPS): Pass to dejagnu. * testsuite/systemtap.base/{xulrunner,tcl,mysql,postgres}: Moved under new systemtap.apps/ subdirectory. * testsuite/systemtap.apps/stap-tcl.sh: New file to build tcl. * testsuite/systemtap.apps/stap-tcl.stp: New file to test tcl. * testsuite/systemtap.apps/tcl.exp: New simplified test driver. * dtrace.in: Disable STAP_HAS_SEMAPHORES as they don't work on shlibs yet. * includes/sys/sdt.h (STAP_SEMAPHORE): Include __builtin_expect for unlikely.
* Properly close the spawn of the pr10854 testcaseJosh Stone2009-10-271-0/+1
|
* PR10854 cont'd: Add a testcase for the reproducerJosh Stone2009-10-272-0/+51
|
* PR 10822 fixed by waiting for the procfs file.David Smith2009-10-221-1/+19
| | | | | * testsuite/systemtap.base/onoffprobe.exp: Wait for up to 10 seconds for the procfs file to be created.
* Added testsuite to test xulrunner sdt markers.Stan Cox2009-10-204-3/+136
| | | | | | | xulrunner.exp: New testsuite, modelled after mysql.exp. mysql.exp (stap-mysql.sh): Use installed stap. postgres.exp (stap-mysql.sh): Use installed stap. tcl.exp (stap-mysql.sh): Use installed stap.
* tcl.exp path fix.Stan Cox2009-10-201-1/+1
| | | | tcl.exp (run_tests): Fix stap path.
* Add testsuite for tcl sdt markers.Stan Cox2009-10-191-0/+165
| | | | | dtrace.in (provider::generate): Set enabled to true until .so is resolved. tcl.exp: New testsuite for tcl sdt markers modelled after mysql.
* PR10746: update test cases related to probe process.*Wenji Huang2009-10-143-6/+19
| | | | | | | | * testsuite/semok/utrace01.stp: Switch by CONFIG_UTRACE. * testsuite/systemtap.base/bz10294.stp: Ditto. * testsuite/systemtap.base/bz6905.stp: Ditto. * testsuite/systemtap.base/statement.exp: Mark untested if non-utrace kernel.
* PR10726 remove testcase workaround.Mark Wielaard2009-10-061-3/+1
| | | | | * testsuite/systemtap.base/const_value.c: Allow inlining since PR10726 was fixed.
* PR10739 testcase. Split const_value test in two. Absolute const addr fails.Mark Wielaard2009-10-064-7/+68
| | | | | | | | * testsuite/systemtap.base/const_value.exp: Handle both const_value blocks and address separately. XFAIL second test as PR10739. * testsuite/systemtap.base/const_value.stp: Only query baz const value. * testsuite/systemtap.base/const_value_func.c: New test for bar address. * testsuite/systemtap.base/const_value_func.stp: Likewise.