• Home
  • Raw
  • Download

Lines Matching refs:period

94     def __init__(self, period=0, acc_period=0):  argument
95 self.period = period
99 self.period += other.period
109 self.period = Period()
111 def add_period(self, period): argument
112 self.period += period
120 self.period = Period()
126 def add_period(self, period): argument
127 self.period += period
129 def add_line_period(self, line, period): argument
133 a += period
135 def add_function_period(self, function_name, function_start_line, period): argument
141 a[1] += period
173 self.period = 0
257 period = Period(sample.period, sample.period)
260 period = Period(0, sample.period)
265 self._add_dso_period(symbol.dso_name, period, used_dso_dict)
270 self._add_file_period(source, period, used_file_dict)
273 self._add_line_period(source, period, used_line_dict)
278 self._add_file_period(source, period, used_file_dict)
280 self._add_function_period(source, period, used_function_dict)
283 self.period += sample.period
285 def _add_dso_period(self, dso_name: str, period: Period, used_dso_dict: Dict[str, bool]):
291 dso_period.add_period(period)
293 def _add_file_period(self, source, period, used_file_dict): argument
299 file_period.add_period(period)
301 def _add_line_period(self, source, period, used_line_dict): argument
305 file_period.add_line_period(source.line, period)
307 def _add_function_period(self, source, period, used_function_dict): argument
311 file_period.add_function_period(source.function, source.line, period)
316 f.write('total period: %d\n\n' % self.period)
321 key=lambda x: x.period.acc_period, reverse=True)
327 key=lambda x: x.period.acc_period, reverse=True)
332 total_str = self._get_period_str(dso_period.period.acc_period)
333 self_str = self._get_period_str(dso_period.period.period)
340 key=lambda x: x.period.acc_period, reverse=True)
345 total_str = self._get_period_str(file_period.period.acc_period)
346 self_str = self._get_period_str(file_period.period.period)
357 func_start_line, period = file_period.function_dict[func_name]
358 values.append((func_name, func_start_line, period))
360 for func_name, func_start_line, period in values:
361 total_str = self._get_period_str(period.acc_period)
362 self_str = self._get_period_str(period.period)
366 period = file_period.line_dict[line]
367 total_str = self._get_period_str(period.acc_period)
368 self_str = self._get_period_str(period.period)
375 def _get_period_str(self, period: Union[Period, int]) -> str:
376 if isinstance(period, Period):
378 self._get_period_str(period.acc_period),
379 self._get_period_str(period.period))
380 if self.config['raw_period'] or self.period == 0:
381 return str(period)
382 return '%.2f%%' % (100.0 * period / self.period)
421 func_start_line, period = file_period.function_dict[func_name]
425 annotates[line] = '[func] ' + self._get_period_str(period)
426 annotates[1] = '[file] ' + self._get_period_str(file_period.period)