Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147660
b: refs/heads/master
c: 0f5486b
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Jun 4, 2009
1 parent eb3dfb6 commit 3813d6d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 62fc44536c14b5787531bac7417580fca54c88b4
refs/heads/master: 0f5486b5c71a831a713ce356d8d06822e3c7c379
20 changes: 9 additions & 11 deletions trunk/Documentation/perf_counter/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static void print_sym_table(void)
list_remove_active_sym(syme);
}

write(1, CONSOLE_CLEAR, strlen(CONSOLE_CLEAR));
puts(CONSOLE_CLEAR);

printf(
"------------------------------------------------------------------------------\n");
Expand Down Expand Up @@ -278,23 +278,21 @@ static void print_sym_table(void)
color_fprintf(stdout, color, "%4.1f%%", pcnt);
printf(" - %016llx : %s\n", sym->start, sym->name);
}

{
struct pollfd stdin_poll = { .fd = 0, .events = POLLIN };

if (poll(&stdin_poll, 1, 0) == 1) {
printf("key pressed - exiting.\n");
exit(0);
}
}
}

static void *display_thread(void *arg)
{
struct pollfd stdin_poll = { .fd = 0, .events = POLLIN };
int delay_msecs = delay_secs * 1000;

printf("PerfTop refresh period: %d seconds\n", delay_secs);

while (!sleep(delay_secs))
do {
print_sym_table();
} while (!poll(&stdin_poll, 1, delay_msecs) == 1);

printf("key pressed - exiting.\n");
exit(0);

return NULL;
}
Expand Down

0 comments on commit 3813d6d

Please sign in to comment.