Lines Matching refs:metric
8 import metric
126 def add(self, s: str, metric: bool) -> None:
132 if metric:
350 self.metric_expr = metric.ParsePerfJson(jd['MetricExpr']).Simplify()
413 def build_c_string(self, metric: bool) -> str:
415 for attr in _json_metric_attributes if metric else _json_event_attributes:
417 if metric and x and attr == 'metric_expr':
421 if metric and x and attr == 'metric_threshold':
429 def to_c_string(self, metric: bool) -> str:
432 s = self.build_c_string(metric)
444 metrics: list[Tuple[str, str, metric.Expression]] = []
449 updates = metric.RewriteMetricsInTermsOfOthers(metrics)
521 _args.output_file.write(event.to_c_string(metric=False))
566 for metric in sorted(_pending_metrics, key=metric_cmp_key):
567 if metric.pmu != last_pmu:
570 pmu_name = metric.pmu.replace(',', '_')
574 last_pmu = metric.pmu
575 pmus.add((metric.pmu, pmu_name))
577 _args.output_file.write(metric.to_c_string(metric=True))
621 _bcs.add(mgroup, metric=True)
622 _bcs.add(description, metric=True)
630 _bcs.add(pmu_name, metric=False)
631 _bcs.add(event.build_c_string(metric=False), metric=False)
633 _bcs.add(pmu_name, metric=True)
634 _bcs.add(event.build_c_string(metric=True), metric=True)