![Arnaldo Carvalho de Melo](/assets/img/avatar_default.png)
In --stdio we turn off color output when the output is not a tty, which is not always desirable, for instance, in: perf annotate | more the 'more' tool is perfectly capable of processing the escape sequences for colored output. Allow using the existing logic for .perfconfig's "color.ui" to be used from the command line by providing a stdio__config_color() helper, that will be used by annotate and report in follow up patches. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-1u4wjdbcc41dxndsb4klpa9y@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
34 lines
655 B
C
34 lines
655 B
C
#ifndef _PERF_UI_H_
|
|
#define _PERF_UI_H_ 1
|
|
|
|
#include <pthread.h>
|
|
#include <stdbool.h>
|
|
#include <linux/compiler.h>
|
|
|
|
extern pthread_mutex_t ui__lock;
|
|
extern void *perf_gtk_handle;
|
|
|
|
extern int use_browser;
|
|
|
|
void setup_browser(bool fallback_to_pager);
|
|
void exit_browser(bool wait_for_ok);
|
|
|
|
#ifdef HAVE_SLANG_SUPPORT
|
|
int ui__init(void);
|
|
void ui__exit(bool wait_for_ok);
|
|
#else
|
|
static inline int ui__init(void)
|
|
{
|
|
return -1;
|
|
}
|
|
static inline void ui__exit(bool wait_for_ok __maybe_unused) {}
|
|
#endif
|
|
|
|
void ui__refresh_dimensions(bool force);
|
|
|
|
struct option;
|
|
|
|
int stdio__config_color(const struct option *opt, const char *mode, int unset);
|
|
|
|
#endif /* _PERF_UI_H_ */
|