#include <linux/ring_buffer.h>
#include <linux/completion.h>
#include <linux/kthread.h>
#include <uapi/linux/sched/types.h>
#include <linux/module.h>
#include <linux/ktime.h>
#include <asm/local.h>
struct rb_page { … };
#define RUN_TIME …
#define SLEEP_TIME …
static int wakeup_interval = …;
static int reader_finish;
static DECLARE_COMPLETION(read_start);
static DECLARE_COMPLETION(read_done);
static struct trace_buffer *buffer;
static struct task_struct *producer;
static struct task_struct *consumer;
static unsigned long read;
static unsigned int disable_reader;
module_param(disable_reader, uint, 0644);
MODULE_PARM_DESC(…) …;
static unsigned int write_iteration = …;
module_param(write_iteration, uint, 0644);
MODULE_PARM_DESC(…) …;
static int producer_nice = …;
static int consumer_nice = …;
static int producer_fifo;
static int consumer_fifo;
module_param(producer_nice, int, 0644);
MODULE_PARM_DESC(…) …;
module_param(consumer_nice, int, 0644);
MODULE_PARM_DESC(…) …;
module_param(producer_fifo, int, 0644);
MODULE_PARM_DESC(…) …;
module_param(consumer_fifo, int, 0644);
MODULE_PARM_DESC(…) …;
static int read_events;
static int test_error;
#define TEST_ERROR() …
enum event_status { … };
static bool break_test(void)
{ … }
static enum event_status read_event(int cpu)
{ … }
static enum event_status read_page(int cpu)
{ … }
static void ring_buffer_consumer(void)
{ … }
static void ring_buffer_producer(void)
{ … }
static void wait_to_die(void)
{ … }
static int ring_buffer_consumer_thread(void *arg)
{ … }
static int ring_buffer_producer_thread(void *arg)
{ … }
static int __init ring_buffer_benchmark_init(void)
{ … }
static void __exit ring_buffer_benchmark_exit(void)
{ … }
module_init(…) …;
module_exit(ring_buffer_benchmark_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;