diff options
author | Robert Richter <robert.richter@amd.com> | 2008-12-22 19:35:12 -0500 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2008-12-29 11:24:36 -0500 |
commit | 300157768f050dabc73a99d958b504282088a132 (patch) | |
tree | 22c688835c713d33f80b99e1d1017482af700437 /drivers/oprofile/cpu_buffer.c | |
parent | 83bd9243956f30d91851b272988a237999b35b10 (diff) |
oprofile: reordering some code in cpu_buffer.c
Reordering code to keep alloc/free functions together.
Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'drivers/oprofile/cpu_buffer.c')
-rw-r--r-- | drivers/oprofile/cpu_buffer.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c index cd67d4dd30b7..b353b19bd786 100644 --- a/drivers/oprofile/cpu_buffer.c +++ b/drivers/oprofile/cpu_buffer.c | |||
@@ -54,16 +54,6 @@ static void wq_sync_buffer(struct work_struct *work); | |||
54 | #define DEFAULT_TIMER_EXPIRE (HZ / 10) | 54 | #define DEFAULT_TIMER_EXPIRE (HZ / 10) |
55 | static int work_enabled; | 55 | static int work_enabled; |
56 | 56 | ||
57 | void free_cpu_buffers(void) | ||
58 | { | ||
59 | if (op_ring_buffer_read) | ||
60 | ring_buffer_free(op_ring_buffer_read); | ||
61 | op_ring_buffer_read = NULL; | ||
62 | if (op_ring_buffer_write) | ||
63 | ring_buffer_free(op_ring_buffer_write); | ||
64 | op_ring_buffer_write = NULL; | ||
65 | } | ||
66 | |||
67 | unsigned long oprofile_get_cpu_buffer_size(void) | 57 | unsigned long oprofile_get_cpu_buffer_size(void) |
68 | { | 58 | { |
69 | return oprofile_cpu_buffer_size; | 59 | return oprofile_cpu_buffer_size; |
@@ -77,6 +67,16 @@ void oprofile_cpu_buffer_inc_smpl_lost(void) | |||
77 | cpu_buf->sample_lost_overflow++; | 67 | cpu_buf->sample_lost_overflow++; |
78 | } | 68 | } |
79 | 69 | ||
70 | void free_cpu_buffers(void) | ||
71 | { | ||
72 | if (op_ring_buffer_read) | ||
73 | ring_buffer_free(op_ring_buffer_read); | ||
74 | op_ring_buffer_read = NULL; | ||
75 | if (op_ring_buffer_write) | ||
76 | ring_buffer_free(op_ring_buffer_write); | ||
77 | op_ring_buffer_write = NULL; | ||
78 | } | ||
79 | |||
80 | int alloc_cpu_buffers(void) | 80 | int alloc_cpu_buffers(void) |
81 | { | 81 | { |
82 | int i; | 82 | int i; |