mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
scripts: dtrace2systemtap: Fix argument name extraction regex to avoid '*' in names
When commitd249170bf6modified the arguments of 'virNetTLSContextNew' which has a systemtap probe defined the 'dtrace2systemtap' script was no longer to correctly generate the definitions for it. First problem which stemmed from mis-detecting the string array argumment as string, which would use 'user_string' to extract it was fixed incb33103c4a. After that the generated probe is still not correct because it doesn't strip all the '*' from pointers and thus for double pointers it generates the following invalid definition: probe libvirt.rpc.tls_context_new = process("/usr/lib64/libvirt.so").mark("rpc_tls_context_new") { ctxt = $arg1; cacert = user_string($arg2); cacrl = user_string($arg3); *cert = $arg4; *keys = $arg5; sanityCheckCert = $arg6; requireValidCert = $arg7; isServer = $arg8; } Leading to the following failure: # stap -ve 'probe oneshot {exit()}' parse error: expected literal string or number saw: operator '*' at /usr/share/systemtap/tapset/libvirt_probes-64.stp:204:3 source: *cert = $arg4; ^ 1 parse error. To address the issue the regex extracting the arguments needs to optionally match any number of '*' instead of just one. Resolves: https://issues.redhat.com/browse/RHEL-153832 Fixes:cb33103c4aSigned-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
1 parent
95d29b66b4
commit
954036635a
1 file changed
+1
-1
@@ -127,7 +127,7 @@ for file in filelist:
|
||||
if re.match(r'''.*char\s\*[^\*].*''', arg) is not None:
|
||||
isstr = True
|
||||
|
||||
m = re.search(r'''^.*\s\*?(\S+)$''', arg)
|
||||
m = re.search(r'''^.*\s\**(\S+)$''', arg)
|
||||
if m is not None:
|
||||
arg = m.group(1)
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user