Lines Matching full:self

64     def __init__(self, root_blkcg, q_id, include_dying=False):  argument
65 self.include_dying = include_dying
66 self.blkgs = []
67 self.walk(root_blkcg, q_id, '')
72 def walk(self, blkcg, q_id, parent_path): argument
73 if not self.include_dying and \
84 self.blkgs.append((path if path else '/', blkg))
88 self.walk(c, q_id, path)
90 def __iter__(self): argument
91 return iter(self.blkgs)
94 def __init__(self, ioc): argument
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.ivrate_pct = ioc.vtime_rate.counter.value_() * 100 / VTIME_PER_USEC
104 self.busy_level = ioc.busy_level.value_()
105 self.autop_idx = ioc.autop_idx.value_()
106 self.user_cost_model = ioc.user_cost_model.value_()
107 self.user_qos_params = ioc.user_qos_params.value_()
109 if self.autop_idx in autop_names:
110 self.autop_name = autop_names[self.autop_idx]
112 self.autop_name = '?'
114 def dict(self, now): argument
117 'enabled' : self.enabled,
118 'running' : self.running,
119 'period_ms' : self.period_ms,
120 'period_at' : self.period_at,
121 'period_vtime_at' : self.vperiod_at,
122 'busy_level' : self.busy_level,
123 'vrate_pct' : self.vrate_pct,
124 'ivrate_pct' : self.ivrate_pct,
127 def table_preamble_str(self): argument
128 state = ('RUN' if self.running else 'IDLE') if self.enabled else 'OFF'
130 f'per={self.period_ms}ms ' \
131 f'cur_per={self.period_at:.3f}:v{self.vperiod_at:.3f} ' \
132 f'busy={self.busy_level:+3} ' \
133 f'vrate={self.vrate_pct:6.2f}%:{self.ivrate_pct:6.2f}% ' \
134 f'params={self.autop_name}'
135 if self.user_cost_model or self.user_qos_params:
136 … output += f'({"C" if self.user_cost_model else ""}{"Q" if self.user_qos_params else ""})'
139 def table_header_str(self): argument
144 def __init__(self, iocg): argument
148 self.is_active = not list_empty(iocg.active_list.address_of_())
149 self.weight = iocg.weight.value_() / WEIGHT_ONE
150 self.active = iocg.active.value_() / WEIGHT_ONE
151 self.inuse = iocg.inuse.value_() / WEIGHT_ONE
152 self.hwa_pct = iocg.hweight_active.value_() * 100 / WEIGHT_ONE
153 self.hwi_pct = iocg.hweight_inuse.value_() * 100 / WEIGHT_ONE
154 self.address = iocg.value_()
161 self.inflight_pct = (vtime - vdone) * 100 / period_vtime
163 self.inflight_pct = 0
165 self.usage = (100 * iocg.usage_delta_us.value_() /
166 ioc.period_us.value_()) if self.active else 0
167 self.wait_ms = (iocg.stat.wait_us.value_() -
169 self.debt_ms = iocg.abs_vdebt.value_() / VTIME_PER_USEC / 1000
171 self.delay_ms = blkg.delay_nsec.counter.value_() / 1_000_000
173 self.delay_ms = 0
175 def dict(self, now, path): argument
178 'is_active' : self.is_active,
179 'weight' : self.weight,
180 'weight_active' : self.active,
181 'weight_inuse' : self.inuse,
182 'hweight_active_pct' : self.hwa_pct,
183 'hweight_inuse_pct' : self.hwi_pct,
184 'inflight_pct' : self.inflight_pct,
185 'usage_pct' : self.usage,
186 'wait_ms' : self.wait_ms,
187 'debt_ms' : self.debt_ms,
188 'delay_ms' : self.delay_ms,
189 'address' : self.address }
192 def table_row_str(self, path): argument
194 f'{"*" if self.is_active else " "} ' \
195 f'{round(self.inuse):5}/{round(self.active):5} ' \
196 f'{self.hwi_pct:6.2f}/{self.hwa_pct:6.2f} ' \
197 f'{self.inflight_pct:6.2f} ' \
198 f'{min(self.usage, 999):6.2f} ' \
199 f'{self.wait_ms:7.2f} ' \
200 f'{self.debt_ms:7.2f} ' \
201 f'{self.delay_ms:7.2f}'