Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\ring_buffer_benchmark.c Create Date:2022-07-28 11:56:29
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ring_buffer_benchmark_init

Proto:static int __init ring_buffer_benchmark_init(void)

Type:int

Parameter:Nothing

435  buffer = Because the ring buffer is generic, if other users of the ring buffer get* traced by ftrace, it can produce lockdep warnings. We need to keep each* ring buffer's lock class separate.(1000000, RB_FL_OVERWRITE)
436  If Not buffer Then Return -ENOMEM
439  If Not disable_reader Then
440  consumer = Create kernel thread(ring_buffer_consumer_thread, NULL, "rb_consumer")
442  ret = PTR_ERR(consumer)
443  If IS_ERR(consumer) Then Go to out_fail
447  producer = kthread_run - create and wake a thread.*@threadfn: the function to run until signal_pending(current).*@data: data ptr for @threadfn.*@namefmt: printf-style name for the thread.* Description: Convenient wrapper for kthread_create() followed by(ring_buffer_producer_thread, NULL, "rb_producer")
449  ret = PTR_ERR(producer)
451  If IS_ERR(producer) Then Go to out_kill
457  If Not disable_reader Then
458  If consumer_fifo >= 0 Then
463  Else set_user_nice(consumer, consumer_nice)
467  If producer_fifo >= 0 Then
468  struct sched_param param = {sched_priority = producer_fifo}
471  sched_setscheduler - change the scheduling policy and/or RT priority of a thread.*@p: the task in question.*@policy: new policy.*@param: structure containing the new RT priority.* Return: 0 on success. An error code otherwise.
472  Else set_user_nice(producer, producer_nice)
475  Return 0
477  out_kill :
478  If consumer Then stop a thread
481  out_fail :
482  g_buffer_free - free a ring buffer.*@buffer: the buffer to free.
483  Return ret