#!/bin/sh NCPU=`ls /dev/cpu*msr | wc -l` echo found $NCPU cpus for i in `jot $NCPU 0`; do BFROMIP=`msr -r $i 0x01db` BTOIP=`msr -r $i 0x01dc` EFROMIP=`msr -r $i 0x01dd` ETOIP=`msr -r $i 0x01de` CTL=`msr -r $i 0x01d9` echo cpu: $i Ctl: $CTL LastBranchFromIP: $BFROMIP LastBranchToIP: $BTOIP LastExceptionFromIP: $EFROMIP LastExceptionToIP: $ETOIP msr -w $i 0x01d9 1 done