4 #include <sys/ttydefaults.h> 6 #include "../../util/sort.h" 7 #include "../../util/util.h" 8 #include "../../util/hist.h" 9 #include "../../util/debug.h" 10 #include "../../util/symbol.h" 11 #include "../browser.h" 12 #include "../helpline.h" 13 #include "../libslang.h" 16 #define MAX_LINES 2048 19 #define AVERAGE_LINE_LEN 160 28 struct list_head entries;
33 #define SCRIPT_NAMELEN 128 34 #define SCRIPT_MAX_NO 64 41 #define SCRIPT_FULLPATH_LEN 256 51 int i, num, choice, ret = -1;
66 if (choice < num && choice >= 0) {
67 strcpy(script_name, paths[choice]);
93 "Press ESC to exit") < 0)
114 int ret = -1, nr_entries = 0;
128 INIT_LIST_HEAD(&script.
entries);
140 sprintf(cmd,
"perf script -s %s ", script_name);
143 strcat(cmd, script_opt);
150 strcat(cmd,
" 2>&1");
152 fp = popen(cmd,
"r");
156 while ((retlen = getline(&line, &len, fp)) != -1) {
166 if (script.
b.
width < retlen)
169 if (nr_entries++ >= MAX_LINES - 1)
#define HE_COLORSET_NORMAL
static char const * script_name
int ui_browser__show(struct ui_browser *browser, const char *title, const char *helpline,...)
x86 movsq based memset() in arch/x86/lib/memset_64.S") MEMSET_FN(memset_erms
bool ui_browser__is_current_entry(struct ui_browser *browser, unsigned row)
unsigned int ui_browser__list_head_refresh(struct ui_browser *browser)
void ui_browser__list_head_seek(struct ui_browser *browser, off_t offset, int whence)
static int entry(u64 ip, struct unwind_info *ui)
unsigned int(* refresh)(struct ui_browser *browser)
void ui_browser__write_nstring(struct ui_browser *browser __maybe_unused, const char *msg, unsigned int width)
static int list_scripts(char *script_name)
static int script_browser__run(struct perf_script_browser *browser)
char line[AVERAGE_LINE_LEN]
#define HE_COLORSET_SELECTED
int ui_browser__run(struct ui_browser *browser, int delay_secs)
void ui_browser__hide(struct ui_browser *browser)
#define SCRIPT_FULLPATH_LEN
int ui_browser__set_color(struct ui_browser *browser, int color)
int find_scripts(char **scripts_array, char **scripts_path_array)
int script_browse(const char *script_opt)
int ui__popup_menu(int argc, char *const argv[])
static void script_browser__write(struct ui_browser *browser, void *entry, int row)
void static void * zalloc(size_t size)