From patchwork Wed Feb 3 07:55:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 8198951 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BCEDF9F38B for ; Wed, 3 Feb 2016 07:55:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 22AA320142 for ; Wed, 3 Feb 2016 07:55:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 71A86201C7 for ; Wed, 3 Feb 2016 07:55:46 +0000 (UTC) Received: from localhost ([::1]:33093 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQsHx-0005J7-ME for patchwork-qemu-devel@patchwork.kernel.org; Wed, 03 Feb 2016 02:55:45 -0500 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=r7B5kFZlqhYWiITstL+toWQF1FWdO3ktyV11Oh0yjpE=; b=vdOC1XtXKDeOz7tbHX23kU1oD0h20Br4c4PswWruddspcYfbCSYxgaDQr1H3xwa+Q3 iMt2Xj/5x7zrBkuzpS28Yf3yuv33rSntqOyP6y4Lk2NyQhpGyQKnLXRS+PMA8ihafcto KrZX70UbEUVAPXGJ4P+BJORQQYVZIuLUhUjTADYC8jIIBMAEx57px9rRzUIaVum4J1P7 u0+VM7fezMwpTWBNnReM+uFZOwoQEyAjE8BhwYL2FlgUPcCbwFWUB5jpAHIHR4cKHlBh Ya/jptGU0wPb6g6Dn/dpfd4iYxak6ai0sVFD6yYyOkRvMGPKw+r02ij/uJ6sNnO81meb OsxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=r7B5kFZlqhYWiITstL+toWQF1FWdO3ktyV11Oh0yjpE=; b=PF930bZzmaeLQvX08GtpfddhXBEcaudMv8zSBcKs/5/ygX4aSBJsE/iBv/8RJoNuG7 GVusgBb5ru/DGOYB3uRa480bPO7nlC2gvS3WSu8g6Pv7aylpp2FrIenbE0AP33zm32BW 2KUmxcd3sn6o5s6EzsTa0sTuVF39pQhv9XFKDevOo61/d0Q2pqD4SsoZt6VO+gPNJJax dAi99yfq7k81ZyVUWre1AhTYH5hU6es1OC0uW4Xt3rbW0tJQX1FKS72TRixbQGSP6X+U I6C6F1bgJ9whb1OIQkQriPtJIo0A+9tQus1NYJymt74ZKjHlXJPsQFG/krlvLIR0X2YD 65wA== X-Gm-Message-State: AG10YOSv0HUoPN8azGODYPnn08csNydkgk/NIVqbcZZ5JXTyAHds8/Ho/a3PrWRWLrozBA== X-Received: by 10.28.63.85 with SMTP id m82mr21311987wma.55.1454486126905; Tue, 02 Feb 2016 23:55:26 -0800 (PST) Received: from [10.1.186.41] ([80.188.125.194]) by smtp.googlemail.com with ESMTPSA id u130sm19994557wmg.15.2016.02.02.23.55.25 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 02 Feb 2016 23:55:25 -0800 (PST) To: Janosch Frank , qemu-devel@nongnu.org References: <1454485291-43849-1-git-send-email-frankja@linux.vnet.ibm.com> From: Paolo Bonzini X-Enigmail-Draft-Status: N1110 Message-ID: <56B1B26C.3080709@redhat.com> 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 MIME-Version: 1.0 In-Reply-To: <1454485291-43849-1-git-send-email-frankja@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22b Cc: borntraeger@de.ibm.com Subject: Re: [Qemu-devel] [PATCH] scripts/kvm/kvm_stat: Fix tracefs access checking X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Otherwise okay. Paolo 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