Josh Stone [Tue, 8 Feb 2011 23:06:25 +0000 (15:06 -0800)]
Clean up exit paths
We need to strive not to leave files/processes around, so exit() calls
are reduced to only places where nothings been allocated yet. Errors
are rarely so fatal to require immediate exit.
Josh Stone [Tue, 8 Feb 2011 23:06:25 +0000 (15:06 -0800)]
Use a ControlMaster for ssh remotes
We can start the ssh remote with a ControlMaster connection, using a
unique socket in the tmpdir, and then each subsequent remote command can
reuse that connection.
* remote.cxx (ssh_remote::open_control_master): Connect to the remote
host with a ControlPath that later commands can reuse. The relevant
options are saved in member ssh_opts.
(ssh_remote::close_control_master): Ask the control process to exit.
(ssh_remote::get_uname, ::start, ::finish): Start using ssh_opts, so
the ControlPath is always specified.
Josh Stone [Tue, 8 Feb 2011 23:06:25 +0000 (15:06 -0800)]
Use a proper session copier when cloning
* session.cxx (systemtap_session): Define copy and assignment
constructors without implementation, to avoid implicit behavior.
Add a new copy constructor with a new kernel/arch.
(systemtap_session::clone): Use the new copier.
Dave Brolley [Mon, 7 Feb 2011 20:00:15 +0000 (15:00 -0500)]
PR 11844 - --use-server-on-error option
- Now defaults to 'off'
- Errors no longer automatically result in retry using the server.
This is done only for certain whitelisted errors.
systemtap_session::set_try_server() is called for these errors.
Dave Brolley [Fri, 4 Feb 2011 18:32:37 +0000 (13:32 -0500)]
PR 12428 - Document Compile Server/Client Setup and Admin
- New README.unprivileged
- Update info about unprivileged mode in stap.1 and in stap-server.8
- Don't bother autoconfing paths in stap-server.8. Refer to stappaths
instead.
William Cohen [Thu, 3 Feb 2011 21:59:24 +0000 (16:59 -0500)]
Avoid using $env(HOSTNAME)
When running crontab jobs the systemtap.server/server.exp tests
would not run because $env(HOSTNAME) is unset. HOSTNAME is
set by the bash shell and is not available in crontab run tests.
An equivalent [info hostname] is used in its place.
Lukas Berk [Thu, 3 Feb 2011 14:16:24 +0000 (09:16 -0500)]
gettext changes in main.cxx and session files
to invoke run $ xgettext -c -k_ main.cxx session.*
not every string has been set up for gettext translation, at this
point it is just to make sure it doesn't break stap. The more
complicated strings will be I18N in time.
Stan Cox [Tue, 1 Feb 2011 22:08:12 +0000 (17:08 -0500)]
Cleanup to improve sdt on ppc.
* tapsets.cxx (sdt_uprobe_var_expanding_visitor::visit_target_symbol):
Use variable shift amount. Don't cast unless probe type 3.
* sdt_misc.exp (type_flags): Don't use sup_flags
* sdt_types.c: Check __SIZEOF_SIZE_T__ for long long tests.
Josh Stone [Fri, 28 Jan 2011 23:02:50 +0000 (15:02 -0800)]
Assert that TMPDIR, if set, is a boring path
We don't want any excitement in the paths we must use.
e.g. Kbuild doesn't cope well with spaces in the M="/module path"
* session.cxx (systemtap_session::check_options): Restrict the
characters allowed in TMPDIR to a universally-safe set.
* testsuite/parseko/cmdline22.stp: New, check that TMPDIR spaces are
not allowed, even if that path really exists.
William Cohen [Fri, 28 Jan 2011 21:12:08 +0000 (16:12 -0500)]
Ensure systemtap.stress/conversions.exp generates individual errors and warnings
PR12168 eliminated duplicated error messages and changed the count of
ERROR and WARNING messages. Adding the "-vv" option turns off the
duplication eliminate and allows an accurate count of the number
of times ERROR and WARNING messages occur.
Dave Brolley [Fri, 28 Jan 2011 19:55:29 +0000 (14:55 -0500)]
PR 11844 - --use-server-on-error option
- Mechanism is in session.cxx, session.h.
- Code in main.cxx:passes_0_4 calls set_try_server upon compilation
errors in phases 0-4.
- set_try_server (systemtap_session:dont_try_server) can be set for
individual errors which do not warrant a retry (e.g. syntax errors)
to override.
Dave Brolley [Wed, 26 Jan 2011 22:15:35 +0000 (17:15 -0500)]
Make sure NSS and NSPR are properly initialized and shutdown.
- rpmReadConfigFiles initializes NSS, but does not shut it down.
We now call rpmFreeCrypto if available or call NSS_Shutdown directly otherwise
in missing_rpm_enlist
- In some versions of NSPR, PR_Init must be called once and only once before NSS_Init or
NSS_InitReadOnly is called. In later versions, it is unnecessary and is ignored.
systemtap_session::NSPR_Initialized is now static so that it is
shared by all active session objects.
Frank Ch. Eigler [Mon, 24 Jan 2011 18:30:04 +0000 (13:30 -0500)]
GCC 4.6 unused-variable warnings
We set a couple of variables that later code doesn't use. GCC 4.6
warns about them, which our C*FLAGS=-Werror turned into a build failure.
Worked around these by adding a (void) var; to add a dummy use.
Josh Stone [Fri, 21 Jan 2011 23:44:41 +0000 (15:44 -0800)]
Audit some minus/dash/hyphen use in manpages
Groff treats "-" as a hyphen, U+2010. When the intention is to produce
a literal ASCII minus sign, U+002D, it must be "\-". This matters for
command-line options and examples to be copyable from the manpage.
I've updated cases that should obviously be escaped. At a glance, I
think we have other cases that could be normal hyphens, not escaped, but
that's less of an issue.
URI paths, queries, and fragments are all parsed, but don't have any
meaning yet, so they're treated as an error. I can imagine using this
for protocol-specific options though, e.g. ssh://host/?Compression=yes
* remote.cxx (class uri_decoder): New, breaks down a URI string.
(ssh_remote::ssh_remote): Add a constructor using a uri_decoder.
(remote::create): Redirect based on the scheme of URI-looking remote
targets. Assume all others are still plain [user@]host for ssh.
Dave Brolley [Wed, 19 Jan 2011 20:36:56 +0000 (15:36 -0500)]
PR 11862: remove obsolete stap-client script and friends
- Remove deprecated scripts
- Remove parts of stap-env used only by the removed scripts
- Remove man pages for removed scripts
- Remove parts of stap-client-connect which allowed it to be built
as a standalone tool (used by stap-client).
- Update spec file. systemtap-client package removed.
Frank Ch. Eigler [Wed, 19 Jan 2011 18:53:50 +0000 (13:53 -0500)]
BZ669082: support powerpc prior to 2.6.15, resolving conflict with PR4186
* buildrun.cxx (compile_pass): Omit passing of ARCH=foo for
ancient powerpc. This enables native ARCH=ppc64 builds,
but sacrifices ppc-target cross-architecture cross-compilation.
(make_tracequery_kmod, make_typequery_kmod): Ditto.
Frank Ch. Eigler [Wed, 19 Jan 2011 13:20:22 +0000 (08:20 -0500)]
PR12411 cont'd: use enum type decl
* tapsets.cxx (sdt_uprobe_var_expanding_visitor): Make regwidths
an enum type decl, not an anonymous-enum-typed variable. Move
DRI macro #define/#undef just around its use.
Stan Cox [Wed, 19 Jan 2011 12:09:01 +0000 (07:09 -0500)]
Switch to using a register width table instead of heuristic code.
* tapsets.cxx (sdt_uprobe_var_expanding_visitor): Add DRI and regwidths.
Change dwarf_regs to be a regname/regwidth pair. Change initializer.
* (sdt_uprobe_var_expanding_visitor::visit_target_symbol): Use it.
David Smith [Tue, 18 Jan 2011 20:14:13 +0000 (14:14 -0600)]
Fixed BZ669740 by making target_set.stp use syscall probes in kernels < 2.6.18.
* tapset/target_set.stp: Dwarfless probes don't work in kernels < 2.6.18.
So, fall back to 'syscall' probes for those kernels (instead of
'nd_syscall' probes.
Dave Brolley [Mon, 17 Jan 2011 18:29:50 +0000 (13:29 -0500)]
Configuration problems.
- CFLAGS was being cleared in configure.ac (oldCFLAGS typo)
- CXXFLAGS was not always being set (CXFXLAGS typo)
- pick up $(AM_CFLAGS) and @PIECFLAGS@ in all C compilations in Makefile.am
Including the comment /* myproc-unprivileged */ within an embedded C
tapset function or embedded C expression makes it available for use
by unprivileged users and also automatically adds a call to
assert_is_myproc() within the function or expression (i.e. it is
equivalent to including the comment /* unprivileged */ and
manually adding the the call to assert_is_myproc).
All instances within the tapset source tree have been updated.
Lukas Berk [Fri, 14 Jan 2011 15:32:47 +0000 (10:32 -0500)]
PR11756 - adding warnings for deprecated declarations
Added the --version-check flag, this will check if systemtap
constructors being used are version dependent. If so, a warning
detailing what syntax element is displayed.
compatibility: perf_event.h updates for kernel 2.6.37
* runtime/autoconf-perf-structpid.c: New file.
* buildrun.cxx: Use it to define STAPCONF_PERF_STRUCTPID.
* runtime/perf.c: Respect it for perf_event_create_kernel_counter param 3.
Dave Brolley [Wed, 22 Dec 2010 16:16:27 +0000 (11:16 -0500)]
PR12172: make unprivileged mode default under certain conditions.
--unprivileged --use-server is now the default for invocations requiring
phase 5 for members of the group stapusr who are not also members of
the group stapdev.
David Smith [Tue, 21 Dec 2010 21:53:33 +0000 (15:53 -0600)]
Fixed PR12338 by updating softirq.entry/softirq.exit probes for 2.6.37+.
* tapset/irq.stp: Added 'vec_nr' variable to softirq.entry/softirq.exit
probes. Used @defined() to make sure old variables are present.
* testsuite/buildok/irq-detailed.stp: Updated softirq.entry/softirq.exit
test.