lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
* [lttng-dev] [PATCH lttng-tools 1/2] README: Update the Userspace RCU requirements
@ 2022-10-07  0:39 Alistair Francis via lttng-dev
  2022-10-07  0:39 ` [lttng-dev] [PATCH lttng-tools 2/2] Tests: select_poll_epoll: Add support for _time64 Alistair Francis via lttng-dev
  0 siblings, 1 reply; 5+ messages in thread
From: Alistair Francis via lttng-dev @ 2022-10-07  0:39 UTC (permalink / raw)
  To: lttng-dev; +Cc: alistair23

From: Alistair Francis <alistair.francis@wdc.com>

Commit cc22de985fbd "Bump URCU dependency to 0.14" increase the
Userspace RCU requirements but didn't update the README. Let's ensure
the README has the correct information.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 README.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.adoc b/README.adoc
index 830dd933e..191b0e0a2 100644
--- a/README.adoc
+++ b/README.adoc
@@ -54,7 +54,7 @@ components:
 
 * **Linux kernel{nbsp}≥{nbsp}2.6.30**
 
-* **http://www.liburcu.org/[Userspace{nbsp}RCU]{nbsp}≥{nbsp}0.11.0**.
+* **http://www.liburcu.org/[Userspace{nbsp}RCU]{nbsp}≥{nbsp}0.14.0**.
 +
 Debian/Ubuntu package: `liburcu{nbh}dev`.
 
-- 
2.37.3

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [lttng-dev] [PATCH lttng-tools 2/2] Tests: select_poll_epoll: Add support for _time64
  2022-10-07  0:39 [lttng-dev] [PATCH lttng-tools 1/2] README: Update the Userspace RCU requirements Alistair Francis via lttng-dev
@ 2022-10-07  0:39 ` Alistair Francis via lttng-dev
  2022-10-12 13:19   ` Jérémie Galarneau via lttng-dev
  0 siblings, 1 reply; 5+ messages in thread
From: Alistair Francis via lttng-dev @ 2022-10-07  0:39 UTC (permalink / raw)
  To: lttng-dev; +Cc: alistair23

From: Alistair Francis <alistair.francis@wdc.com>

Add support for the  64-bit time_t syscalls SYS_ppoll_time64
and SYS_pselect6_time64.

These are the syscalls that exist 32-bit platforms since the 5.1 kernel.
32-bit platforms with a 64-bit time_t only have these and don't have the
original syscalls (such as 32-bit RISC-V).

Fixes: https://github.com/lttng/lttng-tools/pull/162
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 tests/regression/kernel/select_poll_epoll.cpp | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/tests/regression/kernel/select_poll_epoll.cpp b/tests/regression/kernel/select_poll_epoll.cpp
index c0b688217..4a6d394f4 100644
--- a/tests/regression/kernel/select_poll_epoll.cpp
+++ b/tests/regression/kernel/select_poll_epoll.cpp
@@ -5,6 +5,7 @@
  *
  */
 
+#include <errno.h>
 #include <fcntl.h>
 #include <limits.h>
 #include <poll.h>
@@ -456,8 +457,22 @@ void ppoll_fds_buffer_overflow(
 	ufds[0].fd = wait_fd;
 	ufds[0].events = POLLIN|POLLPRI;
 
+#ifdef SYS_ppoll_time64
+	/*
+	 * As there is no timeout value, we don't convert to/from
+	 * 64/32-bit time_t.
+	 */
+	ret = syscall(SYS_ppoll_time64, ufds, 100, NULL, NULL);
+	if (ret == 0 || errno != ENOSYS) {
+		goto ppoll_fds_buffer_overflow_done;
+	}
+#endif
+
+#ifdef SYS_ppoll
 	ret = syscall(SYS_ppoll, ufds, 100, NULL, NULL);
+#endif
 
+ppoll_fds_buffer_overflow_done:
 	if (ret < 0) {
 		PERROR("ppoll");
 	} else if (ret > 0) {
@@ -483,7 +498,22 @@ void ppoll_fds_ulong_max(FILE *validation_output_file __attribute__((unused)))
 	ufds[0].fd = wait_fd;
 	ufds[0].events = POLLIN|POLLPRI;
 
+#ifdef SYS_ppoll_time64
+	/*
+	 * As there is no timeout value, we don't convert to/from
+	 * 64/32-bit time_t.
+	 */
+	ret = syscall(SYS_ppoll_time64, ufds, ULONG_MAX, NULL, NULL);
+	if (ret == 0 || errno != ENOSYS) {
+		goto ppoll_fds_ulong_max_done;
+	}
+#endif
+
+#ifdef SYS_ppoll
 	ret = syscall(SYS_ppoll, ufds, ULONG_MAX, NULL, NULL);
+#endif
+
+ppoll_fds_ulong_max_done:
 	if (ret < 0) {
 		/* Expected error. */
 	} else if (ret > 0) {
@@ -524,7 +554,18 @@ void pselect_invalid_fd(FILE *validation_output_file __attribute__((unused)))
 	FD_ZERO(&rfds);
 	FD_SET(fd, &rfds);
 
+#ifdef SYS_pselect6_time64
+	ret = syscall(SYS_pselect6_time64, fd + 1, &rfds, NULL, NULL, NULL, NULL);
+	if (ret == 0 || errno != ENOSYS) {
+		goto pselect_invalid_fd_done;
+	}
+#endif
+
+#ifdef SYS_pselect6
 	ret = syscall(SYS_pselect6, fd + 1, &rfds, NULL, NULL, NULL, NULL);
+#endif
+
+pselect_invalid_fd_done:
 	if (ret == -1) {
 		/* Expected error. */
 	} else if (ret) {
@@ -553,8 +594,20 @@ void pselect_invalid_pointer(
 	FD_ZERO(&rfds);
 	FD_SET(wait_fd, &rfds);
 
+#ifdef SYS_pselect6_time64
+	ret = syscall(SYS_pselect6_time64, 1, &rfds, (fd_set *) invalid, NULL, NULL,
+			NULL);
+	if (ret == 0 || errno != ENOSYS) {
+		goto pselect_invalid_pointer_done;
+	}
+#endif
+
+#ifdef SYS_pselect6
 	ret = syscall(SYS_pselect6, 1, &rfds, (fd_set *) invalid, NULL, NULL,
 			NULL);
+#endif
+
+pselect_invalid_pointer_done:
 	if (ret == -1) {
 		/* Expected error. */
 	} else if (ret) {
-- 
2.37.3

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [lttng-dev] [PATCH lttng-tools 2/2] Tests: select_poll_epoll: Add support for _time64
  2022-10-07  0:39 ` [lttng-dev] [PATCH lttng-tools 2/2] Tests: select_poll_epoll: Add support for _time64 Alistair Francis via lttng-dev
@ 2022-10-12 13:19   ` Jérémie Galarneau via lttng-dev
  2022-10-13  0:12     ` Alistair Francis via lttng-dev
  0 siblings, 1 reply; 5+ messages in thread
From: Jérémie Galarneau via lttng-dev @ 2022-10-12 13:19 UTC (permalink / raw)
  To: Alistair Francis; +Cc: lttng-dev, alistair23

On Fri, Oct 07, 2022 at 10:39:18AM +1000, Alistair Francis via lttng-dev wrote:

Hi Alistair,

The first patch is good, I'll merge it in master.
Some comments on this patch follow.

> From: Alistair Francis <alistair.francis@wdc.com>
> 
> Add support for the  64-bit time_t syscalls SYS_ppoll_time64
> and SYS_pselect6_time64.
> 
> These are the syscalls that exist 32-bit platforms since the 5.1 kernel.
> 32-bit platforms with a 64-bit time_t only have these and don't have the
> original syscalls (such as 32-bit RISC-V).
> 
> Fixes: https://github.com/lttng/lttng-tools/pull/162
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  tests/regression/kernel/select_poll_epoll.cpp | 53 +++++++++++++++++++
>  1 file changed, 53 insertions(+)
> 
> diff --git a/tests/regression/kernel/select_poll_epoll.cpp b/tests/regression/kernel/select_poll_epoll.cpp
> index c0b688217..4a6d394f4 100644
> --- a/tests/regression/kernel/select_poll_epoll.cpp
> +++ b/tests/regression/kernel/select_poll_epoll.cpp
> @@ -5,6 +5,7 @@
>   *
>   */
>  
> +#include <errno.h>
>  #include <fcntl.h>
>  #include <limits.h>
>  #include <poll.h>
> @@ -456,8 +457,22 @@ void ppoll_fds_buffer_overflow(
>  	ufds[0].fd = wait_fd;
>  	ufds[0].events = POLLIN|POLLPRI;
>  
> +#ifdef SYS_ppoll_time64
> +	/*
> +	 * As there is no timeout value, we don't convert to/from
> +	 * 64/32-bit time_t.
> +	 */
> +	ret = syscall(SYS_ppoll_time64, ufds, 100, NULL, NULL);
> +	if (ret == 0 || errno != ENOSYS) {
> +		goto ppoll_fds_buffer_overflow_done;
> +	}
> +#endif
> +

This results in the following warning when building for an architecture
that doesn't have SYS_ppoll_time64 defined:

label ‘ppoll_fds_buffer_overflow_done’ defined but not used [-Wunused-label]
ppoll_fds_buffer_overflow_done:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
select_poll_epoll.cpp: In function ‘void ppoll_fds_ulong_max(FILE*)’:


Also, it is my understanding that both syscalls can be available on some
platforms. In that case, it would make sense to add them as separate
tests and skip tests that target non-existant syscalls.

Thanks!
Jérémie


> +#ifdef SYS_ppoll
>  	ret = syscall(SYS_ppoll, ufds, 100, NULL, NULL);
> +#endif
>  
> +ppoll_fds_buffer_overflow_done:
>  	if (ret < 0) {
>  		PERROR("ppoll");
>  	} else if (ret > 0) {
> @@ -483,7 +498,22 @@ void ppoll_fds_ulong_max(FILE *validation_output_file __attribute__((unused)))
>  	ufds[0].fd = wait_fd;
>  	ufds[0].events = POLLIN|POLLPRI;
>  
> +#ifdef SYS_ppoll_time64
> +	/*
> +	 * As there is no timeout value, we don't convert to/from
> +	 * 64/32-bit time_t.
> +	 */
> +	ret = syscall(SYS_ppoll_time64, ufds, ULONG_MAX, NULL, NULL);
> +	if (ret == 0 || errno != ENOSYS) {
> +		goto ppoll_fds_ulong_max_done;
> +	}
> +#endif
> +
> +#ifdef SYS_ppoll
>  	ret = syscall(SYS_ppoll, ufds, ULONG_MAX, NULL, NULL);
> +#endif
> +
> +ppoll_fds_ulong_max_done:
>  	if (ret < 0) {
>  		/* Expected error. */
>  	} else if (ret > 0) {
> @@ -524,7 +554,18 @@ void pselect_invalid_fd(FILE *validation_output_file __attribute__((unused)))
>  	FD_ZERO(&rfds);
>  	FD_SET(fd, &rfds);
>  
> +#ifdef SYS_pselect6_time64
> +	ret = syscall(SYS_pselect6_time64, fd + 1, &rfds, NULL, NULL, NULL, NULL);
> +	if (ret == 0 || errno != ENOSYS) {
> +		goto pselect_invalid_fd_done;
> +	}
> +#endif
> +
> +#ifdef SYS_pselect6
>  	ret = syscall(SYS_pselect6, fd + 1, &rfds, NULL, NULL, NULL, NULL);
> +#endif
> +
> +pselect_invalid_fd_done:
>  	if (ret == -1) {
>  		/* Expected error. */
>  	} else if (ret) {
> @@ -553,8 +594,20 @@ void pselect_invalid_pointer(
>  	FD_ZERO(&rfds);
>  	FD_SET(wait_fd, &rfds);
>  
> +#ifdef SYS_pselect6_time64
> +	ret = syscall(SYS_pselect6_time64, 1, &rfds, (fd_set *) invalid, NULL, NULL,
> +			NULL);
> +	if (ret == 0 || errno != ENOSYS) {
> +		goto pselect_invalid_pointer_done;
> +	}
> +#endif
> +
> +#ifdef SYS_pselect6
>  	ret = syscall(SYS_pselect6, 1, &rfds, (fd_set *) invalid, NULL, NULL,
>  			NULL);
> +#endif
> +
> +pselect_invalid_pointer_done:
>  	if (ret == -1) {
>  		/* Expected error. */
>  	} else if (ret) {
> -- 
> 2.37.3
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [lttng-dev] [PATCH lttng-tools 2/2] Tests: select_poll_epoll: Add support for _time64
  2022-10-12 13:19   ` Jérémie Galarneau via lttng-dev
@ 2022-10-13  0:12     ` Alistair Francis via lttng-dev
  2022-10-13  7:08       ` Jérémie Galarneau via lttng-dev
  0 siblings, 1 reply; 5+ messages in thread
From: Alistair Francis via lttng-dev @ 2022-10-13  0:12 UTC (permalink / raw)
  To: Jérémie Galarneau; +Cc: Alistair Francis, lttng-dev

On Wed, Oct 12, 2022 at 11:19 PM Jérémie Galarneau
<jeremie.galarneau@efficios.com> wrote:
>
> On Fri, Oct 07, 2022 at 10:39:18AM +1000, Alistair Francis via lttng-dev wrote:
>
> Hi Alistair,
>
> The first patch is good, I'll merge it in master.
> Some comments on this patch follow.

Thanks!

>
> > From: Alistair Francis <alistair.francis@wdc.com>
> >
> > Add support for the  64-bit time_t syscalls SYS_ppoll_time64
> > and SYS_pselect6_time64.
> >
> > These are the syscalls that exist 32-bit platforms since the 5.1 kernel.
> > 32-bit platforms with a 64-bit time_t only have these and don't have the
> > original syscalls (such as 32-bit RISC-V).
> >
> > Fixes: https://github.com/lttng/lttng-tools/pull/162
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > ---
> >  tests/regression/kernel/select_poll_epoll.cpp | 53 +++++++++++++++++++
> >  1 file changed, 53 insertions(+)
> >
> > diff --git a/tests/regression/kernel/select_poll_epoll.cpp b/tests/regression/kernel/select_poll_epoll.cpp
> > index c0b688217..4a6d394f4 100644
> > --- a/tests/regression/kernel/select_poll_epoll.cpp
> > +++ b/tests/regression/kernel/select_poll_epoll.cpp
> > @@ -5,6 +5,7 @@
> >   *
> >   */
> >
> > +#include <errno.h>
> >  #include <fcntl.h>
> >  #include <limits.h>
> >  #include <poll.h>
> > @@ -456,8 +457,22 @@ void ppoll_fds_buffer_overflow(
> >       ufds[0].fd = wait_fd;
> >       ufds[0].events = POLLIN|POLLPRI;
> >
> > +#ifdef SYS_ppoll_time64
> > +     /*
> > +      * As there is no timeout value, we don't convert to/from
> > +      * 64/32-bit time_t.
> > +      */
> > +     ret = syscall(SYS_ppoll_time64, ufds, 100, NULL, NULL);
> > +     if (ret == 0 || errno != ENOSYS) {
> > +             goto ppoll_fds_buffer_overflow_done;
> > +     }
> > +#endif
> > +
>
> This results in the following warning when building for an architecture
> that doesn't have SYS_ppoll_time64 defined:
>
> label ‘ppoll_fds_buffer_overflow_done’ defined but not used [-Wunused-label]
> ppoll_fds_buffer_overflow_done:
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> select_poll_epoll.cpp: In function ‘void ppoll_fds_ulong_max(FILE*)’:

Argh, I'll fix this

>
>
> Also, it is my understanding that both syscalls can be available on some
> platforms. In that case, it would make sense to add them as separate
> tests and skip tests that target non-existant syscalls.

So all 32-bit platforms since the 5.1 (or 5.4?) kernel have both syscalls.

From my understanding the original syscalls will be removed on 32-bit
platforms at some point (before 2038) and there will only be *_time64
variants.

If you want I can copy the tests to test both syscall types, but I
don't think that's necessary.

Alistair
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [lttng-dev] [PATCH lttng-tools 2/2] Tests: select_poll_epoll: Add support for _time64
  2022-10-13  0:12     ` Alistair Francis via lttng-dev
@ 2022-10-13  7:08       ` Jérémie Galarneau via lttng-dev
  0 siblings, 0 replies; 5+ messages in thread
From: Jérémie Galarneau via lttng-dev @ 2022-10-13  7:08 UTC (permalink / raw)
  To: Alistair Francis; +Cc: Alistair Francis, lttng-dev

On Thu, Oct 13, 2022 at 10:12:48AM +1000, Alistair Francis wrote:
> On Wed, Oct 12, 2022 at 11:19 PM Jérémie Galarneau
> <jeremie.galarneau@efficios.com> wrote:
> >
> > On Fri, Oct 07, 2022 at 10:39:18AM +1000, Alistair Francis via lttng-dev wrote:
> >
> > Hi Alistair,
> >
> > The first patch is good, I'll merge it in master.
> > Some comments on this patch follow.
> 
> Thanks!
> 
> >
> > > From: Alistair Francis <alistair.francis@wdc.com>
> > >
> > > Add support for the  64-bit time_t syscalls SYS_ppoll_time64
> > > and SYS_pselect6_time64.
> > >
> > > These are the syscalls that exist 32-bit platforms since the 5.1 kernel.
> > > 32-bit platforms with a 64-bit time_t only have these and don't have the
> > > original syscalls (such as 32-bit RISC-V).
> > >
> > > Fixes: https://github.com/lttng/lttng-tools/pull/162
> > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > ---
> > >  tests/regression/kernel/select_poll_epoll.cpp | 53 +++++++++++++++++++
> > >  1 file changed, 53 insertions(+)
> > >
> > > diff --git a/tests/regression/kernel/select_poll_epoll.cpp b/tests/regression/kernel/select_poll_epoll.cpp
> > > index c0b688217..4a6d394f4 100644
> > > --- a/tests/regression/kernel/select_poll_epoll.cpp
> > > +++ b/tests/regression/kernel/select_poll_epoll.cpp
> > > @@ -5,6 +5,7 @@
> > >   *
> > >   */
> > >
> > > +#include <errno.h>
> > >  #include <fcntl.h>
> > >  #include <limits.h>
> > >  #include <poll.h>
> > > @@ -456,8 +457,22 @@ void ppoll_fds_buffer_overflow(
> > >       ufds[0].fd = wait_fd;
> > >       ufds[0].events = POLLIN|POLLPRI;
> > >
> > > +#ifdef SYS_ppoll_time64
> > > +     /*
> > > +      * As there is no timeout value, we don't convert to/from
> > > +      * 64/32-bit time_t.
> > > +      */
> > > +     ret = syscall(SYS_ppoll_time64, ufds, 100, NULL, NULL);
> > > +     if (ret == 0 || errno != ENOSYS) {
> > > +             goto ppoll_fds_buffer_overflow_done;
> > > +     }
> > > +#endif
> > > +
> >
> > This results in the following warning when building for an architecture
> > that doesn't have SYS_ppoll_time64 defined:
> >
> > label ‘ppoll_fds_buffer_overflow_done’ defined but not used [-Wunused-label]
> > ppoll_fds_buffer_overflow_done:
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > select_poll_epoll.cpp: In function ‘void ppoll_fds_ulong_max(FILE*)’:
> 
> Argh, I'll fix this
> 
> >
> >
> > Also, it is my understanding that both syscalls can be available on some
> > platforms. In that case, it would make sense to add them as separate
> > tests and skip tests that target non-existant syscalls.
> 
> So all 32-bit platforms since the 5.1 (or 5.4?) kernel have both syscalls.
> 
> From my understanding the original syscalls will be removed on 32-bit
> platforms at some point (before 2038) and there will only be *_time64
> variants.
> 
> If you want I can copy the tests to test both syscall types, but I
> don't think that's necessary.
>

My fear is that on those platforms the test will pass if the kernel tracer
succeeds in tracing any of the two syscalls.

I think it will be easier to simply have separate tests than validate the
two invocations independently in the trace.

Thanks!
Jérémie

> Alistair
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-13 10:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-07  0:39 [lttng-dev] [PATCH lttng-tools 1/2] README: Update the Userspace RCU requirements Alistair Francis via lttng-dev
2022-10-07  0:39 ` [lttng-dev] [PATCH lttng-tools 2/2] Tests: select_poll_epoll: Add support for _time64 Alistair Francis via lttng-dev
2022-10-12 13:19   ` Jérémie Galarneau via lttng-dev
2022-10-13  0:12     ` Alistair Francis via lttng-dev
2022-10-13  7:08       ` Jérémie Galarneau via lttng-dev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).