Lines Matching defs:metric

8 import metric
20 # List of regular metric tables.
22 # List of metric tables generated from "/sys" directories.
24 # Mapping between sys event table names and sys metric table names.
40 # Map from the name of a metric group to a description of the group.
126 def add(self, s: str, metric: bool) -> None:
132 if metric:
349 self.metric_expr = metric.ParsePerfJson(jd['MetricExpr']).Simplify()
350 # Note, the metric formula for the threshold isn't parsed as the &
412 def build_c_string(self, metric: bool) -> str:
414 for attr in _json_metric_attributes if metric else _json_event_attributes:
416 if metric and x and attr == 'metric_expr':
417 # Convert parsed metric expressions into a string. Slashes
420 if metric and x and attr == 'metric_threshold':
428 def to_c_string(self, metric: bool) -> str:
431 s = self.build_c_string(metric)
443 metrics: list[Tuple[str, str, metric.Expression]] = []
448 updates = metric.RewriteMetricsInTermsOfOthers(metrics)
517 _args.output_file.write(event.to_c_string(metric=False))
561 for metric in sorted(_pending_metrics, key=metric_cmp_key):
562 if metric.pmu != last_pmu:
565 pmu_name = metric.pmu.replace(',', '_')
569 last_pmu = metric.pmu
570 pmus.add((metric.pmu, pmu_name))
572 _args.output_file.write(metric.to_c_string(metric=True))
616 _bcs.add(mgroup, metric=True)
617 _bcs.add(description, metric=True)
625 _bcs.add(pmu_name, metric=False)
626 _bcs.add(event.build_c_string(metric=False), metric=False)
628 _bcs.add(pmu_name, metric=True)
629 _bcs.add(event.build_c_string(metric=True), metric=True)
675 /* Struct used to make the PMU metric table implementation opaque to callers. */