All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: Daniel Wagner <dwagner@suse.de>
Cc: Clark Williams <williams@redhat.com>, linux-rt-users@vger.kernel.org
Subject: Re: [PATCH rt-tests v1 02/23] cyclictest: Rename command line option --output to --json
Date: Fri, 21 May 2021 17:32:22 -0400 (EDT)	[thread overview]
Message-ID: <f5502999-7c47-8ef0-513e-f3c457407a33@redhat.com> (raw)
In-Reply-To: <20210519170945.21941-3-dwagner@suse.de>



On Wed, 19 May 2021, Daniel Wagner wrote:

> The initial idea was to have several different output format
> supported but it turns out everyone is happy with JSON, so
> there is no need to add another format.
> 
> Thus let's make the command line option more specific and
> rename it to --json.
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
>  src/cyclictest/cyclictest.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
> index 59dda1973b1a..a561443fa67b 100644
> --- a/src/cyclictest/cyclictest.c
> +++ b/src/cyclictest/cyclictest.c
> @@ -218,7 +218,7 @@ static struct timespec globalt;
>  
>  static char fifopath[MAX_PATH];
>  static char histfile[MAX_PATH];
> -static char outfile[MAX_PATH];
> +static char jsonfile[MAX_PATH];
>  
>  static struct thread_param **parameters;
>  static struct thread_stat **statistics;
> @@ -832,6 +832,7 @@ static void display_help(int error)
>  	       "-H       --histofall=US    same as -h except with an additional summary column\n"
>  	       "	 --histfile=<path> dump the latency histogram to <path> instead of stdout\n"
>  	       "-i INTV  --interval=INTV   base interval of thread in us default=1000\n"
> +	       "         --json=FILENAME   write final results into FILENAME, JSON formatted\n"
>  	       "-l LOOPS --loops=LOOPS     number of loops: default=0(endless)\n"
>  	       "	 --laptop	   Save battery when running cyclictest\n"
>  	       "			   This will give you poorer realtime results\n"
> @@ -841,7 +842,6 @@ static void display_help(int error)
>  	       "			   latency is hit. Useful for low bandwidth.\n"
>  	       "-N       --nsecs           print results in ns instead of us (default us)\n"
>  	       "-o RED   --oscope=RED      oscilloscope mode, reduce verbose output by RED\n"
> -	       "         --output=FILENAME write final results into FILENAME, JSON formatted\n"
>  	       "-p PRIO  --priority=PRIO   priority of highest prio thread\n"
>  	       "	 --policy=NAME     policy of measurement thread, where NAME may be one\n"
>  	       "                           of: other, normal, batch, idle, fifo or rr.\n"
> @@ -944,14 +944,14 @@ enum option_values {
>  	OPT_AFFINITY=1, OPT_BREAKTRACE, OPT_CLOCK,
>  	OPT_DISTANCE, OPT_DURATION, OPT_LATENCY,
>  	OPT_FIFO, OPT_HISTOGRAM, OPT_HISTOFALL, OPT_HISTFILE,
> -	OPT_INTERVAL, OPT_LOOPS, OPT_MLOCKALL, OPT_REFRESH,
> +	OPT_INTERVAL, OPT_JSON, OPT_LOOPS, OPT_MLOCKALL, OPT_REFRESH,
>  	OPT_NANOSLEEP, OPT_NSECS, OPT_OSCOPE, OPT_PRIORITY,
>  	OPT_QUIET, OPT_PRIOSPREAD, OPT_RELATIVE, OPT_RESOLUTION,
>  	OPT_SYSTEM, OPT_SMP, OPT_THREADS, OPT_TRIGGER,
>  	OPT_TRIGGER_NODES, OPT_UNBUFFERED, OPT_NUMA, OPT_VERBOSE,
>  	OPT_DBGCYCLIC, OPT_POLICY, OPT_HELP, OPT_NUMOPTS,
>  	OPT_ALIGNED, OPT_SECALIGNED, OPT_LAPTOP, OPT_SMI,
> -	OPT_TRACEMARK, OPT_POSIX_TIMERS, OPT_OUTPUT
> +	OPT_TRACEMARK, OPT_POSIX_TIMERS,
>  };
>  
>  /* Process commandline options */
> @@ -979,13 +979,13 @@ static void process_options(int argc, char *argv[], int max_cpus)
>  			{"histofall",        required_argument, NULL, OPT_HISTOFALL },
>  			{"histfile",	     required_argument, NULL, OPT_HISTFILE },
>  			{"interval",         required_argument, NULL, OPT_INTERVAL },
> +			{"json",             required_argument, NULL, OPT_JSON },
>  			{"laptop",	     no_argument,	NULL, OPT_LAPTOP },
>  			{"loops",            required_argument, NULL, OPT_LOOPS },
>  			{"mlockall",         no_argument,       NULL, OPT_MLOCKALL },
>  			{"refresh_on_max",   no_argument,       NULL, OPT_REFRESH },
>  			{"nsecs",            no_argument,       NULL, OPT_NSECS },
>  			{"oscope",           required_argument, NULL, OPT_OSCOPE },
> -			{"output",           required_argument, NULL, OPT_OUTPUT },
>  			{"priority",         required_argument, NULL, OPT_PRIORITY },
>  			{"quiet",            no_argument,       NULL, OPT_QUIET },
>  			{"priospread",       no_argument,       NULL, OPT_PRIOSPREAD },
> @@ -1080,6 +1080,9 @@ static void process_options(int argc, char *argv[], int max_cpus)
>  		case 'i':
>  		case OPT_INTERVAL:
>  			interval = atoi(optarg); break;
> +		case OPT_JSON:
> +			strncpy(jsonfile, optarg, strnlen(optarg, MAX_PATH-1));
> +			break;
>  		case 'l':
>  		case OPT_LOOPS:
>  			max_cycles = atoi(optarg); break;
> @@ -1095,9 +1098,6 @@ static void process_options(int argc, char *argv[], int max_cpus)
>  		case 'o':
>  		case OPT_OSCOPE:
>  			oscope_reduction = atoi(optarg); break;
> -		case OPT_OUTPUT:
> -			strncpy(outfile, optarg, strnlen(optarg, MAX_PATH-1));
> -			break;
>  		case 'p':
>  		case OPT_PRIORITY:
>  			priority = atoi(optarg);
> @@ -2134,8 +2134,8 @@ int main(int argc, char **argv)
>  	if (!verbose && !quiet && refresh_on_max)
>  		printf("\033[%dB", num_threads + 2);
>  
> -	if (strlen(outfile) != 0)
> -		rt_write_json(outfile, ret, write_stats, NULL);
> +	if (strlen(jsonfile) != 0)
> +		rt_write_json(jsonfile, ret, write_stats, NULL);
>  
>  	if (quiet)
>  		quiet = 2;
> -- 
> 2.31.1
> 
> 
Signed-off-by: John Kacur <jkacur@redhat.com>


  reply	other threads:[~2021-05-21 21:32 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 17:09 [PATCH rt-tests v1 00/23] Rename --output to --json Daniel Wagner
2021-05-19 17:09 ` [PATCH rt-tests v1 01/23] cyclicdeadline: Fix JSON output format Daniel Wagner
2021-05-21 21:30   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 02/23] cyclictest: Rename command line option --output to --json Daniel Wagner
2021-05-21 21:32   ` John Kacur [this message]
2021-05-19 17:09 ` [PATCH rt-tests v1 03/23] oslat: " Daniel Wagner
2021-05-21 21:35   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 04/23] pi_stress: " Daniel Wagner
2021-05-21 21:39   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 05/23] pmqtest: " Daniel Wagner
2021-05-21 21:41   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 06/23] ptsematest: " Daniel Wagner
2021-05-21 21:45   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 07/23] rt-migrate-test: " Daniel Wagner
2021-05-21 21:47   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 08/23] cyclicdeadline: " Daniel Wagner
2021-05-21 21:49   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 09/23] signaltest: " Daniel Wagner
2021-05-21 21:51   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 10/23] sigwaittest: " Daniel Wagner
2021-05-22  3:33   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 11/23] ssdd: " Daniel Wagner
2021-05-22  3:34   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 12/23] svsematest: " Daniel Wagner
2021-05-22  3:51   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 13/23] cyclictest: Add --json to man page Daniel Wagner
2021-05-22  3:38   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 14/23] oslat: " Daniel Wagner
2021-05-22  3:39   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 15/23] pi_stress: " Daniel Wagner
2021-05-22  3:41   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 16/23] pmqtest: " Daniel Wagner
2021-05-22  3:42   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 17/23] ptsematest: " Daniel Wagner
2021-05-22  3:44   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 18/23] rt-migrate-test: " Daniel Wagner
2021-05-22  3:45   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 19/23] cyclicdeadline: " Daniel Wagner
2021-05-22  3:46   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 20/23] signaltest: " Daniel Wagner
2021-05-22  3:48   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 21/23] sigwaittest: " Daniel Wagner
2021-05-22  3:49   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 22/23] ssdd: " Daniel Wagner
2021-05-22  3:52   ` John Kacur
2021-05-19 17:09 ` [PATCH rt-tests v1 23/23] svematest: " Daniel Wagner
2021-05-22  3:54   ` John Kacur

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=f5502999-7c47-8ef0-513e-f3c457407a33@redhat.com \
    --to=jkacur@redhat.com \
    --cc=dwagner@suse.de \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.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.