public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/23391] New: support {,foo,bar} alternation in wildcards
@ 2018-07-09 18:16 fche at redhat dot com
  2018-10-18 17:23 ` [Bug translator/23391] " fche at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: fche at redhat dot com @ 2018-07-09 18:16 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 23391
           Summary: support {,foo,bar} alternation in wildcards
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: fche at redhat dot com
            Blocks: 23160
  Target Milestone: ---

The systemtap script language supports wildcards in a variety of settings:
- process probe file names
- module names
- function names
- file names
... and many others.  See calls to glob() and fnmatch() in the source tree.

In most or all of these cases, the {,a,b} csh-style alternation syntax would
come in handy.  In particular, but #23160 needs a way of intercepting
"__$arch_sys_$syscall" functions, where $arch is the alternation of "ia32" and
"x64" (on x86-64), but excludes "do" (which is an arch-sensitive lower level
handler we do NOT want to probe).

So what we'd like, in the end, is this to work:

@define arch_syscall_prefix "{ia32,x64}"  # arch-specific macro

probe kprobe.function("__" @arch_syscall_prefix "_sys_read") { .... }  #
generic

To do this, in contexts where glob(3) is used, we simply need to add the
GLOB_BRACE flag bit.  In contexts where fnmatch(3) is used, it's not so simple,
because this uses a different syntax in FNM_EXTMATCH mode.  So we need a
csh-to-ksh transformation function that takes

    fo*o{,bar,ba{do,doo}}ba[xyz]r

and maps them to

    fo*o@(|bar|ba@(do|doo))ba[xyz]r

strings, just before passing them to fnmatch(... FNM_EXTMATCH).  These can be
done probably throughout the code base, maybe subject to --compatible=4,
maybe not.


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=23160
[Bug 23160] 4.17 breaks syscalls tapset
-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug translator/23391] support {,foo,bar} alternation in wildcards
  2018-07-09 18:16 [Bug translator/23391] New: support {,foo,bar} alternation in wildcards fche at redhat dot com
@ 2018-10-18 17:23 ` fche at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: fche at redhat dot com @ 2018-10-18 17:23 UTC (permalink / raw)
  To: systemtap

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Frank Ch. Eigler <fche at redhat dot com> ---
done earlier as part of syscall 4.17 rework

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

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

end of thread, other threads:[~2018-10-18 17:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-09 18:16 [Bug translator/23391] New: support {,foo,bar} alternation in wildcards fche at redhat dot com
2018-10-18 17:23 ` [Bug translator/23391] " fche 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).