summaryrefslogtreecommitdiffstats
path: root/runtime
Commit message (Collapse)AuthorAgeFilesLines
* PR 9940. Rearchitected task_finder.c a bit.David Smith2009-04-072-298/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-04-07 David Smith <dsmith@redhat.com> PR 9940. * tapsets.cxx (emit_vma_callback_probe_decl): Initialized new callbacks. (utrace_derived_probe_group::emit_probe_decl): Ditto. (uprobe_derived_probe_group::emit_module_decls): Uses new callback. Makes sure mapping is executable before trying to set a probe in it. (itrace_derived_probe_group::emit_module_init): Calls _stp_sym_init(). (utrace_derived_probe_group::emit_module_init): Ditto. (uprobe_derived_probe_group::emit_module_init): Ditto. * runtime/sym.c: Moved task_finder_vma.c inclusion here from task_finder.c. (_stp_sym_init): New function. (_stp_tf_mmap_cb): New function that replaces _stp_tf_vm_cb. (_stp_tf_munmap_cb): Ditto. * runtime/task_finder.c: Removed task_finder_vma.c inclusion. Split vm_callback into 3 callbacks: mmap_callback, munmap_callback, and mprotect_callback. (stap_register_task_finder_target): Initializes new events variables for the new callbacks. (__STP_TASK_VM_BASE_EVENTS): No longer specifies syscall entry events. (__stp_call_mmap_callbacks): New function. (__stp_call_mmap_callbacks_with_vma): Ditto. (__stp_call_munmap_callbacks): Ditto. (__stp_call_mprotect_callbacks): Ditto. (__stp_call_vm_callbacks): Removed. (__stp_utrace_task_finder_target_quiesce): Calls __stp_call_mmap_callbacks() instead of __stp_call_vm_callbacks(). (__stp_utrace_task_finder_target_syscall_entry): Removed function. (__stp_utrace_task_finder_target_syscall_exit): Reports raw mmap()/mprotect()/munmap() events.
* PR10032: Trigger cleanup after relay thread errorsJosh Stone2009-04-032-10/+25
| | | | | | When the relay threads encounter an error, they now send SIGTERM to the rest of the process before the thread exit, so we get a clean shutdown. For EPIPE in particular, error messages are also suppressed.
* Add a .gitignore for uprobesJosh Stone2009-04-021-0/+7
|
* Really fix run-stap this time, I promise!Josh Stone2009-04-021-1/+14
|
* Fix strftime format bugMasami Hiramatsu2009-04-021-3/+6
| | | | | This fixes bugs in strftime-subset function. This modifies %C, %l and %j to fit the output of date command.
* Fix a bug in file size limitation code.Masami Hiramatsu2009-04-022-3/+3
| | | | | | | | | This fixes a bug in stapio, which checks written data size and switches new file when it exceeds a limit. The problem is that written-data-size counter ignores the first written-data size when switching files. So, actual file size always exceeds the limit. This changes stapio to initialize written-data-size counter with the size of the data which will be written in new file.
* Reorder includes so regs.c and regs-ia64.c included before task_finder.c.William Cohen2009-04-021-0/+2
|
* Revert "runtime/syscall.h: Forward declare __ia64_fetch_register."William Cohen2009-04-021-3/+0
| | | | This reverts commit 49be62cc7130e60947bbae90b6bf177e173c8b29.
* runtime/syscall.h: Forward declare __ia64_fetch_register.Mark Wielaard2009-04-021-0/+3
|
* PR6580: Implement symname, symdata and modname context functions.Mark Wielaard2009-04-021-7/+19
| | | | | | | | | | | | | | | | | | This adds a couple of the suggested context/stack revamp functions from PR6580. In particular it replaces the symbolname() function that sneaked in with the pr6866 branch merge with the suggested symname(). * runtime/sym.c (_stp_mod_sec_lookup): Make section optional. (_stp_symbol_snprint): Provide a way to get optional module info. * tapset/context-symbols.stp: Replace symbolname() with symname(), add modname() and symdata(). (probemod): Implement pc based fallback. * tapset/context-unwind.stp (caller): Adjust for _stp_symbol_snprint change. * testsuite/systemtap.context/usymbols.exp: Use new symname. * testsuite/buildok/modname.stp: New test. * testsuite/buildok/symdata.stp: Likewise. * testsuite/buildok/symname.stp: Likewise.
* Make task_finder.c compiler if ! defined (CONFIG_UTRACE).Mark Wielaard2009-04-021-2/+28
| | | | | | | * runtime/task-finder.c: If ! defined (CONFIG_UTRACE) define dummy noop API for sym.c consisting of struct stap_task_finder_target, stap_add_vma_map_info, stap_remove_vma_map_info and stap_find_vma_map_info.
* PR10019: --skip-badvars to suppress run-time memory errors tooFrank Ch. Eigler2009-04-011-1/+5
| | | | | | | | * NEWS: Note this change. * hash.cxx (find_script_hash): Add s.skip_badvars into hash. * translate.cxx (translate_pass): Emit STP_SKIP_BADVARS. * runtime/loc2c-runtime.h (DEREF_FAULT, STORE_DEREF_FAULT): Provide dummy implementation if STP_SKIP_BADVARS.
* Revert "Fix runtime/itrace.c to call arch_has_*_step() prior to calling ↵Josh Stone2009-04-011-13/+0
| | | | | | utrace_control" This reverts commit 489afa702639fd10e9756795bd516d939766247d.
* Fix runtime/itrace.c to call arch_has_*_step() prior to calling utrace_controlMaynard Johnson2009-04-011-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | As Roland pointed out in his Mar 31 reply to a posting of mine (subject: Re: Testing insn.block probe point uncovers possible utrace bug), utrace_control() documents that the caller must ensure that arch_has_single_step and arch_has_block_step are defined before trying to use those step modes. The attached patch addresses that issue. I've tested this patch on x86_64 arch, and a block step test runs successfully, since block step is supported on that arch. Testing on ppc64 arch, the test fails as expected (since block step is not supported on ppc64 yet) with: "ERROR: callback for <pid> failed: 1" which is sent to stdderr and "usr_itrace_init: arch does not support block step mode" which is sent to the system log. This isn't the most user-friendly way of surfacing an error. Perhaps the stap runtime could have a set of defined return codes that would be mapped to strings so the user can get an idea of what the error is without looking in the system log. But that's a side issue, of course. Regards, -Maynard
* Merge branch 'master' into pr6866Mark Wielaard2009-04-017-34/+683
|\
| * PR4105: support up to 9 (up from 5) array index dimensionsFrank Ch. Eigler2009-04-012-0/+634
| | | | | | | | | | | | | | | | * runtime/map-gen.c, pmap-gen.c: Hand-expand arity 6..9 cases throughout. * testsuite/buildok/thirty.stp: New test. * testsuite/buildko/two.stp: New test. An Alan Smithee patch.
| * PR9998: new config and test filesWenji Huang2009-03-301-0/+5
| | | | | | | | | | | | * runtime/autoconf-x86-gs.c : New file. * testsuite/systemtap.base/x86_gs.exp : New test case. * testsuite/systemtap.base/x86_gs.stp : Ditto.
| * PR10001: Use the kernel's strlcpy & strlcatJosh Stone2009-03-261-16/+5
| | | | | | | | | | | | We had our own implementations of these which were triggering gcc bug38480 in some particular cases. It's easier for us to use the kernel's strlcpy and strlcat anyway, which avoids the bug.
| * Fix for CVE-2009-0784: stapusr module-path checking raceFrank Ch. Eigler2009-03-251-0/+9
| | | | | | | | | | * runtime/staprun/staprun_funcs.c (check_path): Save fully canonicalized and checked module path for later loading.
| * Revert "PR9940: avoid duplicated calling of uprobes in shared libraries"Frank Ch. Eigler2009-03-241-4/+2
| | | | | | | | | | | | | | | | | | | | This fix caused a regression on fedora. stap -ve 'probe process("/bin/ls").function("main") { log(pp()); } probe process("/lib64/libc.so.6").function("*") { log(pp()); }' \ -c /bin/ls hung (with stapio & ls processes spinning) upon startup.
| * itrace: zap "usr_itrace_init: completed for tid = NNNN" debug messageFrank Ch. Eigler2009-03-241-1/+2
| |
| * PR 9989 fix.David Smith2009-03-241-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-03-24 David Smith <dsmith@redhat.com> PR 9989. * runtime/task_finder.c (stap_utrace_detach): Ignores -EINPROGRESS. (stap_utrace_detach_ops): Ignores errors from stap_utrace_detach(), so that other tasks will get detached from this utrace engine. (__stp_utrace_attach): Better error handling from utrace_barrier(). (__stp_utrace_task_finder_target_quiesce): Ditto.
* | Merge branch 'master' into pr6866Mark Wielaard2009-03-2210-37/+548
|\|
| * PR9974: adapt to utrace_connected_engine -> utrace_engineFrank Ch. Eigler2009-03-225-0/+28
| | | | | | | | | | | | Adjusted all headers that #include <linux/utrace.h> to follow with: /* PR9974: Adapt to struct renaming. */
| * PR9821: staprun supports subset of strftime.Masami Hiramatsu2009-03-204-32/+232
| | | | | | | | | | Add strftime subset format support for output file name to systemtap. This format will be evaluated when opening a new output file.
| * PR6930: stapio: support file switchingMasami Hiramatsu2009-03-205-17/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add file-switching option(-S size[,N]) to stapio. This option has two arguments, 'size' and 'N', and requires -o option. - When the size of output file exceeds specified 'size'MB, staprun switches output file to the next file. For this purpose, all output file has a serial number as a suffix only when user specifies this option. - Using this option in bulk mode, the output file name will be 'FILE_cpuX.SERIAL'. - When the number of files exceeds specified N, staprun removes the oldest file. This argument can be omitted.
| * PR6930: stapio: run in background as a daemonMasami Hiramatsu2009-03-203-4/+84
| | | | | | | | | | | | | | Add '-D'(daemon mode) option to staprun/stapio for daemon mode. In this mode, stapio shows just its pid and detachs from console. Since it has no stdio, this mode requires -o option. stapio will exit when it receives SIGTERM or detects some error.
| * PR6930: staprun: supports error message to syslogMasami Hiramatsu2009-03-203-8/+33
| | | | | | | | | | Add an interface (eprintf) to output error messages to syslogd, because staprun has no stderr after detaching from console.
* | Move _stp_tf_vm_cb to sym.c.Mark Wielaard2009-03-201-0/+34
| | | | | | | | | | | | * tapsets.cxx (utrace_derived_probe_group::emit_module_decls): Remove output task finder vma callback _stp_tf_vm_cb. * runtime/sym.c (_stp_tf_vm_cb): And add it here.
* | Merge branch 'master' into pr6866Mark Wielaard2009-03-204-10/+61
|\|
| * PR9940: avoid duplicated calling of uprobes in shared librariesWenji Huang2009-03-191-2/+4
| | | | | | | | | | | | | | Add map_p argument to __stp_call_vm_callbacks_with_vma to well tune the vma callback. Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
| * start of rhel5 compatibility for itraceFrank Ch. Eigler2009-03-192-2/+49
| |
| * add runtime/autoconf magic for itrace on pre-find_task_by_vpid kernelsFrank Ch. Eigler2009-03-191-0/+6
| |
| * Fix for spinlock bad magic error with itrace probe pointMaynard Johnson2009-03-181-6/+2
| |
* | Remove __stp_tf_vm_cb from task_finder interface.Mark Wielaard2009-03-191-34/+0
| | | | | | | | | | | | * runtime/task_finder.c (__stp_tf_vm_cb): Removed. * tapsets.cxx (utrace_derived_probe_group::emit_module_decls): Output task finder vma callback and hook it.
* | Initialize user and vm_start before use.Mark Wielaard2009-03-191-3/+2
| | | | | | | | * runtime/sym.c (_stp_mod_sec_lookup): Initialize user and vm_start.
* | Get rid of __stp_tf_get_vma_entry_addr function.Mark Wielaard2009-03-192-43/+25
| | | | | | | | | | | | | | | | * runtime/task_finder_vma.c (__stp_tf_get_vma_entry_addr): Deleted. (struct __stp_tf_vma_entry): Replace module by user void* field. (stap_add_vma_map_info): Take a void *user arg. (stap_find_vma_map_info): Take a void **user arg. * runtime/sym.c (_stp_mod_sec_lookup): Use stap_find_vma_map_info.
* | Replace mutex in task_finder_vma with rwlock to be interrupt context safe.Mark Wielaard2009-03-181-31/+51
| | | | | | | | | | * runtime/task_finder_vma.c: Replace all mutex calls with appropriate read or write (un)lock calls.
* | Merge branch 'master' into pr6866Mark Wielaard2009-03-181-1/+0
|\|
| * Don't mutex_unlock in __stp_tf_get_vma_map_entry_internal.Mark Wielaard2009-03-181-1/+0
| | | | | | | | | | | | | | | | | | All callers of __stp_tf_get_vma_map_entry_internal lock and unlock the mutex correctly themselves in all cases. This unlock would trigger a double unlock. * runtime/task_finder_vma.c (__stp_tf_get_vma_map_entry_internal): Don't mutex_unlock(&__stp_tf_vma_mutex).
* | Merge branch 'master' into pr6866Mark Wielaard2009-03-1718-149/+210
|\| | | | | | | | | Resolved conflicts: runtime/task_finder.c: name vs path.
| * Get the canonical path of the main file for comparison at runtime.Mark Wielaard2009-03-172-1/+2
| | | | | | | | | | | | | | | | | | When given directly by the user through -d or in case of the kernel name and path might differ. path should be used for matching. * runtime/sym.h (_stp_module): Add path field. * runtime/task_finder.c (__stp_tf_vm_cb): Use module path to compare vm_path. * translate.cxx (dump_unwindsyms): Output canonical path.
| * PR9951: Prevent GCC warnings in deref()Josh Stone2009-03-161-6/+5
| | | | | | | | | | | | | | | | | | In some configurations, GCC was warning about a possible use of _v in the deref macros. I could not reproduce the error, but the only case where _v is not written is if lookup_bad_addr rejects the address, in which case we will hit DEREF_FAULT and _v won't be used. Now we're priming _v=0 anyway, so GCC has no right to complain...
| * Move vma module tracking from pr6866 branch to master.Mark Wielaard2009-03-152-7/+45
| | | | | | | | | | | | | | | | | | | | | | | | * tapsets.cxx (utrace_derived_probe_group::emit_module_decls): Always emit vm callback probe for __stp_tf_vm_cb. * runtime/task_finder.c (__stp_tf_vm_cb): Always expose, move _stp_dbug statements under ifdef DEBUG_TASK_FINDER_VMA. Find and record corresponding module when vm_path not NULL. * runtime/task_finder_vma.c (struct __stp_tf_vma_entry): Add _stp_module. (stap_add_vma_map_info): Add _stp_module argument and assign. (__stp_tf_get_vma_entry_addr): New static function to get the __stp_tf_vma_entry given an address.
| * Move lookup_bad_addr call in STAPCONF_PROBE_KERNELJosh Stone2009-03-131-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With most of the implementations, kread/kwrite call deref/store_deref, and so it makes sense to have lookup_bad_addr in the latter as an underlying address check. However, in the STAPCONF_PROBE_KERNEL case that uses probe_kernel_read and probe_kernel_write, the roles are reversed, so lookup_bad_addr needs to be in kread/kwrite. Also note that __deref_bad and __store_deref_bad should only be used in cases that can be determined at compile time. These turn into invalid symbols which prevent the module from loading. (They might be better replaced with compile-time assertions.)
| * PR9947: move runtime cleanup out of the work queueJosh Stone2009-03-134-8/+35
| | | | | | | | | | | | | | | | | | | | | | | | The kernel lockdep checking found a possible deadlock if a forced rmmod tried to destroy _stp_work_queue at the same time that the work queue was unregistering tracepoints. An unlikely scenario, but still possible. Now the work queue will just issue a STP_REQUEST_EXIT down to usermode, and usermode will echo back an STP_EXIT that triggers the actual probe cleanup. This way the unregistrations are happening in exactly the same context as the registrations were.
| * Adapt to linux-next commit changing __alloc_percpu API.Frank Ch. Eigler2009-03-082-22/+9
| | | | | | | | | | After linux-next commit f2a8205c, it takes two parameters again, so we autoconf for it rather than use KERNEL_VERSION ifdefs.
| * stap autoconf test for kernel stack trace supportTim Moore2009-03-044-6/+27
| | | | | | | | | | | | | | | | | | | | * buildrun.cxx (compile_pass): Add autoconf line for stack trace test, which defines STAPCONF_KERNEL_STACKTRACE. * runtime/autoconf-save-stack-trace.c: New file. * runtime/stack.c : Use STAPCONF_KERNEL_STACKTRACE instead of tests for kernel configuration and versions. * runtime/stack-i386.c : ditto * runtime/stack-x86_64.c : ditto
| * This patch updates the itrace code to support the new utrace interface.Maynard Johnson2009-03-031-29/+117
| | | | | | | | | | It also adds a private copy of access_process_vm to runtime/itrace.c since that function is not consistently exported by all distros.
| * PR9875: Remove sduprobesWenji Huang2009-03-031-61/+0
| | | | | | | | | | | | | | | | | | | | | | | | Impact: cleanup Since sdt.h is in git tree, sduprobes is no longer needed. * Makefile.am: Remove sduprobes. * Makefile.in: Regenerated. * doc/Makefile.in: Ditto. * runtime/sduprobes.c: Removed. Signed-off-by: Wenji Huang <wenji.huang@oracle.com>