qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] scripts/kvm/kvm_stat: Fix tracefs access checki


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] scripts/kvm/kvm_stat: Fix tracefs access checking
Date: Wed, 3 Feb 2016 08:55:24 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0


On 03/02/2016 08:41, Janosch Frank wrote:
> The following patch fixes the access checking behavior changed in
> 7aa4ee5. Kvm_stat will now fall back to debugfs statistics if the
> tracefs ones were chosen but are not available. It will then print a
> warning and wait five seconds until it continues.
> 
> Five seconds are not long, but I do not want to annoy users with
> longer delays and the message is still visible after closing
> kvm_stat.
> 
> Janosch Frank (1):
>   scripts/kvm/kvm_stat: Fix tracefs access checking
> 
>  scripts/kvm/kvm_stat | 20 +++++++++++++++-----
>  1 file changed, 15 insertions(+), 5 deletions(-)
> 

I think exiting is better if the -t flag is explicitly passed:

diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
index bab34bb..3cf1181 100755
--- a/scripts/kvm/kvm_stat
+++ b/scripts/kvm/kvm_stat
@@ -796,11 +796,12 @@ def check_access(options):
         sys.stderr.write("Please enable CONFIG_TRACING in your kernel "
                          "when using the option -t (default).\n"
                          "If it is enabled, make {0} readable by the "
-                         "current user.\n"
-                         "Falling back to debugfs statistics!\n"
-                         .format(PATH_DEBUGFS_TRACING))
+                         "current user.\n")
+        if options.tracepoints:
+            sys.exit(1)
+
+        sys.stderr.write("Falling back to debugfs statistics!\n"
         options.debugfs = True
-        options.tracepoints = False
         sleep(5)

     return options

Otherwise okay.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]