Lines Matching defs:out

244 void bch2_prt_u64_base2_nbits(struct printbuf *out, u64 v, unsigned nr_bits)
247 prt_char(out, '0' + ((v >> --nr_bits) & 1));
250 void bch2_prt_u64_base2(struct printbuf *out, u64 v)
252 bch2_prt_u64_base2_nbits(out, v, fls64(v) ?: 1);
303 void bch2_prt_backtrace(struct printbuf *out, bch_stacktrace *stack)
306 prt_printf(out, "[<0>] %pB", (void *) *i);
307 prt_newline(out);
311 int bch2_prt_task_backtrace(struct printbuf *out, struct task_struct *task, unsigned skipnr, gfp_t gfp)
316 bch2_prt_backtrace(out, &stack);
323 void bch2_prt_datetime(struct printbuf *out, time64_t sec)
329 prt_str(out, buf);
332 void bch2_prt_datetime(struct printbuf *out, time64_t sec)
336 prt_u64(out, sec);
340 void bch2_pr_time_units(struct printbuf *out, u64 ns)
344 prt_printf(out, "%llu %s", div_u64(ns, u->nsecs), u->name);
347 static void bch2_pr_time_units_aligned(struct printbuf *out, u64 ns)
351 prt_printf(out, "%llu \r%s", div64_u64(ns, u->nsecs), u->name);
354 static inline void pr_name_and_units(struct printbuf *out, const char *name, u64 ns)
356 prt_printf(out, "%s\t", name);
357 bch2_pr_time_units_aligned(out, ns);
358 prt_newline(out);
363 void bch2_time_stats_to_text(struct printbuf *out, struct bch2_time_stats *stats)
388 printbuf_tabstop_push(out, out->indent + TABSTOP_SIZE);
389 prt_printf(out, "count:\t%llu\n", stats->duration_stats.n);
390 printbuf_tabstop_pop(out);
392 printbuf_tabstops_reset(out);
394 printbuf_tabstop_push(out, out->indent + 20);
395 printbuf_tabstop_push(out, TABSTOP_SIZE + 2);
396 printbuf_tabstop_push(out, 0);
397 printbuf_tabstop_push(out, TABSTOP_SIZE + 2);
399 prt_printf(out, "\tsince mount\r\trecent\r\n");
400 prt_printf(out, "recent");
402 printbuf_tabstops_reset(out);
403 printbuf_tabstop_push(out, out->indent + 20);
404 printbuf_tabstop_push(out, TABSTOP_SIZE);
405 printbuf_tabstop_push(out, 2);
406 printbuf_tabstop_push(out, TABSTOP_SIZE);
408 prt_printf(out, "duration of events\n");
409 printbuf_indent_add(out, 2);
411 pr_name_and_units(out, "min:", stats->min_duration);
412 pr_name_and_units(out, "max:", stats->max_duration);
413 pr_name_and_units(out, "total:", stats->total_duration);
415 prt_printf(out, "mean:\t");
416 bch2_pr_time_units_aligned(out, d_mean);
417 prt_tab(out);
418 bch2_pr_time_units_aligned(out, mean_and_variance_weighted_get_mean(stats->duration_stats_weighted, TIME_STATS_MV_WEIGHT));
419 prt_newline(out);
421 prt_printf(out, "stddev:\t");
422 bch2_pr_time_units_aligned(out, d_stddev);
423 prt_tab(out);
424 bch2_pr_time_units_aligned(out, mean_and_variance_weighted_get_stddev(stats->duration_stats_weighted, TIME_STATS_MV_WEIGHT));
426 printbuf_indent_sub(out, 2);
427 prt_newline(out);
429 prt_printf(out, "time between events\n");
430 printbuf_indent_add(out, 2);
432 pr_name_and_units(out, "min:", stats->min_freq);
433 pr_name_and_units(out, "max:", stats->max_freq);
435 prt_printf(out, "mean:\t");
436 bch2_pr_time_units_aligned(out, f_mean);
437 prt_tab(out);
438 bch2_pr_time_units_aligned(out, mean_and_variance_weighted_get_mean(stats->freq_stats_weighted, TIME_STATS_MV_WEIGHT));
439 prt_newline(out);
441 prt_printf(out, "stddev:\t");
442 bch2_pr_time_units_aligned(out, f_stddev);
443 prt_tab(out);
444 bch2_pr_time_units_aligned(out, mean_and_variance_weighted_get_stddev(stats->freq_stats_weighted, TIME_STATS_MV_WEIGHT));
446 printbuf_indent_sub(out, 2);
447 prt_newline(out);
449 printbuf_tabstops_reset(out);
457 prt_printf(out, "quantiles (%s):\t", u->name);
462 prt_printf(out, "%llu ", div_u64(q, u->nsecs));
464 prt_newline(out);
569 void bch2_pd_controller_debug_to_text(struct printbuf *out, struct bch_pd_controller *pd)
571 if (!out->nr_tabstops)
572 printbuf_tabstop_push(out, 20);
574 prt_printf(out, "rate:\t");
575 prt_human_readable_s64(out, pd->rate.rate);
576 prt_newline(out);
578 prt_printf(out, "target:\t");
579 prt_human_readable_u64(out, pd->last_target);
580 prt_newline(out);
582 prt_printf(out, "actual:\t");
583 prt_human_readable_u64(out, pd->last_actual);
584 prt_newline(out);
586 prt_printf(out, "proportional:\t");
587 prt_human_readable_s64(out, pd->last_proportional);
588 prt_newline(out);
590 prt_printf(out, "derivative:\t");
591 prt_human_readable_s64(out, pd->last_derivative);
592 prt_newline(out);
594 prt_printf(out, "change:\t");
595 prt_human_readable_s64(out, pd->last_change);
596 prt_newline(out);
598 prt_printf(out, "next io:\t%llims\n", div64_s64(pd->rate.next - local_clock(), NSEC_PER_MSEC));