public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] API: Give user hint when checkpoints were not initialised
@ 2021-05-12 10:17 Richard Palethorpe
  2021-05-12 12:28 ` Cyril Hrubis
  2021-05-12 13:42 ` Petr Vorel
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Palethorpe @ 2021-05-12 10:17 UTC (permalink / raw)
  To: ltp

Currently the user gets an error about EOVERFLOW. This will hopefully
save some searching.

Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
---
 lib/tst_checkpoint.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/tst_checkpoint.c b/lib/tst_checkpoint.c
index 9e9dcf9e6..13d86c73b 100644
--- a/lib/tst_checkpoint.c
+++ b/lib/tst_checkpoint.c
@@ -86,6 +86,9 @@ int tst_checkpoint_wait(unsigned int id, unsigned int msec_timeout)
 	struct timespec timeout;
 	int ret;
 
+	if (!tst_max_futexes)
+		tst_brkm(TBROK, NULL, "Set test.needs_checkpoints = 1");
+
 	if (id >= tst_max_futexes) {
 		errno = EOVERFLOW;
 		return -1;
@@ -107,7 +110,10 @@ int tst_checkpoint_wake(unsigned int id, unsigned int nr_wake,
 {
 	unsigned int msecs = 0, waked = 0;
 
-	if (id >= tst_max_futexes) {
+	if (!tst_max_futexes)
+		tst_brkm(TBROK, NULL, "Set test.needs_checkpoints = 1");
+
+        if (id >= tst_max_futexes) {
 		errno = EOVERFLOW;
 		return -1;
 	}
-- 
2.31.1


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

* [LTP] [PATCH] API: Give user hint when checkpoints were not initialised
  2021-05-12 10:17 [LTP] [PATCH] API: Give user hint when checkpoints were not initialised Richard Palethorpe
@ 2021-05-12 12:28 ` Cyril Hrubis
  2021-05-12 13:42 ` Petr Vorel
  1 sibling, 0 replies; 5+ messages in thread
From: Cyril Hrubis @ 2021-05-12 12:28 UTC (permalink / raw)
  To: ltp

Hi!
> ---
>  lib/tst_checkpoint.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/tst_checkpoint.c b/lib/tst_checkpoint.c
> index 9e9dcf9e6..13d86c73b 100644
> --- a/lib/tst_checkpoint.c
> +++ b/lib/tst_checkpoint.c
> @@ -86,6 +86,9 @@ int tst_checkpoint_wait(unsigned int id, unsigned int msec_timeout)
>  	struct timespec timeout;
>  	int ret;
>  
> +	if (!tst_max_futexes)
> +		tst_brkm(TBROK, NULL, "Set test.needs_checkpoints = 1");
> +
>  	if (id >= tst_max_futexes) {
>  		errno = EOVERFLOW;
>  		return -1;
> @@ -107,7 +110,10 @@ int tst_checkpoint_wake(unsigned int id, unsigned int nr_wake,
>  {
>  	unsigned int msecs = 0, waked = 0;
>  
> -	if (id >= tst_max_futexes) {
> +	if (!tst_max_futexes)
> +		tst_brkm(TBROK, NULL, "Set test.needs_checkpoints = 1");
> +
> +        if (id >= tst_max_futexes) {
    ^
    Spaces instead of tabs...


Other than that this looks obviously fine.

-- 
Cyril Hrubis
chrubis@suse.cz

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

* [LTP] [PATCH] API: Give user hint when checkpoints were not initialised
  2021-05-12 10:17 [LTP] [PATCH] API: Give user hint when checkpoints were not initialised Richard Palethorpe
  2021-05-12 12:28 ` Cyril Hrubis
@ 2021-05-12 13:42 ` Petr Vorel
  2021-05-12 13:58   ` Cyril Hrubis
  1 sibling, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2021-05-12 13:42 UTC (permalink / raw)
  To: ltp

Hi Richie,

> Currently the user gets an error about EOVERFLOW. This will hopefully
> save some searching.

Nice! I'm for merging it before release (with that fixed whitespace).

Acked-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

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

* [LTP] [PATCH] API: Give user hint when checkpoints were not initialised
  2021-05-12 13:42 ` Petr Vorel
@ 2021-05-12 13:58   ` Cyril Hrubis
  2021-05-13  7:08     ` Richard Palethorpe
  0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2021-05-12 13:58 UTC (permalink / raw)
  To: ltp

Hi!
> > Currently the user gets an error about EOVERFLOW. This will hopefully
> > save some searching.
> 
> Nice! I'm for merging it before release (with that fixed whitespace).

Looks safe enough, I will fix the whitespaces and apply.

-- 
Cyril Hrubis
chrubis@suse.cz

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

* [LTP] [PATCH] API: Give user hint when checkpoints were not initialised
  2021-05-12 13:58   ` Cyril Hrubis
@ 2021-05-13  7:08     ` Richard Palethorpe
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Palethorpe @ 2021-05-13  7:08 UTC (permalink / raw)
  To: ltp

Hi,

Cyril Hrubis <chrubis@suse.cz> writes:

> Hi!
>> > Currently the user gets an error about EOVERFLOW. This will hopefully
>> > save some searching.
>> 
>> Nice! I'm for merging it before release (with that fixed whitespace).
>
> Looks safe enough, I will fix the whitespaces and apply.

Thanks, but I would not put this in the release. There is no advantage
to the end user, only test authors. It can only break the tests from an
end user POV.

-- 
Thank you,
Richard.

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

end of thread, other threads:[~2021-05-13  7:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-12 10:17 [LTP] [PATCH] API: Give user hint when checkpoints were not initialised Richard Palethorpe
2021-05-12 12:28 ` Cyril Hrubis
2021-05-12 13:42 ` Petr Vorel
2021-05-12 13:58   ` Cyril Hrubis
2021-05-13  7:08     ` Richard Palethorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox