From: Jani Nikula <jani.nikula@linux.intel.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: michal.winiarski@intel.com, "David Gow" <davidgow@google.com>,
siqueirajordao@riseup.net, magalilemes00@gmail.com,
"David Airlie" <airlied@linux.ie>,
tales.aparecida@gmail.com, "Arthur Grillo" <arthur.grillo@usp.br>,
brendanhiggins@google.com,
"Javier Martinez Canillas" <javierm@redhat.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
mwen@igalia.com, "Maíra Canal" <mairacanal@riseup.net>,
kunit-dev@googlegroups.com,
"José Expósito" <jose.exposito89@gmail.com>,
"Isabella Basso" <isabbasso@riseup.net>,
andrealmeid@riseup.net
Subject: Re: [PATCH v2 2/2] drm/tests: Change "igt_" prefix to "test_drm_"
Date: Fri, 02 Sep 2022 16:03:20 +0300 [thread overview]
Message-ID: <87mtbidj3b.fsf@intel.com> (raw)
In-Reply-To: <20220902123400.5ljgc7z6zw34d64m@houat>
On Fri, 02 Sep 2022, Maxime Ripard <maxime@cerno.tech> wrote:
> On Fri, Sep 02, 2022 at 11:04:14AM +0300, Jani Nikula wrote:
>> On Thu, 01 Sep 2022, Maíra Canal <mairacanal@riseup.net> wrote:
>> > Hi Maxime,
>> >
>> > On 9/1/22 09:55, Maxime Ripard wrote:
>> >> Hi,
>> >>
>> >> On Thu, Sep 01, 2022 at 09:42:10AM -0300, Maíra Canal wrote:
>> >>> With the introduction of KUnit, IGT is no longer the only option to run
>> >>> the DRM unit tests, as the tests can be run through kunit-tool or on
>> >>> real hardware with CONFIG_KUNIT.
>> >>>
>> >>> Therefore, remove the "igt_" prefix from the tests and replace it with
>> >>> the "test_drm_" prefix, making the tests' names independent from the tool
>> >>> used.
>> >>>
>> >>> Signed-off-by: Maíra Canal <mairacanal@riseup.net>
>> >>>
>> >>> ---
>> >>> v1 -> v2: https://lore.kernel.org/dri-devel/20220830211603.191734-1-mairacanal@riseup.net/
>> >>> - Change "drm_" prefix to "test_drm_", as "drm_" can be a bit confusing (Jani Nikula).
>> >>
>> >> I appreciate it's a bit of a bikeshed but I disagree with this. The
>> >> majority of the kunit tests already out there start with the framework
>> >> name, including *all* the examples in the kunit doc. Plus, it's fairly
>> >> obvious that it's a test, kunit is only about running tests in the first
>> >> place.
>> >
>> > Would it be better to keep it as "drm_"?
>>
>> That's not "keeping". That's renaming igt to drm.
>
> Well, there's like half the tests that are prefixed with drm, the other
> with igt, so it's both really
>
>> > Currently, I don't think it is appropriate to hold the "igt_" prefix, as
>> > the tests are not IGT exclusive, but I don't have a strong opinion on
>> > using the "drm_" or the "test_drm" prefixes.
>>
>> I repeat my stance that "drm_" alone is confusing.
>
> What are you confusing it with?
>
>> For the reason alone that it pollutes the code tagging tools, mixing
>> actual drm_ types and functions with unit test functions.
>
> I don't get it, I'm sorry. All these functions are static and not part
> of any API, so I can't see how it would pollute a code tagging tool. Or
> at least, not more than any driver does.
>
> And we're part of a larger project here, it's about consistency with the
> rest of the ecosystem.
Okay, so I'm just going to explain what I mean, but say "whatever" right
after and move on.
For example, drm_buddy_test.c includes drm_buddy.h so with the igt_ ->
drm_ rename none of the test functions may clash with the drm_buddy_
prefixed existing functions. Ditto for all tests similarly.
For example drm_buddy_alloc_range() as a name sounds like something that
allocs a range, not something that tests range allocation. On the other
hand, you have drm_buddy_alloc_blocks() which is actually a real
drm_buddy function, not a test. What would you call a test that tests
that? Here, we end up with names that are all prefixed drm_buddy and you
won't know what's the actual function and what's the test unless you
look it up.
I use code tagging that I can use for finding and completing
e.g. functions. Currently I have the following completions, for
igt_buddy_ and drm_buddy_, respectively:
Possible completions are:
igt_buddy_alloc_limit igt_buddy_alloc_optimistic igt_buddy_alloc_pathological
igt_buddy_alloc_pessimistic igt_buddy_alloc_range igt_buddy_alloc_smoke
Possible completions are:
drm_buddy_alloc_blocks drm_buddy_block drm_buddy_block_is_allocated drm_buddy_block_is_free
drm_buddy_block_is_split drm_buddy_block_offset drm_buddy_block_order drm_buddy_block_print
drm_buddy_block_size drm_buddy_block_state drm_buddy_block_trim drm_buddy_fini
drm_buddy_free_block drm_buddy_free_list drm_buddy_init drm_buddy_init_test
drm_buddy_module_exit drm_buddy_module_init drm_buddy_print
With the patch at hand, they'll all be lumped under drm_buddy_
completions, and some of them will be actual drm buddy functions and
some not.
I just find it a very odd convention to name the tests in a way that's
indistinguishable from the real things. Even *within* drm_buddy_test.c
where you read the test code. Because currently you do have calls to
igt_buddy_ prefixed functions from other igt_buddy_ prefixed functions,
along with the drm_buddy_ prefixed calls. I think it's just going to be
a mess.
/rant
Whatever. Moving on.
BR,
Jani.
--
Jani Nikula, Intel Open Source Graphics Center
WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: "Maíra Canal" <mairacanal@riseup.net>,
"Isabella Basso" <isabbasso@riseup.net>,
magalilemes00@gmail.com, tales.aparecida@gmail.com,
mwen@igalia.com, andrealmeid@riseup.net,
siqueirajordao@riseup.net, "Trevor Woerner" <twoerner@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"David Airlie" <airlied@linux.ie>,
"Javier Martinez Canillas" <javierm@redhat.com>,
"David Gow" <davidgow@google.com>,
brendanhiggins@google.com, "Arthur Grillo" <arthur.grillo@usp.br>,
michal.winiarski@intel.com,
"José Expósito" <jose.exposito89@gmail.com>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
kunit-dev@googlegroups.com
Subject: Re: [PATCH v2 2/2] drm/tests: Change "igt_" prefix to "test_drm_"
Date: Fri, 02 Sep 2022 16:03:20 +0300 [thread overview]
Message-ID: <87mtbidj3b.fsf@intel.com> (raw)
In-Reply-To: <20220902123400.5ljgc7z6zw34d64m@houat>
On Fri, 02 Sep 2022, Maxime Ripard <maxime@cerno.tech> wrote:
> On Fri, Sep 02, 2022 at 11:04:14AM +0300, Jani Nikula wrote:
>> On Thu, 01 Sep 2022, Maíra Canal <mairacanal@riseup.net> wrote:
>> > Hi Maxime,
>> >
>> > On 9/1/22 09:55, Maxime Ripard wrote:
>> >> Hi,
>> >>
>> >> On Thu, Sep 01, 2022 at 09:42:10AM -0300, Maíra Canal wrote:
>> >>> With the introduction of KUnit, IGT is no longer the only option to run
>> >>> the DRM unit tests, as the tests can be run through kunit-tool or on
>> >>> real hardware with CONFIG_KUNIT.
>> >>>
>> >>> Therefore, remove the "igt_" prefix from the tests and replace it with
>> >>> the "test_drm_" prefix, making the tests' names independent from the tool
>> >>> used.
>> >>>
>> >>> Signed-off-by: Maíra Canal <mairacanal@riseup.net>
>> >>>
>> >>> ---
>> >>> v1 -> v2: https://lore.kernel.org/dri-devel/20220830211603.191734-1-mairacanal@riseup.net/
>> >>> - Change "drm_" prefix to "test_drm_", as "drm_" can be a bit confusing (Jani Nikula).
>> >>
>> >> I appreciate it's a bit of a bikeshed but I disagree with this. The
>> >> majority of the kunit tests already out there start with the framework
>> >> name, including *all* the examples in the kunit doc. Plus, it's fairly
>> >> obvious that it's a test, kunit is only about running tests in the first
>> >> place.
>> >
>> > Would it be better to keep it as "drm_"?
>>
>> That's not "keeping". That's renaming igt to drm.
>
> Well, there's like half the tests that are prefixed with drm, the other
> with igt, so it's both really
>
>> > Currently, I don't think it is appropriate to hold the "igt_" prefix, as
>> > the tests are not IGT exclusive, but I don't have a strong opinion on
>> > using the "drm_" or the "test_drm" prefixes.
>>
>> I repeat my stance that "drm_" alone is confusing.
>
> What are you confusing it with?
>
>> For the reason alone that it pollutes the code tagging tools, mixing
>> actual drm_ types and functions with unit test functions.
>
> I don't get it, I'm sorry. All these functions are static and not part
> of any API, so I can't see how it would pollute a code tagging tool. Or
> at least, not more than any driver does.
>
> And we're part of a larger project here, it's about consistency with the
> rest of the ecosystem.
Okay, so I'm just going to explain what I mean, but say "whatever" right
after and move on.
For example, drm_buddy_test.c includes drm_buddy.h so with the igt_ ->
drm_ rename none of the test functions may clash with the drm_buddy_
prefixed existing functions. Ditto for all tests similarly.
For example drm_buddy_alloc_range() as a name sounds like something that
allocs a range, not something that tests range allocation. On the other
hand, you have drm_buddy_alloc_blocks() which is actually a real
drm_buddy function, not a test. What would you call a test that tests
that? Here, we end up with names that are all prefixed drm_buddy and you
won't know what's the actual function and what's the test unless you
look it up.
I use code tagging that I can use for finding and completing
e.g. functions. Currently I have the following completions, for
igt_buddy_ and drm_buddy_, respectively:
Possible completions are:
igt_buddy_alloc_limit igt_buddy_alloc_optimistic igt_buddy_alloc_pathological
igt_buddy_alloc_pessimistic igt_buddy_alloc_range igt_buddy_alloc_smoke
Possible completions are:
drm_buddy_alloc_blocks drm_buddy_block drm_buddy_block_is_allocated drm_buddy_block_is_free
drm_buddy_block_is_split drm_buddy_block_offset drm_buddy_block_order drm_buddy_block_print
drm_buddy_block_size drm_buddy_block_state drm_buddy_block_trim drm_buddy_fini
drm_buddy_free_block drm_buddy_free_list drm_buddy_init drm_buddy_init_test
drm_buddy_module_exit drm_buddy_module_init drm_buddy_print
With the patch at hand, they'll all be lumped under drm_buddy_
completions, and some of them will be actual drm buddy functions and
some not.
I just find it a very odd convention to name the tests in a way that's
indistinguishable from the real things. Even *within* drm_buddy_test.c
where you read the test code. Because currently you do have calls to
igt_buddy_ prefixed functions from other igt_buddy_ prefixed functions,
along with the drm_buddy_ prefixed calls. I think it's just going to be
a mess.
/rant
Whatever. Moving on.
BR,
Jani.
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2022-09-02 13:03 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 12:42 [PATCH v2 1/2] drm/tests: Split drm_framebuffer_create_test into parameterized tests Maíra Canal
2022-09-01 12:42 ` Maíra Canal
2022-09-01 12:42 ` [PATCH v2 2/2] drm/tests: Change "igt_" prefix to "test_drm_" Maíra Canal
2022-09-01 12:42 ` Maíra Canal
2022-09-01 12:55 ` Maxime Ripard
2022-09-01 12:55 ` Maxime Ripard
2022-09-01 13:17 ` Javier Martinez Canillas
2022-09-01 13:17 ` Javier Martinez Canillas
2022-09-01 22:33 ` Maíra Canal
2022-09-01 22:33 ` Maíra Canal
2022-09-02 8:04 ` Jani Nikula
2022-09-02 8:04 ` Jani Nikula
2022-09-02 12:34 ` Maxime Ripard
2022-09-02 12:34 ` Maxime Ripard
2022-09-02 13:03 ` Jani Nikula [this message]
2022-09-02 13:03 ` Jani Nikula
2022-09-02 13:38 ` Michał Winiarski
2022-09-02 13:38 ` Michał Winiarski
2022-09-02 13:56 ` Jani Nikula
2022-09-02 13:56 ` Jani Nikula
2022-09-02 22:53 ` Maíra Canal
2022-09-02 22:53 ` Maíra Canal
2022-09-05 12:10 ` Maxime Ripard
2022-09-05 12:10 ` Maxime Ripard
2022-09-05 13:11 ` Michał Winiarski
2022-09-05 13:11 ` Michał Winiarski
2022-09-05 13:37 ` Maíra Canal
2022-09-05 13:37 ` Maíra Canal
2022-09-02 8:08 ` Maxime Ripard
2022-09-02 8:08 ` Maxime Ripard
2022-09-02 8:24 ` Jani Nikula
2022-09-02 8:24 ` Jani Nikula
2022-09-02 7:52 ` [PATCH v2 1/2] drm/tests: Split drm_framebuffer_create_test into parameterized tests David Gow
2022-09-02 7:52 ` David Gow
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=87mtbidj3b.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@linux.ie \
--cc=andrealmeid@riseup.net \
--cc=arthur.grillo@usp.br \
--cc=brendanhiggins@google.com \
--cc=davidgow@google.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=isabbasso@riseup.net \
--cc=javierm@redhat.com \
--cc=jose.exposito89@gmail.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=magalilemes00@gmail.com \
--cc=mairacanal@riseup.net \
--cc=maxime@cerno.tech \
--cc=michal.winiarski@intel.com \
--cc=mwen@igalia.com \
--cc=siqueirajordao@riseup.net \
--cc=tales.aparecida@gmail.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.