All of lore.kernel.org
 help / color / mirror / Atom feed
From: Punit Agrawal <punitagrawal@gmail.com>
To: John Kacur <jkacur@redhat.com>
Cc: RT <linux-rt-users@vger.kernel.org>,
	Clark Williams <williams@redhat.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Pierre FICHEUX <pierre.ficheux@smile.fr>,
	Thomas Gleixner <tglx@linutronix.de>,
	John Ogness <john.ogness@linutronix.de>,
	Luis Goncalves <lgoncalv@redhat.com>,
	Leah Leshchinsky <lleshchi@redhat.com>
Subject: Re: [PATCH 3/3] rt-tests: cyclictest: Add --default-system option
Date: Mon, 04 Oct 2021 20:39:24 +0900	[thread overview]
Message-ID: <87sfxh2f4j.fsf@stealth> (raw)
In-Reply-To: <20211001172937.13060-3-jkacur@redhat.com> (John Kacur's message of "Fri, 1 Oct 2021 13:29:37 -0400")

John Kacur <jkacur@redhat.com> writes:

> This patch add the long option --default-system
> --default-system runs cyclictest without attempting any tuning.
> Power management is not suppressed so cyclictest measures the system as
> it is configured.
>
> This is effectively the same as --laptop, but makes it clear to the user
> what is done and why.
>
> Signed-off-by: John Kacur <jkacur@redhat.com>

I suppose this is probably the best that can be done without breaking
compatibility.

One comment about a pre-existing issue in the code below.

> ---
>  src/cyclictest/cyclictest.8 |  3 +++
>  src/cyclictest/cyclictest.c | 15 ++++++++++++++-
>  2 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/src/cyclictest/cyclictest.8 b/src/cyclictest/cyclictest.8
> index dc0a278f3d30..dcae5b83147f 100644
> --- a/src/cyclictest/cyclictest.8
> +++ b/src/cyclictest/cyclictest.8
> @@ -59,6 +59,9 @@ select clock
>  .br
>  1 = CLOCK_REALTIME
>  .TP
> +.B \-\-default\-system
> +Don't attempt to tune the system from cyclictest. Power management is not suppressed. This might give poorer results, but will allow you to discover if you need to tune the system.
> +.TP
>  .B \-d, \-\-distance=DIST
>  Distance of thread intervals in us, default = 500
>  .TP
> diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
> index 067b75317c9a..cbdc6c11ffe3 100644
> --- a/src/cyclictest/cyclictest.c
> +++ b/src/cyclictest/cyclictest.c
> @@ -194,6 +194,7 @@ static int ct_debug;
>  static int use_fifo = 0;
>  static pthread_t fifo_threadid;
>  static int laptop = 0;
> +static int power_management = 0;
>  static int use_histfile = 0;
>  
>  #ifdef ARCH_HAS_SMI_COUNTER
> @@ -256,6 +257,11 @@ static void set_latency_target(void)
>  		return;
>  	}
>  
> +	if (power_management) {
> +		warn("not setting cpu_dma_latency from cyclictest\n");
> +		return;
> +	}
> +
>  	errno = 0;
>  	err = stat("/dev/cpu_dma_latency", &s);
>  	if (err == -1) {
> @@ -820,6 +826,10 @@ static void display_help(int error)
>  	       "-c CLOCK --clock=CLOCK     select clock\n"
>  	       "                           0 = CLOCK_MONOTONIC (default)\n"
>  	       "                           1 = CLOCK_REALTIME\n"
> +	       "         --default-system  Don't attempt to tune the system from cyclictest.\n"
> +	       "                           Power management is not suppressed.\n"
> +	       "                           This might give poorer results, but will allow you\n"
> +	       "                           to discover if you need to tune the system\n"
>  	       "-d DIST  --distance=DIST   distance of thread intervals in us, default=500\n"
>  	       "-D       --duration=TIME   specify a length for the test run.\n"
>  	       "                           Append 'm', 'h', or 'd' to specify minutes, hours or days.\n"
> @@ -947,7 +957,7 @@ static char *policyname(int policy)
>  
>  enum option_values {
>  	OPT_AFFINITY=1, OPT_BREAKTRACE, OPT_CLOCK,
> -	OPT_DISTANCE, OPT_DURATION, OPT_LATENCY,
> +	OPT_DEFAULT_SYSTEM, OPT_DISTANCE, OPT_DURATION, OPT_LATENCY,
>  	OPT_FIFO, OPT_HISTOGRAM, OPT_HISTOFALL, OPT_HISTFILE,
>  	OPT_INTERVAL, OPT_JSON, OPT_MAINAFFINITY, OPT_LOOPS, OPT_MLOCKALL,
>  	OPT_REFRESH, OPT_NANOSLEEP, OPT_NSECS, OPT_OSCOPE, OPT_PRIORITY,
> @@ -976,6 +986,7 @@ static void process_options(int argc, char *argv[], int max_cpus)
>  			{"aligned",          optional_argument, NULL, OPT_ALIGNED },
>  			{"breaktrace",       required_argument, NULL, OPT_BREAKTRACE },
>  			{"clock",            required_argument, NULL, OPT_CLOCK },
> +			{"default-system",   no_argument,       NULL, OPT_DEFAULT_SYSTEM },
>  			{"distance",         required_argument, NULL, OPT_DISTANCE },
>  			{"duration",         required_argument, NULL, OPT_DURATION },
>  			{"latency",          required_argument, NULL, OPT_LATENCY },
> @@ -1061,6 +1072,8 @@ static void process_options(int argc, char *argv[], int max_cpus)
>  		case OPT_CLOCK:
>  			clocksel = atoi(optarg); break;
>  		case 'C':

The case for the short option 'C' should be dropped. It seems to be a
left-over from a previous cleanup. Same for 'E' a bit further down in
the switch statement.

> +		case OPT_DEFAULT_SYSTEM:
> +			power_management = 1; break;
>  		case 'd':
>  		case OPT_DISTANCE:
>  			distance = atoi(optarg); break;

      reply	other threads:[~2021-10-04 11:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 17:29 [PATCH 1/3] rt-tests: Add *.dat to .gitignore John Kacur
2021-10-01 17:29 ` [PATCH 2/3] rt-tests: Update the help and man page for --latency John Kacur
2021-10-01 17:29 ` [PATCH 3/3] rt-tests: cyclictest: Add --default-system option John Kacur
2021-10-04 11:39   ` Punit Agrawal [this message]

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=87sfxh2f4j.fsf@stealth \
    --to=punitagrawal@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=jkacur@redhat.com \
    --cc=john.ogness@linutronix.de \
    --cc=lgoncalv@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=lleshchi@redhat.com \
    --cc=pierre.ficheux@smile.fr \
    --cc=tglx@linutronix.de \
    --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.