From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F7DCC433EF for ; Tue, 1 Feb 2022 16:11:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1298510E2EE; Tue, 1 Feb 2022 16:11:08 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 68C3010E2C0; Tue, 1 Feb 2022 16:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643731867; x=1675267867; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=y8jsEsb7/VhhRVT4gBPGpbL8TwdS1PLCzpx0TmwPbxY=; b=kCS3p9IcyIQfxcfuwif1p+xIE9nWSK5mzzacUMRdsqJqbbL+NK3zLawW ANG4prn0H8f+gA2RJOcvRpE3gxqUzlTXhYsScUX6Za2kQlE+P0sBo4nCk GLdS4cho8PdjQhoAUlHVzzlHbHsNcV8hGjVTDo7mytOFnSYilnZTSj9Yt MaagEPItoRZdfgJGvPz+Z1O8xHwPU1Drcf9t8gPLnGC5z4KRU0NAMO/Qn 6BySMibn8eFB3pHTDB4XqwZSf+wutoWg3NIF2fMcRtv41I/mittzX5Yrg 3avVj4VsQQ8quJdT5kYgE6T6QNaMeZDqXnWMAey2bj7PmGdSEZDs9N3fN Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10244"; a="272202530" X-IronPort-AV: E=Sophos;i="5.88,334,1635231600"; d="scan'208";a="272202530" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2022 08:10:19 -0800 X-IronPort-AV: E=Sophos;i="5.88,334,1635231600"; d="scan'208";a="626774766" Received: from adixit-mobl1.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.160.202]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2022 08:10:18 -0800 Date: Tue, 01 Feb 2022 08:10:17 -0800 Message-ID: <87h79i4lg6.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Tvrtko Ursulin In-Reply-To: <20220201151946.258360-1-tvrtko.ursulin@linux.intel.com> References: <20220201151946.258360-1-tvrtko.ursulin@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [PATCH i-g-t] intel_gpu_top: Improve error message when insufficient privilege X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, 01 Feb 2022 07:19:46 -0800, Tvrtko Ursulin wrote: > > From: Tvrtko Ursulin > > Print out end user friendly help text when the running user has > insufficient privilege for accessing system wide performance counters. Reviewed-by: Ashutosh Dixit > Signed-off-by: Tvrtko Ursulin > Issue: https://gitlab.freedesktop.org/drm/intel/-/issues/5018 > --- > tools/intel_gpu_top.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c > index 81c724d1fe1c..0404a5881b40 100644 > --- a/tools/intel_gpu_top.c > +++ b/tools/intel_gpu_top.c > @@ -1761,6 +1761,15 @@ int main(int argc, char **argv) > if (ret) { > fprintf(stderr, > "Failed to initialize PMU! (%s)\n", strerror(errno)); > + if (errno == EACCES && geteuid()) > + fprintf(stderr, > +"\n" > +"When running as a normal user CAP_PERFMON is required to access performance\n" > +"monitoring. See \"man 7 capabilities\", \"man 8 setcap\", or contact your\n" > +"distribution vendor for assistance.\n" > +"\n" > +"More information can be found at 'Perf events and tool security' document:\n" > +"https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html\n"); > ret = EXIT_FAILURE; > goto err; > } > -- > 2.32.0 >