]> granicus.if.org Git - strace/blobdiff - filter_qualify.c
tests: check decoding of vcpu auxstr
[strace] / filter_qualify.c
index 9b5569c320923503295cfe80d83e9151f773511e..e28c67298b27888a446ec2208f2c98ddef868580 100644 (file)
@@ -405,6 +405,21 @@ qualify_inject(const char *const str)
        qualify_inject_common(str, false, "inject argument");
 }
 
+#ifdef HAVE_LINUX_KVM_H
+static void
+qualify_kvm(const char *const str)
+{
+       if (strcmp(str, "vcpu") == 0) {
+               if (os_release >= KERNEL_VERSION(4, 16, 0))
+                       kvm_run_structure_decoder_init();
+               else
+                       error_msg("-e kvm=vcpu option needs Linux 4.16.0 or higher");
+       } else {
+               error_msg("unknown value for -e kvm= option: %s", str);
+       }
+}
+#endif
+
 static const struct qual_options {
        const char *name;
        void (*qualify)(const char *);
@@ -428,6 +443,9 @@ static const struct qual_options {
        { "w",          qualify_write   },
        { "fault",      qualify_fault   },
        { "inject",     qualify_inject  },
+#ifdef HAVE_LINUX_KVM_H
+       { "kvm",        qualify_kvm     },
+#endif
 };
 
 void