Skip to content

Commit a5e5c27

Browse files
committed
Merge tag 'trace-v5.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing ring-buffer fix from Steven Rostedt: "The success return value of ring_buffer_resize() is stated to be zero and checked that way. But it was incorrectly returning the size allocated. Also, a fix to a comment" * tag 'trace-v5.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: ring-buffer: Update the description for ring_buffer_wait ring-buffer: Return 0 on success from ring_buffer_resize()
2 parents b76f733 + e1981f7 commit a5e5c27

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

kernel/trace/ring_buffer.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ static void rb_wake_up_waiters(struct irq_work *work)
793793
* ring_buffer_wait - wait for input to the ring buffer
794794
* @buffer: buffer to wait on
795795
* @cpu: the cpu buffer to wait on
796-
* @full: wait until a full page is available, if @cpu != RING_BUFFER_ALL_CPUS
796+
* @full: wait until the percentage of pages are available, if @cpu != RING_BUFFER_ALL_CPUS
797797
*
798798
* If @cpu == RING_BUFFER_ALL_CPUS then the task will wake up as soon
799799
* as data is added to any of the @buffer's cpu buffers. Otherwise
@@ -1952,18 +1952,18 @@ int ring_buffer_resize(struct trace_buffer *buffer, unsigned long size,
19521952
{
19531953
struct ring_buffer_per_cpu *cpu_buffer;
19541954
unsigned long nr_pages;
1955-
int cpu, err = 0;
1955+
int cpu, err;
19561956

19571957
/*
19581958
* Always succeed at resizing a non-existent buffer:
19591959
*/
19601960
if (!buffer)
1961-
return size;
1961+
return 0;
19621962

19631963
/* Make sure the requested buffer exists */
19641964
if (cpu_id != RING_BUFFER_ALL_CPUS &&
19651965
!cpumask_test_cpu(cpu_id, buffer->cpumask))
1966-
return size;
1966+
return 0;
19671967

19681968
nr_pages = DIV_ROUND_UP(size, BUF_PAGE_SIZE);
19691969

@@ -2119,7 +2119,7 @@ int ring_buffer_resize(struct trace_buffer *buffer, unsigned long size,
21192119
}
21202120

21212121
mutex_unlock(&buffer->mutex);
2122-
return size;
2122+
return 0;
21232123

21242124
out_err:
21252125
for_each_buffer_cpu(buffer, cpu) {

0 commit comments

Comments
 (0)