- command = (
- u"perf stat"
- f" --cpu {cpu} --no-aggr"
- f" --event '{{{Constants.PERF_STAT_EVENTS}}}'"
- f" --interval-print 1000 "
- f" -- sleep {int(duration)}"
- )
+ if Constants.PERF_STAT_EVENTS:
+ command = (
+ u"perf stat"
+ f" --cpu {cpu} --no-aggr"
+ f" --event '{{{Constants.PERF_STAT_EVENTS}}}'"
+ f" --interval-print 1000 "
+ f" -- sleep {int(duration)}"
+ )
+ else:
+ command = (
+ u"perf stat"
+ f" --cpu {cpu} --no-aggr"
+ f" --interval-print 1000 "
+ f" -- sleep {int(duration)}"
+ )