public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/20988] New: string tapset could use a strstr() type function
@ 2016-12-21 22:03 dsmith at redhat dot com
  2016-12-21 22:05 ` [Bug tapsets/20988] " fche at redhat dot com
  2017-04-10  3:48 ` mcermak at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2016-12-21 22:03 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20988

            Bug ID: 20988
           Summary: string tapset could use a strstr() type function
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: dsmith at redhat dot com
  Target Milestone: ---

The string tapset has a function called 'instr()' that tells you if a substring
is present in a string, but the caller doesn't know where that substring is in
the string. It would be nice to have a tapset function that returns the index
of where a substring starts in a string. Then you could use the 'substr()'
tapset function to extract the string parts before and after a substring.

If the substring doesn't exist in string, the new tapset function should raise
an error.

Here's an example in action:

  # You've got a string that is in the general format 'FIRST.LAST'.
  # You want to break that string down into its parts.
  full = "David.Smith"

  # Find the index of the '.' character  
  index = NEW_FUNCTION(full, ".")

  # Extract the first part of the string
  first = substr(full, 0, index)

  # Extract the last part of the string
  last = substr(full, index + 1, strlen(full) - index - 1)

(I haven't checked all the indexing logic in the above example, but the idea is
there.)

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tapsets/20988] string tapset could use a strstr() type function
  2016-12-21 22:03 [Bug tapsets/20988] New: string tapset could use a strstr() type function dsmith at redhat dot com
@ 2016-12-21 22:05 ` fche at redhat dot com
  2017-04-10  3:48 ` mcermak at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fche at redhat dot com @ 2016-12-21 22:05 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20988

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fche at redhat dot com

--- Comment #1 from Frank Ch. Eigler <fche at redhat dot com> ---
See also function::tokenize() and bug #15065.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tapsets/20988] string tapset could use a strstr() type function
  2016-12-21 22:03 [Bug tapsets/20988] New: string tapset could use a strstr() type function dsmith at redhat dot com
  2016-12-21 22:05 ` [Bug tapsets/20988] " fche at redhat dot com
@ 2017-04-10  3:48 ` mcermak at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: mcermak at redhat dot com @ 2017-04-10  3:48 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20988

Martin Cermak <mcermak at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mcermak at redhat dot com
           Assignee|systemtap at sourceware dot org    |mcermak at redhat dot com

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-10  3:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-21 22:03 [Bug tapsets/20988] New: string tapset could use a strstr() type function dsmith at redhat dot com
2016-12-21 22:05 ` [Bug tapsets/20988] " fche at redhat dot com
2017-04-10  3:48 ` mcermak at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).