Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Krzysztof Karas <krzysztof.karas@intel.com>,
	Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Cc: igt-dev@lists.freedesktop.org, kamil.konieczny@linux.intel.com,
	krzysztof.niemiec@intel.com
Subject: Re: [PATCH i-g-t 7/8] tools/gputop: integrate i915 and xe PMU engine monitoring
Date: Tue, 29 Sep 2026 12:16:06 +0300	[thread overview]
Message-ID: <14fa2e4326d5be089719038c32eebb128f4a1f64@intel.com> (raw)
In-Reply-To: <be7mrp73b7wd3c4zj6tyawxsbbnjqmjbwqrvqjhz7jthqr66m6@mp2dap6vrqsd>

On Tue, 29 Sep 2026, Krzysztof Karas <krzysztof.karas@intel.com> wrote:
> Hi Sebastian,
>
> [...]
>
>> +static void pmu_devices_init(struct gputop_driver *drv,
>> +			     const struct device_operations *ops,
>> +			     const char *filter, size_t instance_size)
>> +{
>> +	struct igt_device_card *cards;
>> +	int n;
>> +
>> +	n = igt_device_card_match_all(filter, &cards);
>> +	if (n <= 0)
>> +		return;
>> +
>> +	drv->instances = calloc(n, instance_size);
>> +	if (!drv->instances) {
>> +		free(cards);
>> +		return;
>> +	}
>> +
>> +	drv->len = n;
>> +
>> +	for (int i = 0; i < n; i++) {
> I'll be pedantic here: iterators in this patch could be
> unsigned :)

Well, to be really pedantic, never use unsigned unless you really have
to.

Unsigned doesn't protect you from anything, and usually just lead to
trickier situations than using signed would. Use int when you can, and
it'll save you a lot of trouble.


BR,
Jani.



-- 
Jani Nikula, Intel

  reply	other threads:[~2026-09-29  9:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 10:57 [PATCH i-g-t 0/8] tools/gputop: add i915 PMU engine monitoring Sebastian Brzezinka
2026-09-25 10:57 ` [PATCH i-g-t 1/8] tools/gputop/xe_gputop: fix struct layout and PMU read Sebastian Brzezinka
2026-09-28  8:49   ` Krzysztof Karas
2026-09-30 12:30     ` Sebastian Brzezinka
2026-09-25 10:57 ` [PATCH i-g-t 2/8] tools/gputop/xe_gputop: fix CLAMP() usage Sebastian Brzezinka
2026-09-28  8:50   ` Krzysztof Karas
2026-09-29 10:14   ` Kamil Konieczny
2026-09-25 10:57 ` [PATCH i-g-t 3/8] tools/gputop/xe_gputop: fix return logic, cleanup and div by zero bugs Sebastian Brzezinka
2026-09-28  9:12   ` Krzysztof Karas
2026-09-25 10:57 ` [PATCH i-g-t 4/8] tools/gputop/i915_gputop: add i915 PMU engine monitoring Sebastian Brzezinka
2026-09-28 11:01   ` Krzysztof Karas
2026-09-30 11:06     ` Sebastian Brzezinka
2026-09-30 14:39       ` Kamil Konieczny
2026-10-02  2:29         ` vitaly prosyak
2026-10-02  8:59   ` Tvrtko Ursulin
2026-09-25 10:57 ` [PATCH i-g-t 5/8] tools/meson: build gputop PMU backends as part of gputop Sebastian Brzezinka
2026-09-29  5:58   ` Krzysztof Karas
2026-09-25 10:57 ` [PATCH i-g-t 6/8] tools/gputop/utils: guard ANSI macros against redefinition Sebastian Brzezinka
2026-09-29  5:58   ` Krzysztof Karas
2026-09-25 10:57 ` [PATCH i-g-t 7/8] tools/gputop: integrate i915 and xe PMU engine monitoring Sebastian Brzezinka
2026-09-29  8:49   ` Krzysztof Karas
2026-09-29  9:16     ` Jani Nikula [this message]
2026-09-25 10:57 ` [PATCH i-g-t 8/8] tests/tools_test: add gputop PMU engine monitoring subtests Sebastian Brzezinka
2026-09-29  9:39   ` Krzysztof Karas
2026-09-25 12:48 ` ✓ i915.CI.BAT: success for tools/gputop: add i915 PMU engine monitoring Patchwork
2026-09-25 13:02 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-25 20:21 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-26  5:44 ` ✗ i915.CI.Full: " Patchwork
2026-09-28 20:59 ` ✗ Xe.CI.BAT: failure for tools/gputop: add i915 PMU engine monitoring (rev2) Patchwork
2026-09-28 21:05 ` ✓ i915.CI.BAT: success " Patchwork
2026-09-29  2:59 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-29  5:06 ` ✓ i915.CI.Full: success " 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=14fa2e4326d5be089719038c32eebb128f4a1f64@intel.com \
    --to=jani.nikula@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=krzysztof.karas@intel.com \
    --cc=krzysztof.niemiec@intel.com \
    --cc=sebastian.brzezinka@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