Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org
Subject: Re: [igt-dev] [Intel-gfx] [PATCH i-g-t] intel_gpu_top: Use actual period when calculating client busyness
Date: Thu, 16 Mar 2023 09:04:24 +0000	[thread overview]
Message-ID: <170dfb87-2f42-2ea3-968f-18415509a879@linux.intel.com> (raw)
In-Reply-To: <ZBIi1269Dm/++c9t@orsosgc001.jf.intel.com>


On 15/03/2023 19:56, Umesh Nerlige Ramappa wrote:
> On Wed, Mar 15, 2023 at 09:20:49AM +0000, Tvrtko Ursulin wrote:
>>
>> Hi Umesh,
>>
>> On 14/03/2023 18:25, Umesh Nerlige Ramappa wrote:
>>> lgtm,
>>>
>>> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
>>
>> Thanks - I had one second thought though. See below please.
>>
>>> On Tue, Mar 14, 2023 at 12:17:40PM +0000, Tvrtko Ursulin wrote:
>>>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>>
>>>> On a slow machine, or with many processes and/or file descriptors to
>>>> parse, the period of the scanning loop can drift significantly from the
>>>> assumed value. This results in artificially inflated client busyness
>>>> percentages.
>>>>
>>>> To alleviate the issue take some real timestamps and use actual elapsed
>>>> time when calculating relative busyness.
>>>>
>>>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>> ---
>>>> tools/intel_gpu_top.c | 39 ++++++++++++++++++++++++++++++++++++++-
>>>> 1 file changed, 38 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
>>>> index e13e35b71f4b..af4b350da8e4 100644
>>>> --- a/tools/intel_gpu_top.c
>>>> +++ b/tools/intel_gpu_top.c
>>>> @@ -43,6 +43,7 @@
>>>> #include <sys/types.h>
>>>> #include <unistd.h>
>>>> #include <termios.h>
>>>> +#include <time.h>
>>>> #include <sys/sysmacros.h>
>>>>
>>>> #include "igt_perf.h"
>>>> @@ -2524,6 +2525,38 @@ static void show_help_screen(void)
>>>> "\n");
>>>> }
>>>>
>>>> +static int gettime(struct timespec *ts)
>>>> +{
>>>> +    memset(ts, 0, sizeof(*ts));
>>>> +
>>>> +#ifdef CLOCK_MONOTONIC_RAW
>>>> +    if (!clock_gettime(CLOCK_MONOTONIC_RAW, ts))
>>>> +        return 0;
>>>> +#endif
>>>> +#ifdef CLOCK_MONOTONIC_COARSE
>>>> +    if (!clock_gettime(CLOCK_MONOTONIC_COARSE, ts))
>>>> +        return 0;
>>>> +#endif
>>
>> So I copied this (with some edits) from igt_core.c but I think I 
>> should actually remove the CLOCK_MONOTONIC_COARSE option. The usage in 
>> intel_gpu_top is not performance sensitive and tick granularity 
>> actually defeats to point of this patch.
>>
>> Okay to keep the r-b if I remove it?
> 
> Sure, okay to keep the R-b.

Thanks, pushed!

Regards,

Tvrtko

  reply	other threads:[~2023-03-16  9:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 12:17 [igt-dev] [PATCH i-g-t] intel_gpu_top: Use actual period when calculating client busyness Tvrtko Ursulin
2023-03-14 14:42 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-03-14 18:25 ` [igt-dev] [Intel-gfx] [PATCH i-g-t] " Umesh Nerlige Ramappa
2023-03-15  9:20   ` Tvrtko Ursulin
2023-03-15 19:56     ` Umesh Nerlige Ramappa
2023-03-16  9:04       ` Tvrtko Ursulin [this message]
2023-03-15 18:46 ` [igt-dev] ✓ Fi.CI.IGT: success for " 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=170dfb87-2f42-2ea3-968f-18415509a879@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=umesh.nerlige.ramappa@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox