4 * Copyright (C) 2015, Taeung Song <treeze.taeung@gmail.com>
11 #include "util/cache.h"
12 #include <subcmd/parse-options.h>
13 #include "util/util.h"
14 #include "util/debug.h"
16 static const char * const config_usage
[] = {
17 "perf config [options]",
25 static struct option config_options
[] = {
26 OPT_SET_UINT('l', "list", &actions
,
27 "show current config variables", ACTION_LIST
),
31 static int show_config(const char *key
, const char *value
,
32 void *cb __maybe_unused
)
35 printf("%s=%s\n", key
, value
);
42 int cmd_config(int argc
, const char **argv
, const char *prefix __maybe_unused
)
46 argc
= parse_options(argc
, argv
, config_options
, config_usage
,
47 PARSE_OPT_STOP_AT_NON_OPTION
);
52 pr_err("Error: takes no arguments\n");
53 parse_options_usage(config_usage
, config_options
, "l", 1);
55 ret
= perf_config(show_config
, NULL
);
57 pr_err("Nothing configured, "
58 "please check your ~/.perfconfig file\n");
62 usage_with_options(config_usage
, config_options
);