X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcursesdisplay.c;h=577643064685eb64066e49d4146eeadf7d664530;hb=6153ec123e4ad29d2b44521e46d80aaf9a07ed69;hp=01dc543a402e85f3e5abafa85680499a07d4efe6;hpb=41f5890b4f45d14caf1134f0d4397fe2dd3251ea;p=lttngtop.git diff --git a/src/cursesdisplay.c b/src/cursesdisplay.c index 01dc543..5776430 100644 --- a/src/cursesdisplay.c +++ b/src/cursesdisplay.c @@ -57,7 +57,7 @@ char log_lines[MAX_LINE_LENGTH * MAX_LOG_LINES + MAX_LOG_LINES]; int max_elements = 80; -int toggle_threads = -1; +int toggle_threads = 1; int toggle_pause = -1; int max_center_lines; @@ -281,6 +281,7 @@ void update_footer() print_key(footer, "Space", "Highlight ", 0); print_key(footer, "q", "Quit ", 0); print_key(footer, "r", "Pref ", 0); + print_key(footer, "t", "Threads ", toggle_threads); print_key(footer, "p", "Pause ", toggle_pause); wrefresh(footer); @@ -568,6 +569,9 @@ void update_cputop_display() for (i = list_offset; i < data->process_table->len && nblinedisplayed < max_center_lines; i++) { tmp = g_ptr_array_index(data->process_table, i); + if (tmp->pid != tmp->tid) + if (toggle_threads == -1) + continue; if (process_selected(tmp)) { wattron(center, COLOR_PAIR(6)); @@ -581,9 +585,9 @@ void update_cputop_display() /* CPU(%) */ mvwprintw(center, current_line + header_offset, 1, "%1.2f", tmp->totalcpunsec / maxcputime); - /* TGID */ - mvwprintw(center, current_line + header_offset, 11, "%d", tmp->pid); /* PID */ + mvwprintw(center, current_line + header_offset, 11, "%d", tmp->pid); + /* TID */ mvwprintw(center, current_line + header_offset, 21, "%d", tmp->tid); /* NAME */ mvwprintw(center, current_line + header_offset, 31, "%s", tmp->comm); @@ -648,6 +652,7 @@ void update_process_details() char unit[4]; char filename_buf[COLS]; int line = 1; + int column; GPtrArray *newfilearray = g_ptr_array_new(); GHashTableIter iter; struct perfcounter *perfn1, *perfn2; @@ -695,10 +700,15 @@ void update_process_details() line++; wattron(center, A_BOLD); - mvwprintw(center, line, 1, "FD"); - mvwprintw(center, line, 10, "READ"); - mvwprintw(center, line, 17, "WRITE"); - mvwprintw(center, line++, 24, "FILENAME"); + column = 1; + for (i = 0; i < 3; i++) { + if (fileview[i].sort) + wattron(center, A_UNDERLINE); + mvwprintw(center, line, column, fileview[i].title); + wattroff(center, A_UNDERLINE); + column += 10; + } + mvwprintw(center, line++, column, "FILENAME"); wattroff(center, A_BOLD); /* @@ -728,11 +738,11 @@ void update_process_details() continue; mvwprintw(center, line + j, 1, "%d", file_tmp->fd); scale_unit(file_tmp->read, unit); - mvwprintw(center, line + j, 10, "%s", unit); + mvwprintw(center, line + j, 11, "%s", unit); scale_unit(file_tmp->write, unit); - mvwprintw(center, line + j, 17, "%s", unit); + mvwprintw(center, line + j, 21, "%s", unit); snprintf(filename_buf, COLS - 25, "%s", file_tmp->name); - mvwprintw(center, line + j, 24, "%s", filename_buf); + mvwprintw(center, line + j, 31, "%s", filename_buf); j++; } g_ptr_array_free(newfilearray, TRUE); @@ -779,6 +789,9 @@ void update_perf() for (i = 0; i < data->process_table->len && nblinedisplayed < max_center_lines; i++) { tmp = g_ptr_array_index(data->process_table, i); + if (tmp->pid != tmp->tid) + if (toggle_threads == -1) + continue; if (process_selected(tmp)) { wattron(center, COLOR_PAIR(6)); @@ -856,6 +869,9 @@ void update_iostream() for (i = list_offset; i < data->process_table->len && nblinedisplayed < max_center_lines; i++) { tmp = g_ptr_array_index(data->process_table, i); + if (tmp->pid != tmp->tid) + if (toggle_threads == -1) + continue; if (process_selected(tmp)) { wattron(center, COLOR_PAIR(6)); @@ -1403,8 +1419,8 @@ void init_view_headers() { cputopview[0].title = strdup("CPU(%)"); cputopview[0].sort = 1; - cputopview[1].title = strdup("TGID"); - cputopview[2].title = strdup("PID"); + cputopview[1].title = strdup("PID"); + cputopview[2].title = strdup("TID"); cputopview[3].title = strdup("NAME"); iostreamtopview[0].title = strdup("R (B/sec)");