summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* PR10572: Allow duplicate function names in a CUJosh Stone2009-09-023-24/+29
| | | | | | | | | | | | | | | | | | We can't assume that a given function name will only appear once in a CU. In C++, two functions may have the same name in different classes or namespaces, or even in the same scope with overloaded parameters. Even in C, the compiler may generate multiple copies of a single function with different optimizations. We now use a multimap for function names, so we shouldn't miss any. * dwflpp.h (cu_type_cache_t, mod_cu_type_cache_t): New typedef to keep a normal map for the global_alias_cache. (cu_function_cache_t): Use a multimap for function names. * dwflpp.cxx (dwflpp::iterate_over_functions): Walk over the range of exactly-matching functions. * tapsets.cxx (query_dwarf_func): Don't abort after seeing an exact match -- there could be more to come.
* Delete stuff that dwflpp newedJosh Stone2009-09-021-0/+17
| | | | * dwflpp.cxx (dwflpp::~dwflpp): Delete all of the caches.
* Provide backward-compatible unordered_map/setJosh Stone2009-09-022-20/+61
| | | | | | | | | | | | | | | We were defining our own stap_map with a ::type to let us use typedefs to use the new unordered_map if available, or hash_map otherwise. Since unordered_map is the future direction, I'm changing our code to use that directly. The backward-compatible version is a #define to hash_map, which has a compatible interface. While I'm at it, let's also define unordered_multimap, unordered_set, and unordered_multiset. * unordered.h: New. * dwflpp.h (stap_map): Removed. (cache typedefs): Use the unordered name now.
* Unify lex_cast* and avoid string copiesJosh Stone2009-09-0214-105/+108
| | | | | | | | | | | | | | | 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.
* Return, don't exit mysql.exp when unsupported.Mark Wielaard2009-09-021-1/+1
|
* PR10589: switch to kernel vscnprintf for _stp_{dbug,warn,error} calls in runtimeFrank Ch. Eigler2009-09-025-21/+24
| | | | | | | | | | | _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.
* Add mysql.exp to test dtrace like support for mysql.Stan Cox2009-09-012-1/+345
| | | | * testsuite/systemtap.base/mysql.exp: New.
* PR10552: Removed references to the merge ('-M') option.David Smith2009-09-017-33/+3
| | | | | | | | | | | * hash.cxx (find_script_hash): Removed unused merge option. * main.cxx (checkOptions): Removed merge option checks. (main): Removed merge option. * session.h: Ditto. * initscript/README.initscript: Removed reference to '-M' option. * initscript/systemtap.in (stap_getopt): Ditto. * testsuite/parseko/cmdline01.stp: Removed merge option test. * testsuite/parseko/cmdline05.stp: Ditto.
* PR10581: Use ARCH for tracepoints and kernel typequeriesJosh Stone2009-09-012-1/+29
| | | | | | | | | | | | These are kernel modules that we generate for querying debuginfo, so they need to use the same ARCH settings that we put in the main script module. * buildrun.cxx (make_tracequery, make_typequery_kmod): Add the arch and kbuild flags to make_cmd. * hash.cxx (find_stapconf_hash, find_tracequery_hash, find_typequery_hash): The arch is in the base hash already, but add the kbuild flags too.
* Provide accurate error message for failed utrace probeWenji Huang2009-08-311-0/+2
| | | | * tapset-utrace.cxx(emit_module_init): Set probe_point.
* Use a header-cast in nd_syscall.sigaltstackJosh Stone2009-08-311-1/+2
| | | | | | | | | The nd_syscalls tapset is meant to run with no debuginfo, so using a @cast into a module type defeats the purpose. We should use a @cast with a header name instead, so debuginfo is generated. * tapset/i386/nd_syscalls.stp (nd_syscall.sigaltstack): Get the pt_regs type definition from "kernel<asm/ptrace.h>".
* Add virtual memory subsystem tracepoint examples.William Cohen2009-08-3112-0/+437
|
* Mirror the sys_sigaltstack fix in nd_syscallsJosh Stone2009-08-311-2/+2
| | | | | | | The argument fix in commit 77c26b4 needs to be made in nd_syscalls too, where the conditional kernel should be 2.6.30 instead of 2.6.29. * tapset/i386/nd_syscalls.stp (nd_syscall.sigaltstack): Check 2.6.30.
* Fix sys_sigaltstack ussp conditional.Mark Wielaard2009-08-291-1/+1
| | | | | | | | For i386 sys_sigaltstack changed argument params starting with kernel commit b12bda which was only included in 2.6.30, not in any 2.6.29 kernel. * tapset/i386/syscalls.stp (sys_sigaltstack): ussp conditional should be kernel_v < "2.6.30" for param change (from bx to regs).
* Tighten kernel.function alias_tapset.exp expect regexp to match precisely.Mark Wielaard2009-08-291-1/+1
|
* Fix overlapping statement probe error in warnings.stp.Mark Wielaard2009-08-291-1/+1
| | | | | | | | | | | | | Instead of generating a warning the current kernel.statement probe produced a warning on some 386 kernels that had optimized that particular line: semantic error: multiple addresses for fs/bio.c:282 (try fs/bio.c:278 or fs/bio.c:284) semantic error: no match while resolving probe point kernel.statement("bio_init@fs/bio.c+3") So do as told to just get the expected warnings for this probe. * testsuite/systemtap.base/warnings.stp (probea): Probe bio_init@fs/bio.c+5.
* Tighten alias_tapset.exp expect regexp to not gobble up multiple lines.Mark Wielaard2009-08-291-4/+4
|
* Cache inline instance lookupsJosh Stone2009-08-282-12/+52
| | | | | | | | | | | | | | | | | | | | We used to call dwarf_func_inline_instances to get the locations where inlines are used. This function has to iterate through nearly all DIEs to find instances, which is a lot of redundant work when we're probing multiple inline functions. Now we have our own dwarf iterator to cache all inline instances back to their origin. This only needs to be called once for each CU, and all further inlines are just a map lookup. Some quick benchmarks: stap -l Before After kernel.function("*") 25010ms 2110ms module("*").function("*") 86550ms 16920ms process("stap").function("*") 41330ms 580ms * dwflpp.cxx (dwflpp::cu_inl_function_caching_callback): Removed. (dwflpp::cache_inline_instances): New caching iterator. (dwflpp::iterate_over_inline_instances): Cache each CU once.
* Have dtrace use [wd] as the default dir when -o isn't given.Stan Cox2009-08-282-5/+5
| | | | | * dtrace.in: Generate the output file from basename of input filename. * dtrace.exp: Adjust the tests accordingly.
* stap-client will now always choose a compatible server even for phases 1-3.Dave Brolley2009-08-282-9/+8
| | | | Always start a local server needed by the test suite (make {install}check).
* Added test for pr10568.David Smith2009-08-283-0/+43
| | | | | | * testsuite/systemtap.base/alias_tapset.exp: New file. * testsuite/systemtap.base/alias_tapset.stp: Ditto. * testsuite/systemtap.base/alias_tapset/tapset_test.stp: Ditto.
* Add a NEWS blurb for || and && in the preprocessorJosh Stone2009-08-281-0/+3
|
* Use || and && in preprocessor's conditions in tapsets.Przemyslaw Pawelczyk2009-08-281-13/+3
| | | | Signed-off-by: Josh Stone <jistone@redhat.com>
* Support || and && in preprocessor's conditions.Przemyslaw Pawelczyk2009-08-285-17/+54
| | | | | | | | | | * parse.cxx (parser::scan_pp): Add || and &&. * stap.1.in: Document || and && in PREPROCESSING. * testsuite/parseok/twenty.stp: Test case. * testsuite/parseko/preprocess14.stp: Ditto. * testsuite/parseko/preprocess15.stp: Ditto. Signed-off-by: Josh Stone <jistone@redhat.com>
* Cross check stap_compile.exp stap run result with error messages seen.Mark Wielaard2009-08-281-1/+14
|
* Tighten stap_compile.exp regexp to not accidentially gobble up extra lines.Mark Wielaard2009-08-281-1/+1
|
* PR10568: Ensure that aliases pull in their tapsetJosh Stone2009-08-275-0/+48
| | | | | | | | | | | When a probe alias is resolved in a tapset, the contents of that tapset should be included in the compiled script, just as we do for global variables and functions. * elaborate.cxx (alias_expansion_builder::build): When an alias is instantiated, add its stapfile to the session files. * testsuite/systemtap.base/tapset_includes.exp: New test. * testsuite/systemtap.base/tapset/*.stp: Testing tapsets for above.
* xfail backtrace.exp as PR6961 backtrace from non-pt_regs probe contextMark Wielaard2009-08-271-0/+4
|
* Return, don't exit postgres.exp when unsupported.Mark Wielaard2009-08-271-1/+1
|
* Teach postgres.exp to use a locally built version of postgres.Stan Cox2009-08-271-62/+92
| | | | | * postgres.exp: Grab postgres from upstream then build and test it with uprobe, utrace, and kprobe.
* Reorganize iterate_over_labelsJosh Stone2009-08-263-71/+80
| | | | | | | | | | | | | | | I noticed that iterate_over_labels was using a static variable as a recursion variable, which isn't a safe thing to do since it will only be initialized once. While fixing that, I also reorganized the function quite a bit. * dwflpp.cxx (dwflpp::iterate_over_labels): Take the current function as a parameter instead of using a static local. Rewrite some of the code as well to try to make it more obvious. * tapsets.cxx (add_label_name): Remove in favor of query_label. (query_label): New, to check decl_file and fix probe listing. (query_srcfile_label, query_cu): Adjust to iterate_over_labels change and start using query_label as the callback.
* Remove unnecessary static membersJosh Stone2009-08-263-12/+3
| | | | | | | | | When a static class member is only used by a single method, it's more concise to use a static local variable instead. * staptree.cxx (probe::probe): Make last_probeidx a static local. * tapset-perfmon.cxx (perfmon_derived_probe::perfmon_derived_probe): Make probes_allocated a static local.
* Cleanup some deref handling in the task tapsetJosh Stone2009-08-261-11/+20
| | | | | | | | | | | | | Some of this is just cosmetic, but there is one big takeaway: there's a error-goto between kread calls and the CATCH_DEREF_FAULT. You must not allow this to bypass any resource management, like unlocking a resource that you grabbed! * tapset/task.stp (pid2task): No derefs, so remove the CATCH. (task_gid, task_egid, task_uid, task_euid): Move the CATCH within the #ifdef branch that actually needs it. (task_open_file_handles, task_max_file_handles): Ensure that we always call rcu_read_unlock if we locked it!
* Correct a few comments to match the codeJosh Stone2009-08-263-6/+6
| | | | | | | * tapset/conversions.stp (kernel_long, kernel_int, kernel_short, kernel_char): All are actually using kread(), not deref(). * tapset/i386/registers.stp (_stp_arg): Ditto. * tapset/x86_64/registers.stp (_stp_arg): Ditto.
* Increase avahi-browse timeout to 20 seconds.Dave Brolley2009-08-261-1/+1
|
* Allow 20 seconds for the server to start up.Dave Brolley2009-08-261-3/+4
| | | | Use ps -e to check for server and avahi pids.
* 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.