]> sourceware.org Git - systemtap.git/log
systemtap.git
6 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").

6 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.

6 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.

6 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.

6 years agoGet the "drm" and "snd_pcm" tracepoint groups working on rawhide.
David Smith [Thu, 26 Oct 2017 15:35:03 +0000 (10:35 -0500)]
Get the "drm" and "snd_pcm" tracepoint groups working on rawhide.

* tapsets.cxx (tracepoint_extra_decls): Add extra decls for the "fsi" and
  "snd_pcm" tracepoint groups. Add a few other decls for existing groups.

6 years agoFix BZ1506230 by fixing netdev.receive probe to work on kernels after v3.14.
Lukas Herbolt [Wed, 25 Oct 2017 20:47:18 +0000 (15:47 -0500)]
Fix BZ1506230 by fixing netdev.receive probe to work on kernels after v3.14.

6 years agoAdd a minor update to systemtap.stress/tapset_functions.exp.
David Smith [Wed, 25 Oct 2017 13:26:19 +0000 (08:26 -0500)]
Add a minor update to systemtap.stress/tapset_functions.exp.

* testsuite/systemtap.stress/tapset_functions.exp: Change the name of the
  "testscript" test to "tapset_functions testscript" test so its name
  sticks out a bit more on failure.

6 years agoMade a coupe of buildok tests executable.
David Smith [Wed, 25 Oct 2017 13:21:12 +0000 (08:21 -0500)]
Made a coupe of buildok tests executable.

6 years agoFix PR22327 by updating the loadavg tapset.
David Smith [Wed, 25 Oct 2017 13:17:33 +0000 (08:17 -0500)]
Fix PR22327 by updating the loadavg tapset.

* tapset/linux/loadavg.stp: Ditto.
* testsuite/buildok/loadavg-embedded.stp: New test.

6 years agoSimplify some "autoconf" tests related to the kernel's sched header file.
David Smith [Wed, 25 Oct 2017 13:15:27 +0000 (08:15 -0500)]
Simplify some "autoconf" tests related to the kernel's sched header file.

* buildrun.cxx (compile_pass): Replace the STAPCONF_SCHED_MM_H,
  STAPCONF_SCHED_TASK_STACK_H, and STAPCONF_UAPI_LINUX_SCHED_TYPES
  "autoconf" tests with the STAPCONF_LINUX_SCHED_HEADERS "autoconf" test.
* runtime/compatdefs.h: Use the STAPCONF_LINUX_SCHED_HEADERS define before
  including <linux/sched/*.h>.
* runtime/linux/access_process_vm.h: Ditto.
* tapset/linux/aux_syscalls.stp: Ditto.
* tapset/linux/timestamp_monotonic.stp: Ditto.
* runtime/linux/autoconf-linux-sched_headers.c: New autoconf-style test.
* runtime/linux/autoconf-sched-mm.c: Deleted.
* runtime/linux/autoconf-sched-task_stack.c: Ditto.
* runtime/linux/autoconf-uapi-linux-sched-types.c: Ditto.

6 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
David Smith [Fri, 20 Oct 2017 19:55:08 +0000 (14:55 -0500)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

6 years agoThe web server now gives a better error message on an unsupported request.
David Smith [Fri, 20 Oct 2017 19:52:06 +0000 (14:52 -0500)]
The web server now gives a better error message on an unsupported request.

* httpd/backends.cxx: Provide a new "default" backend, which just returns
  a reasonable error message (that this server cannot support the request).
* httpd/api.cxx (module_build): Improved error message.

6 years agocoverity tweak - close fds in dying threads
Frank Ch. Eigler [Fri, 20 Oct 2017 15:04:56 +0000 (11:04 -0400)]
coverity tweak - close fds in dying threads

6 years agorhbz1504009: let dtrace -G -o /dev/null run, as in autoconf
Frank Ch. Eigler [Fri, 20 Oct 2017 14:01:58 +0000 (10:01 -0400)]
rhbz1504009: let dtrace -G -o /dev/null run, as in autoconf

commit c245153ca193c471a8c broke the ability of dtrace to be tested in
autoconf "-G -o /dev/null" usage, because its output file name was too
simple a function of the input name, and normal users can't write to
/dev/null.dtrace-temp.c .  Now we back down to mkstemp, like before,
upon a failure of the simple concatenated name.

6 years agocoverity fixes
Frank Ch. Eigler [Fri, 20 Oct 2017 02:22:57 +0000 (22:22 -0400)]
coverity fixes

One pthread_create() RC check, one extra-initialized variable.

6 years agobpf translator: avoid attaching tags to format string more than once.
Aaron Merey [Thu, 19 Oct 2017 20:31:55 +0000 (16:31 -0400)]
bpf translator: avoid attaching tags to format string more than once.

* bpf-translate.cxx (print_format_add_tag): return immediately if
  tag is true.

* staptree.h (print_format): add boolean member 'tag'.

6 years agoImprove web service startup a bit.
David Smith [Thu, 19 Oct 2017 18:24:06 +0000 (13:24 -0500)]
Improve web service startup a bit.

* client-http.cxx (http_client::download): If verbose is >= 4, set the
  VERBOSE curl option so that all packets are dumped.
  (http_client_backend::find_and_connect_to_server): Instead of trying to
  GET the /builds directory (which isn't implemented), grab the base
  server directory.
* httpd/server.cxx (server::server): Add a base directory request
  handler.
* httpd/server.h: Move 'class server' constructor into server.cxx.

6 years agoAdd string trim utility functions.
David Smith [Thu, 19 Oct 2017 18:19:04 +0000 (13:19 -0500)]
Add string trim utility functions.

* util.cxx (ltrim): New function.
  (rtrim): Ditto.
  (trim): Ditto.
  (get_distro_info): Trim 'name' and 'version' items.
* util.h: Add trim function declarations.
* tapset-mark.cxx (mark_builder::build): Use new trim functions.
* tapsets.cxx (dwarf_builder::build): Ditto.

6 years agostap -V -- bump last-known-kernel version number to 4.14-rc4, overlooked from PRERELE...
Frank Ch. Eigler [Wed, 18 Oct 2017 23:46:51 +0000 (19:46 -0400)]
stap -V -- bump last-known-kernel version number to 4.14-rc4, overlooked from PRERELEASE handling

6 years agobump version numbers for future release 3.3
Frank Ch. Eigler [Wed, 18 Oct 2017 21:56:52 +0000 (17:56 -0400)]
bump version numbers for future release 3.3

6 years agoregen docs as per 'scripts/update-docs' release-3.2
Frank Ch. Eigler [Wed, 18 Oct 2017 17:59:37 +0000 (13:59 -0400)]
regen docs as per 'scripts/update-docs'

6 years agoupdate remaining PRERELEASE timestamps
Frank Ch. Eigler [Wed, 18 Oct 2017 17:22:22 +0000 (13:22 -0400)]
update remaining PRERELEASE timestamps

6 years agospec file typo fixes
Frank Ch. Eigler [Wed, 18 Oct 2017 16:39:12 +0000 (12:39 -0400)]
spec file typo fixes

bpf is too new for rhel7

6 years agosystemtap.spec: fix typo
Aaron Merey [Wed, 18 Oct 2017 17:10:33 +0000 (13:10 -0400)]
systemtap.spec: fix typo

6 years agosystemtap.spec: add bpf macro
Aaron Merey [Wed, 18 Oct 2017 16:29:08 +0000 (12:29 -0400)]
systemtap.spec: add bpf macro

6 years agoAdd a minor fix to testsuite/systemtap.pass1-4/semok.exp.
David Smith [Wed, 18 Oct 2017 13:50:40 +0000 (08:50 -0500)]
Add a minor fix to testsuite/systemtap.pass1-4/semok.exp.

* testsuite/systemtap.pass1-4/semok.exp (dyninst_kfails): Add twenty.stp
  as a dyninst KFAIL since it is a kernel-only test.

6 years agoimprove error message for bad assignment lvalue
Frank Ch. Eigler [Wed, 18 Oct 2017 11:24:56 +0000 (07:24 -0400)]
improve error message for bad assignment lvalue

Handle cases such as

   if (a || b = c) { }

better.

6 years agoPrerelease updates.
Aaron Merey [Tue, 17 Oct 2017 21:16:23 +0000 (17:16 -0400)]
Prerelease updates.

* AUTHORS: add new authors.

* po/: updated with scripts/update-docs.

* staprun.c: updated copyright years.

6 years agoelaborate.cxx: skip add_global_var_display if using bpf runtime.
Aaron Merey [Tue, 17 Oct 2017 17:07:03 +0000 (13:07 -0400)]
elaborate.cxx: skip add_global_var_display if using bpf runtime.

add_global_var_display might synthesize a probe containing foreach
statements which stapbpf does not currently support.

6 years agostapbpf: flush output buffer after every printf.
Aaron Merey [Tue, 17 Oct 2017 16:47:23 +0000 (12:47 -0400)]
stapbpf: flush output buffer after every printf.

* bpfinterp.cxx: fflush may be needed in case the output is buffered
  for too long.

* stapbpf.cxx, bpfinterp.h: replace printf with fprintf incase -o option
  was used.

6 years agobpf translator: access front of vector only if it's nonempty.
Aaron Merey [Tue, 17 Oct 2017 00:37:23 +0000 (20:37 -0400)]
bpf translator: access front of vector only if it's nonempty.

* bpf-translate.cxx: this check is necessary for scripts that
  contain global variable initializations but no begin probes.

6 years agostapbpf: remove hardware perf events dependency.
Aaron Merey [Tue, 17 Oct 2017 00:08:17 +0000 (20:08 -0400)]
stapbpf: remove hardware perf events dependency.

* stapbpf.cxx (create_group_fds): change perf event group leader
  from hardware type to software type.

* bpf_tests/context_vars1.stp: remove unused variable.

* bpf_tests/printf.stp: ensure kernel probe only triggers once.

6 years agoAdd the server.exp change that was supposed to go in commit 504364331.
David Smith [Mon, 16 Oct 2017 21:03:16 +0000 (16:03 -0500)]
Add the server.exp change that was supposed to go in commit 504364331.

6 years agoAdd a minor server fix.
David Smith [Mon, 16 Oct 2017 20:42:39 +0000 (15:42 -0500)]
Add a minor server fix.

* stap-serverd.cxx (filter_response_file): Only filter the server's home
  directory if it isn't "/".

6 years agoFix PR22278 by fixing server breakage caused by commit 586c8666a.
David Smith [Mon, 16 Oct 2017 20:30:52 +0000 (15:30 -0500)]
Fix PR22278 by fixing server breakage caused by commit 586c8666a.

* csclient.cxx (create_request): Let the backend add the argument in
  include_file_or_directory().
* testsuite/systemtap.server/server.exp: Add 3 simple tests: a filename, a
  "-L", and a "-I tapset -e SCRIPT".
* testsuite/lib/systemtap.exp (stap_run_batch): If the "filename" argument
  is empty, assume this stap command line doesn't need a file.

6 years agoFix the bpf.exp test case for systems without bpf support.
David Smith [Mon, 16 Oct 2017 15:07:46 +0000 (10:07 -0500)]
Fix the bpf.exp test case for systems without bpf support.

* testsuite/systemtap.bpf/bpf.exp: Use bpf_p() to know when to run the test.
* testsuite/lib/systemtap.exp (bpf_p): New function.

6 years agobpf translation error handling: try tracking derived_probe token
Frank Ch. Eigler [Sat, 14 Oct 2017 21:11:16 +0000 (17:11 -0400)]
bpf translation error handling: try tracking derived_probe token

BPF translation internals involve data structures that do not track
the staptree level entities they are based on.  So when an error
occurs, there's no quick way to mapping it back to the token, for an
ideal error message.  translate_bpf_pass() now tries to track a
last-token* as it goes translating all the probe bodies to bpf, so
that a semantic_error can be synthesized if needed.

This is still far from ideal; a single exception causes giving up
trying all the remaining probes; and all begin/end probes are
translated into single larger bpf programs, so it's harder to narrow
down the cause.  Baby steps.

6 years agobpf translator: catch runtime_errors
Frank Ch. Eigler [Fri, 13 Oct 2017 23:00:37 +0000 (19:00 -0400)]
bpf translator: catch runtime_errors

Some simple test cases can run up against bpf-translate limitations.
Those that are signalled with a runtime_error exception need to be
caught at least in translate_bpf_pass() and a message improvised, so
that there is something more to go on than an anonymous pass-4
failure.

6 years agostap-report: add BPF related kconfig fields
Frank Ch. Eigler [Fri, 13 Oct 2017 14:25:07 +0000 (10:25 -0400)]
stap-report: add BPF related kconfig fields

6 years agoMake small improvements to the systemtap server testsuite.
David Smith [Fri, 13 Oct 2017 20:52:44 +0000 (15:52 -0500)]
Make small improvements to the systemtap server testsuite.

* testsuite/systemtap.server/server.exp: When restarting the avahi daemon,
  try to fix a restart failure.
* testsuite/systemtap.server/client.exp (list_servers): Add debug output.
* testsuite/lib/systemtap.exp (shutdown_server): Try to ensure that the
  systemtap server is really gone before returning.

6 years agoAllow '+' characters in kernel names.
David Smith [Fri, 13 Oct 2017 20:47:15 +0000 (15:47 -0500)]
Allow '+' characters in kernel names.

* session.cxx (parse_cmdline): Allow '+' in kernel names, to handle
  kernels like '4.14.0-0.rc3.git0.1.fc28.x86_64+debug'.

6 years agoAdd syscalls.stpm to tapset/bpf to avoid compilation warnings.
David Smith [Fri, 13 Oct 2017 14:42:48 +0000 (09:42 -0500)]
Add syscalls.stpm to tapset/bpf to avoid compilation warnings.

* tapset/bpf/syscalls.stpm: Add macro file for bpf to make compiling the
  python2 tapset stop complaining about @__pointer() not being defined.

6 years agoFixed PR22287 by updating the ioblock tapset.
David Smith [Thu, 12 Oct 2017 21:47:16 +0000 (16:47 -0500)]
Fixed PR22287 by updating the ioblock tapset.

* tapset/linux/ioblock.stp (disk_get_part_start_sect): New function.
  (bio_rw_str): Handles 'struct bio' changes from kernel commit 74d46992e.
  (__bio_devname): Ditto.
  (ioblock.request): Ditto.
  (ioblock_trace.bounce): Ditto.
  (ioblock_trace.request): Ditto.
  (ioblock_trace.end): Ditto.
* tapset/linux/dev.stp (bdevname): Extract code into into disk_name() and
  just call it.
* buildrun.cxx (compile_pass): Add exportconf test for disk_get_part().
* testsuite/buildok/dev-embedded.stp: Updated.

6 years agoman stapprobes: tweak uprobe-perf probe templates to match metavariables
Frank Ch. Eigler [Thu, 12 Oct 2017 19:36:03 +0000 (15:36 -0400)]
man stapprobes: tweak uprobe-perf probe templates to match metavariables

6 years agoAdd stapbpf.8 to stapbpf directory.
Aaron Merey [Thu, 12 Oct 2017 17:50:04 +0000 (13:50 -0400)]
Add stapbpf.8 to stapbpf directory.

6 years agoAdd stapbpf man page, update NEWS and stap man page with stapbpf info.
Aaron Merey [Thu, 12 Oct 2017 17:42:09 +0000 (13:42 -0400)]
Add stapbpf man page, update NEWS and stap man page with stapbpf info.

6 years agostapbpf: add while loop test
Aaron Merey [Thu, 12 Oct 2017 17:38:22 +0000 (13:38 -0400)]
stapbpf: add while loop test

* while.stp: basic test for while loops.

* array.stp: changed location of exit call.

6 years agoUpdated the sysc_msgctl and sysc_shmctl tapsets for rawhide.
David Smith [Thu, 12 Oct 2017 15:19:57 +0000 (10:19 -0500)]
Updated the sysc_msgctl and sysc_shmctl tapsets for rawhide.

* tapset/linux/sysc_msgctl.stp: Updated to handle parameter name change.
* tapset/linux/sysc_shmctl.stp: Ditto.

6 years agoAdd some testsuite test kernel module fixes for rawhide.
David Smith [Thu, 12 Oct 2017 14:46:59 +0000 (09:46 -0500)]
Add some testsuite test kernel module fixes for rawhide.

* testsuite/systemtap.base/stap_hwbkpt_kmod.c: Add fixes for
  rawhide. Include <linux/sched.h> and <linux/uaccess.h>, not
  <asm/uaccess.h>.
* testsuite/systemtap.base/stap_kmodule.c: Ditto.
* testsuite/systemtap.context/systemtap_test_module1.c: Ditto.
* testsuite/systemtap.printf/memory1_module.c: Ditto.

6 years agoGet the "xdp" and "bridge" tracepoint groups working on rawhide.
David Smith [Wed, 11 Oct 2017 21:33:06 +0000 (16:33 -0500)]
Get the "xdp" and "bridge" tracepoint groups working on rawhide.

* tapsets.cxx (tracepoint_extra_decls): Added extra decls for the "xdp"
  and "bridge" tracepoint groups.

6 years agostapbpf: fix call to bpf helper during array store.
Aaron Merey [Wed, 11 Oct 2017 18:21:50 +0000 (14:21 -0400)]
stapbpf: fix call to bpf helper during array store.

* bpf-translate.cxx (emit_store): move "flags" argument to register 4 before
  calling bpf_map_update_elem.

* bpf_tests/array.stp: new test for array stores and loads.

6 years agoUpdate the server_locale.exp test case to avoid spurious failures.
David Smith [Wed, 11 Oct 2017 15:53:19 +0000 (10:53 -0500)]
Update the server_locale.exp test case to avoid spurious failures.

* testsuite/systemtap.server/server_locale.exp: Handle the case where the
  French langpack isn't installed on the system. Do a French sniff test
  before trying to use the French locale.

6 years agoFixed server breakage caused by commit 586c8666a.
David Smith [Tue, 10 Oct 2017 15:33:47 +0000 (10:33 -0500)]
Fixed server breakage caused by commit 586c8666a.

* client-nss.h (client_backend): Removed 'server_tmpdir' declaration that
  shadowed the declaration in the base class. This caused the code in
  csclient.cxx to get the wrong value for 'server_tmpdir'.

6 years agoDo better cleanup when the web server gets an error.
David Smith [Mon, 9 Oct 2017 15:51:42 +0000 (10:51 -0500)]
Do better cleanup when the web server gets an error.

* httpd/backends.cxx (generate_module): Be sure to cleanup the
  posix_span_file_actions, even if we get an error.

6 years agostapbpf: fix global variable initialization bug.
Aaron Merey [Fri, 6 Oct 2017 23:34:24 +0000 (19:34 -0400)]
stapbpf: fix global variable initialization bug.

* bpf-translate.cxx: The translator now adds assignment statements to
  the beginning of the "stap_begin" bpf program in order to initialize
  global variables with any user-supplied default values. Currently there
  is no support for string literals, the translator will still ignore them.
  (struct init_block): manages the resources associated with these
  assignments.

* tapsets.cxx(sort_for_bpf), tapset-been.cxx (sort_for_bpf): immediately
  returns if the probe group pointer is NULL.

* bpf_tests: added new tests and fixed a syntax error in globals1.stp and
  globals2.stp.

6 years agoAdd a PR20516 workaround by using kallsyms_lookup_name to find udelay_simple.
David Smith [Fri, 6 Oct 2017 15:32:53 +0000 (10:32 -0500)]
Add a PR20516 workaround by using kallsyms_lookup_name to find udelay_simple.

* runtime/linux/common_session_state.h (stp_session_init): Use
  kallsyms_lookup_name() to find udelay_simple() if it exists but isn't
  exported.
* runtime/linux/runtime.h: Ditto.
* buildrun.cxx (compile_pass): Add an new autoconf test for
  udelay_simple().
* runtime/linux/autoconf-udelay_simple.c: New file.

6 years agostapbpf: add testsuite.
Aaron Merey [Thu, 5 Oct 2017 17:48:29 +0000 (13:48 -0400)]
stapbpf: add testsuite.

* testsuite/systemtap.bpf/bpf.exp: Driver for testsuite. Call
  make installcheck with RUNTESTFLAGS='bpf.exp' to run this testsuite.

* tapset/logging.stp (error): added version of error() for bpf runtime.

6 years agostapbpf: fix evaluation of comparison expressions.
Aaron Merey [Thu, 5 Oct 2017 17:22:36 +0000 (13:22 -0400)]
stapbpf: fix evaluation of comparison expressions.

* bpf-translate.cxx (bpf_unparser::emit_cond): correct the order
  of arguments in the call to mk_jcond().

6 years agostapbpf: fix context variable segfault, improve adherence to bpf's calling conventions.
Aaron Merey [Thu, 5 Oct 2017 17:19:56 +0000 (13:19 -0400)]
stapbpf: fix context variable segfault, improve adherence to bpf's calling conventions.

* bpf-translate.cxx: Added missing assignment statements for bpf_unparser's
  'result' member. r0 is no longer used to pass arguments to bpf functions.

6 years agostapbpf: fix temporary registers appearing in translator output and null ptr deref.
Aaron Merey [Thu, 5 Oct 2017 16:35:44 +0000 (12:35 -0400)]
stapbpf: fix temporary registers appearing in translator output and null ptr deref.

* bpf-opt.cxx (reg_alloc): When replacing temp registers with hard registers in
  bpf instructions, allow for a maximum of 10 dereferences of vector "partition",
  up from 2.
  (post_alloc_cleanup): Avoid removing redundant instructions if they
  are their block's only instruction since removing them will cause a null pointer
  deref in bpf-translate.cxx (output_probe).

6 years agoAdd the server version number to the http protocol.
David Smith [Thu, 5 Oct 2017 17:31:26 +0000 (12:31 -0500)]
Add the server version number to the http protocol.

* httpd/api.cxx (result_info::generate_response): Send the server version
  number to the client.
  (build_info::generate_response): Ditto.
* client-http.cxx (unpack_response): Get the server version number.

6 years agopowerpc: Change SDT argument constraint
Sandipan Das [Thu, 5 Oct 2017 09:09:41 +0000 (14:39 +0530)]
powerpc: Change SDT argument constraint

With the 'o' memory constraint, any memory operand which
has an offsettable address is allowed. However, for some
architectures such as powerpc, this allows operands like
the ones shown below in the readelf output from Fedora 26
to be generated.

  $ readelf -n /lib64/libc.so.6 | grep memory_mallopt_mmap_max -A2 -B2
    stapsdt              0x0000006c NT_STAPSDT (SystemTap probe descriptors)
      Provider: libc
      Name: memory_mallopt_mmap_max
      Location: 0x00000000000a0274, Base: 0x00000000001ccb90, Semaphore: 0x0000000000000000
      Arguments: -4@9 -4@.LANCHOR0+44@toc@l(8) -4@.LANCHOR0+52@toc@l(7)

The second and third argument shown above are both having
operands which are pointers to static data anchors. Since
these static anchors are not included in the symbol table,
they cannot be resolved from the binary itself. So, such
arguments cannot be read via their corresponding markers.

Using the 'Z' memory constraint instead solves this issue
as it will only allow a memory operand that is an indexed
or indirect from a register.

So, for powerpc, we set STAP_SDT_ARG_CONSTRAINT to 'nZr'
but keep it as 'nor' for all other architectures.

Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
6 years agoconfigury: disable http parts by default
Frank Ch. Eigler [Thu, 5 Oct 2017 16:03:55 +0000 (12:03 -0400)]
configury: disable http parts by default

Also, move the stapbpf -lpthread out of the generated configure/ file
and into stapbpf/Makefile.am.

6 years agoAdd more http client updates and rearrange some code.
David Smith [Wed, 4 Oct 2017 20:48:19 +0000 (15:48 -0500)]
Add more http client updates and rearrange some code.

* client-nss.cxx: Moved MOK_PUBLIC_CERT_NAME to cscommon.h.
  (nss_client_backend:nss_client_backend): Moved here from client-nss.h.
  (process_response): Moved to csclient.cxx.
* client-nss.h (nss_client_backend): Moved class constructor to
  client-nss.cxx.
* client-http.h (http_client_backend): Moved class constructor to
  client-http.cxx.
* client-http.cxx (http_client_backend::http_client_backend): Moved here
  from header file and initialize 'server_tmpdir'.
  (http_client_backend::unpack_response): Move processing from
  process_response() to here and delete process_response().
* csclient.cxx (process_response): Moved from client-nss.cxx.
* csclient.h: Move 'process_response' from the backend to the main
  code. Add 'server_tmpdir' and 'server_version' to the backend.
* cscommon.h: Move MOK_PUBLIC_CERT_NAME and MOK_PUBLIC_CERT_FILE
  definitions here.
* stap-serverd.cxx: Remove MOK_PUBLIC_CERT_NAME and MOK_PUBLIC_CERT_FILE
  definitions.
* util.cxx: Add another write_to_file() template instantiation.

7 years agoAdd more http client updates.
David Smith [Mon, 2 Oct 2017 21:29:08 +0000 (16:29 -0500)]
Add more http client updates.

* client-http.cxx (http_client::download): Turn off following HTML
  redirects, so we can handle things ourselves.
  (http_client::get_response_code): New function.
  (http_client_backend::find_and_connect_to_server): Don't try to look up
  details for the "kernel" module. Reverse return value logic - only
  return success if everything worked.
  (http_client_backend::process_response): Rework logic to keep looping
  until we get a 303 response code. The next GET should be our result
  info. Make the "files" array optional, since not all stap requests
  return a module.

7 years agoFix PR22158 by fixing the shutdown sequence of events.
David Smith [Wed, 27 Sep 2017 21:43:33 +0000 (16:43 -0500)]
Fix PR22158 by fixing the shutdown sequence of events.

* runtime/stp_utrace.c (utrace_exit): Free everything.
  (utrace_cleanup): No longer cancel pending task_work requests.
  (utrace_cancel_all_task_work): New function.
  (untrace_shutdown): Cancel all pending task_work requests, wait on all
  running items to finish, then free everything.
* runtime/linux/task_finder2.c (__stp_tf_cancel_all_task_work): Renamed
  from __stp_tf_cancel_task_work.
  (__stp_tf_free_all_task_work) New function.
  (stap_stop_task_finder): Just cancel all pending task_work requests
  before waiting for them to finish. After they have all finished, free
  everything.

7 years agoEmit correct kernel rpm syntax.
Stan Cox [Fri, 22 Sep 2017 18:28:59 +0000 (14:28 -0400)]
Emit correct kernel rpm syntax.

* client-http.cxx (http_client_backend::find_and_connect_to_server):
  Emit correct kernel rpm syntax.

7 years agoUpdate testsuite/systemtap.base/optim_arridx.exp.
David Smith [Fri, 22 Sep 2017 13:07:31 +0000 (08:07 -0500)]
Update testsuite/systemtap.base/optim_arridx.exp.

* testsuite/systemtap.base/optim_arridx.exp: Commit cbc169736 changed the
  contents of the exit() function. Update the expected output.

7 years agoAdd some http client updates.
David Smith [Thu, 21 Sep 2017 20:41:21 +0000 (15:41 -0500)]
Add some http client updates.

* client-http.cxx (http_client::post): Reindent a bit and add FIXME
  comment.
  (http_client::add_script_file): Don't assume a placeholder for the
  script file.
  (http_client_backend::process_response): Instead of calling
  json_object_to_json_string(), call json_object_get_string(). The former
  returns a quoted string (and turns '/' into '\/'). The latter returns a
  "raw" string, which is what we want.

7 years agoFix PR22155 by avoiding a kernel panic.
Tetsuo Handa [Thu, 21 Sep 2017 15:09:44 +0000 (10:09 -0500)]
Fix PR22155 by avoiding a kernel panic.

* runtime/linux/task_finder.c (__stp_call_mmap_callbacks_for_task):
  Instead of a 'struct path' pointer, store the 'struct path' structure
  itself in vma_cache_t.
* runtime/linux/task_finder2.c: Ditto.

7 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
David Smith [Thu, 21 Sep 2017 14:47:00 +0000 (09:47 -0500)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

7 years agoFix PR22151 by not trying to use a pmap when it is NULL.
David Smith [Thu, 21 Sep 2017 14:46:39 +0000 (09:46 -0500)]
Fix PR22151 by not trying to use a pmap when it is NULL.

* runtime/pmap-gen.c (_stp_pmap_new*): If pmap allocation fails, don't try
  to use it.

7 years agostapbpf: fix kprobe registration bugs
Aaron Merey [Wed, 20 Sep 2017 23:45:34 +0000 (19:45 -0400)]
stapbpf: fix kprobe registration bugs

* stapbpf/stapbpf.cxx: Perform _stext-based relocation on kprobe addresses.
  Use symbol name instead of symbol address for kretprobes registration.

* tapsets.cxx (generic_kprobe_derived_probe): Add member sym_name_for_bpf.
  (args_for_bpf): bo file now includes proper kprobe registration info.

* tapset/bpf/exit.stp, tapset/logging.stp: _set_exit_flag() renamed to
  _set_exit_status().

7 years agostapbpf: fix printf(), add exit()
Aaron Merey [Tue, 19 Sep 2017 23:09:33 +0000 (19:09 -0400)]
stapbpf: fix printf(), add exit()

* bpf-translate.cxx:
  All bpf programs produced by the translator now include a bpf map
  containing internal globals intended for use by the runtime. Currently
  this map contains a single element which indicates whether exit()
  has been called.

  Add support for BPF_LD_MAP pseudo-instruction for tapsets with
  embedded bytecode.

  Add tags to printf() format strings to facilitate parsing from trace
  buffer at runtime.

* bpf-internal.h (struct globals): Add ABI for internal globals.

* configure: Add "-pthread" to stapbpf_LIBS

* main.cxx (passes_0_4): Include "/bpf" as a possible runtime_prefix

* parse.cxx (eval_pp_conditional): Include "bpf" as option for
  runtime-based preprocessor conditionals.

* stapbpf/bpfinterp.cxx: Add function remove_tags().

* stapbpf/libbpf.c: Fix bug where some bpf_attrs weren't memset to 0
  upon initialization.

* stapbpf/stapbpf.cxx: Add functions init_internal_globals(),
  get_exit_status(), print_trace_output(). sigint() now sets
  exit status.

* tapset/bpf/exit.stp: Add function _set_exit_status()

* tapset/logging.stp: Add version of exit() for bpf runtime.

7 years agoAvoid "confusing usage" warnings in tcpmib.stp and the tcpipstat.stp example.
David Smith [Wed, 20 Sep 2017 13:31:34 +0000 (08:31 -0500)]
Avoid "confusing usage" warnings in tcpmib.stp and the tcpipstat.stp example.

* tapset/linux/tcpmib.stp: Avoid "confusing usage, consider @entry($sk) in
  .return probe" translator warnings by using @entry().
* testsuite/systemtap.examples/network/tcpipstat.stp: Ditto.

7 years agoGet stapregex-dfa.cxx compiling.
David Smith [Tue, 19 Sep 2017 16:02:48 +0000 (11:02 -0500)]
Get stapregex-dfa.cxx compiling.

* stapregex-dfa.cxx: Fix some unsigned vs signed comparison problems, so
  that gcc doesn't complain.

7 years agoFix PR22158 by updating the runtime to handle the removal of spin_unlock_wait.
David Smith [Tue, 19 Sep 2017 15:51:54 +0000 (10:51 -0500)]
Fix PR22158 by updating the runtime to handle the removal of spin_unlock_wait.

* runtime/stp_helper_lock.h: Removed stp_spin_unlock_wait(), since the
  underlying kernel functionality was removed in kernel commit
  d3a024abbc43827785.
* runtime/stp_utrace.c (utrace_finish_stop): Instead of calling
  stp_spin_unlock_wait(), just try to lock and unlock the spin lock.

7 years agoregexp post-merge cleanup
Frank Ch. Eigler [Fri, 15 Sep 2017 19:07:44 +0000 (15:07 -0400)]
regexp post-merge cleanup

Just little type / doc / test tweaks.

7 years agoMerge remote-tracking branch 'serhei/serhei/tnfa-submit'
Frank Ch. Eigler [Fri, 15 Sep 2017 18:49:20 +0000 (14:49 -0400)]
Merge remote-tracking branch 'serhei/serhei/tnfa-submit'

* serhei/serhei/tnfa-submit:
  PR15065 documentation :: doc/langref.tex
  PR15065 documentation :: NEWS and man/stap.1.in
  stapregex PR15065 (8/8) :: add back re2c's mini-optimizer
  stapregex PR15065 (7/8) :: Core algorithm -- emit TNFA actions.
  stapregex PR15065 (6/8) :: Core algorithm -- compute TNFA actions.
  stapregex PR15065 (5/8) :: correctly number tags in stapregex-parse
  stapregex PR15065 (4/8) :: switch DFA engine to an unsigned char type
  stapregex PR15065 (3/8) :: translator integration bits
  stapregex PR15065 (2/8) :: add grouping testsuite
  stapregex PR15065 (1/8) :: add tapset/regex.stp

7 years agoAvoid pulling in old compatibility RPM 4.4 API
William Cohen [Fri, 15 Sep 2017 15:37:36 +0000 (11:37 -0400)]
Avoid pulling in old compatibility RPM 4.4 API

RPM 4.14.0 rc1 removes a number of RPM 4.4 compatibility APIs enabled by
_RPM_4_4_COMPAT define.  SystemTap has been updated to the newer API
and keeping this define causes the build to fail on Fedora rawhide.

7 years agoUpdate systemtap.stress/conversions.exp.
David Smith [Thu, 14 Sep 2017 21:42:55 +0000 (16:42 -0500)]
Update systemtap.stress/conversions.exp.

* testsuite/systemtap.stress/conversions.exp (run_conv_test): Turn off
  overload protection so that we get the right errors ("copy fault") and
  not the wrong errors ("probe took too long").

7 years agoSuppress spurious "never-assigned" warnings for globals set via '-G'.
Arjun Shankar [Thu, 14 Sep 2017 20:46:23 +0000 (15:46 -0500)]
Suppress spurious "never-assigned" warnings for globals set via '-G'.

7 years agowork around bpf valgrind errors
Frank Ch. Eigler [Thu, 14 Sep 2017 17:09:18 +0000 (13:09 -0400)]
work around bpf valgrind errors

The bpf infrastructure has a complex graph data types, which are
created, mutated, partly deleted, added etc., representing a
worst-case scenario for a statically typed non-GC system like c++.
The following little test case triggers memory corruption
(access-after-free).

./stap --runtime=bpf -p4 -e 'probe  kernel.function("sys_open")
        {x = 1; if (x) x = 0; else x = 2 } '

This patch disables some of the responsible code - by turning off
program::program destructors' detailed cleanup of the embedded graph
structure.  So we leak memory instead. :-(

Another little hunk deals with an un-C++-ish typecasting error that
valgrind also caught (operator new[] vs. free() on same pointer).

7 years agoImprove fix for PR22117 by updating the translator.
David Smith [Tue, 12 Sep 2017 21:15:47 +0000 (16:15 -0500)]
Improve fix for PR22117 by updating the translator.

* dwflpp.cxx (dwflpp::translate_base_ref): Add an even better fix to the
  number of bytes comparison to avoid "noncontiguous location for base
  fetch" semantic error on 32-bit systems (and not break 64-bit systems).

7 years agoFix PR22124 by properly handling perf counter reads in uretprobes.
David Smith [Tue, 12 Sep 2017 18:51:07 +0000 (13:51 -0500)]
Fix PR22124 by properly handling perf counter reads in uretprobes.

* tapsets.cxx (uprobe_derived_probe_group::emit_module_utrace_decls): Be
  sure to properly handle perf counter reads in uretprobes.
* testsuite/systemtap.base/perf.exp: If this system doesn't support
  hardware perf probes, try with software perf probes.
* testsuite/systemtap.base/perf03sw.stp: New file.
* testsuite/systemtap.base/perf04sw.stp: Ditto.

7 years agoPR15065 documentation :: doc/langref.tex
Serhei Makarov [Tue, 12 Sep 2017 02:27:40 +0000 (22:27 -0400)]
PR15065 documentation :: doc/langref.tex

7 years agoPR15065 documentation :: NEWS and man/stap.1.in
Serhei Makarov [Tue, 12 Sep 2017 02:13:16 +0000 (22:13 -0400)]
PR15065 documentation :: NEWS and man/stap.1.in

7 years agoFix PR22110 by updating the translator.
David Smith [Fri, 8 Sep 2017 19:08:18 +0000 (14:08 -0500)]
Fix PR22110 by updating the translator.

* loc2stap.cxx (location_context::new_symref): Set sym->referent to avoid
  "internal error: unresolved symbol 'pointer'" when processing
  semok/autocast07.stp.

7 years agoFix PR22117 by updating the translator.
David Smith [Fri, 8 Sep 2017 19:05:37 +0000 (14:05 -0500)]
Fix PR22117 by updating the translator.

* dwflpp.cxx (dwflpp::translate_base_ref): Fix number of bytes comparison
  to avoid "noncontiguous location for base fetch" semantic error on
  32-bit systems.

7 years agostapregex PR15065 (8/8) :: add back re2c's mini-optimizer
Serhei Makarov [Fri, 8 Sep 2017 03:04:37 +0000 (23:04 -0400)]
stapregex PR15065 (8/8) :: add back re2c's mini-optimizer

* stapregex-tree.cxx (ins_optimize): New function.
(regexp::compile): Initialize i.marked in newly allocated ins to
stop a harmless but very noisy Valgrind complaint.
* stapregex-tree.h (ins_optimize): New function.
* stapregex-dfa.cxx (stapregex_compile): Invoke ins_optimize.

7 years agostapregex PR15065 (7/8) :: Core algorithm -- emit TNFA actions.
Serhei Makarov [Fri, 8 Sep 2017 01:55:39 +0000 (21:55 -0400)]
stapregex PR15065 (7/8) :: Core algorithm -- emit TNFA actions.

This is the only part of the TNFA functionality that touches
the kernel, so it is crucially important to review for safety.

* stapregex.cxx (stapdfa::emit_declaration): Set up and clean
up tag state, define additional YY* macros used by TNFA actions.
* stapregex-dfa.cxx (span::emit_jump): Add diagnostic printing,
continue matching even after entering an accepting state.
(span::emit_final): Emit finalizer TNFA action, save final
tags if the finalizer produced a suitable longest-match.
(state::emit): Add diagnostic printing, handle unknown chars.
(dfa::emit): Set up tags, emit initializer TNFA action, emit
finalizer when the regex accepts at the first char.
(dfa::emit_action): New function.
(dfa::emit_tagsave): Vestigial functionality -- just sets ntags.

* stapregex-dfa.h (dfa::emit_action): New function.

7 years agostapregex PR15065 (6/8) :: Core algorithm -- compute TNFA actions.
Serhei Makarov [Fri, 8 Sep 2017 01:49:49 +0000 (21:49 -0400)]
stapregex PR15065 (6/8) :: Core algorithm -- compute TNFA actions.

* stapregex-dfa.cxx: Implement Laurikari's TNFA algorithm.
(arc_priority::refine_higher, ::refine_lower): Detect overflow.
(arc_compare): Previous implementation was incorrect, fix it.
(dfa::add_map_item): New function.
(te_closure): Properly consider arc_priorities.
(same_ins): New function.
(dfa::find_equivalent): Algorithm to compute reordering actions.
(dfa::compute_action): Algorithm to compute TNFA actions.
(dfa::compute_finalizer): Algorithm to compute finalizers.
(dfa::dfa): Consider arc_priorities and reordering actions.
(operator << for map_item): New function.
(operator << for tdfa_action): Use << for map_item.
(kernel_point::print): New function.
(state::print): Include diagnostic info for TNFA algorithm.
(operator << for state): New function.
(operator << for dfa): New function.

* stapregex-dfa.h (operator << for map_item): New function.
(struct tdfa_insn): Add save_tag option for finalizers.
(kernel_point::print): New function.
(struct span): Add jump_pairs field.
(struct state): Add dfa field to access containing DFA. Also
add accept_kp field to track TNFA actions for accepting states.
(state::state): Add dfa field to constructor.
(state::print): Use ordinary ostream, not translator_output.
(operator << for state): New function.
(struct dfa): Add success_outcome and fail_outcome field to
explicitly track the indices of 'accept' and 'fail' outcomes.
(dfa::dfa): Add an option to set index of 'accept' outcome.
(dfa::add_map_item): New function.
(dfa::compute_action): New function.
(dfa::compute_finalizer): New function.

* stapregex.cxx (regex_to_stapdfa): Add comment -- here is how
you can force TNFA tag operations to be generated even when the
stap script doesn't request any groups.

7 years agostapregex PR15065 (5/8) :: correctly number tags in stapregex-parse
Serhei Makarov [Fri, 8 Sep 2017 01:44:14 +0000 (21:44 -0400)]
stapregex PR15065 (5/8) :: correctly number tags in stapregex-parse

* stapregex-parse.h (regex_parser):
Replace num_tags with num_subexpressions.

* stapregex-parse.cxx (regex_parser::parse):
Compute num_subexpressions, generate tags for subexpression 0.
(regex_parser::parse_factor): Generate tags for groups '()'.
(regex_parser::parse_char_range): Remove TODOXXX.

7 years agostapregex PR15065 (4/8) :: switch DFA engine to an unsigned char type
Serhei Makarov [Fri, 8 Sep 2017 01:36:29 +0000 (21:36 -0400)]
stapregex PR15065 (4/8) :: switch DFA engine to an unsigned char type

* stapregex-defines.h: New file. The rchar type is an unsigned
char. Within an NFA or DFA, rchar 128 is used to represent
unknown characters (i.e., anything that does not fit within
the ASCII standard encoding). This is placeholder functionality
meant to sanely handle other encodings such as UTF prior to
implementing full support for them.

* stapregex-dfa.h, stapregex-dfa.cxx: Use rchar throughout.
* stapregex-parse.h, stapregex-parse.cxx: Use rchar throughout.
* stapregex-tree.h, stapregex-tree.cxx: Use rchar throughout.
* stapregex.h: Use rchar throughout.

7 years agostapregex PR15065 (3/8) :: translator integration bits
Serhei Makarov [Fri, 8 Sep 2017 01:17:35 +0000 (21:17 -0400)]
stapregex PR15065 (3/8) :: translator integration bits

* elaborate.cxx (typeresolution_info::visit_embeddedcode):
Enable session.need_tagged_dfa.

* session.h (systemtap_session):
Replace dfa_maxstate with dfa_maxmap.
* session.cxx (systemtap_session::systemtap_session):
Replace dfa_maxstate with dfa_maxmap.
* translate.cxx (systemtap_session):
Replace dfa_maxstate with dfa_maxmap.

* stapregex-dfa.h (struct dfa): New variable nmapitems.

* stapregex.h (stapdfa::num_map_items): New function.
* stapregex.cxx (regex_to_stapdfa): Set value of dfa_maxmap.
(stapdfa::num_map_items): New function.

7 years agostapregex PR15065 (2/8) :: add grouping testsuite
Serhei Makarov [Wed, 12 Jul 2017 00:46:42 +0000 (20:46 -0400)]
stapregex PR15065 (2/8) :: add grouping testsuite

* testsuite/runok/regex_grouping.stp:
New file. Testcases with grouping enabled.

* testsuite/runok/regex.stp:
Testcases with grouping disabled (minor fix).

7 years agostapregex PR15065 (1/8) :: add tapset/regex.stp
Serhei Makarov [Thu, 6 Jul 2017 18:17:11 +0000 (14:17 -0400)]
stapregex PR15065 (1/8) :: add tapset/regex.stp

* regex.stp: New tapset providing access to TNFA grouping data.
(matched_str): Return last matched str.
(matched): Return n'th subexpression from last match.
(ngroups): Return the number of subexpressions in last match.

7 years agoFix PR22097 by updating the translator.
David Smith [Thu, 7 Sep 2017 20:30:28 +0000 (15:30 -0500)]
Fix PR22097 by updating the translator.

* dwflpp.cxx (dwflpp::translate_final_fetch_or_store): Add logic that
  prevents trying to take the address of a register (and similar items).

7 years agoFix PR22109 by updating tapset/linux/nfsd.stp for upstream kernel changes.
David Smith [Thu, 7 Sep 2017 19:15:51 +0000 (14:15 -0500)]
Fix PR22109 by updating tapset/linux/nfsd.stp for upstream kernel changes.

* tapset/linux/nfsd.stp: Handle several nfsd function's moving several
  function arguments to fields inside structures in current kernels.

7 years agoGet the systemtap.printf/memory1.exp test case working on rawhide.
David Smith [Thu, 7 Sep 2017 14:46:38 +0000 (09:46 -0500)]
Get the systemtap.printf/memory1.exp test case working on rawhide.

* testsuite/systemtap.printf/memory1_module.c: Update for rawhide systems,
  where <linux/uaccess.h> is needed.

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