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

12 years agotracepoints: Add support for CONDITION events
Josh Stone [Tue, 11 Oct 2011 23:55:59 +0000 (16:55 -0700)]
tracepoints: Add support for CONDITION events

These are events that check a condition before raising callbacks, but
take no hit for the condition when not tracing.  We don't have to do
anything special in stap except handle the new macro, as the condition
is handled at the trace site.

* tapsets.cxx (tracepoint_builder::get_tracequery_modules): Add a
  definition for DECLARE_TRACE_CONDITION.  Also settle the macro-
  arg wrappers to PARAMS().

12 years agotracepoints: Support reading enum parameters
Josh Stone [Tue, 11 Oct 2011 22:04:13 +0000 (15:04 -0700)]
tracepoints: Support reading enum parameters

* tapsets.cxx (resolve_tracepoint_arg_type): Treat enum like any other
  numeric base type, simply casted to int64_t.
  (tracepoint_derived_probe::build_args): Log parameter availability.

12 years agotracepoints: Skip identical headers from the build and source trees
Josh Stone [Tue, 11 Oct 2011 21:15:27 +0000 (14:15 -0700)]
tracepoints: Skip identical headers from the build and source trees

In preparing the tracequery source, we normalize paths containing
"include/" to just the suffix part, so the header will be found by the
normal -I path.  However, the debuginfo source tree usually contains
at least the same headers found in the build tree.  We were thus
building effectively the same tracequery twice for headers that are
present in both the build and source trees.  Stop that!

* tapsets.cxx (tracepoint_builder::init_dw): Build the header list with
  knowledge of the "include/" normalization to avoid extra work.

12 years agotracepoints: Avoid building tracequery.ko targets
Josh Stone [Tue, 11 Oct 2011 20:42:04 +0000 (13:42 -0700)]
tracepoints: Avoid building tracequery.ko targets

Since we're now only using the tracequery.o intermediates, we can forgo
building the tracequery.ko modules altogether.  This saves about a third
of the processing time on my machine.

* buildrun.cxx (make_any_make_cmd): New, the common make_cmd base.
  (make_make_cmd): The normal case targets "modules".
  (make_make_objs_cmd): New, build only stage-1 objects.
  (make_tracequeries): Call make_make_objs_cmd.

12 years agotracepoints: Work with the tracequery's .o rather than .ko
Josh Stone [Tue, 11 Oct 2011 20:21:34 +0000 (13:21 -0700)]
tracepoints: Work with the tracequery's .o rather than .ko

The intermediate object files are slightly smaller, since they don't
have any of the module boilerplate compiled in yet.  It still has what
we need though, just the basic stapprobe_* function definitions.

* buildrun.cxx (make_tracequeries): Return .o filenames rather than .ko.
* hash.cxx (find_tracequery_hash): Use .o for cached filenames.
* tapsets.cxx (tracepoint_builder::get_tracequery_modules): Update
  comments and variable names to refer to objects instead of kos.

12 years agotracepoints: Cache an empty file for failures
Josh Stone [Tue, 11 Oct 2011 20:13:40 +0000 (13:13 -0700)]
tracepoints: Cache an empty file for failures

When a tracepoint header doesn't compile for any reason, we'd like not
to keep trying on subsequent runs.  This patch restores previous
behavior that would save an empty file in the cache, signaling that
we've tried this header before and can't get anything from it.

* tapsets.cxx (tracepoint_builder::get_tracequery_modules): When reading
  from the cache, note and skip empty files.  When saving to the cache,
  copy /dev/null for those that failed to compile.

12 years agoPR3823: fix accidental whitespace included in type mismatch messages for i18n
Frank Ch. Eigler [Tue, 11 Oct 2011 13:39:56 +0000 (09:39 -0400)]
PR3823: fix accidental whitespace included in type mismatch messages for i18n

* elaborate.cxx (typeresolution_info::mismatch): eliminate excess space.

Reported-by: Petr Muller <pmuller@redhat.com> and the fine fujitsu testsuite
12 years agoPR13155/BZ730884: ext3/jbd tracepoint listings
Han Pingtian [Mon, 10 Oct 2011 10:12:37 +0000 (06:12 -0400)]
PR13155/BZ730884: ext3/jbd tracepoint listings

A few tracepoint-class-specific hacks to make ext3 / jbd / ext4 / jbd2
all show up on appropriate kernels.

* tapsets.cxx (tracepoint_extra_decls): Add extra ext[34] clauses.

12 years agotestsuite: add dummyish test case for tracepoint listing only
Frank Ch. Eigler [Mon, 10 Oct 2011 10:12:19 +0000 (06:12 -0400)]
testsuite: add dummyish test case for tracepoint listing only

12 years agoPR13100: build tracepoint query modules separately, concurrently
Frank Ch. Eigler [Mon, 10 Oct 2011 09:08:22 +0000 (05:08 -0400)]
PR13100: build tracepoint query modules separately, concurrently

* tapsets.cxx (tracepoint_extra_decls): Prepare for PR13155.
  (get_tracepoint_modules): Rewrite former get_tracepoint_module().
  (tracepoint_builder::init_dw): Don't even try to build all tracequery
  modules at once.
* buildrun.cxx (make_tracequeries): Replace make_tracequery().
  Run given compilation jobs in parallel.
* buildrun.h: Corresponding changes.
* hash.cxx (find_tracequery_hash): Clarify signature for single header.
* hash.h: Corresponding changes.

12 years agotestsuite: note number of kernel tracepoints tested in pass result
Frank Ch. Eigler [Mon, 10 Oct 2011 08:48:26 +0000 (04:48 -0400)]
testsuite: note number of kernel tracepoints tested in pass result

12 years agoexamples: add a &para; anchor to the keyword index html too
Frank Ch. Eigler [Fri, 7 Oct 2011 21:33:17 +0000 (17:33 -0400)]
examples: add a &para; anchor to the keyword index html too

12 years agoexamples: tweak keyword selections
Frank Ch. Eigler [Fri, 7 Oct 2011 21:31:07 +0000 (17:31 -0400)]
examples: tweak keyword selections

12 years agoexamples: add a &para; anchor before individual examples in full index
Frank Ch. Eigler [Fri, 7 Oct 2011 21:28:31 +0000 (17:28 -0400)]
examples: add a &para; anchor before individual examples in full index

12 years agoPR3217: Fix systemtap.base/vars.exp
Josh Stone [Fri, 7 Oct 2011 17:13:38 +0000 (10:13 -0700)]
PR3217: Fix systemtap.base/vars.exp

This test has a grep on pass-3 code, which started matching too much
with the new compiled-printf output.  This tightens that grep down a
bit, and adds a comment explaining what the test is trying to do.

12 years agoPR13272: Fix quoted strings in the printf shortcut path
Josh Stone [Fri, 7 Oct 2011 16:48:43 +0000 (09:48 -0700)]
PR13272: Fix quoted strings in the printf shortcut path

For printf strings with no arguments, we usually skip all the printf
path altogether and just use _stp_print.  However, the compiled-printf
changes affected the level of string escaping, which broke for a case
like printf("\"quote\\this\"\n").  We must make sure that this shortcut
path uses an output-quoted string literal.

* translate.cxx (c_unparser::visit_print_format): Generate an output-
  quoted format_string too, for use by the _stp_print shortcut.
  (preprocess_print_format): The "%s\n" case shouldn't alter components.
* testsuite/buildok/printf.stp: Add "%s" and "%s\n" shortcut tests too.

12 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
Mark Wielaard [Fri, 7 Oct 2011 11:18:33 +0000 (13:18 +0200)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

12 years agoEnable dwarf unwinder for ppc64.
Mark Wielaard [Fri, 7 Oct 2011 09:54:39 +0000 (11:54 +0200)]
Enable dwarf unwinder for ppc64.

12 years agoAlways remove prefix '.' when _stp_snprint_addr() human readable symname.
Mark Wielaard [Fri, 7 Oct 2011 09:51:06 +0000 (11:51 +0200)]
Always remove prefix '.' when _stp_snprint_addr() human readable symname.

Some arches prefix some symbol names with '.', to make symbol names as
presented in human readable form consistent across arches always remove
them when printing them with _stp_snprint_addr. Remove special casing
in context-symbols.stp probefunc().

12 years agoPR3217: Add STP_LEGACY_PRINT option to use the old form
Josh Stone [Thu, 6 Oct 2011 20:00:09 +0000 (13:00 -0700)]
PR3217: Add STP_LEGACY_PRINT option to use the old form

* translate.cxx (c_unparser::visit_print_format): Alternate using
  STP_LEGACY_PRINT between the new compiled printfs and the old
  _stp_[s]printf, so we can make sure both still work.
  (c_unparser::emit_compiled_printf_locals): Conditionalize.
  (c_unparser::emit_compiled_printfs): Conditionalize.
* testsuite/lib/stap_run2.exp: Show extra args used in stap_run2.
* testsuite/systemtap.printf/*.exp: Run -DSTP_LEGACY_PRINT too in all
  the tests using stap_run2.  Others will require greater restructuring
  to achieve this...

12 years agoPR3217: Make compiled-printf functions noinline
Josh Stone [Thu, 6 Oct 2011 19:33:59 +0000 (12:33 -0700)]
PR3217: Make compiled-printf functions noinline

When running systemtap.printf/int1.stp, I got:

    ...: In function ‘probe_1997’:
    ...:3885:1: error: the frame size of 772 bytes is larger than 256 bytes [-Werror=frame-larger-than=]

It's not yet clear to me why gcc claims so much stack space here, as
even in the compiled printf functions, most of the local variables have
very limited scope.  For now, marking them noinline solves the issue,
but this deserves closer inspection...

* translate.cxx (c_unparser::emit_compiled_printfs): Mark each generated
  printf function as noinline.

12 years agoPR3217: Merge similar compiled-printfs
Josh Stone [Tue, 27 Sep 2011 22:30:13 +0000 (15:30 -0700)]
PR3217: Merge similar compiled-printfs

It's pretty common for tapset wildcards to expand to lots of probes with
slightly different handlers (e.g. syscall.*), and we'd like for the
newly expanded printf code to not be duplicated so much.

This patch keeps a hash in the translator of visited format strings, so
we can output a compiled version of that only once.  This requires some
new argument space in the context, but we can optimize by realizing that
(1) printfs never nest when arguments are precomputed, (2) string
arguments are immutable and need not be copied, and (3) return strings
for sprintf can write directly to the caller's tmpvar.

* translate.cxx (c_unparser::compiled_printfs): New map for storing
  pair(print_to_stream, format_string) -> compiled printf name.
  (c_unparser::emit_compiled_printfs): New, emit the expanded function
  body for every compiled printf.
  (c_unparser::emit_compiled_printf_locals): New, emit a union-struct of
  context locals for all compiled printfs.
  (c_unparser::emit_common_header): Call emit_compiled_printf*.
  (c_unparser::declare_compiled_printf): New, called to declare that we
  need this printf -- add it to the map if it's not already there.
  (c_tmpcounter::visit_print_format): Declare printfs as we see them.
  (c_unparser::get_compiled_printf): New, get the name for a previously
  declared printf function.
  (c_unparser::visit_print_format): Get the compiled printf function.

12 years agoPR3217: Compiled printf
Josh Stone [Tue, 7 Jun 2011 23:50:20 +0000 (16:50 -0700)]
PR3217: Compiled printf

This translates script-level printf statements into unrolled printing
statements.  The compiled code is faster, but also larger.

* runtime/vsprintf.c (_stp_vsprint_memory): Factored out for %s/%m/%M.
  (_stp_vsprint_memory_size): Factored out for size of %s/%m/%M.
  (_stp_vsprint_memory_size): Factored out for %b.
  (_stp_vsprint_binary_size): Factored out for size of %b.
* staptree.h (print_format::format_flag): Match the same definitions
  used by print_flag in runtime/vsprintf.c.
  (print_format::conversion_type): Collapse numeric types into one.
  (print_format::format_component::base): New field to classify numeric.
  (print_format::set_flag, print_format::test_flag): New, for convenience.
* elaborate.cxx (typeresolution_info::visit_print_format): Handle the
  changes in conversion_type.
* staptree.cxx (print_format::components_to_string): Parse out the new
  and impoved format_component.
  (print_format::string_to_components): Create the new format_component.
* translate.cxx (c_unparser::visit_print_format): Generate unrolled code
  for printf statements.

12 years agoDWARF_REG_MAP reg_value argument of DW_CFA_register in unwinder.
Mark Wielaard [Wed, 5 Oct 2011 21:36:52 +0000 (23:36 +0200)]
DWARF_REG_MAP reg_value argument of DW_CFA_register in unwinder.

12 years agoPR13266 Implement DW_CFA_restore in the dwarf unwinder.
Mark Wielaard [Wed, 5 Oct 2011 20:23:01 +0000 (22:23 +0200)]
PR13266 Implement DW_CFA_restore in the dwarf unwinder.

Store the initial reg state after processing the CIE and restore
on DW_CFA_restore[_extended].

12 years agoAUTHORS: bump
Frank Ch. Eigler [Fri, 30 Sep 2011 01:49:29 +0000 (21:49 -0400)]
AUTHORS: bump

12 years agoExplicitly set UNW_PC in unwinder to retAddrReg value if not yet set.
Mark Wielaard [Wed, 5 Oct 2011 17:49:08 +0000 (19:49 +0200)]
Explicitly set UNW_PC in unwinder to retAddrReg value if not yet set.

This is necessary when the UNW_PC storage is not equal to where retAddrReg
is set.

12 years agoSupport same value rules in unwinder. Don't treat undefined as same value.
Mark Wielaard [Wed, 5 Oct 2011 13:04:17 +0000 (15:04 +0200)]
Support same value rules in unwinder. Don't treat undefined as same value.

The unwinder treated undefined and same value rules the same. This patch
introduces different states for them. All "real" registers are assumed to
be "same value". Their value will be carried over to the next frame unless
overruled. All other "fake" dwarf registers are treated as undefined.
This makes a difference for architectures where for example the dwarf
return register is a real register, where same value means something
different from undefined (e.g. ppc).

12 years agoExtend optionalprobe.exp timeout to 120 seconds.
Mark Wielaard [Wed, 5 Oct 2011 10:01:18 +0000 (12:01 +0200)]
Extend optionalprobe.exp timeout to 120 seconds.

optionalprobe.exp uses tracepoint probes and is the first to do so.
Generating the tracepoint cache can take more than 60 seconds on some setups.

12 years agoDocument process.plt.
Stan Cox [Tue, 4 Oct 2011 15:11:19 +0000 (11:11 -0400)]
Document process.plt.

NEWS: Add process.plt.
stapprobes.3stap:  Likewise.
doc/langref.tex:  Likewise.

12 years agoIntroduce DWARF_MAP_REG for unwind.
Mark Wielaard [Tue, 4 Oct 2011 13:19:52 +0000 (15:19 +0200)]
Introduce DWARF_MAP_REG for unwind.

The reg_info array assumes dwarf register numbers start at zero and
are consecutive.  If that isn't the case for some architecture (e.g. ppc)
then redefine DWARF_MAP_REG to map the given dwarf register number to the
actual reg_info index.

12 years agoAdd process.library.plt
Stan Cox [Mon, 3 Oct 2011 15:14:44 +0000 (11:14 -0400)]
Add process.library.plt

tapsets.cxx (symbol_table::get_first_func):  New.
(dwarf_query::query_module_symtab):    Use it to as a placeholder, which
is replaced by plt entry address.
(symbol_table::*)  Add \n to cerr messages.

plt.exp:  Test process.library.plt

12 years agoRename runtime/stack-x86.c -> runtime/stack-dwarf.c to reuse by other arches.
Mark Wielaard [Mon, 3 Oct 2011 13:08:10 +0000 (15:08 +0200)]
Rename runtime/stack-x86.c -> runtime/stack-dwarf.c to reuse by other arches.

12 years agoCheck module was actually created in tracepoint_builder.
Mark Wielaard [Fri, 30 Sep 2011 13:57:43 +0000 (15:57 +0200)]
Check module was actually created in tracepoint_builder.

Commit e86f32 added -i to the make invocation for tracequery jobs. This
means make would succeed even if there were errors. So it was possible
that tracequery_ko didn't actually exist. Leading to spurious warnings
about copying non-existing files into the cache when used.

12 years agotapset: remove result caching from __find_bdevname
Frank Ch. Eigler [Thu, 29 Sep 2011 21:33:48 +0000 (17:33 -0400)]
tapset: remove result caching from __find_bdevname

This function is indirectly used from many vfs tapset probe points.
Since it sets/gets an internal script global variable, the current
optimizer does not elide this function, thus wasting time, space, and
risks @cast/kread runtime errors.  Let's get rid of the cache, until
the optimizer can do this automagically.

* tapset/vfs.ftp (__find_bdevname): Simplify.

12 years agoRemove unused unwind _stp_put_unaligned definitions.
Mark Wielaard [Thu, 29 Sep 2011 15:04:40 +0000 (17:04 +0200)]
Remove unused unwind _stp_put_unaligned definitions.

12 years agoConvert _stp_ctl_write_cmd->default's message to dbug_trans2
Josh Stone [Wed, 28 Sep 2011 21:07:07 +0000 (14:07 -0700)]
Convert _stp_ctl_write_cmd->default's message to dbug_trans2

12 years agoPR13128: preparing for more privilege levels
Josh Stone [Wed, 28 Sep 2011 20:58:11 +0000 (13:58 -0700)]
PR13128: preparing for more privilege levels

Only staprun (euid==0) sends STP_RELOCATION and STP_TZINFO.

12 years agoMerge branch 'master' of ssh://sources.redhat.com/git/systemtap
William Cohen [Wed, 28 Sep 2011 16:19:53 +0000 (12:19 -0400)]
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap

12 years agoFix typo in loc2c-runtime.h for ia64
William Cohen [Wed, 28 Sep 2011 15:40:06 +0000 (11:40 -0400)]
Fix typo in loc2c-runtime.h for ia64

12 years agoFix typo in loc2c-runtime.h for ia6
William Cohen [Wed, 28 Sep 2011 15:40:06 +0000 (11:40 -0400)]
Fix typo in loc2c-runtime.h for ia6

12 years agoIntroduce gfp_mask variants of _stp allocation functions.
Mark Wielaard [Wed, 28 Sep 2011 11:18:18 +0000 (13:18 +0200)]
Introduce gfp_mask variants of _stp allocation functions.

* runtime/alloc.c: Add _stp_kmalloc_gfp(), _stp_kzalloc_gfp() and
  _stp_kmalloc_node_gfp() which take a gfp_mask in case you really know
  what you are doing.
* translate.cxx (emit_module_init): Use with GFP_KERNEL for context alloc.
* runtime/map.c: Use for init and new functions called at module_init time.
* runtime/stat.c: Likewise.

12 years agoruntime/alloc.c: Remove unused _stp_vmalloc() and _stp_vfree() functions.
Mark Wielaard [Wed, 28 Sep 2011 10:15:22 +0000 (12:15 +0200)]
runtime/alloc.c: Remove unused _stp_vmalloc() and _stp_vfree() functions.

12 years ago_stp_vma_match_vdso: Don't subtract build_id_len from notes_addr.
Mark Wielaard [Tue, 27 Sep 2011 14:21:15 +0000 (16:21 +0200)]
_stp_vma_match_vdso: Don't subtract build_id_len from notes_addr.

Older (pre-0.138) elfutils would erroneously return the address of the
build id note address with the length added. Newer ones never do this.
And we only support elfutils 0.142+ now anyway. Fixes vma_vdso.exp.

12 years agodtrace.in: generate DTRACE_PROBE compatibility macro instead of STAP_PROBE.
Mark Wielaard [Tue, 27 Sep 2011 12:28:45 +0000 (14:28 +0200)]
dtrace.in: generate DTRACE_PROBE compatibility macro instead of STAP_PROBE.

12 years agostack.c (_stp_get_uregs): Detect kernel unwind before user unwind case.
Mark Wielaard [Mon, 26 Sep 2011 14:19:37 +0000 (16:19 +0200)]
stack.c (_stp_get_uregs): Detect kernel unwind before user unwind case.

Detect and optimize the kernel backtrace() then user backtrace in same
probe case, by reusing the unwind info.

12 years agostack.c (_stp_get_uregs): Recover user registers from kernel context.
Mark Wielaard [Fri, 23 Sep 2011 11:34:37 +0000 (13:34 +0200)]
stack.c (_stp_get_uregs): Recover user registers from kernel context.

When possible recover full pt_regs user register set by unwinding
using kernel context till we hit user space.

12 years agounwind.c (adjustStartLoc): Call stap_find_vma_map_info_user() only on task.
Mark Wielaard [Fri, 23 Sep 2011 11:18:32 +0000 (13:18 +0200)]
unwind.c (adjustStartLoc): Call stap_find_vma_map_info_user() only on task.

For kernel modules the mapped address is found in the section static_addr.

12 years ago_stp_current_pt_regs() helper, explicitly checks current->mm.
Mark Wielaard [Fri, 23 Sep 2011 11:07:07 +0000 (13:07 +0200)]
_stp_current_pt_regs() helper, explicitly checks current->mm.

task_pt_regs(current) is only valid when current->mm has been setup.

12 years agoPR12221 cont'd: Added module suport for adding build id to hash
Chris Meek [Thu, 22 Sep 2011 19:04:32 +0000 (15:04 -0400)]
PR12221 cont'd: Added module suport for adding build id to hash

Now when you probe a module, the build ID of the module is
added to the script's hash.

dwflpp.cxx:
  - Calls dwfl_getmodules in setup_kernel with a new callback
  add_module_build_id_to_hash().
  - Added add_module_build_id_to_hash() callback.

dwflpp.h:
  - Added function declaration for above callback.

setupdwfl.cxx:
  - Removed adding kernel build ID to session variable as new
  callback handles that case as well.

12 years agoPR13216: set AM_GNU_GETTEXT_VERSION(0.17) in configury
Frank Ch. Eigler [Thu, 22 Sep 2011 15:53:13 +0000 (11:53 -0400)]
PR13216: set AM_GNU_GETTEXT_VERSION(0.17) in configury

12 years agotestsuite: standardize test $pass/$fail messages
Frank Ch. Eigler [Wed, 21 Sep 2011 15:57:50 +0000 (11:57 -0400)]
testsuite: standardize test $pass/$fail messages

* lib/stap_run_error.exp (stap_run_error): Make pass & fail testcase
  names the same, so regressions can be more easily found.

12 years agoFix pre gcc 4.6 unitialized variable warnings.
Stan Cox [Wed, 21 Sep 2011 14:20:51 +0000 (10:20 -0400)]
Fix pre gcc 4.6 unitialized variable warnings.

dwflpp.cxx (dwflpp::iterate_over_plt):  Initialize have_rel/have_rela.

12 years agodwflpp.cxx (dwflpp::iterate_over_plt): Initialize both rel and rela.
Mark Wielaard [Wed, 21 Sep 2011 14:02:05 +0000 (16:02 +0200)]
dwflpp.cxx (dwflpp::iterate_over_plt): Initialize both rel and rela.

So gcc can see they are not used uninitialized.

12 years agoPut probe name descriptions on separate line to include in tapset ref.
Mark Wielaard [Wed, 21 Sep 2011 13:16:18 +0000 (15:16 +0200)]
Put probe name descriptions on separate line to include in tapset ref.

To get included in the tapset reference manual a probe name description
cannot start on the first '/**' comment line.

12 years agoAlso recognize rel.plt, which is used on x686.
Stan Cox [Wed, 21 Sep 2011 12:54:28 +0000 (08:54 -0400)]
Also recognize rel.plt, which is used on x686.

dwflpp.cxx (dwflpp::iterate_over_plt):  Allow either .rela.plt or .rel.plt.

12 years agoTell the user if UTS_VERSION does not match running kernel
Timo Juhani Lindfors [Wed, 21 Sep 2011 09:19:01 +0000 (12:19 +0300)]
Tell the user if UTS_VERSION does not match running kernel

The test is done before looking at build-id since build-id error
messages like

ERROR: Build-id mismatch: "kernel" vs. "vmlinux-2.6.32-5-amd64" byte 0 (0x5e vs 0xff)
Pass 5: run failed.  Try again with another '--vp 00001' option.

are not very user-friendly.

12 years agoPR13210 vma/vdso tracking is broken testcase
Mark Wielaard [Wed, 21 Sep 2011 10:38:24 +0000 (12:38 +0200)]
PR13210 vma/vdso tracking is broken testcase

Add a generic testcase to see if we can track the vma from which a syscall
was made. This might or might not come in through the vdso on the particular
(compat) arch, but should always at least be able to get the vma name.
Currently it fails some of the tests in different ways for different arches
and/or kernel versions.

12 years agoAdd process.plt test.
Stan Cox [Tue, 20 Sep 2011 18:14:46 +0000 (14:14 -0400)]
Add process.plt test.

testsuite/systemtap.base/plt.exp:  New test.
testsuite/systemtap.base/plt.c:  New test case.
tapsets.cxx (base_query::base_query):  .plt requires the elf symbol table.

12 years agoPut struct unwind_frame_info in unwind.h and remove unused task field.
Mark Wielaard [Tue, 20 Sep 2011 20:22:14 +0000 (22:22 +0200)]
Put struct unwind_frame_info in unwind.h and remove unused task field.

Remove the identical definitions of struct unwind_frame_info from
unwind/i386.h and unwind/x86_64.h and put it in unwind/unwind.h.
Also put struct unwind_context there to keep all struct definitions
together. Remove unused task field from struct unwind_frame_info.

12 years agoPR 13107: simplify compile-server testsuite
Dave Brolley [Tue, 20 Sep 2011 16:56:42 +0000 (12:56 -0400)]
PR 13107: simplify compile-server testsuite

- Removed the use of a wrapper script to run stap using the server.
- Client/server tests now use the --use-server option as needed.
- testsuite/systemtap.server/server.exp is now reduced.
  - no longer runs all of buildok tests
  - now runs tests on server-specific functionality
  - general client/server interoperability covered by existing tests.

12 years agoBZ732346 vs PR12729: don't print make failure messages for bad tracepoints
Frank Ch. Eigler [Tue, 20 Sep 2011 14:49:41 +0000 (10:49 -0400)]
BZ732346 vs PR12729: don't print make failure messages for bad tracepoints

Having buggy/incomplete kernel tracepoint headers is routine, but
PR12729 started relaying make/gcc complaints about them to the user.
That's unkind.

* buildrun.cxx (make_tracequery): Run "make -i" instead of "make"
  for tracequery jobs.

12 years agotestsuite: add explicit timeouts to stap session
Frank Ch. Eigler [Tue, 20 Sep 2011 14:21:09 +0000 (10:21 -0400)]
testsuite: add explicit timeouts to stap session

With the previous code, it was possible for the delayedkill ./loop job
to be killed before the stap script watching for its end got really
ready.  That could mean that the stap script starts, and waits, and
waits, and waits more, and waits, and waits, and waits, and waits, and
waits, and waits, and waits, and waits, and waits, and waits, and
waits, and waits, and waits yet more, and waits, and waits, and waits,
and waits, and waits, and waits, and waits, and waits, and waits, and
waits, and waits a bit longer, and waits, and waits, and waits, and
waits, and waits, and waits, and waits, and waits more , and waits,
and waits, and waits, and waits, and waits, and waits, and waits, and
waits, and keeps waiting, and waits, and waits, and waits, and waits,
and waits, and waits, and waits, and goes on waiting, and waits, and
waits a lot, and waits, and waits, and waits, and waits, and waits,
and waits, and waits, and waits for warts, and waits, and waits, and
waits, and waits, and waits, and waits, and waits, and waits, now
getting slightly impatient, and waits, and waits, and waits, and
waits, and waits, and waits, and waits, and waits, and waits, and
waits, and waits, and waits, and waits, and waits a lot more.

Since there is no robust synchronization in the test case, let's
increase the delayedkill interval to make the above wait less likely,
plus add a godot timeout probe that will abort the script before it
gets grey hairs, loses its teeth, and gets bombarded with funeral
pre-planning spam.

12 years agoIntroduce _stp_get_uregs and _STP_PROBE_STATE_FULL_UREGS flag.
Mark Wielaard [Tue, 20 Sep 2011 09:48:28 +0000 (11:48 +0200)]
Introduce _stp_get_uregs and _STP_PROBE_STATE_FULL_UREGS flag.

No actual functionality change yet. _STP_PROBE_STATE_FULL_UREGS
is set for context probe_flags if full user register set is available
after calling _stp_get_uregs().

12 years agoFix arm _stp_get_register_by_offset switched uregs/kregs usage.
Mark Wielaard [Tue, 20 Sep 2011 09:07:14 +0000 (11:07 +0200)]
Fix arm _stp_get_register_by_offset switched uregs/kregs usage.

12 years agoPR13200: skip prologue searching for *.function(ADDR).return probes
Frank Ch. Eigler [Mon, 19 Sep 2011 18:25:43 +0000 (14:25 -0400)]
PR13200: skip prologue searching for *.function(ADDR).return probes

Prologue searching has to be suppressed for all kretprobes/uretprobes
address calculations, or else the *retprobes facility can overwrite
valid stack frame data instead of return addresses.

* tapsets.cxx (query_addr, query_func_info): Perform prologue analysis
  but verbosely ignore results, for .return probes.

12 years agouaddr(): Use CONTEXT->uregs directly when _STP_PROBE_STATE_USER_MODE set.
Mark Wielaard [Mon, 19 Sep 2011 15:27:44 +0000 (17:27 +0200)]
uaddr(): Use CONTEXT->uregs directly when _STP_PROBE_STATE_USER_MODE set.

12 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
Dave Brolley [Mon, 19 Sep 2011 15:14:32 +0000 (11:14 -0400)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

12 years agoRemove arch specific _stp_probing_32bit_app() and _stp_get_regparm().
Mark Wielaard [Mon, 19 Sep 2011 13:42:19 +0000 (15:42 +0200)]
Remove arch specific _stp_probing_32bit_app() and _stp_get_regparm().

Both functions were doing more than necessary and didn't actually need
access to the current regs. _STP_PROBE_STATE_USER_MODE tells us whether
the current probe triggered in user mode. _stp_is_compat_task() tells
us whether the current task is a 32-on-64 process.

* runtime/compatdefs.h (_stp_is_compat_task): Defined also when CONFIG_COMPAT
  is undefined (to always return false).
* runtime/loc2c-runtime.h: u_fetch_register() and u_store_register() are
  only called from user space dwarf context. Only needs _stp_is_compat_task()
  test.
* runtime/regs.c: Remove arch specific _stp_probing_32bit_app() and
  _stp_get_regparm() functions.
* tapset/i386/registers.stp (_stp_arg): Check regparm directly.
* tapset/powerpc/registers.stp (probing_32bit_app): Use _stp_is_compat_task()
  test.
* tapset/s390/registers.stp (probing_32bit_app): Likewise.
* tapset/x86_64/registers.stp (_stp_arg): Check regparm directly.
  (probing_32bit_app): Use _stp_is_compat_task() test.
  (regparm): Likewise.

12 years agoPR12136: Test a @cast to type sdt::string
Josh Stone [Fri, 16 Sep 2011 23:45:15 +0000 (16:45 -0700)]
PR12136: Test a @cast to type sdt::string

This test would previously fail to find std::string, as that type is not
at the top level of the CU in the debuginfo, but rather nested under the
DIE for the std namespace.  It should now be found.

Note however that this test is currently failing for me due to an
apparently bad argument calculation.  The @cast in the SDT probe looks
good, but from the function probe it's getting a bad pointer for $str.
It's OK on F15 i686, but not on F15 x86_64.  I think this issue is
distinct from what I'm fixing, but it need further investigation...

12 years agoFill in @cast default module from SDT
Josh Stone [Fri, 16 Sep 2011 22:59:45 +0000 (15:59 -0700)]
Fill in @cast default module from SDT

If a @cast in SDT context does not have a specified source for type
info, then we should infer it as the SDT's module, as we do for normal
DWARF-based probes.

* tapsets.cxx (sdt_uprobe_var_expanding_visitor::visit_cast_op): If the
  @cast module isn't already set, use the SDT module.
  (sdt_kprobe_var_expanding_visitor::visit_cast_op): Ditto.

12 years agoPR12136: Load nested types for C++ CUs
Josh Stone [Wed, 24 Aug 2011 23:21:38 +0000 (16:21 -0700)]
PR12136: Load nested types for C++ CUs

For C++ compile units only, check for nested type definitions within
namespaces, structures, and classes.  This allows @cast to have access
to types like "std::string".

* dwflpp.cxx (dwflpp::global_alias_caching_callback): Take a flag
  has_inner_types to indicate that we should recurse, and a prefix to
  specify what we've already recursed into.
  (dwflpp::iterate_over_globals): Check whether we're in C++, then do
  the real work in the new iterate_over_types.
  (dwflpp::iterate_over_types): Do the work that iterate_over_globals
  used to handle, without assuming that we're starting in a top CU.

12 years agoImprove scope splitting in function specs
Josh Stone [Tue, 23 Aug 2011 23:59:16 +0000 (16:59 -0700)]
Improve scope splitting in function specs

We now take care to only split "::" separators that are outside of any
template specification.  So "std::foo<std::bar>" becomes only two
components, "std" and "foo<std::bar>".

* util.cxx (tokenize_cxx): Split on "::" only outside of templates.
* tapsets.cxx (dwarf_query::parse_function_spec): Use tokenize_cxx.

12 years agoPR13193 wallpaper
Frank Ch. Eigler [Fri, 16 Sep 2011 21:34:14 +0000 (17:34 -0400)]
PR13193 wallpaper

The reported stuck process bug (whether it's in the kernel or
in stap), is apparently triggered by concurrent modprobes.  Change
the testsuite to avoid this practice, to wallpaper over the problem
temporarily.

12 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
Dave Brolley [Fri, 16 Sep 2011 20:20:23 +0000 (16:20 -0400)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

Conflicts:
NEWS

12 years agoPR 11441 - continue with unprivileged test suite
Dave Brolley [Fri, 16 Sep 2011 20:18:09 +0000 (16:18 -0400)]
PR 11441 - continue with unprivileged test suite

Deprecate probe types discovered during testing to have no reasonable
meaning:

      kernel.function(number).inline
      module(string).function(number).inline
      process.function(number).inline
      process.library(string).function(number).inline
      process(string).function(number).inline
      process(string).library(string).function(number).inline

12 years agoAdd process.plt to probe plt entries.
Stan Cox [Fri, 16 Sep 2011 15:31:39 +0000 (11:31 -0400)]
Add process.plt to probe plt entries.

* dwflpp.cxx (iterate_over_plt):  New to callback through plt entries.
* dwflpp.h: Likewise.
* tapsets.cxx (TOK_PLT): New.
(base_query::query_plt_callback, query_plt):  New methods.
(base_query):  New members has_plt, has_statement, plt_val.
(base_query::base_query):  Set new members.
(dwarf_query::query_module_symtab):  Use raw address for plt entries.
(dwarf_query::add_probe_point): Don't reloc the plt entry address.
(query_module):  Call iterate_over_plt.
(plt_expanding_visitor):  New to expand $$name.
(dwarf_derived_probe::register_patterns):  Add new probe tags.

12 years agoSplit kregs and uregs in probe context.
Mark Wielaard [Fri, 16 Sep 2011 12:33:06 +0000 (14:33 +0200)]
Split kregs and uregs in probe context.

Keep track of kernel registers and user registers for a probe context
separately in anticipation of k/uregs "recovery". This patch simply
replaces the regs field of common_probe_context.h with a kregs and uregs
field, plus changes all over to use one or the other to store or fetch
the appropriate registers.

12 years agoPR13156 cont'd: Removed String Truncating Code
Chris Meek [Thu, 15 Sep 2011 18:55:13 +0000 (14:55 -0400)]
PR13156 cont'd: Removed String Truncating Code

No longer truncates anything. Just prints everything as-is in
the hash log.

12 years agoPR13101 Networking tapsets should have structured comments
William Cohen [Thu, 15 Sep 2011 18:25:36 +0000 (14:25 -0400)]
PR13101 Networking tapsets should have structured comments

Fix up the language for the default filter functions for ipmib, linuxmib,
and tcpmib. Also make the functions return sane values regardless of
the value of the op parameter.

12 years agoPR6503 NEWS blurb
Frank Ch. Eigler [Thu, 15 Sep 2011 01:02:47 +0000 (21:02 -0400)]
PR6503 NEWS blurb

12 years agoPR6503 test cases
Frank Ch. Eigler [Thu, 15 Sep 2011 01:00:26 +0000 (21:00 -0400)]
PR6503 test cases

12 years agoPR6503: verify build-ids of dynamically arriving modules
Frank Ch. Eigler [Wed, 14 Sep 2011 22:49:51 +0000 (18:49 -0400)]
PR6503: verify build-ids of dynamically arriving modules

With the horrible module_sect_attr* hack, the .note.gnu.build-id data
may now be verified.

* runtime/sym.c (_stp_kmodule_check): New function.
* runtime/transport/symbols.c (_stp_module_notifier): Upon MODULE_STATE_COMING,
  verify build-ids.  Reject the module from further consideration upon a
  mismatch.

12 years agoPR6503: get at dynamic module section addresses via horrible hack (tm)
Frank Ch. Eigler [Wed, 14 Sep 2011 21:52:44 +0000 (17:52 -0400)]
PR6503: get at dynamic module section addresses via horrible hack (tm)

Since <linux/module.h> does not declare structs module_sect_attr[s],
let's declare it ourselves.  We need to get at these, because
otherwise there is no way to get at the build-id section address.

* runtime/autoconf-module-sect-attrs.c: New (partial) autoconf file.
* buildrun.cxx (compile_pass): Build it.
* runtime/transport/symbols.c (_stp_module_notifier): Use our own
  modern (2.6.19+) declaration of these structs to pass all section
  names/addresses to _stp_kmodule_update_address.

12 years agoPR6503: note special build-id relocation with -DDEBUG_SYMBOLS
Frank Ch. Eigler [Wed, 14 Sep 2011 21:51:27 +0000 (17:51 -0400)]
PR6503: note special build-id relocation with -DDEBUG_SYMBOLS

* runtime/sym.c (_stp_kmodule_update_address): Specially
  note .note.gnu.build-id pseudo-section being relocated.

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