2023-09-09 00:38:52

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v2] selftests/user_events: Fix failures when user_events is not installed

On Fri, Sep 08, 2023 at 08:19:16PM +0000, Beau Belgrave wrote:

> Add common methods to detect if tracefs and user_events is enabled. If
> either is not enabled skip the test. If tracefs is enabled, but is not
> mounted, mount tracefs and fail if there were any errors. Fail if not
> run as root.

This will leave tracefs mounted if it was not already mounted which is a
change to the system configuration. While that may happen if things go
wrong during a test we should probably avoid actively doing this and
either only skip or try to umount at the end of the test if we mounted
ourselves.


Attachments:
(No filename) (606.00 B)
signature.asc (499.00 B)
Download all attachments

2023-09-09 04:41:21

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH v2] selftests/user_events: Fix failures when user_events is not installed

On Sat, 9 Sep 2023 00:33:05 +0100
Mark Brown <[email protected]> wrote:

> On Fri, Sep 08, 2023 at 08:19:16PM +0000, Beau Belgrave wrote:
>
> > Add common methods to detect if tracefs and user_events is enabled. If
> > either is not enabled skip the test. If tracefs is enabled, but is not
> > mounted, mount tracefs and fail if there were any errors. Fail if not
> > run as root.
>
> This will leave tracefs mounted if it was not already mounted which is a
> change to the system configuration. While that may happen if things go
> wrong during a test we should probably avoid actively doing this and
> either only skip or try to umount at the end of the test if we mounted
> ourselves.

LOL! Beau just asked me yesterday if anyone would care if the test mounted
tracefs and left it mounted. I told him "no" as ftracetest in the selftests
already do that.

I guess I was wrong and some people do care ;-)

-- Steve

2023-09-09 21:05:22

by Masami Hiramatsu

[permalink] [raw]
Subject: Re: [PATCH v2] selftests/user_events: Fix failures when user_events is not installed

On Sat, 9 Sep 2023 00:33:05 +0100
Mark Brown <[email protected]> wrote:

> On Fri, Sep 08, 2023 at 08:19:16PM +0000, Beau Belgrave wrote:
>
> > Add common methods to detect if tracefs and user_events is enabled. If
> > either is not enabled skip the test. If tracefs is enabled, but is not
> > mounted, mount tracefs and fail if there were any errors. Fail if not
> > run as root.
>
> This will leave tracefs mounted if it was not already mounted which is a
> change to the system configuration. While that may happen if things go
> wrong during a test we should probably avoid actively doing this and
> either only skip or try to umount at the end of the test if we mounted
> ourselves.

Oh, I didn't know that. I need to update ftracetest to unmount tracefs if
it is not mounted.

Thanks!

--
Masami Hiramatsu (Google) <[email protected]>

2023-09-12 22:32:36

by Beau Belgrave

[permalink] [raw]
Subject: Re: [PATCH v2] selftests/user_events: Fix failures when user_events is not installed

On Fri, Sep 08, 2023 at 09:27:12PM -0400, Steven Rostedt wrote:
> On Sat, 9 Sep 2023 00:33:05 +0100
> Mark Brown <[email protected]> wrote:
>
> > On Fri, Sep 08, 2023 at 08:19:16PM +0000, Beau Belgrave wrote:
> >
> > > Add common methods to detect if tracefs and user_events is enabled. If
> > > either is not enabled skip the test. If tracefs is enabled, but is not
> > > mounted, mount tracefs and fail if there were any errors. Fail if not
> > > run as root.
> >
> > This will leave tracefs mounted if it was not already mounted which is a
> > change to the system configuration. While that may happen if things go
> > wrong during a test we should probably avoid actively doing this and
> > either only skip or try to umount at the end of the test if we mounted
> > ourselves.
>
> LOL! Beau just asked me yesterday if anyone would care if the test mounted
> tracefs and left it mounted. I told him "no" as ftracetest in the selftests
> already do that.
>
> I guess I was wrong and some people do care ;-)
>
> -- Steve

It looks like this change got applied [1] to the fixes branch of
linux-kselftest. I can either send a V3 with this addressed or build a
patch based upon the fixes branch on top of this one to address it.

Which way do you all prefer?

Thanks,
-Beau

1. https://git.kernel.org/shuah/linux-kselftest/c/a06023a8f78d

2023-09-13 00:15:43

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH v2] selftests/user_events: Fix failures when user_events is not installed

On Tue, 12 Sep 2023 10:12:34 -0700
Beau Belgrave <[email protected]> wrote:


> > I guess I was wrong and some people do care ;-)
> >
> > -- Steve
>
> It looks like this change got applied [1] to the fixes branch of
> linux-kselftest. I can either send a V3 with this addressed or build a
> patch based upon the fixes branch on top of this one to address it.
>
> Which way do you all prefer?
>
> Thanks,
> -Beau
>
> 1. https://git.kernel.org/shuah/linux-kselftest/c/a06023a8f78d

I'm guessing that this would go through Shuah's tree right? So it would be
up to her to decide that.

-- Steve

2023-09-15 18:30:36

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH v2] selftests/user_events: Fix failures when user_events is not installed

On 9/12/23 11:46, Steven Rostedt wrote:
> On Tue, 12 Sep 2023 10:12:34 -0700
> Beau Belgrave <[email protected]> wrote:
>
>
>>> I guess I was wrong and some people do care ;-)
>>>
>>> -- Steve
>>
>> It looks like this change got applied [1] to the fixes branch of
>> linux-kselftest. I can either send a V3 with this addressed or build a
>> patch based upon the fixes branch on top of this one to address it.
>>
>> Which way do you all prefer?

Please send me patch on top of this one on linux-kselftest fixes.

thanks,
-- Shuah