]> sourceware.org Git - systemtap.git/log
systemtap.git
8 years agoFixed PR19275 by updating stap_run.
David Smith [Fri, 20 Nov 2015 16:53:51 +0000 (10:53 -0600)]
Fixed PR19275 by updating stap_run.

* testsuite/lib/stap_run.exp: The stap_run() function now fails if it
  receives any unexpected output. The 'all_pass_string' was modified to be
  only one copy of "systemtap test success" instead of allowing of
  multiple copies.
* testsuite/systemtap.base/array_slicing.exp: Handle stap_run
  changes. Also, fixed the test names so that they aren't '$test_name'.
* testsuite/systemtap.base/at_var_tracepoint.exp: Update for stap_run
  changes.
* testsuite/systemtap.base/at_var_tracepoint.stp: Ditto.
* testsuite/systemtap.base/be_order.stp: Ditto.
* testsuite/systemtap.base/div0.exp: Ditto.
* testsuite/systemtap.base/error_fn.exp: Ditto.
* testsuite/systemtap.base/global_init.stp: Ditto.
* testsuite/systemtap.base/global_var_kernel.exp: Ditto.
* testsuite/systemtap.base/global_vars.stp: Ditto.
* testsuite/systemtap.base/if.exp: Ditto.
* testsuite/systemtap.base/if.stp: Ditto.
* testsuite/systemtap.base/kprobes.exp: Ditto.
* testsuite/systemtap.base/logical_and.stp: Ditto.
* testsuite/systemtap.base/maxactive.exp: Ditto.
* testsuite/systemtap.base/pp.exp: Ditto.
* testsuite/systemtap.base/print.exp: Ditto.
* testsuite/systemtap.base/proc_by_pid.exp: Ditto.
* testsuite/systemtap.base/process_by_pid.exp: Ditto.
* testsuite/systemtap.base/procfs_maxsize.exp: Ditto.
* testsuite/systemtap.base/procfs_umask.exp: Ditto.
* testsuite/systemtap.base/stmt_counting.exp: Ditto.
* testsuite/systemtap.base/stmt_counting_functions.stp: Ditto.
* testsuite/systemtap.base/stmt_counting_straight.stp: Ditto.
* testsuite/systemtap.base/timers.exp: Ditto.
* testsuite/systemtap.base/tri.stp: Ditto.
* testsuite/systemtap.context/context_ns.exp: Ditto.
* testsuite/systemtap.context/pid_ns.stp: Ditto.
* testsuite/systemtap.context/usymfileline.exp: Ditto.
* testsuite/systemtap.printf/memory1.exp: Ditto.
* testsuite/systemtap.stress/current.exp: Ditto.

8 years agoupdate NEWS
Felix Lu [Fri, 20 Nov 2015 15:23:57 +0000 (10:23 -0500)]
update NEWS

8 years agoupdate systemtap.spec
Felix Lu [Thu, 19 Nov 2015 16:36:02 +0000 (11:36 -0500)]
update systemtap.spec

Include build requirements for json-c and ncurses.

8 years agoPR18848: Add manual testing readme guide
Felix Lu [Thu, 19 Nov 2015 15:14:54 +0000 (10:14 -0500)]
PR18848: Add manual testing readme guide

8 years agoPR18848: Only compile monitor mode if json-c and ncurses developer
Felix Lu [Thu, 19 Nov 2015 14:31:08 +0000 (09:31 -0500)]
PR18848: Only compile monitor mode if json-c and ncurses developer
libraries are installed. Updated automake/conf files.

* session.cxx: error if using monitor mode when not compiled with
required libraries

8 years agoPR18848: Fix pipe buffer overflow problem, improve monitor UI
Felix Lu [Tue, 17 Nov 2015 20:32:22 +0000 (15:32 -0500)]
PR18848: Fix pipe buffer overflow problem, improve monitor UI

The pipe used in monitor mode was not being read the moment
data was available, causing an overflow. pselect now watches
the pipe fd for data to read. The UI now cuts off the probe name
if terminal size is not wide enough.

8 years agoPR18848: fix json array string
Felix Lu [Mon, 16 Nov 2015 22:04:51 +0000 (17:04 -0500)]
PR18848: fix json array string

Arrays were not made into key-value pairs when global scalars were
turned into a json object. Currently, only the array sizes are shown.

8 years agoPR18848: add --monitor option in man/stap.1
Felix Lu [Mon, 16 Nov 2015 21:23:43 +0000 (16:23 -0500)]
PR18848: add --monitor option in man/stap.1

Stap man page now provides an overview of the --monitor option
along with the main commands.

8 years agoPR18848: add help page, switch to page scrolling for output
Felix Lu [Mon, 16 Nov 2015 20:05:28 +0000 (15:05 -0500)]
PR18848: add help page, switch to page scrolling for output

Status bar can be toggled to show a manual page describing the
various commands available. Module output now scrolls by pages
instead of lines.

8 years agoPR18848: Fix json parsing error
Felix Lu [Mon, 16 Nov 2015 16:40:36 +0000 (11:40 -0500)]
PR18848: Fix json parsing error

Quotes in the probe names for the json string were not escaped to
form a valid json object. They had to be escaped once for the
systemtap parser and once more for the json parser.

* elaborate.cxx: escape quotes twice when generating json string
* staprun/monitor.c: check for correct parse result

8 years agoPR18848: use a pipe to redirect module output instead of proc file
Felix Lu [Fri, 13 Nov 2015 14:50:54 +0000 (09:50 -0500)]
PR18848: use a pipe to redirect module output instead of proc file

The module output can be written directly into a pipe by the reader
thread for the monitor interface to read.

* runtime/monitor.c: deleted
* runtime/print_flush.c: removed monitor path
* staprun/monitor.c: read output from pipe
* staprun/relay.c: create pipe and redirect output
* translate.cxx: remove proc file creation

8 years agoPR18848: increase history limit of output queue, add more keybindings
Felix Lu [Mon, 9 Nov 2015 16:57:09 +0000 (11:57 -0500)]
PR18848: increase history limit of output queue, add more keybindings
for scrolling probes and output

History size increased to 8192, arrows keys and pageup/pagedown keys
can be used as an alternative for scrolling

8 years agoPR18848: add module output scrollback, status window now refreshed
Felix Lu [Mon, 9 Nov 2015 16:00:48 +0000 (11:00 -0500)]
PR18848: add module output scrollback, status window now refreshed
on input

Users can now use the u and d keys to scroll back and forward through
the output. The scrollback uses a moving window approach over a queue.
The status window is now updated upon input for a smoother experience.

8 years agoPR18848: add probe scrolling capability
Felix Lu [Wed, 4 Nov 2015 16:24:03 +0000 (11:24 -0500)]
PR18848: add probe scrolling capability

Users can now use j and k keys to scroll down and up the probe list
respectively.

8 years agoPR18848: increase timeout timer and remove strsignal
Felix Lu [Wed, 4 Nov 2015 14:49:36 +0000 (09:49 -0500)]
PR18848: increase timeout timer and remove strsignal

8 years agoPR18848: improve keyboard input response time
Felix Lu [Tue, 3 Nov 2015 21:18:01 +0000 (16:18 -0500)]
PR18848: improve keyboard input response time

pselect now watches stdin for input.

8 years agoPR18848: zero pad the uptime
Felix Lu [Tue, 3 Nov 2015 20:59:10 +0000 (15:59 -0500)]
PR18848: zero pad the uptime

Uptime was not padded before if the unit was a single digit value.

8 years agoPR18848: only handle SIGWINCH in monitor mode
Felix Lu [Tue, 3 Nov 2015 20:58:37 +0000 (15:58 -0500)]
PR18848: only handle SIGWINCH in monitor mode

8 years agoPR18848: move resizing functionality out of signal handler
Felix Lu [Tue, 3 Nov 2015 20:16:06 +0000 (15:16 -0500)]
PR18848: move resizing functionality out of signal handler

Calling many functions in signal handler may be unsafe. A global
variable is now set on SIGWINCH.

8 years agoPR18848: handle terminal resizing
Felix Lu [Tue, 3 Nov 2015 19:12:06 +0000 (14:12 -0500)]
PR18848: handle terminal resizing

The curses UI now adjusts it's windows to the new dimensions of the
terminal upon receiving a SIGWINCH.

8 years agoPR18848: display current probe input
Felix Lu [Mon, 2 Nov 2015 20:56:32 +0000 (15:56 -0500)]
PR18848: display current probe input

Input prompt now shows what the user has entered.

8 years agoPR18848: add command line option to specify interval for polling stats
Felix Lu [Mon, 2 Nov 2015 20:10:23 +0000 (15:10 -0500)]
PR18848: add command line option to specify interval for polling stats

Users can display the stats every N seconds with --monitor=N

* buildrun.cxx: append monitor interval.
* cmdline.cxx: --monitor optional argument
* session.cxx: new monitor_interval attribute
* staprun/common.c: parse --monitor optarg
* staprun/mainloop.c: decrease pselect timeout to poll input quicker
* staprun/monitor.c: render monitor stats every N seconds

8 years agoPR18848: improve monitor ui and refactor input function.
Felix Lu [Mon, 2 Nov 2015 14:36:05 +0000 (09:36 -0500)]
PR18848: improve monitor ui and refactor input function.

Improved hint on keyboard mappings. New function to write
to procfs interface.

8 years agoPR18848: add most functionality to curses interface
Felix Lu [Wed, 28 Oct 2015 18:44:35 +0000 (14:44 -0400)]
PR18848: add most functionality to curses interface

Currently, a file is used to redirect stp_print output to curses window.
Previous curses interface code in mainloop got refactored into monitor.c.

* runtime/monitor.c: New file. procfs functions for stp_print redirection
* runtime/print_flush.c: Redirect stp_print to curses interface in
  monitor mode
* staprun/monitor.c: New file implementing curses interface
* staprun/mainloop.c: Move code into monitor.c
* staprun/Makefile.*: Link json-c and curses library, include monitor.c
  to source list
* translate.cxx: Create procfs file for stp_print redirection

8 years agoPR18848: change json format and retain entire probe name.
Felix Lu [Tue, 27 Oct 2015 19:15:43 +0000 (15:15 -0400)]
PR18848: change json format and retain entire probe name.

* elaborate.cxx: global variables are no longer in a list.

8 years agoPR18848: Add json parser and comparators to allow sorting
Felix Lu [Wed, 21 Oct 2015 16:00:48 +0000 (12:00 -0400)]
PR18848: Add json parser and comparators to allow sorting

Probe list will be sorted at runtime based on a user input on
either name, hit count, or cycles.

* staprun/mainloop: include json-c and parse the monitor read interface.

8 years agoPR18848: modify printf format
Felix Lu [Wed, 21 Oct 2015 15:31:09 +0000 (11:31 -0400)]
PR18848: modify printf format

Format changed to %d from %lld

8 years agoPR18848: convert procfs read to json format
Felix Lu [Wed, 21 Oct 2015 13:33:01 +0000 (09:33 -0400)]
PR18848: convert procfs read to json format

Json format allows for easy sorting of probes through json arrays.
This can be done at runtime based on probe attributes.

* elaborate.cxx: convert monitor_mode_read to output json.

8 years agoPR18848: monitor status formatting
Felix Lu [Fri, 16 Oct 2015 20:29:35 +0000 (16:29 -0400)]
PR18848: monitor status formatting

Removed h:m:s indicators in uptime and global scalar values are now
displayed.

* elaborate.cxx: changes in monitor_mode_read()

8 years agoPR18848: output monitor data in stapio event loop
Felix Lu [Fri, 16 Oct 2015 15:50:39 +0000 (11:50 -0400)]
PR18848: output monitor data in stapio event loop

* staprun/mainloop.c: polls procfs monitor interface for data

8 years agoPR18848: remove print statement
Felix Lu [Thu, 15 Oct 2015 19:20:17 +0000 (15:20 -0400)]
PR18848: remove print statement

elaborate.cxx: removed a debug print statement

8 years agoPR18848: new command line argument -M for staprun
Felix Lu [Thu, 15 Oct 2015 18:51:24 +0000 (14:51 -0400)]
PR18848: new command line argument -M for staprun

Pass stap --monitor command to staprun.

* buildrun.cxx: add -M argument to flags
* staprun/common.c: -M option to parse_args
* staprun/mainloop.c: add a timeout to pselect in monitor mode
  to prevent blocking and allow the procfs monitor interface to
  be polled.
* staprun/staprun.h: monitor extern declaration

8 years agoPR18848: refactor functions
Felix Lu [Wed, 7 Oct 2015 18:56:11 +0000 (14:56 -0400)]
PR18848: refactor functions

Renamed the initialization function and removed some redundant
parameters.

8 years agoPR18848: move embedded code for module size into tapset
Felix Lu [Wed, 7 Oct 2015 17:42:24 +0000 (13:42 -0400)]
PR18848: move embedded code for module size into tapset

* elaborate.cxx: remove monitor synthetic function
* tapset/linux/context.stp: new module_size function

8 years agoPR18848: use jiffies tapset function
Felix Lu [Wed, 7 Oct 2015 15:33:59 +0000 (11:33 -0400)]
PR18848: use jiffies tapset function

Switch the implementation of uptime to use the jiffies and hz tapset
functions instead of using embedded C

* elaborate.cxx: remove old embedded C function to get uptime. Added
  a synthetic begin probe to obtain starting time. Synthetic variables
  are now hidden in monitor mode and not reset.
* translate.cxx: remove jiffies inclusion in monitor mode.

8 years agoPR18848: new procfs monitor mode option
Felix Lu [Tue, 6 Oct 2015 20:15:07 +0000 (16:15 -0400)]
PR18848: new procfs monitor mode option

Presents a procfs read interface to obtain data about the running
script and another procfs write interface to control the script

* cmdline.cxx: new "monitor" option
* cmdline.h: new field in enum
* elaborate.cxx: new functions monitor_mode_read and monitor_mode_write
  synthesizes procfs probes for the interfaces
* session.cxx: new monitor flag
* session.h: new monitor flag
* translate.cxx: extra code is generated to provide statistics for
  monitor mode, function emission is delayed to allow stap_probes to
  be first defined

8 years agoUpdate the PR19241 fix so that 'out_fd' gets correctly handled.
Martin Cermak [Fri, 20 Nov 2015 11:22:05 +0000 (12:22 +0100)]
Update the PR19241 fix so that 'out_fd' gets correctly handled.

This is an update to commit d879410b. Before this update, stap
in "stream mode" was using invalid output file descriptor per
https://sourceware.org/bugzilla/show_bug.cgi?id=19241#c2.

8 years agoAllow buildok/{rpc-all-probes,rpc-detailed} to access private var.
Martin Cermak [Fri, 20 Nov 2015 10:00:30 +0000 (11:00 +0100)]
Allow buildok/{rpc-all-probes,rpc-detailed} to access private var.

Tests buildok/rpc-all-probes.stp and buildok/rpc-detailed.stp are
examining '@__private30 global __rpc_create_args' array.  That can
only be accessed using '--compatible=2.9' by the test script.

This approach to testing private stuff will probably need to change
in the future.  For now, this update aligns buildok/{rpc-all-probes,\
rpc-detailed}.stp to other buildok tests examining private variables
or functions.

8 years agoAvoid using the nomencl compatible option
William Cohen [Thu, 19 Nov 2015 22:05:12 +0000 (17:05 -0500)]
Avoid using the nomencl compatible option

Some versions of nomencl such as the one on RHEL 5 are missing the
compatible option.  Thus, tutorial.tex should avoid using it so the
documentation can be built.

8 years agoImprove kmodule.exp by adding tests that load the module after stap.
David Smith [Thu, 19 Nov 2015 18:38:09 +0000 (12:38 -0600)]
Improve kmodule.exp by adding tests that load the module after stap.

* testsuite/systemtap.base/kmodule.exp: Add subtests that see if the same
  scripts work if the module is loaded after the systemtap module is
  loaded. This currently fails for non-dwarf kprobe probes (PR19216).

8 years agoMake testsuite/systemtap.base/switch_file.exp more robust.
David Smith [Wed, 18 Nov 2015 20:17:50 +0000 (14:17 -0600)]
Make testsuite/systemtap.base/switch_file.exp more robust.

8 years agoRefix PR18889 by switching to symbol_name+offset module probing.
David Smith [Wed, 18 Nov 2015 19:03:44 +0000 (13:03 -0600)]
Refix PR18889 by switching to symbol_name+offset module probing.

* tapsets.cxx: Add symbol_name+offset support for dwarf kprobes present in
  modules. This is somewhat based on work by James Bottomley from the
  following email:
    <https://sourceware.org/ml/systemtap/2008-q3/msg00182.html>
* runtime/transport/symbols.c (_stp_module_notifier): On kernel's >= 3.16,
  use symbol_name+offset probing for modules.
* runtime/linux/kprobes.c: Switch to using symbol_name+offset probing for
  modules.

8 years agoRevert "PR18889 part: module-init notification via module_{load,free} tracepoints"
David Smith [Wed, 18 Nov 2015 18:53:33 +0000 (12:53 -0600)]
Revert "PR18889 part: module-init notification via module_{load,free} tracepoints"

This reverts commit 2278079efc01124dd509241f6c6eadbd6e19cb2a. This code
will be replaced with a new method for handling probes in kernel module's
init sections.

8 years agoRevert "PR18889: switch to STP_TRACEPOINT* frontend for kernel tracepoint registration"
David Smith [Wed, 18 Nov 2015 18:52:08 +0000 (12:52 -0600)]
Revert "PR18889: switch to STP_TRACEPOINT* frontend for kernel tracepoint registration"

This reverts commit 2e67c14dad1c661d2ce0b0ed218b371c1af218ba. This code
will be replaced with a different method for handling probes in kernel
module's init sections.

8 years agoMake the "shebang trick" work for RPM packaged testcases.
Martin Cermak [Wed, 18 Nov 2015 10:00:07 +0000 (11:00 +0100)]
Make the "shebang trick" work for RPM packaged testcases.

Some testcases use the "shebang trick" described in stap_run_batch()
testsuite function.  Commit d2995e6f breaks this for RPM packaged
testcases by putting the absolute path to stap into the shebang.

This update reverts cb69017 update to stap_run_batch() and fixes the
specfile shebang rewriter instead, so that it only applies to
systemtap examples contained in the systemtap-client package, where
the "shebang trick" is unwelcome.  With this update, testcases
contained in the systemtap-testsuite RPM remain unchanged, so that
the "shebang trick" works for them.

8 years agoTestsuite: Raise --rlimit-cpu, update stap_run_batch()
Martin Cermak [Mon, 16 Nov 2015 13:56:01 +0000 (14:56 +0100)]
Testsuite: Raise --rlimit-cpu, update stap_run_batch()

Need to increase --rlimit-cpu, since especially certain buildok
tests seem to reach the old value easily. It turns out that not
only "32-bit arm machines are quite slow", so not distinguishing
the machine type any more and just raising the treshold:

The goal is to raise the limit for low cost. Note that the
"-E 'probe timer.s(900) ...'' limit affects the generated source
that some testcases rely on verbatimely. So setting --rlimit-cpu
just slightly under 15 mins should improve test results without
need to modify those testcases source.

The stap_run_batch() update is needed to deal properly with RPM
packaged testcases, which have slightly modified source code
compared to their git versions due to commit d2995e6f. This update
is an addition to commit 6b131ba7 making it work with RPM packaged
testcases too.

8 years agoTerminate parsing on duplicate variable or function declaration.
Martin Cermak [Sat, 14 Nov 2015 18:17:27 +0000 (19:17 +0100)]
Terminate parsing on duplicate variable or function declaration.

This fixes condition that makes the parser stop on attempt to
declare duplicate global variable or function.  It also (newly)
makes the parser terminate on global versus private variable or
function declaration attempt.

This update makes parseko/eleven.stp and parseko/twelve.stp
expectedly fail.  It also adds parseko/private0[12].stp that
expectedly fail on attempt do declare conflicting global versus
private variable or function.

8 years agoFix PR19241 by scanning for available CPUs.
Martin Cermak [Fri, 13 Nov 2015 15:21:15 +0000 (16:21 +0100)]
Fix PR19241 by scanning for available CPUs.

Per PR19241/rhbz1280321, staprun was failing to start when CPU0
was offline or offline.  In bulk mode, staprun was failing if
any CPU but the last one was offline.  This patch fixes it by
scanning for available online CPUS up to NR_CPUS.

8 years agoUpdate user_string_n2_quoted() so that semok/context-globals.stp is happy.
Martin Cermak [Fri, 13 Nov 2015 13:10:36 +0000 (14:10 +0100)]
Update user_string_n2_quoted() so that semok/context-globals.stp is happy.

Rename the local 'str' variable within user_string_n2_quoted() to '__str'
so that it doesn't collide with global variable of the same name defined
in the semok/context-globals.stp testcase.

8 years agokill interned_string::c_str(), allowing shared substr()
Josh Stone [Thu, 12 Nov 2015 22:14:22 +0000 (14:14 -0800)]
kill interned_string::c_str(), allowing shared substr()

For the most part, c_str() is just used for "%s" in warnings, errors,
and debug messages.  We can afford to pay the cost of to_string() there,
while allowing string_ref to share memory the rest of the time.

NB: when using `to_string().c_str()`, it's important not to let that
pointer outlive the string temporary!  It's good only for the range of
its full expression; if you need it longer, bind the string to a local
reference first.

8 years agoFix PR19234 by adapting user_string_n_quoted.exp.
Martin Cermak [Thu, 12 Nov 2015 15:07:06 +0000 (16:07 +0100)]
Fix PR19234 by adapting user_string_n_quoted.exp.

Adapt user_string_n_quoted.exp to the new behavior of
user_string_n2_quoted() introduced by commit bfd1c4ccc2.

8 years agoFix PR19236 by undefining the unmangled variable name.
Martin Cermak [Thu, 12 Nov 2015 14:44:10 +0000 (15:44 +0100)]
Fix PR19236 by undefining the unmangled variable name.

8 years agoExtend private.exp to cover the PR13721 workaround scenario.
Martin Cermak [Wed, 11 Nov 2015 09:41:19 +0000 (10:41 +0100)]
Extend private.exp to cover the PR13721 workaround scenario.

8 years agoExtend global_end.exp to cover private globals too.
Martin Cermak [Wed, 11 Nov 2015 09:40:02 +0000 (10:40 +0100)]
Extend global_end.exp to cover private globals too.

8 years agoFix synthetic probes generation for written and unread private globals.
Martin Cermak [Wed, 11 Nov 2015 09:23:16 +0000 (10:23 +0100)]
Fix synthetic probes generation for written and unread private globals.

Mangling a private global happens based on the name of the file where the
variable got defined.  Stap automatically prints written and unread globals
and private globals at the end of the session.  For autogeneration purposes
of respective derived synthetic probes, we need to keep track of the file
where given variable got defined.

8 years agoAvoid undefined behavior in get_number_param
Josh Stone [Wed, 11 Nov 2015 02:03:08 +0000 (18:03 -0800)]
Avoid undefined behavior in get_number_param

An uninitialized assignment led the compiler to assume it must be
initialized after all, which led to an optimization reversing the
conditions of an '&&'.  This triggered valgrind when the condition
actually was uninitialized after all.  See GCC PR68281.

Ditch the long and long long get_number_param for just int64_t, which is
just a pass-through to get_param.  A few fields are now int64_t to
match, so they can never truncate input values on 32-bit systems.  The
other Dwarf_Addr get_number_param is now careful to only copy good
values from get_param.

Just to be paranoid, all base_query and dwarf_query POD members are now
zeroed in the initializer lists, even when the constructor will set a
better value right away.

8 years agoMark selected internal tapset global vars as '@__private30'.
Martin Cermak [Tue, 10 Nov 2015 07:32:05 +0000 (08:32 +0100)]
Mark selected internal tapset global vars as '@__private30'.

Mark tapset global vars, that are only intended to be used
internally within given tapset, as '@__private30'.  This
restriction appears to have no imparct from the testsuite
perspective.  However, it's still possible that some user
script may rely on one of those.  This restriction can be
worked around using 'stap --compatible=2.9' setting.

8 years agoFix parsing multiple, comma separated, private global vars.
Martin Cermak [Tue, 10 Nov 2015 07:20:26 +0000 (08:20 +0100)]
Fix parsing multiple, comma separated, private global vars.

8 years agoFix several uninitialized class members
Josh Stone [Tue, 10 Nov 2015 02:37:37 +0000 (18:37 -0800)]
Fix several uninitialized class members

Reported by Coverity as UNINIT_CTOR.

8 years agoFix the uselib syscall testcase by updating the expected output.
Martin Cermak [Mon, 9 Nov 2015 08:37:14 +0000 (09:37 +0100)]
Fix the uselib syscall testcase by updating the expected output.

8 years agoMark internal tapset functions as '@__private30' where possible.
Martin Cermak [Sat, 7 Nov 2015 14:43:29 +0000 (09:43 -0500)]
Mark internal tapset functions as '@__private30' where possible.

Add '@__private30' macro that gives 'private' keyword for compatibility
mode 3.0 and higher. Mark internal tapset functions as private using
it where possible. Testcases examining private tapset functions must
now use the --compatible=2.9 option.

8 years agoPrefix global functions in the generated code.
Martin Cermak [Thu, 5 Nov 2015 20:50:55 +0000 (15:50 -0500)]
Prefix global functions in the generated code.

Add '__global_' prefix to global functions in the generated code.
Treat selected internal synthetic functions as private.
Fix using a private function in user script and test-cover it.

* elaborate.cxx: Correctly match global function names to respective
  functiondecls. Match synthetic private functions coming from
  tapset-procfs.cxx (*_procfs_value_*), and tapsets.cxx
  (_sdt_arg_get_addr_) to respective functiondecls.
* main.cxx: Update the --dump-functions feature to correctly deal with
  new internal function names.
* parse.cxx: Add the "__global_" prefix to global functions in the
  generated code.
* staptree.cxx: Update functiondecl::printsig() so that it outputs
  unmangled function name.
* tapset-procfs.cxx: Treat internal synthetic functions
  '*_procfs_value_get*', '*_procfs_value_set*', '*_procfs_value_append*'
  as private.
* tapsets.cxx: Treat internal synthetic functions '*_sdt_arg_get_addr_*'
  as private.
* optim_arridx.exp: Adapt the testcase to new naming.
* private.exp: Add subtest examining use of a private function in
  user script.

8 years agoFix the 'if.exp' testcase so that the second test result matters.
David Smith [Thu, 5 Nov 2015 16:52:10 +0000 (10:52 -0600)]
Fix the 'if.exp' testcase so that the second test result matters.

* testsuite/systemtap.base/if.exp: Make sure we look for the
  'all_pass_string' twice, since the test case prints it twice.

8 years agoAdd testcases for variables scope.
Zhou Wenjian [Thu, 5 Nov 2015 16:44:25 +0000 (10:44 -0600)]
Add testcases for variables scope.

* testsuite/systemtap.base/var_scope.exp: New test case.
* testsuite/systemtap.base/var_scope.stp: New test file.

8 years agoman/stap.1: hold forth on DEPRECATION
Frank Ch. Eigler [Wed, 4 Nov 2015 18:09:16 +0000 (13:09 -0500)]
man/stap.1: hold forth on DEPRECATION

Explain that our deprecation is done for the users' benefit.

8 years agoHide "__global_" mangling from the module parameters
Josh Stone [Tue, 3 Nov 2015 19:42:27 +0000 (11:42 -0800)]
Hide "__global_" mangling from the module parameters

This mangling is an implementation detail of the module, and we don't
want to introduce a version dependency for staprun and stapdyn which
understand this.  Leave the parameter names unmangled and simply map
them to the mangled variable internally.

This also makes sure we don't expose the new private variables as
parameters at all, not even in mangled form.

8 years agoMake private functions play well with default optimizations.
Martin Cermak [Tue, 3 Nov 2015 15:16:36 +0000 (10:16 -0500)]
Make private functions play well with default optimizations.

Without this update, duplicate_function_remover::visit_functioncall()
would treat two different private functions of the same name as one
("Changing B reference to A reference"). This would happen with default
optimizations (without -u). This fix is analogical to b834d412e356
(mcermak/private branch) which does similar thing for private globals.

8 years agoExtend testcase private.exp to cover PR10607 scenario.
Martin Cermak [Tue, 3 Nov 2015 08:19:55 +0000 (03:19 -0500)]
Extend testcase private.exp to cover PR10607 scenario.

8 years agoMake test outut easier to compare among runs (PR19135).
Martin Cermak [Tue, 3 Nov 2015 07:55:09 +0000 (02:55 -0500)]
Make test outut easier to compare among runs (PR19135).

Drop PIDs and auxiliary counters from output of listing_mode.exp
valid_pid.exp and bench.exp. With this update test outputs are easier
to compare between testsuite runs and still well debuggable.

8 years agoMake a few small tweaks to modules_out_of_tree.exp.
David Smith [Mon, 2 Nov 2015 22:24:20 +0000 (16:24 -0600)]
Make a few small tweaks to modules_out_of_tree.exp.

* testsuite/systemtap.base/modules_out_of_tree.exp: A few tweaks, move all
  the generated files to a new temporary directory and don't remove the
  temporary directory if we're in verbose mode.

8 years agosystemtap.spec: partial revert of latex2html configury cleanup
Frank Ch. Eigler [Mon, 2 Nov 2015 18:56:52 +0000 (13:56 -0500)]
systemtap.spec: partial revert of latex2html configury cleanup

We don't run latex2html, but a few of our .tex files include
\usepackage{html} - which is provided by latex2html.

8 years agosystemtap.spec: tex package typo fix
Frank Ch. Eigler [Mon, 2 Nov 2015 18:34:57 +0000 (13:34 -0500)]
systemtap.spec: tex package typo fix

8 years agosystemtap.spec: also require tex(graphicsx.sty)
Frank Ch. Eigler [Mon, 2 Nov 2015 18:33:08 +0000 (13:33 -0500)]
systemtap.spec: also require tex(graphicsx.sty)

This explicit dependency has only recently become necessary.

8 years agoSet input.check_compatible at the lexer ctor time.
Martin Cermak [Mon, 2 Nov 2015 16:11:54 +0000 (17:11 +0100)]
Set input.check_compatible at the lexer ctor time.

Before this update input.check_compatible has been set after lexer
ctor finished. This was too late for has_version() to work properly
within the lexer ctor.

8 years agoFix operator precedence issue introduced by commit 6469522cf.
Martin Cermak [Mon, 2 Nov 2015 15:40:22 +0000 (16:40 +0100)]
Fix operator precedence issue introduced by commit 6469522cf.

8 years agoDrop the --compatible part of the private.exp testcase.
Martin Cermak [Mon, 2 Nov 2015 15:21:04 +0000 (10:21 -0500)]
Drop the --compatible part of the private.exp testcase.

Can go back in once some system tapset starts relying on the "private"
keyword.

8 years agoTestsuite additions and fixes for the "private" keyword feature.
Martin Cermak [Fri, 30 Oct 2015 17:17:16 +0000 (18:17 +0100)]
Testsuite additions and fixes for the "private" keyword feature.

* testsuite/systemtap.base/modargs.exp: Fix the testcase.
* testsuite/systemtap.base/optim_arridx.exp: Ditto.
* testsuite/systemtap.onthefly/affection.exp: Ditto.
* testsuite/systemtap.base/private.{exp,stp}: New testcase.

8 years agoDocument the "private" keyword feature.
Martin Cermak [Fri, 30 Oct 2015 17:15:09 +0000 (18:15 +0100)]
Document the "private" keyword feature.

Add documentation for changes brought by commit 38bf68a81d.

8 years agoIntroduce "private" keyword for tapsets and user scripts.
Martin Cermak [Fri, 30 Oct 2015 17:03:19 +0000 (18:03 +0100)]
Introduce "private" keyword for tapsets and user scripts.

With this update global variables and functions may be marked "private"
limiting their scope to a tapset or usersctipt file per PR19136.

* NEWS: Add entry.
* elaborate.cxx: Match names to decls within find_var(), update
  generation of synthetic probes within add_global_var_display().
* parse.cxx: Recognize the "private" keyword.
* stapdyn/mutator.cxx: Pass global variable names to the dyninst
  runtime with "__global_" prefix.
* staprun/staprun_funcs.c: Pass global variable names to the kernel
  runtime with "__global_" prefix.
* tapset-utrace.cxx, tapsets.cxx: Prefix internal globals that are
  bypassing the parser.
* util.cxx, util.h: Add detox_path() as a support function.

8 years agodocs: add tex(nomencl.sty) dependency
Frank Ch. Eigler [Thu, 29 Oct 2015 14:15:27 +0000 (10:15 -0400)]
docs: add tex(nomencl.sty) dependency

nomencl.sty is available from at least RHEL5 onward, so let's not bundle it.

8 years agoForget about latex2html in configury; we don't use it in builds any more.
Frank Ch. Eigler [Thu, 29 Oct 2015 13:54:29 +0000 (09:54 -0400)]
Forget about latex2html in configury; we don't use it in builds any more.

8 years agoFix the shamed -Werror bug link
Josh Stone [Thu, 29 Oct 2015 01:06:10 +0000 (18:06 -0700)]
Fix the shamed -Werror bug link

8 years agostap: buildrun's -Werror is not really optional
Josh Stone [Thu, 29 Oct 2015 00:43:23 +0000 (17:43 -0700)]
stap: buildrun's -Werror is not really optional

We really, really do want -Werror in kbuild invocations, else things
like "warning: passing argument from incompatible pointer type" will be
allowed, and that's almost certainly a fatal problem for kernel code.

This particular warning first shows up in stapconf checks for tracepoint
features, which then leads to uncompilable code elsewhere, so at least
it fails nicely.  But we don't want *any* warnings to sneak through.
The string in buildrun.cxx is now slightly obfuscated so it may escape
Gentoo's blunt sed removal.

This also removes the undocumented, obfuscated, *evil* option from the
command which omitted -Werror.  If you're really so sure that you don't
need it, you must now talk to this guy:

 ______________
< I <3 -Werror >
 --------------
      \                    / \  //\
       \    |\___/|      /   \//  \\
            /0  0  \__  /    //  | \ \
           /     /  \/_/    //   |  \  \
           @_^_@'/   \/_   //    |   \   \
           //_^_/     \/_ //     |    \    \
        ( //) |        \///      |     \     \
      ( / /) _|_ /   )  //       |      \     _\
    ( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.
  (( / / )) ,-{        _      `-.|.-~-.           .~         `.
 (( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \
 (( /// ))      `.   {            }                   /      \  \
  (( / ))     .----~-.\        \-'                 .~         \  `. \^-.
             ///.----..>        \             _ -~             `.  ^-`  ^-_
               ///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~
                                                                  /.-~

8 years agoPR14431 cont'd: syscalls testsuite fallout
Frank Ch. Eigler [Tue, 27 Oct 2015 22:34:27 +0000 (18:34 -0400)]
PR14431 cont'd: syscalls testsuite fallout

jistone helpfully noted that the innocuous tapset changes broke the
syscall testsuite, since the latter looks for particular idiosyncratic
hex patterns.  Lovingly adjusting them, a single line at a time, until
[7]f+ turns into the newly consistentified 0x[7]f+, etc.

8 years agoPR14431 cont'd: user_string_n2_quoted()
Frank Ch. Eigler [Tue, 27 Oct 2015 22:33:01 +0000 (18:33 -0400)]
PR14431 cont'd: user_string_n2_quoted()

Turn this lower-level tapset function into a pure-script alternative
that uses the same new standard 0xHEX notation for failed accesses
that the {user,kernel}_string_quoted() ones do.

8 years agotestsuite: wrap /usr/bin/stress invocations in /usr/bin/timeout -k
Frank Ch. Eigler [Tue, 27 Oct 2015 22:26:24 +0000 (18:26 -0400)]
testsuite: wrap /usr/bin/stress invocations in /usr/bin/timeout -k

On some platforms (I'm winking at you, rawhide!), stress(1) could get
into a hung state when running under stap probes, even though it was
given the "-t TIMEOUT" parameter.  Now we wrap it in timeout(1), which
makes sure that stress won't last forever.

8 years agoruntime: reject overlong UTF-8, output as raw octal instead
Josh Stone [Wed, 28 Oct 2015 00:42:32 +0000 (17:42 -0700)]
runtime: reject overlong UTF-8, output as raw octal instead

Since string_quoted is meant to unambiguously represent its output, it's a
bad idea to let different UTF-8 byte sequences lead to the same Unicode
code point.  This can only happen if you allow 0-padded UTF-8 that ends up
longer than necessary.  It's especially bad if you let long zero encodings
like 0xC0 0x80 be treated as a string terminator!

If any UTF-8 was decoded from more bytes than its value should have needed,
just write it verbatim with octal escapes instead.

8 years agoruntime: simplify byte counts in _stp_decode_utf8
Josh Stone [Wed, 28 Oct 2015 00:26:19 +0000 (17:26 -0700)]
runtime: simplify byte counts in _stp_decode_utf8

8 years agoruntime: share code for \u and \U escaped output
Josh Stone [Wed, 28 Oct 2015 00:24:29 +0000 (17:24 -0700)]
runtime: share code for \u and \U escaped output

8 years agoexamples: add callgraph.stp simple sample
Frank Ch. Eigler [Tue, 27 Oct 2015 19:17:43 +0000 (15:17 -0400)]
examples: add callgraph.stp simple sample

8 years agoMake a small change to runtime/stp_string.c to avoid RHEL5 compile errors.
David Smith [Tue, 27 Oct 2015 18:56:28 +0000 (13:56 -0500)]
Make a small change to runtime/stp_string.c to avoid RHEL5 compile errors.

* runtime/stp_string.c (_stp_decode_utf8): Add some initializations to
  make RHEL5's compiler happy.

8 years agoUpdate the mmreclaim.stp example's "meta" file.
David Smith [Tue, 27 Oct 2015 18:54:19 +0000 (13:54 -0500)]
Update the mmreclaim.stp example's "meta" file.

* testsuite/systemtap.examples/memory/mmreclaim.meta (test_support): Relax
  test support requirements, only checking for any tracepoint that looks
  like "mm_*reclaim*".

8 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
David Smith [Mon, 26 Oct 2015 21:03:09 +0000 (16:03 -0500)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

8 years agoUpdate the mmreclaim.stp example scripts.
David Smith [Mon, 26 Oct 2015 21:02:34 +0000 (16:02 -0500)]
Update the mmreclaim.stp example scripts.

* testsuite/systemtap.examples/memory/mmreclaim.stp: Update script for
  newer kernels (RHEL7+).

8 years agoruntime: produce unicode escapes in _stp_text_str
Josh Stone [Fri, 23 Oct 2015 20:11:59 +0000 (13:11 -0700)]
runtime: produce unicode escapes in _stp_text_str

Instead of just writing raw octal escapes, detect and decode well-formed
UTF-8 sequences and write them as \uXXXX or \UXXXXXXXX.

8 years agoforktracker: add TIDs to the trace
Josh Stone [Fri, 23 Oct 2015 19:22:22 +0000 (12:22 -0700)]
forktracker: add TIDs to the trace

It can be confusing for users to see that a PID forked into the same PID,
but really this is just a new thread in that process.  Printing the TIDs
makes this more obvious.

8 years agoruntime/dyninst: add a dummy _stp_is_compat_task()
Josh Stone [Fri, 23 Oct 2015 19:20:20 +0000 (12:20 -0700)]
runtime/dyninst: add a dummy _stp_is_compat_task()

Fixes buildok/arch_bytes.stp.

8 years agoUpdate the mmfilepage.stp and net_xmit_json.stp example scripts.
David Smith [Fri, 23 Oct 2015 18:48:12 +0000 (13:48 -0500)]
Update the mmfilepage.stp and net_xmit_json.stp example scripts.

* testsuite/systemtap.examples/memory/mmfilepage.stp: Update script for
  newer kernels (RHEL7+).
* testsuite/systemtap.examples/memory/mmfilepage.meta (test_support):
  Relax support requirements.
* testsuite/systemtap.examples/network/net_xmit_json.stp: Make the
  "net_dev_start_xmit" tracepoint optional, since it doesn't exist in some
  kernels.
* testsuite/systemtap.examples/network/net_xmit_json.meta: Ditto.
* testsuite/systemtap.examples/profiling/fileline-profile.meta: Correct
  typo so that the script gets built.

8 years agoUpdate the 'autofs4' example script for current kernels.
David Smith [Thu, 22 Oct 2015 21:00:30 +0000 (16:00 -0500)]
Update the 'autofs4' example script for current kernels.

* testsuite/systemtap.examples/network/autofs4.stp: Update for kernels >
  RHEL5-era kernels.
* testsuite/systemtap.examples/network/autofs4.meta (test_support): Remove
  'test_support' line since the script should work everywhere now.

8 years agoAdd testcases for prologue and epilogue style aliases.
Zhou Wenjian [Thu, 22 Oct 2015 16:20:16 +0000 (11:20 -0500)]
Add testcases for prologue and epilogue style aliases.

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