diff options
author | Soren Sandmann <sandmann@daimi.au.dk> | 2007-11-17 02:53:22 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2007-11-17 02:53:22 +0000 |
commit | c00ccd69c7a3ef29208171e364d46254363ab383 (patch) | |
tree | 8f6aa73198609e2e1280227e17bf89ef4acbddd3 /module | |
parent | d82fe2e474afa2ccb6a9814f50eee9782d143b24 (diff) |
updates
2007-11-16 Soren Sandmann <sandmann@daimi.au.dk>
* TODO: updates
* module/sysprof-module.c (sysprof_poll): Only select readable
when there is at least eight traces available
* collector.c (collect_traces): New function, old on_read()
* collector.c (collector_create_profile): Collect traces here as
well.
svn path=/trunk/; revision=388
Diffstat (limited to 'module')
-rw-r--r-- | module/sysprof-module.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/module/sysprof-module.c b/module/sysprof-module.c index d2f5ab5..71e5e95 100644 --- a/module/sysprof-module.c +++ b/module/sysprof-module.c @@ -235,17 +235,28 @@ sysprof_read(struct file *file, char *buffer, size_t count, loff_t *offset) return 0; } +static int +n_traces_available (SysprofStackTrace *tail) +{ + SysprofStackTrace *head = &(area->traces[area->head]); + + if (head >= tail) + return head - tail; + else + return SYSPROF_N_TRACES - (tail - head); +} + static unsigned int sysprof_poll(struct file *file, poll_table *poll_table) { SysprofStackTrace *tail = file->private_data; - if (&(area->traces[area->head]) != tail) + if (n_traces_available (tail) >= 8) return POLLIN | POLLRDNORM; poll_wait(file, &wait_for_trace, poll_table); - if (&(area->traces[area->head]) != tail) + if (n_traces_available (tail) >= 8) return POLLIN | POLLRDNORM; return 0; |