summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCrystal Wood <crwood@redhat.com>2024-01-22 16:13:21 -0600
committerJohn Kacur <jkacur@redhat.com>2024-01-23 15:27:48 -0500
commit326e7c65f07a6caee814eb1e385704aa1b5b129e (patch)
tree24cd035d772224c63d4de2e0e742e15fbbfd653e
parent8f05671597898ffc9f2f310bbf71e0b9c7b4dec3 (diff)
downloadrt-tests-326e7c65f07a6caee814eb1e385704aa1b5b129e.tar.gz
rt-tests: cyclicdeadline: Remove dead "verbose" code in print_stat()
print_stat() isn't and has never been called with verbose set, and that codepath doesn't even print anything. Remove it. Signed-off-by: Crystal Wood <crwood@redhat.com> Signed-off-by: John Kacur <jkacur@redhat.com>
-rw-r--r--src/sched_deadline/cyclicdeadline.c46
1 files changed, 15 insertions, 31 deletions
diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c
index 3cb8f71..7525ad1 100644
--- a/src/sched_deadline/cyclicdeadline.c
+++ b/src/sched_deadline/cyclicdeadline.c
@@ -53,7 +53,6 @@ typedef int s32;
/* Struct for statistics */
struct thread_stat {
unsigned long cycles;
- unsigned long cyclesread;
long min;
long max;
long act;
@@ -64,8 +63,6 @@ struct thread_stat {
int threadstarted;
int tid;
long reduce;
- long redmax;
- long cycleofmax;
};
struct sched_data {
@@ -775,36 +772,23 @@ static void print_hist(FILE *fp, struct sched_data *sd, int nthreads)
fprintf(fp, "\n");
}
-static void print_stat(FILE *fp, struct sched_data *sd, int index, int verbose, int quiet)
+static void print_stat(FILE *fp, struct sched_data *sd, int index, int quiet)
{
struct thread_stat *stat = &sd->stat;
+ char *fmt;
- if (!verbose) {
- if (quiet != 1) {
- char *fmt;
- if (use_nsecs)
- fmt = "T:%2d (%5d) I:%ld C:%7lu "
- "Min:%7ld Act:%8ld Avg:%8ld Max:%8ld\n";
- else
- fmt = "T:%2d (%5d) I:%ld C:%7lu "
- "Min:%7ld Act:%5ld Avg:%5ld Max:%8ld\n";
- fprintf(fp, fmt, index, stat->tid,
- sd->deadline_us, stat->cycles, stat->min, stat->act,
- stat->cycles ?
- (long)(stat->avg/stat->cycles) : 0, stat->max);
- }
- } else {
- while (stat->cycles != stat->cyclesread) {
- long diff = stat->values
- [stat->cyclesread & sd->bufmsk];
+ if (quiet)
+ return;
- if (diff > stat->redmax) {
- stat->redmax = diff;
- stat->cycleofmax = stat->cyclesread;
- }
- stat->cyclesread++;
- }
- }
+ if (use_nsecs)
+ fmt = "T:%2d (%5d) I:%ld C:%7lu Min:%7ld Act:%8ld Avg:%8ld Max:%8ld\n";
+ else
+ fmt = "T:%2d (%5d) I:%ld C:%7lu Min:%7ld Act:%5ld Avg:%5ld Max:%8ld\n";
+
+ fprintf(fp, fmt, index, stat->tid,
+ sd->deadline_us, stat->cycles, stat->min, stat->act,
+ stat->cycles ?
+ (long)(stat->avg/stat->cycles) : 0, stat->max);
}
static u64 do_runtime(struct sched_data *sd, u64 period)
@@ -1109,7 +1093,7 @@ static void loop(struct sched_data *sched_data, int nr_threads)
while (!shutdown) {
for (i = 0; i < nr_threads; i++)
- print_stat(stdout, &sched_data[i], i, 0, quiet);
+ print_stat(stdout, &sched_data[i], i, quiet);
usleep(10000);
if (!quiet)
printf("\033[%dA", nr_threads);
@@ -1119,7 +1103,7 @@ static void loop(struct sched_data *sched_data, int nr_threads)
printf("\033[%dB", nr_threads + 2);
} else if (!histogram) {
for (i = 0; i < nr_threads; ++i)
- print_stat(stdout, &sched_data[i], i, 0, 0);
+ print_stat(stdout, &sched_data[i], i, 0);
}
if (histogram) {