1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
package skylake
import (
"testing"
"github.com/hodgesds/perf-utils"
"golang.org/x/sys/unix"
)
func TestSkylake(t *testing.T) {
eventAttr := &unix.PerfEventAttr{
Type: unix.PERF_TYPE_RAW,
Config: 0x1B0,
Size: perf.EventAttrSize,
Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv,
Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED,
}
_, err := unix.PerfEventOpen(
eventAttr,
unix.Gettid(),
-1,
-1,
0,
)
if err != nil {
t.Fatal(err)
}
}
|