]> sourceware.org Git - systemtap.git/log
systemtap.git
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 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 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 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 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 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 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.

12 years agoRefactor sdt & plt pattern registration
Josh Stone [Fri, 28 Oct 2011 22:11:17 +0000 (15:11 -0700)]
Refactor sdt & plt pattern registration

This factors the sdt and plt suffixes away from the various process and
process.library prefixes.  As a result, we also gain process.plt for
probing -c commands.

* tapsets.cxx (dwarf_derived_probe::register_sdt_variants): New.
  (dwarf_derived_probe::register_plt_variants): New.
  (dwarf_derived_probe::register_patterns): Register sdt and plt for all
  process/library combinations.
* testsuite/semok/plt2.stp: Test that process.plt succeeds with -c
* testsuite/semko/plt2.stp: Test that process.plt fails without -c

12 years agoJust test up to -p2 for kernel-debuginfo smoke test.
Mark Wielaard [Fri, 28 Oct 2011 21:47:53 +0000 (23:47 +0200)]
Just test up to -p2 for kernel-debuginfo smoke test.

We already do a -p4 kernel-devel smoke test just before this one.
We don't need another one. It slows down doing make installcheck
RUNTESTFLAGS=quick_test.exp runs. Especially on slow machines.

12 years agoplt: Throw an appropriate error for missing $var
Josh Stone [Fri, 28 Oct 2011 21:42:23 +0000 (14:42 -0700)]
plt: Throw an appropriate error for missing $var

* tapsets.cxx (plt_expanding_visitor::visit_target_symbol): Throw a
  semantic_error for missing $var, so it may be caught and chained for
  later.  This ensures that the visitor always has a provide() too.
* testsuite/semko/plt1.stp: New, check that missing $var is an error.
* testsuite/semok/plt1.stp: New, check that $$name works, as does
  @defined on a missing $var.

12 years agoAllow "broken" kernel-debuginfo for the testsuite.
Mark Wielaard [Fri, 28 Oct 2011 21:22:11 +0000 (23:22 +0200)]
Allow "broken" kernel-debuginfo for the testsuite.

We just care there is some debuginfo, it is allowed have bad var
location descriptors (which will cause some tests to fail of course).

e.g. 2.6.35.6-45.fc14.s390x kernels build with gcc version 4.5.1.

12 years agoMore PR13083 fixes to avoid sleeping in the task_finder.
David Smith [Thu, 27 Oct 2011 15:24:45 +0000 (10:24 -0500)]
More PR13083 fixes to avoid sleeping in the task_finder.

* runtime/task_finder.c (__stp_get_mm_path): Call down_read_trylock()
  instead of down_read() to avoid the possibility of sleeping.
  (stap_start_task_finder): Call task_lock() to make sure a task's mm
  doesn't go away while we're looking at it.

12 years agoWorkaround PR13350 dwarf unwinder _stp_valid_pc_addr() invalid for s390x.
Mark Wielaard [Thu, 27 Oct 2011 14:14:23 +0000 (16:14 +0200)]
Workaround PR13350 dwarf unwinder _stp_valid_pc_addr() invalid for s390x.

Just assume it is valid unless clearly bogus (aka zero) for now.

12 years agoPR 13128: Rework of commit f2013cc91ea1dba576661d6b746ee28658c8bc51
Dave Brolley [Tue, 25 Oct 2011 16:22:20 +0000 (12:22 -0400)]
PR 13128: Rework of commit f2013cc91ea1dba576661d6b746ee28658c8bc51

Based on peer feedback:
- Compare privilege credentials as sets, not levels.
- Send privilege credentials as a ctl message at startup.
- Send startup ctl messages (tzinfo, relocations, privilege_credentials)
  on the same control channel. Ensure channel is closed properly on error.

12 years agoMake uprobe_uaddr.exp line matches unique.
Mark Wielaard [Sat, 22 Oct 2011 22:22:02 +0000 (00:22 +0200)]
Make uprobe_uaddr.exp line matches unique.

12 years agoMake sdt_misc.exp test names unique.
Mark Wielaard [Sat, 22 Oct 2011 17:15:57 +0000 (19:15 +0200)]
Make sdt_misc.exp test names unique.

12 years agoMake client.exp test names unique.
Mark Wielaard [Sat, 22 Oct 2011 14:38:39 +0000 (16:38 +0200)]
Make client.exp test names unique.

12 years agoRemove duplicate -D "foo;bar" invalid_options test from client_args.exp.
Mark Wielaard [Sat, 22 Oct 2011 14:36:20 +0000 (16:36 +0200)]
Remove duplicate -D "foo;bar" invalid_options test from client_args.exp.

12 years agoMove duplicated __is_user_regs from [nd_]syscalls.stp to aux_syscalls.stp
Mark Wielaard [Sat, 22 Oct 2011 13:52:18 +0000 (15:52 +0200)]
Move duplicated __is_user_regs from [nd_]syscalls.stp to aux_syscalls.stp

12 years agoMake labels.exp test names unique.
Mark Wielaard [Fri, 21 Oct 2011 22:34:46 +0000 (00:34 +0200)]
Make labels.exp test names unique.

12 years agoMake procfs_maxsize.exp test names unique.
Mark Wielaard [Fri, 21 Oct 2011 22:29:04 +0000 (00:29 +0200)]
Make procfs_maxsize.exp test names unique.

12 years agoMake procfs.exp test names unique.
Mark Wielaard [Fri, 21 Oct 2011 22:19:29 +0000 (00:19 +0200)]
Make procfs.exp test names unique.

12 years agoMake testsuite error_handler "target_compile" pass/fail message unique.
Mark Wielaard [Fri, 21 Oct 2011 22:10:22 +0000 (00:10 +0200)]
Make testsuite error_handler "target_compile" pass/fail message unique.

12 years agoMake uprobe_uaddr.exp testcase names unique.
Mark Wielaard [Fri, 21 Oct 2011 21:50:00 +0000 (23:50 +0200)]
Make uprobe_uaddr.exp testcase names unique.

12 years agoImprove git.library.plt testname.
Stan Cox [Fri, 21 Oct 2011 18:55:39 +0000 (14:55 -0400)]
Improve git.library.plt testname.

plt.exp: Uniquely identify the library test.

12 years agoExtract addr_of for unprivileged_[my]probes.exp once and with optional dot.
Mark Wielaard [Fri, 21 Oct 2011 14:49:02 +0000 (16:49 +0200)]
Extract addr_of for unprivileged_[my]probes.exp once and with optional dot.

Some architectures prefix function symbols with a '.', so accept an
optional dot prefix. Also extract each symbol only once instead of
for each pass over the list.

12 years agoExtend vma_map entry vm_end range when additional segments are mapped.
Mark Wielaard [Fri, 21 Oct 2011 11:34:21 +0000 (13:34 +0200)]
Extend vma_map entry vm_end range when additional segments are mapped.

Once registered, we may want to extend an earlier registered region.
A segment might be mapped with different flags for different offsets.
If so we want to record the extended range so we can address more
precisely to module names and symbols.

* runtime/task_finder_vma.c (__stp_tf_get_vma_map_entry_end_internal):
  New function.
  (stap_extend_vma_map_info): Likewise.
* runtime/vma.c (_stp_vma_mmap_cb): Call stap_extend_vma_map_info().

12 years agoAdd runtime/autoconf-mm-context-vdso-base.c for vma.c vdso catching.
Mark Wielaard [Thu, 20 Oct 2011 18:42:34 +0000 (20:42 +0200)]
Add runtime/autoconf-mm-context-vdso-base.c for vma.c vdso catching.

Some architectures use an unsigned long vdso_base field in mm->context,
instead of a void *vdso field. Detect either in _stp_vma_match_vdso().

12 years agoset test "hash_add_buildid"
Mark Wielaard [Thu, 20 Oct 2011 14:26:01 +0000 (16:26 +0200)]
set test "hash_add_buildid"

12 years agoMake sure sdt includes are setup for cast-scope.exp testcase.
Mark Wielaard [Thu, 20 Oct 2011 13:53:43 +0000 (15:53 +0200)]
Make sure sdt includes are setup for cast-scope.exp testcase.

12 years agotestsuite/systemtap.exelib allow any libc function to occur as start_func.
Mark Wielaard [Thu, 20 Oct 2011 11:44:07 +0000 (13:44 +0200)]
testsuite/systemtap.exelib allow any libc function to occur as start_func.

On some arches some libc startup function don't have a starting _.
e.g. on powerpc there is generic_start_main().

12 years agoDisable uregs recovery through kernel dwarf unwinder for powerpc.
Mark Wielaard [Thu, 20 Oct 2011 11:38:31 +0000 (13:38 +0200)]
Disable uregs recovery through kernel dwarf unwinder for powerpc.

Sadly powerpc does support the dwarf unwinder, but doesn't have enough
CFI in the kernel to recover fully to user space.

12 years agoDon't try to do any lookup when addr is zero in _stp_kallsyms_lookup().
Mark Wielaard [Thu, 20 Oct 2011 11:06:54 +0000 (13:06 +0200)]
Don't try to do any lookup when addr is zero in _stp_kallsyms_lookup().

12 years agoRemove unused runtime/stack-ppc.c.
Mark Wielaard [Thu, 20 Oct 2011 11:00:27 +0000 (13:00 +0200)]
Remove unused runtime/stack-ppc.c.

12 years agoDon't trust dwfl_module_relocations() for ET_EXEC in get_unwind_data.
Mark Wielaard [Wed, 19 Oct 2011 21:39:07 +0000 (23:39 +0200)]
Don't trust dwfl_module_relocations() for ET_EXEC in get_unwind_data.

12 years agoFixed PR13158 by adding a staprun signal handler so modules don't remain.
David Smith [Wed, 19 Oct 2011 15:00:45 +0000 (10:00 -0500)]
Fixed PR13158 by adding a staprun signal handler so modules don't remain.

* runtime/staprun/staprun.c (term_signal_handler): New function.
  (setup_term_signals): Ditto.
  (insert_stap_module): Remembers if insert_module() worked.
  (main): Call setup_term_signals().
* testsuite/systemtap.base/rename_module.exp: Made test case more robust
  by waiting on output from all stap scripts.
* testsuite/systemtap.base/pr13158.exp: New testcase.

12 years agoPR13319: fix _stp_bufsize-related start-time net/ memory report printk
Frank Ch. Eigler [Wed, 19 Oct 2011 02:49:35 +0000 (22:49 -0400)]
PR13319: fix _stp_bufsize-related start-time net/ memory report printk

* transport/relay_v2.c, relayfs.c (_stp_transport_data_fs_init):
  Increment _stp_allocated_[net_]memory with relay buffers.
* transport/ring_buffer.c: Ditto.  Plus fix scaling of the incoming -sNN
  value, so NN represents megabytes consistently.

12 years agorhbz744907: Fix unowned directories
Josh Stone [Tue, 18 Oct 2011 21:33:17 +0000 (14:33 -0700)]
rhbz744907: Fix unowned directories

Most notably, %{_libdir}/systemtap and %{_libexecdir}/systemtap were
note owned by the subpackages which install files there.

12 years agoPR13317: mention parser error handling changes
Frank Ch. Eigler [Tue, 18 Oct 2011 21:21:21 +0000 (17:21 -0400)]
PR13317: mention parser error handling changes

12 years agoPR13317: improve parse error recovery heuristics
Frank Ch. Eigler [Tue, 18 Oct 2011 20:58:15 +0000 (16:58 -0400)]
PR13317: improve parse error recovery heuristics

This change changes the 10 parse errors reported by brendang for iostat-scsi.stp
to just six actually salient ones.

* parse.cxx (parser::parse): Reorder error recovery to skip
  everything until next top-level keyword.  Wrap try {} in
  while {} rather than vice versa.
  (parser::parse_stmt_block): Drop recovery loop.

12 years agotestsuite: add installtest_p protection to systemtap.base/stmt_rel.exp
Frank Ch. Eigler [Tue, 18 Oct 2011 20:10:33 +0000 (16:10 -0400)]
testsuite: add installtest_p protection to systemtap.base/stmt_rel.exp

12 years agotestsuite: add installtest_p assertion to rename_module.exp
Frank Ch. Eigler [Tue, 18 Oct 2011 20:02:55 +0000 (16:02 -0400)]
testsuite: add installtest_p assertion to rename_module.exp

12 years agoDon't crash with -DDEBUG_SYMBOLS in _stp_umod_lookup when vm_start is NULL.
Mark Wielaard [Tue, 18 Oct 2011 20:13:51 +0000 (22:13 +0200)]
Don't crash with -DDEBUG_SYMBOLS in _stp_umod_lookup when vm_start is NULL.

12 years agoFilter out arch-specific and deprecated functions in unprivileged_embedded_C.exp.
Dave Brolley [Tue, 18 Oct 2011 19:09:02 +0000 (15:09 -0400)]
Filter out arch-specific and deprecated functions in unprivileged_embedded_C.exp.

12 years agoPR 13128: Pass user privilege credentials from staprun to the module.
Dave Brolley [Tue, 18 Oct 2011 17:54:20 +0000 (13:54 -0400)]
PR 13128: Pass user privilege credentials from staprun to the module.

- User's privilege credentials are determined by staprun and passed to the module
- Module contains generated code which checks the user's credentials against those
  required to load/run the module (specified at compile time).
  - module aborts if credentials are insufficient.

12 years agoPR13261 Cont'd: Added NEWS, man page and Language Ref entries
Chris Meek [Tue, 18 Oct 2011 14:14:55 +0000 (10:14 -0400)]
PR13261 Cont'd: Added NEWS, man page and Language Ref entries

12 years agoPR13284 Failure to resolve kernel global e.g. jiffies.
Mark Wielaard [Tue, 18 Oct 2011 12:28:59 +0000 (14:28 +0200)]
PR13284 Failure to resolve kernel global e.g. jiffies.

* dwflpp.cxx (vardie_from_symtable): Also accept STT_NOTYPE. Some global
  don't have a type associated with them.
* testsuite/buildok/pr13284.stp: New testcase.

12 years agoPR13283: Use a temporary string for comparisons
Josh Stone [Mon, 17 Oct 2011 22:18:06 +0000 (15:18 -0700)]
PR13283: Use a temporary string for comparisons

The reported issue was trying to directly compare the results of two
different kernel_string() calls, but they were always computed equal
even though they were known to be different.  Inspection of pass-3
showed that both calls led to an expr-stmt ending in ...->__retvalue.
This is just a pointer though, and it happens here that both calls will
point to the same string buffer, so strncmp rightly calls them equal.

To fix this, we must introduce temporary storage for the intermediate
strings.  Now we won't lose either value, and they can be properly
compared for equality.

* translate.cxx (c_tmpcounter::visit_comparison): Declare temporary
  storage for the left operand if it's not a literal.
  (c_unparser::visit_comparison): Use the left temporary.
* testsuite/systemtap.string/strcmp.*: Test string comparisons.

12 years agoFix PR13312 by defining PTRACE_GET_LAST_BREAK for older kernels.
David Smith [Mon, 17 Oct 2011 21:30:34 +0000 (16:30 -0500)]
Fix PR13312 by defining PTRACE_GET_LAST_BREAK for older kernels.

* tapset/s390/aux_syscalls.stp: If PTRACE_GET_LAST_BREAK isn't defined,
  define it.

12 years agoi18n: fix printf formatting typo in commit 984ad50c
Frank Ch. Eigler [Mon, 17 Oct 2011 20:15:47 +0000 (16:15 -0400)]
i18n: fix printf formatting typo in commit 984ad50c

12 years agoi18n: fix gettext markup for "command line argument index" parse error message
Frank Ch. Eigler [Mon, 17 Oct 2011 15:54:38 +0000 (11:54 -0400)]
i18n: fix gettext markup for "command line argument index" parse error message

12 years agoPR13261 Cont'd: Added test cases for map wrapping
Chris Meek [Fri, 14 Oct 2011 15:58:52 +0000 (11:58 -0400)]
PR13261 Cont'd: Added test cases for map wrapping

12 years agoPR13261 cont'd: Added error handling for scalars
Chris Meek [Fri, 14 Oct 2011 14:37:57 +0000 (10:37 -0400)]
PR13261 cont'd: Added error handling for scalars

elaborate.cxx
  Ensured that if the variable is a global scalar and '%' has been
  used for wrapping, an error is thrown.

12 years agoTweak cache logic to group removals by hash value
Josh Stone [Thu, 13 Oct 2011 22:55:24 +0000 (15:55 -0700)]
Tweak cache logic to group removals by hash value

We used to glob the cache for *.ko, *.so, *.h, and *.log, implicitly
assuming that this was all that was cached.  For the .ko case we also
grouped .c and .sgn to be removed all together.  But when any new
extension came along, the cache cleanup ignored it.

Now we glob instead for any file in the cache that looks like is has a
hashed name, and we group removals for all files that appear to have the
same hash value, regardless of prefix or suffix.  This will hopefully
make us more robust against future file-caching changes.

* cache.cxx (cache_ent_info): Becomes a vector of paths, with no
  knowledge needed for modules.  Use better types for size and mtime.
  (clean_cache): Use a new glob that looks for hash-like files, with 32
  hex digits in a row.  Use a regex to find common HASH_LEN substrings
  in all those filenames.  Build the cache_ent_info groups by HASH_LEN,
  and proceed to delete old entries until below quota.

12 years agoHandle PPC64 function symbols by resolving function descriptors.
Mark Wielaard [Thu, 13 Oct 2011 21:19:21 +0000 (23:19 +0200)]
Handle PPC64 function symbols by resolving function descriptors.

* translate.cxx (dump_symbol_table): If the module is EM_PPC64, but not
  ET_REL, then register two address for a STT_FUNC. The function descriptor
  address and the address of the function that the descriptor points to.
  For ET_REL still rely on the .function_name convention.

12 years ago(More PR13289 fixes) Added better %m/%M error handling.
David Smith [Thu, 13 Oct 2011 21:24:43 +0000 (16:24 -0500)]
(More PR13289 fixes) Added better %m/%M error handling.

* runtime/print.c (_stp_unreserve_bytes): New function.
* runtime/print.h: Added _stp_unreserve_bytes() declaration.
* runtime/vsprintf.c (_stp_vsprint_memory): Only change the input pointer
  to "<NULL>" when we're formatting a string (%s), not when we're
  formatting raw memory (%m/%M).  Also, return NULL on errors.
  (_stp_vsprint_memory_size): Only change the input pointer to "<NULL>"
  when we're formatting a string (%s), not when we're formatting raw
  memory (%m/%M).
  (_stp_vsnprintf): If _stp_vsprint_memory() returns NULL, unreserve bytes
  in the print buffer, when necessary.
* translate.cxx (c_unparser::emit_compiled_printfs): If
  _stp_vsprint_memory() returns NULL, unreserve bytes in the print buffer,
  when necessary.  Also improve error message if _stp_vsprint_memory()
  fails by setting 'last_stmt'.
* testsuite/systemtap.stress/conversions.stp: Added tests for '%M' and for
  using sprintf() with '%m' and '%M'.
* testsuite/systemtap.stress/conversions.exp: Updated error count.

12 years agoPR13155: Fix tracepoint argument access
Josh Stone [Thu, 13 Oct 2011 20:22:29 +0000 (13:22 -0700)]
PR13155: Fix tracepoint argument access

The restructured tracepoint build broke the way tracepoint parameters
are passed to the script.  This patch cleans that up, and simplifies a
few other parts of the code generation.

* tapsets.cxx (tracepoint_derived_probe_group::emit_module_decls):
  Define intptr_t for the aux source.  Collect .used entries from
  p->args[] into used_args[] to ease call-list generation. Simplify
  registration by replacing the wrappers with plain declarations.
* buildrun.cxx (compile_pass): We do have everything needed for strict
  prototypes, so don't squash this warning.

12 years agoPR13155: separate compilation for tracepoint-related functions
Frank Ch. Eigler [Thu, 13 Oct 2011 16:33:48 +0000 (12:33 -0400)]
PR13155: separate compilation for tracepoint-related functions

The linux kernel's tracepoint headers are sometimes mutually
conflicting, defining structs etc. differently.  Since we need to use
each header in its natural habitat, we need to separately-compile
those tracepoint-related functions that absolutely need access to
those declarations.  This is quite new to us as so far, the translator
has usually emitted a single translated_source output, plus the
stap-symbols.h file.

* buildrun.cxx (compile_pass): Compile auxiliary sources into main module.
* tapsets.cxx (tracepoint_derived_probe_group::emit_module_decls): Effectively
  rewrite to create per-tracepoint-header auxiliary source files.
* session.cxx (op_create_auxiliary): New function.
* translate.cxx (translator_output): Add filename field.
* session.h, translate.h: Corresponding changes.
* hash.cxx (find_script_hash): Rename primary source file to stap_XXX_src.c.
* main.cxx (passes_0_4): Ditto.

12 years agodocumentation: mention --remote=direct:// and --remote-prefix
Frank Ch. Eigler [Mon, 10 Oct 2011 14:05:21 +0000 (10:05 -0400)]
documentation: mention --remote=direct:// and --remote-prefix

12 years agoPR13155 prep: move kbuild make -j parallelism to general code
Frank Ch. Eigler [Mon, 10 Oct 2011 13:36:48 +0000 (09:36 -0400)]
PR13155 prep: move kbuild make -j parallelism to general code

* buildrun.cxx (run_make_cmd): Do it here, to cover all make invocations,
  (make_tracequeries) ... instead of here.

12 years agoPR13076 tidbit: increase default module cache size to 256MB
Frank Ch. Eigler [Mon, 10 Oct 2011 13:36:27 +0000 (09:36 -0400)]
PR13076 tidbit: increase default module cache size to 256MB

12 years agoFixed PR13083 by no longer calling mmput() when possible.
David Smith [Thu, 13 Oct 2011 17:37:29 +0000 (12:37 -0500)]
Fixed PR13083 by no longer calling mmput() when possible.

* runtime/task_finder.c (__stp_utrace_attach): Don't call
  get_task_mm()/mmput().  Since we're in the context of that task, the mm
  should stick around (and mmput() can sleep).
  (__stp_call_mmap_callbacks_with_addr): Ditto.
  (__stp_utrace_attach_match_tsk): Ditto.
  (__stp_call_mmap_callbacks_for_task): Ditto.

12 years agoPR13261: Added map->wrap mode to script parser
Chris Meek [Thu, 13 Oct 2011 17:04:54 +0000 (13:04 -0400)]
PR13261: Added map->wrap mode to script parser

To activate map->wrap mode, use the '%' symbol after the variable name
in a global declaration, for example:

  global foo%[100]

This will let it automatically replace elements in the map if you
try to place something out of bounds, rather than give an error.
It also works for statistics-valued arrays.

parse.cxx
  Checked for the '%' symbol in parser::parse_global(), and if
  present, sets the vardecl* d->wrap value to true.

staptree.cxx
  Set the default value of the new vardecl->wrap boolean value to false.
  Added the '%' to the hash if it is enabled.

staptree.h
  Added the bool wrap element to struct vardecl

translate.cxx
  Added the bool wrap element to struct mapvar and initialixed it to the
  wrap element of the associated vardecl variable.
  Checked whether the mapvar->wrap has been set (from vardecl->wrap set
  in parser::parse_global()).
  If so, added the apropriate code to set the map->wrap for whether its a
  map or a pmap.

12 years agoPR13241 too much dump-unwindsyms processing for modules even if !need_symbols
Mark Wielaard [Thu, 13 Oct 2011 11:53:08 +0000 (13:53 +0200)]
PR13241 too much dump-unwindsyms processing for modules even if !need_symbols

Introduce dump_section_list() that will pregenerate the section list when
needed. dump_symbol_tables() now does the minimum necessary to extract
the needed symbols, or will not even be called at all when !need_symbols
and the module isn't the "kernel".

12 years agoFixed PR12389 by making %m/%M use kread() to access memory.
David Smith [Wed, 12 Oct 2011 21:52:30 +0000 (16:52 -0500)]
Fixed PR12389 by making %m/%M use kread() to access memory.

* runtime/vsprintf.c (_stp_vsprint_memory): The '%m' and '%M' formatting
  operators use kread() to read memory.
* translate.cxx: Removed all support from the c_unparser class for
  'probe_or_function_needs_deref_fault_handler' processing since it is no
  longer needed.
  (c_unparser::visit_print_format): Removed deref_buffer() call.  Added
  check for c->last_error after print is done.
* runtime/runtime_context.h: New file.
* runtime/vsprintf.h: Ditto.
* runtime/print.c: Removed extra include of vsprintf.c.  Allow use to
  override STP_LOG_BUF_LEN.  Make _stp_print_flush() definitions exactly
  the same between the RELAY_{GUEST,HOST} and normal caes.
* runtime/print.h: Added a few more functions and includes the new
  vsprintf.h file.
* runtime/runtime.h: Includes print.h instead of print.c.  Moved print.c
  and io.c to runtime_context.h.
* runtime/transport/transport.h: Declares '_stp_target'.

12 years agoembeddedc.awk: Fixup too much whitespace for unprivileged_embedded_C.exp.
Mark Wielaard [Wed, 12 Oct 2011 19:50:25 +0000 (21:50 +0200)]
embeddedc.awk: Fixup too much whitespace for unprivileged_embedded_C.exp.

12 years agoSplit translate dump_unwindsyms in separate collection/dump phases.
Mark Wielaard [Wed, 12 Oct 2011 10:53:30 +0000 (12:53 +0200)]
Split translate dump_unwindsyms in separate collection/dump phases.

Untangle separate module data collection. First collect all information,
build-ids, symbols, unwind tables, etc. Put all collected info in the
unwindsym_dump_context. Then dump it all out using the context.

12 years agoPR 13128: Generate section in the module containing privilege level information.
Dave Brolley [Wed, 12 Oct 2011 14:41:22 +0000 (10:41 -0400)]
PR 13128: Generate section in the module containing privilege level information.

- A list of the groups allowed to load/run the module is generated into the
  section .stap_privilege.

12 years agoPR 13128: Modify unprivileged mode infrastructure to support a multi-privilege design
Dave Brolley [Tue, 11 Oct 2011 18:49:07 +0000 (14:49 -0400)]
PR 13128: Modify unprivileged mode infrastructure to support a multi-privilege design

vs the previous boolean privileged/unprivileged design.

- in stap
  - Store the specified privilege level as an enum as opposed to a boolean
  - Test privilege levels against the proper enumerator.
- in the generated code
  - Generate STP_PRIVILEGE macro with the specified privilege level
  - Generated code tests it against the proper privilege level.

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