* [PATCH 1/3] rt-tests: Add *.dat to .gitignore @ 2021-10-01 17:29 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 0 siblings, 2 replies; 4+ messages in thread From: John Kacur @ 2021-10-01 17:29 UTC (permalink / raw) To: RT Cc: Clark Williams, Sebastian Andrzej Siewior, Pierre FICHEUX, Thomas Gleixner, Punit Agrawal, John Ogness, Luis Goncalves, Leah Leshchinsky, John Kacur Add *.dat to .gitignore so that files such as trace.dat are ignored by git Signed-off-by: John Kacur <jkacur@redhat.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a975c4bd28fb..61fb49c874d3 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ *.bz2 *.xz *.asc +*.dat tmp patches ChangeLog -- 2.31.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] rt-tests: Update the help and man page for --latency 2021-10-01 17:29 [PATCH 1/3] rt-tests: Add *.dat to .gitignore John Kacur @ 2021-10-01 17:29 ` John Kacur 2021-10-01 17:29 ` [PATCH 3/3] rt-tests: cyclictest: Add --default-system option John Kacur 1 sibling, 0 replies; 4+ messages in thread From: John Kacur @ 2021-10-01 17:29 UTC (permalink / raw) To: RT Cc: Clark Williams, Sebastian Andrzej Siewior, Pierre FICHEUX, Thomas Gleixner, Punit Agrawal, John Ogness, Luis Goncalves, Leah Leshchinsky, John Kacur - Update the help and man page for --latency - Fix some sorting of --latency and --loops Signed-off-by: John Kacur <jkacur@redhat.com> --- src/cyclictest/cyclictest.8 | 12 ++++++------ src/cyclictest/cyclictest.c | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/cyclictest/cyclictest.8 b/src/cyclictest/cyclictest.8 index abc56e8e4970..dc0a278f3d30 100644 --- a/src/cyclictest/cyclictest.8 +++ b/src/cyclictest/cyclictest.8 @@ -67,9 +67,6 @@ Specify a length for the test run. .br Append 'm', 'h', or 'd' to specify minutes, hours or days. .TP -.B \-\-latency=PM_Q0S -write PM_Q0S to /dev/cpu_dma_latency -.TP .B \-F, \-\-fifo=<path> Create a named pipe at path and write stats to it .TP @@ -88,12 +85,15 @@ Set the base interval of the thread(s) in microseconds (default is 1000us). This .B \-\-json=FILENAME Write final results into FILENAME, JSON formatted. .TP -.B \-l, \-\-loops=LOOPS -Set the number of loops. The default is 0 (endless). This option is useful for automated tests with a given number of test cycles. Cyclictest is stopped once the number of timer intervals has been reached. -.TP .B \-\-laptop Save battery when running cyclictest. This will give you poorer realtime results, but will not drain your battery so quickly. .TP +.B \-\-latency=PM_Q0S +power management latency target value. This value is written to /dev/cpu_dma_latency and affects c-states. The default is 0 +.TP +.B \-l, \-\-loops=LOOPS +Set the number of loops. The default is 0 (endless). This option is useful for automated tests with a given number of test cycles. Cyclictest is stopped once the number of timer intervals has been reached. +.TP .B \-\-mainaffinity=CPUSET Run the main thread on CPU #N. This only affects the main thread and not the measurement threads .TP diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index f8f7dbc7e43d..067b75317c9a 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -823,7 +823,6 @@ static void display_help(int error) "-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" - " --latency=PM_QOS write PM_QOS to /dev/cpu_dma_latency\n" "-F --fifo=<path> create a named pipe at path and write stats to it\n" "-h --histogram=US dump a latency histogram to stdout after the run\n" " US is the max latency time to be tracked in microseconds\n" @@ -832,10 +831,13 @@ static void display_help(int error) " --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" " but will not drain your battery so quickly\n" + " --latency=PM_QOS power management latency target value\n" + " This value is written to /dev/cpu_dma_latency\n" + " and affects c-states. The default is 0\n" + "-l LOOPS --loops=LOOPS number of loops: default=0(endless)\n" " --mainaffinity=CPUSET\n" " Run the main thread on CPU #N. This only affects\n" " the main thread and not the measurement threads\n" -- 2.31.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] rt-tests: cyclictest: Add --default-system option 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 ` John Kacur 2021-10-04 11:39 ` Punit Agrawal 1 sibling, 1 reply; 4+ messages in thread From: John Kacur @ 2021-10-01 17:29 UTC (permalink / raw) To: RT Cc: Clark Williams, Sebastian Andrzej Siewior, Pierre FICHEUX, Thomas Gleixner, Punit Agrawal, John Ogness, Luis Goncalves, Leah Leshchinsky, John Kacur 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> --- 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': + case OPT_DEFAULT_SYSTEM: + power_management = 1; break; case 'd': case OPT_DISTANCE: distance = atoi(optarg); break; -- 2.31.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 3/3] rt-tests: cyclictest: Add --default-system option 2021-10-01 17:29 ` [PATCH 3/3] rt-tests: cyclictest: Add --default-system option John Kacur @ 2021-10-04 11:39 ` Punit Agrawal 0 siblings, 0 replies; 4+ messages in thread From: Punit Agrawal @ 2021-10-04 11:39 UTC (permalink / raw) To: John Kacur Cc: RT, Clark Williams, Sebastian Andrzej Siewior, Pierre FICHEUX, Thomas Gleixner, John Ogness, Luis Goncalves, Leah Leshchinsky 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; ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-10-04 11:39 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox