summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.h
Commit message (Collapse)AuthorAgeFilesLines
* Use clamping to more easily normalize input valuesJosh Stone2010-02-161-0/+8
| | | | | | 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.
* Remove uprobes.h declaration from runtime.hTim Moore2009-12-181-10/+0
| | | | | | | | | | | 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.
* support for a brief backtrace formatTim Moore2009-12-171-0/+10
| | | | | | | | | | | | | | 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
* set the IP in return probes to the returned-to instructionTim Moore2009-12-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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
* PR10849: Support MAXSKIPPED handling on RHEL4 through implementation of ↵Roland Grunberg2009-11-061-0/+11
| | | | atomic_cmpxchg
* PR10655 part 1: uprobes: track sdt semaphores properlyFrank Ch. Eigler2009-09-181-0/+1
| | | | | | | | | | | | | | | | | | | 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.
* PR10650: markup some unprivileged-safe tapset functionsFrank Ch. Eigler2009-09-161-0/+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().
* PR10589: switch to kernel vscnprintf for _stp_{dbug,warn,error} calls in runtimeFrank Ch. Eigler2009-09-021-3/+3
| | | | | | | | | | | _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.
* Merge commit 'origin/master' into pr7043David Smith2009-06-161-0/+1
|\ | | | | | | | | Conflicts: runtime/transport/transport.c
| * Moved time.c inclusion from runtime/transport/transport.c to runtime/runtime.h.David Smith2009-06-161-0/+1
| | | | | | | | | | * runtime/runtime.h: Includes time.c. * runtime/transport/transport.c: Removed time.c inclusion.
* | Merge commit 'origin/master' into pr7043David Smith2009-05-211-7/+12
|\| | | | | | | | | | | | | Conflicts: runtime/print.c runtime/transport/transport.c runtime/transport/transport_msgs.h
| * Don't redefine STP_USE_DWARF_UNWINDER.Mark Wielaard2009-04-121-0/+2
| | | | | | | | * runtime/runtime.h: STP_USE_DWARF_UNWINDER don't redefine.
| * Prefer dwarf unwinder on i386 and x86_64.Mark Wielaard2009-04-111-7/+5
| | | | | | | | * runtime/runtime.h: Move up and enable check for STP_USE_DWARF_UNWINDER.
| * Make sure code using the vma tracker compiles again.Mark Wielaard2009-04-081-0/+2
| | | | | | | | | | | | | | | | * 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.
| * Only includes task_finder.c when needed.David Smith2009-04-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Reorder includes so regs.c and regs-ia64.c included before task_finder.c.William Cohen2009-04-021-0/+2
| |
| * Merge branch 'master' into pr6866Mark Wielaard2009-02-201-4/+4
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: ChangeLog: Removed runtime/ChangeLog: Removed runtime/sym.c: Merged runtime/task_finder.c: Merged tapset/ChangeLog: Removed testsuite/ChangeLog: Removed
| * | Always include task_finder.c and enable emit_vm_callback_probe_decl.Mark Wielaard2008-12-151-16/+1
| | |
| * | PR6866: First pass at translating addresses to symbol names through vma.Mark Wielaard2008-12-101-0/+18
| | |
* | | Renamed STP_OLD_TRANSPORT to STP_TRANSPORT_VERSION.David Smith2009-04-021-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Start of new ring_buffer transport.David Smith2009-03-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | More cleanup.David Smith2009-02-251-0/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Use 'static' as much as possibleJosh Stone2009-01-281-4/+4
|/ | | | | | | | | | 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.
* Use for_each_cpu_mask always.Wenji Huang2008-11-241-6/+0
| | | | Suggested-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
* Fix the conflicted for_each_cpu macro with 2.6.28.Wenji Huang2008-11-171-2/+8
|
* backtrace fix for i386 with neither frame pointers nor dwarf unwindingFrank Ch. Eigler2008-09-101-3/+1
|
* Enable usage of STP_USE_DWARF_UNWINDER for i386 and arm for debugging purposes.Mark Wielaard2008-09-101-0/+2
|
* Feed dwarf unwinder data through _stp_mod_sec_lookup (), but disabled for now.Mark Wielaard2008-09-101-2/+4
|
* PR1288: runtime functions for avoiding certain addressesTim Moore2008-09-081-0/+1
|
* cleanup: remove never-implemented runtime TEST_MODE compile flagFrank Ch. Eigler2008-04-281-8/+0
|
* 2.6.25 fixes and stack level limits.Martin Hunt2008-04-151-0/+4
|
* Add new define STP_USE_DWARF_UNWINDER which is set based on which archsMartin Hunt2008-03-311-0/+5
| | | | work with the unwinder.
* Support for kernels built with CONFIG_FRAME_POINTERMartin Hunt2008-03-301-0/+7
|
* rebased unwind_branch on top of current masterFrank Ch. Eigler2008-03-251-1/+0
|
* 2008-02-27 Martin Hunt <hunt@redhat.com>hunt2008-02-271-16/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2007-09-10 Martin Hunt <hunt@redhat.com>hunt2007-09-101-1/+4
| | | | * procfs.c: New file. Common runtime procfs functions.
* 2007-04-27 Martin Hunt <hunt@redhat.com>hunt2007-04-271-2/+6
| | | | * runtime.h: Improve check for debugfs in kernel.
* 2007-03-14 Martin Hunt <hunt@redhat.com>hunt2007-03-141-6/+11
| | | | | | | | | | | | | | | | | | | | * 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().
* 2007-01-31 Martin Hunt <hunt@redhat.com>hunt2007-01-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2006-12-20 Martin Hunt <hunt@redhat.com>hunt2006-12-201-0/+1
| | | | * runtime.h: Include mm.h.
* 2006-12-08 Josh Stone <joshua.i.stone@intel.com>jistone2006-12-091-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Always include sym.chunt2006-12-041-0/+1
|
* 2006-11-15 Martin Hunt <hunt@redhat.com>hunt2006-11-151-1/+1
| | | | | | | * alloc.c (STP_ALLOC_FLAGS): Define. Cleanup ifdefs. * map.c: Use STP_ALLOC_FLAGS. * stat.c: ditto.
* 2006-11-02 Martin Hunt <hunt@redhat.com>hunt2006-11-021-1/+1
| | | | | * io.c (_stp_vlog, _stp_dbug): Make first parameter const. * runtime.h: Update prototype for _stp_dbug.
* 2006-09-27 Martin Hunt <hunt@redhat.com>hunt2006-09-271-81/+1
| | | | | | | | | | * 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.
* 2006-09-26 David Smith <dsmith@redhat.com>dsmith2006-09-261-1/+1
| | | | | | | | | | * README: Changed 'stpd' references to 'staprun'. * README.doc: Ditto. * TODO: Ditto. * io.c: Ditto. * print.c: Ditto. * runtime.h: Ditto. * bench2/bench.rb: Ditto.
* 2006-09-18 Martin Hunt <hunt@redhat.com>hunt2006-09-181-5/+9
| | | | | | | | | | | | | | | | * 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.
* Systemtap perfmon support to access the processors perfmon hardware.wcohen2006-09-121-0/+3
|
* 2006-07-21 Martin Hunt <hunt@redhat.com>hunt2006-07-211-0/+1
| | | | * runtime.h: Include compat.h.
* 2006-07-12 Martin Hunt <hunt@redhat.com>hunt2006-07-121-0/+4
| | | | | * runtime.h (for_each_cpu): Define for new kernels which no longer define it.