函数逻辑报告 |
Source Code:kernel\trace\ring_buffer.c |
Create Date:2022-07-27 12:59:03 |
Last Modify:2020-03-17 19:30:04 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:__ring_buffer_alloc - allocate a new ring_buffer*@size: the size in bytes per cpu that is needed.*@flags: attributes to set for the ring buffer.* Currently the only flag that is available is the RB_FL_OVERWRITE* flag
函数原型:struct ring_buffer *__ring_buffer_alloc(unsigned long size, unsigned flags, struct lock_class_key *key)
返回类型:struct ring_buffer
参数:
类型 | 参数 | 名称 |
---|---|---|
unsigned long | size | |
unsigned | flags | |
struct lock_class_key * | key |
1389 | 如果非buffer则返回:NULL |
1392 | 如果非zalloc_cpumask_var( & cpumask, GFP_KERNEL)则转到:fail_free_buffer |
1395 | nr_pages等于DIV_ROUND_UP(size, BUF_PAGE_SIZE) |
1397 | clock等于race_clock_local(): the simplest and least coherent tracing clock.* Useful for tracing that does not cross to other CPUs nor* does it go through idle events. |
1398 | reader_lock_key等于key |
1400 | init_irq_work( & work, _wake_up_waiters - wake up tasks waiting for ring buffer input* Schedules a delayed work to wake up any task that is blocked on the* ring buffer waiters queue.) |
1401 | init_waitqueue_head( & waiters) |
1412 | 如果非buffers则转到:fail_free_cpumask |
1416 | 设置CPU信息 |
1418 | 如果非buffers[cpu]则转到:fail_free_buffers |
1422 | 如果ret小于0则转到:fail_free_buffers |
1425 | mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & mutex) |
1427 | 返回:buffer |
1429 | fail_free_buffers : |
1430 | for_each_buffer_cpu(buffer, cpu) |
1431 | 如果buffers[cpu]则rb_free_cpu_buffer(buffers[cpu]) |
1436 | fail_free_cpumask : |
1437 | 释放CPU掩码 |
1439 | fail_free_buffer : |
1441 | 返回:NULL |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |