mbox series

[rt-tests,v2,00/14] JSON cleanups and more tests updated

Message ID 20210305073500.17926-1-dwagner@suse.de
Headers show
Series JSON cleanups and more tests updated | expand

Message

Daniel Wagner March 5, 2021, 7:34 a.m. UTC
v2:
  - added 'return_code' to the common section of the JSON output
  - dropped 'inversion' as we have 'return_code' in pip_stress
  - dropped 'success' as we have 'return code in ssdd

The first two patches fixes the format string issue. Then there are a
couple of patches which fixes the common JSON entries (command line,
start_time, end_time).

Then there are patches which add the --output parameter to the missing
rt-tests programs.

All patches are also available at:

  https://github.com/igaw/rt-tests/tree/json-output-2021-03-05

Daniel Wagner (14):
  cyclictest: Fix printf format specifier
  cyclicdeadline.c: Fix printf format specifier
  signaltest: Add missing --output usage info
  rt-util: Copy command line before getopt_long() is called
  rt-util: Add start time of test execution for JSON output
  rt-util: Add return_code to common section of JSON output
  pip_stress: Move test result output to main
  pip_stress: Return failure code if test fails
  pip_stress: Prepare arg parser to accept only long options
  pip_stress: Add JSON output feature
  pi_stress: Prepare command line parser for long options only
  pi_stress: Add JSON output feature
  ssdd: Add quiet command line option
  ssdd: Add JSON output feature

 src/cyclictest/cyclictest.c           | 13 ++--
 src/include/rt-utils.h                |  9 ++-
 src/lib/rt-utils.c                    | 86 ++++++++++++++++-----------
 src/oslat/oslat.c                     |  6 +-
 src/pi_tests/pi_stress.c              | 65 ++++++++++++++++----
 src/pi_tests/pip_stress.c             | 40 +++++++++----
 src/pmqtest/pmqtest.c                 |  4 +-
 src/ptsematest/ptsematest.c           |  4 +-
 src/rt-migrate-test/rt-migrate-test.c |  4 +-
 src/sched_deadline/cyclicdeadline.c   | 12 ++--
 src/signaltest/signaltest.c           |  5 +-
 src/sigwaittest/sigwaittest.c         |  4 +-
 src/ssdd/ssdd.c                       | 43 +++++++++++---
 src/svsematest/svsematest.c           |  4 +-
 14 files changed, 207 insertions(+), 92 deletions(-)

Comments

John Kacur March 5, 2021, 3:29 p.m. UTC | #1
On Fri, 5 Mar 2021, Daniel Wagner wrote:

> Hi John,
> 
> On Fri, Mar 05, 2021 at 08:34:46AM +0100, Daniel Wagner wrote:
> > v2:
> >   - added 'return_code' to the common section of the JSON output
> >   - dropped 'inversion' as we have 'return_code' in pip_stress
> >   - dropped 'success' as we have 'return code in ssdd
> 
> I am pretty happy with the this version now. That means I don't plan to
> change more on the JSON feature. Well, one thing I am still not really
> happy is the name '--output'. But as no one had any better idea, let's
> keep it as it is. Hopefully no one wants it changed in 2 weeks from now
> :)
> 
> So if you want to do a release, please go ahead.
> 
> Thanks,
> Daniel
> 

How about --json ?
Description, "Optionally output final results to FILENAME in JSON format"

John
John Kacur March 5, 2021, 3:51 p.m. UTC | #2
On Fri, 5 Mar 2021, Daniel Wagner wrote:

> On 05.03.21 16:29, John Kacur wrote:
> > How about --json ?
> > Description, "Optionally output final results to FILENAME in JSON format"
> 
> Ah, that reminds me why I opted for output initially. We had the discussion to
> support different output formats. But if we just stick with JSON, --json is
> way better.
> 
> What about finishing this series first and then I send the output -> json
> cleanup?
> 
> 

Fair enough.

John
John Kacur March 14, 2021, 10:45 p.m. UTC | #3
On Fri, 5 Mar 2021, Daniel Wagner wrote:

> The fields are not uint64 just longs, update the printf format

> specifiers.

> 

> Signed-off-by: Daniel Wagner <dwagner@suse.de>

> ---

>  src/cyclictest/cyclictest.c | 9 ++++-----

>  1 file changed, 4 insertions(+), 5 deletions(-)

> 

> diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c

> index 157047837259..c43dd7cbbd64 100644

> --- a/src/cyclictest/cyclictest.c

> +++ b/src/cyclictest/cyclictest.c

> @@ -11,7 +11,6 @@

>  #include <stdio.h>

>  #include <stdlib.h>

>  #include <stdint.h>

> -#include <inttypes.h>

>  #include <stdarg.h>

>  #include <unistd.h>

>  #include <fcntl.h>

> @@ -1751,15 +1750,15 @@ static void write_stats(FILE *f, void *data)

>  			if (s->hist_array[j] == 0)

>  				continue;

>  			fprintf(f, "%s", comma ? ",\n" : "\n");

> -			fprintf(f, "        \"%u\": %" PRIu64, j, s->hist_array[j]);

> +			fprintf(f, "        \"%u\": %ld", j, s->hist_array[j]);

>  			comma = 1;

>  		}

>  		if (comma)

>  			fprintf(f, "\n");

>  		fprintf(f, "      },\n");

> -		fprintf(f, "      \"cycles\": %" PRIu64 ",\n", s->cycles);

> -		fprintf(f, "      \"min\": %" PRIu64 ",\n", s->min);

> -		fprintf(f, "      \"max\": %" PRIu64 ",\n", s->max);

> +		fprintf(f, "      \"cycles\": %ld,\n", s->cycles);

> +		fprintf(f, "      \"min\": %ld,\n", s->min);

> +		fprintf(f, "      \"max\": %ld,\n", s->max);

>  		fprintf(f, "      \"avg\": %.2f,\n", s->avg/s->cycles);

>  		fprintf(f, "      \"cpu\": %d,\n", par[i]->cpu);

>  		fprintf(f, "      \"node\": %d\n", par[i]->node);

> -- 

> 2.30.1

> 

> 


This had already been added before

John
John Kacur March 14, 2021, 10:45 p.m. UTC | #4
On Fri, 5 Mar 2021, Daniel Wagner wrote:

> The fields are not uint64 just longs, update the printf format

> specifiers.

> 

> Signed-off-by: Daniel Wagner <dwagner@suse.de>

> ---

>  src/sched_deadline/cyclicdeadline.c | 7 +++----

>  1 file changed, 3 insertions(+), 4 deletions(-)

> 

> diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c

> index 33bac8cda898..d7aa9bb5d269 100644

> --- a/src/sched_deadline/cyclicdeadline.c

> +++ b/src/sched_deadline/cyclicdeadline.c

> @@ -18,7 +18,6 @@

>  #include <errno.h>

>  #include <signal.h>

>  #include <getopt.h>

> -#include <inttypes.h>

>  

>  #include <sys/syscall.h>

>  #include <sys/types.h>

> @@ -976,9 +975,9 @@ static void write_stats(FILE *f, void *data)

>  	for (i = 0; i < nr_threads; i++) {

>  		s = &sd[i].stat;

>  		fprintf(f, "    \"%u\": {\n", i);

> -		fprintf(f, "	 \"cycles\": %" PRIu64 ",\n", s->cycles);

> -		fprintf(f, "	 \"min\": %" PRIu64 ",\n", s->min);

> -		fprintf(f, "	 \"max\": %" PRIu64 ",\n", s->max);

> +		fprintf(f, "	 \"cycles\": %ld,\n", s->cycles);

> +		fprintf(f, "	 \"min\": %ld,\n", s->min);

> +		fprintf(f, "	 \"max\": %ld\n", s->max);

>  		fprintf(f, "	 \"avg\": %.2f\n", s->avg/s->cycles);

>  		fprintf(f, "    }%s\n", i == nr_threads - 1 ? "" : ",");

>  	}

> -- 

> 2.30.1

> 

> 


This has also already been added before.

John
Daniel Wagner March 15, 2021, 8:57 a.m. UTC | #5
On Sun, Mar 14, 2021 at 06:45:16PM -0400, John Kacur wrote:
> This had already been added before


Okay, I didn't show up when I pulled.
Daniel Wagner March 15, 2021, 8:58 a.m. UTC | #6
On Mon, Mar 15, 2021 at 09:57:33AM +0100, Daniel Wagner wrote:
> On Sun, Mar 14, 2021 at 06:45:16PM -0400, John Kacur wrote:

> > This had already been added before

> 

> Okay, I didn't show up when I pulled.


arg, need more coffee: "it didn't..."