struct header_view cputopview[6];
struct header_view iostreamtopview[3];
struct header_view fileview[3];
+struct header_view kprobeview[2];
void reset_ncurses()
{
return -1;
}
+void update_kprobes_display()
+{
+ int i, column;
+ struct kprobes *probe;
+ int header_offset = 2;
+ int current_line = 0;
+
+ set_window_title(center, "Kprobes Top ");
+ wattron(center, A_BOLD);
+ column = 1;
+ for (i = 0; i < 2; i++) {
+ if (kprobeview[i].sort) {
+ wattron(center, A_UNDERLINE);
+ pref_current_sort = i;
+ }
+ mvwprintw(center, 1, column, "%s", kprobeview[i].title);
+ wattroff(center, A_UNDERLINE);
+ column += 30;
+ }
+ wattroff(center, A_BOLD);
+
+ for (i = 0; i < data->kprobes_table->len; i++) {
+ column = 1;
+ probe = g_ptr_array_index(data->kprobes_table, i);
+ mvwprintw(center, current_line + header_offset, column,
+ "%s", probe->probe_name + 6);
+ column += 30;
+ mvwprintw(center, current_line + header_offset, column,
+ "%d", probe->count);
+ current_line++;
+ }
+}
+
void update_cputop_display()
{
int i;
nblinedisplayed < max_center_lines; i++) {
tmp = g_ptr_array_index(data->process_table, i);
current_row_offset = 1;
+ if (!opt_tid && (opt_hostname && !lookup_hostname_list(tmp->hostname)))
+ continue;
+ if (!opt_hostname && (opt_tid && !lookup_tid_list(tmp->pid)))
+ continue;
+ if ((opt_tid && !lookup_tid_list(tmp->tid)) &&
+ (opt_hostname && !lookup_hostname_list(tmp->hostname)))
+ continue;
+
if (tmp->pid != tmp->tid)
if (toggle_threads == -1)
continue;
for (i = 0; i < data->process_table->len &&
nblinedisplayed < max_center_lines; i++) {
tmp = g_ptr_array_index(data->process_table, i);
+
+ if (!opt_tid && (opt_hostname && !lookup_hostname_list(tmp->hostname)))
+ continue;
+ if (!opt_hostname && (opt_tid && !lookup_tid_list(tmp->pid)))
+ continue;
+ if ((opt_tid && !lookup_tid_list(tmp->tid)) &&
+ (opt_hostname && !lookup_hostname_list(tmp->hostname)))
+ continue;
+
if (tmp->pid != tmp->tid)
if (toggle_threads == -1)
continue;
for (i = list_offset; i < data->process_table->len &&
nblinedisplayed < max_center_lines; i++) {
tmp = g_ptr_array_index(data->process_table, i);
+
+ if (!opt_tid && (opt_hostname && !lookup_hostname_list(tmp->hostname)))
+ continue;
+ if (!opt_hostname && (opt_tid && !lookup_tid_list(tmp->pid)))
+ continue;
+ if ((opt_tid && !lookup_tid_list(tmp->tid)) &&
+ (opt_hostname && !lookup_hostname_list(tmp->hostname)))
+ continue;
+
if (tmp->pid != tmp->tid)
if (toggle_threads == -1)
continue;
case tree:
update_cputop_display();
break;
+ case kprobes:
+ update_kprobes_display();
+ break;
default:
break;
}
selected_line = 0;
update_current_view();
break;
+ case KEY_F(5):
+ if (pref_panel_visible)
+ toggle_pref_panel();
+ current_view = kprobes;
+ selected_line = 0;
+ update_current_view();
+ break;
case KEY_F(10):
case 'q':
reset_ncurses();
fileview[1].title = strdup("READ");
fileview[1].sort = 1;
fileview[2].title = strdup("WRITE");
+
+ kprobeview[0].title = strdup("NAME");
+ kprobeview[1].title = strdup("HIT");
+ kprobeview[1].sort = 1;
}
void init_ncurses()