函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-cgroup.c Create Date:2022-07-27 19:15:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:blkcg_print_stat

函数原型:static int blkcg_print_stat(struct seq_file *sf, void *v)

返回类型:int

参数:

类型参数名称
struct seq_file *sf
void *v
744  blkcg等于css_to_blkcg(seq_css(sf))
747  group_rstat_flush - flush stats in @cgrp's subtree*@cgrp: target cgroup* Collect all per-cpu stats in @cgrp's subtree into the global counters* and propagate them upwards
748  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
751  bis等于iostat
755  size等于获取任意数据的缓冲区, off等于0
757  bool has_stats = false
760  spin_lock_irq( & queue_lock)
762  如果非 is this blkg online? protected by both blkcg and q locks 则转到:skip
765  dname等于blkg_dev_name(blkg)
766  如果非dname则转到:skip
775  off加等于格式化输出字符串
777  循环
778  seq等于u64_stats_fetch_begin( & sync)
780  rbytes等于bytes[BLKG_IOSTAT_READ]
781  wbytes等于bytes[BLKG_IOSTAT_WRITE]
782  dbytes等于bytes[BLKG_IOSTAT_DISCARD]
783  rios等于ios[BLKG_IOSTAT_READ]
784  wios等于ios[BLKG_IOSTAT_WRITE]
785  dios等于ios[BLKG_IOSTAT_DISCARD]
786 u64_stats_fetch_retry( & sync, seq)循环
788  如果rbyteswbytesrioswios
789  has_stats = true
790  off加等于格式化输出字符串
796  如果blkcg_debug_statsatomic_read( & use_delay)则
797  has_stats = true
798  off加等于格式化输出字符串
804 i小于Maximum number of blkcg policies allowed to be registered concurrently.* Defined here to simplify include dependency.循环
805  pol等于blkcg_policy[i]
808  如果非pd[i]或非pd_stat_fn则继续下一循环
811  written等于pd_stat_fn(pd[i], buf + off, size - off)
812  如果writtenhas_stats = true
814  off加等于written
817  如果has_stats
818  如果off小于size减1则
821  否则
825  :
826  spin_unlock_irq( & queue_lock)
829  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
830  返回:0