Frank Ch. Eigler [Sat, 12 Feb 2011 20:46:37 +0000 (15:46 -0500)]
PR3823: use our own autosprintf()
* configure.ac, Makefile.am: Forget about libasprintf.
* main.cxx, session.cxx, session.h: Likewise.
* util.h, util.cxx: Define workalike autosprintf(), with a fresh
new look, and with no added memory leaks! WOW!
Frank Ch. Eigler [Sat, 12 Feb 2011 20:17:45 +0000 (15:17 -0500)]
PR3823: redo autoconfigury with gettextize
* Makefile.am, configure.ac: Use autoconf/automake gettext support.
* config.rpath, config.sub, ABOUT.NLS: New files.
* m4/*. Many new files, copied by gettextize.
* po/*. Many new files, mostly from gettextize.
* po/LINGUAS, po/POTFILES.in, po/systemtap.pot, po/en.po, po/en.gmo: New files.
Josh Stone [Sat, 12 Feb 2011 01:32:16 +0000 (17:32 -0800)]
Silence the closing of the ssh control master
* remote.cxx (ssh_remote::close_control_master): Tell stap_system to
redirect stdout and stderr to /dev/null, so we don't see the insistent
"Exit request sent" message.
Josh Stone [Sat, 12 Feb 2011 00:29:18 +0000 (16:29 -0800)]
Build the staprun command as an argument vector
* buildrun.cxx (make_run_command): Build the command as a vector.
* util.cxx (cmdstr_join): New, join a vector as quoted strings.
* remote.cxx (direct::start): Use make_run_command directly.
(ssh_remote::start): Pass cmdstr_join(make_run_command(...)) to
ssh, so all args survive intact to the remote side.
Josh Stone [Fri, 11 Feb 2011 23:17:24 +0000 (15:17 -0800)]
Remove the flat-string stap_system altogether
* util.cxx (stap_system): Remove the flat-string version. Add
booleans to the vectored version for whether stdout/err should
be redirected to /dev/null.
* buildrun.cxx (run_make_cmd): Take the cmd as a vector, and use the
same nulling flags to pass along to stap_system.
(compile_pass): Build a vectored make_cmd.
(verify_uprobes_uptodate): Ditto.
(make_uprobes): Ditto.
(make_tracequery): Ditto.
(make_typequery_kmod): Ditto.
(make_typequery_umod): Build a vectored gcc command.
* csclient.cxx (compile_server_client::package_request): Manually wrap
this compound command with an sh -c vector. Add quoting to the client
tmpdir and zipfile, just in case.
David Smith [Fri, 11 Feb 2011 17:16:57 +0000 (11:16 -0600)]
The logger pmda now asks for a logfile to monitor.
* pcp/src/pmdas/logger/logger.h: New file.
* pcp/src/pmdas/logger/loggerMain.c: New custom main loop.
* pcp/src/pmdas/logger/logger.c (main): Added option for logfile to
monitor and calls new custom main loop.
* pcp/src/pmdas/logger/Install: Asks for logfile name to monitor.
* pcp/src/pmdas/logger/GNUmakefile: Added loggerMain.c and logger.h.
Josh Stone [Fri, 11 Feb 2011 02:46:19 +0000 (18:46 -0800)]
Start using arg vectors for stap_system and friends
Instead of worrying about quoting properly in every command string, we
can rest easier by launching processes with a proper argv[]. All of the
stap_system-like functions are converted, but a flat-string stap_system
is also kept around for now while callers are converted.
* util.cxx (stap_spawn): Take a vector<string> for command arguments,
convert that to an argv[], and use that for posix_spawnp. Note the
conversion to spawnp as well so PATH-searching is still performed.
(stap_system, stap_system_read): Convert to vectors, but keep a flat
version of the former for compatibility.
(probe stap_system__start): Move to stap_spawn, to probe all flavors.
(probe stap_system__complete): Likewise, move to stap_waitpid, to
probe when any process is finished; add a pid to track who's done.
* remote.cxx (direct, ssh_remote): Convert all calls to vector form.
Josh Stone [Fri, 11 Feb 2011 00:43:55 +0000 (16:43 -0800)]
Use posix_spawn_file_actions for stap_system_read
The file actions can handle the dup2 necessary to hook a pipe onto the
child's stdout. It could do the necessary closing too, but we'll just
use FD_CLOEXEC for that.
* util.cxx (stap_spawn): Take file_actions for the posix_spawn.
(pipe_child_fd): New, open a pipe and set the dup2 action for it.
(stap_system_read): Let stap_spawn and pipe_child_fd do the hard part.
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.