Skip to content

Commit

Permalink
toplev: Add FORCEHT for forcing SMT for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Andi Kleen committed Feb 3, 2015
1 parent d04e1a8 commit 09ecc02
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion toplev.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,13 @@ def force_counters(self):
if cnt:
self.counters = int(cnt)

def force_ht(self):
ht = os.getenv("FORCEHT")
if ht:
self.ht = int(ht)
return True
return False

def __init__(self):
self.model = 0
self.cpu = None
Expand All @@ -323,6 +330,7 @@ def __init__(self):
self.siblings = {}
self.threads = 0
forced_cpu = self.force_cpu()
forced_ht = self.force_ht()
self.force_counters()
cores = Counter()
sockets = Counter()
Expand Down Expand Up @@ -359,7 +367,7 @@ def __init__(self):
key = (physid, coreid,)
cores[key] += 1
self.threads = max(self.threads, cores[key])
if self.threads > 1:
if self.threads > 1 and not forced_ht:
self.ht = True
self.coreids[key].append(cpunum)
self.cputocore[cpunum] = key
Expand Down

0 comments on commit 09ecc02

Please sign in to comment.