diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-11-09 17:08:28 -0500 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-11-09 17:08:28 -0500 |
| commit | 1081b867aec7a716f7a0c60ec5689487d12b4720 (patch) | |
| tree | 390bbcd3fae58916869630289270643b64e39231 | |
| parent | 5925a6033bef2cec578f5e4c6a0f774a9ff1ba4f (diff) | |
District10: enable the cycle counter on all processors
Do this by forcing a perf task on each CPU.
| -rwxr-xr-x | enable-cycle-counter.district10 | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/enable-cycle-counter.district10 b/enable-cycle-counter.district10 index b3f53df..11d1d7e 100755 --- a/enable-cycle-counter.district10 +++ b/enable-cycle-counter.district10 | |||
| @@ -6,11 +6,18 @@ die() { | |||
| 6 | } | 6 | } |
| 7 | 7 | ||
| 8 | # if perf is not given in environment, then check path | 8 | # if perf is not given in environment, then check path |
| 9 | [ -z "$PERF" ] && PERF=`which perf` | 9 | [ -z "$PERF" ] && PERF=`which perf 2> /dev/null` |
| 10 | # otherwise, assume default location | 10 | # otherwise, assume default location |
| 11 | [ -z "$PERF" ] && PERF=~/dev/litmus2010/tools/perf/perf | 11 | [ -z "$PERF" ] && PERF=~/dev/litmus2010/tools/perf/perf |
| 12 | 12 | ||
| 13 | [ -f "$PERF" ] && [ -x "$PERF" ] || die "Could not find perf tool." | 13 | [ -f "$PERF" ] && [ -x "$PERF" ] || die "Could not find perf tool." |
| 14 | 14 | ||
| 15 | # works for sparc64 and Intel x86 if all CPUs are online | ||
| 16 | NUM_CPUS=`egrep -c '^processor|online' /proc/cpuinfo` | ||
| 17 | |||
| 15 | # Keep cycle counter active for a loooong time. | 18 | # Keep cycle counter active for a loooong time. |
| 16 | "$PERF" record -o /dev/null sleep $((60 * 60 * 24 * 365)) > /dev/null & | 19 | |
| 20 | for x in `seq 0 $(($NUM_CPUS - 1))` | ||
| 21 | do | ||
| 22 | schedtool -a $x -e "$PERF" record -o /dev/null sleep $((60 * 60 * 24 * 365)) > /dev/null & | ||
| 23 | done | ||
