Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf jevents: Add threshold expressions to Metric

Allow threshold expressions for metrics to be generated.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Thomas Falcon <thomas.falcon@intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Ian Rogers and committed by
Namhyung Kim
b90e94ae 7d5b4061

+6 -1
+6 -1
tools/perf/pmu-events/metric.py
··· 430 430 expr: Expression 431 431 scale_unit: str 432 432 constraint: MetricConstraint 433 + threshold: Optional[Expression] 433 434 434 435 def __init__(self, 435 436 name: str, 436 437 description: str, 437 438 expr: Expression, 438 439 scale_unit: str, 439 - constraint: MetricConstraint = MetricConstraint.GROUPED_EVENTS): 440 + constraint: MetricConstraint = MetricConstraint.GROUPED_EVENTS, 441 + threshold: Optional[Expression] = None): 440 442 self.name = name 441 443 self.description = description 442 444 self.expr = expr.Simplify() ··· 449 447 else: 450 448 self.scale_unit = f'1{scale_unit}' 451 449 self.constraint = constraint 450 + self.threshold = threshold 452 451 self.groups = set() 453 452 454 453 def __lt__(self, other): ··· 476 473 } 477 474 if self.constraint != MetricConstraint.GROUPED_EVENTS: 478 475 result['MetricConstraint'] = self.constraint.name 476 + if self.threshold: 477 + result['MetricThreshold'] = self.threshold.ToPerfJson() 479 478 480 479 return result 481 480