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: Update metric constraint support

Previous metric constraints were binary, either none or don't group
when the NMI watchdog is present. Update to match the definitions in
'enum metric_event_groups' in pmu-events.h.

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
e7b9e750 33c44bbc

+10 -4
+10 -4
tools/perf/pmu-events/metric.py
··· 4 4 import decimal 5 5 import json 6 6 import re 7 + from enum import Enum 7 8 from typing import Dict, List, Optional, Set, Tuple, Union 8 9 10 + class MetricConstraint(Enum): 11 + GROUPED_EVENTS = 0 12 + NO_GROUP_EVENTS = 1 13 + NO_GROUP_EVENTS_NMI = 2 14 + NO_GROUP_EVENTS_SMT = 3 9 15 10 16 class Expression: 11 17 """Abstract base class of elements in a metric expression.""" ··· 429 423 groups: Set[str] 430 424 expr: Expression 431 425 scale_unit: str 432 - constraint: bool 426 + constraint: MetricConstraint 433 427 434 428 def __init__(self, 435 429 name: str, 436 430 description: str, 437 431 expr: Expression, 438 432 scale_unit: str, 439 - constraint: bool = False): 433 + constraint: MetricConstraint = MetricConstraint.GROUPED_EVENTS): 440 434 self.name = name 441 435 self.description = description 442 436 self.expr = expr.Simplify() ··· 470 464 'MetricExpr': self.expr.ToPerfJson(), 471 465 'ScaleUnit': self.scale_unit 472 466 } 473 - if self.constraint: 474 - result['MetricConstraint'] = 'NO_NMI_WATCHDOG' 467 + if self.constraint != MetricConstraint.GROUPED_EVENTS: 468 + result['MetricConstraint'] = self.constraint.name 475 469 476 470 return result 477 471