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 D8D3AC05027 for ; Thu, 9 Feb 2023 08:25:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 540DB10E947; Thu, 9 Feb 2023 08:25:30 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0C14010E92F; Thu, 9 Feb 2023 08:25:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675931129; x=1707467129; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=Mh2ZogLL1yGUIioJ4VcGClIhVIm7/7upo5ccRQpZtt8=; b=J2yIala0+p/Sn7PnOk8FaHX0m+4PKVS+uD+rXcngr3vvtvNf0agOCmAT StBzfVt9O0si6KvLfTyL0x8raFicuMq0R3gZBrAeT7vMIGYJHhQxIT0Rz WdqqS5V5z/4SDdC5wgW9USUxtHbUpiTPjZwteOJ+/Anzd5Youk1Xziydj 2ipuUu7RO6wsHYrKUT9aycvydfyz3nWV5A5FXTJ0CP2moU6DxjajqpI18 zKG6K5DTnCcmKxYW+L2YyCX8MKzyHBocX2eYmzTzSNleaSpzscpp83YO3 oKBsYj8itfDIHwPf+qmHyJzt7d97vID9DNCHRl8bvdVAWDj9nVxJJtsGH A==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="330073685" X-IronPort-AV: E=Sophos;i="5.97,283,1669104000"; d="scan'208";a="330073685" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2023 00:25:28 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="756331229" X-IronPort-AV: E=Sophos;i="5.97,283,1669104000"; d="scan'208";a="756331229" Received: from jptoner-mobl2.ger.corp.intel.com (HELO [10.213.192.123]) ([10.213.192.123]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2023 00:24:58 -0800 Message-ID: <2825c998-3e11-ccc0-0e0a-ebb874d569fb@linux.intel.com> Date: Thu, 9 Feb 2023 08:24:56 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US To: Kamil Konieczny , igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org, Caleb Callaway References: <20230203111636.4138202-1-tvrtko.ursulin@linux.intel.com> <20230203111636.4138202-2-tvrtko.ursulin@linux.intel.com> <20230208123142.zudgou6bjt7qbin4@kamilkon-desk1> From: Tvrtko Ursulin Organization: Intel Corporation UK Plc In-Reply-To: <20230208123142.zudgou6bjt7qbin4@kamilkon-desk1> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Intel-gfx] [PATCH i-g-t 1/3] intel_gpu_top: Do not repeat header lines in non-interactive output 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 08/02/2023 12:31, Kamil Konieczny wrote: > Hi Tvrtko, > > one small nit, see below. > > On 2023-02-03 at 11:16:34 +0000, Tvrtko Ursulin wrote: >> From: Tvrtko Ursulin >> >> If output is redirected to a file, or a pipe, lets not repeat the headers >> because that can usually mean user is trying to parse the data later and >> so repeated headers are a hindrance. >> >> Signed-off-by: Tvrtko Ursulin >> Cc: Caleb Callaway >> --- >> tools/intel_gpu_top.c | 19 ++++++++++++++----- >> 1 file changed, 14 insertions(+), 5 deletions(-) >> >> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c >> index 0a1de41b3374..e2a7f4753099 100644 >> --- a/tools/intel_gpu_top.c >> +++ b/tools/intel_gpu_top.c >> @@ -1391,6 +1391,7 @@ static unsigned int stdout_level; >> >> #define STDOUT_HEADER_REPEAT 20 >> static unsigned int stdout_lines = STDOUT_HEADER_REPEAT; >> +static bool stdout_header_repeat; >> >> static void >> stdout_open_struct(const char *name) >> @@ -1580,16 +1581,22 @@ static const struct print_operations term_pops = { >> >> static bool print_groups(struct cnt_group **groups) >> { >> - unsigned int headers = stdout_lines % STDOUT_HEADER_REPEAT + 1; >> + static bool headers_printed = false; > ----------------------------------- ^ > Remove this initialization (use checkpatch from Linux kernel). > > Please correct and resend (you can keep my r-b). Fixed and pushed, thanks for the review! Regards, Tvrtko