summaryrefslogtreecommitdiffstats
path: root/tapset/string.stp
Commit message (Collapse)AuthorAgeFilesLines
* PR 9871 (partial) fix. Removed some embedded-C in ioblock.stp/vfs.stp.David Smith2010-03-301-0/+14
| | | | | | | | | * 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.
* Use clamping to more easily normalize input valuesJosh Stone2010-02-161-4/+5
| | | | | | 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.
* Convert string.stp documentation to standard markup.Mark Wielaard2009-12-011-53/+76
| | | | | | * doc/SystemTap_Tapset_Reference/tapsets.tmpl: Add string.stp chapter. * tapset/string.stp: Convert documentation to standard markup and add documentation that was missing.
* PR10650: markup some unprivileged-safe tapset functionsFrank Ch. Eigler2009-09-161-10/+10
| | | | | | | | | | | | | | | | | 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().
* Remove unused strlens from str_replaceJosh Stone2009-06-221-2/+0
|
* Add str_replace() To TapsetsVarun Chandramohan2009-06-221-0/+33
| | | | | | | | | | | | | | | | | | 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>
* Fix tokenize function and test.Przemyslaw Pawelczyk2009-06-171-8/+15
| | | | | | | | | | | | | | | | | 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>
* Add function of returning the char in given position of stringWenji Huang2009-04-261-0/+12
| | | | | | * tapset/string.stp: New function stringat. * testsuite/systemtap.printf/char1.exp: Update test case. * testsuite/systemtap.printf/char1.stp: Ditto.
* 2007-02-06 Josh Stone <joshua.i.stone@intel.com>jistone2007-02-071-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Added new string functions tokenize() and strtol().mmason2007-01-231-0/+32
|
* 2006-09-18 Martin Hunt <hunt@redhat.com>hunt2006-09-181-1/+1
| | | | | * logging.stp (stp_print_binary): New function. * string.stp: Fix docs.
* 2006-08-21 Martin Hunt <hunt@redhat.com>hunt2006-08-211-16/+11
| | | | | * string.stp (substr): Rewrite. Make the 3rd parameter be the length.
* *** empty log message ***hunt2006-07-111-2/+2
|
* 2006-05-30 Martin Hunt <hunt@redhat.com>hunt2006-05-301-0/+19
| | | | | * string.stp (text_str): New. (text_strn): New.
* 2006-04-25 Frank Ch. Eigler <fche@elastic.org>fche2006-04-251-3/+3
| | | | | | | | | | | | | | | | | 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.
* 2006-02-01 Martin Hunt <hunt@redhat.com>hunt2006-02-011-0/+23
| | | | | | | * syscalls.stp: New syscall file. * syscall2.stp: More syscalls. * i686/syscalls.stp: x86-specific calls. * x86_64/syscalls.stp: x86_64-specific calls.
* mask_string.stpkevinrs2005-09-291-0/+7
| | | | | | | | | 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
* tapset/mask_string.stp:kevinrs2005-09-281-0/+18
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