]> sourceware.org Git - systemtap.git/log
systemtap.git
15 years agoAdd limit on unwind table size we accept.
Mark Wielaard [Tue, 20 Oct 2009 10:38:55 +0000 (12:38 +0200)]
Add limit on unwind table size we accept.

* translate.cxx (MAX_UNWIND_TABLE_SIZE): New define.
  (dump_unwindsyms): Check debug_len and eh_len against new limit.

15 years agoAdd testsuite for tcl sdt markers.
Stan Cox [Mon, 19 Oct 2009 02:26:27 +0000 (22:26 -0400)]
Add testsuite for tcl sdt markers.

dtrace.in (provider::generate): Set enabled to true until .so is resolved.
tcl.exp:  New testsuite for tcl sdt markers modelled after mysql.

15 years agoImprove some runtime struct layouts
Josh Stone [Tue, 20 Oct 2009 01:11:58 +0000 (18:11 -0700)]
Improve some runtime struct layouts

Guided by pahole, I've shaved off a few padding bytes here and there.
New sizes on x86_64:

  stap_task_finder_target  192 -> 184
  stap_itrace_probe        216 -> 208
  stap_utrace_probe        328 -> 312
  stap_uprobe_tf           200 -> 192
  stap_uprobe_spec          48 ->  40

I only changed field layouts, not types or names, so this should be
perfectly safe. (FLW)

15 years agobemoan that _stp_*printf can't be protected with gcc attribute printf
Frank Ch. Eigler [Mon, 19 Oct 2009 17:53:33 +0000 (13:53 -0400)]
bemoan that _stp_*printf can't be protected with gcc attribute printf

15 years agofix 32-bit compatibility for @hist_log printing
Wenji Huang [Mon, 19 Oct 2009 17:49:23 +0000 (13:49 -0400)]
fix 32-bit compatibility for @hist_log printing

* stat-common.c (_stp_stat_print_histogram_buf): Fix HIST_PRINTF
  parameter passing.

15 years agoPR10799: warn on possibly uintended local-vs-global namespace collision
Frank Ch. Eigler [Mon, 19 Oct 2009 15:33:24 +0000 (11:33 -0400)]
PR10799: warn on possibly uintended local-vs-global namespace collision

* elaborate.cxx (find_var): Take extra token parameter.
  Look for cross-file global variable resolution, signal
  a warning.
* testsuite/systemtap.examples/io/traceio2.stp: Fix it.
* testsuite/systemtap.syscall/sys.stp: Fix it.
* NEWS: Document it.

15 years agoprovide error message token/context if loc2c doesn't
Frank Ch. Eigler [Mon, 19 Oct 2009 15:13:10 +0000 (11:13 -0400)]
provide error message token/context if loc2c doesn't

* tapsets.cxx (visit_target_symbol): When catching semantic_error,
  fill in token value if unset.  Can happen for loc2c DIE() msgs.

15 years agoAvoid lockdep warnings.
Srikar Dronamraju [Mon, 19 Oct 2009 08:14:21 +0000 (13:44 +0530)]
Avoid lockdep warnings.

uprobe_fork_uproc() runs with parent_uproc->rwsem locked.
However uprobe_mk_process() that gets called within uprobe_fork_uproc()
also locks child_uproc->rwsem after initializing it.

Lockdep report confuses this to acquiring a lock that already has been
acquired and suggests using sub-classes.

The alternatives we have are:
1. use classes level to distinguish different uproc structures.
2. unlock parent_uproc->rwsem before we call uprobe_fork_uproc().
3. dont try locking child_uproc->rwsem; since we are protected by
   uproc_mutex as well as parent_uproc->rwsem;

We use the last approach.

Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
---

15 years agoPR10331: build fix for older nss redux
Frank Ch. Eigler [Fri, 16 Oct 2009 12:05:14 +0000 (08:05 -0400)]
PR10331: build fix for older nss redux

Reported by Wenji, these SEC_* symbols were enums rather than macros,
so instead of individual #ifdefs ...

* stapsslerr.h: use NSS_{VMAJOR/VMINOR/VPATCH} to detect 3.12.4 or later
  for the two recent error symbols.

15 years agoFix transok/tval-opt.stp testcase. Pick diffent function and non-empty block.
Mark Wielaard [Thu, 15 Oct 2009 19:55:16 +0000 (21:55 +0200)]
Fix transok/tval-opt.stp testcase. Pick diffent function and non-empty block.

This testcase succeeded just because the value being set couldn't be
found. So the error message being compared was the same. Set -o pipefail
to catch that case. On vta compiled kernels it failed because the optimizer
turned { statement } into statement. So pick a function and argument which
location can always be found and add an extra 'next' statement so the
block isn't folded.

* testsuite/transok/tval-opt.stp: Set -o pipefail. Add 'next' to make
  sure block isn't empty. Use "do_filp_open" and "mode".

15 years agoUpdated checking for grapher dependencies.
David Smith [Thu, 15 Oct 2009 17:39:15 +0000 (12:39 -0500)]
Updated checking for grapher dependencies.
* configure.ac: Made sure nss includes will error even if only 1 header
  isn't usable.  Added grapher dependencies gtkmm and boost headers.
* Makefile.in: Regenerated.
* config.in: Ditto.
* configure: Ditto.
* doc/Makefile.in: Ditto.
* doc/SystemTap_Tapset_Reference/Makefile.in: Ditto.
* grapher/Makefile.am: Use libglade CFLAGS/LIBS.
* grapher/Makefile.in: Regenerated.

15 years agoPR10331: build fix for older nss
Frank Ch. Eigler [Thu, 15 Oct 2009 15:25:06 +0000 (11:25 -0400)]
PR10331: build fix for older nss

* stapsslerr.h: #ifdef-conditionalize a few of the error codes,
  apparently defined some time after NSS 3.12.2.

Reported-By: Wenji Huang <wenji.huang@oracle.com>
15 years agoAdd boost-devel build requirement for the grapher.
David Smith [Thu, 15 Oct 2009 15:09:19 +0000 (10:09 -0500)]
Add boost-devel build requirement for the grapher.

15 years agoFix $$targets in dwarf probes
Josh Stone [Wed, 14 Oct 2009 23:12:49 +0000 (16:12 -0700)]
Fix $$targets in dwarf probes

My print_format refactoring in d5e178c1 missed an improperly-named
token, an sprint that should be sprintf.  Since the token value is now
significant, that name needs to be correct.

15 years agoPR10331: more ssl error text
Frank Ch. Eigler [Wed, 14 Oct 2009 21:47:47 +0000 (17:47 -0400)]
PR10331: more ssl error text

* stapsslerr.h: Added a few blurbs from mozilla sources.
  Added mozilla copyright/license header block, which lets
  us use this under GPLv2.

15 years agoPR10331: improve nss error message handling
Frank Ch. Eigler [Wed, 14 Oct 2009 21:02:47 +0000 (17:02 -0400)]
PR10331: improve nss error message handling

* stapsslerr.h: New file containing NSS* error number to string mappings.
  Originally from mozilla NSS documentation, also seen in other GPLv2
  software.
* nsscommon.c (nssError): Print error number, and text from <stapsslerr.h>.
* stap-{client,server}-connect.c (errWarn): Standardize on nssError().
* Makefile.am (nss binaries): Also link in nsscommon.c.

15 years agoReport experssion stack slot use back from loc2c.
Roland McGrath [Wed, 14 Oct 2009 20:59:06 +0000 (13:59 -0700)]
Report experssion stack slot use back from loc2c.

15 years agocheck for module-building Makefile more clearly
Frank Ch. Eigler [Wed, 14 Oct 2009 17:16:28 +0000 (13:16 -0400)]
check for module-building Makefile more clearly

* buildrun.cxx (compile_pass): stat the Makefile, not just the build/
  directory.

15 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
Tim Moore [Wed, 14 Oct 2009 16:45:25 +0000 (18:45 +0200)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

15 years agocleanup of graph data parser, using Boost functions where useful
Tim Moore [Wed, 14 Oct 2009 15:46:31 +0000 (17:46 +0200)]
cleanup of graph data parser, using Boost functions where useful

* grapher/StapParser.cxx (commaSplit): Use Boost string split function
  (findTaggedValue): Return bool instead of position
  (ioCallback): Avoid using hard-coded string lengths

15 years agoAdd DTRACE_PROBE10.
Mark Wielaard [Wed, 14 Oct 2009 10:46:51 +0000 (12:46 +0200)]
Add DTRACE_PROBE10.

We already had STAP_PROBE10, but not DTRACE_PROBE10 yet.

* includes/sys/sdt.h: Declare DTRACE_PROBE10 as STAP_PROBE10.

15 years agoMerge branch 'master' of ssh://wenji@sources.redhat.com/git/systemtap
Wenji Huang [Wed, 14 Oct 2009 02:26:03 +0000 (10:26 +0800)]
Merge branch 'master' of ssh://wenji@sources.redhat.com/git/systemtap

15 years agoMerge branch 'master' of sourceware.org:/git/systemtap
Josh Stone [Wed, 14 Oct 2009 02:20:05 +0000 (19:20 -0700)]
Merge branch 'master' of sourceware.org:/git/systemtap

15 years agoPR10746: update test cases related to probe process.*
Wenji Huang [Wed, 14 Oct 2009 02:19:05 +0000 (10:19 +0800)]
PR10746: update test cases related to probe process.*

* testsuite/semok/utrace01.stp: Switch by CONFIG_UTRACE.
* testsuite/systemtap.base/bz10294.stp: Ditto.
* testsuite/systemtap.base/bz6905.stp: Ditto.
* testsuite/systemtap.base/statement.exp: Mark untested if
  non-utrace kernel.

15 years agoConsolidate print_format creation
Josh Stone [Tue, 13 Oct 2009 23:57:38 +0000 (16:57 -0700)]
Consolidate print_format creation

We almost had a factory in print_format::parse_print, so let's take that
the rest of the way.  This way we don't have so much duplication in
initializing the print flags.

* staptree.cxx (print_format::parse_print): Replaced with...
  (print_format::create): New factory to parse and create print_formats.
* elaborate.cxx (add_global_var_display): Use this factory.
* parse.cxx (parser::parse_symbol): Ditto.
* tapset-mark.cxx
  (mark_var_expanding_visitor::visit_target_symbol_context): Ditto.
* tapset-utrace.cxx
  (utrace_var_expanding_visitor::visit_target_symbol_arg): Ditto.
* tapsets.cxx
  (dwarf_var_expanding_visitor::visit_target_symbol_context): Ditto.
  (tracepoint_var_expanding_visitor::visit_target_symbol_context) Ditto.

15 years agoruntime shutdown errors: simplify, improve error specificity
Frank Ch. Eigler [Tue, 13 Oct 2009 21:33:29 +0000 (17:33 -0400)]
runtime shutdown errors: simplify, improve error specificity

* transport/control.c (*_cmd): Return -Ecodes rather than "-1" from
  file_operations callbacks.
* staprun/ctl.c (init_ctl_channel): Return distinct error codes.
* staprun/staprun.c (remove_module): Skip connection attempt to .ctl
  file; just do delete_module() with O_NONBLOCK.

15 years agoRefactor some of the histogram printing
Josh Stone [Tue, 13 Oct 2009 21:10:08 +0000 (14:10 -0700)]
Refactor some of the histogram printing

* runtime/stat-common.c (reprint_buf): Removed.
  (_stp_stat_print_histogram_buf): Use a local HIST_PRINTF macro to
  abstract the buffer management.  Also convert reprint_buf calls to
  either %* formats or simple for-loops.

15 years agoAdd buildok tests for sprint[ln](@hist_*)
Josh Stone [Tue, 13 Oct 2009 21:07:58 +0000 (14:07 -0700)]
Add buildok tests for sprint[ln](@hist_*)

15 years agoPR10257: Add support for sprint[ln](@hist_*).
Przemyslaw Pawelczyk [Tue, 13 Oct 2009 12:44:29 +0000 (14:44 +0200)]
PR10257: Add support for sprint[ln](@hist_*).

* parse.cxx (parser::parse_symbol): Add sprint[ln] to @hist_* hack.
* runtime/stat-common.c: Replace reprint with new reprint_buf, add more
  generic _stp_stat_print_histogram_buf and call it from the older one.
  Also correct some formatting issues.
* translate.cxx (c_unparser::visit_print_format): Add sprint case.

15 years agoPR5434: Fix syscall.nfsservctl.
Przemyslaw Pawelczyk [Tue, 13 Oct 2009 01:23:45 +0000 (03:23 +0200)]
PR5434: Fix syscall.nfsservctl.

Use proper $vars according to CONFIG_NFSD and CONFIG_COMPAT in
syscall.nfsservctl and mask it out along with return probe if
CONFIG_NFSD != "[ym]" && CONFIG_COMPAT != "y".

* tapset/syscalls2.stp (syscall.nfsservctl): Fix it.

15 years agoLet semko/utrace.stp fail even with CONFIG_UTRACE=y
Josh Stone [Tue, 13 Oct 2009 18:59:23 +0000 (11:59 -0700)]
Let semko/utrace.stp fail even with CONFIG_UTRACE=y

15 years agoAdd a test for CONFIG_FOO wildcards
Josh Stone [Tue, 13 Oct 2009 18:50:34 +0000 (11:50 -0700)]
Add a test for CONFIG_FOO wildcards

15 years agoMerge branch 'master' of ssh://sources.redhat.com/git/systemtap
Dave Brolley [Tue, 13 Oct 2009 18:02:26 +0000 (14:02 -0400)]
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap

15 years agoPR10761: pass -v's to final "staprun -d" if appropriate
Frank Ch. Eigler [Tue, 13 Oct 2009 15:57:19 +0000 (11:57 -0400)]
PR10761: pass -v's to final "staprun -d" if appropriate

* mainloop.c (cleanup_and_exit): Remove non-BUG9788_WORKAROUND
  branch.  Remove execlp branch.  Pass -v to staprun-d if verbose.

15 years agoMerge branch 'master' of ssh://sources.redhat.com/git/systemtap
Dave Brolley [Tue, 13 Oct 2009 15:55:11 +0000 (11:55 -0400)]
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap

15 years agoEnsure that unprivileged-authorized probe point functions are hashed differently
Dave Brolley [Tue, 13 Oct 2009 15:52:22 +0000 (11:52 -0400)]
Ensure that unprivileged-authorized probe point functions are hashed differently
than non-authorized ones for the purpose of removing duplicates.

2009-10-13  Dave Brolley  <brolley@redhat.com>

        * elaborate.h (print_dupe_stamp_unprivileged): New static method
        of derived_probe.
        (print_dupe_stamp_unprivileged_process_owner): Likewise.

        * elaborate.cxx (print_dupe_stamp_unprivileged): New static method
        of derived_probe.
        (print_dupe_stamp_unprivileged_process_owner): Likewise.

        * tapset-been.cxx (print_dupe_stamp): New virtual method of be_derived_p
robe
        and never_derived_probe.

        * tapset-utrace.cxx (print_dupe_stamp): New virtual method of utrace_der
ived_probe

        * tapset-itrace.cxx (itrace_derived_probe::emit_unprivileged_assertion):
 Removed.
        (itrace_builder::check_unprivileged): Removed.

        * tapsets.cxx (print_dupe_stamp): New virtual method of uprobe_derived_p
robe

15 years agoPR 10575. Improves running target commands.
David Smith [Tue, 13 Oct 2009 13:55:57 +0000 (08:55 -0500)]
PR 10575.  Improves running target commands.
* runtime/staprun/mainloop.c (signal_usr1): Renamed from signal_dontcare.
  Sets a new variable, usr1_interrupt.
  (start_cmd): Avoids pause() race condition by switching to blocking
  SIGUSR1, then waiting on SIGUSR1 with sigsuspend().

15 years agoparse: fix CONFIG_ matching typo
Frank Ch. Eigler [Tue, 13 Oct 2009 11:59:25 +0000 (07:59 -0400)]
parse: fix CONFIG_ matching typo

* parse.cxx (eval_pp_conditional): Flip rhs and lhs args for fnmatch().

15 years agoAdd the .call modifier to syscall entry probes.
Przemyslaw Pawelczyk [Sat, 10 Oct 2009 10:14:54 +0000 (12:14 +0200)]
Add the .call modifier to syscall entry probes.

Inline functions do not have an indentifiable return point and require
kernel built using VTA-enabled gcc to get tracking of variables. OTOH
syscall functions are very rarely inlined (depending on the compiler
mood), therefore filtering probes to include only non-inlined functions
ensures consistent behavior between different kernels.

This removes the problem of inaccessible variables in inlined syscalls
that is described in comments #6-9 to PR5890 and gives us the status quo
w.r.t. syscall probing, because before the commit solving PR10572
(b7478964) inline instances were masked anyway by non-inline ones.

You can check whether you have inlined syscalls using following command:
$ stap -l 'kernel.function("sys_*"),kernel.function("compat_sys_*")' \
                      2>&1 -vvv | awk '/^selected inline/{print $5}'

* tapset/syscalls.stp: Add .call to all entry probes.
* tapset/syscalls2.stp: Ditto.

15 years agoAdd task_time tapset, functions to query time resource usage of current task.
Mark Wielaard [Fri, 9 Oct 2009 21:23:12 +0000 (23:23 +0200)]
Add task_time tapset, functions to query time resource usage of current task.

* tapset/task_time.stp: New tapset.
* testsuite/buildok/task_test.stp: Add new task_time functions.
* doc/SystemTap_Tapset_Reference/tapsets.tmpl: Add new section on
  Task Time Tapset. Include tapset/task_time.stp.

15 years agoGenerate safety net assertions in probe function not authorized for unprivileged...
Dave Brolley [Fri, 9 Oct 2009 15:09:12 +0000 (11:09 -0400)]
Generate safety net assertions in probe function not authorized for unprivileged users.

2009-10-08  Dave Brolley  <brolley@redhat.com>

        * elaborate.h (emit_unprivileged_assertion): New virtual method of deriv
ed_probe.
        (emit_process_owner_assertion): New static method of derived_probe.
        (check_unprivileged): New virtual method of derived_probe_builder.
        (match_node::unprivileged_ok): Removed.
        (match_node::allow_unprivileged): Removed.
        (match_node::unprivileged_allowed): Removed.

        * elaborate.cxx (translate.h): #include it.
        (emit_unprivileged_assertion): New virtual method of derived_probe.
        (emit_process_owner_assertion): New static method of derived_probe.
        (check_unprivileged): New virtual method of derived_probe_builder.
        (match_node::unprivileged_ok): Removed.
        (match_node::allow_unprivileged): Removed.
        (match_node::unprivileged_allowed): Removed.
        (find_and_build): Don't check for unprivileged restrictions here. Call t
he
        builder's check_unprivileged method.
        (alias_expansion_builder::check_unprivileged): New virtual method.

        * tapset-been.cxx (be_derived_probe::emit_unprivileged_assertion): New v
irtual
        method.
        (be_builder::check_unprivileged): Likewise.
        (never_derived_probe::emit_unprivileged_assertion): Likewise.
        (never_builder::check_unprivileged): Likewise.
        (register_tapset_been): Don't call allow_unprivileged.

        * tapset-itrace.cxx (itrace_derived_probe::emit_unprivileged_assertion):
 New virtual
        method.
        (itrace_builder::check_unprivileged): Likewise.
        (register_tapset_itrace): Don't call allow_unprivileged.

        * tapset-utrace.cxx (utrace_derived_probe::emit_unprivileged_assertion):
 New virtual
        method.
        (utrace_builder::check_unprivileged): Likewise.
        (register_tapset_utrace): Don't call allow_unprivileged.

        * tapset-timer.cxx (timer_derived_probe::emit_unprivileged_assertion): N
ew virtual
        method.
        (timer_builder::check_unprivileged): Likewise.
        (register_tapset_timers): Don't call allow_unprivileged.

        * tapsets.cxx (uprobe_derived_probe::emit_unprivileged_assertion): New v
irtual
        method.
        (uprobe_builder::check_unprivileged): Likewise.
        (register_standard_tapsets): Don't call allow_unprivileged.
        (register_statement_variants): Remove unprivileged_ok_p parameter. Don't
 call
        allow_unprivileged.
        (register_function_variants): Likewise.
        (register_function_and_statement_variants): Likewise.
        (register_patterns): Don't call allow_unprivileged.

        * translate.cxx (emit_probe): Call v->emit_unprivileged_assertion.

15 years agotapset/proc_mem.stp: Document function parameters.
Mark Wielaard [Fri, 9 Oct 2009 12:31:18 +0000 (14:31 +0200)]
tapset/proc_mem.stp: Document function parameters.

15 years agoPR10746: improve error message on utrace-less kernels
Frank Ch. Eigler [Thu, 8 Oct 2009 21:36:36 +0000 (17:36 -0400)]
PR10746: improve error message on utrace-less kernels

* tapset-itrace.exp (itrace_derived_probe ctor): Fail if !CONFIG_UTRACE.
* tapset-utrace.exp (utrace_derived_probe ctor): Fail if !CONFIG_UTRACE.
* tapsets.cxx (dwarf_builder::build): Fail process.* if !CONFIG_UTRACE.
* testsuite/semko/utrace.stp: New test.

15 years agoexamples: regen indexes
Frank Ch. Eigler [Thu, 8 Oct 2009 21:23:42 +0000 (17:23 -0400)]
examples: regen indexes

15 years agoexamples: add mbrwatch sample
Frank Ch. Eigler [Thu, 8 Oct 2009 21:21:08 +0000 (17:21 -0400)]
examples: add mbrwatch sample

15 years agotestsuite: robustify check_* invocation of examples meta
Frank Ch. Eigler [Thu, 8 Oct 2009 21:18:51 +0000 (17:18 -0400)]
testsuite: robustify check_* invocation of examples meta

testsuite/systemtap.examples/

* check.exp (extract_tag): Log extracted tags.  Tolerate embedded '$'.
  (run_command): Pass through commands to sh -c without eval quoting.
* README: Document "sh -c"-ness of check_* tags.
* *.meta: Fix quoting, add a few check_support predicates.

15 years agoThis script (tcp_trace) can be used to trace tcp connection parameters and state...
David J. Wilder [Thu, 8 Oct 2009 18:00:20 +0000 (11:00 -0700)]
This script (tcp_trace) can be used to trace tcp connection parameters and state changes.  This work was original inspired by Stephen Hemminger's TCP cwnd snooper (net/ipv4/tcp_probe.c). Tcp_trace is a helpful tool for troubleshooting connection performance issues.

15 years agoPR10702: preprocessor conditional for kernel CONFIG_foo
Frank Ch. Eigler [Thu, 8 Oct 2009 13:57:43 +0000 (09:57 -0400)]
PR10702: preprocessor conditional for kernel CONFIG_foo

* session.h (kernel_config[]): New session field.
* main.cxx (parse_kernel_config): Populate it.
* parse.cxx (eval_comparison): Use it.
* testsuite/buildok/utrace.stp, testsuite/parseok/kconfig.stp: New tests.
* NEWS, stap.1.in, doc/langref.tex: Mention it.

15 years agobuild: fix !HAVE_NSS case
Frank Ch. Eigler [Wed, 7 Oct 2009 22:31:07 +0000 (18:31 -0400)]
build: fix !HAVE_NSS case

* staprun_funcs.c (assert_permissions): Move "check_signature_rc"
  variable inside #if HAVE_NSS.

15 years agoMerge commit 'origin/master'
Tim Moore [Wed, 7 Oct 2009 18:10:17 +0000 (20:10 +0200)]
Merge commit 'origin/master'

15 years agoAdded man page for stapgraph
Tim Moore [Wed, 7 Oct 2009 18:08:50 +0000 (20:08 +0200)]
Added man page for stapgraph

* grapher/stapgraph.1.in: new file

15 years agoRemove the global derived_probe->semaphore map
Josh Stone [Wed, 7 Oct 2009 03:01:13 +0000 (20:01 -0700)]
Remove the global derived_probe->semaphore map

Instead just make the semaphore address a member of derived_probe.

* session.h (systemtap_session): Remove the map sdt_semaphore_addr.
* elaborate.h (derived_probe): Add sdt_semaphore_addr directly.
* tapsets.cxx (sdt_query::record_semaphore): Write the addr directly.
  (uprobe_derived_probe_group::emit_module_decls): Read it directly.
* tapset-utrace.cxx (utrace_derived_probe_group::emit_probe_decl): Ditto

15 years agoAdd proc_mem tapset, functions to query memory usage of the current process.
Mark Wielaard [Tue, 6 Oct 2009 17:24:22 +0000 (19:24 +0200)]
Add proc_mem tapset, functions to query memory usage of the current process.

* tapset/proc_mem.stp: New tapset.
* testsuite/buildok/proc_mem.stp
* doc/SystemTap_Tapset_Reference/tapsets.tmpl (memory_stp): Include
  tapset/proc_mem.stp.

15 years agoPR10724: staprun: simplify permissions checking logic
Charley Wang [Tue, 6 Oct 2009 14:26:36 +0000 (10:26 -0400)]
PR10724: staprun: simplify permissions checking logic

Pending advice from Frank and Dave, changed check_permission to return void and
renamed it to assert_permission. assert_permission simply returns if
permissions are okay, and calls exit(-1) if there are any permissions errors.

15 years agoPR10726 remove testcase workaround.
Mark Wielaard [Tue, 6 Oct 2009 13:26:58 +0000 (15:26 +0200)]
PR10726 remove testcase workaround.

* testsuite/systemtap.base/const_value.c: Allow inlining since PR10726 was
  fixed.

15 years agoPR10739 testcase. Split const_value test in two. Absolute const addr fails.
Mark Wielaard [Tue, 6 Oct 2009 13:22:21 +0000 (15:22 +0200)]
PR10739 testcase. Split const_value test in two. Absolute const addr fails.

* testsuite/systemtap.base/const_value.exp: Handle both const_value blocks
  and address separately. XFAIL second test as PR10739.
* testsuite/systemtap.base/const_value.stp: Only query baz const value.
* testsuite/systemtap.base/const_value_func.c: New test for bar address.
* testsuite/systemtap.base/const_value_func.stp: Likewise.

15 years agoPR10726: Get the correct scope for statement(NUM)
Josh Stone [Tue, 6 Oct 2009 00:41:30 +0000 (17:41 -0700)]
PR10726: Get the correct scope for statement(NUM)

The problem in this bug is that our statement(NUM) lookup was only
searching for the outermost function (not inlined) which contains the PC
in question.  When that PC happens to be the beginning of the function
and also the beginning of an inline, the caching was using the wrong
variable scope.

The function/statement(NUM) lookup has been rewritten to bypass all of
the CU and function iteration, and just go straight to a getscopes(pc)
lookup, so it will now always use the innermost containing die for the
variable scope.

* tapsets.cxx (query_addr): New, short-circuit for numeric probes.
  (dwarf_query::query_module_dwarf): Route num probes to query_addr.
  (query_label): Assume now that we only need to handle _str probes.
  (query_dwarf_inline_instance): Ditto.
  (query_dwarf_func): Ditto.
  (query_cu): Ditto.

15 years agoNEWS: Better gcc 4.5 DWARF support (kernel module deps, DW_AT_const_value).
Mark Wielaard [Mon, 5 Oct 2009 08:22:59 +0000 (10:22 +0200)]
NEWS: Better gcc 4.5 DWARF support (kernel module deps, DW_AT_const_value).

15 years agoAdd tescase for DW_AT_const_value location descriptions.
Mark Wielaard [Mon, 5 Oct 2009 07:14:49 +0000 (09:14 +0200)]
Add tescase for DW_AT_const_value location descriptions.

* testsuite/systemtap.base/const_value.c: New test.
* testsuite/systemtap.base/const_value.exp: Likewise.
* testsuite/systemtap.base/const_value.stp: Likewise.

15 years agoHandle DW_AT_const_value as alternative to location description.
Mark Wielaard [Mon, 5 Oct 2009 07:11:59 +0000 (09:11 +0200)]
Handle DW_AT_const_value as alternative to location description.

* dwflpp.cxx (translate_location): Call c_translate_constant when
  attribute is DW_AT_const_value.
  (literal_stmt_for_local): Allow  both DW_AT_location and DW_AT_const_value.

15 years agoMake sure loc2c declare_noncontig_union for different locs don't overlap.
Mark Wielaard [Mon, 5 Oct 2009 07:05:29 +0000 (09:05 +0200)]
Make sure loc2c declare_noncontig_union for different locs don't overlap.

* loc2c.c (declare_noncontig_union): Name union u_pieces for
  loc_noncontiguous or u_const for loc_constant.
  (translate_base_store): Use u_pieces for loc_noncontiguous.
  (translate_base_fetch): Likewise or u_const for loc_constant.

15 years agoAUTHORS bump for Kiran
Josh Stone [Fri, 2 Oct 2009 23:50:18 +0000 (16:50 -0700)]
AUTHORS bump for Kiran

15 years agoUpdates samples index for sched_switch
Josh Stone [Fri, 2 Oct 2009 23:42:44 +0000 (16:42 -0700)]
Updates samples index for sched_switch

15 years agoScheduler Tapset based on kernel tracepoints
Kiran Prakesh [Thu, 1 Oct 2009 17:09:32 +0000 (22:39 +0530)]
Scheduler Tapset based on kernel tracepoints

This patch adds kernel tracepoints based probes to the scheduler tapset
along with the testcase, scheduler-test-tracepoints.stp and an example
script, sched_switch.stp.

Signed-off-by: Kiran Prakash <kiran@linux.vnet.ibm.com>
Signed-off-by: Josh Stone <jistone@redhat.com>
15 years agoindent tapset: make O(1) rather than O(n)
Frank Ch. Eigler [Fri, 2 Oct 2009 20:24:00 +0000 (16:24 -0400)]
indent tapset: make O(1) rather than O(n)

* tapset/indent.stp (_generic_indent): Use "%-*s" instead of
  string concatenation loop.

15 years agoFix stap-server bug. --unprivileged not processed if processed as first argument.
Dave Brolley [Fri, 2 Oct 2009 20:20:31 +0000 (16:20 -0400)]
Fix stap-server bug. --unprivileged not processed if processed as first argument.

15 years agoloc2c discontiguify loops for not small enough loc_constant.
Mark Wielaard [Fri, 2 Oct 2009 15:07:10 +0000 (17:07 +0200)]
loc2c discontiguify loops for not small enough loc_constant.

* loc2c.c (loc_constant): Add offset to size after creating piece in
  loc_constant loop.

15 years agoPR10678 vta-gcc: module debuginfo: relocation refers to undefined symbol
Mark Wielaard [Thu, 1 Oct 2009 22:28:46 +0000 (00:28 +0200)]
PR10678 vta-gcc: module debuginfo: relocation refers to undefined symbol

libdwfl tries to resolve all relocations in a module debuginfo file and
if it cannot find a symbol used in a relocation it will fail when
dwfl_module_getdwarf() is called. So we must make sure all possible
dependencies of the module are also in the dwfl. We do this by trying
to find and parse the modules.dep file and insert all dependencies
into the dwfl.

* setupdwfl.cxx (elfutils_kernel_path): Lift from setup_dwfl_kernel and
  make static.
  (is_comma_dash): New function.
  (modname_from_path): Likewise.
  (setup_mod_deps): Likewise.
  (setup_dwfl_report_kernel_p): Call setup_mod_deps().
* testsuite/buildok/pr10678.stp: New test.

15 years agoFixed grapher build.
David Smith [Thu, 1 Oct 2009 18:07:12 +0000 (13:07 -0500)]
Fixed grapher build.
* systemtap.spec: Updated grapher's buildreqs and file list.

15 years agoGrapher support now also needs libglademm24-devel, version 2.6.7 or higher.
Mark Wielaard [Thu, 1 Oct 2009 13:30:20 +0000 (15:30 +0200)]
Grapher support now also needs libglademm24-devel, version 2.6.7 or higher.

* configure.ac: Clarify fail/help string when gtkmm support wasn't found.
* configure: Regenerated.

15 years agoAdd DEBUG_UPROBES for sdt semaphores.
Stan Cox [Thu, 1 Oct 2009 13:18:21 +0000 (09:18 -0400)]
Add DEBUG_UPROBES for sdt semaphores.

* tapsets.cxx (uprobe_derived_probe_group::emit_module_decls):  Add
DEBUG_UPROBES for sdt semaphores
* dtrace.in (main): Add -k option to keep around the temp files.

15 years agoPrint total memory usage in verbose mode after pass 1, 2 and 3.
Mark Wielaard [Thu, 1 Oct 2009 12:22:23 +0000 (14:22 +0200)]
Print total memory usage in verbose mode after pass 1, 2 and 3.

Makes it easier to see which probe queries use lots of memory.

* main.cxx (getmemusage): New function.
  (main): Use new function printing passes in verbose mode.

15 years agoActually indent_thread() is a very useful function, but
Breno Leitao [Thu, 1 Oct 2009 03:09:07 +0000 (00:09 -0300)]
Actually indent_thread() is a very useful function, but
sometimes you're probing something that is not related to
any task, as an interrupt function, and if the application
changes during the interrupt, the indentation gets confused.
For example:

    0 swapper(0): -> neo_copy_data_from_queue_to_uart
    69 a.out(7659):   -> neo_parse_modem
    74 a.out(7659):    -> neo_param
    14 swapper(0): <- neo_copy_data_from_queue_to_uart
    83 a.out(7659):  -> jsm_carrier
    86 a.out(7659):  <- jsm_carrier
     0 swapper(0): -> neo_parse_modem
    94 a.out(7659): <- jsm_tty_set_termios
     8 swapper(0): <- neo_parse_modem

So, I decided to create a simpler function that doesn't
consider the task.

Much of the idea of this implementation came from Frank(Thanks)

15 years agodoc build: support older xmlto without --stringparm option
Frank Ch. Eigler [Wed, 30 Sep 2009 23:07:26 +0000 (19:07 -0400)]
doc build: support older xmlto without --stringparm option

* configure.ac: Check for xmlto --stringparam support.
* doc/Systemtap_Tapset_Reference/Makefile.am: Be sensitive to the result.

15 years agodialog for choosing stap script and providing arguments to stap and the script
Tim Moore [Wed, 30 Sep 2009 17:02:42 +0000 (19:02 +0200)]
dialog for choosing stap script and providing arguments to stap and the script

* grapher/grapher.cxx (GraphicalStapLauncher): New class.
  (GrapherWindow constructor): Bind actions for graphical launcher buttons
  (GrapherWindow::setGraphicalLauncher): new method
  (GrapherWindow::on_menu_script_start): new method
  grapher/stap-start.glade, grapher/stap-start.gladep: new files
  grapher/Makefile.am: install stap-start.glade

15 years agoclasses for launching stap and listening for its death
Tim Moore [Wed, 23 Sep 2009 16:03:00 +0000 (18:03 +0200)]
classes for launching stap and listening for its death

* grapher/grapher.cxx (ChildDeathReader): New class to handle I/O signalling
  death of a child.
  (GrapherWindow): Inherit from ChildDeathReader.
  (StapLauncher): New class for passing arguments to inferior stap process
  and checking for its demise.
  (main): Move launching logic to StapLauncher.

15 years agoPass command line arguments on to stap
Tim Moore [Mon, 21 Sep 2009 20:35:17 +0000 (22:35 +0200)]
Pass command line arguments on to stap

* grapher/grapher.cxx (main): Pass program arguments to stap

15 years agocleanup of graph data dialog
Tim Moore [Wed, 16 Sep 2009 17:15:21 +0000 (19:15 +0200)]
cleanup of graph data dialog

* grapher/GraphWidget.cxx (on_button_release_event, onDataAdd): tweaks
for graph data dialog

15 years agographer: Handle the death of the child stap process
Tim Moore [Wed, 16 Sep 2009 17:06:29 +0000 (19:06 +0200)]
grapher: Handle the death of the child stap process

* grapher/grapher.c (main): Set up signal and i/o handlers to detect death
  of child.
* grapher/StapParser.cxx (errIoCallback): New method

15 years agoCreate lists of graph data to choose
Tim Moore [Wed, 2 Sep 2009 13:16:26 +0000 (15:16 +0200)]
Create lists of graph data to choose

15 years agoAdd graph data chooser window, based on glade
Tim Moore [Wed, 2 Sep 2009 10:39:05 +0000 (12:39 +0200)]
Add graph data chooser window, based on glade

* configure.ac: Test for libglademm
* grapher/GraphWidget.hxx (DataModelColumns): new class
  (onDataDialogCancel, void onDataAdd, onDataRemove, onDataDialogOpen):
  new methods
* grapher/GraphWidget.cxx: ditto; methods for the graph data dialog.
* grapher/graph-dialog.glade: New file.
* grapher/graph-dialog.gladep: New file.
* grapher/Makefile.am (dist_pkgdata_DATA): add graph-dialog.glade to
  installation.
* grapher/GraphWidget.cxx (GraphWidget constructor): Use PKGDATADIR

15 years agomore multiple graph fixes
Tim Moore [Tue, 4 Aug 2009 21:46:02 +0000 (23:46 +0200)]
more multiple graph fixes

* grapher/Graph.cxx (Graph constructor): set _drawX, _drawY
* grapher/GraphWidget.cxx (addGraph): Fix graph layout
(on_button_press_event): Fix test of play button in multiple graphs

15 years agoDraw multiple graphs
Tim Moore [Wed, 29 Jul 2009 11:11:10 +0000 (13:11 +0200)]
Draw multiple graphs

* grapher/Graph.cxx (Graph constructor): Initialize graph dimensions.
(draw): Don't clear the drawing area.
* grapher/GraphWidget.hxx (GraphWidget): Add dimensions and
on_size_request() method.
* grapher/GraphWidget.cxx (GraphWidget constructor): Initialize
dimensions.
(addGraph): New method.
(on_size_request): New method to pass widget's size to parent widgets
* grapher/grapher.cxx (GrapherWindow constructor): add "add graph"
action.
(addGraph): New method.

15 years agoPR10678 module reloc refers to symbol in dwarf refer to kernel symbols.
Mark Wielaard [Wed, 30 Sep 2009 14:51:29 +0000 (16:51 +0200)]
PR10678 module reloc refers to symbol in dwarf refer to kernel symbols.

First part of a fix for PR10678. Always include the kernel in the dwfl.
This doesn't seem to impact performance noticable, so for now enable
always.

* setupdwfl.cxx (setup_dwfl_done): New variable, used to clean up logic
  in setup_dwfl_report_kernel_p().
  (setup_all_deps): New static bool to indicate we want all deps (just
  the kernel for now, other modules coming).
  (setup_dwfl_report_kernel_p): Use new variables, shortcut kernel
  inclusion.
  (setup_dwfl_kernel): Setup setup_dwfl_done (false).

15 years agobuild fix: use boost shared_ptr if libstdc++ to old to have <tr1/memory>
Frank Ch. Eigler [Tue, 29 Sep 2009 21:09:20 +0000 (17:09 -0400)]
build fix: use boost shared_ptr if libstdc++ to old to have <tr1/memory>

* configure.ac: Look for tr1/memory and boost/shared_ptr.hpp
* setupdwfl.h (shared_ptr): Define conditionally based on above.
* systemtap.spec (with_boost): New parameter, default-off.

15 years agoDelete trailing whitespace
Robb Romans [Tue, 29 Sep 2009 20:51:23 +0000 (15:51 -0500)]
Delete trailing whitespace

15 years agoAdd information about userspace probing
Robb Romans [Tue, 29 Sep 2009 20:49:51 +0000 (15:49 -0500)]
Add information about userspace probing

Add information from the manual pages and from Prerna Saxena about
userspace probing to the Language Reference Guide.

15 years agoAdd -Werror to tracequery build
Josh Stone [Tue, 29 Sep 2009 18:35:18 +0000 (11:35 -0700)]
Add -Werror to tracequery build

The final module build uses -Werror, so tracequery should as well to
catch problems as early as possible.  Some ext4 errors have crept in
again (PR10703).

* buildrun.cxx (make_tracequery): Add -Werror to EXTRA_CFLAGS.

15 years agotapset docs cleanup
Frank Ch. Eigler [Tue, 29 Sep 2009 18:09:32 +0000 (14:09 -0400)]
tapset docs cleanup

Several problems: some invalid <command> etc. directives
in the tapset embedded docs; some analysis about the
non-generation of the pdf; some cleanup of the generated
man pages.

* configure.ac (BUILD_PDFREFDOCS): Correct condition typo, but still
  leave disabled.
* doc/SystemTap_Tapset_Reference/Makefile.am (XMLTOMANPARMS): Add,
  to disable noise "AUTHORS" / "COPYRIGHT" sections.
* tapset/*.stp: Removed several docbook-y markup that is not valid
  in kerneldoc.

15 years agoAdded timeouts to test 15 & 16.
David Smith [Tue, 29 Sep 2009 16:00:26 +0000 (11:00 -0500)]
Added timeouts to test 15 & 16.

15 years agoCache Dwfl's for reuse between pass 2 and pass 3.
Mark Wielaard [Tue, 29 Sep 2009 14:45:37 +0000 (16:45 +0200)]
Cache Dwfl's for reuse between pass 2 and pass 3.

* setupdwfl.h: Introduce DwflPtr.
* setupdwfl.cxx: Cache kernel_dwfl and user_dwfl. Keep track of last used
  module strings. Return cached versions if same query used.
* dwflpp.h: Use DwflPtr instead of Dwfl*.
* dwflpp.cxx: Use DwflPtr and don't dwfl_end().
* translate.cxx: Likewise. Run through dwfl_getmodules() with returned
  ptr offset.

15 years agoHandle non-regex full path kernel module dwfl setup earlier.
Mark Wielaard [Tue, 29 Sep 2009 09:22:30 +0000 (11:22 +0200)]
Handle non-regex full path kernel module dwfl setup earlier.

* setupdwfl.cxx (setup_dwfl_kernel(unsigned*,systemtap_session&)):
  Don't switch around offline_search_modname and offline_search_names here.
  (setup_dwfl_kernel(string&,unsigned*,systemtap_session&): But here.

15 years agoMake sys32_pipe probe available only before 2.6.32
Wenji Huang [Tue, 29 Sep 2009 05:05:54 +0000 (13:05 +0800)]
Make sys32_pipe probe available only before 2.6.32

* tapset/x86_64/nd_syscalls.stp: Switch by kernel version.
* tapset/x86_64/syscalls.stp: Ditto.

15 years ago* tapsets.cxx (sdt_query::record_semaphore): Adjust addr relative to
Stan Cox [Tue, 29 Sep 2009 02:40:33 +0000 (22:40 -0400)]
* tapsets.cxx (sdt_query::record_semaphore): Adjust addr relative to
relocation base.

15 years agoRemove cached signature files along with modules
Josh Stone [Tue, 29 Sep 2009 02:04:00 +0000 (19:04 -0700)]
Remove cached signature files along with modules

* cache.cxx (cache_ent_info::cache_ent_info): Count the sgn in the size
  (cache_ent_info::unlink): Remove the sgn too.

15 years agoSimplify copy_file calls
Josh Stone [Tue, 29 Sep 2009 01:49:51 +0000 (18:49 -0700)]
Simplify copy_file calls

Every single copy_file call we had was converting strings to char*,
printing the same error message, and optionally printing the same
verbose string.  Let's canonicalize that.

* util.cxx (copy_file): Take string filenames, add a verbose flag, and
  consolidate the message printing.
* cache.cxx (add_to_cache): Pass strings and remove message printing.
  (get_from_cache): Ditto.
* main.cxx (main): Ditto.
* tapsets.cxx (tracepoint_builder::get_tracequery_module): Ditto.
  (dwarf_cast_expanding_visitor::filter_special_modules): Ditto.

15 years agoTry to build tracequery for all headers at once
Josh Stone [Tue, 29 Sep 2009 00:36:04 +0000 (17:36 -0700)]
Try to build tracequery for all headers at once

To mitigate PR10424, we switched to building a separate tracequery
module for each tracepoint header, so a bad header wouldn't break all of
the others.  However, with recent kernels that leads to ~18 make
commands, which adds up quickly in time.  It's cached, so that's not too
bad, but as a developer who rebuilds stap frequently, it gets annoying.

If we're going to call 18 makes, it's worth it to start with one bigger
make that covers all the headers at once (like we used to).  If that one
fails, we can still fall back to compiling individually.

FWIW, the failing ext4.h header was only created in 2.6.31, and was
fixed before 2.6.32, so the specific failure in PR10424 has a fairly
small window.

* buildrun.cxx (make_tracequery): Just take a single vector of headers.
* hash.cxx (find_tracequery_hash): Deal with multiple headers.
* tapsets.cxx (tracepoint_builder::get_tracequery_module): Ditto.
  (tracepoint_builder::init_dw): Attempt all system headers together,
  and if that fails, try again individually.

15 years agoFactor out duplicated code to setup user/module Dwfl from dwflpp/translate.
Mark Wielaard [Mon, 28 Sep 2009 22:12:26 +0000 (00:12 +0200)]
Factor out duplicated code to setup user/module Dwfl from dwflpp/translate.

* setupdwfl.h: Add setup_dwfl_user() and is_user_module().
* setupdwfl.cxx: Likewise.
* dwflpp.cxx (setup_user): Use setup_dwfl_user().
* translate.cxx (emit_symbol_data): Likewise and is_user_module().
* tapsets.cxx (dwarf_cast_expanding_visitor::visit_cast_op):
  Use is_user_module().

15 years agoHandle full path .ko modules in setup_dwfl_kernel.
Mark Wielaard [Mon, 28 Sep 2009 21:30:49 +0000 (23:30 +0200)]
Handle full path .ko modules in setup_dwfl_kernel.

* setupdwfl.cxx (setup_dwfl_kernel): First report all full path modules.

15 years agoBetter cleanup.
David Smith [Mon, 28 Sep 2009 20:18:58 +0000 (15:18 -0500)]
Better cleanup.
* testsuite/systemtap.base/cmd_parse.exp: Remove temporary module.

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