Merge branch 'ring-buffer/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git

This commit is contained in:
Stephen Rothwell 2024-12-20 09:42:14 +11:00
commit bf034d3155
2 changed files with 14 additions and 1 deletions

View File

@ -7019,7 +7019,11 @@ static int __rb_map_vma(struct ring_buffer_per_cpu *cpu_buffer,
lockdep_assert_held(&cpu_buffer->mapping_lock);
nr_subbufs = cpu_buffer->nr_pages + 1; /* + reader-subbuf */
nr_pages = ((nr_subbufs + 1) << subbuf_order) - pgoff; /* + meta-page */
nr_pages = ((nr_subbufs + 1) << subbuf_order); /* + meta-page */
if (nr_pages <= pgoff)
return -EINVAL;
nr_pages -= pgoff;
nr_vma_pages = vma_pages(vma);
if (!nr_vma_pages || nr_vma_pages > nr_pages)

View File

@ -4206,6 +4206,15 @@ static enum print_line_t print_trace_fmt(struct trace_iterator *iter)
if (event) {
if (tr->trace_flags & TRACE_ITER_FIELDS)
return print_event_fields(iter, event);
/*
* For TRACE_EVENT() events, the print_fmt is not
* safe to use if the array has delta offsets
* Force printing via the fields.
*/
if ((tr->text_delta || tr->data_delta) &&
event->type > __TRACE_LAST_TYPE)
return print_event_fields(iter, event);
return event->funcs->trace(iter, sym_flags, event);
}