函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\ring_buffer.c Create Date:2022-07-27 12:58:30
Last Modify:2020-03-17 19:30:04 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:g_buffer_wait - wait for input to the ring buffer*@buffer: buffer to wait on*@cpu: the cpu buffer to wait on*@full: wait until a full page is available, if @cpu != RING_BUFFER_ALL_CPUS* If @cpu == RING_BUFFER_ALL_CPUS then the task will wake up as soon

函数原型:int ring_buffer_wait(struct ring_buffer *buffer, int cpu, int full)

返回类型:int

参数:

类型参数名称
struct ring_buffer *buffer
intcpu
intfull
578  cpu_buffer等于cpu_buffer
579  DEFINE_WAIT(wait)
581  ret等于0
588  如果cpu恒等于RING_BUFFER_ALL_CPUS
589  work等于irq_work
591  full等于0
592  否则
593  如果非测试CPU信息则返回:负ENODEV
595  cpu_buffer等于buffers[cpu]
596  work等于irq_work
600  当(true)循环
601  如果fullNote: we use "set_current_state()" _after_ the wait-queue add,* because we need a memory barrier there on SMP, so that any* wake-function that tests for the wait-queue being active* will be guaranteed to see waitqueue addition _or_ subsequent
603  否则Note: we use "set_current_state()" _after_ the wait-queue add,* because we need a memory barrier there on SMP, so that any* wake-function that tests for the wait-queue being active* will be guaranteed to see waitqueue addition _or_ subsequent
626  如果fullfull_waiters_pending = true
628  否则waiters_pending = true
631  如果signal_pending(当前进程)则
632  ret等于负EINTR
633  退出
636  如果cpu恒等于RING_BUFFER_ALL_CPUS且非d_buffer_empty - is the ring buffer empty?*@buffer: The ring buffer to test退出
646  如果非full退出
651  nr_pages等于nr_pages
653  如果非shortest_fullshortest_full小于fullshortest_full等于full
657  如果非pagebusy且非nr_pagesdirty乘100大于fullnr_pages的值则退出
662  进程调度
665  如果fullsh_wait - clean up after waiting in a queue*@wq_head: waitqueue waited on*@wq_entry: wait descriptor* Sets current thread back to running state and removes* the wait descriptor from the given waitqueue if still* queued.
667  否则sh_wait - clean up after waiting in a queue*@wq_head: waitqueue waited on*@wq_entry: wait descriptor* Sets current thread back to running state and removes* the wait descriptor from the given waitqueue if still* queued.
670  返回:ret
调用者
名称描述
wait_on_pipe