static bool sync_run = false;
static unsigned int unit_width = 4; /* strlen("unit") */
static bool forever = false;
-static bool metric_only = false;
static bool force_metric_only = false;
static bool no_merge = false;
static bool walltime_run_table = false;
print_metric_t pm = print_metric_std;
new_line_t nl;
- if (metric_only) {
+ if (config->metric_only) {
nl = new_line_metric;
if (config->csv_output)
pm = print_metric_only_csv;
} else
nl = new_line_std;
- if (config->csv_output && !metric_only) {
+ if (config->csv_output && !config->metric_only) {
static int aggr_fields[] = {
[AGGR_GLOBAL] = 0,
[AGGR_THREAD] = 1,
os.nfields++;
}
if (run == 0 || ena == 0 || counter->counts->scaled == -1) {
- if (metric_only) {
+ if (config->metric_only) {
pm(config, &os, NULL, "", "", 0);
return;
}
return;
}
- if (!metric_only)
+ if (!config->metric_only)
abs_printout(config, id, nr, counter, uval);
out.print_metric = pm;
out.ctx = &os;
out.force_header = false;
- if (config->csv_output && !metric_only) {
+ if (config->csv_output && !config->metric_only) {
print_noise(config, counter, noise);
print_running(config, run, ena);
}
perf_stat__print_shadow_stats(config, counter, uval,
first_shadow_cpu(counter, id),
&out, &metric_events, st);
- if (!config->csv_output && !metric_only) {
+ if (!config->csv_output && !config->metric_only) {
print_noise(config, counter, noise);
print_running(config, run, ena);
}
static void print_aggr(struct perf_stat_config *config,
char *prefix)
{
+ bool metric_only = config->metric_only;
FILE *output = config->output;
struct perf_evsel *counter;
int s, id, nr;
static void print_counter_aggr(struct perf_stat_config *config,
struct perf_evsel *counter, char *prefix)
{
+ bool metric_only = config->metric_only;
FILE *output = config->output;
double uval;
struct caggr_data cd = { .avg = 0.0 };
static void print_interval(struct perf_stat_config *config,
char *prefix, struct timespec *ts)
{
+ bool metric_only = config->metric_only;
FILE *output = config->output;
static int num_print_interval;
struct timespec *ts,
int argc, const char **argv)
{
+ bool metric_only = config->metric_only;
int interval = config->interval;
struct perf_evsel *counter;
char buf[64], *prefix = NULL;
const char *s __maybe_unused, int unset)
{
force_metric_only = true;
- metric_only = !unset;
+ stat_config.metric_only = !unset;
return 0;
}
"aggregate counts per thread", AGGR_THREAD),
OPT_UINTEGER('D', "delay", &stat_config.initial_delay,
"ms to wait before starting measurement after program start"),
- OPT_CALLBACK_NOOPT(0, "metric-only", &metric_only, NULL,
+ OPT_CALLBACK_NOOPT(0, "metric-only", &stat_config.metric_only, NULL,
"Only print computed metrics. No raw values", enable_metric_only),
OPT_BOOLEAN(0, "topdown", &topdown_run,
"measure topdown level 1 statistics"),
if (pmu_have_event("msr", "aperf") &&
pmu_have_event("msr", "smi")) {
if (!force_metric_only)
- metric_only = true;
+ stat_config.metric_only = true;
err = parse_events(evsel_list, smi_cost_attrs, &errinfo);
} else {
fprintf(stderr, "To measure SMI cost, it needs "
}
if (!force_metric_only)
- metric_only = true;
+ stat_config.metric_only = true;
if (topdown_filter_events(topdown_attrs, &str,
arch_topdown_check_group(&warn)) < 0) {
pr_err("Out of memory\n");
goto out;
}
- if (metric_only && stat_config.aggr_mode == AGGR_THREAD) {
+ if (stat_config.metric_only && stat_config.aggr_mode == AGGR_THREAD) {
fprintf(stderr, "--metric-only is not supported with --per-thread\n");
goto out;
}
- if (metric_only && run_count > 1) {
+ if (stat_config.metric_only && run_count > 1) {
fprintf(stderr, "--metric-only is not supported with -r\n");
goto out;
}