Dave Brolley [Wed, 14 Sep 2011 20:21:01 +0000 (16:21 -0400)]
Systemtap compile-server and client do not require avahi.
Avahi is required for automatic detection and selection of compile-servers
but the client can still contact servers directly without avahi.
avahi-tools and avahi-devel are not required.
Updated stap-start-server, testsuite/lib/systemtap.exp and systemtap.spec
to reflect this. The specfile stills list avahi-client as a build
requirement for both the systemtap and systemtap-server packages.
Chris Meek [Wed, 14 Sep 2011 17:30:52 +0000 (13:30 -0400)]
PR13156: More verbose hash log output
Added descriptions for each item added to the script's hash in
the hash's log. Also, now it limits the length of each string
printed to the last 80 characters (except paths), to make it
more readable.
* runtime/transport/relay_v2.c (_stp_transport_data_fs_init):
In BULK_MODE, stop overestimating the number of pages we will
need: it's num_online_cpus rather than num_possible_cpus.
Chris Meek [Tue, 13 Sep 2011 17:48:50 +0000 (13:48 -0400)]
PR12221: Added Test Cases
Test:
1. Compiles a simple binary
2. Sets timestamp to a known value
3. Compiles a stap module probing this binary
4. Compiles a similar binary, same size, name, path etc
but different contents
5. Sets the timestamp to the same as the previous one
6. Compiles another stap module probing this new binary.
Results:
Before the build ID was added to the hash, this sequence
would cause stap to fetch the module from the cache, but
now, it will compile a new one, since the build IDs are
different.
Dave Brolley [Tue, 13 Sep 2011 15:07:11 +0000 (11:07 -0400)]
RHBZ 737095: Unable to start a systemtap server
- Don't use getlogin to obtain user name because it can fail.
- Establish server log before issuing any messages.
- Failure of avahi to advertise is now only a warning. Avahi is not
always available and the server can still be used directly.
* dwflpp.cxx (dwflpp::blacklisted_p): Skip blacklist_section
processing for modules, since we can (sometimes) probe their
.init / .exit sections now.
* runtime/staprun/staprun.c (send_relocation_modules): Hey, we
only said "sometimes". Preexisting modules lie in /sys/module/...
about having their init stuff still in memory. Skip those.
During the i18n conversion, we ended up with several instances of 0x%#
PRIx64 formatting directives, which duplicates the 0x. This patch
zaps those throughout.
Previously, guru mode override for the blacklist only applied to the
file/function blacklist. With this rework, all blacklists may be
bypassed in guru mode.
Mark Wielaard [Fri, 9 Sep 2011 21:28:00 +0000 (23:28 +0200)]
Revert "Remove CONFIG_UTRACE check in pass 2 (dwarfbuilder)."
This reverts commit 2fd2c46ca19c8d995d2376ab8ca1d3e62fb6f43e.
<jistone> tsk tsk, mjw is making a liar out of pass-2 / -l
The issue is that pass-2 does not just list the probes,
but also selects which optional probes might trigger.
Mark Wielaard [Fri, 9 Sep 2011 11:46:45 +0000 (13:46 +0200)]
Fix systemtap.examples/process/syscalltimes script and add test.
stap was a little too smart for the script, optimizing out unused
variables and producing WARNINGS/ERRORS for deleted variables.
Make all variable manipulation conditional on their actual usage,
add -w to surpress warnings, add a new option -c 'process' to run
during script invocation and add a meta testcase for the testsuite.
Mark Wielaard [Fri, 9 Sep 2011 07:05:09 +0000 (09:05 +0200)]
Remove CONFIG_UTRACE check in pass 2 (dwarfbuilder).
pass 4 (buildrun) already checks for CONFIG_UTRACE, so remove it from
pass 2 (dwarfbuilder) so scripts containing process() probes can at least
be semantically checked and inspected with stap -l on arches that don't
have utrace yet.
Mark Wielaard [Thu, 8 Sep 2011 15:22:25 +0000 (17:22 +0200)]
Remove commented out and outdated (confusing embedded C) example from SBG.
Just remove so there are no false positives while looking for dangerous
embedded C snippets. The actual example just includes the thread-times.stp
file which is fine.
Chris Meek [Thu, 8 Sep 2011 12:09:51 +0000 (08:09 -0400)]
PR12221: Added the build ids to the script's hash
hash.cxx
Added the build IDs from the session variables's build_ids
vector to the script's hash.
session.h
Added the build_ids vector to the session.
setupdwfl.cxx
Extracted the build IDs in setup_dwfl_kernel and
setup_dwfl_user and added them to the build_ids vector.
Also, rearranged the code for downloading the debuginfo
to facilitate this patch.
Mark Wielaard [Thu, 8 Sep 2011 11:57:21 +0000 (13:57 +0200)]
Rename CONTEXT regflags to probe_flags. Now simply indicates user mode.
Renamed common_probe_context.h regflags to probe_flags, rename constant
from _STP_REGS_USER_FLAG to _STP_PROBE_STATE_USER_MODE and use throughout
tapsets to check whether in user_mode() or not.
I believe this because three variables, arr_struct, primary_colors_var, incomplete_struct_type, has been changed to conditional defined in systemtap.base/sdt_types.c:
Dave Brolley [Tue, 6 Sep 2011 19:48:29 +0000 (15:48 -0400)]
PR11441 - unprivileged mode test suite enhancements.
- Created a script which identifies all embedded C code in our tapset
sources.
- Tests to ensure that calls to each function containing embedded C are
accepted/rejected for unprivileged users, as appropriate.
Mark Wielaard [Mon, 5 Sep 2011 21:37:11 +0000 (23:37 +0200)]
PR13112 (and PR13108) blacklist probing function from include/asm .h files.
dwflpp.cxx (build_blacklist): all include/asm .h blfile patterns might
need "full path" so prefix those with '.*'
Add new XFAIL semok.exp inb_blacklisted.stp testcase.
PR6503: introduce systemtap_module_refresh() entry point
This new function in the generated code is to get all active probe
point families to reevaluate applicability, to retry inserting probes
that may have failed during systemtap_module_init (e.g., due to
modules being offline), or disarm/remove probes that are no longer
applicable (e.g. due to modules having gone offline). The default
implementation is empty.
* runtime/transport/symbols.c (_stp_module_notifier): A hack worthy of
Alan Smithee himself, supply a disappointing subset of
module-section-address data tuples as modules come and go.
Frank Ch. Eigler [Wed, 31 Aug 2011 17:42:17 +0000 (13:42 -0400)]
PR6503: add module notifier
* runtime/transport/symbols.c (_stp_module_notifier): New function.
Do nothing.
* runtime/transport/transport.c (_stp_handle_start): Register it.
(_stp_cleanup_and_exit): Unregister it.
Frank Ch. Eigler [Wed, 31 Aug 2011 17:04:27 +0000 (13:04 -0400)]
runtime: remove probe_start/_exit() intermediary
These functions were unnecessary; the runtime can call to the
translator-generated systemtap_module_init|exit throughout.
Documentation and comment changes dominate this patch.
Frank Ch. Eigler [Wed, 31 Aug 2011 15:52:29 +0000 (11:52 -0400)]
PR6503 part 1: separate out _stp_kmodule_update_address
* runtime/sym.c (_stp_kmodule_update_address): New function, body
pulled from river at ...
* runtime/transport/symbols.c (_stp_do_relocation): Chop into two bits.
Auto-discovered dependencies are fine when building on the system the
package will be used on; but for distributions such as Gentoo or for
cross-compilation, they only cause headaches if they are not configurable.
By adding two simple ./configure options, the problem is solved.
Checking for directories directly on the /usr disallows building against a
locally-installed NSS or Avahi, and makes cross-compilation difficult.
By using pkg-config, it's easy to override the results, which allow
building against non-system libraries as well as properly identifying
cross-compiled libraries.
Chris Meek [Tue, 30 Aug 2011 13:42:28 +0000 (09:42 -0400)]
PR12773 cont'd: Added Kernel Debuginfo Support
NOTE: Due to BZ733690, abrt cannot download the kernel-debuginfo.
As soon as that bug is fixed, this feature should work.
setupdwfl.cxx
- Added get_kernel_build_id_from_notes()
- This is used to extract the build ID hex string
from /sys/kernel/notes
- Added download_kernel_debuginfo(systemtap_session &s)
- This attempts to extract the build ID hex string
from /lib/modules/<release>/build/vmlinux.id and
if it fails, it calls the above function. It then
calls abrt to attempt to download the associated
debuginfo.
setupdwfl.cxx
Added function declarations for the above.
Frank Ch. Eigler [Thu, 25 Aug 2011 21:21:22 +0000 (17:21 -0400)]
PR13057 related, remove process.**.return.maxactive(N) probe type
The .maxactive stuff is strictly for kretprobes, so should not be
present in process (uprobes) probes. Use the existing
bind_unprivileged_p flag as a proxy for whether we're dealing with
kernel vs. process probe point hierarchy.
* tapsets.cxx (dwarf_derived_probe::register_*_variants): Make
bind_unprivileged_p an explicit (non-defaulted) argument.
Update callers.
(register_function_variants): Skip TOK_MAXACTIVE variant for process
probes.
Dave Brolley [Thu, 25 Aug 2011 16:14:10 +0000 (12:14 -0400)]
PR 11441 - continue with unprivileged test suite
- New unprivileged_all.exp replaces previously existing unprivileged
mode test suites.
- Tests all known probe point types for expected success/failure for
unprivileged users.
- Checks the above directly and also using an alias.
- Checks that all known probe point types have been tested (uses
--dump-probe-types).
Dave Brolley [Thu, 25 Aug 2011 16:10:59 +0000 (12:10 -0400)]
PR 13057 Provide a Command Line Option to Dump Supported Probe Points
New command line option, --dump-probe-types, has been added. If
--unprivilged is also specified, the dump will be limited to
probe types available to unprivileged users.
David Smith [Thu, 18 Aug 2011 18:34:01 +0000 (13:34 -0500)]
Fixed PR13055 by getting procfs probes working on 3.1 kernels.
* runtime/procfs.c (_stp_rmdir_proc_module): Fix problem where
'/proc/systemtap' wasn't getting removed correctly.
(_stp_mkdir_proc_module): Add support for kernels where neither
path_lookup() or kern_path_parent() are exported (such as the 3.1
kernels).
* buildrun.cxx (compile_pass): Convert compile test for kern_path_parent()
to an export test. Add exports tests for path_lookup() and
vfs_path_lookup().
* runtime/autoconf-kern-path-parent.c: Removed.
Josh Stone [Wed, 17 Aug 2011 21:46:45 +0000 (14:46 -0700)]
PR13078: Support stap --remote unix:/path sockets
* remote.cxx (unix_stapsh): New, connects to an AF_UNIX socket.
(stapsh::get_reply): Deal with possible stapsh stderr chatter.
(stapsh::handle_poll): Rework to handle some corner cases better,
like having the same fd for in and out.
* testsuite/systemtap.base/stapsh-unix.exp: New test using socat.
* testsuite/systemtap.base/stapsh-unix.stp: New test.
Lukas Berk [Wed, 17 Aug 2011 20:36:04 +0000 (16:36 -0400)]
Initialize POD members that were previously uninitialized
* coveragedb.h: initialize type in coverage_element
* csclient.h: initialize argc in compile_server_client
* dwflpp.cxx: initialize blacklist_func, blacklist_func_ret,
and blacklist_file in dwflpp
* dwflpp.h: initialize entrypc in func_info
* elaborate.cxx: initialize num_newly_resolved, num_still_unresolved,
assert_resolvability and t in typeresolution_info
* session.cxx: initialize automatic_server_mode in systemtap_session
* staptree.cxx: initialize privileged in probe, tok in component,
and epilogue_style in probe_alias
* staptree.h: initialize num_index and expr_index in component
* tapset-utrace.cxx: initialize has_library in derived_probe
* tapsets.cxx: initialize has_process and has_library in
dwarf_derived_probe, has_library in base_query,
has_relative, relative_val, choose_next_line, and
entrypc_for_next_line in dwarf_query, op in
var_expanding_visitor and probe_type, probe_loc,
probe_scn_offset, probe_scn_addr, arg_count, base,
and semaphore in sdt_query
* translate.cxx: initialize action_counter and
probe_or_function_needs_deref_fault_handler in
c_unparser