summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* PR4186 cont'd: Squash EM_S390 to s390.Mark Wielaard2009-08-261-1/+1
| | | | * tapsets.cxx (validate_module_elf): Set expect_machine to "s390".
* Compute cu_name dynamicallyJosh Stone2009-08-253-9/+15
| | | | | | | | | | | | We only need cu_name for errors and verbose messages, so it's a waste to always construct it in focus_on_cu. It's now built only as-needed. * dwflpp.cxx (dwflpp::cu_name): Now a method instead of a data member. (dwflpp::focus_on_module): No cu_name to clear now. (dwflpp::focus_on_cu): No cu_name to set now. (dwflpp::declaration_resolve): Adjust to call cu_name() now. (dwflpp::iterate_over_functions): Ditto. * tapsets.cxx (query_cu): Ditto.
* Avoid needless Dwarf_Die copyingJosh Stone2009-08-251-14/+11
| | | | | | | * dwflpp.cxx (dwflpp::iterate_over_cus): Use the Dwarf_Die as a pointer directly into the vector. (dwflpp::iterate_over_inline_instances): Ditto. (dwflpp::iterate_over_functions): Ditto in a map.
* Convert module_cu_cache_t to a stap_mapJosh Stone2009-08-251-1/+3
| | | | * dwflpp.cxx (module_cu_cache_t): Typedef as a stap_map instead.
* Index cu_inl_function_cache_t by function->addrJosh Stone2009-08-252-4/+5
| | | | | | | | Again, avoid needless string construction for map indexing. * dwflpp.h (cu_inl_function_cache_t): Index by the void* function->addr. * dwflpp.cxx (dwflpp::iterate_over_inline_instances): Index cu_inl_function_cache by function->addr.
* Index mod_cu_function_cache_t by cu->addrJosh Stone2009-08-252-18/+25
| | | | | | | | | | | | | | | Rather than constructing a "module:cu" string all the time, we can just index the cache by the cu die's addr field. The addr will never change as long as the Dwarf object is still alive. This has a quite noticeable performance impact for scripts that iterate over lots of cus (like for syscall.*). * dwflpp.h (stap_map): Allow void* keys too. (mod_cu_function_cache_t): Index by the void* cu->addr. * dwflpp.cxx (dwflpp::iterate_over_functions): Index cu_function_cache by addr, and build the verbose strings manually when needed. (dwflpp::declaration_resolve): Index global_alias_cache by addr.
* PR4186 cont'd: clarify ARCH naming in NEWS tooFrank Ch. Eigler2009-08-251-0/+6
|
* PR4186 cont'd: option #2: standardize on kernel ARCH/SUBARCH throughoutFrank Ch. Eigler2009-08-2516-31/+43
| | | | | | | | * main.cxx (main): Perform equivalent sed by hand on uname()->machine. * stap.1.in: Clarify -a ARCH slightly. * tapsets.cxx (validate_module_elf): Accept "arm*"for EM_ARM. * tapset/**, testsuite/**: Removed/collapsed "i386"/"i686" branches, renamed "ppc64"->"powerpc" and "s390x"->"s390".
* KFAIL cmd_parse15 on kernel < 2.6.29, see commit e0ccd3.Mark Wielaard2009-08-251-0/+5
| | | | | * testsuite/systemtap.base/cmd_parse.exp: kfail cmd_parse15 when kernel26ver < 29.
* Make inlinedvars empty asm really empty.Mark Wielaard2009-08-251-1/+1
| | | | | | | A debug "nop" was accidentially left in the asm statement that should have been totally empty. * testsuite/systemtap.base/inlinedvars.c (m): Really empty asm.
* PR2475: Filter filenames against the decl_fileJosh Stone2009-08-243-7/+14
| | | | | | | | | | | | We used to only check that a CU contains at least one srcfile matching the user's file spec. This patch ensures that the selected function was actually defined in one of the matching srcfiles. * tapsets.cxx (struct dwarf_query): Make filtered_srcfiles carry strings, so we can easily lookup matches later. (query_dwarf_func): Check that the decl_file is in filtered_srcfiles. (query_cu): Adjust to using set<string>. * dwflpp.cxx (dwflpp::collect_srcfiles_matching): Take a set<string>.
* PR4186 cont'd: uname -m --> uname -i in test casesFrank Ch. Eigler2009-08-244-5/+5
|
* PR4186 cont'd: move tapset/i686 -> tapset/i386Frank Ch. Eigler2009-08-243-0/+0
|
* PR4186 cont'd: tolerate older kbuild Makefile's chattinessFrank Ch. Eigler2009-08-241-0/+8
| | | | * buildrun.cxx (run_make_cmd): Add back >/dev/null for older kernels.
* PR4186 cont'd: fix 32-bit i386 buildsFrank Ch. Eigler2009-08-241-0/+5
| | | | | * main.cxx (main): Initialize s.architecture to value as if from `uname -i`. Specifically, squash i?86 -> i386.
* Rename cache.exp proc stap_compile to cache_compile to not conflict.Mark Wielaard2009-08-241-22/+22
| | | | | | * testsuite/systemtap.base/cache.exp: Rename proc stap_compile to cache_compile, to prevent conflict with proc stap_compile from lib/stap_compile.exp.
* Fix failing uprobes.exp -p5 failures by removing trailing spaces in $$ vars.Mark Wielaard2009-08-243-8/+12
| | | | | | | | * tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol_context): Don't add extra space at end of list, only add space between symbols. * testsuite/systemtap.base/uprobes.exp: Use more specific expect regex. * testsuite/systemtap.base/vars.exp: Don't just chop off last char of printf output string.
* PR4186: cross-architecture probe buildingFrank Ch. Eigler2009-08-247-7/+69
| | | | | | | | | | | * main.cxx (main): Add 'a:' and 'B:' options. * session.h (kbuildflags): New place to store -B args. * testsuite/systemtap.base/cmd_parse.exp: Test them lightly. * buildrun.cxx (run_make_cmd): Use "--no-print-directory" rather than ">/dev/null" in kbuild invocations. Pass '-a' and '-B' flags along. * hash.cxx (find_script_hash): Add them. * NEWS, stap.1.in: Mention this.
* Initialize sdt_types testcase arr_char so that it is always null terminated.Mark Wielaard2009-08-241-1/+1
| | | | | | * testsuite/systemtap.base/sdt_types.c: Initialize char arr_char [], not with (too small) constant length, to make sure the string is always null terminated.
* Simplify mkstemp invocation.Stan Cox2009-08-231-1/+1
| | | | *dtrace: Don't bother with prefix when invoking mkstemp.
* PR10551: cont'dFrank Ch. Eigler2009-08-231-1/+2
| | | | * runtime/print.c (_stp_print_kernel_info): Also switch module_core->module_core_rx.
* PR10551: build compatibility for pax/grsecurity include/linux/module.hFrank Ch. Eigler2009-08-233-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adapts to patches such as: diff -urNp linux-2.6.29.6/include/linux/module.h linux-2.6.29.6/include/linux/module.h --- linux-2.6.29.6/include/linux/module.h 2009-07-02 19:41:20.000000000 -0400 +++ linux-2.6.29.6/include/linux/module.h 2009-07-30 17:59:26.175602427 -0400 @@ -278,16 +278,16 @@ struct module int (*init)(void); /* If this is non-NULL, vfree after init() returns */ - void *module_init; + void *module_init_rx, *module_init_rw; /* Here is the actual code + data, vfree'd on unload. */ - void *module_core; + void *module_core_rx, *module_core_rw; /* Here are the sizes of the init and core sections */ - unsigned int init_size, core_size; + unsigned int init_size_rw, core_size_rw; /* The size of the executable code in each section. */ - unsigned int init_text_size, core_text_size; + unsigned int init_size_rx, core_size_rx; * runtime/autoconf-grsecurity.c: New test. * buildrun.cxx: Try it. * runtime/print.c: Use it.
* 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
|