Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: "Rogozhkin, Dmitry V" <dmitry.v.rogozhkin@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Cc: "Intel-gfx@lists.freedesktop.org" <Intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH i-g-t 6/6] intel_gpu_top: Add a sanity check discovered busy metric is per engine
Date: Wed, 1 Dec 2021 10:06:28 +0000	[thread overview]
Message-ID: <6ee343d6-df54-3c89-5d80-9073884805f5@linux.intel.com> (raw)
In-Reply-To: <3894f6c21d51bdd4a188f077e146d36a3d6ddb71.camel@intel.com>


On 01/12/2021 02:20, Rogozhkin, Dmitry V wrote:
> On Fri, 2021-11-19 at 12:59 +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Adding a cross-check with ABI config name space and not just relying
>> on
>> sysfs names.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Cc: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
>> ---
>>   tools/intel_gpu_top.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
>> index 41c59a72c09d..81c724d1fe1c 100644
>> --- a/tools/intel_gpu_top.c
>> +++ b/tools/intel_gpu_top.c
>> @@ -376,6 +376,12 @@ static struct engines *discover_engines(char
>> *device)
>>   			break;
>>   		}
>>   
>> +		/* Double check config is an engine config. */
>> +		if (engine->busy.config >= __I915_PMU_OTHER(0)) {
>> +			free((void *)engine->name);
>> +			continue;
>> +		}
>> +
>>   		engine->class = (engine->busy.config &
>>   				 (__I915_PMU_OTHER(0) - 1)) >>
>>   				I915_PMU_CLASS_SHIFT;
> 
> This works for me.
> Acked-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>

Thanks, pushed!

> However, looking to the existing code down below the place where you've
> added a fix, it seems to me that 'free((void *)engine->name)' might be
> missing on a number of other error paths and on non-error exit path as
> well.

Error paths are all fatal (tool simply exits) so it's moot. No real 
value to cleanup piecemeal. It is the same for normal exit if that is 
what you mean. Would be nicer I guess but it's a task for a rainy idle day.

Regards,

Tvrtko

  reply	other threads:[~2021-12-01 10:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 12:59 [igt-dev] [PATCH i-g-t 1/6] tests/api_intel_allocator: Fix build warning Tvrtko Ursulin
2021-11-19 12:59 ` [Intel-gfx] [PATCH i-g-t 2/6] igt/drm_read: " Tvrtko Ursulin
2021-11-19 12:59 ` [igt-dev] [PATCH i-g-t 3/6] igt/core: " Tvrtko Ursulin
2021-11-19 13:53   ` [Intel-gfx] " Petri Latvala
2021-11-19 15:34     ` [igt-dev] " Tvrtko Ursulin
2021-11-19 15:41       ` [Intel-gfx] " Petri Latvala
2021-11-19 15:54         ` [igt-dev] " Petri Latvala
2021-11-22  9:03           ` Tvrtko Ursulin
2021-11-19 12:59 ` [igt-dev] [PATCH i-g-t 4/6] igt/drm_read: " Tvrtko Ursulin
2021-11-19 12:59 ` [igt-dev] [PATCH i-g-t 5/6] intel_gpu_top: Remove clients support Tvrtko Ursulin
2021-11-26 13:07   ` [Intel-gfx] " Tvrtko Ursulin
2021-11-26 14:01     ` Petri Latvala
2021-11-26 14:16       ` Tvrtko Ursulin
2021-11-19 12:59 ` [igt-dev] [PATCH i-g-t 6/6] intel_gpu_top: Add a sanity check discovered busy metric is per engine Tvrtko Ursulin
2021-12-01  2:20   ` Rogozhkin, Dmitry V
2021-12-01 10:06     ` Tvrtko Ursulin [this message]
2021-11-19 13:38 ` [igt-dev] ✗ Fi.CI.BUILD: failure for series starting with [i-g-t,1/6] tests/api_intel_allocator: Fix build warning Patchwork
2021-11-19 13:56 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
2021-11-22  5:58 ` [igt-dev] [PATCH i-g-t 1/6] " Zbigniew Kempczyński

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ee343d6-df54-3c89-5d80-9073884805f5@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=dmitry.v.rogozhkin@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox