| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
unprivileged users.
2009-10-08 Dave Brolley <brolley@redhat.com>
* elaborate.h (emit_unprivileged_assertion): New virtual method of deriv
ed_probe.
(emit_process_owner_assertion): New static method of derived_probe.
(check_unprivileged): New virtual method of derived_probe_builder.
(match_node::unprivileged_ok): Removed.
(match_node::allow_unprivileged): Removed.
(match_node::unprivileged_allowed): Removed.
* elaborate.cxx (translate.h): #include it.
(emit_unprivileged_assertion): New virtual method of derived_probe.
(emit_process_owner_assertion): New static method of derived_probe.
(check_unprivileged): New virtual method of derived_probe_builder.
(match_node::unprivileged_ok): Removed.
(match_node::allow_unprivileged): Removed.
(match_node::unprivileged_allowed): Removed.
(find_and_build): Don't check for unprivileged restrictions here. Call t
he
builder's check_unprivileged method.
(alias_expansion_builder::check_unprivileged): New virtual method.
* tapset-been.cxx (be_derived_probe::emit_unprivileged_assertion): New v
irtual
method.
(be_builder::check_unprivileged): Likewise.
(never_derived_probe::emit_unprivileged_assertion): Likewise.
(never_builder::check_unprivileged): Likewise.
(register_tapset_been): Don't call allow_unprivileged.
* tapset-itrace.cxx (itrace_derived_probe::emit_unprivileged_assertion):
New virtual
method.
(itrace_builder::check_unprivileged): Likewise.
(register_tapset_itrace): Don't call allow_unprivileged.
* tapset-utrace.cxx (utrace_derived_probe::emit_unprivileged_assertion):
New virtual
method.
(utrace_builder::check_unprivileged): Likewise.
(register_tapset_utrace): Don't call allow_unprivileged.
* tapset-timer.cxx (timer_derived_probe::emit_unprivileged_assertion): N
ew virtual
method.
(timer_builder::check_unprivileged): Likewise.
(register_tapset_timers): Don't call allow_unprivileged.
* tapsets.cxx (uprobe_derived_probe::emit_unprivileged_assertion): New v
irtual
method.
(uprobe_builder::check_unprivileged): Likewise.
(register_standard_tapsets): Don't call allow_unprivileged.
(register_statement_variants): Remove unprivileged_ok_p parameter. Don't
call
allow_unprivileged.
(register_function_variants): Likewise.
(register_function_and_statement_variants): Likewise.
(register_patterns): Don't call allow_unprivileged.
* translate.cxx (emit_probe): Call v->emit_unprivileged_assertion.
|
|
|
|
|
|
|
|
|
|
| |
* setupdwfl.h: Introduce DwflPtr.
* setupdwfl.cxx: Cache kernel_dwfl and user_dwfl. Keep track of last used
module strings. Return cached versions if same query used.
* dwflpp.h: Use DwflPtr instead of Dwfl*.
* dwflpp.cxx: Use DwflPtr and don't dwfl_end().
* translate.cxx: Likewise. Run through dwfl_getmodules() with returned
ptr offset.
|
|
|
|
|
|
|
|
|
| |
* setupdwfl.h: Add setup_dwfl_user() and is_user_module().
* setupdwfl.cxx: Likewise.
* dwflpp.cxx (setup_user): Use setup_dwfl_user().
* translate.cxx (emit_symbol_data): Likewise and is_user_module().
* tapsets.cxx (dwarf_cast_expanding_visitor::visit_cast_op):
Use is_user_module().
|
|
|
|
|
|
|
|
|
|
|
| |
* setupdwfl.h: New header file.
* setupdwfl.cxx: New source file containing shared setup_dwfl_kernel() code.
* dwflpp.cxx (dwfl_report_offline_predicate): Removed.
(setup_kernel): Call setup_dwfl_kernel().
* translate.cxx (dwfl_report_offline_predicate2): Remove.
(emit_symbol_data): Call setup_dwfl_kernel().
* Makefile.am (stap_SOURCES): Add setupdwfl.cxx.
* Makefile.in: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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).
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
2009-09-03 Dave Brolley <brolley@redhat.com>
* tapsets.cxx (visit_cast_op): Don't disallow unprivileged users.
Annotate synthesized function with /* unprivileged */.
* tapset-utrace.cxx (register_tapset_utrace): Call allow_unprivileged
for process begin and end probes.
* translate.cxx (translate_pass): Generate '#define STP_PRIVILEGED 1'
unless --unprivileged was specified.
* runtime/transport/transport.c: Don't define _stp_unprivileged_user.
* runtime/task_finder.c (__stp_utrace_attach_match_filename): Check
that _stp_uid equals the task euid when STP_PRIVILEGED is not defined.
(stap_start_task_finder): Likewise.
* runtime/staprun/staprun.c (insert_stap_module): Don't generate
module option _stp_unprivileged_user.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We always use lex_cast either to string or from string, so I made that
explicit, and got rid of some string copies in the process. There was
also stringify(), which was redundant to lex_cast<string>.
We also always used lex_cast_hex to string, so that's now hard-coded and
again eliminated a string copy.
For lex_cast_qstring<string>, there's no need to write the streamify the
input, so a specialization now operates directly on the input.
Hopefully this is a bit cleaner, and I do measure it to be a little
faster on scripts with many probes.
|
|
|
|
|
|
|
|
|
|
|
| |
_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.
|
|
|
|
|
|
|
|
|
|
| |
The previous name made it easy to misread the purpose of this
field. It is only for matching executable names, not for
shared libraries.
* runtime/task_finder.c (task_finder_target): Rename field.
(*): Adjust.
* tapset-itrace.cxx, tapset-utrace.cxx, tapsets.cxx, translate.cxx: Ditto.
|
|
|
|
|
|
|
| |
* runtime/task_finder.c (non-UTRACE): Return 0 for
stap_start_task_finder.
* translate.cxx (emit_module_init): Let vma tracker
specific to utrace.
|
|
|
|
|
|
|
| |
* translate.cxx (dump_unwindsyms): Decide based on modname[] not
mainfile[] to emit a vmcb.
* runtime/task_finder.c (non-UTRACE): Include dummy stap_{start,stop}_*
functions.
|
|
|
|
|
|
|
|
| |
* translate.cxx (emit_common_header, translate_pass): Use new
recursion_info visitor to calculate appropriate MAXNESTING value for
scripts with or without recursion.
* tapsets.cxx (common_probe_entryfn_prologue): Initialize c->nesting = -1.
* stap.1.in: Clarify MAXNESTING value.
|
|
|
|
|
|
| |
* translate.cxx (emit_common_header): Emit probe locals into
a separate union, not into the locals[] array.
(emit_probe): Adapt.
|
|
|
|
|
| |
* translate.cxx (c_unparser::emit_probe): Unlocks global variables, then
calls _stp_print_flush() (instead of the other way around).
|
|
|
|
|
|
|
|
|
|
|
|
| |
* main.cxx (main): For "-d /path" arguments, enable task finder.
* runtime/sym.h (_stp_module): Add *vmcb member.
* task_finder{.cxx,.h} (emit_vma_callback_probe_decl): Zap.
* tapset-itrace.cxx, tapset-utrace.cxx: Use unwindsyms_modules
instead.
* tapsets.cxx (uprobe::emit_module_decls): Ditto.
* translate.cxx (emit_module_init): Emit task finder registrations
for vmcb's associated with _stp_modules.
(dump_unwindsyms): Associate vmcbs with user-space unwindsyms entries.
|
|
|
|
|
|
|
| |
We were jumping through a few hoops to deal with elfutils < 0.138 that
did not have the _ELFUTILS_PREREQ macro. I've added an always-false
dummy macro to take its place when it doesn't exit. All of the other
"#ifdef _ELFUTILS_PREREQ" ugliness can now go away.
|
|
|
|
|
|
|
|
| |
* translate.cxx (translate_pass): Raise MAXSTRINGLEN to 256 for 32bit arches
and to 512 for 64bit arches.
* testsuite/systemtap.context/backtrace.tcl: Don't set MAXSTRINGLEN.
* testsuite/systemtap.exelib/ustack.tcl: Likewise.
* testsuite/systemtap.string/str_replace.exp: Explicitly set MAXSTRINGLEN.
|
|\
| |
| |
| |
| |
| | |
Conflicts:
cache.cxx
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Rather than just numeric literals, we can now support arbitrary
expressions for the index value. Note that loc2c won't allow this for
noncontiguous arrays, as the access methods need to be statically
computed, but for contiguous arrays and pointers-as-arrays it works
just fine.
* staptree.h (target_symbol::component): Add expression_array_index.
* staptree.cxx (target_symbol::visit_components): New helper.
(target_symbol::assert_no_components): Recognize new array type.
(target_symbol::component::print): Print subexpressions.
(traversing_visitor::visit_target_symbol, visit_cast_op): Visit the
indexing components too.
(varuse_collecting_visitor::visit_target_symbol): Ditto.
(update_visitor::visit_target_symbol, visit_cast_op): Ditto.
* elaborate.cxx (void_statement_reducer::visit_target_symbol): New.
(void_statement_reducer::visit_cast_op): Save indexes too.
* parse.cxx (parser::parse_target_symbol_components): Parse expressions.
* tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol): Pass
expression-indexes as parameters (indexN) to the dwarf function.
(dwarf_cast_expanding_visitor::visit_cast_op): Ditto.
(tracepoint_var_expanding_visitor::visit_target_symbol_arg): Ditto.
(sdt_var_expanding_visitor::visit_target_symbol): Visit the new @cast.
* dwflpp.cxx (dwflpp::translate_components): Use THIS->indexN.
* translate.cxx (c_unparser::visit_target_symbol): Correct error msg.
* testsuite/systemtap.base/pointer_array.stp: Use a simple index.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* stap.1.in: Document that -w disables all warning messages.
* dwflpp.cxx (get_module_dwarf): Only output warning when session
suppress_warnings is not set.
* translate.cxx (dump_unwindsyms): Likewise.
(emit_symbol_data_done): Likewise.
* tapsets.cxx (query_module_symtab): Likewise.
(read_from_elf_file): Take systemtap_session, check suppress_warnings
before emitting warning.
(read_from_text_file): Likewise.
(get_symtab): Call read_from_elf_file and read_from_text_file with session.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* dwflpp.cxx (dwflpp ctor): Parametrize for user/kernel modes.
Update callers.
(dwfl_report_offline_predicate): New function. Filter and
abort searches early if possible.
(setup_kernel): Use new predicate.
* dwflpp.h: Corresponding changes.
* tapsets.cxx (dwfl_report_offline_predicate): Remove this shared
implementation.
(dwarf_builder): Turn kern_dw into module_name->dwflpp* map, just
like user_dw.
(get_kern_dw): Adapt.
(dwarf_build_no_more): Adapt.
* tapsets.h: Remove old shared predicate.
* translate.cxx (dwfl_report_offline_predicate2): New function.
Filter and abort searches early if possible.
(emit_symbol_data): Use it.
|
|\| |
|
| |
| |
| |
| |
| |
| | |
* translate.cxx (emit_symbol_data_done): Special case
_stp_kretprobe_trampoline emission for -1, which is invalid
in hex if host width > target width.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For shared libraries (.dynamic sections) we need the eh frame section
address offset. This is the sh_addr if the shared library isn't prelinked
(since the base load address is zero in that case), otherwise it is
the module start address minus the bias (which also works for the
non-prelinked case).
* translate.cxx (get_unwind_data): Adjust eh_addr for module start and
bias if module isn't absolute (has no relocations).
* testsuite/systemtap.exelib/ustack.tcl: Accept all prelink tests.
|
| |
| |
| |
| | |
tagged by /* unprivileged */.
|
|\| |
|
| |
| |
| |
| |
| | |
* translate.cxx (translate_pass): Emit module_parm stuff at the very end.
* testsuite/buildok/null.stp: New test.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When anything in systemtap_module_init fails, and we return non-zero,
then the module load is aborted. The normal module unload path
(systemtap_module_exit) is not even attempted, so we need to make sure
that all partially-allocated resources are returned.
Our timer callbacks for the gettimeofday subsystem are a classic example
of this error. If we don't unregister the timers before aborting init,
they will later be called and cause a kernel fault.
We also were neglecting to free the percpu context. A memory leak is
less harmful, but that's fixed now too.
|
| |
| |
| |
| | |
* translate.cxx (emit_symbol_data): Use ~0 instead of -1 for big unsigned constant
|
| |
| |
| |
| |
| |
| | |
Don't generate an error message for unsigned modules.
Make sure module signature exists before attempting to copy to the cache.
Allow timer p[robes for unprivileged users.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* runtime/sym.h (_stp_kretprobe_trampoline): Document.
* translate.cxx (unwindsym_dump_context): Add stp_kretprobe_trampoline_addr.
(dump_unwindsyms): Detect kretprobe_trampoline_holder symbol address.
(emit_symbol_data): Initialize and emit _stp_kretprobe_trampoline.
* runtime/transport/symbols.c (_stp_do_relocation): Detect kernel load
address and adjust _stp_kretprobe_trampoline.
* runtime/stack-i386.c (__stp_stack_print): Always use fallback unwinder
when hitting kretprobe_trampoline_holder.
* runtime/stack-x86_64.c (__stp_stack_print): Likewise.
|
|\| |
|
| |
| |
| |
| |
| | |
On powerpc, function descriptors are in the .opd section as NO_TYPE.
Include them in stap-symbols.h
|
|\| |
|
| |
| |
| |
| | |
* translate.cxx (dump_unwindsyms): Initialize eh_frame to 0, not NULL.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, _stp_init_time and _stp_kill_time were being called from
begin/end/error probes, which will run with preemption disabled. The
BUG reported on RT kernels showed that cpufreq_unregister_notifier can
end up sleeping, which violates our preemption block.
This patch moves the init/kill into systemtap_module_init/exit, where it
is safe to sleep. The code maintains a new predicate with the define
STAP_NEED_GETTIMEOFDAY, so we don't still incur any timer overhead if
it's not used.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* runtime/unwind.c (adjustStartLoc): Add extra dbug_unwind.
(_stp_search_unwind_hdr): Always pass true for is_ehframe.
(unwind_frame): Properly pass through is_ehframe to adjustStartLoc().
(unwind): Add extra dbug_unwind.
* translate.cxx (dump_unwindsyms): Output and use correct eh_frame
and eh_len.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* runtime/sym.h (_stp_module): Remove unwind_data, unwind_data_len and
unwind_is_ehframe fields. Add debug_frame, eh_frame, debug_frame_len,
eh_frame_len and eh_frame_addr fields.
* runtime/unwind.c: Use debug_frame and debug_frame_len instead of
unwind_data and unwind_data_len throughout.
(cie_for_fde): Take unwind_data and is_ehframe as direct arguments.
* runtime/unwind/unwind.h (cie_for_fde): New function declaration.
* translate.cxx (get_unwind_data): Fetch and return both debug_frame
and eh_frame tables.
(dump_unwindsyms): Dump both debug_frame and eh_frame tables.
|
|\|
| |
| |
| |
| |
| | |
Conflicts:
Makefile.in
|
| |
| |
| |
| |
| |
| |
| | |
* tapsets.cxx: Add dwfl_report_offline_predicate to check pending
interrupts for an early abort.
* tapsets.h: Declare it.
* translate.cxx: Add callback to function call.
|
|\| |
|
| |
| |
| |
| |
| |
| | |
* translate.cxx (dump_unwindsyms): Just check that dwfl_module_relocations()
return more than 1 relocation section bases before calling
dwfl_module_address_section().
|