From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQsHl-0005IW-5I for qemu-devel@nongnu.org; Wed, 03 Feb 2016 02:55:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQsHg-0002pw-2d for qemu-devel@nongnu.org; Wed, 03 Feb 2016 02:55:33 -0500 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:35681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQsHf-0002ps-Rd for qemu-devel@nongnu.org; Wed, 03 Feb 2016 02:55:27 -0500 Received: by mail-wm0-x22b.google.com with SMTP id r129so152036624wmr.0 for ; Tue, 02 Feb 2016 23:55:27 -0800 (PST) Sender: Paolo Bonzini References: <1454485291-43849-1-git-send-email-frankja@linux.vnet.ibm.com> From: Paolo Bonzini Message-ID: <56B1B26C.3080709@redhat.com> Date: Wed, 3 Feb 2016 08:55:24 +0100 MIME-Version: 1.0 In-Reply-To: <1454485291-43849-1-git-send-email-frankja@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] scripts/kvm/kvm_stat: Fix tracefs access checking List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Janosch Frank , qemu-devel@nongnu.org Cc: borntraeger@de.ibm.com 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