Lines Matching refs:self

67     def walk(self, blkcg, q_id, parent_path):
68 if not self.include_dying and \
79 self.blkgs.append((path if path else '/', blkg))
83 self.walk(c, q_id, path)
85 def __init__(self, root_blkcg, q_id, include_dying=False):
86 self.include_dying = include_dying
87 self.blkgs = []
88 self.walk(root_blkcg, q_id, '')
90 def __iter__(self):
91 return iter(self.blkgs)
94 def __init__(self, ioc):
97 self.enabled = ioc.enabled.value_()
98 self.running = ioc.running.value_() == IOC_RUNNING
99 self.period_ms = ioc.period_us.value_() / 1_000
100 self.period_at = ioc.period_at.value_() / 1_000_000
101 self.vperiod_at = ioc.period_at_vtime.value_() / VTIME_PER_SEC
102 self.vrate_pct = ioc.vtime_base_rate.value_() * 100 / VTIME_PER_USEC
103 self.busy_level = ioc.busy_level.value_()
104 self.autop_idx = ioc.autop_idx.value_()
105 self.user_cost_model = ioc.user_cost_model.value_()
106 self.user_qos_params = ioc.user_qos_params.value_()
108 if self.autop_idx in autop_names:
109 self.autop_name = autop_names[self.autop_idx]
111 self.autop_name = '?'
113 def dict(self, now):
116 'enabled' : self.enabled,
117 'running' : self.running,
118 'period_ms' : self.period_ms,
119 'period_at' : self.period_at,
120 'period_vtime_at' : self.vperiod_at,
121 'busy_level' : self.busy_level,
122 'vrate_pct' : self.vrate_pct, }
124 def table_preamble_str(self):
125 state = ('RUN' if self.running else 'IDLE') if self.enabled else 'OFF'
127 f'per={self.period_ms}ms ' \
128 f'cur_per={self.period_at:.3f}:v{self.vperiod_at:.3f} ' \
129 f'busy={self.busy_level:+3} ' \
130 f'vrate={self.vrate_pct:6.2f}% ' \
131 f'params={self.autop_name}'
132 if self.user_cost_model or self.user_qos_params:
133 output += f'({"C" if self.user_cost_model else ""}{"Q" if self.user_qos_params else ""})'
136 def table_header_str(self):
141 def __init__(self, iocg):
145 self.is_active = not list_empty(iocg.active_list.address_of_())
146 self.weight = iocg.weight.value_() / WEIGHT_ONE
147 self.active = iocg.active.value_() / WEIGHT_ONE
148 self.inuse = iocg.inuse.value_() / WEIGHT_ONE
149 self.hwa_pct = iocg.hweight_active.value_() * 100 / WEIGHT_ONE
150 self.hwi_pct = iocg.hweight_inuse.value_() * 100 / WEIGHT_ONE
151 self.address = iocg.value_()
158 self.inflight_pct = (vtime - vdone) * 100 / period_vtime
160 self.inflight_pct = 0
162 self.usage = (100 * iocg.usage_delta_us.value_() /
163 ioc.period_us.value_()) if self.active else 0
164 self.debt_ms = iocg.abs_vdebt.value_() / VTIME_PER_USEC / 1000
166 self.delay_ms = blkg.delay_nsec.counter.value_() / 1_000_000
168 self.delay_ms = 0
170 def dict(self, now, path):
173 'is_active' : self.is_active,
174 'weight' : self.weight,
175 'weight_active' : self.active,
176 'weight_inuse' : self.inuse,
177 'hweight_active_pct' : self.hwa_pct,
178 'hweight_inuse_pct' : self.hwi_pct,
179 'inflight_pct' : self.inflight_pct,
180 'debt_ms' : self.debt_ms,
181 'delay_ms' : self.delay_ms,
182 'usage_pct' : self.usage,
183 'address' : self.address }
186 def table_row_str(self, path):
188 f'{"*" if self.is_active else " "} ' \
189 f'{round(self.inuse):5}/{round(self.active):5} ' \
190 f'{self.hwi_pct:6.2f}/{self.hwa_pct:6.2f} ' \
191 f'{self.inflight_pct:6.2f} ' \
192 f'{self.debt_ms:7.2f} ' \
193 f'{self.delay_ms:7.2f} '\
194 f'{min(self.usage, 999):6.2f}'