File: skylake_msr_test.go

package info (click to toggle)
golang-github-hodgesds-perf-utils 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 308 kB
  • sloc: makefile: 3
file content (28 lines) | stat: -rw-r--r-- 537 bytes parent folder | download
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)
	}
}