diff options
author | Robert Richter <robert.richter@amd.com> | 2008-07-22 15:08:52 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-26 05:48:03 -0400 |
commit | 5e11f98dcebc40c9d67e8d21a5f47248444c17a8 (patch) | |
tree | 7f333ec131d340ac8938d12cd1fc932022ef9808 /drivers/oprofile/buffer_sync.c | |
parent | 73185e0a5d11d729d451692034fbe55a9eba7468 (diff) |
OProfile: moving increment_tail() in buffer_sync.c
Signed-off-by: Robert Richter <robert.richter@amd.com>
Cc: oprofile-list <oprofile-list@lists.sourceforge.net>
Cc: Barry Kasindorf <barry.kasindorf@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/oprofile/buffer_sync.c')
-rw-r--r-- | drivers/oprofile/buffer_sync.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c index 69a732778ba..615929f6f0c 100644 --- a/drivers/oprofile/buffer_sync.c +++ b/drivers/oprofile/buffer_sync.c | |||
@@ -268,6 +268,17 @@ lookup_dcookie(struct mm_struct *mm, unsigned long addr, off_t *offset) | |||
268 | return cookie; | 268 | return cookie; |
269 | } | 269 | } |
270 | 270 | ||
271 | static void increment_tail(struct oprofile_cpu_buffer *b) | ||
272 | { | ||
273 | unsigned long new_tail = b->tail_pos + 1; | ||
274 | |||
275 | rmb(); | ||
276 | |||
277 | if (new_tail < b->buffer_size) | ||
278 | b->tail_pos = new_tail; | ||
279 | else | ||
280 | b->tail_pos = 0; | ||
281 | } | ||
271 | 282 | ||
272 | static unsigned long last_cookie = INVALID_COOKIE; | 283 | static unsigned long last_cookie = INVALID_COOKIE; |
273 | 284 | ||
@@ -417,19 +428,6 @@ static unsigned long get_slots(struct oprofile_cpu_buffer *b) | |||
417 | } | 428 | } |
418 | 429 | ||
419 | 430 | ||
420 | static void increment_tail(struct oprofile_cpu_buffer *b) | ||
421 | { | ||
422 | unsigned long new_tail = b->tail_pos + 1; | ||
423 | |||
424 | rmb(); | ||
425 | |||
426 | if (new_tail < b->buffer_size) | ||
427 | b->tail_pos = new_tail; | ||
428 | else | ||
429 | b->tail_pos = 0; | ||
430 | } | ||
431 | |||
432 | |||
433 | /* Move tasks along towards death. Any tasks on dead_tasks | 431 | /* Move tasks along towards death. Any tasks on dead_tasks |
434 | * will definitely have no remaining references in any | 432 | * will definitely have no remaining references in any |
435 | * CPU buffers at this point, because we use two lists, | 433 | * CPU buffers at this point, because we use two lists, |