使用 ncurses 接口编译 Linux perf?

Compile Linux perf with ncurses interface?

如果我使用发行版提供的 Linux perf 二进制文件,它通常有一个很好的 ncurses 界面(即 perf top)。

然而,当我从 linux 内核源代码编译 perf 时,它只包含基于文本的输出。

我想知道我需要做什么来编译它以支持 ncurses? P.S。我安装了 libncurses5-dev:amd64。

perf 不使用 ./configure 脚本,因为它是使用 linux 内核构建的 user-space 工具的一部分(内核没有自动工具或配置)。 linux 内核树的 perf 子目录 tools/perf 中有 makefile,您可以在其中重新运行 make。

两个额外的用户界面,TUI 和 GTK 在 http://lxr.free-electrons.com/source/tools/perf/Makefile.config?v=4.8#L499. TUI is disabled when there is no newt/slang (/usr/include/slang/slang.h or /usr/include/slang.h) and GTK2 UI needs gtk2-devel or libgtk2.0-dev. Feature macro are defined in Makefile.perf 中被禁用:

 42 # Define NO_SLANG if you do not want TUI support.
 43 #
 44 # Define NO_GTK2 if you do not want GTK+ GUI support.