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:
Soren Sandmann
2007-11-17 02:53:22 +00:00
committed by Søren Sandmann Pedersen
parent d82fe2e474
commit c00ccd69c7
4 changed files with 46 additions and 13 deletions

View File

@ -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;