Skip to content

Commit

Permalink
toplev: Avoid measuring frequency in SMT mode with level 1
Browse files Browse the repository at this point in the history
as we would need more counters than available, due to the extra cycles
count. Add a new --frequency argument to override.

Thanks to Ahmad for the report.
  • Loading branch information
Andi Kleen committed Feb 3, 2015
1 parent 6db7d07 commit 136d685
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions toplev.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def event_group(evlist):
p.add_argument('--cpu', '-C', help=argparse.SUPPRESS)
p.add_argument('--tsx', help="Measure TSX metrics", action='store_true')
p.add_argument('--all', help="Measure everything available", action='store_true')
p.add_argument('--frequency', help="Measure frequency", action='store_true')
p.add_argument('--no-group', help='Dont use groups', action='store_true')
p.add_argument('--no-multiplex',
help='Do not multiplex, but run the workload multiple times as needed. Requires reproducible workloads.',
Expand All @@ -192,6 +193,7 @@ def event_group(evlist):
args.power = True
args.sw = True
args.metrics = True
args.frequency = True
args.level = 5

if args.graph:
Expand Down Expand Up @@ -1016,11 +1018,12 @@ def setup_with_metrics(p, runner):
import tsx_metrics
setup_with_metrics(tsx_metrics, runner)

import frequency
old_metrics = args.metrics
args.metrics = True
frequency.SetupCPU(runner, cpu)
args.metrics = old_metrics
if (args.level > 2 or not need_any) or args.frequency:
import frequency
old_metrics = args.metrics
args.metrics = True
frequency.SetupCPU(runner, cpu)
args.metrics = old_metrics

if need_any:
print "Running in HyperThreading mode. Will measure complete system."
Expand Down

0 comments on commit 136d685

Please sign in to comment.