]> sourceware.org Git - systemtap.git/log
systemtap.git
5 years agobpf-translate.cxx :: fix segfault with malformed register
Serhei Makarov [Tue, 30 Oct 2018 21:10:53 +0000 (17:10 -0400)]
bpf-translate.cxx :: fix segfault with malformed register

5 years agoFix miscellaneous errors/typos in syscall tapset
Jafeer Uddin [Tue, 30 Oct 2018 20:07:05 +0000 (16:07 -0400)]
Fix miscellaneous errors/typos in syscall tapset

* tapset/linux/sysc_pkey_*.stp: properly cast target variables in dw_syscall probe
* runtime/linux/compat_unistd.h: fix typos and errors in __NR_* definitions
* testsuite/systemtap.syscall/pkey.c: remove empty first line in file

5 years agoOn aarch64 Linux system calls related SystemTap scripts
Victor Kamensky [Tue, 30 Oct 2018 19:58:24 +0000 (15:58 -0400)]
On aarch64 Linux system calls related SystemTap scripts
compilation fail with "__NR_compat_[exit|read|write] redefined"
errors after following two commits:

 7abf0aee9 PR23160,PR14690: remove references to ia32 and x86 to make sysc_* files as arch-independent as possible
 cd84aedca PR23160,PR14690: adapt 13 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit

aarch64 kernel defines __NR_compat_[exit|read|write] after
 a1ae65b21941 arm64: add seccomp support

aarch64 kernel define __NR_compat_restart_syscall after
 f3e5c847ec3d arm64: Add __NR_* definitions for compat syscalls

Fix by adding proper conditional compilation based on current
architecture and kernel version.

5 years agoAdjust the BPF translate error report formatting to work on 32-bit architectures
William Cohen [Tue, 30 Oct 2018 18:20:46 +0000 (14:20 -0400)]
Adjust the BPF translate error report formatting to work on 32-bit architectures

The 32-bit architectures such as arm and i686 had arguments in the
error reporting that did not match up with the %lu or %ld formatting.
Used type casting and %llu and %lld to avoid variation between 32-bit
and 64-bit architectures.

5 years agosession.cxx :: enable caching for bpf backend
Serhei Makarov [Fri, 26 Oct 2018 15:15:13 +0000 (11:15 -0400)]
session.cxx :: enable caching for bpf backend

5 years agobpf-translate.cxx :: plug an exception gap in is_numeric()
Serhei Makarov [Thu, 25 Oct 2018 16:19:53 +0000 (12:19 -0400)]
bpf-translate.cxx :: plug an exception gap in is_numeric()

5 years agoMerge branch 'serhei/bpf_asm' -- kernel_string() tapset and experimental bpf assembler
Serhei Makarov [Wed, 24 Oct 2018 20:04:30 +0000 (16:04 -0400)]
Merge branch 'serhei/bpf_asm' -- kernel_string() tapset and experimental bpf assembler

Note the big comment in bpf-translate.cxx explaining the new assembler.

Major changes:
- Embedded-code assembler
- TODO Embedded-code tapset function call support is incomplete, only enabled for exit()
- TODO Token adjustment for assembler diagnostics needs work.
- Refactor bpf_unparser
- Improved metadata about helpers
- String handling changes
- Misc cleanup/notes

Tapset for kernel_string:

* tapset/bpf/conversions.stp: New file.
(kernel_string): New function.
(kernel_string): New function (err_msg version), in assembly.
(kernel_string_n): New function, in assembly.
* testsuite/systemtap.bpf/bpf_tests/context_vars3.stp: New testcase.

Embedded-code assembler:

* bpf-translate.cxx (bpf_unparser::parse_imm): New function.
(bpf_unparser::parse_asm_stmt): New function.
(bpf_unparser::emit_asm_arg): New function.
(bpf_unparser::parse_reg): Removed.
(bpf_unparser::emit_asm_reg): New function.
(bpf_unparser::get_asm_reg): New function.
(bpf_unparser::emit_asm_opcode): New function.
(bpf_unparser::visit_embeddedcode): Process new assembly format.
(BPF_ASM_DEBUG): New (disabled) macro for diagnostics.
(struct asm_stmt): New structure.
(operator <<): New function -- print logic for asm_stmt.
(is_numeric): New function.
* testsuite/systemtap.bpf/asm_tests/*: New testcases for embedded-code assembler.
* testsuite/systemtap.bpf/bpf-asm.exp: TODO Initial test driver for embedded-code assembler.

TODO Embedded-code tapset function call support is incomplete, only enabled for exit():

* bpf-translate.cxx (translate_bpf_pass): Pass systemtap_session to assembler globals.
* bpf-internal.h (globals::session): New field to pass systemtap_session to assembler.

TODO Token adjustment for assembler diagnostics needs work:

* parse.h (token::adjust_location): New function.

Refactor bpf_unparser:

* bpf-translate.cxx (bpf_unparser::emit_functioncall): New function.
(bpf_unparser::visit_functioncall): Use emit_functioncall.
(print_format_add_tag): New function on std::string.
(bpf_unparser::emit_print_format): New function.
(bpf_unparser::visit_print_format): Use print_format_add_tag, emit_print_format.

Improved metadata about helpers:

* bpf-base.cxx (bpf_func_name_map): New structure -- id->name map.
(bpf_func_id_map): New structure -- name->id map.
(init_bpf_helper_tables): New function -- populate name->id and id->name map.
(bpf_function_name): Change to use the maps.
(bpf_function_id): New function -- map from name to helper id.
(bpf_function_nargs): TODO Still need to expand the list of helpers.
* bpf-translate.cxx (translate_bpf_pass): Call init_bpf_helper_tables to populate info.
* bpf-internal.h (init_bpf_helper_table): New function.
(bpf_function_id): New function.
(__STAPBPF_FUNC_MAPPER): New macro -- like __BPF_FUNC_MAPPER for userspace-only helpers.

String handling changes:

* bpf-translate.cxx (bpf_unparser::emit_literal_str): New function.
(bpf_unparser::visit_literal_str): Use emit_literal_str.
(emit_simple_literal_str): Renamed from emit_literal_str.
(bpf_unparser::emit_string_copy): Renamed from emit_copied_str;
rename emit_literal_str to emit_simple_literal_str.
(bpf_unparser::emit_str_arg): Rename emit_copied_str to emit_string_copy.
(translate_escapes): Takes a const string now.
* bpf-opt.cxx (alloc_literal_str): Rename emit_literal_str to emit_simple_literal_str.
* bpf-internal.h (emit_simple_literal_str): Renamed from emit_literal_str.

Misc cleanup/notes:

* bpf-internal.h (BPF_MAXSTRINGLEN): TODO Someday this will be increased.
(program::use_tmp_space): Assert to catch miscalulations.
* tapset/logging.stp (abort): TODO Could abort immediately with assembly in future.

5 years agotestsuite/systemtap.bpf :: diagnose a bug in print_format("%s%s", ...)
Serhei Makarov [Wed, 24 Oct 2018 19:56:44 +0000 (15:56 -0400)]
testsuite/systemtap.bpf :: diagnose a bug in print_format("%s%s", ...)

5 years agostapbpf assembler WIP #8 :: bpf-asm.exp driver and more testcases serhei/bpf_asm
Serhei Makarov [Wed, 24 Oct 2018 17:30:29 +0000 (13:30 -0400)]
stapbpf assembler WIP #8 :: bpf-asm.exp driver and more testcases

5 years agostapbpf assembler WIP #7 :: fixed kernel_string() tapset and testcase
Serhei Makarov [Wed, 24 Oct 2018 16:46:55 +0000 (12:46 -0400)]
stapbpf assembler WIP #7 :: fixed kernel_string() tapset and testcase

* tapset/bpf/conversions.stp (kernel_string_n): enable error path.
* tapset/logging.stp (abort): note future work.
* testsuite/systemtap.bpf/bpf_tests/context_vars3.stp: new testcase.

5 years agostapbpf assembler WIP #6 :: other call functions ({s}printf and tapset)
Serhei Makarov [Tue, 23 Oct 2018 17:35:08 +0000 (13:35 -0400)]
stapbpf assembler WIP #6 :: other call functions ({s}printf and tapset)

Only very limited support for tapset functions (restricted to exit()
for now) due to the difficulty of resolving symbols after the semantic
pass is already completed. Could address this in the future.

* bpf_internal.h (program::use_tmp_space): check for overflow.
(globals::session): new field for systemtap_session (used by function lookup).

* bpf_translate.cxx (asm_stmt::has_jmp_target): new field.
(operator <<): printing rules for alloc, call.
(bpf_unparser::parse_asm_stmt): remove printf/error, BUGFIX alloc, call, string literal.
Also calculate has_jmp_target in the resulting stmt.
(bpf_unparser::visit_embeddedcode): handle printf, sprintf and exit().
Also fix the way fallthrough fields are populated to avoid spurious extra jump.
(bpf_unparser::emit_functioncall): new function. Factors out non-staptree code.
(bpf_unparser::visit_functioncall): use new emit_functioncall().
(print_format_add_tag): new function on std::string. Factors out string operations.
(bpf_unparser::emit_print_format): new function. Factors out non-staptree code.
(bpf_unparser::visit_print_format): use new emit_print_format().
(translate_bpf_pass): store session in globals.

5 years agoPR21080: support added for new pkey_* syscalls
Jafeer Uddin [Tue, 23 Oct 2018 19:19:29 +0000 (15:19 -0400)]
PR21080: support added for new pkey_* syscalls

* sysc_pkey_*.stp: new syscall probes
* aux_syscalls.stp: add new function to convert init_val to PKEY_DISABLE_[ACCESS|WRITE]
* compat_unistd.h: add new syscall numbers
* pkey.c: tests for new syscall

5 years agostap-exporter examples: use symlinks rather than copies
Frank Ch. Eigler [Tue, 23 Oct 2018 18:19:35 +0000 (14:19 -0400)]
stap-exporter examples: use symlinks rather than copies

Some of the .stp examples were accidentally replaced by
copies of the EXAMPLE driver script.  Back to symlinks.

5 years agoUse NSS_InitContext instead of NSS_Init.
Stan Cox [Tue, 23 Oct 2018 02:29:32 +0000 (22:29 -0400)]
Use NSS_InitContext instead of NSS_Init.

* nsscommon.cxx (nssInitContext): New function which allows
   multiple nss invocations.  Change all callers except where
   write access is required.
  (nssCleanup): Add context parameter.  Change all callers.
* client-http.cxx (download): Add cleanup parameter to choose
   curl_easy_cleanup.  Change all callers.
  (download_pem_cert): If CURLINFO_CERTINFO fails then retrieve cert from server.
  (find_and_connect_to_server): If the database cert fails then try again
   with retrieved server cert.
  (fill_in_server_info): Likewise.

* testsuite/systemtap.http_server/server_trust.exp:  New test.

5 years agoprometheus tapset: add dump_array_*_unquoted variants
Frank Ch. Eigler [Mon, 22 Oct 2018 20:26:15 +0000 (16:26 -0400)]
prometheus tapset: add dump_array_*_unquoted variants

For demos like also_ran.stp, the incoming strings are usually already
quoted.  Re-quoting them for prometheus labeling is counterproductive,
so we now offer an option to bypass that string_quoted() wrapping.
also_ran.stp updated.

before:

count{path="\"/lib64/libdl.so.2\""} 69
count{path="\"/lib64/libpthread.so.0\""} 76
count{path="\"/usr/bin/expr\""} 89

after:

count{path="/lib64/libdl.so.2"} 69
count{path="/lib64/libpthread.so.0"} 76
count{path="/usr/bin/expr"} 89

5 years agonfsd tapset: adapt nfsd.proc4.commit probe to different kernel versions
Frank Ch. Eigler [Fri, 19 Oct 2018 23:31:31 +0000 (19:31 -0400)]
nfsd tapset: adapt nfsd.proc4.commit probe to different kernel versions

Here too an if(@defined($u)) is appropriate, just like in
every other case.  Audited remainder.

5 years agoPR23799 - sprint_ustack() always returns empty string values
Yichun Zhang (agentzh) [Fri, 19 Oct 2018 21:55:08 +0000 (14:55 -0700)]
PR23799 - sprint_ustack() always returns empty string values

The tapset function sprint_ustack() forgot to actually return
the computed string value. Alas.

5 years agonfsd tapset: adapt nfsd.proc4.read probe to different kernel versions
Frank Ch. Eigler [Fri, 19 Oct 2018 21:36:04 +0000 (17:36 -0400)]
nfsd tapset: adapt nfsd.proc4.read probe to different kernel versions

Here too an if(@defined($u)) is appropriate, just like in the .write case.

5 years agostep-prep: on debian/ubuntu machines, attempt "apt-get -y install"
Frank Ch. Eigler [Thu, 18 Oct 2018 19:46:09 +0000 (15:46 -0400)]
step-prep: on debian/ubuntu machines, attempt "apt-get -y install"

If we're running as root, and the apt cache already knows our desired
package, actually run apt-get to install it.

5 years agoUse cast to make c->cycles_sum aways match the %lld format.
William Cohen [Fri, 19 Oct 2018 18:59:27 +0000 (14:59 -0400)]
Use cast to make c->cycles_sum aways match the %lld format.

On aarch64 and ppc64le cycles_t is a slightly different type from the
x86_64 and does not match up with the %lld format.  Cast c->cyles_sum
to always be (long long) to avoid the compile failing on aarch64 and
ppc64le with the following message:

**** failed systemtap kernel-devel smoke test:

/tmp/stapzubPmR/stap_e418199b88a6f8adf13a14e064ae79da_1403_src.c: In function '_stp_hrtimer_notify_function':
/tmp/stapzubPmR/stap_e418199b88a6f8adf13a14e064ae79da_1403_src.c:477:45: error: format '%lld' expects argument of type 'long long int', but argument 2 has type 'cycles_t' {aka 'long unsigned int'} [-Werror=format=]
             _stp_error ("probe overhead (%lld cycles) exceeded threshold (%lld cycles) in last %lld cycles", c->cycles_sum, STP_OVERLOAD_THRESHOLD, STP_OVERLOAD_INTERVAL);
                                          ~~~^                                                                ~~~~~~~~~~~~~
                                          %ld
cc1: all warnings being treated as errors

5 years agoAdd more quantitative data to error message when probes exceed threshold
Jafeer Uddin [Fri, 19 Oct 2018 14:12:52 +0000 (10:12 -0400)]
Add more quantitative data to error message when probes exceed threshold

5 years agoAvoid using target variable in target_set.stp for syscall.* probes.
William Cohen [Thu, 18 Oct 2018 17:44:03 +0000 (13:44 -0400)]
Avoid using target variable in target_set.stp for syscall.* probes.

5 years agoAvoid using target variables for syscall.write in print_user_buffer.stp.
William Cohen [Thu, 18 Oct 2018 17:31:28 +0000 (13:31 -0400)]
Avoid using target variables for syscall.write in print_user_buffer.stp.

5 years agoAvoid using target variables in signal.stp for syscall.* based probe points.
William Cohen [Thu, 18 Oct 2018 17:05:25 +0000 (13:05 -0400)]
Avoid using target variables in signal.stp for syscall.* based probe points.

5 years agoAdd buildok/syscall_any.stp to list of tests dyninst will not run.
William Cohen [Thu, 18 Oct 2018 16:05:56 +0000 (12:05 -0400)]
Add buildok/syscall_any.stp to list of tests dyninst will not run.

5 years agokprocess.exec_complete should avoid using $return from syscall.execve.return
William Cohen [Thu, 18 Oct 2018 15:47:50 +0000 (11:47 -0400)]
kprocess.exec_complete should avoid using $return from syscall.execve.return

5 years agostapbpf assembler WIP #5 :: basic kernel_string() implementation
Serhei Makarov [Tue, 16 Oct 2018 22:17:25 +0000 (18:17 -0400)]
stapbpf assembler WIP #5 :: basic kernel_string() implementation

5 years agostapbpf assembler WIP #4 :: alloc and (helper) call operations
Serhei Makarov [Tue, 16 Oct 2018 22:16:48 +0000 (18:16 -0400)]
stapbpf assembler WIP #4 :: alloc and (helper) call operations

5 years agostapbpf assembler WIP #3 :: additional assembly test cases
Serhei Makarov [Tue, 16 Oct 2018 22:13:47 +0000 (18:13 -0400)]
stapbpf assembler WIP #3 :: additional assembly test cases

5 years agoFix searching of kernel_source_tree for kernel built with O option
Hou Tao [Mon, 10 Sep 2018 11:46:27 +0000 (19:46 +0800)]
Fix searching of kernel_source_tree for kernel built with O option

When generating kernel module for a systemtap script that uses trace-point
probe, if the vanilla kernel is built by using O=build_path option and
r=build_path option is passed to stap, stap will not be able to find
kernel_source_tree and will fail on pass-2.

Linux kernel will create a symlink named source to the source tree
for out-of-source build since (399b835be30e "kbuild: add a symlink
to the source for separate objdirs"), so fix the problem by checking
whether or not the symlink exists and using it as the kernel_source_tree.

Also using a new helper dir_exists() instead of file_exists() to
ensure the existence of the directory of source tree.

Signed-off-by: Hou Tao <houtao1@huawei.com>
5 years agopostrelease version bump for future version 4.1
Frank Ch. Eigler [Sat, 13 Oct 2018 20:38:23 +0000 (16:38 -0400)]
postrelease version bump for future version 4.1

5 years agopre-release release timestamp bump release-4.0
Frank Ch. Eigler [Sat, 13 Oct 2018 16:42:36 +0000 (12:42 -0400)]
pre-release release timestamp bump

5 years agopre-release examples index bump
Frank Ch. Eigler [Sat, 13 Oct 2018 16:41:14 +0000 (12:41 -0400)]
pre-release examples index bump

5 years agopre-release update-docs bump
Frank Ch. Eigler [Sat, 13 Oct 2018 16:38:40 +0000 (12:38 -0400)]
pre-release update-docs bump

5 years agomechanical prerelease copyright notice year# changes
Frank Ch. Eigler [Fri, 12 Oct 2018 20:52:23 +0000 (16:52 -0400)]
mechanical prerelease copyright notice year# changes

scripts/update-copyrights now knows how to handle singleton year#s too.

5 years agoPRERELEASE bump
Frank Ch. Eigler [Fri, 12 Oct 2018 20:33:16 +0000 (16:33 -0400)]
PRERELEASE bump

5 years agoi18n update-po bump
Frank Ch. Eigler [Fri, 12 Oct 2018 20:30:26 +0000 (16:30 -0400)]
i18n update-po bump

5 years agoAUTHORS bump
Frank Ch. Eigler [Fri, 12 Oct 2018 20:27:29 +0000 (16:27 -0400)]
AUTHORS bump

5 years agoFix error in sysc_msgsnd.stp regarding compat_sys_msgsnd
William Cohen [Fri, 12 Oct 2018 19:29:49 +0000 (15:29 -0400)]
Fix error in sysc_msgsnd.stp regarding compat_sys_msgsnd

5 years agoFix typos in ppc compat_fadvise64 and compat_fallocate
Jafeer Uddin [Fri, 12 Oct 2018 19:22:28 +0000 (15:22 -0400)]
Fix typos in ppc compat_fadvise64 and compat_fallocate

5 years agoAdd fallback __NR_fork define
William Cohen [Fri, 12 Oct 2018 19:02:03 +0000 (15:02 -0400)]
Add fallback __NR_fork define

The aarch64 architecture doesn't have a fork syscall, so the code
needs to have a fallback __NR_fork define for the code to be
successfully compiled on aarch64.

5 years agoFix error in sysc_msgrcv.stp regarding compat_sys_msgrcv
Jafeer Uddin [Fri, 12 Oct 2018 18:57:18 +0000 (14:57 -0400)]
Fix error in sysc_msgrcv.stp regarding compat_sys_msgrcv

5 years agoRHBZ1638874 workaround: let $SYSTEMTAP_SIGN override missing secureboot hint
Frank Ch. Eigler [Fri, 12 Oct 2018 18:33:04 +0000 (14:33 -0400)]
RHBZ1638874 workaround: let $SYSTEMTAP_SIGN override missing secureboot hint

On some Fedora kernels, EFI SecureBoot involves activating a lockdown
mode that prevents unsigned .ko's from loading.  It doesn't appear to
give any userlevel sign that this is happening, so stap couldn't
activate its secureboot / stap-server machinery.

Until the kernel does inform us properly, we let users set an
environment variable to force UEFI MOK module signing.

5 years agotestsuite :: another do_ fix in buildok/
Serhei Makarov [Fri, 12 Oct 2018 17:08:53 +0000 (13:08 -0400)]
testsuite :: another do_ fix in buildok/

5 years agodeprecate STP_USE_RING_BUFFER
Serhei Makarov [Fri, 12 Oct 2018 16:07:16 +0000 (12:07 -0400)]
deprecate STP_USE_RING_BUFFER

5 years agoPR23766: testsuite: make syscalls tests too-short-module warning proof
Frank Ch. Eigler [Fri, 12 Oct 2018 15:57:46 +0000 (11:57 -0400)]
PR23766: testsuite: make syscalls tests too-short-module warning proof

Just use longlonglong -m MODULE names.

5 years agoPR23766: tolerate staprun -R attempts on very short module names
Frank Ch. Eigler [Fri, 12 Oct 2018 15:52:20 +0000 (11:52 -0400)]
PR23766: tolerate staprun -R attempts on very short module names

We warn instead of error out.  This could mean loading conflicts
later, but that's less bad than a definite error.

5 years agoFix typo in compat_unistd.h
Jafeer Uddin [Fri, 12 Oct 2018 13:56:51 +0000 (09:56 -0400)]
Fix typo in compat_unistd.h

5 years agotestsuite :: couple more do_ tweaks
Serhei Makarov [Fri, 12 Oct 2018 00:22:53 +0000 (20:22 -0400)]
testsuite :: couple more do_ tweaks

5 years agotestsuite :: some lingering sys_open -> do_sys_open changes
Serhei Makarov [Thu, 11 Oct 2018 21:51:38 +0000 (17:51 -0400)]
testsuite :: some lingering sys_open -> do_sys_open changes

5 years agoAdjust eatkmydata.stp to work with the newer Linux kernels and tapsets
William Cohen [Thu, 11 Oct 2018 18:05:46 +0000 (14:05 -0400)]
Adjust eatkmydata.stp to work with the newer Linux kernels and tapsets

The revised tapsets generally do not use the dwarf-based kprobes and
kretprobes for syscalls on newer 4.17 Linux kernels.  As a result
target variables are not available and guru mode will not work with
them.  The eatmydata.stp example has been modified to instrument the
common do_fsync function that both syscall.fsync and syscall.fdatasync
call.  The target variable and guru mode will work on this function.

5 years agoAdjust iotime.stp to work with newer Linux kernels and sysetmtap tapset
William Cohen [Thu, 11 Oct 2018 17:41:20 +0000 (13:41 -0400)]
Adjust iotime.stp to work with newer Linux kernels and sysetmtap tapset

Newer systems may use the openat syscall instead of the open syscall,
so need to monitor openat syscall.  The probe points used by systemtap
for the syscalls do not have the target variable available via
@entry(), so need to code up iotime.stp to explicitly store values
available on syscall entry in associative arrays to have them
available for the syscall return probes.

5 years agoPR23760: allow wildcarded .statement() expansion for debug-line-less srcfiles
Frank Ch. Eigler [Thu, 11 Oct 2018 16:15:43 +0000 (12:15 -0400)]
PR23760: allow wildcarded .statement() expansion for debug-line-less srcfiles

We were overzealous with error detection for this best-effort case.

5 years agoNEWS: reword / collect the syscall tapset changes
Frank Ch. Eigler [Thu, 11 Oct 2018 00:07:05 +0000 (20:07 -0400)]
NEWS: reword / collect the syscall tapset changes

5 years agoNEWS: mention kernel 4.17+ syscall fix
Jafeer Uddin [Wed, 10 Oct 2018 19:17:37 +0000 (15:17 -0400)]
NEWS: mention kernel 4.17+ syscall fix

5 years agoAvoid using target variable and @entry() in syscall.*.return for futex examples
William Cohen [Wed, 10 Oct 2018 18:08:19 +0000 (14:08 -0400)]
Avoid using target variable and @entry() in syscall.*.return for futex examples

The update to the syscall tapsets causes SystemTap to use non-dwarf
based probe points for syscalls on linux-4.17 and newer.  The
non-dwarf based syscall instrumentation does not have the target
variables available, so the @entry() operation is not going to work.
The futex examples are revised to store the needed data into
associative arrays at syscall entry and accessed that data in the
syscall return.

5 years agoNEWS :: fxi tyops
Serhei Makarov [Wed, 10 Oct 2018 17:27:12 +0000 (13:27 -0400)]
NEWS :: fxi tyops

5 years agostapbpf.8 :: update based on recent development work
Serhei Makarov [Wed, 10 Oct 2018 17:26:39 +0000 (13:26 -0400)]
stapbpf.8 :: update based on recent development work

5 years agoPR23160,PR14690: adapt last few syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit
Jafeer Uddin [Tue, 9 Oct 2018 19:03:02 +0000 (15:03 -0400)]
PR23160,PR14690: adapt last few syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit

5 years agoAdd syscall_any.stp to buildok tests to test this new tapset.
William Cohen [Mon, 8 Oct 2018 15:09:39 +0000 (11:09 -0400)]
Add syscall_any.stp to buildok tests to test this new tapset.

5 years agoAdd really simple glib2 example.
William Cohen [Mon, 8 Oct 2018 14:05:38 +0000 (10:05 -0400)]
Add really simple glib2 example.

5 years agoAdd a simple php-trace.stp to show the tracepoints.
William Cohen [Fri, 5 Oct 2018 15:29:53 +0000 (11:29 -0400)]
Add a simple php-trace.stp to show the tracepoints.

5 years agosamples: add cve-2018-14634 security band-aid
Frank Ch. Eigler [Fri, 5 Oct 2018 15:09:42 +0000 (11:09 -0400)]
samples: add cve-2018-14634 security band-aid

5 years agoAdd stap_time.stp example.
William Cohen [Thu, 4 Oct 2018 15:38:49 +0000 (11:38 -0400)]
Add stap_time.stp example.

5 years agorhbz1629623: adapt to CONFIG_HAVE_ARCH_PREL32_RELOCATIONS tracepoint enumeration
Frank Ch. Eigler [Thu, 4 Oct 2018 02:03:28 +0000 (22:03 -0400)]
rhbz1629623: adapt to CONFIG_HAVE_ARCH_PREL32_RELOCATIONS tracepoint enumeration

Kernel commit 46e0c9be206fa7b (4.19-rc1) makes the mod->tracepoints_ptrs[]
contain pointer-relative-offsets instead of normal pointers.
We must follow suit to avoid a crash.

5 years agoPR23160,PR14690: adapt 31 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit
Jafeer Uddin [Wed, 3 Oct 2018 15:37:04 +0000 (11:37 -0400)]
PR23160,PR14690: adapt 31 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit

5 years agoFix typos in exists.stp
Masanari Iida [Tue, 2 Oct 2018 04:07:58 +0000 (13:07 +0900)]
Fix typos in exists.stp

This patch fixes some spellint typo found in
/testsuite/systemtap.maps/exists.stp

5 years agoAdd a comment in thread-times.stp to clarify the reason for *10000 in the code.
William Cohen [Tue, 2 Oct 2018 15:44:50 +0000 (11:44 -0400)]
Add a comment in thread-times.stp to clarify the reason for *10000 in the code.

5 years agostapbpf assembler WIP #2 :: testcases (no driver so far)
Serhei Makarov [Mon, 1 Oct 2018 19:39:00 +0000 (15:39 -0400)]
stapbpf assembler WIP #2 :: testcases (no driver so far)

5 years agostapbpf assembler WIP #1 :: basic parser and control flow
Serhei Makarov [Mon, 1 Oct 2018 19:38:16 +0000 (15:38 -0400)]
stapbpf assembler WIP #1 :: basic parser and control flow

5 years agoAdd some Tcl examples.
William Cohen [Mon, 1 Oct 2018 15:45:22 +0000 (11:45 -0400)]
Add some Tcl examples.

5 years agoCorrect to use @hist_log in description.
William Cohen [Mon, 1 Oct 2018 15:16:41 +0000 (11:16 -0400)]
Correct to use @hist_log in description.

6 years agoFix a typo in api.cxx
Masanari Iida [Wed, 19 Sep 2018 04:03:51 +0000 (13:03 +0900)]
Fix a typo in api.cxx

This patch fix a spelling typo in error message.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
6 years agoChange the tapset file name to get matching tapset::syscall_any manpage
William Cohen [Thu, 27 Sep 2018 14:48:14 +0000 (10:48 -0400)]
Change the tapset file name to get matching tapset::syscall_any manpage

The automated generation of man pages uses the file name to generate
the manpage names.  Adjusted the name to get a matching tapset man
page for syscall_any{.return} probe points.

6 years agoConvert the various systemtap examples to use the syscall any tapset
William Cohen [Fri, 21 Sep 2018 02:50:16 +0000 (22:50 -0400)]
Convert the various systemtap examples to use the syscall any tapset

To make the examples cleaner use the new syscall any tapset.  This avoids
exposing the systemtap internal function _stp_syscall_nr() and makes the
instrumentation look a bit more like the traditional syscall.* probe points.

6 years agoAdd the syscall_any and syscall_any.return probe points
William Cohen [Fri, 21 Sep 2018 00:33:17 +0000 (20:33 -0400)]
Add the syscall_any and syscall_any.return probe points

The syscall.*{.return} and np_syscall.*.{.return} end up expanding to
large amount of code that takes a signficant amount of time to
compile.  The resulting kernel module also takes a fair amount of time
to install and remove the instrumentation when it starts and shuts
down.  For instrumentation don't really care about the details of the
syscall arguments it would be preferable to use the sys_enter and sys_exit
tracepoints to more efficiently probe the one or two places.

Using tp_syscall.*{.return} end up generating a lot of code to
determine which of the hundreds of syscall is being used and then runs
the same handler.  The syscall_any and syscall_any.return eliminate
that undesired overhead by just looking up the syscall name in a
table.

6 years agoAdjust comment in tapset/errno.stp so the documentation can be built.
William Cohen [Thu, 20 Sep 2018 18:50:39 +0000 (14:50 -0400)]
Adjust comment in tapset/errno.stp so the documentation can be built.

6 years agoUse sys_enter and sys_exit tracepoints in place of syscall.*{.return}
William Cohen [Mon, 17 Sep 2018 20:58:09 +0000 (16:58 -0400)]
Use sys_enter and sys_exit tracepoints in place of syscall.*{.return}

The common probe point idiom of syscall.* and syscall.*.return can be
replaced with equivalent sys_enter and sys_exit tracepoints for a
number of the example scripts.  The advantages are:

-Quicker compilation of the script into instrumenation
-Smaller kernels modules for the instrumentation
-Lower overhead for probe points

This changes are not applicable to all uses use syscall.* and
syscall.*.return. The predefined variable such as argstr are not
available for the sys_enter and sys_exit trace points.

Some of the revised examples are using the internal _stp_syscall_nr())
function.  A user visible version of this function should be
available.

6 years agoFix typo on s390 nd_syscall.compat_fallocate probe point.
William Cohen [Fri, 21 Sep 2018 19:44:24 +0000 (15:44 -0400)]
Fix typo on s390 nd_syscall.compat_fallocate probe point.

6 years agoUse existing "limits" keyword for cpu_throttle.stp example.
William Cohen [Fri, 21 Sep 2018 18:38:16 +0000 (14:38 -0400)]
Use existing "limits" keyword for cpu_throttle.stp example.

6 years agoAdd ioctl_handler.stp example
William Cohen [Fri, 21 Sep 2018 18:36:16 +0000 (14:36 -0400)]
Add ioctl_handler.stp example

6 years agoPR23160,PR14690: adapt 32 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit
Jafeer Uddin [Thu, 20 Sep 2018 20:56:35 +0000 (16:56 -0400)]
PR23160,PR14690: adapt 32 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit

6 years agoNote the need for debuginfo for threadstacks.stp.
William Cohen [Mon, 17 Sep 2018 18:54:46 +0000 (14:54 -0400)]
Note the need for debuginfo for threadstacks.stp.

6 years agoPR23160,PR14690: adapt 27 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit
Jafeer Uddin [Mon, 17 Sep 2018 14:27:25 +0000 (10:27 -0400)]
PR23160,PR14690: adapt 27 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit

6 years agoFix a regression that reading 64-bit registers on x86_64 was broken
Yichun Zhang (agentzh) [Mon, 17 Sep 2018 07:34:52 +0000 (00:34 -0700)]
Fix a regression that reading 64-bit registers on x86_64 was broken

This bug first appeared in commit 345537c32.

6 years agoFix the register() and u_register() tapset functions for x86
Yichun Zhang (agentzh) [Sun, 16 Sep 2018 06:42:16 +0000 (23:42 -0700)]
Fix the register() and u_register() tapset functions for x86

The register() and u_register() functions incorrectly read 16-bit
x86 registers as 32-bit on both i386 and x86_64.

Fixed the sign-extension of register values on i386.

Fixed a compilation error when using *register() in the dyninst
runtime mode on x86_64.

Also added support for 8-bit x86 reigsters like "al" and "bh" on both
i386 and x86_64.

6 years agoPR23599 Bugfix: the embeddedcode info pass incorrectly skipped unused functions
Yichun Zhang (agentzh) [Sun, 16 Sep 2018 01:08:58 +0000 (18:08 -0700)]
PR23599 Bugfix: the embeddedcode info pass incorrectly skipped unused functions

This bug led to kernel module compilation errors when using tapset
functions like usym* in unoptimized stap translation mode (i.e., stap
-u).

6 years agoPR23666 Fix a bug in semantic analysis of aggregate operators in foreach sorting
Yichun Zhang (agentzh) [Sun, 16 Sep 2018 00:06:59 +0000 (17:06 -0700)]
PR23666 Fix a bug in semantic analysis of aggregate operators in foreach sorting

When aggregate operators like @count, @sum, and etc were used in the
foreach loop sorting criteria but not in the foreach loop body, then
these sorting criteria were not respected by the translator in the
generated code.

This bug affected both the kernel and dyninst runtime modes.

6 years agoditto
Frank Ch. Eigler [Fri, 14 Sep 2018 23:38:51 +0000 (19:38 -0400)]
ditto

6 years agodummy commit for ci trigger
Frank Ch. Eigler [Fri, 14 Sep 2018 21:59:47 +0000 (17:59 -0400)]
dummy commit for ci trigger

6 years agospin-rawhide: accelerate git checkout
Frank Ch. Eigler [Fri, 14 Sep 2018 19:28:55 +0000 (15:28 -0400)]
spin-rawhide: accelerate git checkout

Use this script's directory as a git clone --reference

6 years agoDo some testing of the sizeof_interactive.stp script.
William Cohen [Fri, 14 Sep 2018 19:19:56 +0000 (15:19 -0400)]
Do some testing of the sizeof_interactive.stp script.

6 years agoIgnore the error value returned by the find command for the slowvfs.stp
William Cohen [Fri, 14 Sep 2018 18:13:08 +0000 (14:13 -0400)]
Ignore the error value returned by the find command for the slowvfs.stp

Some files in /proc are unreadable by normal users. When the find
command encounters these files find returns a non-zero value on exit.
The test is just using the find to create some load and really wants
to discard the error result otherwise the install test for slowvfs.stp
will fail.

6 years agoAdd the libguestfs example.
William Cohen [Thu, 13 Sep 2018 18:01:44 +0000 (14:01 -0400)]
Add the libguestfs example.

6 years agoPR23608 refine_*: replace assertion failure with regex_error
Serhei Makarov [Wed, 12 Sep 2018 20:22:46 +0000 (16:22 -0400)]
PR23608 refine_*: replace assertion failure with regex_error

6 years agotestsuite configury: typo fix for make check, transcribe dejagnu summary exactly
Frank Ch. Eigler [Wed, 12 Sep 2018 15:58:35 +0000 (11:58 -0400)]
testsuite configury: typo fix for make check, transcribe dejagnu summary exactly

Fix $-vs-$$ quoting typo in Makefile.

6 years agosyscalls: adapt sample scripts: syscall.*.return returnval() -> retval
Frank Ch. Eigler [Wed, 12 Sep 2018 17:51:28 +0000 (13:51 -0400)]
syscalls: adapt sample scripts: syscall.*.return returnval() -> retval

Demonstrate post-4.0 style in our distributed samples.

6 years agoPR23160,PR14690: convert syscall.*.return aliases to @SYSC_SETRETVAL retval/retstr
Frank Ch. Eigler [Wed, 12 Sep 2018 17:30:44 +0000 (13:30 -0400)]
PR23160,PR14690: convert syscall.*.return aliases to @SYSC_SETRETVAL retval/retstr

Adjust all syscall.*.return aliases to a new macro for provision of new
retval, old retstr, and the temporary returnval() compatibility hack.
All hail /bin/sed, mother of /bin/ed, which made this operation bearable.

6 years agoPR23160,PR14690: prep returnval() for an extra side-channel of data
Frank Ch. Eigler [Wed, 12 Sep 2018 17:07:53 +0000 (13:07 -0400)]
PR23160,PR14690: prep returnval() for an extra side-channel of data

To permit tracepoint-based syscall probe-aliases to provide return values
to scripts, returnval() needs an extension.  This patch adds a pair of
new values to the context, conditional on version <= 4.0.  (The retval
value will be the next better approach, coming in a followup patch.)

https://sourceware.org/ml/systemtap/2018-q3/msg00167.html

6 years agotestsuite configury: for make check, transcribe dejagnu summary exactly
Frank Ch. Eigler [Wed, 12 Sep 2018 15:58:35 +0000 (11:58 -0400)]
testsuite configury: for make check, transcribe dejagnu summary exactly

Use a bit of sed magic to tail systemtap.sum more precisely.

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