]> sourceware.org Git - systemtap.git/log
systemtap.git
12 years agoFixed PR13428 by updating nfsd.stp.
David Smith [Tue, 22 Nov 2011 15:10:26 +0000 (09:10 -0600)]
Fixed PR13428 by updating nfsd.stp.

* tapset/nfsd.stp: Fixed nfsd.createv3 and nfsd.createv3.return probes
  after the kernel function they probe was renamed.

12 years agoAdd autoconf check for the addition of the pte argument for alloc_vm_area
William Cohen [Mon, 21 Nov 2011 22:21:20 +0000 (17:21 -0500)]
Add autoconf check for the addition of the pte argument for alloc_vm_area

Linux Kernel commit cd12909cb5 add the pt argument to the alloc_vm_area
function. Need to check whether that pte argument exists and sets a define
as required.

12 years agoMerge branch 'master' of ssh://sources.redhat.com/git/systemtap
William Cohen [Mon, 21 Nov 2011 21:38:39 +0000 (16:38 -0500)]
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap

12 years agoMerge branch 'master' into dsmith/task_finder2
David Smith [Mon, 21 Nov 2011 19:28:40 +0000 (13:28 -0600)]
Merge branch 'master' into dsmith/task_finder2

12 years agoUpdate testsuite to check for new utrace requirements.
David Smith [Mon, 21 Nov 2011 18:03:03 +0000 (12:03 -0600)]
Update testsuite to check for new utrace requirements.

* testsuite/lib/systemtap.exp (utrace_p): Properly tests for the new
  utrace requirements.
* runtime/task_finder.c: Remove code that hardcoded new utrace.
* runtime/uprobes/uprobes.h: Reset to "normal" version.

12 years agoMerge branch 'master' of ssh://sources.redhat.com/git/systemtap
William Cohen [Mon, 21 Nov 2011 15:15:23 +0000 (10:15 -0500)]
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap

12 years agotestsuite/systemtap.base/cast-scope.exp: KFAIL: cast-scope-m64 (PRMS: 13420)
Mark Wielaard [Mon, 21 Nov 2011 12:23:46 +0000 (13:23 +0100)]
testsuite/systemtap.base/cast-scope.exp: KFAIL: cast-scope-m64 (PRMS: 13420)

PR13420 prologue detection fails for unoptimized 64bit cast-scope.exp.

12 years agotestsuite/lib/systemtap.exp: Check abi arch flags (-m64, -m32/31) work.
Mark Wielaard [Mon, 21 Nov 2011 10:51:24 +0000 (11:51 +0100)]
testsuite/lib/systemtap.exp: Check abi arch flags (-m64, -m32/31) work.

Make sure all development packages for the supported ABIs (-m64 -m32/-m31)
are installed by building a quick hello.c and hello.cxx program with both.

12 years agoAdd testsuite/lib/compile_flags.exp and use it in tests.
Mark Wielaard [Sat, 19 Nov 2011 19:45:49 +0000 (20:45 +0100)]
Add testsuite/lib/compile_flags.exp and use it in tests.

testsuite/lib/compile_flags.exp defines all_compile_flags(),
all_compile_flag(INDEX) and all_compile_flag_name(INDEX) which return
the number, actual flag and extra test name to use in tests that use
target_compile for use space testing. On architectures that support
multiple ABIs it will return all combinations of all optimizations
(none, -O, -O2) and the ABI flags (-m64, -m32 or -m31).

Use in a for loop like: for {set i 0} {$i < [all_compile_flags]} {incr i} {
  set extra_flag [all_compile_flag $i] # Add to target_compile flags
  set extra_name [all_compile_flag_name $i] # Add to test pass/fail message
...
}

12 years agouprobe_stmt_num.exp run the last test, but explicitl kfail PR10454.
Mark Wielaard [Sat, 19 Nov 2011 18:07:47 +0000 (19:07 +0100)]
uprobe_stmt_num.exp run the last test, but explicitl kfail PR10454.

12 years agoCheck for the new task_finder config variable requirement.
David Smith [Fri, 18 Nov 2011 20:37:11 +0000 (14:37 -0600)]
Check for the new task_finder config variable requirement.

* tapsets.cxx (check_process_probe_kernel_support): Add support for the
  requirements of the new task_finder (and even look ahead to the new
  uprobes).
* tapset-utrace.cxx (utrace_derived_probe_group::emit_module_decls): Minor
  change to match "real" tapset-utrace.cxx.

12 years agoMerge branch 'master' of ssh://sources.redhat.com/git/systemtap
William Cohen [Fri, 18 Nov 2011 20:22:03 +0000 (15:22 -0500)]
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap

12 years agoMerge branch 'master' into dsmith/task_finder2
David Smith [Fri, 18 Nov 2011 19:35:02 +0000 (13:35 -0600)]
Merge branch 'master' into dsmith/task_finder2

12 years agoMove common CONFIG_UTRACE check to its own function.
David Smith [Fri, 18 Nov 2011 19:28:54 +0000 (13:28 -0600)]
Move common CONFIG_UTRACE check to its own function.

* tapsets.cxx (check_process_probe_kernel_support): New function.
  (dwarf_builder::build): Moved CONFIG_UTRACE check to
  check_process_probe_kernel_support() which we call instead.
* tapset-utrace.cxx (utrace_derived_probe::utrace_derived_probe): Call
  check_process_probe_kernel_support() instead of doing CONFIG_UTRACE
  check.
* tapsets.h: Declare check_process_probe_kernel_support().

12 years agoPR12136: Tweak the cast-scope testcase
Josh Stone [Thu, 17 Nov 2011 21:10:55 +0000 (13:10 -0800)]
PR12136: Tweak the cast-scope testcase

- Use unnamed process.* to allow -c to guarantee the right path
- Specify the function probe's file, so we don't accidentally pick up
  any other length(), like string::length().

12 years agoMerge branch 'master' of ssh://sources.redhat.com/git/systemtap
William Cohen [Thu, 17 Nov 2011 21:02:28 +0000 (16:02 -0500)]
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap

12 years agoPR12136: Add a statement probe for testing @cast scopes
Josh Stone [Thu, 17 Nov 2011 20:32:03 +0000 (12:32 -0800)]
PR12136: Add a statement probe for testing @cast scopes

There's still an issue with getting the entry value, but the rest looks
like it's working properly...

12 years agoAdd UTRACE_API_VERSION to determine which utrace version we've got.
David Smith [Wed, 16 Nov 2011 21:23:46 +0000 (15:23 -0600)]
Add UTRACE_API_VERSION to determine which utrace version we've got.

* runtime/stp_utrace.h: Added UTRACE_API_VERSION back.
* tapset-utrace.cxx (utrace_derived_probe_group::emit_module_decls): Use
  UTRACE_API_VERSION, which stp_utrace.h now provides, so that we don't
  have to check STP_TASK_FINDER2.

12 years agoMerge branch 'master' into dsmith/task_finder2
David Smith [Wed, 16 Nov 2011 21:04:16 +0000 (15:04 -0600)]
Merge branch 'master' into dsmith/task_finder2

12 years agoDon't use dwfl_module bias in either emit_address() and vardie_from_symtable().
Mark Wielaard [Wed, 16 Nov 2011 12:33:26 +0000 (13:33 +0100)]
Don't use dwfl_module bias in either emit_address() and vardie_from_symtable().

dwflpp::emit_address() is called by loc2c for emitting DW_OP_addr.
DW_OP_addr could come from the actual dwarf location description or
could be synthetically generated from through vardie_from_symtable().
vardie_from_symtable() would keep the dwfl module bias (if there was one),
but the DW_OP_addr from real dwarf debuginfo would not have it.
Now we are consistently not having the module bias added.

Add some variants of the externalvar.exp testcase, which previously
failed with older GCC versions (where we would pick up the DW_OP_addr
from the dwarf location description), while newer GCCs emit dwarf DIEs
for these variables that only have the external flag set. The new
testcase variants use static vars, which will have DW_OP_addr emitted
in both old and new GCC versions.

12 years agoAdd the kvm_service_time.stp example
William Cohen [Tue, 15 Nov 2011 16:39:45 +0000 (11:39 -0500)]
Add the kvm_service_time.stp example

12 years agoUpdate the examples index with qemu_io.stp and qemu_count.stp.
William Cohen [Tue, 15 Nov 2011 14:19:20 +0000 (09:19 -0500)]
Update the examples index with qemu_io.stp and qemu_count.stp.

12 years agoAdd qemu_count.stp example
William Cohen [Tue, 15 Nov 2011 14:18:22 +0000 (09:18 -0500)]
Add qemu_count.stp example

12 years agoAdd the qemu_io.stp example
William Cohen [Tue, 15 Nov 2011 14:12:51 +0000 (09:12 -0500)]
Add the qemu_io.stp example

12 years agoserver_locale.exp: Make untested message different from server.exp message.
Mark Wielaard [Tue, 15 Nov 2011 14:07:59 +0000 (15:07 +0100)]
server_locale.exp: Make untested message different from server.exp message.

12 years agoPR13313 cont'd, fix regexp for [+-]D[+-]D[+-]D(...) operand case again.
Mark Wielaard [Tue, 15 Nov 2011 10:09:38 +0000 (11:09 +0100)]
PR13313 cont'd, fix regexp for [+-]D[+-]D[+-]D(...) operand case again.

The +/- before the second and third D aren't optional, but the combination
of [+-]D as a whole is optional. Tweak regexp again.

12 years agotestsuite/systemtap.base/library.exp: Add test name to PASS/FAIL messages.
Mark Wielaard [Tue, 15 Nov 2011 09:58:56 +0000 (10:58 +0100)]
testsuite/systemtap.base/library.exp: Add test name to PASS/FAIL messages.

12 years agounprivileged_embedded_C.exp: Before 2.6.21 __get_skb_iphdr wasn't native.
Mark Wielaard [Mon, 14 Nov 2011 21:33:06 +0000 (22:33 +0100)]
unprivileged_embedded_C.exp: Before 2.6.21 __get_skb_iphdr wasn't native.

12 years agoMake plt.exp test work against older glibc and/or newer gcc.
Mark Wielaard [Mon, 14 Nov 2011 20:31:57 +0000 (21:31 +0100)]
Make plt.exp test work against older glibc and/or newer gcc.

Older glibc only had (the now deprecated) register_printf_function.
Newer gcc might transform stpcpy into strcpy if return value is ignored.

12 years agoPR13313 cont'd, fix regexp for [+-]D[+-]D[+-]D(...) operand case
Frank Ch. Eigler [Mon, 14 Nov 2011 19:34:56 +0000 (14:34 -0500)]
PR13313 cont'd, fix regexp for [+-]D[+-]D[+-]D(...) operand case

Our regexps used [+-]? for the second/third optional displacement
values, when in fact they are not optional.  They are the only thing
that would separate the numbers.

Reported-By: Sergio Durigan <sdurigan@redhat.com>
12 years agotestsuite/systemtap.base/implicitptr.exp: Only fail if exe_uses_implicit_ptr.
Mark Wielaard [Mon, 14 Nov 2011 18:03:20 +0000 (19:03 +0100)]
testsuite/systemtap.base/implicitptr.exp: Only fail if exe_uses_implicit_ptr.

If gcc didn't even produce a DW_OP_[GNU_]implicit_pointer there is little
we can test.

12 years agoPR 13128: Reorganize privilege functions to share common code between stap and staprun.
Dave Brolley [Mon, 14 Nov 2011 16:12:46 +0000 (11:12 -0500)]
PR 13128: Reorganize privilege functions to share common code between stap and staprun.

- Privilege related functions now in privilege.cxx.
- privilege.h now at root of the source tree.

12 years agoPR 13398 - Allow Compile-Server Specs to Resolve to localhost and localhost.localdomain
Dave Brolley [Thu, 10 Nov 2011 22:33:40 +0000 (17:33 -0500)]
PR 13398 - Allow Compile-Server Specs to Resolve to localhost and localhost.localdomain

Removed heuristic which attempted to filter localhost.

12 years agoCorrect typo.
Dave Brolley [Thu, 10 Nov 2011 21:13:13 +0000 (16:13 -0500)]
Correct typo.

12 years agoPR13313 redux, fix off-by-one error in disp+disp+disp(...) asm operand format
Frank Ch. Eigler [Mon, 14 Nov 2011 14:44:52 +0000 (09:44 -0500)]
PR13313 redux, fix off-by-one error in disp+disp+disp(...) asm operand format

commit 8095a157 cleaned up regexp match parsing, but
included a bonus off-by-one error that resulted in
ignoring the third "disp" optional addend.

* tapsets.cxx (sdt_uprobe_var_expanding_visitor::visit_target_symbol_arg)
  Make optional disp addends count up to three.  Four shalt thou not
  count, neither shalt thou count to two, excepting that thou then
  proceed to three. Five is right out.

12 years agotestsuite/systemtap.exelib/pthreadprobes.exp: Handle pthread_mutex_timedlock.
Mark Wielaard [Mon, 14 Nov 2011 14:26:52 +0000 (15:26 +0100)]
testsuite/systemtap.exelib/pthreadprobes.exp: Handle pthread_mutex_timedlock.

pthreadprobes.exp tested pthread_mutex_timedlock but didn't handle the
result which caused it to FAIL the mutex_timedlock_entry test each time.

pthread_mutex_timedlock is called with a timeout of 1 second in a
loop while the mutex is held by the other thread for about 5 seconds
resulting in a couple of entries resulting in a ETIMEDOUT before it
is actually acquired.  Expect 2 till 6 tries before success.

12 years agotestsuite/systemtap.exelib/pthreadprobes.exp: Make PASS messages unique.
Mark Wielaard [Mon, 14 Nov 2011 13:43:15 +0000 (14:43 +0100)]
testsuite/systemtap.exelib/pthreadprobes.exp: Make PASS messages unique.

12 years agotestsuite/systemtap.base/implicitptr.c: Make sure to use all implicit values.
Mark Wielaard [Mon, 14 Nov 2011 12:46:40 +0000 (13:46 +0100)]
testsuite/systemtap.base/implicitptr.c: Make sure to use all implicit values.

Or gcc might optimize out the generation of dwarf.

12 years agotestsuite/systemtap.base/sdt_misc.c: nanosleep in endless loop.
Mark Wielaard [Mon, 14 Nov 2011 10:36:32 +0000 (11:36 +0100)]
testsuite/systemtap.base/sdt_misc.c: nanosleep in endless loop.

Be nice to single CPU or low resource devices running this testcase.

12 years agosched_switch.stp parse arguments once, workaround name argument WARNINGs.
Mark Wielaard [Sat, 12 Nov 2011 21:30:28 +0000 (22:30 +0100)]
sched_switch.stp parse arguments once, workaround name argument WARNINGs.

stap got smarter and now detects some arguments aren't used or used
"wrongly". Add a begin probe to parse the arguments, use strtol if
necessary, and add usage message in case wrong number of args were given.
This suppresses WARNINGs for 'stap sched_switch.stp name firefox':

WARNING: never-assigned local variable 'firefox' (alternatives: __tracepoint_arg_p name task task_pid task_tid task_priority task_cpu task_state): identifier 'firefox' at testsuite/systemtap.examples/profiling/sched_switch.stp:34:19
 source:                if (task_pid != $2 && pid() != $2)
                                        ^
WARNING: never-assigned local variable 'firefox' (alternatives: __tracepoint_arg_prev __tracepoint_arg_next next_pid next_tid next_task next_task_name nexttsk_state next_priority prev_priority prev_pid prev_tid prev_task prev_task_name prevtsk_state name): identifier 'firefox' at :53:19
 source:                if (next_pid != $2 && prev_pid != $2)
                                        ^
WARNING: Eliding unused variable 'firefox': identifier 'firefox' at :34:19
 source:                if (task_pid != $2 && pid() != $2)
                                        ^

12 years agoPR13404: Dial SDT args up to twelve
Josh Stone [Fri, 11 Nov 2011 22:11:11 +0000 (11:11 -1100)]
PR13404: Dial SDT args up to twelve

This is SystëmTap, and eleven is so 1984...

* includes/sys/sdt.h: Expand all macros from 10 to 12.
* tapsets.cxx (sdt_uprobe_var_expanding_visitor): Allow 12 args now.
* testsuite/systemtap.base/sdt.*: Test 12 args for SDT v3 only.
* testsuite/systemtap.base/sdt_va_args.*: Test 12 in STAP_PROBEV.

12 years agoFix compile error in _stp_stack_user_print.
David Smith [Fri, 11 Nov 2011 19:12:37 +0000 (13:12 -0600)]
Fix compile error in _stp_stack_user_print.

* runtime/stack.c (_stp_stack_user_print): Fix compile error when
  STAPCONF_UPROBE_GET_PC isn't defined.

12 years agoPR13313: parse x86 base+(index*scale)+displacement sdt.h asm operand format
Frank Ch. Eigler [Fri, 11 Nov 2011 16:59:11 +0000 (11:59 -0500)]
PR13313: parse x86 base+(index*scale)+displacement sdt.h asm operand format

* tapsets.cxx (sdt_uprobe_var_expanding_visitor::visit_target_symbol_arg): Parse
  N(%r,%r,S) format with another regexp branch.  Adjust regexp-parsing logic in N(%r)
  to avoid iteration over regexp matches, as we know the indices directly.

12 years agoMerge branch 'master' into dsmith/task_finder2
David Smith [Fri, 11 Nov 2011 13:56:28 +0000 (07:56 -0600)]
Merge branch 'master' into dsmith/task_finder2

12 years agotestsuite/systemtap.base/vta-test.c: Tweaked to use variables.
Mark Wielaard [Fri, 11 Nov 2011 11:23:25 +0000 (12:23 +0100)]
testsuite/systemtap.base/vta-test.c: Tweaked to use variables.

GCC 4.6 was too smart. It saw we didn't actually use the a[] ever
so never stored its contents. Now we actually use the array so a
(constant) expresion location is put in the dwarf output.

12 years agoPR 13394: Use __attribute__ ((always_inline)) to inline test case function.
Dave Brolley [Wed, 9 Nov 2011 22:22:31 +0000 (17:22 -0500)]
PR 13394: Use __attribute__ ((always_inline)) to inline test case function.

12 years agoMerge branch 'master' into dsmith/task_finder2
David Smith [Wed, 9 Nov 2011 22:11:42 +0000 (16:11 -0600)]
Merge branch 'master' into dsmith/task_finder2

12 years agoFix memory leak in new utrace code.
David Smith [Wed, 9 Nov 2011 22:08:58 +0000 (16:08 -0600)]
Fix memory leak in new utrace code.

* runtime/stp_utrace.c: Removed some unused code.
  (utrace_cleanup): Renamed from utrace_free() and added comments.
  (utrace_free): Renamed from utrace_free_task() and now takes a 'struct
  utrace' pointer instead of a 'task_struct' pointer.
  (utrace_report_death): To avoid a memory leak, call utrace_free().

12 years agoPR 13394 - gcc 4.6 doesn't inline ibar for unprivileged testcase
Dave Brolley [Wed, 9 Nov 2011 21:53:55 +0000 (16:53 -0500)]
PR 13394 - gcc 4.6 doesn't inline ibar for unprivileged testcase

Mark the failing tests as XFAIL when gcc 4.6 is detected.

12 years agoPR 13128: Implement --privilege option and correct privilege checking usage.
Dave Brolley [Wed, 9 Nov 2011 20:39:47 +0000 (15:39 -0500)]
PR 13128: Implement --privilege option and correct privilege checking usage.

- In particular, don't assume only two privilege levels. All tests now test
  for the specific privilege required in order to allow the construct.
- Update test suites

12 years agoPR13373 addendum: add back a shlib->plt->shlib call trigger for myproc test
Frank Ch. Eigler [Wed, 9 Nov 2011 17:11:14 +0000 (12:11 -0500)]
PR13373 addendum: add back a shlib->plt->shlib call trigger for myproc test

12 years agoPR13373: unprivileged tests for plt / label probes
Frank Ch. Eigler [Wed, 9 Nov 2011 17:04:18 +0000 (12:04 -0500)]
PR13373: unprivileged tests for plt / label probes

* libfoo.c, libloop.c: Add a dummy goto & label.
* unprivileged_probes.exp: Add missing probe point types.  Add plt(string)
  substitution.
* unprivileged_myproc.exp: Ditto, plus designate .plt.statement(N) probes
  as xfail, since the naive sort of address (N) substitution does not
  result in tripped probes.

12 years agotestsuite/systemtap.base/plt.c: define _GNU_SOURCE for stpcpy.
Mark Wielaard [Wed, 9 Nov 2011 16:06:28 +0000 (17:06 +0100)]
testsuite/systemtap.base/plt.c: define _GNU_SOURCE for stpcpy.

stpcpy is strange. On some older systems it is only declared when
_GNU_SOURCE is defined. The STPCPY(3) manpage says:

   This function is not part of the C or POSIX.1  standards,  and  is  not
   customary  on Unix systems, but is not a GNU invention either.  Perhaps
   it comes from MS-DOS.

12 years agoplt.exp should be tolerant of slight function call variations.
Mark Wielaard [Wed, 9 Nov 2011 09:52:45 +0000 (10:52 +0100)]
plt.exp should be tolerant of slight function call variations.

__cxa_finalize can be called more than once, the number of calls
to free can be more than expected with different glibc versions.

12 years agoFix commented out code to avoid compile error.
David Smith [Tue, 8 Nov 2011 21:04:35 +0000 (15:04 -0600)]
Fix commented out code to avoid compile error.

* runtime/stp_utrace.c (utrace_report_death): Fix comment.

12 years agoSwitch UTRACE_EVENT(EXIT) support to UTRACE_EVENT(DEATH) support.
David Smith [Tue, 8 Nov 2011 19:28:10 +0000 (13:28 -0600)]
Switch UTRACE_EVENT(EXIT) support to UTRACE_EVENT(DEATH) support.

* runtime/stp_utrace.c: Switch UTRACE_EVENT(EXIT) support to
  UTRACE_EVENT(DEATH) support to avoid leading utrace engines.
* runtime/stp_utrace.h: Turn off UTRACE_EVENT(EXIT) support and turn on
  UTRACE_EVENT(DEATH) support.
* runtime/task_finder2.c: Switch from UTRACE_EVENT(EXIT) handlers to
  UTRACE_EVENT(DEATH) handlers.
* tapset-utrace.cxx (utrace_derived_probe_group::emit_probe_decl): Removed
  special STP_TASK_FINDER2 code.

12 years agoUpdated for v3 of the kernel exec tracepoint patch.
David Smith [Tue, 8 Nov 2011 17:48:09 +0000 (11:48 -0600)]
Updated for v3 of the kernel exec tracepoint patch.

* runtime/autoconf-utrace-via-tracepoints.c: Updated for v3 of the kernel
  exec tracepoint patch.
* runtime/stp_utrace.c: Ditto.
  (utrace_free_task): Fix compile error.

12 years agoMerge branch 'master' into dsmith/task_finder2
David Smith [Tue, 8 Nov 2011 17:30:07 +0000 (11:30 -0600)]
Merge branch 'master' into dsmith/task_finder2

12 years agoPR 13128: Backward compatibility for stapusr and stapdev level modules.
Dave Brolley [Tue, 8 Nov 2011 15:15:27 +0000 (10:15 -0500)]
PR 13128: Backward compatibility for stapusr and stapdev level modules.

If no privilege credentials are passed to the module, we can assume that
the module was loaded directly by a root level user (insmod) or by an
older version of staprun (less than 1.7). In the latter case, if the module
requires stapusr or stapdev credentials, we can assume that staprun did the
right thing and that the module is safe to run. Otherwise, the required
privilege level is unknown to the old staprun and we must abort.

12 years agoMake sure to test 64-on-64 for fib.exp and exelib.exp when appropriate.
Mark Wielaard [Tue, 8 Nov 2011 15:06:54 +0000 (16:06 +0100)]
Make sure to test 64-on-64 for fib.exp and exelib.exp when appropriate.

The dwarf unwinder doesn't work for 32-on-64 processes. PR10272.
So make sure to at least test 64-on-64 backtraces on 64bit arches.

12 years agoSplit printing of kernel and user stack in separate functions.
Mark Wielaard [Tue, 8 Nov 2011 12:50:52 +0000 (13:50 +0100)]
Split printing of kernel and user stack in separate functions.

We used to do some "clever" tricks with passing around constants that
indicated which stack we really wanted. Partly this was so gcc could
optimize out uprobe_get_pc() calls when not necessary. Which was needed
to prevent WARNING: "uprobe_get_pc" undefined! when loading the module
if uprobes wasn't available (e.g. when wanting just a kernel stack).
This was too fragile, gcc didn't always optimize out the call when not
needed. And the code wasn't particular clear. This just splits
__stp_dwarf_stack_print() into __stp_dwarf_stack_kernel_print() and
__stp_dwarf_stack_user_print() and splits _stp_stack_print() into
_stp_stack_kernel_print() and _stp_stack_user_print() (including the
sprint variants). Only the user functions will ever call uprobe_get_pc().

12 years agoPR13353: use session parameters to search for build-id.
Frank Ch. Eigler [Mon, 7 Nov 2011 23:23:03 +0000 (18:23 -0500)]
PR13353: use session parameters to search for build-id.

Previous code used uname directly, which ignored the arch/machine
data already available in the incoming systemtap_session instance.

* session.h (native_build): New flag.
* session.cxx (check_options): Compute it.
  (systemtap_session ctors): Heurstically estimate it.
* setupdwfl.cxx (get_kernel_build_id): Use incoming kernel_build_tree
  to search for vmlinux.id.  If native build suspected, check
  /sys/kernel/notes.

12 years agoSilence gtod.c -Wformat warnings. Arguments are long int (%ld), not int (%d).
Mark Wielaard [Mon, 7 Nov 2011 20:08:34 +0000 (21:08 +0100)]
Silence gtod.c -Wformat warnings. Arguments are long int (%ld), not int (%d).

Some gcc installs have -Wformat as default warning enabled...
gtod.c:21:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘__time_t’ [-Wformat]
gtod.c:21:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__suseconds_t’ [-Wformat]
gtod.c:22:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘__time_t’ [-Wformat]
gtod.c:22:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__suseconds_t’ [-Wformat]

12 years agoPR13386: avoid _stp_printf() crash for null context / %M or %m
Frank Ch. Eigler [Mon, 7 Nov 2011 19:20:26 +0000 (14:20 -0500)]
PR13386: avoid _stp_printf() crash for null context / %M or %m

If _stp_printf() were invoked with %M or %m directive that resulted in
an error, it likes to write into the current stap probe handler
context about it.  However, _stp_printf is sometimes used outside
probe handler context, in which case no context is actually available,
such as during module_exit().  So we tolerate a null context pointer
(it just having been deallocated).  Note that there don't exist any
current %M/%m outputs in the runtime that could trigger this
NULL-deref, so this is only a prophylactic measure.

* runtime/vsprintf.c (_stp_vsprint_memory): Tolerate null context.

12 years agoPR13386: disable preemption around printing-happy parts of *module_exit().
Frank Ch. Eigler [Mon, 7 Nov 2011 19:19:05 +0000 (14:19 -0500)]
PR13386: disable preemption around printing-happy parts of *module_exit().

* translate.cxx (c_unparser::emit_module_exit): Since we use stp_printf
  (that internally is preempt-sensitive), we need to disable preemption
  (or at least cpu switching) during this stage.

12 years agoPR13338: make test case pass even without coreutils-debuginfo
Frank Ch. Eigler [Mon, 7 Nov 2011 19:18:44 +0000 (14:18 -0500)]
PR13338: make test case pass even without coreutils-debuginfo

12 years agoPR13332 skipped.exp testcase can freeze processes/system.
Mark Wielaard [Mon, 7 Nov 2011 10:52:17 +0000 (11:52 +0100)]
PR13332 skipped.exp testcase can freeze processes/system.

Mark skipped.exp as untested for now.

12 years agoPR13193: pessimize dynamic-module test case
Frank Ch. Eigler [Sun, 6 Nov 2011 21:55:59 +0000 (16:55 -0500)]
PR13193: pessimize dynamic-module test case

This variant of the test case serializes the module coming/going
traffic, to work around what are assumed to be kernel kprobes
problems.  With &'s wherever ;'s are, even manly, glutamine-fortified
bicept-curling kernels quiver with fear.

12 years agoPR13193: disable kprobes-optimization at staprun startup time
Frank Ch. Eigler [Sun, 6 Nov 2011 18:44:50 +0000 (13:44 -0500)]
PR13193: disable kprobes-optimization at staprun startup time

* runtime/staprun/staprun.c (disable_kprobes_optimization): New function,
  called from ...
  (init_staprun): ... here, unless getenv("STAP_PR13193_OVERRIDE").

12 years agoMerge branch 'master' into dsmith/task_finder2
David Smith [Fri, 4 Nov 2011 19:52:18 +0000 (14:52 -0500)]
Merge branch 'master' into dsmith/task_finder2

12 years agoSmall fixes and cleanups in stp_utrace.c and task_finder2.c.
David Smith [Fri, 4 Nov 2011 19:39:18 +0000 (14:39 -0500)]
Small fixes and cleanups in stp_utrace.c and task_finder2.c.

* runtime/task_finder2.c (__stp_task_finder_cleanup): Removed unused code.
* runtime/stp_utrace.c (utrace_init): Only declare 'report_exec_name' when
  STAPCONF_UTRACE_VIA_FTRACE is defined.
  (utrace_free_task): Updated (but still isn't called).

12 years agoSimplified environ variable parsing in server
Chris Meek [Fri, 4 Nov 2011 18:07:07 +0000 (14:07 -0400)]
Simplified environ variable parsing in server

stap-serverd.cxx
  No need to check for control characters in parsing, as it is only
  passing the environ variables between stap-serverd and its child stap.

12 years agoPPC64 Dwarf handle both .debug_frame and .eh_frame register mappings.
Mark Wielaard [Fri, 4 Nov 2011 16:26:43 +0000 (17:26 +0100)]
PPC64 Dwarf handle both .debug_frame and .eh_frame register mappings.

These are slightly strange since they don't really use dwarf register
mappings, but gcc internal register numbers. There is some confusion about
the numbering see http://gcc.gnu.org/ml/gcc/2004-01/msg00025.html
We just handle the 32 fixed point registers, mq, count and link and
ignore status registers, floating point, vectors and special registers
(most of which aren't available in pt_regs anyway). Also we placed nip
last since we use that as UNW_PC register and it needs to be filled in.
Note that we handle both the .eh_frame and .debug_frame numbering at
the same time. There is potential overlap though. 64 maps to cr in one
and mq in the other...

12 years agoAdd syscall information for ARM
Wade Farnsworth [Thu, 3 Nov 2011 18:13:00 +0000 (11:13 -0700)]
Add syscall information for ARM

Add syscall information for ARM devices.  This allows tapsets to be
compiled on this architecture when CONFIG_UTRACE is enabled.

Signed-off-by: Wade Farnsworth <wade_farnsworth@mentor.com>
12 years agoFix uninitialized variable warning in __stp_call_mmap_callbacks_with_addr
Wade Farnsworth [Thu, 3 Nov 2011 18:10:26 +0000 (11:10 -0700)]
Fix uninitialized variable warning in __stp_call_mmap_callbacks_with_addr

When compiling a tapset, gcc complains that dentry may be used uninitialized in
this function.  Initialize it to NULL to prevent this.

Signed-off-by: Wade Farnsworth <wade_farnsworth@mentor.com>
12 years agoFix tapset/powerpc/aux_syscalls.stp for older ppc kernels.
Mark Wielaard [Thu, 3 Nov 2011 20:56:42 +0000 (21:56 +0100)]
Fix tapset/powerpc/aux_syscalls.stp for older ppc kernels.

Define missing PTRACE constants if necessary.

12 years agotranslate.cxx (get_unwind_data): Only get .eh_frame for SHT_PROGBITS sections.
Mark Wielaard [Thu, 3 Nov 2011 20:20:47 +0000 (21:20 +0100)]
translate.cxx (get_unwind_data): Only get .eh_frame for SHT_PROGBITS sections.

This is really a bug somewhere in the toolchain. Only observed on s390x
for the kernel debuginfo vmlinux image. But it is a good sanity check in
general. See also rhbz#751197.

12 years agoruntime/unwind.c (unwind_frame): _stp_warn which eh or debug hdr is missing.
Mark Wielaard [Thu, 3 Nov 2011 19:48:53 +0000 (20:48 +0100)]
runtime/unwind.c (unwind_frame): _stp_warn which eh or debug hdr is missing.

12 years agoIfdef'ed out unused internal utrace code.
David Smith [Thu, 3 Nov 2011 19:44:56 +0000 (14:44 -0500)]
Ifdef'ed out unused internal utrace code.

* runtime/stp_utrace.h: Ifdef'ed out more unused code.
* runtime/stp_utrace.c: Ditto.

12 years agoFix problem with last commit.
David Smith [Thu, 3 Nov 2011 19:41:47 +0000 (14:41 -0500)]
Fix problem with last commit.

* runtime/task_finder.c: Change define back to 'STP_TASK_FINDER2' to match
  up with tapset-utrace.cxx.

12 years agoFixed environ variable parsing in server
Chris Meek [Thu, 3 Nov 2011 19:37:45 +0000 (15:37 -0400)]
Fixed environ variable parsing in server

stap-serverd.cxx
  Used regexp_match() to extract the environment variables from
  environ, checking for embedded control characters. If found,
  that variable is ignored, a warning is printed, and execution
  continues.

12 years agoMerge branch 'master' into dsmith/task_finder2
David Smith [Thu, 3 Nov 2011 19:32:31 +0000 (14:32 -0500)]
Merge branch 'master' into dsmith/task_finder2

12 years agoAdded 'autoconf' tests to figure out which new utrace implementation to use.
David Smith [Thu, 3 Nov 2011 16:19:04 +0000 (11:19 -0500)]
Added 'autoconf' tests to figure out which new utrace implementation to use.

* runtime/autoconf-utrace-via-ftrace.c: New autoconf test.
* runtime/autoconf-utrace-via-tracepoints.c: Ditto.
* buildrun.cxx (compile_pass): Use 2 new autoconf tests.
* runtime/stp_utrace.c: Handle STAPCONF_UTRACE_VIA_TRACEPOINTS and
  STAPCONF_UTRACE_VIA_FTRACE.
* runtime/task_finder.c: Ditto.

12 years agounprivileged awk regexp tweak to prevent false matches on s390x objdump -d.
Mark Wielaard [Wed, 2 Nov 2011 12:28:31 +0000 (13:28 +0100)]
unprivileged awk regexp tweak to prevent false matches on s390x objdump -d.

12 years agoclarify that = (equal sign) is necessary for optional-argument --long-options
Frank Ch. Eigler [Wed, 2 Nov 2011 00:17:58 +0000 (20:17 -0400)]
clarify that = (equal sign) is necessary for optional-argument --long-options

* stap.1 (use-server, list-servers, trust-servers, use-server-on-error,
  download-debuginfo): Plop in an equal sign, right in the reader's face.

12 years agoPR13338: prevent infinite recursion during process glob expansion
Frank Ch. Eigler [Tue, 1 Nov 2011 23:53:57 +0000 (19:53 -0400)]
PR13338: prevent infinite recursion during process glob expansion

Previously, it was possible for a process("/usr/bin/*") probe to
expand to a list that included process("/usr/bin/[") (or indeed
some other wildcard-containing filename), which would recursively
trigger glob expansion.  Now we \-quote glob results, to prevent
this, and later \-unquote to undo the damage.

* tapsets.cxx (dwarf_builder::build): quote / unquote process globs.
* testsuite/systemtap.base/bz13338.exp: New test.
* util.cxx (*_glob_chars): New/revised functions for \-quoting
  some glob metacharacters.
* util.h: Corresponding changes.
* staptree.h: Crucial whitespace change.

12 years agofix missing \n's in usage message
Frank Ch. Eigler [Tue, 1 Nov 2011 23:52:19 +0000 (19:52 -0400)]
fix missing \n's in usage message

Previously, the "--download-debuginfo" option kind of got lost.

12 years agoCleanup task_finder2 by removing some unused code (ported).
David Smith [Tue, 1 Nov 2011 20:53:26 +0000 (15:53 -0500)]
Cleanup task_finder2 by removing some unused code (ported).

* runtime/task_finder2.c (__stp_utrace_attach_match_filename): Remove
  'register_p' parameter (and associated code), since it was always set.
  (__stp_utrace_attach_match_tsk): Remove 'register_p' parameter.
  (__stp_utrace_task_finder_report_clone): Remove register_p parameter
  from __stp_utrace_attach_match_tsk() call.
  (__stp_utrace_task_finder_report_exec): Ditto.

12 years agoCompile-server client name resolution improvements.
Dave Brolley [Tue, 1 Nov 2011 20:41:02 +0000 (16:41 -0400)]
Compile-server client name resolution improvements.

- treat localhost and localhost.localdomain as identical.

12 years agoMerge branch 'master' into dsmith/task_finder2
David Smith [Tue, 1 Nov 2011 19:50:02 +0000 (14:50 -0500)]
Merge branch 'master' into dsmith/task_finder2

12 years agoCleanup task_finder by removing some unused code.
David Smith [Tue, 1 Nov 2011 19:20:16 +0000 (14:20 -0500)]
Cleanup task_finder by removing some unused code.

* runtime/task_finder.c (__stp_utrace_attach_match_filename): Remove
  'register_p' parameter (and associated code), since it was always set.
  (__stp_utrace_attach_match_tsk): Remove 'register_p' parameter.
  (__stp_utrace_task_finder_report_clone): Remove register_p parameter
  from __stp_utrace_attach_match_tsk() call.
  (__stp_utrace_task_finder_report_exec): Ditto.

12 years agotestsuite: update to match error message change
Frank Ch. Eigler [Tue, 1 Nov 2011 19:17:28 +0000 (15:17 -0400)]
testsuite: update to match error message change

Earlier commit 1d7ae21b changed an error message.
Update server_locale.exp testcase to match.

12 years agoMerge branch 's390x-unwind'
Mark Wielaard [Tue, 1 Nov 2011 16:52:11 +0000 (17:52 +0100)]
Merge branch 's390x-unwind'

12 years agoHook up s390x dwarf unwinder.
Mark Wielaard [Tue, 1 Nov 2011 16:47:29 +0000 (17:47 +0100)]
Hook up s390x dwarf unwinder.

12 years agoBe explicit about SP from CFA and PC from RA dwarf unwind rules.
Mark Wielaard [Tue, 1 Nov 2011 16:32:23 +0000 (17:32 +0100)]
Be explicit about SP from CFA and PC from RA dwarf unwind rules.

There are subtle differences between architectures whether or not they
should unwind the stack pointer from the call frame address and the
instruction pointer from the return address given by the dwarf call
frame instructions. Make it so each arch explicitly encodes how it
does the unwinding of these two special registers.

12 years agoFix segfault introduced by previous coverity cleanups.
Dave Brolley [Tue, 1 Nov 2011 16:26:12 +0000 (12:26 -0400)]
Fix segfault introduced by previous coverity cleanups.

- make sure environTok is initialized before using
- don't need to call getenv at all.

12 years agocode hygiene: some more coverity cleanups
Frank Ch. Eigler [Tue, 1 Nov 2011 12:04:55 +0000 (08:04 -0400)]
code hygiene: some more coverity cleanups

* nsscommon.cxx (add_client_cert): Check PORT_Alloc() return value.
* stap-serverd.cxx (get_stap_locale): Check getenv() return value
  and localization key=value parsability.
* util.cxx (assert_regexp_match, regexp_match): Assert regcomp
  success.

12 years agoMake --with-elfutils work with either a source release or git checkout.
Mark Wielaard [Mon, 31 Oct 2011 13:29:46 +0000 (14:29 +0100)]
Make --with-elfutils work with either a source release or git checkout.

Add configure check to see if this is a source release, or a source
checkout. We need --enable-maintainer-mode if it isn't a source release
to make sure some additional files are generated. This makes working
against non-released elfutils git checkout a lot easier.

12 years agoIntroduce and use STP_ALLOC_SLEEP_FLAGS for use with gfp alloc functions.
Mark Wielaard [Mon, 31 Oct 2011 09:39:10 +0000 (10:39 +0100)]
Introduce and use STP_ALLOC_SLEEP_FLAGS for use with gfp alloc functions.

When in a context where we can wait we like to use normal GFP_KERNEL.
But this might trigger the oom-killer, which might kill out own stapio
process. To suppress this use __GFP_NORETRY. All _stp_[kmz]alloc_gfp
functions that are used in user context should use STP_ALLOC_SLEEP_FLAGS
if appropriate.

Note that the kernel itself may still use GFP_KERNEL. For example
__alloc_percpu() will always use GFP_KERNEL.

12 years agoAdd the pattern for label probes in libraries
Josh Stone [Fri, 28 Oct 2011 22:42:02 +0000 (15:42 -0700)]
Add the pattern for label probes in libraries

* tapsets.cxx (dwarf_derived_probe::register_patterns): Refactor so that
  all process[.library] variants get the same set of suffixes.
  (dwarf_derived_probe::register_function_and_statement_variants): Add
  the label pattern from here, just as .inline is done.

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