static const char *pre_cmd = NULL;
static const char *post_cmd = NULL;
static bool sync_run = false;
-static unsigned int unit_width = 4; /* strlen("unit") */
static bool forever = false;
static bool force_metric_only = false;
static bool no_merge = false;
static struct perf_stat_config stat_config = {
.aggr_mode = AGGR_GLOBAL,
.scale = true,
+ .unit_width = 4, /* strlen("unit") */
};
static bool is_duration_time(struct perf_evsel *evsel)
counter->supported = true;
l = strlen(counter->unit);
- if (l > unit_width)
- unit_width = l;
+ if (l > stat_config.unit_width)
+ stat_config.unit_width = l;
if (perf_evsel__should_store_id(counter) &&
perf_evsel__store_ids(counter, evsel_list))
if (evsel->unit)
fprintf(output, "%-*s%s",
- config->csv_output ? 0 : unit_width,
+ config->csv_output ? 0 : config->unit_width,
evsel->unit, config->csv_sep);
fprintf(output, "%-*s", config->csv_output ? 0 : 25, perf_evsel__name(evsel));
}
fprintf(config->output, "%-*s%s",
- config->csv_output ? 0 : unit_width,
+ config->csv_output ? 0 : config->unit_width,
counter->unit, config->csv_sep);
fprintf(config->output, "%*s",
char *prefix, struct timespec *ts)
{
bool metric_only = config->metric_only;
+ unsigned int unit_width = config->unit_width;
FILE *output = config->output;
static int num_print_interval;