]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
scripts: avoid matching 'char **' as string for systemtap
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 16 Feb 2026 10:00:48 +0000 (10:00 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 16 Feb 2026 14:41:31 +0000 (14:41 +0000)
When a probe argument is declared "char *" we reference the userspace
string value using 'user_string(...)' for systemtap.

Unfortunately our code generator also matches on args declared "char **"
and generates bogus code

   *cert = user_string($arg4);

which is a syntax error for systemtap.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
scripts/dtrace2systemtap.py

index 506db9c5033dfc40ef257280feb47b35fb7f5f33..361dab1075f38c35f5b1ca77079641072e3f3e1d 100755 (executable)
@@ -124,7 +124,7 @@ for file in filelist:
         for idx in range(len(argbits)):
             arg = argbits[idx]
             isstr = False
-            if 'char *' in arg:
+            if re.match(r'''.*char\s\*[^\*].*''', arg) is not None:
                 isstr = True
 
             m = re.search(r'''^.*\s\*?(\S+)$''', arg)