diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/perf.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/perf/perf.c b/tools/perf/perf.c index a0ae2902f9c9..0f661fbce6a8 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c | |||
@@ -85,21 +85,26 @@ int check_pager_config(const char *cmd) | |||
85 | return c.val; | 85 | return c.val; |
86 | } | 86 | } |
87 | 87 | ||
88 | static int tui_command_config(const char *var, const char *value, void *data) | 88 | static int browser_command_config(const char *var, const char *value, void *data) |
89 | { | 89 | { |
90 | struct pager_config *c = data; | 90 | struct pager_config *c = data; |
91 | if (!prefixcmp(var, "tui.") && !strcmp(var + 4, c->cmd)) | 91 | if (!prefixcmp(var, "tui.") && !strcmp(var + 4, c->cmd)) |
92 | c->val = perf_config_bool(var, value); | 92 | c->val = perf_config_bool(var, value); |
93 | if (!prefixcmp(var, "gtk.") && !strcmp(var + 4, c->cmd)) | ||
94 | c->val = perf_config_bool(var, value) ? 2 : 0; | ||
93 | return 0; | 95 | return 0; |
94 | } | 96 | } |
95 | 97 | ||
96 | /* returns 0 for "no tui", 1 for "use tui", and -1 for "not specified" */ | 98 | /* |
97 | static int check_tui_config(const char *cmd) | 99 | * returns 0 for "no tui", 1 for "use tui", 2 for "use gtk", |
100 | * and -1 for "not specified" | ||
101 | */ | ||
102 | static int check_browser_config(const char *cmd) | ||
98 | { | 103 | { |
99 | struct pager_config c; | 104 | struct pager_config c; |
100 | c.cmd = cmd; | 105 | c.cmd = cmd; |
101 | c.val = -1; | 106 | c.val = -1; |
102 | perf_config(tui_command_config, &c); | 107 | perf_config(browser_command_config, &c); |
103 | return c.val; | 108 | return c.val; |
104 | } | 109 | } |
105 | 110 | ||
@@ -302,7 +307,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv) | |||
302 | prefix = NULL; /* setup_perf_directory(); */ | 307 | prefix = NULL; /* setup_perf_directory(); */ |
303 | 308 | ||
304 | if (use_browser == -1) | 309 | if (use_browser == -1) |
305 | use_browser = check_tui_config(p->cmd); | 310 | use_browser = check_browser_config(p->cmd); |
306 | 311 | ||
307 | if (use_pager == -1 && p->option & RUN_SETUP) | 312 | if (use_pager == -1 && p->option & RUN_SETUP) |
308 | use_pager = check_pager_config(p->cmd); | 313 | use_pager = check_pager_config(p->cmd); |