]> sourceware.org Git - systemtap.git/log
systemtap.git
6 years agosession.cxx: bump supported kernel version latest to 4.15.3
Frank Ch. Eigler [Fri, 23 Feb 2018 17:58:22 +0000 (12:58 -0500)]
session.cxx: bump supported kernel version latest to 4.15.3

6 years agoFix a web server memory leak.
David Smith [Thu, 22 Feb 2018 22:45:49 +0000 (16:45 -0600)]
Fix a web server memory leak.

* httpd/nss_funcs.cxx (nss_get_server_cert_info): Fix memory leak causing
  SEC_ERROR_BUSY when shutting down.

6 years agodwflpp::function_entrypc if entry or low pc isn't given use base or start.
Mark Wielaard [Thu, 22 Feb 2018 09:54:36 +0000 (10:54 +0100)]
dwflpp::function_entrypc if entry or low pc isn't given use base or start.

On Fedora rawhide a kernel compiled with GCC8 sometimes has subprograms
without an entry or low pc attribute, but with a ranges attribute. In that
case assume the base address or first start address of the range is the
entry pc to set a probe on.

6 years agoRemove %clean section
Igor Gnatenko [Wed, 14 Feb 2018 08:07:51 +0000 (09:07 +0100)]
Remove %clean section

None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
6 years agoRemove BuildRoot definition
Igor Gnatenko [Tue, 13 Feb 2018 23:42:22 +0000 (00:42 +0100)]
Remove BuildRoot definition

None of currently supported distributions need that.
It was needed last for EL5 which is EOL now

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
6 years agoEscape macros in %changelog
Igor Gnatenko [Fri, 9 Feb 2018 08:06:23 +0000 (09:06 +0100)]
Escape macros in %changelog

Reference: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/Y2ZUKK2B7T2IKXPMODNF6HB2O5T5TS6H/
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
6 years agoFix very old Requires
Igor Gnatenko [Wed, 7 Feb 2018 16:44:25 +0000 (17:44 +0100)]
Fix very old Requires

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
6 years agoMake a few small changes to handle Fedora's switch to python 3 as default.
David Smith [Wed, 21 Feb 2018 22:09:18 +0000 (16:09 -0600)]
Make a few small changes to handle Fedora's switch to python 3 as default.

* configure.ac: Prefer 'python2' over 'python' for the python2
  executable.
* configure: Regenerated.
* httpd/backends.cxx (generate_module): Be sure which version of python
  we're calling.
* httpd/docker/stap_build_docker_image.py: Remove python shebang line
  since httpd/backends.cxx knows the right version of python to call.
* httpd/docker/fedora_install_package.py: Add comment about why using
  '/usr/bin/python' is OK.

6 years agoFix the netdev.ioctl probe point for rawhide kernels.
David Smith [Wed, 21 Feb 2018 21:18:26 +0000 (15:18 -0600)]
Fix the netdev.ioctl probe point for rawhide kernels.

* tapset/linux/networking.stp: Fix the netdev.ioctl probe alias for the
  4.16.0-0.rc1.git4.1.fc28.x86_64 kernel.

6 years agosystemtap.spec: Update Python 2 dependency declarations to new packaging standards
Iryna Shcherbina [Wed, 21 Feb 2018 19:15:45 +0000 (14:15 -0500)]
systemtap.spec: Update Python 2 dependency declarations to new packaging standards

6 years agoman error::pass5 - mention stap -t
Frank Ch. Eigler [Sat, 17 Feb 2018 21:46:06 +0000 (16:46 -0500)]
man error::pass5 - mention stap -t

6 years agoAdd undefine __brp_mangle_shebangs
Stan Cox [Wed, 14 Feb 2018 22:35:03 +0000 (17:35 -0500)]
Add undefine __brp_mangle_shebangs

6 years agoAdded strncpy()/strncat() code correctness fixes.
David Smith [Wed, 14 Feb 2018 17:11:55 +0000 (11:11 -0600)]
Added strncpy()/strncat() code correctness fixes.

* doc/SystemTap_Tapset_Reference/docproc.c: gcc version 8 (on rawhide)
  rightly complains that the following code is wrong:
char buf[PATH_MAX];
strncpy(buf, foo, PATH_MAX);
  The code should be:
strncpy(buf, foo, PATH_MAX - 1);
  Note that a similar problem occurs with strncat(). Fix these errors by
  either subtracing one from the buffer length or switching to strlcpy()
  instead of strncpy().
* runtime/task_finder_vma.c: Ditto.
* staplog.c: Ditto.
* staprun/ctl.c: Ditto.
* staprun/staprun.c: Ditto.
* stapvirt.c: Ditto.
* tapset/linux/ip.stp: Ditto.
* tapset/tokenize.stp: Ditto.
* tapset/uconversions.stp: Ditto.
* testsuite/buildok/cmdline01.stp: Ditto.
* testsuite/buildok/two.stp: Ditto.
* testsuite/systemtap.syscall/bind.c: Ditto.
* testsuite/systemtap.syscall/nfsservctl.c: Ditto.

6 years agoAdd a couple of http client/server json-c 0.13 fixes.
David Smith [Wed, 14 Feb 2018 15:20:53 +0000 (09:20 -0600)]
Add a couple of http client/server json-c 0.13 fixes.

* client-http.cxx (unpack_response): Add a json-c 0.13 (from rawhide) fix.
* httpd/server.cxx (get_key_values): Ditto.

6 years agoFixes for gcc 8
Stan Cox [Wed, 14 Feb 2018 03:38:03 +0000 (22:38 -0500)]
Fixes for gcc 8

* includes/sys/sdt.h (__SDT_COND_SIGNED):  Add CT, cast type argument

Author: Will Cohen <wcohen.redhat.com>

* stap-serverd.cxx (generate_mok, handleRequest, handle_connection):
  Catch format overflow

* translate.cxx (translate_pass): Use ref in catch.

6 years agoFix an server error message with odd spacing.
David Smith [Tue, 13 Feb 2018 22:58:01 +0000 (16:58 -0600)]
Fix an server error message with odd spacing.

* nss-server-info.cxx (add_server_trust): Make sure we don't output an
  extra space in an error message.

6 years agoMake sure the user who starts the http server trusts it as an SSL peer.
David Smith [Tue, 13 Feb 2018 19:26:59 +0000 (13:26 -0600)]
Make sure the user who starts the http server trusts it as an SSL peer.

* httpd/nss_funcs.cxx (nss_init): Make sure the server certificate is
  automatically trusted by the user starting the server.

6 years agoMove the code getting a certificate from a server into each backend.
David Smith [Tue, 13 Feb 2018 19:24:19 +0000 (13:24 -0600)]
Move the code getting a certificate from a server into each backend.

* nss-server-info.cxx (add_server_trust): Instead of calling the NSS
  client-specific client_connect() function, call
  backend->trust_server_info(). This allows different clients to implement
  getting the server certificate differently.
* csclient.h (client_backend): Add client_backend::trust_server_info()
  virtual function declaration.
* client-nss.cxx (client_connect): Make static.
  (nss_client_backend::trust_server_info): New function that just calls
  client_connect().
* client-nss.h: Add nss_client_backend::trust_server_info() declaration
  and remove client_connect() declaration.
* client-http.h: Add http_client_backend::client_backend() declaration.
* client-http.cxx (trust_server_info): New stub function.

6 years agoFix finding compatible servers (broken in last commit).
David Smith [Tue, 13 Feb 2018 19:03:03 +0000 (13:03 -0600)]
Fix finding compatible servers (broken in last commit).

* nss-server-info.cxx (nss_get_or_keep_compatible_server_info): Fix
  discarding compatible server check broken in commit eb3896e.

6 years agoAdd comment to the testsuite's 'setup_server' function.
David Smith [Mon, 12 Feb 2018 20:10:29 +0000 (14:10 -0600)]
Add comment to the testsuite's 'setup_server' function.

* testsuite/lib/systemtap.exp (setup_server): Add note explaining why/how
  the server is immediately trusted as an SSL peer.

6 years agoman stap.1: give examples of stap -l / -L options
Frank Ch. Eigler [Fri, 9 Feb 2018 12:39:49 +0000 (07:39 -0500)]
man stap.1: give examples of stap -l / -L options

6 years agobpf translator: improve interference check during reg alloc
Aaron Merey [Thu, 8 Feb 2018 19:23:56 +0000 (14:23 -0500)]
bpf translator: improve interference check during reg alloc

* bpf-opt.cxx (reg_alloc): when merging temporary registers a and b,
  add checks for interference between temporaries that have already
  merged with either a or b.

* bpf_tests/reg_alloc3.stp: tests this fix.

6 years agoAdd the capability to list http servers.
David Smith [Thu, 8 Feb 2018 18:45:13 +0000 (12:45 -0600)]
Add the capability to list http servers.

* client-http.cxx (fill_in_server_info): New function.
* client-http.h (client_backend): Added 'fill_in_server_info' prototype.
* client-nss.h (client_backend): Added 'fill_in_server_info' stub.
* csclient.cxx (nss_get_client_backend): New function.
  (compile_server_client::passes_0_4): Calls new 'nss_get_client_backend'
  function.
* csclient.h: Added client_backend::fill_in_server_info() virtual
  function and 'nss_get_client_backend' prototype.
* httpd/Makefile.am (stap_httpd_SOURCES): Now includes ../cscommon.cxx.
* httpd/Makefile.in: Regenerated.
* httpd/nss_funcs.cxx (nss_get_server_cert_info): New function.
* httpd/nss_funcs.h: Added 'nss_get_server_cert_info' prototype.
* httpd/server.cxx (base_dir_rh::GET): When a GET is done on the server
  root directory, the server architecture and certificate info is
  returned.
* nss-server-info.cxx (compile_server_info::host_specification): New
  function.
  (query_server_status): Add support for http servers.
  (nss_get_specified_server_info): Ditto.
  (nss_get_or_keep_compatible_server_info): A server can be compatible if
  the architectures match.
  (nss_add_online_server_info): New function.
* nss-server-info.h: Added compile_server_info::host_specification() and
  nss_add_online_server_info() prototypes.

6 years agoMove NSS server info to its own file for reuse by the http server code.
David Smith [Fri, 2 Feb 2018 16:26:42 +0000 (10:26 -0600)]
Move NSS server info to its own file for reuse by the http server code.

* client-nss.cxx: Moved server info code to nss-server-info.cxx.
* client-nss.h: Ditto.
* nss-server-info.cxx: New file.
* nss-server-info.h: New file.
* Makefile.am (stap_SOURCES): Added new nss-server-info.cxx file.
* Makefile.in: Regenerated.

6 years agodtrace: accept "char const" via pyparsing
Stefan Hajnoczi [Thu, 1 Feb 2018 16:24:04 +0000 (11:24 -0500)]
dtrace: accept "char const" via pyparsing

The widely used "const char" declaration specifier can also be written
as "char const".  While this form is rarely used, currently produces the
following warning from dtrace(1):

  Warning: /usr/bin/dtrace:myapp.dtrace:66: syntax error near:
    probe probe1

  Warning: Proceeding as if --no-pyparsing was given.

This patch extends the pyparsing grammar to accept "char const" as
defined by ISO/IEC 9899:1999 ("C99").  Now "const char", "char const",
and even "const char const" are accepted without a noisy warning.

Note that "const char const" is also valid C and described by the
standard:

  6.7.3 Type qualifiers
    4  If the same qualifier appears more than once in the same
         specifier-qualifier-list, either directly or via one or more
              typedefs, the behavior is the same as if it appeared only once.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agoFix @cast translation for stapbpf tracepoint probes
Aaron Merey [Tue, 30 Jan 2018 22:55:22 +0000 (17:55 -0500)]
Fix @cast translation for stapbpf tracepoint probes

* tapsets.cxx (synthetic_embedded_deref_call): remove an unnecessary
  condition from an if statement.

  (dwarf_cast_query::handle_query_module): if the current expression
  includes a bpf_context_vardecl, call location_context::adapt_pointer_to_bpf

  (tracepoint_var_expanding_visitor::visit_target_symbol_arg): use a
  bpf_context_vardecl even if the arg has no components.

* bpf_tests/cast_op_tracepoint.stp: tests whether a tracepoint probe
  containing @cast compiles and runs.

* bpf_tests/tracepoint1.stp: removed unused globals.

6 years agoBZ1527809 - Fix detaching from modules using SIGQUIT.
David Smith [Fri, 26 Jan 2018 15:24:51 +0000 (09:24 -0600)]
BZ1527809 - Fix detaching from modules using SIGQUIT.

* staprun/mainloop.c: Put a "/* NOTREACHED */" comment after all calls to
  cleanup_and_exit() to remind the reader that cleanup_and_exit() doesn't
  return.
  (stp_main_loop): If we've got a pending interrupt,
  but 'load_only' is set, just detach instead of sending STP_EXIT to
  the module. Otherwise using SIGQUIT to detach fails and unloads the
  module.
* staprun/monitor.c: Put a "/* NOTREACHED */" comment after all calls to
  cleanup_and_exit() to remind the reader that cleanup_and_exit() doesn't
  return.
* testsuite/systemtap.base/attach_detach.exp: New test.

6 years agostapbpf: Add tracepoint probe support.
Aaron Merey [Fri, 26 Jan 2018 00:48:35 +0000 (19:48 -0500)]
stapbpf: Add tracepoint probe support.

* bpf-translate.cxx (bpf_unparser::emit_context_var): Similar to
  bpf_unparser::visit_target_deref, but the size and offset info needed
  to read from the context is present in this function's argument instead
  of being computed during probe execution.

* dwflpp.h (iterate_over_globals): access modifier changed from private
  to public. Needed for reading debuginfo from tracequery modules.

* staptree.h (struct bpf_context_vardecl): specialized vardecl
  that includes size, offset and is_signed members needed for
  bpf_unparser::emit_context_var.

* loc2stap.cxx (location_context::adapt_pointer_to_bpf): replaces the
  location_context's pointer with a bpf_context_vardecl *.

* stapbpf.cxx: Add support for reading tracepoint probes from the
  BPF-ELF file and registering/unregistering tracepoint probes.

* tapsets.cxx: Adapt the tracepoint probe derivation process
  to --runtime=bpf.

  (get_tracequery_modules): Instantiate structs in the tracequery
  modules whose members are the tracepoint's $context variables.

  (tracepoint_query_type, handle_query_type): Iterate over the
  module's debuginfo looking for the Dwarf_Dies of the tracepoint
  arg structs.

  (build_args_for_bpf): Create tracepoint_arg's from the struct dies

  (is_signed_type, get_byte_size): helpers for build_args_for_bpf.

6 years agoAdded a logfile option to the web server.
David Smith [Tue, 23 Jan 2018 22:38:05 +0000 (16:38 -0600)]
Added a logfile option to the web server.

* httpd/main.cxx (parse_cmdline): Added a '--log' option to specify a
  logfile.
  (signal_thread): Replaced all logging via clog/cerr with a call to
  server_error().
  (setup_main_signals): Ditto.
  (main): Stop the logging when finished.
* httpd/utils.cxx (server_error): New function.
  (execute_and_capture): Replaced all logging via clog/cerr with a call to
  server_error().
* httpd/utils.h: Added server_error() prototype.
* httpd/api.cxx: Replaced all logging via clog/cerr with a call to
  server_error().
* httpd/backends.cxx: Ditto.
* httpd/nss_funcs.cxx: Ditto.
* httpd/server.cxx: Ditto.

6 years agoconfigure: Require json-c >= 0.11 and full C++11 support for the web service.
David Smith [Tue, 23 Jan 2018 16:49:08 +0000 (10:49 -0600)]
configure: Require json-c >= 0.11 and full C++11 support for the web service.

* configure.ac: Relax the json-c library requirement to version
  0.11+. Require full C++11 support for the httpd web service.
* configure: Regenerated.

6 years agoFix a web service compile problem on RHEL7.
David Smith [Mon, 22 Jan 2018 22:34:29 +0000 (16:34 -0600)]
Fix a web service compile problem on RHEL7.

* httpd/api.h: Add missing <memory> inclusion for shared_ptr.

6 years agoMake the http server send the module signature back to the client.
David Smith [Mon, 22 Jan 2018 17:38:12 +0000 (11:38 -0600)]
Make the http server send the module signature back to the client.

* httpd/api.cxx (result_info): Switch from expecting one file to return to
  handling multiple files.
  (result_info::add_file): New function.
  (result_info::generate_response): Add all output files to the "files"
  section.
  (result_info::generate_file_response): Handle the list of output files.
  (build_info::module_build): If the module signing worked, add the
  signature file to the results.

6 years agoUpdate tapset/mips/registers.stp to assert on a 32-bit kernel when needed.
David Smith [Mon, 22 Jan 2018 17:31:53 +0000 (11:31 -0600)]
Update tapset/mips/registers.stp to assert on a 32-bit kernel when needed.

* tapset/mips/registers.stp: Assert if we try to access any argument > 4
  on a 32-bit mips system. Code is needed to grab arguments off the stack.

6 years agoUpdate the systemtap.server/client.exp test to use a mount namespace.
David Smith [Fri, 19 Jan 2018 14:24:44 +0000 (08:24 -0600)]
Update the systemtap.server/client.exp test to use a mount namespace.

* testsuite/systemtap.server/client.exp: Use a custom mount namespace to
  test signed modules.
* testsuite/systemtap.server/server_privilege.exp: Remove unneeded call to
  'systemtap_check_users'.

6 years agoAdd a new server test that runs modules.
David Smith [Thu, 18 Jan 2018 20:12:22 +0000 (14:12 -0600)]
Add a new server test that runs modules.

* testsuite/systemtap.server/server_privilege.exp: New test that tests
  modules built by the compile server.
* testsuite/lib/server_ns.exp: New file.
* testsuite/lib/systemtap.exp (systemtap_check_users): New function.
  (setup_systemtap_environment): Call systemtap_check_users.
  (shutdown_server): Call server_ns_cleanup.
* testsuite/config/unix.exp: Add server_ns.exp.
* testsuite/Makefile.am: Pass the SYSCONFDIR down to the tests.
* testsuite/Makefile.in: Regenerated.
* systemtap.spec: Create the 'stapusr', 'stapsys', and 'stapdev' users for
  the testsuite.

6 years agoEnable python3 support in RHEL > 7.
David Smith [Mon, 15 Jan 2018 17:08:39 +0000 (11:08 -0600)]
Enable python3 support in RHEL > 7.

* systemtap.spec: Expect python3 to exist in RHEL > 7 (according to a
  message on fedora-devel entitled "Python3 will be in next major RHEL
  release, please adjust %if statements accordingly" on Jan. 11, 2018).

6 years agoFix BZ1525651 by making the task_finder shutdown more robust.
David Smith [Mon, 15 Jan 2018 16:23:45 +0000 (10:23 -0600)]
Fix BZ1525651 by making the task_finder shutdown more robust.

* runtime/linux/task_finder.c (__stap_utrace_detach): New function, based
  on stap_utrace_detach(), but lets the caller know if any the task had
  the utrace engine attached to it.
  (stap_utrace_detach): Just call __stap_utrace_detach().
  (stap_utrace_detach_ops): Perform the detaching in a loop, so if the
  process list snapshot we operate on becomes out of date, we'll still
  detach everything.
  (__stp_utrace_task_finder_report_clone): Move the
  __stp_tf_handler_start() call to the very start of the function.
  (__stp_utrace_task_finder_report_exec): Ditto.
  (__stp_utrace_task_finder_target_exec): Ditto.
  (__stp_utrace_task_finder_target_exit): Ditto.
  (__stp_utrace_task_finder_target_quiesce): Ditto.
  (__stp_utrace_task_finder_target_syscall_entry): Ditto.
  (__stp_utrace_task_finder_target_syscall_exit): Ditto.

6 years agoFix PR22695 by reverting a python subdirectory's Makefile.am.
David Smith [Thu, 11 Jan 2018 20:42:57 +0000 (14:42 -0600)]
Fix PR22695 by reverting a python subdirectory's Makefile.am.

* python/Makefile.am: Revert last change by removing DESTDIR to
  pkglibexecpythondir, which broke rpm builds.
* python/Makefile.in: Regenerated.

6 years agoAdd the beginnings of module signing to the web server.
David Smith [Mon, 8 Jan 2018 17:28:25 +0000 (11:28 -0600)]
Add the beginnings of module signing to the web server.

* httpd/main.cxx (parse_cmdline): Add the new '--ssl' argument.
  (main): Initialize NSS before starting the server and shut it down
  afterwards.
* httpd/api.cxx (parse_cmd_args): Look for the '--privilege' and
  '--unprivileged' arguments.
  (module_build): Sign the module if needed.
* httpd/api.h (client_request_data): Add the 'privilege' member.
* httpd/server.h (server): Add new member variable 'cert_db_path' and
  function get_cert_db_path().
* httpd/server.cxx (server::server): Take the 'cert_db_path' in the
  initializer.
* httpd/nss_funcs.cxx: New file.
* httpd/nss_funcs.h: Ditto.
* httpd/Makefile.am: Add the NSS library flags and libraries. Add
  nss_funcs.cxx, ../nsscommon.cxx, and ../privilege.cxx to the list of
  sources.
* httpd/Makefile.in: Regenerated.
* configure.ac: Make the NSS libraries a requirement for the web server.
* configure: Regenerated.

6 years agoAdd a port option to the web server.
David Smith [Thu, 4 Jan 2018 21:28:47 +0000 (15:28 -0600)]
Add a port option to the web server.

* httpd/main.cxx (parse_cmdline): New function.
  (main): Call parse_cmdline() to handle the the new '--port' option.

6 years agoPerform some docker-related cleanup in the web service.
David Smith [Wed, 20 Dec 2017 22:12:25 +0000 (16:12 -0600)]
Perform some docker-related cleanup in the web service.

* httpd/backends.cxx (docker_backend::generate_module): Remove selected
  docker images and containers.

6 years agostapref.1: explain 'next' and 'return' - in \fIitalics\fP
Frank Ch. Eigler [Wed, 20 Dec 2017 19:37:53 +0000 (14:37 -0500)]
stapref.1: explain 'next' and 'return' - in \fIitalics\fP

6 years agoAdd a small fix to execute_and_capture().
David Smith [Tue, 19 Dec 2017 22:03:57 +0000 (16:03 -0600)]
Add a small fix to execute_and_capture().

* httpd/utils.cxx (execute_and_capture): Add the O_APPEND flag to 'open'
  actions, so that the 2nd and following commands output gets captured.

6 years agoRenamed httpd/docker/stap_build_docker_container.py.
David Smith [Tue, 19 Dec 2017 22:02:28 +0000 (16:02 -0600)]
Renamed httpd/docker/stap_build_docker_container.py.

* httpd/docker/stap_build_docker_container.py: Renamed to
  'stap_build_docker_image.py'.
* httpd/backends.cxx: Ditto.
* httpd/docker/Makefile.am: Ditto.
* httpd/docker/Makefile.in: Regenerated.

6 years agoCopy user files into the docker container image.
David Smith [Tue, 19 Dec 2017 21:50:53 +0000 (15:50 -0600)]
Copy user files into the docker container image.

* httpd/backends.cxx (docker_backend::generate_module): Copy any user
  files into the container image before running stap.

6 years agostap-prep: check_error tweaks
Frank Ch. Eigler [Mon, 18 Dec 2017 01:20:43 +0000 (20:20 -0500)]
stap-prep: check_error tweaks

Use printf(1), so that \-codes like \n are expanded properly.  Add
advice to "# yum erase kernel-debuginfo" in case a debuginfo-install
results in conflicting /usr/lib/debug/.build-id/XX/YYYY files.

6 years agoMove repeated web server code to a new function, execute_and_capture().
David Smith [Fri, 15 Dec 2017 19:38:36 +0000 (13:38 -0600)]
Move repeated web server code to a new function, execute_and_capture().

* httpd/backends.cxx (local_backend::generate_module): Call
  execute_and_capture to do all the work.
  (docker_backend::generate_module): Ditto.
* httpd/utils.cxx (execute_and_capture): New function.
* httpd/utils.h: Added execute_and_capture() declaration.

6 years agoMove get_uuid() to utils.cxx.
David Smith [Fri, 15 Dec 2017 18:06:58 +0000 (12:06 -0600)]
Move get_uuid() to utils.cxx.

* httpd/utils.cxx: New file.
* httpd/utils.h: Ditto.
* httpd/api.h: Move get_uuid() declaration to utils.h.
* httpd/api.cxx: Move get_uuid() to utils.cxx. Include utils.h
* httpd/backends.cxx: Include utils.h.
* httpd/Makefile.am: Add utils.cxx.
* httpd/Makefile.in: Regenerated.

6 years agoRename and rework get_uuid_representation().
David Smith [Fri, 15 Dec 2017 16:37:55 +0000 (10:37 -0600)]
Rename and rework get_uuid_representation().

* httpd/api.cxx (get_uuid): Renamed and reworked from
  get_uuid_representation().
* httpd/api.h: Renamed get_uuid() representation.
* httpd/backends.cxx (generate_module): Call the new get_uuid().

6 years agoMade 'pylint' suggested changes to stap_build_docker_container.py.
David Smith [Thu, 14 Dec 2017 21:53:54 +0000 (15:53 -0600)]
Made 'pylint' suggested changes to stap_build_docker_container.py.

* httpd/docker/stap_build_docker_container.py: Made several small changes
  to make 'pylint' happy.

6 years agoPerform better build id validation in fedora_install_package.py.
David Smith [Thu, 14 Dec 2017 17:24:12 +0000 (11:24 -0600)]
Perform better build id validation in fedora_install_package.py.

* httpd/docker/fedora_install_package.py: Perform better build id
  validation. Move clean up function into the class.

6 years agoPerform clean up in fedora_install_package.py.
David Smith [Thu, 14 Dec 2017 16:38:58 +0000 (10:38 -0600)]
Perform clean up in fedora_install_package.py.

* httpd/docker/fedora_install_package.py: Clean up downloaded package
  directory.

6 years agoMade 'pylint' suggested changes to fedora_install_package.py.
David Smith [Thu, 14 Dec 2017 15:38:52 +0000 (09:38 -0600)]
Made 'pylint' suggested changes to fedora_install_package.py.

* httpd/docker/fedora_install_package.py: Made several small changes to
  make 'pylint' happy.

6 years agoUpdate the web service fedora package installer to use packages from koji.
David Smith [Wed, 13 Dec 2017 19:07:34 +0000 (13:07 -0600)]
Update the web service fedora package installer to use packages from koji.

* httpd/docker/fedora_install_package.py: Add support from downloading
  packages from koji, the fedora build system.
* httpd/docker/fedora.json: Add 'wget' and 'createrepo_c' to the base list
  of packages to be installed.

6 years agoBPF translator: change map type of internal globals
Aaron Merey [Tue, 12 Dec 2017 23:56:55 +0000 (18:56 -0500)]
BPF translator: change map type of internal globals

* bpf-translate.cxx (build_internal_globals): use BPF_MAP_TYPE_HASH
  instead of BPF_MAP_TYPE_ARRAY. The former supports atomic updates.

* stapbpf.cxx (init_internal_globals): replace BPF_EXIST with BPF_ANY
  since BPF hash maps elements have to be created before attempting
  to update them.

6 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
David Smith [Tue, 12 Dec 2017 19:53:26 +0000 (13:53 -0600)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

6 years agoGrab the stap output from the docker container.
David Smith [Tue, 12 Dec 2017 19:42:59 +0000 (13:42 -0600)]
Grab the stap output from the docker container.

* httpd/backends.cxx (docker_backend::generate_module): Cleanup the
  stdout/stderr capturing logic. Use "docker cp" to copy any results from
  the container image to the server.
* httpd/api.cxx (get_uuid_representation): Make non-static so other code
  can use.
* httpd/api.h: Add get_uuid_representation() declaration.

6 years agoMake consistent use of the term "build_id"
Stan Cox [Tue, 12 Dec 2017 19:26:51 +0000 (14:26 -0500)]
Make consistent use of the term "build_id"

* client-http.cxx (http_client::post):  Use term "build_id"
* httpd/api.cxx (build_collection_rh::POST:  Likewise.
* httpd/server.cxx (get_key_values):  Likewise.

6 years agoAdd another PR22551 fix by updating the use of timers for the 4.13 kernel.
David Smith [Mon, 11 Dec 2017 16:05:50 +0000 (10:05 -0600)]
Add another PR22551 fix by updating the use of timers for the 4.13 kernel.

* runtime/linux/timer_compatibility.h: Update for the
  4.13.16-202.fc26.x86_64 kernel, which has the TIMER_TRACE_FLAGMASK
  define (which we were using to determine the old vs. new timer
  interface).
* tapset-timers.cxx: Ditto.

6 years agoAdd environment variable support to http client/server.
Stan Cox [Thu, 7 Dec 2017 22:09:50 +0000 (17:09 -0500)]
Add environment variable support to http client/server.

* client-http.cxx (trace): Don't display large packets.
  (post):  Package file info as file_info array.  Package env vars as
     env_vars object collection.
* api.h/api.cxx (client_request_data):  Add env_vars
* backends.cxx (*::generate_module):  Handle env_vars
* server.cxx (get_key_values): Handle array of objects and object collection

6 years agoUpdated several tapsets for the 4.15 kernel.
David Smith [Thu, 7 Dec 2017 22:07:39 +0000 (16:07 -0600)]
Updated several tapsets for the 4.15 kernel.

* tapset/linux/linuxmib.stp: Update the 'DelayedACKs' probes to handle
  a missing '$data' parameter.
* tapset/linux/memory.stp: Handle missing '__GFP_COLD' flag.
* tapset/linux/nfsd.stp: Update the 'nfsd.proc4.rename' probe to handle
  upstream changes.
* tapset/linux/signal.stp: Update the 'signal.pending' probe to handle a
  missing '$sigsestsize' parameter.

6 years agoMake builds more reproducible by removing 'DATE' variable references.
Bernhard Wiedemann [Thu, 7 Dec 2017 15:57:40 +0000 (09:57 -0600)]
Make builds more reproducible by removing 'DATE' variable references.

* doc/Tapset_Reference_Guide/manpager.sh: Remove DATE reference.
* man/cs/stappaths.7.in: Ditto.

6 years agoFix PR22551 by updating the use of timers for the 4.15 kernel.
David Smith [Wed, 6 Dec 2017 20:37:42 +0000 (14:37 -0600)]
Fix PR22551 by updating the use of timers for the 4.15 kernel.

* runtime/linux/timer_compatibility.h: New file.
* runtime/time.c: Update timer callback function parameter type. Update
  timer initialization.
* runtime/transport/relay_v2.c: Ditto.
* runtime/transport/transport.c: Ditto.
* tapset-timers.cxx (timer_derived_probe_group::emit_module_decls):
  Ditto. Handle old and new timer callback interface.
* runtime/linux/runtime.h: Include timer_compatibility.h instead of timer.h.
* tapset/linux/scsi.stp: Ditto.

6 years agoMake builds more reproducible by removing unneeded autoconf 'DATE' variable.
Bernhard Wiedemann [Tue, 5 Dec 2017 18:33:16 +0000 (12:33 -0600)]
Make builds more reproducible by removing unneeded autoconf 'DATE' variable.

* configure.ac: Removed unneeded 'DATE' autoconf variable (which breaks
  build reproducibility).
* man/stappaths.7.in: Removed uneeded 'DATE' variable reference.
* Makefile.in: Regenerated.
* config.in: Ditto.
* configure: Ditto.
* doc/Makefile.in: Ditto.
* doc/SystemTap_Tapset_Reference/Makefile.in: Ditto.
* doc/beginners/Makefile.in: Ditto.
* httpd/Makefile.in: Ditto.
* httpd/docker/Makefile.in: Ditto.
* java/Makefile.in: Ditto.
* man/Makefile.in: Ditto.
* man/cs/Makefile.in: Ditto.
* python/Makefile.in: Ditto.
* stapbpf/Makefile.in: Ditto.
* stapdyn/Makefile.in: Ditto.
* staprun/Makefile.in: Ditto.

6 years agostap: Add shorthand option --bpf for --runtime=bpf
Martin Cermak [Fri, 1 Dec 2017 12:43:43 +0000 (13:43 +0100)]
stap: Add shorthand option --bpf for --runtime=bpf

* cmdline.h: Introduce LONG_OPT_RUNTIME_BPF.
* cmdline.cxx: Define --bpf as LONG_OPT_RUNTIME_BPF.
* session.cxx: Set the runtime option, show the feature
  in the --version output, document --bpf.
* man/stap.1.in: Document --bpf.

6 years agoTranslate server distro name to lower case.
Stan Cox [Wed, 29 Nov 2017 21:59:00 +0000 (16:59 -0500)]
Translate server distro name to lower case.

* httpd/backends.cxx local_backend::local_backend():  Translate distro
  name to lower case to match client.

6 years agoSend client http info as a single json form.
Stan Cox [Wed, 29 Nov 2017 16:30:47 +0000 (11:30 -0500)]
Send client http info as a single json form.

* client-http.cxx (http_client::get_data):  Create and send as a single
  json form.

* httpd/server.cxx (get_key_values):  Load key values from json form.

6 years agorhbz1490862: more kernel f2fs tracepoint header file workarounds
David Smith [Tue, 28 Nov 2017 20:35:06 +0000 (15:35 -0500)]
rhbz1490862: more kernel f2fs tracepoint header file workarounds

6 years agoUpdate the Czech version of manpages.
Martin Cermak [Tue, 28 Nov 2017 15:26:04 +0000 (16:26 +0100)]
Update the Czech version of manpages.

6 years agostap -k mode: only generate the .i file for the main lkm, not auxiliary built files
Frank Ch. Eigler [Tue, 28 Nov 2017 01:54:15 +0000 (20:54 -0500)]
stap -k mode: only generate the .i file for the main lkm, not auxiliary built files

* buildrun.cxx (make_make_cmd): Move the .i generation code from here ...
  (compile_pass): ... to here.

Reported-By: Torsten Polle <Torsten.Polle@gmx.de>
6 years agoAdd tracing of sent and received packets.
Stan Cox [Mon, 27 Nov 2017 22:00:13 +0000 (17:00 -0500)]
Add tracing of sent and received packets.

* client-http.cxx (http_client::trace):  New.
  (http_client::download):  Enable.

6 years agoFix stapbpf compile error on older kernels.
Aaron Merey [Wed, 22 Nov 2017 20:38:40 +0000 (15:38 -0500)]
Fix stapbpf compile error on older kernels.

* configure.ac: Check for the necessary declarations in linux/bpf.h instead of
  simply checking that linux/bpf.h exists. This avoids a compile error if
  linux/bpf.h exists but does not contain these declarations (as is the case
  with some older kernels). Replaced HAVE_LINUX_BPF_H with HAVE_BPF_DECLS.

* Makefile.am, stapbpf/Makefile.am, main.cxx: Replaced HAVE_LINUX_BPF_H with
  HAVE_BPF_DECLS.

* rest: changes caused by autoconf, automake and autoheader.

6 years agoActually run the stap command in the docker container.
David Smith [Mon, 20 Nov 2017 21:36:03 +0000 (15:36 -0600)]
Actually run the stap command in the docker container.

* httpd/backends.cxx (docker_backend::generate_module): Actually run the
  stap command in the docker container.
* httpd/docker/fedora_install_package.py: Renamed from
  fedora_install_packages.py. When installing a kernel, automatically
  install the kernel-devel package. Install each package's debuginfo.
* httpd/docker/Makefile.am: Handle fedora_install_package.py rename.
* httpd/docker/fedora.json: Ditto.
* httpd/docker/Makefile.in: Regenerated.

6 years agoFix PR22462 by updating the way we generate the Makefile.
David Smith [Mon, 20 Nov 2017 15:51:40 +0000 (09:51 -0600)]
Fix PR22462 by updating the way we generate the Makefile.

* buildrun.cxx (compile_pass): If the runtime path doesn't have any odd
  characters in it, don't bother quoting it in the generated Makefile.

6 years agostap -L: produce yum/dnf disagnostics if kernel-devel missing
Frank Ch. Eigler [Thu, 16 Nov 2017 22:18:57 +0000 (17:18 -0500)]
stap -L: produce yum/dnf disagnostics if kernel-devel missing

stap listing modes previously suppressed the rpm-finder's suggestions,
if not even kernel-devel was installed, leading to an opaque error
message about .../build/.config not being found.  Reenable warnings in
this case, for if kernel-devel was sought and missing, stap as a whole
will shut down soon anyway.

6 years agoActually commit web server changes.
David Smith [Thu, 16 Nov 2017 20:20:28 +0000 (14:20 -0600)]
Actually commit web server changes.

6 years agoUpdate the docker container builder for the web server.
David Smith [Thu, 16 Nov 2017 20:18:39 +0000 (14:18 -0600)]
Update the docker container builder for the web server.

* httpd/docker/fedora_install_packages.py: New file.
* httpd/docker/fedora.json: Change from stages to a scheme where we've got
  a docker 'header' and 'footer' items. Each package to be installed runs
  the 'install' item.
* httpd/docker/stap_build_docker_container.py: Handle changes to the
  distro JSON file.
* httpd/backends.cxx (docker_backend::docker_backend): Fix the docker
  build script path.
  (docker_backend::generate_module): Update the docker build script
  arguments.
* httpd/api.cxx (build_info::module_build): Pass the UUID down to the
  backends.
* httpd/backends.h (backend_base): Add a 'uuid' parameter to the
  generate_module() function declaration.
* httpd/docker/Makefile.am: Installs the fedora install package script.
* httpd/docker/Makefile.in: Regenerated.

6 years agoImplement http_client_backend::add_localization_variable
Stan Cox [Thu, 16 Nov 2017 20:01:02 +0000 (15:01 -0500)]
Implement http_client_backend::add_localization_variable

* client-http.cxx (http_client_backend::add_localization_variable):
  Add environment variable to vector.
  (http_client::post):  Post to server.

6 years agoAdd a small fix to python/Makefile.am.
David Smith [Thu, 16 Nov 2017 19:23:17 +0000 (13:23 -0600)]
Add a small fix to python/Makefile.am.

* python/Makefile.am: Add DESTDIR to pkglibexecpythondir.
* python/Makefile.in: Regenerated.

6 years agoAdded the initial httpd/docker directory.
David Smith [Tue, 14 Nov 2017 21:39:32 +0000 (15:39 -0600)]
Added the initial httpd/docker directory.

* httpd/docker/stap_build_docker_container.py: Python script that uses
  distro JSON data files to generate docker files.
* httpd/docker/fedora.json: Fedora docker file description.
* httpd/docker/Makefile.am: New file.
* httpd/docker/Makefile.in: Generated.
* httpd/Makefile.am: Added 'docker' subdirectory.
* py-compile: New file (copied from automake).
* configure.ac: Include the httpd/docker directory.
* Makefile.in: Regenerated.
* aclocal.m4: Ditto.
* configure: Ditto.
* doc/Makefile.in: Ditto.
* doc/SystemTap_Tapset_Reference/Makefile.in: Ditto.
* doc/beginners/Makefile.in: Ditto.
* httpd/Makefile.in: Ditto.
* java/Makefile.in: Ditto.
* man/Makefile.in: Ditto.
* man/cs/Makefile.in: Ditto.
* python/Makefile.in: Ditto.
* stapbpf/Makefile.in: Ditto.
* stapdyn/Makefile.in: Ditto.
* staprun/Makefile.in: Ditto.
* testsuite/Makefile.in: Ditto.
* testsuite/aclocal.m4: Ditto.

6 years agoThe web server now writes the client request data to a JSON file.
David Smith [Mon, 13 Nov 2017 22:34:36 +0000 (16:34 -0600)]
The web server now writes the client request data to a JSON file.

* httpd/api.h ("client_request_data"): Made 'struct client_request_data'
  into a class. Added a get_json_object() function declaration.
* httpd/api.cxx: Change the type on all 'client_request_data' variables.
  (response build_collection_rh::POST): Lowercase the distro name to make
  things easier when searching for a distro.
  (client_request_data::get_json_object): New function.
* httpd/backends.h: Change the type on all 'client_request_data'
  variables.
* httpd/backends.cxx: Change the type on all 'client_request_data'
  variables.
  (docker_backend::docker_backend): Lowercase the distro name to make
  things easier when searching for a distro.
  (docker_backend::generate_module): Grab a JSON representation of the
  client_request_data and write it to a file.

6 years agoFix a couple of subtle bugs in the web server POST parameter handling.
David Smith [Fri, 10 Nov 2017 19:46:53 +0000 (13:46 -0600)]
Fix a couple of subtle bugs in the web server POST parameter handling.

* httpd/server.cxx (get_key_values): Expect a 'post_params_t' instead of
  a 'struct request' pointer.
  (connection_info::postdataiterator): Be sure to only use 'size' bytes of
  'data', otherwise you can get junk values.
  (server::access_handler): Pass get_key_values a 'post_params_t' instead
  of a 'struct request' pointer.
* httpd/server.h: Define and use the 'post_params_t' type.

6 years agostapbpf: add perf probe support.
Aaron Merey [Fri, 10 Nov 2017 00:02:27 +0000 (19:02 -0500)]
stapbpf: add perf probe support.

* bpf-translate.cxx: translate perf_derived_probes.

* stapbpf.cxx: parse perf data from ELF file, load associated bpf progs
  and perf events.

* tapset-perfmon.cxx (sort_for_bpf): prepare perf probes and symbol names
  for translation.

* tapsets.h: add declarations for above.

* bpf_tests/: add two perf tests, fix typo in no_end.stp, rename timers.stp
  to timer1.stp, add new timer test.

6 years agoSave the package information on the web server side.
David Smith [Wed, 8 Nov 2017 22:12:09 +0000 (16:12 -0600)]
Save the package information on the web server side.

* httpd/api.cxx (build_collection_rh::POST): Package up the file
  information (name, package name, build id) from the client.
  (build_info::parse_cmd_args): Fix the argument handling. We need to
  add an argument 0 to make getopt_long() happy. Grab the right perpass
  verbosity level as our level.
* httpd/api.h: Add the 'file_info' structure.

6 years agoRework the web client package information to be valid JSON.
David Smith [Wed, 8 Nov 2017 16:41:52 +0000 (10:41 -0600)]
Rework the web client package information to be valid JSON.

* client-http.cxx (http_client::post): Rework the package information to
  be valid JSON. Turn the package information inside out so that instead
  of one array of multiple fields, we'll have multiplie single-dimension
  arrays.

6 years agoMove the web server unzip logic to its proper place.
David Smith [Mon, 6 Nov 2017 15:50:50 +0000 (09:50 -0600)]
Move the web server unzip logic to its proper place.

* httpd/api.cxx (build_collection_rh::POST): Move the unzip logic to
  build_info::module_build().
  (build_info::module_build): Do the unzip here, so that we don't slow
  down the thread handling http requests.

7 years agoThe web server now tries to build a docker container.
David Smith [Fri, 3 Nov 2017 20:06:13 +0000 (15:06 -0500)]
The web server now tries to build a docker container.

* httpd/backends.cxx (local_backend::generate_module): No longer fail if
  the stdout/stderr files already exist.
  (docker_backend::docker_backend): Clear out the docker path if we
  couldn't find the docker executable. Fix choping off the json file
  extension.
  (docker_backend::generate_module): Run the script that builds the
  docker container.
* httpd/api.cxx (parse_cmd_args): New function.
  (module_build): Call parse_cmd_args(). Always create the stdout/stderr
  files, so the client will always have something to grab.
* httpd/api.h (client_request_data): Add 'verbose' field.
* httpd/Makefile.am: Add ../cmdline.cxx to the list of files to be compiled.
* httpd/Makefile.in: Regenerated.

7 years agostapbpf: Call perf_event_open with group_fd.
Aaron Merey [Fri, 3 Nov 2017 18:55:50 +0000 (14:55 -0400)]
stapbpf: Call perf_event_open with group_fd.

* stapbpf.cxx (register_timers): Using group_fd ensures that all
  probes are armed at the same time.

7 years agostapbpf: Add timer probe support.
Aaron Merey [Fri, 3 Nov 2017 18:35:06 +0000 (14:35 -0400)]
stapbpf: Add timer probe support.

* bpf-translate.cxx: translate hrtimer_derived_probes and timer_derived_probes.

* stapbpf.cxx: parse timer data from ELF file, load timer bpf programs and
  open timer perf events.

* tapset-timers.cxx (sort_for_bpf): Organize timer probes and prepare timer
  symbol names for ELF file.

* tapsets.h: Add declarations for above.

* bpf_tests/timers.stp: New test for timer probes.

7 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
David Smith [Wed, 1 Nov 2017 19:57:30 +0000 (14:57 -0500)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

7 years agoAdd comments to httpd/backends.cxx.
David Smith [Wed, 1 Nov 2017 19:57:10 +0000 (14:57 -0500)]
Add comments to httpd/backends.cxx.

7 years agobpf translator: remove unused variable.
Aaron Merey [Tue, 31 Oct 2017 22:41:04 +0000 (18:41 -0400)]
bpf translator: remove unused variable.

7 years agobpf translator: add prologue that checks exit status.
Aaron Merey [Tue, 31 Oct 2017 18:27:33 +0000 (14:27 -0400)]
bpf translator: add prologue that checks exit status.

* bpf-translate.cxx (bpf_unparser::add_prologue): adds instructions that
  checks exit status and immediately returns from probe handler if true.

* exit3.stp: test whether prologue works correctly.

* bpf_tests/: remove manual exit status checks from various tests.

7 years agoNew example: capture_ssl_master_secrets.stp.
Timo Juhani Lindfors [Tue, 31 Oct 2017 18:17:25 +0000 (13:17 -0500)]
New example: capture_ssl_master_secrets.stp.

Tested to work with Debian 9 openssl and gnutls.

7 years agoMatch non-executable shared libraries in glob patterns (author credit fix)
Timo Juhani Lindfors [Mon, 30 Oct 2017 20:56:10 +0000 (16:56 -0400)]
Match non-executable shared libraries in glob patterns (author credit fix)

7 years agoMatch non-executable shared libraries in glob patterns.
David Smith [Mon, 30 Oct 2017 20:39:11 +0000 (15:39 -0500)]
Match non-executable shared libraries in glob patterns.

Shared libraries in Debian do not have executable permissions. This
patch makes glob patterns work for those. Debian policy 8.1:

"Shared libraries should not be installed executable, since the dynamic
linker does not require this and trying to execute a shared library
usually results in a core dump."

7 years agoAdd a small improvement to testsuite/semok/twenty.stp
David Smith [Mon, 30 Oct 2017 20:25:21 +0000 (15:25 -0500)]
Add a small improvement to testsuite/semok/twenty.stp

* testsuite/semok/twenty.stp: Instead of piping stap's output to "wc",
  instead send it to /dev/null. This uses less memory on the system and
  avoids masking the return value of stap (by getting the return value of
  "wc").

7 years agoAdd a small fix to the copy_file() utility function.
David Smith [Mon, 30 Oct 2017 18:28:32 +0000 (13:28 -0500)]
Add a small fix to the copy_file() utility function.

* util.cxx (copy_file): Removed an unnecessary unlink() call.

7 years agoImprove the way the web client/server sends files.
David Smith [Mon, 30 Oct 2017 18:05:18 +0000 (13:05 -0500)]
Improve the way the web client/server sends files.

* client-http.cxx (http_client): Rename the 'script_files' variable to
  'files'.
  (http_client::post): No longer assume the first file is a script.
  (add_file): Renamed from 'add_script_file'. Just add the file.
  (http_client_backend::include_file_or_directory): Rewrite to be like the
  nss client.
  (http_client_backend::package_request): If we've seen some files the
  need to be transferred, package them up into a zip file.
  (add_tapsets): Deleted function.
  (http_client_backend::add_tmpdir_file): Just remember we added a file.
* client-http.h (client_backend): Remove the 'request_files' variable and
  add the 'files_seen' variable.
* httpd/api.cxx (POST): Unzip the client zip file if present.

7 years agoImprove the way a script is read from standard input.
David Smith [Mon, 30 Oct 2017 17:57:07 +0000 (12:57 -0500)]
Improve the way a script is read from standard input.

* main.cxx (passes_0_4): Instead of passing 'cin' to parse(), pass it the
  session 'stdin_script' variable.
* csclient.cxx (create_request): Instead of copying the script from
  standard input, copy it from the session 'stdin_script' variable.
* session.h (s): Add the 'stdin_script' variable.
* session.cxx (systemtap_session): Copy the 'stdin_script' variable in the
  copy constructor.
* testsuite/systemtap.server/server.exp: Add 2 tests for getting a script
  from standard input.

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