[PATCH i-g-t v4 1/2] lib/igt_kmemleak: library to interact with kmemleak

Peter Senna Tschudin peter.senna at linux.intel.com
Tue Feb 25 18:06:17 UTC 2025


Hi Zbigniew,

On 25.02.2025 14:46, Peter Senna Tschudin wrote:
> Hi Zbigniew,
> 
> On 11.02.2025 17:17, Zbigniew Kempczyński wrote:
> [...]
> 
>>
>> I'm looking at the code and I have impression this should be part of
>> the runner, not igt library. Do I understand correctly that your
>> code will be used by the runner only and not by the tests?
>>
>> Regarding your above question, I think runner should use as much as
>> minimal from lib/ directory, because this is collection of functions
>> designed for tests, not for runner. I think generic code like data
>> structures (lists) are fine, but not the others. Imagine you'll
>> incidentally try to use igt_require() - follow the call and see
>> the pitfall there.
>>
>> So if my understanding is correct and this code should be part of the
>> runner only your test might be moved to the runner_tests.c.
>>
>> BTW please rebase on top of current master, there were changes in
>> the runner/settings.c file that affects this series.
> 
> I sent V5 a few moments ago and I included the AMD folks who sent a patch
> to add kmemleaks integration as a library for tests. Please have a look at
> the last comment from AMD explaining why adding a lib for tests:
> 
> https://patchwork.freedesktop.org/series/145011/
> 
> I feel we should work with them to avoid duplication functionality. What
> are your toughs?

I have a proposal: what about extending the kmemleak library to add an
additional option that to accept a test list file pointing to the
tests we want to collect kmemleak reports? At least in theory this will
allow the AMD folks to do what they want. Something like:
 - once: collect kmemleak reports after running all tests
 - each: collect kmemleak reports after running each test
 - file: collect kmemleak reports after each test on the file

Please let me know what you think.

Thanks,

Peter


More information about the igt-dev mailing list