| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* runtime/staprun/mainloop.c (stp_main_loop): Switched to unbuffered
output (instead of line buffered output).
|
|
|
|
|
|
| |
This patch just make the RC=1 when any output line starts with ERROR:.
Also some minors error that was returning 0 instead of 1 were fixed.
|
|
|
|
|
| |
* runtime/transport/transport.h: Removed extra declarations of
_stp_transport_init() and _stp_transport_close().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We had a race where the probe setup could be called during/after the
probe shutdown in abnormal circumstances, which leads to kernel
callbacks still registered after module unload. (BOOM)
Now the setup/shutdown activities and related flags are guarded by a
mutex, so we should have strict ordering.
* runtime/transport/transport.c (_stp_transport_mutex): New.
(_stp_handle_start): Grab the mutex, and make sure we're not exiting.
(_stp_cleanup_and_exit): Grab the mutex.
(_stp_lock_inode, _stp_unlock_inode): Use kernel version for checking
inode locking type.
|
|
|
|
|
|
|
|
|
|
|
|
| |
For scripts with thousands of probes, we save a fair amount of code-gen
time in pass-4 by having the common locking code extracted into shared
functions.
* runtime/probe_lock.h (stp_lock_probe, stp_unlock_probe): New.
* translate.cxx (c_unparser::emit_lock_decls): New, emits a static
const array of locks needed for each probe.
(c_unparser::emit_locks): Just call stp_lock_probe.
(c_unparser::emit_unlocks): Just call stp_unlock_probe.
|
|
|
|
|
| |
* runtime/unwind.c (processCFI): Fail if the number of instructions is
larger than MAX_CFI (currently 512).
|
|
|
|
|
| |
* runtime/unwind.c (unwind_frame): Check end read from cie or fde doesn't
go passed end of unwind table.
|
|
|
|
|
|
| |
* runtime/unwind.c (cie_for_fde): Take table and table_len into account.
(fde_pointer_type): Likewise.
* runtime/unwind/unwind.h: Adjust function prototypes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Guided by pahole, I've shaved off a few padding bytes here and there.
New sizes on x86_64:
stap_task_finder_target 192 -> 184
stap_itrace_probe 216 -> 208
stap_utrace_probe 328 -> 312
stap_uprobe_tf 200 -> 192
stap_uprobe_spec 48 -> 40
I only changed field layouts, not types or names, so this should be
perfectly safe. (FLW)
|
| |
|
|
|
|
|
| |
* stat-common.c (_stp_stat_print_histogram_buf): Fix HIST_PRINTF
parameter passing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
uprobe_fork_uproc() runs with parent_uproc->rwsem locked.
However uprobe_mk_process() that gets called within uprobe_fork_uproc()
also locks child_uproc->rwsem after initializing it.
Lockdep report confuses this to acquiring a lock that already has been
acquired and suggests using sub-classes.
The alternatives we have are:
1. use classes level to distinguish different uproc structures.
2. unlock parent_uproc->rwsem before we call uprobe_fork_uproc().
3. dont try locking child_uproc->rwsem; since we are protected by
uproc_mutex as well as parent_uproc->rwsem;
We use the last approach.
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
---
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
* transport/control.c (*_cmd): Return -Ecodes rather than "-1" from
file_operations callbacks.
* staprun/ctl.c (init_ctl_channel): Return distinct error codes.
* staprun/staprun.c (remove_module): Skip connection attempt to .ctl
file; just do delete_module() with O_NONBLOCK.
|
| |
| |
| |
| |
| |
| |
| | |
* runtime/stat-common.c (reprint_buf): Removed.
(_stp_stat_print_histogram_buf): Use a local HIST_PRINTF macro to
abstract the buffer management. Also convert reprint_buf calls to
either %* formats or simple for-loops.
|
|/
|
|
|
|
|
|
| |
* parse.cxx (parser::parse_symbol): Add sprint[ln] to @hist_* hack.
* runtime/stat-common.c: Replace reprint with new reprint_buf, add more
generic _stp_stat_print_histogram_buf and call it from the older one.
Also correct some formatting issues.
* translate.cxx (c_unparser::visit_print_format): Add sprint case.
|
|
|
|
|
| |
* mainloop.c (cleanup_and_exit): Remove non-BUG9788_WORKAROUND
branch. Remove execlp branch. Pass -v to staprun-d if verbose.
|
|
|
|
|
|
|
| |
* runtime/staprun/mainloop.c (signal_usr1): Renamed from signal_dontcare.
Sets a new variable, usr1_interrupt.
(start_cmd): Avoids pause() race condition by switching to blocking
SIGUSR1, then waiting on SIGUSR1 with sigsuspend().
|
|
|
|
|
| |
* staprun_funcs.c (assert_permissions): Move "check_signature_rc"
variable inside #if HAVE_NSS.
|
|
|
|
|
|
| |
Pending advice from Frank and Dave, changed check_permission to return void and
renamed it to assert_permission. assert_permission simply returns if
permissions are okay, and calls exit(-1) if there are any permissions errors.
|
|
|
|
| |
* runtime/tranport/ring_buffer.c: Removed 'USE_ITERS' definition.
|
|
|
|
|
|
|
|
|
| |
* tapset/random.stp (randint): Make it 1-arity (imply min=0).
Document with kerneldoc.
* doc/Systemtap_Tapset_Reference/tapsets.tmpl: Extract the docs.
* runtime/arith.c (_stp_random_pm_u): Rename without _pm.
(_stp_random_pm): Rewrite in terms of ..._u.
* testsuite/random.stp: Adapt & simplify.
|
|
|
|
| |
* arith.c (_stp_random_pm_u): New function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* staplog.c (get_rchan): Separated original relayfs code and current
relayfs code.
(get_rchan_buf): Ditto.
(output_cpu_logs): Ditto.
(get_rchan_addr): Handles original relayfs code detection.
(setup_global_data): Looks for '_stp_relay_data' structure instead of
'_stp_utt' structure.
(open_output_file): Improved error message.
* runtime/transport/relay_v2.c: Rearranged struct _stp_relay_data_type to
make things a bit easier for staplog.c.
* runtime/transport/relayfs.c: Ditto
|
|
|
|
|
|
|
|
|
|
|
| |
* tapset/logging.stp (ftrace): New function.
(*): Add kerneldoc to other functions.
* doc/SystemTap_Tapset_Reference/tapsets.tmpl: Process logging.stp.
* stapfuncs.3stap.in: Remove "LOGGING" section, now redundant.
* runtime/autoconf-trace-printk.c: New autoconf test.
* buildrun.cxx (compile_pass): Build it.
* NEWS: Mention it.
* testsuite/buildok/logging.stp: Test it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit 6846cfc8 introduced an unintended side-effect where semaphore tracking
was identified with stap_uprobe_specs[] elements, which are normally static/const.
This kernel patch <http://article.gmane.org/gmane.linux.kernel/854187> catches
and panics on this. The cure is to move the variable over to the stap_uprobes[]
array.
* tapsets.cxx (uprobe emit_module_decls): Add sdt_sem_address to stap_uprobe{} struct,
to contain per-process relocated semaphore address.
(emit_module_decls,_init): Remove tsk field, restore constness of appropriate
locals. Activate uprobe semaphore right around uprobe activation time. Remove
semaphore clearing upon process exit, since by then it's gone.
(emit_module_exit): Use remembered relocated semaphore address to clean up.
Fix "-uprobe" DEBUG_UPROBES message.
* runtime.h: #include <linux/sched.h>.
* dtrace.in (*_semaphore): Make it an unsigned short - intended 16 bits on all
common architectures/multilibs.
|
|
|
|
|
|
|
| |
* runtime/staprun/staprun.h: Put ppoll() declaration here (so that
relay_old.c can use it).
* runtime/staprun/relay.c (ppoll): Made ppoll() non-static so that
relay_old.c can use it.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We allocate a "fake" unlinked shmem file because anonymous
memory might not be granted execute permission when the selinux
security hooks have their way. Only do this for 2.6.28 or higher
since shmem_file_setup() isn't exported before that.
* runtime/uprobes2/uprobes.c (uprobe_setup_ssol_vma): Use shmem_file_setup
to setup the ssol vma area when using 2.6.28+.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add /* unprivileged */ to a variety of tapset embedded-c functions,
together with uid-assertion-checking code as needed. This is only
an initial set, and may need to grow or shrink after further testing.
Prototyped-By: Dave Brolley <brolley@redhat.com>
* runtime/runtime.h (is_myproc, assert_is_myproc): New macros.
* runtime/addr-map.c (lookup_bad_addr): Reject if !is_myproc
in unprivileged mode.
* runtime/print.c (_stp_print_kernel_info): Add unprivileged
mode info.
* tapset/DEVGUIDE: Document /* pure */ and /* unprivileged */.
* tapset/*.stp: Add /* unprivileged */ here and there, in
questionable cases along with an assert_is_myproc().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* itrace.h (__access_process_vm): Moved from here...
* runtime/access_process_vm.h: New. ...to here.
* translate.cxx (translate_pass): Include access_process_vm.h
* session.h (sdt_semaphore_addr): New.
* tapsets.cxx (sdt_query::record_semaphore): New. Record sdt_semaphore_addr.
(uprobe_derived_probe_group::emit_module_decls): Allow for uprobe guard variable to be set and unset.
(uprobe_derived_probe_group::emit_module_decls): Likewise.
(uprobe_derived_probe_group::emit_module_exit): Likewise.
* tapset-utrace.cxx (utrace_derived_probe_group::emit_probe_decl): Likewise.
(utrace_derived_probe_group::emit_module_decls): Likewise.
(utrace_derived_probe_group::emit_module_exit): Likewise.
|
|
|
|
|
|
|
|
|
|
|
| |
* runtime/staprun/relay_old.c (switch_oldoutfile): New function for file
switching.
(process_subbufs): Use switch_oldoutfile.
(reader_thread): Use ppoll() instead of poll() for receiving SIGUSR2
and switch output file when receiving a signal(SIGUSR2).
(switchfile_handler): Send SIGUSR2 signal to reader threads for file
switching.
(init_oldrelayfs): Assign switchfile_handler to SIGUSR2.
|
|
|
|
|
|
|
|
|
|
| |
* runtime/staprun/relay.c (switch_outfile): New function for file switching.
(reader_thread): Don't assign empty_handler to SIGUSR2, and switch output
file when receiving signal(SIGUSR2) on ppoll.
(switchfile_handler): Send SIGUSR2 signal to reader threads for file
switching.
(init_relayfs): Assign switchfile_handler to SIGUSR2.
* staprun.1.in: Add FILE SWITCHING BY SIGNAL section.
|
| |
|
|
|
|
| |
* runtime/syscall.h (x86_64 MMAP2_SYSCALL_NO): Define.
|
|
|
|
| |
* transport/symbols.c (_stp_do_relocation): Make msg static.
|
|
|
|
|
|
|
|
|
| |
* runtime/regs.h (SET_REG_IP): Define.
(REG_IP_LVALUE): Undefine.
* tapsets.cxx (*::emit_module_decls): Use SET_REG_IP() instead
of old LVALUE? conditional.
Written by jkenisto & jistone.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With old relayfs, out_fd is used only when non-bulk mode. However,
open_oldoutfile and open_relayfs_files open files with fopen and
set only percpu_tmpfile. This will cause a problem with -S option,
that out_fd will be closed when the file size reaches fsize_max
and new fd will be opened only on percpu_tmpfile.
So, out_fd should be synchronized with percpu_tmpfile.
* runtime/staprun/relay_old.c (open_oldoutfile): Set fd of output file
to out_fd[cpu].
(open_relayfs_files): Ditto.
|
|/
|
|
|
|
|
| |
* runtime/transport/ring_buffer.c (_stp_event_to_user): Removed unneeded
cast.
(_stp_data_write_reserve): Ditto.
(_stp_data_write_commit): Ditto.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The general approach is to rip out task_finder_tgt's from all over the
place (including the unwindsym vmcbs, and the stap_uprobe_specs), and
instead have a small handful of them: one for all unwindsyms, and one
per abstract probed process (PID or NAME). These are in turn shared
by all new stap_unwind_specs by index.
Before: probe process("./stap").function("*")
-rw-r--r--. 1 fche users 11775283 2009-09-08 20:26 /var/tmp/fche/systemtap/cache/96/stap_96c0479d674db55ec98d8a8750a790e7_7989596.ko
text data bss dec hex filename
445158 8351944 4306472 13103574 c7f1d6 /var/tmp/fche/systemtap/cache/96/stap_96c0479d674db55ec98d8a8750a790e7_7989596.ko
After: (Note how data shrank, though text gained a bit in const-init-data.)
-rw-r--r--. 1 fche users 4021569 2009-09-08 20:27 /var/tmp/fche/systemtap/cache/e4/stap_e46e88634efd850b1586e81c231c239a_8058419.ko
text data bss dec hex filename
1896511 2192 4324808 6223511 5ef697 /var/tmp/fche/systemtap/cache/e4/stap_e46e88634efd850b1586e81c231c239a_8058419.ko
* tapsets.cxx (uprobe_derived_probe_group): Rewrite emit_module_decls,
and adjust emit_module_init.
* runtime/sym.c (_stp_sym_init): Initialize unwindsyms-shared vmcb.
* runtime/sym.h (_stp_module): Remove *vmcb field.
* translate.cxx (emit_module_init, dump_unwindsyms): Adapt.
* translate.h (assert_0_indent): Flush output before possibly assert-failing.
|
| |
|
|
|
|
|
|
|
|
| |
Suspecting that some kernel->user control messages may be getting
lost, let's more robustly log these occurrences.
* runtime/transport/control.c (_stp_ctl_send): printk(KERN_ERROR)
instead of ignoring errors.
|
|
|
|
| |
* io.c (DEBUG_TASK_FINDER_PRINTK): Remove conditional.
|
|
|
|
|
|
| |
* task_finder.c (stap_start_task_finder): Emit _stp_dbug message at end
rather at beginning, so printed utrace-engine attach counts reflect
status at end of initialization rather than at beginning.
|
|
|
|
|
|
| |
* runtime/io.c (_stp_vlog): Don't put ansi highlighting into debugging
messages. #if STAP_DEBUG_PRINTK, direct all diagnostics to appropriate
printk channel instead of runtime trace buffer.
|
| |
|
|
|
|
|
|
| |
Save offset of build id relative to _stext instead of absolute
address for kernel and apply relocations at run-time. This fixes
Debian bug #545277 (http://bugs.debian.org/545277).
|
| |
|
| |
|