Hi,
recently I encountered a kernel crash, while running `./run_tests.sh` (see dmesg.txt attached).
I believe the reason of this crash is that my kernel is configured such that CONFIG_NR_CPUS is greater than nr_cpus_ids.
This causes that "cpu" index computed in trace_buffer_read may be also greater than nr_cpus_ids, and that may lead to read
from some trashy memory address in ring_buffer_peek function.
I managed to workaround the issue (see trace_buffer.patch attached), but I'm not sure if this is a correct solution.
I saw "for_each_possible_cpu" usage in "trace_buffer_clear_internal" function, so should I use this one over "for_each_online_cpu"?
Also maybe "last_messages" array can be allocated dynamically? If CONFIG_NR_CPUS is greater than nr_cpus_ids,
some of the memory will be wasted.
Let me know if should I change anything, so I can submit a pull request if you wish.
Thanks.