Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146085
b: refs/heads/master
c: afbab76
h: refs/heads/master
i:
  146083: e7ab0ec
v: v3
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed May 5, 2009
1 parent 05512f4 commit dc300c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 778c55d44eb4f5f658915ed631d68ed9d1ac3ad1
refs/heads/master: afbab76a62b69ea6197e19727d4b8a8aef8deb25
28 changes: 3 additions & 25 deletions trunk/kernel/trace/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2785,28 +2785,6 @@ int ring_buffer_swap_cpu(struct ring_buffer *buffer_a,
}
EXPORT_SYMBOL_GPL(ring_buffer_swap_cpu);

static void rb_remove_entries(struct ring_buffer_per_cpu *cpu_buffer,
struct buffer_data_page *bpage,
unsigned int offset)
{
struct ring_buffer_event *event;
unsigned long head;

__raw_spin_lock(&cpu_buffer->lock);
for (head = offset; head < local_read(&bpage->commit);
head += rb_event_length(event)) {

event = __rb_data_page_index(bpage, head);
if (RB_WARN_ON(cpu_buffer, rb_null_event(event)))
return;
/* Only count data entries */
if (event->type_len > RINGBUF_TYPE_DATA_TYPE_LEN_MAX)
continue;
cpu_buffer->read++;
}
__raw_spin_unlock(&cpu_buffer->lock);
}

/**
* ring_buffer_alloc_read_page - allocate a page to read from buffer
* @buffer: the buffer to allocate for.
Expand Down Expand Up @@ -2977,6 +2955,9 @@ int ring_buffer_read_page(struct ring_buffer *buffer,
/* we copied everything to the beginning */
read = 0;
} else {
/* update the entry counter */
cpu_buffer->read += local_read(&reader->entries);

/* swap the pages */
rb_init_page(bpage);
bpage = reader->page;
Expand All @@ -2985,9 +2966,6 @@ int ring_buffer_read_page(struct ring_buffer *buffer,
local_set(&reader->entries, 0);
reader->read = 0;
*data_page = bpage;

/* update the entry counter */
rb_remove_entries(cpu_buffer, bpage, read);
}
ret = read;

Expand Down

0 comments on commit dc300c1

Please sign in to comment.