All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Petri Latvala <petri.latvala@intel.com>
Cc: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [igt-dev] [PATCH i-g-t 1/1] intel-gpu-top: Support for client stats
Date: Mon, 7 Sep 2020 10:53:12 +0100	[thread overview]
Message-ID: <b7045601-1b6a-e4e4-d116-db4eac9b8111@linux.intel.com> (raw)
In-Reply-To: <20200907093117.GX7444@platvala-desk.ger.corp.intel.com>


On 07/09/2020 10:31, Petri Latvala wrote:
> On Fri, Sep 04, 2020 at 02:06:07PM +0100, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Adds support for per-client engine busyness stats i915 exports in sysfs
>> and produces output like the below:
>>
>> ==========================================================================
>> intel-gpu-top -  935/ 935 MHz;    0% RC6; 14.73 Watts;     1097 irqs/s
>>
>>        IMC reads:     1401 MiB/s
>>       IMC writes:        4 MiB/s
>>
>>            ENGINE      BUSY                                 MI_SEMA MI_WAIT
>>       Render/3D/0   63.73% |███████████████████           |      3%      0%
>>         Blitter/0    9.53% |██▊                           |      6%      0%
>>           Video/0   39.32% |███████████▊                  |     16%      0%
>>           Video/1   15.62% |████▋                         |      0%      0%
>>    VideoEnhance/0    0.00% |                              |      0%      0%
>>
>>    PID            NAME     RCS          BCS          VCS         VECS
>>   4084        gem_wsim |█████▌     ||█          ||           ||           |
>>   4086        gem_wsim |█▌         ||           ||███        ||           |
>> ==========================================================================
>>
>> Apart from the existing physical engine utilization it now also shows
>> utilization per client and per engine class.
>>
>> v2:
>>   * Version to match removal of global enable_stats toggle.
>>   * Plus various fixes.
>>
>> v3:
>>   * Support brief backward jumps in client stats.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> ---
>>   tools/intel_gpu_top.c | 539 +++++++++++++++++++++++++++++++++++++++++-
>>   1 file changed, 528 insertions(+), 11 deletions(-)
>>
>> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
>> index cae01c25b920..9eac569e75de 100644
>> --- a/tools/intel_gpu_top.c
>> +++ b/tools/intel_gpu_top.c
>> @@ -679,23 +679,347 @@ static void pmu_sample(struct engines *engines)
>>   	}
>>   }
>>   
>> +enum client_status {
>> +	FREE = 0, /* mbz */
>> +	ALIVE,
>> +	PROBE
>> +};
>> +
>> +struct clients;
>> +
>> +struct client {
>> +	struct clients *clients;
>> +
>> +	enum client_status status;
>> +	unsigned int id;
>> +	unsigned int pid;
>> +	char name[128];
>> +	unsigned int samples;
>> +	unsigned long total;
>> +	struct engines *engines;
>> +	unsigned long *val;
>> +	uint64_t *last;
>> +};
>> +
>> +struct engine_class {
>> +	unsigned int class;
>> +	const char *name;
>> +	unsigned int num_engines;
>> +};
>> +
>> +struct clients {
>> +	unsigned int num_classes;
>> +	struct engine_class *class;
>> +
>> +	unsigned int num_clients;
>> +	struct client *client;
>> +};
>> +
>> +#define for_each_client(clients, c, tmp) \
>> +	for ((tmp) = (clients)->num_clients, c = (clients)->client; \
>> +	     (tmp > 0); (tmp)--, (c)++)
>> +
>> +static struct clients *init_clients(void)
>> +{
>> +	struct clients *clients = malloc(sizeof(*clients));
>> +
>> +	return memset(clients, 0, sizeof(*clients));
>> +}
>> +
>> +#define SYSFS_CLIENTS "/sys/class/drm/card0/clients"
> 
> Now that intel_gpu_top supports device selection, this path works
> every time only 60% of the time, right?

Gah yes.. thanks. I cherry picked from the wrong branch. I did already 
have this updated for device selection, somewhere. Will find it.

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-09-07  9:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04 13:06 [Intel-gfx] [PATCH i-g-t 0/1] Per client engine busyness for intel_gpu_top Tvrtko Ursulin
2020-09-04 13:06 ` [igt-dev] [PATCH i-g-t 1/1] intel-gpu-top: Support for client stats Tvrtko Ursulin
2020-09-04 13:06   ` [Intel-gfx] " Tvrtko Ursulin
2020-09-07  9:31   ` [igt-dev] " Petri Latvala
2020-09-07  9:31     ` [Intel-gfx] " Petri Latvala
2020-09-07  9:53     ` Tvrtko Ursulin [this message]
2020-09-14 15:39   ` [igt-dev] [PATCH i-g-t v4] " Tvrtko Ursulin
2020-09-14 15:39     ` [Intel-gfx] " Tvrtko Ursulin
2020-09-04 13:40 ` [igt-dev] ✓ Fi.CI.BAT: success for Per client engine busyness for intel_gpu_top Patchwork
2020-09-04 22:51 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-09-14 17:40 ` [igt-dev] ✓ Fi.CI.BAT: success for Per client engine busyness for intel_gpu_top (rev2) Patchwork
2020-09-15  0:32 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=b7045601-1b6a-e4e4-d116-db4eac9b8111@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.