| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
* tapset/dev.stp: Added a bdevname() script function.
* tapset/ioblock.stp: Rewrote the embedded-C devname function to just use
bdevname() script function.
* tapset/vfs.stp: Removed embedded-C __bdevname() C function. Calls
bdevname() script function instead.
* tapset/string.stp: Added isdigit() function.
|
|
|
|
|
|
| |
The kernel has min/max/clamp macros to make range comparisons easier.
Clamp is a newer invention, but we can define it for older kernels in
terms of min and max.
|
|
|
|
|
|
| |
* doc/SystemTap_Tapset_Reference/tapsets.tmpl: Add string.stp chapter.
* tapset/string.stp: Convert documentation to standard markup and add
documentation that was missing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add /* unprivileged */ to a variety of tapset embedded-c functions,
together with uid-assertion-checking code as needed. This is only
an initial set, and may need to grow or shrink after further testing.
Prototyped-By: Dave Brolley <brolley@redhat.com>
* runtime/runtime.h (is_myproc, assert_is_myproc): New macros.
* runtime/addr-map.c (lookup_bad_addr): Reject if !is_myproc
in unprivileged mode.
* runtime/print.c (_stp_print_kernel_info): Add unprivileged
mode info.
* tapset/DEVGUIDE: Document /* pure */ and /* unprivileged */.
* tapset/*.stp: Add /* unprivileged */ here and there, in
questionable cases along with an assert_is_myproc().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a search and replace string functionality to existing
tapsets.
The functionality is as follows:
The function takes in a parent string and searches for a substring as
specified by the user. If substring not found, the parent string is
returned. If substring is found, it is replaced by another string and
returned.
NOTE: The function will search and replace all the occurrence of
substrings in a parent string when matched.
Signed-off-by: Varun Chandramohan <varunc@linux.vnet.ibm.com>
Signed-off-by: Josh Stone <jistone@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previous implementation was error-prone, because allowed returning empty
tokens (mimiced strsep()), which is fine if there is a NULL semantic.
Unfortunately SystemTap doesn't provide it in scripts and has only blank
string (""), therefore testing against it was misleading.
The solution is to return only non-empty tokens (mimic strtok()).
* tapset/string.stp: Fix tokenize.
* testsuite/systemtap.string/tokenize.stp: Improve and add case with
more than one delimiter in the delim string.
* testsuite/systemtap.string/tokenize.exp: Ditto.
* stapfuncs.3stap.in: Update tokenize description.
* doc/langref.tex: Ditto.
Signed-off-by: Josh Stone <jistone@redhat.com>
|
|
|
|
|
|
| |
* tapset/string.stp: New function stringat.
* testsuite/systemtap.printf/char1.exp: Update test case.
* testsuite/systemtap.printf/char1.stp: Ditto.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* aux_syscalls.stp, inet_sock.stp, ioblock.stp, ioscheduler.stp,
nfs.stp, nfs_proc.stp, nfsd.stp, rpc.stp, scsi.stp, signal.stp,
socket.stp, task.stp, tcp.stp, vfs.stp: Protect pointer dereferences
with kread wherever possible. Some places still have hazards, as
marked with FIXMEs.
* errno.stp (returnstr): Don't use return in tapset C functions.
* aux_syscalls.stp (__uget_timex_m): Ditto.
* nfsd.stp (__get_fh): Ditto.
* nfs.stp, vfs.stp (<many functions>): Ditto.
* string.stp (substr): Ditto. Also make sure start index is valid.
* syscalls.stp (syscall.execve): Change __string to kernel_string.
LKET/
* nfs.stp, nfs_proc.stp, nfsd.stp, process.stp, tskdispatch.stp:
Protect pointer dereferences with kread wherever possible. Some
places still have hazards, as marked with FIXMEs.
* aio.stp (log_io_getevents): Don't use return in tapset C functions.
* timestamp.stp (set_timing_method): Ditto.
* utils.stp (filter_by_pid): Ditto.
|
| |
|
|
|
|
|
| |
* logging.stp (stp_print_binary): New function.
* string.stp: Fix docs.
|
|
|
|
|
| |
* string.stp (substr): Rewrite. Make the 3rd parameter
be the length.
|
| |
|
|
|
|
|
| |
* string.stp (text_str): New.
(text_strn): New.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 2427.
* staptree.cxx (varuse_collecting_visitor::visit_embeddedcode):
Support /* pure */ declaration. Stop using __tvar_ naming hack.
(v_c_u::visit_print_format): Mark sprint and sprintf as
side-effect-free.
(deep_copy_visitor::visit_print_format): Propagate raw_components.
* stap.1.in: Document declaration.
* elaborate.cxx (semantic_pass_opt2): Verbose message tweak.
(dead_stmtexpr_remover): Extend for more aggressive optimization.
* tapsets.cxx (dwarf,mark_var_expanding_copy_visotor): Add
/* pure */ declaration to rvalue expansions.
* tapset/*.stp: Added /* pure */ declarations to many functions.
* testsuite/parseok/unparsers.stp: Propagate guru mode flag.
* testsuite/buildok/twentyfour.stp: New test.
|
|
|
|
|
|
|
| |
* syscalls.stp: New syscall file.
* syscall2.stp: More syscalls.
* i686/syscalls.stp: x86-specific calls.
* x86_64/syscalls.stp: x86_64-specific calls.
|
|
|
|
|
|
|
|
|
| |
function uses different algorithm to build symbolic
flag string from int. Now uses locals to do so. SMP
safe.
string.stp
add isinstr(s1,s2) - return 1 if s1 contains s2 else
return 0
|
|
wrote a few aux functions that can be used by tapsets to derive
a bitmask symbolic string from a given number
tapset/string.stp:
strlen: Returns the length of the string argument
substr: Returns a substring starting at start/ending at stop
stapfuncs.5.in:
Added a STRING category with aforementioned functions
tapset/system_calls.stp
Exported more variable for more system calls
|