函数逻辑报告 |
Source Code:kernel\trace\ring_buffer_benchmark.c |
Create Date:2022-07-27 13:02:02 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:ring_buffer_producer
函数原型:static void ring_buffer_producer(void)
返回类型:void
参数:无
236 | missed等于0 |
237 | hit等于0 |
239 | cnt等于0 |
245 | trace_printk("Starting ring buffer hammer\n") |
246 | start_time等于ktime_get() |
247 | timeout等于Add a ktime_t variable and a scalar nanosecond value.* res = kt + nsval:(start_time, un time and sleep time in seconds * NSEC_PER_SEC) |
248 | 循环 |
253 | 以i小于write_iteration循环 |
255 | 如果非event则 |
256 | missed自加 |
257 | 否则 |
266 | cnt自加 |
283 | 当时间比较且非break_test()循环 |
284 | trace_printk("End ring buffer hammer\n") |
286 | 如果consumer则 |
288 | init_completion( & read_start) |
289 | init_completion( & read_done) |
291 | smp_wmb() |
292 | reader_finish等于1 |
293 | 唤醒中断线程 |
297 | time等于ktime_us_delta(end_time, start_time) |
299 | entries等于g_buffer_entries - get the number of entries in a buffer*@buffer: The ring buffer* Returns the total number of entries in the ring buffer* (all CPU entries) |
300 | overruns等于g_buffer_overruns - get the number of overruns in buffer*@buffer: The ring buffer* Returns the total number of overruns in the ring buffer* (all CPU entries) |
302 | 如果test_error则trace_printk("ERROR!\n") |
305 | 如果非disable_reader则 |
306 | 如果consumer_fifo小于0则trace_printk("Running Consumer at nice: %d\n", consumer_nice) |
309 | 否则trace_printk("Running Consumer at SCHED_FIFO %d\n", consumer_fifo) |
313 | 如果producer_fifo小于0则trace_printk("Running Producer at nice: %d\n", producer_nice) |
316 | 否则trace_printk("Running Producer at SCHED_FIFO %d\n", producer_fifo) |
321 | 如果producer_fifo小于0且consumer_fifo小于0且producer_nice恒等于MAX_NICE且consumer_nice恒等于MAX_NICE则trace_printk("WARNING!!! This test is running at lowest priority.\n") |
325 | trace_printk("Time: %lld (usecs)\n", time) |
326 | trace_printk("Overruns: %lld\n", overruns) |
327 | 如果disable_reader则trace_printk("Read: (reader disabled)\n") |
329 | 否则trace_printk("Read: %ld (by %s)\n", read, read_events ? "events" : "pages") |
332 | trace_printk("Entries: %lld\n", entries) |
333 | trace_printk("Total: %lld\n", entries + overruns + read) |
334 | trace_printk("Missed: %ld\n", missed) |
335 | trace_printk("Hit: %ld\n", hit) |
341 | 否则trace_printk("TIME IS ZERO??\n") |
344 | trace_printk("Entries per millisec: %ld\n", hit) |
346 | 如果hit则 |
348 | avg等于NSEC_PER_MSEC除hit |
349 | trace_printk("%ld ns per entry\n", avg) |
352 | 如果missed则 |
356 | trace_printk("Total iterations per millisec: %ld\n", hit + missed) |
361 | trace_printk("hit + missed overflowed and totalled zero!\n") |
362 | hit自减 |
366 | avg等于NSEC_PER_MSEC除hit加missed的和 |
367 | trace_printk("%ld ns per entry\n", avg) |
名称 | 描述 |
---|---|
ring_buffer_producer_thread |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |