/*
- * Copyright (C) 2011 Julien Desfossez
+ * Copyright (C) 2011-2012 Julien Desfossez
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2 as
int max_elements = 80;
-int toggle_threads = -1;
+int toggle_threads = 1;
int toggle_pause = -1;
int max_center_lines;
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);
{
struct processtop *n1 = *(struct processtop **)p1;
struct processtop *n2 = *(struct processtop **)p2;
- unsigned long totaln1 = n1->filewrite + n1->fileread;
- unsigned long totaln2 = n2->filewrite + n2->fileread;
+ unsigned long totaln1 = n1->totalfilewrite + n1->totalfileread;
+ unsigned long totaln2 = n2->totalfilewrite + n2->totalfileread;
if (totaln1 < totaln2)
return 1;
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));
/* 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);
char unit[4];
char filename_buf[COLS];
int line = 1;
+ int column;
GPtrArray *newfilearray = g_ptr_array_new();
GHashTableIter iter;
struct perfcounter *perfn1, *perfn2;
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);
/*
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);
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));
int current_line = 0;
int total = 0;
char unit[4];
+ int column;
set_window_title(center, "IO Top");
wattron(center, A_BOLD);
mvwprintw(center, 1, 1, "PID");
mvwprintw(center, 1, 11, "TID");
mvwprintw(center, 1, 22, "NAME");
- mvwprintw(center, 1, 40, "R (B/sec)");
- mvwprintw(center, 1, 52, "W (B/sec)");
- mvwprintw(center, 1, 64, "Total");
+ column = 40;
+ for (i = 0; i < 3; i++) {
+ if (iostreamtopview[i].sort)
+ wattron(center, A_UNDERLINE);
+ mvwprintw(center, 1, column, iostreamtopview[i].title);
+ wattroff(center, A_UNDERLINE);
+ column += 12;
+ }
wattroff(center, A_BOLD);
+ wattroff(center, A_UNDERLINE);
if (iostreamtopview[0].sort == 1)
g_ptr_array_sort(data->process_table, sort_by_process_read_desc);
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));
{
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)");