summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-config.c')
-rw-r--r--tools/perf/builtin-config.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/perf/builtin-config.c b/tools/perf/builtin-config.c
index 75459668edb2..bb1be79bceda 100644
--- a/tools/perf/builtin-config.c
+++ b/tools/perf/builtin-config.c
@@ -225,10 +225,23 @@ int cmd_config(int argc, const char **argv)
break;
}
- if (value == NULL)
+ if (value == NULL) {
ret = show_spec_config(set, var);
- else
+ if (ret < 0) {
+ pr_err("%s is not configured: %s\n",
+ var, config_filename);
+ free(arg);
+ break;
+ }
+ } else {
ret = set_config(set, config_filename, var, value);
+ if (ret < 0) {
+ pr_err("Failed to set '%s=%s' on %s\n",
+ var, value, config_filename);
+ free(arg);
+ break;
+ }
+ }
free(arg);
}
}