mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
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
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
d82fe2e474
commit
c00ccd69c7
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user