summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-list.c')
-rw-r--r--tools/perf/builtin-list.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index 791f513ae5b4..76e1d31a68ee 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -168,6 +168,7 @@ static void default_print_metric(void *ps,
const char *desc,
const char *long_desc,
const char *expr,
+ const char *threshold,
const char *unit __maybe_unused)
{
struct print_state *print_state = ps;
@@ -227,6 +228,11 @@ static void default_print_metric(void *ps,
wordwrap(expr, 8, pager_get_columns(), 0);
printf("]\n");
}
+ if (threshold && print_state->detailed) {
+ printf("%*s", 8, "[");
+ wordwrap(threshold, 8, pager_get_columns(), 0);
+ printf("]\n");
+ }
}
struct json_print_state {
@@ -367,7 +373,7 @@ static void json_print_event(void *ps, const char *pmu_name, const char *topic,
static void json_print_metric(void *ps __maybe_unused, const char *group,
const char *name, const char *desc,
const char *long_desc, const char *expr,
- const char *unit)
+ const char *threshold, const char *unit)
{
struct json_print_state *print_state = ps;
bool need_sep = false;
@@ -388,6 +394,11 @@ static void json_print_metric(void *ps __maybe_unused, const char *group,
fix_escape_printf(&buf, "%s\t\"MetricExpr\": \"%S\"", need_sep ? ",\n" : "", expr);
need_sep = true;
}
+ if (threshold) {
+ fix_escape_printf(&buf, "%s\t\"MetricThreshold\": \"%S\"", need_sep ? ",\n" : "",
+ threshold);
+ need_sep = true;
+ }
if (unit) {
fix_escape_printf(&buf, "%s\t\"ScaleUnit\": \"%S\"", need_sep ? ",\n" : "", unit);
need_sep = true;