[PATCH i-g-t v5 11/17] lib/xe_eudebug: Introduce eu debug testing framework
Manszewski, Christoph
christoph.manszewski at intel.com
Wed Sep 4 13:11:21 UTC 2024
Hi Zbigniew,
On 4.09.2024 13:26, Zbigniew Kempczyński wrote:
> On Thu, Aug 29, 2024 at 04:45:41PM +0200, Christoph Manszewski wrote:
>
> <cut>
>
> Forgot to add this in my previous comment.
>
>> +static void event_log_sort(struct xe_eudebug_event_log *l)
>> +{
>> + struct xe_eudebug_event_log *tmp;
>> + struct drm_xe_eudebug_event *e = NULL;
>> + uint64_t first_seqno = 0;
>> + uint64_t last_seqno = 0;
>> + uint64_t events = 0, added = 0;
>> + uint64_t i;
>> +
>> + xe_eudebug_for_each_event(e, l) {
>> + if (e->seqno > last_seqno)
>> + last_seqno = e->seqno;
>> +
>> + if (e->seqno < first_seqno)
>> + first_seqno = e->seqno;
>> +
>> + events++;
>> + }
>> +
>> + tmp = xe_eudebug_event_log_create("tmp", l->max_size);
>> +
>> + for (i = 1; i <= last_seqno; i++) {
>
> Shouldn't this be i = first_seqno?
So as we discussed offline - indeed it should. What's more, first_seqno
should be initialized to UINT64_MAX. I will fix that in the next
revision - thanks!
Christoph
>
>> + e = xe_eudebug_event_log_find_seqno(l, i);
>> + if (e) {
>> + xe_eudebug_event_log_write(tmp, e);
>> + added++;
>> + }
>> + }
>> +
>> + igt_assert_eq(events, added);
>> + igt_assert_eq(tmp->head, l->head);
>> +
>> + memcpy(l->log, tmp->log, tmp->head);
>> +
>> + xe_eudebug_event_log_destroy(tmp);
>> +}
>
> --
> Zbigniew
More information about the igt-dev
mailing list