summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* build fix: make buildable with elfutils < 0.142Frank Ch. Eigler2009-08-232-0/+21
| | | | | * dwarf_wrappers.h, loc2c.c: Define DW_TAG_rvalue_reference_type=0x42 for older elfutils.
* PR10461: Add support for C++ classes and referencesJosh Stone2009-08-213-25/+81
| | | | | | | | | | * dwarf_wrappers.cxx (dwarf_type_name): Name class and reference types. * dwflpp.cxx (dwflpp::iterate_over_globals): Capture class names. (dwflpp::print_members): Permit classes, and dig into inheritance. (dwflpp::find_struct_member): Ditto. (dwflpp::translate_components): Handle classes and references. (dwflpp::translate_final_fetch_or_store): Ditto. * loc2c.c (c_translate_pointer): Treat references as simple pointers.
* PR10507: tweak MAXUPROBES calculation to shrink table for small static ↵Frank Ch. Eigler2009-08-211-3/+7
| | | | | | | | number of probes * tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): Use geometric mean rather than arithmetic mean. Add a comment to explain relative harmlessness of exceeding the "minimum" or "maximum" values.
* PR10543: do module cache cleaning before copying new file into the cacheFrank Ch. Eigler2009-08-212-3/+5
| | | | | | ... otherwise the new stuff can get cleaned before use. * cache.cxx (add_to_cache): Do clean_cache() first, not last.
* PR10544: clean up stap child process error handlingFrank Ch. Eigler2009-08-216-41/+40
| | | | | | | * util.cxx (stap_system): Take extra verbosity value. Standardize error handling / tracing. * util.h: Corresponding changes. * buildrun.cxx, main.cxx, modsign.cxx: Update callers.
* cleanup: rename task_finder_target->pathname -> procnameFrank Ch. Eigler2009-08-215-22/+22
| | | | | | | | | | 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.
* Two minor testcase fixes.David Smith2009-08-202-3/+5
| | | | | * testsuite/systemtap.base/global_stat.exp: Improved error handling. * testsuite/systemtap.base/strftime.exp: Ditto.
* * dtrace.in: Support -C, preprocess with cpp, which upstream postgresStan Cox2009-08-202-3/+34
| | | | is now using.
* PR10537 process().function().label() should select multiple inlined instances.Mark Wielaard2009-08-203-44/+38
| | | | | | | | | | | | | | | | | | | | This is less useful than one would hope. gcc will often emit a label with a DW_AT_low_pc that is not really in the neighbourhood of where one would expect it when the label is inlined and gcc can proof the label isn't really used in the optimized code. dwflpp::iterate_over_labels will now really iterate recursively through the die, even for dies without a name (like lexical blocks). This means we should now always find the concrete inlined label instances that have a real DW_AT_low_pc and so we don't need the trick to use the line table to get at the actual address. * dwflpp.cxx (iterate_over_labels): Accept dies without a name. Don't handle labels without a name or without a lowpc attribute. * testsuite/systemtap.base/inlinedvars.c (m): Trick gcc into thinking label is always used. (call, call2): Activate. (main): Call call and call2. * testsuite/systemtap.base/inlinedvars.exp: New result_string. Test both unoptimized and optimized (inlined) builds.
* Two minor testcase fixes.David Smith2009-08-202-2/+2
| | | | | * testsuite/systemtap.base/poll_map.exp: Improved error handling. * testsuite/systemtap.base/postgres.exp: Fixed typo.
* PR10228: fix non-utrace building regression - cont'dWenji Huang2009-08-202-2/+2
| | | | | | | * runtime/task_finder.c (non-UTRACE): Return 0 for stap_start_task_finder. * translate.cxx (emit_module_init): Let vma tracker specific to utrace.
* Merge branch 'master' of ssh://sourceware.org/git/systemtapJosh Stone2009-08-191-70/+145
|\
| * Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDavid Smith2009-08-191-7/+8
| |\
| * | Updated with latest code.David Smith2009-08-191-70/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * runtime/transport/ring_buffer.c (_stp_ring_buffer_disable_cpu): New function. (_stp_ring_buffer_enable_cpu): Ditto. (_stp_ring_buffer_cpu_disabled): Ditto. (_stp_ring_buffer_empty_cpu): Only checks online cpus (instead of all possible cpus). (_stp_find_next_event): Ditto. (_stp_ring_buffer_iterator_increment): Calls _stp_ring_buffer_disable_cpu()/_stp_ring_buffer_enable_cpu() around ring_buffer_* calls. (_stp_ring_buffer_consume): Ditto. (_stp_peek_next_event): Ditto. (_stp_buffer_iter_finish): New function. (_stp_buffer_iter_start): Ditto. (_stp_data_read_trace): Uses _stp_buffer_iter_start()/_stp_buffer_iter_finish(). (_stp_data_write_reserve): Checks to see if the cpu is disabled (with _stp_ring_buffer_cpu_disabled() before reserving memory. Uses _stp_buffer_iter_start()/_stp_buffer_iter_finish(). (_stp_transport_data_fs_init): Initializes buffer iterators.
* | | Give a more exact error for dereferencing void*Josh Stone2009-08-191-0/+6
| | | | | | | | | | | | * dwflpp.cxx (dwflpp::translate_components): Check for void* deref.
* | | PR10538: Give a file:line hint for anonymous typesJosh Stone2009-08-191-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | When we list the possible members for an anonymous struct/union, the user may want to go look at the source for the type. That's hard without a type name, so we now list the decl file:line for them. * dwflpp.cxx (dwflpp::translate_components): List file:line for anon.
* | | Create a dwarf_attr_die idiomJosh Stone2009-08-194-31/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We commonly do a dwarf_attr_integrate followed by dwarf_formref_die, with no care for the Dwarf_Attribute, so I captured that idiom in an inline function. * dwarf_wrappers.h (dwarf_attr_die): New. * dwarf_wrappers.cxx (dwarf_type_name): Call dwarf_attr_die. * dwflpp.cxx (dwflpp::print_members): Ditto. (dwflpp::find_struct_member): Ditto. * tapsets.cxx (dwarf_derived_probe::saveargs): Ditto. (uprobe_derived_probe::saveargs): Ditto. (resolve_tracepoint_arg_type): Ditto. (tracepoint_derived_probe::build_args): Ditto.
* | | Use dwarf_diename instead of a DW_AT_name lookupJosh Stone2009-08-191-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | We should always use the canonical dwarf_diename. The code being replaced here wasn't even using dwarf_attr_integrate, so it may have been missing the accessibility of some names. * dwflpp.cxx (dwflpp::iterate_over_labels): Use dwarf_diename.
* | | Use dwarf_type_name in more placesJosh Stone2009-08-194-124/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dwarf_wrappers.cxx (dwarf_type_name): Moved here from tapsets.cxx, and added a variant that returns a string for easier ostreaming. * dwflpp.cxx (dwflpp::print_members): Use dwarf_type_name for errors. (dwflpp::find_struct_member): Ditto. (dwflpp::translate_components): Ditto. (dwflpp::translate_final_fetch_or_store): Ditto. (dwflpp::literal_stmt_for_pointer): Ditto. * tapsets.cxx (dwarf_derived_probe::saveargs): Pass die to dwarf_type_name by pointer instead of reference. (uprobe_derived_probe::saveargs): Ditto. (resolve_tracepoint_arg_type): Ditto.
* | | PR10538: Use {...} for naming anonymous typesJosh Stone2009-08-191-1/+3
| |/ |/| | | | | * tapsets.cxx (dwarf_type_name): Handle NULL dwarf_diename.
* | PR10538: Improve location lookup for unionsJosh Stone2009-08-191-7/+8
|/ | | | | | | | | | | | | We had a bug that the starting call to find_struct_member used the same memory for the parentdie and the resulting member. If parentdie is a union, then the first member probably won't have a location, and we actually assert that it must be a union. Since we wrote the result in the same memory, we lost the real info about the parent, and so the assertion failed. * dwflpp.cxx (dwflpp::translate_components): Use distinct memory for the parent and resulting member in the call to find_struct_member. (dwflpp::find_struct_member): Remove the needless parentdie copy.
* * testsuite/systemtap.base/postgres.exp: New test for checking sdtStan Cox2009-08-191-0/+136
| | | | | marker support as used by postgres. Currently assumes, and verifies, that postgres is installed in /usr/local
* PR10228: fix non-utrace building regressionFrank Ch. Eigler2009-08-192-2/+7
| | | | | | | * 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.
* Improved testcase error handling.David Smith2009-08-192-14/+14
| | | | | * testsuite/systemtap.base/arith.exp: Improved error handling. * testsuite/systemtap.base/cmd_parse.exp: Ditto.
* Improved systemtap.printf/sharedbuf.exp testcase.David Smith2009-08-191-41/+87
| | | | | * testsuite/systemtap.printf/sharedbuf.exp: Handles failure better and possible modpost warnings.
* Fix typo in sdt_types.stp (missing newline).Mark Wielaard2009-08-191-2/+2
| | | | * testsuite/systemtap.base/sdt_types.stp (int_var): Add \n to printf.
* PR10495: allow multiple probe aliases with same nameFrank Ch. Eigler2009-08-185-12/+32
| | | | | | | | * elaborate.cxx (match_node::bind): Change ->end to ->ends[] vector. (find_and_build,build_no_more): Iterate over ends[]. * elaborate.h: Corresponding changes. * testsuite/semok/thirtyfour.stp: New test. * NEWS, doc/langref.tex: Note this.
* AUTHORS updateJosh Stone2009-08-182-0/+2
|
* PR10512 STAP_PROBES don't work in c++ constructors/destructors testcase.Mark Wielaard2009-08-183-0/+126
| | | | | | * testsuite/systemtap.base/cxxclass.exp: New file. * testsuite/systemtap.base/cxxclass.stp: Likewise. * testsuite/systemtap.base/cxxclass.cxx: Likewise.
* PR10512 Referencing computed goto labels in c++ constructors does work.Mark Wielaard2009-08-181-23/+0
| | | | | | | | PR10533 inlined vars are not always found was fixed which means we no longer need to prevent inlining of the STAP_PROBE macros. * includes/sys/sdt.h (STAP_UNINLINE_LABEL): Removed. (STAP_PROBE[1-9]_): Remove label: and STAP_UNINLINE_LABEL.
* Add testcase for PR10533 (inlined vars) and 10537 (inlined labels - disabled)Mark Wielaard2009-08-183-0/+73
| | | | | | | | | | Partial testcase for PR10533 (inlined vars) and 10537 (inlined labels) currently we cannot use the full testcase since stap doesn't support probing multiple instances of inlined labels. * testsuite/systemtap.base/inlinedvars.exp: New file. * testsuite/systemtap.base/inlinedvars.stp: Likewise. * testsuite/systemtap.base/inlinedvars.c: Likewise.
* PR10533 inlined vars are not always found (dwflpp).Mark Wielaard2009-08-181-14/+26
| | | | | | | | | | | | | | dwflpp::find_variable_and_frame_base switched too early to "pyshical view" of die tree. We need to lookup the var in the "syntactical view" of the die tree first. Then when we see a DW_TAG_inlined_subroutine while walking the syntactical die tree as returned by dwarf_getscopes for a given variable to retrieve the frame base, then we need to switch to walking the physical die tree where the subroutine is inlined. * dwflpp.cxx (find_variable_and_frame_base): Don't immediately go to die_scopes, but lookup var first based on pc. Then switch "die branches" when searching for frame base and a DW_TAG_inlined_subroutine is encountered.
* PR10533 inlined vars are not always found (lo2c-test off-by-one).Mark Wielaard2009-08-181-1/+1
| | | | | * loc2c-test.c (handle_variable): Set inner to zero after calling dwarf_getscopes_die(), for loop will increase inner.
* PR10518: context shrinkage with function recursion analysis feeding MAXNESTINGFrank Ch. Eigler2009-08-183-7/+87
| | | | | | | | * 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.
* Adapt tracepoints to the new probe_locals unionJosh Stone2009-08-182-2/+2
| | | | | | | * tapsets.cxx (tracepoint_derived_probe_group::emit_module_decls): Use probe_locals to set the tracepoint arguments for the probe. * testsuite/systemtap.base/tracepoints.exp: Include the arguments in the pass-4 tracepoint test.
* PR10516: reduce context sizeFrank Ch. Eigler2009-08-181-3/+9
| | | | | | * translate.cxx (emit_common_header): Emit probe locals into a separate union, not into the locals[] array. (emit_probe): Adapt.
* elfutils build tweak: run nested configure with bash, add -fgnu89-inlineFrank Ch. Eigler2009-08-1815-3443/+5734
| | | | | * configure.ac: Tweak --with-elfutils nested configure invocation. * rest of auto* files: regenerated with fedora-11 tools
* * dtrace.in: Honor the dirname for the output file.Stan Cox2009-08-182-2/+119
| | | | * testsuite/systemtap.base/dtrace.exp: New test.
* PR10533 loc2c doesn't resolve frame base correctly for inlined vars.Mark Wielaard2009-08-181-12/+28
| | | | | | | | | | When we see a DW_TAG_inlined_subroutine while walking the syntactical die tree as returned by dwarf_getscopes for a given variable to retrieve the frame base, then we need to switch to walking the physical die tree where the subroutine is inlined. * loc2c-test.c (handle_variable): Switch "die branches" when searching for frame base and a DW_TAG_inlined_subroutine is encountered.
* Print DIE offsets in loc2c-test scope dumps.Roland McGrath2009-08-181-1/+2
|
* Unlocks global variables, then calls _stp_print_flush().David Smith2009-08-171-4/+4
| | | | | * translate.cxx (c_unparser::emit_probe): Unlocks global variables, then calls _stp_print_flush() (instead of the other way around).
* Cache failed tracepoint headers tooJosh Stone2009-08-141-2/+8
| | | | | | | | | | Rather than re-attempting a tracepoint header that fails to compile, we now save an empty file into the cache to indicate "nothing to see here." See also PR10424. * tapsets.cxx (tracepoint_builder::get_tracequery_module): Use /dev/null as the empty result file if make_tracequery fails. (tracepoint_builder::init_dw): Ignore empty tracequery modules.
* PR10228: use task_finder_vma for -d /user/object files.Frank Ch. Eigler2009-08-149-115/+46
| | | | | | | | | | | | * 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.
* usability: don't suppress pass-4 compiler errorsFrank Ch. Eigler2009-08-141-1/+1
| | | | | | ... since a pass-4 compilation error is just as bad as pass-2 error. * buildrun.cxx (run_make_cmd): Remove "2>&1".
* Add missing quote for uname.tclWenji Huang2009-08-141-1/+1
| | | | * testsuite/systemtap.exelib/uname.tcl: Add '"'.
* PR10507: tweak heuristics for stap_uprobes[] allocationFrank Ch. Eigler2009-08-122-8/+15
| | | | | | * tapsets.cxx (uprobes::emit_module_decls): Compute MAXUPROBES with x-treme kl3v3rn3ss. * stap.1.in: Clarify MAXUPROBES.
* PR10461: Probe identical functions only onceJosh Stone2009-08-112-10/+14
| | | | | | | | | | | | | | | In C++ especially, a function definition in a header may be compiled into multiple CUs, but the linker will merge those into a single output function. We don't want to place multiple probes on the same function. The dupe-detection from the alias code (commit 1c6b77e5) already tracks identical functions within a CU, so I've just lifted this to instead track function entrypcs at the module level. * dwflpp.cxx (dwflpp::iterate_over_functions): Remove dupe checks. * tapsets.cxx (dwarf_query): Add alias_dupes set to the query. (dwarf_query::handle_query_module): Reset the dupes for each module. (query_dwarf_func): Check that we only probe each entrypc once.
* Don't call dwarf_lowpc after dwarf_entrypc failsJosh Stone2009-08-111-7/+0
| | | | | | | | The implementation of dwarf_entrypc already checks for _lowpc, so it's redundant for us to attempt a _lowpc call too. * dwflpp.cxx (dwflpp::function_entrypc): Remove XXX comment. (dwflpp::die_entrypc): Don't bother with _lowpc if _entrypc fails
* Improved context.exp error handling.David Smith2009-08-113-10/+8
| | | | | | | | | | * testsuite/systemtap.context/context.exp: Makes sure errors are output to the log file. Also, a Makefile is copied with 'cp -p' to avoid make erroring out if the Makefile's date is in the future (as can be the case if running the test over nfs). * testsuite/systemtap.context/args.tcl: Makes sure 'close' errors are ignored. * testsuite/systemtap.context/backtrace.tcl: Ditto.
* Add 'unused' attribute to module_data and module_size arguments of ↵Dave Brolley2009-08-111-2/+4
| | | | check_permissions.