mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-10 07:00:53 +00:00
Initialize retval.
Fri Jan 13 22:59:48 2006 Soeren Sandmann <sandmann@redhat.com> * module/sysprof-module.c (sysprof_open): Initialize retval. * module/sysprof-module.c (sysprof_read): Copy contents of trace, not tail to the buffer.
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
c65bfcc114
commit
2d525523f8
@ -1,3 +1,10 @@
|
|||||||
|
Fri Jan 13 22:59:48 2006 Soeren Sandmann <sandmann@redhat.com>
|
||||||
|
|
||||||
|
* module/sysprof-module.c (sysprof_open): Initialize retval.
|
||||||
|
|
||||||
|
* module/sysprof-module.c (sysprof_read): Copy contents of trace,
|
||||||
|
not tail to the buffer.
|
||||||
|
|
||||||
Wed Jan 11 20:31:11 2006 Søren Sandmann <sandmann@redhat.com>
|
Wed Jan 11 20:31:11 2006 Søren Sandmann <sandmann@redhat.com>
|
||||||
|
|
||||||
* process.c (read_maps): Also make offset a gulong (Samuel Mimram)
|
* process.c (read_maps): Also make offset a gulong (Samuel Mimram)
|
||||||
|
|||||||
@ -114,7 +114,7 @@ on_read (gpointer data)
|
|||||||
|
|
||||||
if (rd == -1 && errno == EWOULDBLOCK)
|
if (rd == -1 && errno == EWOULDBLOCK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_get_current_time (&now);
|
g_get_current_time (&now);
|
||||||
|
|
||||||
/* After a reset we ignore samples for a short period so that
|
/* After a reset we ignore samples for a short period so that
|
||||||
|
|||||||
@ -175,8 +175,10 @@ sysprof_read(struct file *file, char *buffer, size_t count, loff_t *offset)
|
|||||||
trace = tail;
|
trace = tail;
|
||||||
if (tail++ == &stack_traces[N_TRACES - 1])
|
if (tail++ == &stack_traces[N_TRACES - 1])
|
||||||
tail = &stack_traces[0];
|
tail = &stack_traces[0];
|
||||||
|
|
||||||
|
BUG_ON(trace->pid == 0);
|
||||||
|
|
||||||
if (copy_to_user(buffer, tail, sizeof *tail))
|
if (copy_to_user(buffer, trace, sizeof *trace))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
file->private_data = tail;
|
file->private_data = tail;
|
||||||
@ -203,7 +205,7 @@ sysprof_poll(struct file *file, poll_table *poll_table)
|
|||||||
static int
|
static int
|
||||||
sysprof_open(struct inode *inode, struct file *file)
|
sysprof_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval = 0;
|
||||||
|
|
||||||
if (atomic_inc_return(&client_count) == 1)
|
if (atomic_inc_return(&client_count) == 1)
|
||||||
retval = register_timer_hook (timer_notify);
|
retval = register_timer_hook (timer_notify);
|
||||||
|
|||||||
Reference in New Issue
Block a user