diff --git a/include/villas/hist.h b/include/villas/hist.h index a410e3649..abb3ea091 100644 --- a/include/villas/hist.h +++ b/include/villas/hist.h @@ -67,7 +67,7 @@ double hist_mean(struct hist *h); double hist_stddev(struct hist *h); /** Print all statistical properties of distribution including a graphilcal plot of the histogram. */ -void hist_print(struct hist *h); +void hist_print(struct hist *h, int details); /** Print ASCII style plot of histogram */ void hist_plot(struct hist *h); diff --git a/lib/hist.c b/lib/hist.c index b57eaacb0..21baa6784 100644 --- a/lib/hist.c +++ b/lib/hist.c @@ -112,13 +112,13 @@ double hist_stddev(struct hist *h) return sqrt(hist_var(h)); } -void hist_print(struct hist *h) +void hist_print(struct hist *h, int details) { INDENT stats("Counted values: %ju (%ju between %f and %f)", h->total, h->total-h->higher-h->lower, h->high, h->low); stats("Highest: %f Lowest: %f", h->highest, h->lowest); stats("Mu: %f Sigma2: %f Sigma: %f", hist_mean(h), hist_var(h), hist_stddev(h)); - if (h->total - h->higher - h->lower > 0) { + if (details > 0 && h->total - h->higher - h->lower > 0) { char *buf = hist_dump(h); stats("Matlab: %s", buf); free(buf); diff --git a/src/test.c b/src/test.c index a05e4b9ea..bb31796d0 100644 --- a/src/test.c +++ b/src/test.c @@ -182,7 +182,7 @@ void test_rtt() { else error("Invalid file descriptor: %u", fd); - hist_print(&hist); + hist_print(&hist, 1); hist_destroy(&hist); }