]> sourceware.org Git - systemtap.git/log
systemtap.git
15 years agopackaging: make -testsuite prereq /usr/bin/which
Frank Ch. Eigler [Tue, 8 Sep 2009 01:20:47 +0000 (21:20 -0400)]
packaging: make -testsuite prereq /usr/bin/which

15 years agobz10475.exp: Use filp_open which has a constant const char argument for test.
Mark Wielaard [Mon, 7 Sep 2009 15:06:27 +0000 (17:06 +0200)]
bz10475.exp: Use filp_open which has a constant const char argument for test.

For some reason the do_filp_open const char *pathname argument has changed
its name between different kernel versions. Luckily filp_open has a cont char
*filename argument that is constant between versions (the test needs a
const char* argument to do an array operation on).

* testsuite/semok/bz10475.stp: Use filp_open instead of do_filp_open.

15 years agoPR10613 sys32_ustat is renamed compat_sys_ustat in 2.6.30 kernel.
Mark Wielaard [Mon, 7 Sep 2009 09:36:03 +0000 (11:36 +0200)]
PR10613 sys32_ustat is renamed compat_sys_ustat in 2.6.30 kernel.

Note that the new compat_sys_ustat is asmlinkage and has a differently
named argument for the user struct.

* tapset/syscalls2.stp (syscall.ustat32): Add compat_sys_ustat variant.
  (syscall.ustat.return): Likewise.
* tapset/nd_syscalls2.stp (nd_syscall.ustat32): Likewise.
  (nd_syscall.ustat.return): Likewise.

15 years agoFix build-id check for relocatable kernel
Eugeniy Meshcheryakov [Mon, 7 Sep 2009 09:01:14 +0000 (11:01 +0200)]
Fix build-id check for relocatable kernel

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).

15 years agoMerge branch 'master' of ssh://sources.redhat.com/git/systemtap
Dave Brolley [Fri, 4 Sep 2009 20:25:50 +0000 (16:25 -0400)]
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap

15 years agorc = 0 should be return 0 for database not ownder by root.
Dave Brolley [Fri, 4 Sep 2009 20:25:14 +0000 (16:25 -0400)]
rc = 0 should be return 0 for database not ownder by root.

15 years agoCheck for bad address range or size in lookup_bad_addr.
Dave Brolley [Fri, 4 Sep 2009 16:35:26 +0000 (12:35 -0400)]
Check for bad address range or size in lookup_bad_addr.

15 years agoGet tcpdumplike.stp tested on "make check"
William Cohen [Fri, 4 Sep 2009 14:33:56 +0000 (10:33 -0400)]
Get tcpdumplike.stp tested on "make check"

15 years agoMerge branch 'master' of ssh://sources.redhat.com/git/systemtap
Dave Brolley [Thu, 3 Sep 2009 23:53:24 +0000 (19:53 -0400)]
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap

15 years agoUse task_euid when STAPCONF_TASK_UID is not defined.
Dave Brolley [Thu, 3 Sep 2009 23:52:44 +0000 (19:52 -0400)]
Use task_euid when STAPCONF_TASK_UID is not defined.

15 years agoAdd --unprivileged to the module hash
Josh Stone [Thu, 3 Sep 2009 22:57:48 +0000 (15:57 -0700)]
Add --unprivileged to the module hash

* hash.cxx (find_script_hash): Add s.unprivileged.

15 years agoMerge branch 'master' of sourceware.org:/git/systemtap
Josh Stone [Thu, 3 Sep 2009 21:31:02 +0000 (14:31 -0700)]
Merge branch 'master' of sourceware.org:/git/systemtap

15 years agoDisallow kernel space memory access when unprivileged.
Dave Brolley [Thu, 3 Sep 2009 21:19:05 +0000 (17:19 -0400)]
Disallow kernel space memory access when unprivileged.

2009-09-03  Dave Brolley  <brolley@redhat.com>

        * runtime/addr-map.c (lookup_addr_aux): Now takes size argument.
        Consider the size when looking for overlapping range with the map
        entries.
        (lookup_bad_addr): Now takes size argument. Disallow kernel space access
        when STP_PRIVILEGED is not defined. Pass size to lookup_addr_aux.
        <asm/processor.h>: #include it when STP_PRIVILEGED is not defined.
        (add_bad_addr_entry): Supply a size of 1 to calls to lookup_addr_aux.
        * runtime/loc2c-runtime.h (kread): Pass sizeof (*(ptr)) to
        lookup_bad_addr.
        (kwrite): Likewise.
        (deref): Pass size to lookup_bad_addr.
        (store_deref): Likewise.

15 years agoAllow process begin/end probes for unprivileged users.
Dave Brolley [Thu, 3 Sep 2009 20:13:30 +0000 (16:13 -0400)]
Allow process begin/end probes for unprivileged users.

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.

15 years agoEscape literal '.'s in regular expressions
Josh Stone [Thu, 3 Sep 2009 19:31:21 +0000 (12:31 -0700)]
Escape literal '.'s in regular expressions

* dwflpp.cxx (dwflpp::build_blacklist): Escape '.'s in filenames.

15 years agoUse a regexp for matching blacklist sections
Josh Stone [Thu, 3 Sep 2009 19:26:37 +0000 (12:26 -0700)]
Use a regexp for matching blacklist sections

We already use regexp for function/file blacklisting, so this just makes
the section blacklisting consistent with the rest.

* dwflpp.cxx (dwflpp::blacklisted_p): Use regexec instead of section==.
  (dwflpp::build_blacklist): Build blacklist_section too.

15 years agoFetch the blacklist section only when needed
Josh Stone [Thu, 3 Sep 2009 19:00:10 +0000 (12:00 -0700)]
Fetch the blacklist section only when needed

We only check blacklisting on kernel probes, so it's a waste to dig up
the section name otherwise.

* dwflpp.cxx (dwflpp::blacklisted_p): Lookup the section directly.
  (relocate_address::relocate_address): Don't do blacklisting here.
* tapsets.cxx (dwarf_query::add_probe_point): Don't carry the blacklist
  section directly anymore.

15 years agoPR10573: Squash duplicate inline instances
Josh Stone [Thu, 3 Sep 2009 18:32:59 +0000 (11:32 -0700)]
PR10573: Squash duplicate inline instances

In C++, identical functions included in multiple CUs will get merged at
link time into a single instance.  We need to make sure that inlines
within those merged functions are not probed multiple times.

* tapsets.cxx (inline_instance_info::operator<): Used for set support.
  (dwarf_query::handle_query_module): Clear inline_dupes on each module.
  (query_dwarf_inline_instance): Squash this inline instance if it's
  already in the inline_dupes set.

15 years agoPR10589 followup. More tapsets.cxx _stp_warn formatting fixlets.
Mark Wielaard [Thu, 3 Sep 2009 13:03:35 +0000 (15:03 +0200)]
PR10589 followup. More tapsets.cxx _stp_warn formatting fixlets.

struct kretprobe nmissed an int, but struct kprobe nmissed an unsigned long.

* tapsets.cxx (dwarf_derived_probe_group::emit_module_exit): Adjust _stp_warn
  format string for kprobe nmissed argument.
  (kprobe_derived_probe_group::emit_module_init): Likewise.

15 years agoPR10552 followup, remove -M testcases.
Mark Wielaard [Thu, 3 Sep 2009 12:02:45 +0000 (14:02 +0200)]
PR10552 followup, remove -M testcases.

* testsuite/systemtap.base/cache.exp: Remove MERGE1 and MERGE2 (-M) tests.

15 years agoPR10589 followup. tapsets.cxx _stp_warn formatting fixlets.
Mark Wielaard [Thu, 3 Sep 2009 11:54:07 +0000 (13:54 +0200)]
PR10589 followup. tapsets.cxx _stp_warn formatting fixlets.

* tapsets.cxx (dwarf_derived_probe_group::emit_module_init): Cast _stp_warn
  arguments.
  (kprobe_derived_probe_group::emit_module_init): Likewise.

15 years agoPR10572: Allow duplicate function names in a CU
Josh Stone [Thu, 3 Sep 2009 02:09:50 +0000 (19:09 -0700)]
PR10572: Allow duplicate function names in a CU

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.

15 years agoDelete stuff that dwflpp newed
Josh Stone [Thu, 3 Sep 2009 01:40:14 +0000 (18:40 -0700)]
Delete stuff that dwflpp newed

* dwflpp.cxx (dwflpp::~dwflpp): Delete all of the caches.

15 years agoProvide backward-compatible unordered_map/set
Josh Stone [Wed, 2 Sep 2009 23:43:58 +0000 (16:43 -0700)]
Provide backward-compatible unordered_map/set

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.

15 years agoUnify lex_cast* and avoid string copies
Josh Stone [Wed, 2 Sep 2009 23:14:08 +0000 (16:14 -0700)]
Unify lex_cast* and avoid string copies

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.

15 years agoReturn, don't exit mysql.exp when unsupported.
Mark Wielaard [Wed, 2 Sep 2009 19:53:21 +0000 (21:53 +0200)]
Return, don't exit mysql.exp when unsupported.

15 years agoPR10589: switch to kernel vscnprintf for _stp_{dbug,warn,error} calls in runtime
Frank Ch. Eigler [Wed, 2 Sep 2009 16:01:27 +0000 (12:01 -0400)]
PR10589: switch to kernel vscnprintf for _stp_{dbug,warn,error} calls in runtime

_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.

15 years agoAdd mysql.exp to test dtrace like support for mysql.
Stan Cox [Tue, 1 Sep 2009 21:52:44 +0000 (17:52 -0400)]
Add mysql.exp to test dtrace like support for mysql.

* testsuite/systemtap.base/mysql.exp: New.

15 years agoPR10552: Removed references to the merge ('-M') option.
David Smith [Tue, 1 Sep 2009 20:20:39 +0000 (15:20 -0500)]
PR10552: Removed references to the merge ('-M') option.
* 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.

15 years agoPR10581: Use ARCH for tracepoints and kernel typequeries
Josh Stone [Tue, 1 Sep 2009 16:38:12 +0000 (09:38 -0700)]
PR10581: Use ARCH for tracepoints and kernel typequeries

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.

15 years agoProvide accurate error message for failed utrace probe
Wenji Huang [Tue, 1 Sep 2009 02:47:12 +0000 (22:47 -0400)]
Provide accurate error message for failed utrace probe

* tapset-utrace.cxx(emit_module_init): Set probe_point.

15 years agoUse a header-cast in nd_syscall.sigaltstack
Josh Stone [Mon, 31 Aug 2009 22:22:33 +0000 (15:22 -0700)]
Use a header-cast in nd_syscall.sigaltstack

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>".

15 years agoAdd virtual memory subsystem tracepoint examples.
William Cohen [Mon, 31 Aug 2009 20:53:40 +0000 (16:53 -0400)]
Add virtual memory subsystem tracepoint examples.

15 years agoMirror the sys_sigaltstack fix in nd_syscalls
Josh Stone [Mon, 31 Aug 2009 18:22:50 +0000 (11:22 -0700)]
Mirror the sys_sigaltstack fix in nd_syscalls

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.

15 years agoFix sys_sigaltstack ussp conditional.
Mark Wielaard [Sat, 29 Aug 2009 18:42:09 +0000 (20:42 +0200)]
Fix sys_sigaltstack ussp conditional.

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).

15 years agoTighten kernel.function alias_tapset.exp expect regexp to match precisely.
Mark Wielaard [Sat, 29 Aug 2009 17:34:01 +0000 (19:34 +0200)]
Tighten kernel.function alias_tapset.exp expect regexp to match precisely.

15 years agoFix overlapping statement probe error in warnings.stp.
Mark Wielaard [Sat, 29 Aug 2009 14:49:44 +0000 (16:49 +0200)]
Fix overlapping statement probe error in warnings.stp.

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.

15 years agoTighten alias_tapset.exp expect regexp to not gobble up multiple lines.
Mark Wielaard [Sat, 29 Aug 2009 14:29:27 +0000 (16:29 +0200)]
Tighten alias_tapset.exp expect regexp to not gobble up multiple lines.

15 years agoCache inline instance lookups
Josh Stone [Sat, 29 Aug 2009 01:01:51 +0000 (18:01 -0700)]
Cache inline instance lookups

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.

15 years agoHave dtrace use [wd] as the default dir when -o isn't given.
Stan Cox [Fri, 28 Aug 2009 21:16:00 +0000 (17:16 -0400)]
Have dtrace use [wd] as the default dir when -o isn't given.

* dtrace.in: Generate the output file from basename of input filename.
* dtrace.exp: Adjust the tests accordingly.

15 years agostap-client will now always choose a compatible server even for phases 1-3.
Dave Brolley [Fri, 28 Aug 2009 20:47:20 +0000 (16:47 -0400)]
stap-client will now always choose a compatible server even for phases 1-3.
Always start a local server needed by the test suite (make {install}check).

15 years agoAdded test for pr10568.
David Smith [Fri, 28 Aug 2009 18:59:27 +0000 (13:59 -0500)]
Added test for pr10568.
* testsuite/systemtap.base/alias_tapset.exp: New file.
* testsuite/systemtap.base/alias_tapset.stp: Ditto.
* testsuite/systemtap.base/alias_tapset/tapset_test.stp: Ditto.

15 years agoAdd a NEWS blurb for || and && in the preprocessor
Josh Stone [Fri, 28 Aug 2009 18:29:17 +0000 (11:29 -0700)]
Add a NEWS blurb for || and && in the preprocessor

15 years agoUse || and && in preprocessor's conditions in tapsets.
Przemyslaw Pawelczyk [Fri, 28 Aug 2009 00:19:21 +0000 (02:19 +0200)]
Use || and && in preprocessor's conditions in tapsets.

Signed-off-by: Josh Stone <jistone@redhat.com>
15 years agoSupport || and && in preprocessor's conditions.
Przemyslaw Pawelczyk [Fri, 28 Aug 2009 00:11:47 +0000 (02:11 +0200)]
Support || and && in preprocessor's conditions.

* 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>
15 years agoCross check stap_compile.exp stap run result with error messages seen.
Mark Wielaard [Fri, 28 Aug 2009 11:51:41 +0000 (13:51 +0200)]
Cross check stap_compile.exp stap run result with error messages seen.

15 years agoTighten stap_compile.exp regexp to not accidentially gobble up extra lines.
Mark Wielaard [Fri, 28 Aug 2009 10:35:04 +0000 (12:35 +0200)]
Tighten stap_compile.exp regexp to not accidentially gobble up extra lines.

15 years agoPR10568: Ensure that aliases pull in their tapset
Josh Stone [Thu, 27 Aug 2009 22:43:51 +0000 (15:43 -0700)]
PR10568: Ensure that aliases pull in their tapset

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.

15 years agoxfail backtrace.exp as PR6961 backtrace from non-pt_regs probe context
Mark Wielaard [Thu, 27 Aug 2009 21:42:56 +0000 (23:42 +0200)]
xfail backtrace.exp as PR6961 backtrace from non-pt_regs probe context

15 years agoReturn, don't exit postgres.exp when unsupported.
Mark Wielaard [Thu, 27 Aug 2009 21:34:17 +0000 (23:34 +0200)]
Return, don't exit postgres.exp when unsupported.

15 years agoTeach postgres.exp to use a locally built version of postgres.
Stan Cox [Thu, 27 Aug 2009 18:47:08 +0000 (14:47 -0400)]
Teach postgres.exp to use a locally built version of postgres.

* postgres.exp: Grab postgres from upstream then build and test it
with uprobe, utrace, and kprobe.

15 years agoReorganize iterate_over_labels
Josh Stone [Thu, 27 Aug 2009 03:09:48 +0000 (20:09 -0700)]
Reorganize iterate_over_labels

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.

15 years agoRemove unnecessary static members
Josh Stone [Thu, 27 Aug 2009 00:35:54 +0000 (17:35 -0700)]
Remove unnecessary static members

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.

15 years agoCleanup some deref handling in the task tapset
Josh Stone [Thu, 27 Aug 2009 00:05:29 +0000 (17:05 -0700)]
Cleanup some deref handling in the task tapset

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!

15 years agoCorrect a few comments to match the code
Josh Stone [Wed, 26 Aug 2009 23:15:46 +0000 (16:15 -0700)]
Correct a few comments to match the code

* 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.

15 years agoIncrease avahi-browse timeout to 20 seconds.
Dave Brolley [Wed, 26 Aug 2009 16:36:25 +0000 (12:36 -0400)]
Increase avahi-browse timeout to 20 seconds.

15 years agoAllow 20 seconds for the server to start up.
Dave Brolley [Wed, 26 Aug 2009 14:46:50 +0000 (10:46 -0400)]
Allow 20 seconds for the server to start up.
Use ps -e to check for server and avahi pids.

15 years agoPR4186 cont'd: Squash EM_S390 to s390.
Mark Wielaard [Wed, 26 Aug 2009 11:16:17 +0000 (13:16 +0200)]
PR4186 cont'd: Squash EM_S390 to s390.

* tapsets.cxx (validate_module_elf): Set expect_machine to "s390".

15 years agoCompute cu_name dynamically
Josh Stone [Wed, 26 Aug 2009 01:53:40 +0000 (18:53 -0700)]
Compute cu_name dynamically

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.

15 years agoAvoid needless Dwarf_Die copying
Josh Stone [Wed, 26 Aug 2009 01:20:39 +0000 (18:20 -0700)]
Avoid needless Dwarf_Die copying

* 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.

15 years agoConvert module_cu_cache_t to a stap_map
Josh Stone [Wed, 26 Aug 2009 00:42:55 +0000 (17:42 -0700)]
Convert module_cu_cache_t to a stap_map

* dwflpp.cxx (module_cu_cache_t): Typedef as a stap_map instead.

15 years agoIndex cu_inl_function_cache_t by function->addr
Josh Stone [Wed, 26 Aug 2009 00:23:28 +0000 (17:23 -0700)]
Index cu_inl_function_cache_t by function->addr

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.

15 years agoIndex mod_cu_function_cache_t by cu->addr
Josh Stone [Tue, 25 Aug 2009 23:58:20 +0000 (16:58 -0700)]
Index mod_cu_function_cache_t by cu->addr

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.

15 years agoPR4186 cont'd: clarify ARCH naming in NEWS too
Frank Ch. Eigler [Tue, 25 Aug 2009 16:38:33 +0000 (12:38 -0400)]
PR4186 cont'd: clarify ARCH naming in NEWS too

15 years agoPR4186 cont'd: option #2: standardize on kernel ARCH/SUBARCH throughout
Frank Ch. Eigler [Tue, 25 Aug 2009 15:54:15 +0000 (11:54 -0400)]
PR4186 cont'd: option #2: standardize on kernel ARCH/SUBARCH throughout

* 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".

15 years agoKFAIL cmd_parse15 on kernel < 2.6.29, see commit e0ccd3.
Mark Wielaard [Tue, 25 Aug 2009 15:18:00 +0000 (17:18 +0200)]
KFAIL cmd_parse15 on kernel < 2.6.29, see commit e0ccd3.

* testsuite/systemtap.base/cmd_parse.exp: kfail cmd_parse15 when
  kernel26ver < 29.

15 years agoMake inlinedvars empty asm really empty.
Mark Wielaard [Tue, 25 Aug 2009 12:25:43 +0000 (14:25 +0200)]
Make inlinedvars empty asm really empty.

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.

15 years agoPR2475: Filter filenames against the decl_file
Josh Stone [Tue, 25 Aug 2009 00:54:40 +0000 (17:54 -0700)]
PR2475: Filter filenames against the decl_file

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>.

15 years agoPR4186 cont'd: uname -m --> uname -i in test cases
Frank Ch. Eigler [Mon, 24 Aug 2009 23:42:28 +0000 (19:42 -0400)]
PR4186 cont'd: uname -m  -->  uname -i in test cases

15 years agoPR4186 cont'd: move tapset/i686 -> tapset/i386
Frank Ch. Eigler [Mon, 24 Aug 2009 23:38:51 +0000 (19:38 -0400)]
PR4186 cont'd: move tapset/i686 -> tapset/i386

15 years agoPR4186 cont'd: tolerate older kbuild Makefile's chattiness
Frank Ch. Eigler [Mon, 24 Aug 2009 17:14:21 +0000 (13:14 -0400)]
PR4186 cont'd: tolerate older kbuild Makefile's chattiness

* buildrun.cxx (run_make_cmd): Add back >/dev/null for older kernels.

15 years agoPR4186 cont'd: fix 32-bit i386 builds
Frank Ch. Eigler [Mon, 24 Aug 2009 16:54:42 +0000 (12:54 -0400)]
PR4186 cont'd: fix 32-bit i386 builds

* main.cxx (main): Initialize s.architecture to value as if
  from `uname -i`.  Specifically, squash i?86 -> i386.

15 years agoRename cache.exp proc stap_compile to cache_compile to not conflict.
Mark Wielaard [Mon, 24 Aug 2009 15:40:12 +0000 (17:40 +0200)]
Rename cache.exp proc stap_compile to cache_compile to not conflict.

* testsuite/systemtap.base/cache.exp: Rename proc stap_compile to
  cache_compile, to prevent conflict with proc stap_compile from
  lib/stap_compile.exp.

15 years agoFix failing uprobes.exp -p5 failures by removing trailing spaces in $$ vars.
Mark Wielaard [Mon, 24 Aug 2009 15:09:29 +0000 (17:09 +0200)]
Fix failing uprobes.exp -p5 failures by removing trailing spaces in $$ vars.

* 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.

15 years agoPR4186: cross-architecture probe building
Frank Ch. Eigler [Mon, 24 Aug 2009 14:34:45 +0000 (10:34 -0400)]
PR4186: cross-architecture probe building

* 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.

15 years agoInitialize sdt_types testcase arr_char so that it is always null terminated.
Mark Wielaard [Mon, 24 Aug 2009 13:07:19 +0000 (15:07 +0200)]
Initialize sdt_types testcase arr_char so that it is always null terminated.

* 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.

15 years agoSimplify mkstemp invocation.
Stan Cox [Mon, 24 Aug 2009 01:51:28 +0000 (21:51 -0400)]
Simplify mkstemp invocation.

*dtrace:  Don't bother with prefix when invoking mkstemp.

15 years agoPR10551: cont'd
Frank Ch. Eigler [Sun, 23 Aug 2009 23:10:36 +0000 (19:10 -0400)]
PR10551: cont'd

* runtime/print.c (_stp_print_kernel_info): Also switch module_core->module_core_rx.

15 years agoPR10551: build compatibility for pax/grsecurity include/linux/module.h
Frank Ch. Eigler [Sun, 23 Aug 2009 22:18:21 +0000 (18:18 -0400)]
PR10551: build compatibility for pax/grsecurity include/linux/module.h

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.

15 years agobuild fix: make buildable with elfutils < 0.142
Frank Ch. Eigler [Sun, 23 Aug 2009 22:15:01 +0000 (18:15 -0400)]
build fix: make buildable with elfutils < 0.142

* dwarf_wrappers.h, loc2c.c: Define DW_TAG_rvalue_reference_type=0x42
  for older elfutils.

15 years agoPR10461: Add support for C++ classes and references
Josh Stone [Sat, 22 Aug 2009 02:16:18 +0000 (19:16 -0700)]
PR10461: Add support for C++ classes and references

* 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.

15 years agoPR10507: tweak MAXUPROBES calculation to shrink table for small static number of...
Frank Ch. Eigler [Fri, 21 Aug 2009 21:16:13 +0000 (17:16 -0400)]
PR10507: tweak MAXUPROBES calculation to shrink table for small static 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.

15 years agoPR10543: do module cache cleaning before copying new file into the cache
Frank Ch. Eigler [Fri, 21 Aug 2009 20:22:29 +0000 (16:22 -0400)]
PR10543: do module cache cleaning before copying new file into the cache

... otherwise the new stuff can get cleaned before use.

* cache.cxx (add_to_cache): Do clean_cache() first, not last.

15 years agoPR10544: clean up stap child process error handling
Frank Ch. Eigler [Fri, 21 Aug 2009 20:00:27 +0000 (16:00 -0400)]
PR10544: clean up stap child process error handling

* util.cxx (stap_system): Take extra verbosity value.  Standardize
  error handling / tracing.
* util.h: Corresponding changes.
* buildrun.cxx, main.cxx, modsign.cxx: Update callers.

15 years agocleanup: rename task_finder_target->pathname -> procname
Frank Ch. Eigler [Fri, 21 Aug 2009 17:29:50 +0000 (13:29 -0400)]
cleanup: rename task_finder_target->pathname -> procname

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.

15 years agoTwo minor testcase fixes.
David Smith [Thu, 20 Aug 2009 21:54:06 +0000 (16:54 -0500)]
Two minor testcase fixes.
* testsuite/systemtap.base/global_stat.exp: Improved error handling.
* testsuite/systemtap.base/strftime.exp: Ditto.

15 years ago* dtrace.in: Support -C, preprocess with cpp, which upstream postgres
Stan Cox [Thu, 20 Aug 2009 16:51:48 +0000 (12:51 -0400)]
* dtrace.in: Support -C, preprocess with cpp, which upstream postgres
  is now using.

15 years agoPR10537 process().function().label() should select multiple inlined instances.
Mark Wielaard [Thu, 20 Aug 2009 14:31:55 +0000 (16:31 +0200)]
PR10537 process().function().label() should select multiple inlined instances.

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.

15 years agoTwo minor testcase fixes.
David Smith [Thu, 20 Aug 2009 13:41:03 +0000 (08:41 -0500)]
Two minor testcase fixes.
* testsuite/systemtap.base/poll_map.exp: Improved error handling.
* testsuite/systemtap.base/postgres.exp: Fixed typo.

15 years agoPR10228: fix non-utrace building regression - cont'd
Wenji Huang [Thu, 20 Aug 2009 04:06:50 +0000 (00:06 -0400)]
PR10228: fix non-utrace building regression - cont'd

* runtime/task_finder.c (non-UTRACE): Return 0 for
  stap_start_task_finder.
* translate.cxx (emit_module_init): Let vma tracker
  specific to utrace.

15 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
Josh Stone [Thu, 20 Aug 2009 01:34:18 +0000 (18:34 -0700)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

15 years agoGive a more exact error for dereferencing void*
Josh Stone [Thu, 20 Aug 2009 01:23:32 +0000 (18:23 -0700)]
Give a more exact error for dereferencing void*

* dwflpp.cxx (dwflpp::translate_components): Check for void* deref.

15 years agoPR10538: Give a file:line hint for anonymous types
Josh Stone [Thu, 20 Aug 2009 01:19:53 +0000 (18:19 -0700)]
PR10538: Give a file:line hint for anonymous types

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.

15 years agoCreate a dwarf_attr_die idiom
Josh Stone [Thu, 20 Aug 2009 00:27:18 +0000 (17:27 -0700)]
Create a dwarf_attr_die idiom

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.

15 years agoUse dwarf_diename instead of a DW_AT_name lookup
Josh Stone [Thu, 20 Aug 2009 00:07:30 +0000 (17:07 -0700)]
Use dwarf_diename instead of a DW_AT_name lookup

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.

15 years agoUse dwarf_type_name in more places
Josh Stone [Wed, 19 Aug 2009 23:48:53 +0000 (16:48 -0700)]
Use dwarf_type_name in more places

* 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.

15 years agoPR10538: Use {...} for naming anonymous types
Josh Stone [Wed, 19 Aug 2009 21:40:53 +0000 (14:40 -0700)]
PR10538: Use {...} for naming anonymous types

* tapsets.cxx (dwarf_type_name): Handle NULL dwarf_diename.

15 years agoMerge branch 'master' of ssh://sources.redhat.com/git/systemtap
David Smith [Wed, 19 Aug 2009 21:02:26 +0000 (16:02 -0500)]
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap

15 years agoUpdated with latest code.
David Smith [Wed, 19 Aug 2009 21:01:45 +0000 (16:01 -0500)]
Updated with latest code.
* 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.

15 years agoPR10538: Improve location lookup for unions
Josh Stone [Wed, 19 Aug 2009 20:30:31 +0000 (13:30 -0700)]
PR10538: Improve location lookup for unions

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.

This page took 0.06947 seconds and 5 git commands to generate.