| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
The kernel has min/max/clamp macros to make range comparisons easier.
Clamp is a newer invention, but we can define it for older kernels in
terms of min and max.
|
|
|
|
|
|
|
|
|
|
|
| |
Turns out that it breaks on kernels that don't have utrace.
* runtime/runtime.h : Don't include uprobes.h
* runtime/stack.c: Include uprobes.h
* runtime/stack-i386.c: Check if uprobes is included at all.
* runtime/stack-x86_64.c: ditto
* tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): put
uprobes.h include back in.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This only prints symbol+offset, or an address if the symbol isn't
known.
* runtime/runtime.h (SYM_VERBOSE_NO, SYM_VERBOSE_FULL,
SYM_VERBOSE_BRIEF): new constants
* runtime/stack.c (_stp_stack_print): support brief format
* runtime/sym.c (_stp_func_print): ditto
* tapset/ucontext-unwind.stp (print_ubacktrace_brief): new function
* testsuite/systemtap.context/fib.c: new test program
* testsuite/systemtap.context/fib.stp: new test
* testsuite/systemtap.context/fib.exp: new test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's easily available in kretprobes and uretprobes and is consistent
with the rest of the program state.
* translate.cxx (emit_common_header) : add uretprobe_instance to context.
* tapsets.cxx (common_probe_entryfn_prologue): Initialize ri in
context to 0.
(dwarf_derived_probe_group::emit_module_decls): Change IP to return
address in kretprobes.
(uprobe_derived_probe_group::emit_module_decls): enter_uretprobe_probe:
set ri (uretprobe_instance) in context. Change IP to return
address in uretprobes. Don't emit uprobe include and #define
* runtime/runtime.h : Add includes and #define for uprobes.
* runtime/stack.c (_stp_stack_print, _stp_stack_snprint): Add extra
argument for uretprobe_instance.
* tapset/context-unwind.stp (print_backtrace, backtrace): Pass NULL
for uretprobe_instance to _stp_stack_print.
* tapset/ucontext-unwind.stp (print_ubacktrace, ubacktrace): pass
uretprobe_instance to _stp_stack_print
* testsuite/systemtap.context/uprobe_uaddr.exp : new test for uaddr in
function probes
* testsuite/systemtap.context/uprobe_uaddr.stp : new file
|
|
|
|
| |
atomic_cmpxchg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
|
|
|
|
|
| |
_stp_vscnprintf is only suitable for calls from the script, with slightly
different conventions (64-bit ints/pointers, extra formatting directives).
* runtime/runtime.h (_stp_{dbug,warn,error}): Add __attribute__ format(printf).
* runtime/io.c (_stp_vlog): Ditto. Use vscnprintf().
* runtime/sym.c (_stp_module_check): Remove hexdumping (%.*M) of mismatching
buildids. Switch to _stp_warn from printk (KERN_WARNING).
* translate.cxx, runtime/unwind.c: Numerous print formatting tweaks.
|
|\
| |
| |
| |
| | |
Conflicts:
runtime/transport/transport.c
|
| |
| |
| |
| |
| | |
* runtime/runtime.h: Includes time.c.
* runtime/transport/transport.c: Removed time.c inclusion.
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
runtime/print.c
runtime/transport/transport.c
runtime/transport/transport_msgs.h
|
| |
| |
| |
| | |
* runtime/runtime.h: STP_USE_DWARF_UNWINDER don't redefine.
|
| |
| |
| |
| | |
* runtime/runtime.h: Move up and enable check for STP_USE_DWARF_UNWINDER.
|
| |
| |
| |
| |
| |
| |
| |
| | |
* runtime/runtime.h: Include task_finder.c.
* runtime/sym.c: Always define task_finder callbacks for usage in tapsets.
* runtime/task_finder.c: Define dummy stap_task_finder_target when
! defined(CONFIG_UTRACE).
* tapsets.cxx: Never include task_finder.c directly.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
2009-04-08 David Smith <dsmith@redhat.com>
* tapsets.cxx (itrace_derived_probe_group::emit_module_decls):
Added inclusion of task_finder.c back. Unconditionally including
it when not needed causes all systemtap scripts to fail on kernels
with no utrace support.
(utrace_derived_probe_group::emit_module_decls): Ditto.
(uprobe_derived_probe_group::emit_module_decls): Ditto.
* runtime/runtime.h: Removed unconditional inclusion of
task_finder.c.
|
| | |
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
ChangeLog: Removed
runtime/ChangeLog: Removed
runtime/sym.c: Merged
runtime/task_finder.c: Merged
tapset/ChangeLog: Removed
testsuite/ChangeLog: Removed
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
2009-04-02 David Smith <dsmith@redhat.com>
* runtime.h: Defines STP_TRANSPORT_VERSION instead of STP_OLD_TRANSPORT.
* staprun/staprun.h (STP_OLD_TRANSPORT): Ditto.
* print.c: Changed STP_OLD_TRANSPORT to STP_TRANSPORT_VERSION.
* staprun/mainloop.c (stp_main_loop): Ditto.
* transport/transport.c: Ditto.
* transport/transport.h: Ditto.
* transport/transport_msgs.h: Ditto.
* transport/utt.h: Ditto.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
2009-03-04 David Smith <dsmith@redhat.com>
* runtime.h: Added _stp_exit() prototype.
* transport/ring_buffer.c: New file.
* transport/transport.c: Removed unneeded utt_trace lines.
Includes transport/ring_buffer.c.
(_stp_transport_fs_init): Calls _stp_transport_data_fs_init().
(_stp_transport_fs_close): Calls _stp_transport_data_fs_close().
* transport/transport.h: Added prototypes.
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
2009-02-25 David Smith <dsmith@redhat.com>
* debug.h: Removed unused variable '_stp_transport_state'.
* print_new.c (stp_print_flush): Ifdef'ed out call to
utt_reserve().
* runtime.h: Added _stp_warn() prototype.
* transport/control.c: Includes control.h, mempool.c, and
symbols.c. Renamed '_stp_attached' to '_stp_ctl_attached'.
* transport/control.h: Removed _stp_pool_q declaration.
* transport/debugfs.c (_stp_register_ctl_channel_fs): Uses
_stp_get_module_dir().
* transport/transport.c: Cleanup.
* transport/transport.h: Ditto.
|
|/
|
|
|
|
|
|
|
|
| |
This change just inserts 'static' on runtime, tapset, and generated C
functions and globals, so the compiler can do a better job of
optimizing.
My tests with small scripts show ~10% reduction in compile time and ~20%
reduction in module size. Larger scripts may show less benefit, but I
expect purely positive results.
|
|
|
|
| |
Suggested-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
work with the unwinder.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sym.h (_stp_module): Add text_size, lock, and unwind data
pointer.
* sym.c (_stp_find_module_by_addr): New function.
(_stp_kallsyms_lookup): Call _stp_find_module_by_addr().
(_stp_get_unwind_info): New.
* runtime.h: Move debug macros to debug.h. Include it.
* debug.h: New file.
* map.c: Update debug calls.
* map-gen.c: Update debug calls.
* pmap-gen.c: Update debug calls.
* mempool.c: New file.
* symbols.c: Use rwlocks. Use new dbug macros. Handle
unwind info if present.
* transport.c: Include mempool.c. Update dbug and kbug calls
to new macros.
* transport_msgs.h (_stp_command_name): Add
struct containing message names for debugging.
* control.c, procfs.c: Use new dbug macros. Use
new mempool functions.
|
|
|
|
| |
* procfs.c: New file. Common runtime procfs functions.
|
|
|
|
| |
* runtime.h: Improve check for debugfs in kernel.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bench2/bench.rb: Updated to work with new transport
and new itest.c.
* bench2/Makefile: Updated for new itest.c
* bench2/itest.c: Rewritten to use multiple threads
and automatically divide the workload among the threads.
* print.c (_stp_print_flush): Move to print_new.c and
print_old.c.
* print_new.c: New file containing _stp_print_flush()
for the new transport.
* print_old.c: Ditto for old transport.
* runtime.h (STP_OLD_TRANSPORT): Define
(errk): Define.
(MAXSTRINGLEN): Define if not already defined.
* io.c (_stp_vlog): Use _stp_ctl_write().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* string.c (_stp_string_init): Deleted.
(_stp_sprintf): Deleted.
(_stp_vsprintf): Deleted.
(_stp_string_cat_cstr): Deleted.
(_stp_string_cat_string): Deleted.
(_stp_string_cat_char): Deleted.
(_stp_string_ptr): Deleted.
(_stp_string_cat): Deleted.
(_stp_snprintf): Moved from vsprintf.c.
(_stp_vscnprintf): Moved from vsprintf.c.
* string.h (STP_STRING_SIZE): Deleted.
(STP_NUM_STRINGS): Deleted.
Remove all references to type "String".
* vsprintf.c (_stp_vscnprintf): Moved to string.c.
(_stp_snprintf): Moved to string.c
* sym.c (_stp_symbol_sprint): Replaced with
_stp_symbol_print, which writes to the print buffer.
(_stp_symbol_sprint_basic): Replaced with
_stp_symbol_snprint.
* runtime.h: Include io.c.
* stat-common.c: Use new _stp_print* functions.
* stat.c: Ditto.
* regs.c: Renamed to regs-ia64.c.
* current.c: Renamed regs.c.
* regs-ia64.c: New file (renamed from regs.c).
* stack.c (_stp_stack_sprint): Renamed _stp_stack_print
and now just prints to the print buffer. Calls
__stp_stack_print instead of __stp_stack_sprint.
(_stp_stack_snprint): New function. Calls _stp_stack_print and
then copies the print buffer into a string.
(_stp_stack_printj): Deleted.
(_stp_ustack_sprint): Deleted.
* stack-*.c: Rewritten to print instead of writing to strings.
Uses new _stp_print* functions.
* print.c (_stp_printf): Create new function instead of macro.
(_stp_print): Ditto.
(_stp_print_char): New function.
* map.c: Use _stp_print() and _stp_print_char()
instead of _stp_print_cstr().
* io.c (_stp_vlog): Use _stp_print() instead
of _stp_string_cat_cstr().
* copy.c (_stp_string_from_user): Deleted.
|
|
|
|
| |
* runtime.h: Include mm.h.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 3681.
* staptree.h (struct vardecl): Add a literal 'init' member for the
initialization value of globals.
* staptree.cxx (vardecl::vardecl): Initialize 'init' to NULL.
(vardecl::print): Print global init value during pass-1 output.
* main.cxx (printscript): Print global init values during verbose
pass-2 output.
* parse.cxx (parser::parse_global): Set the initialization literal of
global vardecls.
* translate.cxx (var::init): Don't unconditionally override the value
of numeric globals when the module_param isn't used.
(c_unparser::emit_global_param): Write numeric module_params directly
into the global variable, as an int64_t instead of long.
(c_unparser::emit_global): Add initialization to global declarations.
Don't create a temp module_param long for numeric globals anymore.
runtime/
* runtime.h (param_set_int64_t, param_get_int64_t,
param_check_int64_t): New functions to allow taking module parameters
directly as int64_t values.
testsuite/
* systemtap.base/global_init.exp, systemtap.base/global_init.stp: New
test for checking the timeliness of global initialization.
|
| |
|
|
|
|
|
|
|
| |
* alloc.c (STP_ALLOC_FLAGS): Define.
Cleanup ifdefs.
* map.c: Use STP_ALLOC_FLAGS.
* stat.c: ditto.
|
|
|
|
|
| |
* io.c (_stp_vlog, _stp_dbug): Make first parameter const.
* runtime.h: Update prototype for _stp_dbug.
|
|
|
|
|
|
|
|
|
|
| |
* stack.c (_stp_kta): Rewrite. Use the _stap_symbols
struct instead of calling into the kernel.
* sym.c (_stp_kallsyms_lookup): Move here from runtime.h
* runtime.h: Get rid of all the symbol stuff that
did not belong here.
|
|
|
|
|
|
|
|
|
|
| |
* README: Changed 'stpd' references to 'staprun'.
* README.doc: Ditto.
* TODO: Ditto.
* io.c: Ditto.
* print.c: Ditto.
* runtime.h: Ditto.
* bench2/bench.rb: Ditto.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* print.c (_stp_print_flush): Rewrite so one version works for
relayfs or procfs. Use proper per-cpu functions.
(_stp_reserve_bytes): New function. Reserve bytes in the output buffer.
(_stp_print_binary): New function. Write a variable number of
64-bit values directly into the output buffer.
* string.c (_stp_sprintf): Rewrite using new per-cpu buffers.
(_stp_vsprintf): Ditto.
(_stp_string_cat_cstr): Ditto.
(_stp_string_cat_char): Ditto.
* runtime.h: Set defaults for MAXTRYLOCK and TRYLOCKDELAY to make
runtime tests in bench2 happy.
|
| |
|
|
|
|
| |
* runtime.h: Include compat.h.
|
|
|
|
|
| |
* runtime.h (for_each_cpu): Define for new kernels
which no longer define it.
|