This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/23391] New: support {,foo,bar} alternation in wildcards
- From: "fche at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Mon, 09 Jul 2018 18:16:11 +0000
- Subject: [Bug translator/23391] New: support {,foo,bar} alternation in wildcards
- Auto-submitted: auto-generated
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.