diff options
author | John Kacur <jkacur@starship.(none)> | 2009-12-11 14:45:27 +0100 |
---|---|---|
committer | John Kacur <jkacur@starship.(none)> | 2009-12-11 14:45:27 +0100 |
commit | a6d367302e932b3a1d1865adf64a1a29b4d54ee4 (patch) | |
tree | fcbb219f4636d33d14c6d55cd54e6837b49a4771 | |
parent | 3085482cff7a5b7f3d099259d7d2618aed5a72c6 (diff) | |
parent | 996e0f5e4de4824162757049f0814e5a007a4f33 (diff) | |
download | rt-tests-a6d367302e932b3a1d1865adf64a1a29b4d54ee4.tar.gz |
Merge commit 'v0.56' into rt-tests-dev
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | rt-tests.spec-in | 3 | ||||
-rw-r--r-- | src/cyclictest/cyclictest.c | 61 |
3 files changed, 43 insertions, 23 deletions
@@ -1,4 +1,4 @@ -VERSION_STRING = 0.55 +VERSION_STRING = 0.56 TARGETS = cyclictest signaltest classic_pi pi_stress \ hwlatdetect rt-migrate-test diff --git a/rt-tests.spec-in b/rt-tests.spec-in index 3bbaecf..8906a5b 100644 --- a/rt-tests.spec-in +++ b/rt-tests.spec-in @@ -42,6 +42,9 @@ rm -rf $RPM_BUILD_ROOT /usr/share/man/man8/hwlatdetect.8.gz %changelog +* Thu Dec 10 2009 Clark Williams <williams@redhat.com> - 0.56-1 +- cyclictest: added code to print break thread id with -b + * Thu Nov 19 2009 Clark Williams <williams@redhat.com> - 0.55-1 - pi_stress: cosmetic newline added - fixes from John Kacur <jkacur@redhat.com> diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index 223f343..24d4d83 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -138,6 +138,7 @@ struct thread_stat { long reduce; long redmax; long cycleofmax; + long hist_overflow; }; static int shutdown; @@ -149,7 +150,6 @@ static int oscope_reduction = 1; static int lockall = 0; static int tracetype = NOTRACE; static int histogram = 0; -static int histogram_limit_exceeded = 0; static int duration = 0; static int use_nsecs = 0; static int refresh_on_max; @@ -157,6 +157,9 @@ static int refresh_on_max; static pthread_cond_t refresh_on_max_cond = PTHREAD_COND_INITIALIZER; static pthread_mutex_t refresh_on_max_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t break_thread_id_lock = PTHREAD_MUTEX_INITIALIZER; +static pid_t break_thread_id = 0; + /* Backup of kernel variables that we modify */ static struct kvars { char name[KVARNAMELEN]; @@ -702,6 +705,10 @@ void *timerthread(void *param) stopped++; tracing(0); shutdown++; + pthread_mutex_lock(&break_thread_id_lock); + if (break_thread_id == 0) + break_thread_id = stat->tid; + pthread_mutex_unlock(&break_thread_id_lock); } stat->act = diff; stat->cycles++; @@ -709,18 +716,14 @@ void *timerthread(void *param) if (par->bufmsk) stat->values[stat->cycles & par->bufmsk] = diff; - /* When histogram limit got exceed, mark limit as exceeded, - * and use last bucket to recored samples of, exceeding - * latency spikes. - */ - if (histogram && diff >= histogram) { - histogram_limit_exceeded = 1; - diff = histogram - 1; + /* Update the histogram */ + if (histogram) { + if (diff >= histogram) + stat->hist_overflow++; + else + stat->hist_array[diff]++; } - if (histogram) - stat->hist_array[diff] += 1; - next.tv_sec += interval.tv_sec; next.tv_nsec += interval.tv_nsec; tsnorm(&next); @@ -1092,11 +1095,20 @@ static void sighand(int sig) tracing(0); } +static void print_tids(struct thread_param *par, int nthreads) +{ + int i; + + printf("# Thread Ids:"); + for (i = 0; i < nthreads; i++) + printf(" %05d", par[i].stats->tid); + printf("\n"); +} + static void print_hist(struct thread_param *par, int nthreads) { int i, j; unsigned long long log_entries[nthreads]; - unsigned long max_latency = 0; bzero(log_entries, sizeof(log_entries)); @@ -1109,8 +1121,6 @@ static void print_hist(struct thread_param *par, int nthreads) unsigned long curr_latency=par[j].stats->hist_array[i]; printf("%06lu\t", curr_latency); log_entries[j] += curr_latency; - if (curr_latency && max_latency < i) - max_latency = i; } printf("\n"); } @@ -1118,7 +1128,14 @@ static void print_hist(struct thread_param *par, int nthreads) for (j = 0; j < nthreads; j++) printf(" %09llu", log_entries[j]); printf("\n"); - printf("# Max Latency: %lu / %d\n", max_latency, histogram); + printf("# Max Latencys:"); + for (j = 0; j < nthreads; j++) + printf(" %05lu", par[j].stats->max); + printf("\n"); + printf("# Histogram Overflows:"); + for (j = 0; j < nthreads; j++) + printf(" %05lu", par[j].stats->hist_overflow); + printf("\n"); } static void print_stat(struct thread_param *par, int index, int verbose) @@ -1342,6 +1359,13 @@ int main(int argc, char **argv) free (stat[i].hist_array); } + if (tracelimit) { + print_tids(par, num_threads); + if (break_thread_id) + printf("# Break thread: %d\n", break_thread_id); + } + + free(stat); outpar: free(par); @@ -1358,12 +1382,5 @@ int main(int argc, char **argv) if (kernelversion != KV_26_CURR) restorekernvars(); - if (histogram && histogram_limit_exceeded) { - ret = EXIT_FAILURE; - fprintf(stderr, "ERROR: Histogram limit got exceeded at least once!\n" - "Limit exceeding got sampled in last bucket.\n"); - - } - exit(ret); } |