Lines Matching refs:self
67 def walk(self, blkcg, q_id, parent_path): argument
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): argument
86 self.include_dying = include_dying
87 self.blkgs = []
88 self.walk(root_blkcg, q_id, '')
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_rate.counter.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): argument
116 'enabled' : str(int(self.enabled)),
117 'running' : str(int(self.running)),
118 'period_ms' : str(self.period_ms),
119 'period_at' : str(self.period_at),
120 'period_vtime_at' : str(self.vperiod_at),
121 'busy_level' : str(self.busy_level),
122 'vrate_pct' : str(self.vrate_pct), }
124 def table_preamble_str(self): argument
125 state = ('RUN' if self.running else 'IDLE') if self.enabled else 'OFF'
132 if self.user_cost_model or self.user_qos_params:
136 def table_header_str(self): argument
141 def __init__(self, iocg): argument
145 self.is_active = not list_empty(iocg.active_list.address_of_())
146 self.weight = iocg.weight.value_()
147 self.active = iocg.active.value_()
148 self.inuse = iocg.inuse.value_()
149 self.hwa_pct = iocg.hweight_active.value_() * 100 / HWEIGHT_WHOLE
150 self.hwi_pct = iocg.hweight_inuse.value_() * 100 / HWEIGHT_WHOLE
151 self.address = iocg.value_()
158 self.inflight_pct = (vtime - vdone) * 100 / period_vtime
160 self.inflight_pct = 0
162 self.debt_ms = iocg.abs_vdebt.counter.value_() / VTIME_PER_USEC / 1000
163 self.use_delay = blkg.use_delay.counter.value_()
164 self.delay_ms = blkg.delay_nsec.counter.value_() / 1_000_000
167 self.usages = []
168 self.usage = 0
172 self.usages.append(upct)
173 self.usage = max(self.usage, upct)
175 def dict(self, now, path): argument
178 'is_active' : str(int(self.is_active)),
179 'weight' : str(self.weight),
180 'weight_active' : str(self.active),
181 'weight_inuse' : str(self.inuse),
182 'hweight_active_pct' : str(self.hwa_pct),
183 'hweight_inuse_pct' : str(self.hwi_pct),
184 'inflight_pct' : str(self.inflight_pct),
185 'debt_ms' : str(self.debt_ms),
186 'use_delay' : str(self.use_delay),
187 'delay_ms' : str(self.delay_ms),
188 'usage_pct' : str(self.usage),
189 'address' : str(hex(self.address)) }
190 for i in range(len(self.usages)):
191 out[f'usage_pct_{i}'] = str(self.usages[i])
194 def table_row_str(self, path): argument
203 for u in self.usages: