BASH   24

lastbranch

Guest on 24th January 2023 01:58:15 PM


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

Raw Paste


Login or Register to edit or fork this paste. It's free.

">