Beispiel #1
0
static void print(FILE* fp, ast_t* ast, size_t indent, bool type)
{
  size_t len = length(ast, indent, type);

  if(len < width)
    print_compact(fp, ast, indent, type);
  else
    print_extended(fp, ast, indent, type);

  fprintf(fp, "\n");
}
/** print statistics out of memory structures */
static void do_stats_shm(struct config_file* cfg, struct ub_stats_info* stats,
	struct ub_shm_stat_info* shm_stat)
{
	int i;
	char nm[32];
	for(i=0; i<cfg->num_threads; i++) {
		snprintf(nm, sizeof(nm), "thread%d", i);
		pr_stats(nm, &stats[i+1]);
	}
	pr_stats("total", &stats[0]);
	print_uptime(shm_stat);
	if(cfg->stat_extended) {
		print_mem(shm_stat);
		print_hist(stats);
		print_extended(stats);
	}
}