diff --git a/perf/collector_libpfm.go b/perf/collector_libpfm.go index 09d271eb02..d915469687 100644 --- a/perf/collector_libpfm.go +++ b/perf/collector_libpfm.go @@ -345,7 +345,7 @@ func createPerfEventAttr(event CustomEvent) *unix.PerfEventAttr { func setAttributes(config *unix.PerfEventAttr, leader bool) { config.Sample_type = unix.PERF_SAMPLE_IDENTIFIER config.Read_format = unix.PERF_FORMAT_TOTAL_TIME_ENABLED | unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_GROUP | unix.PERF_FORMAT_ID - config.Bits = unix.PerfBitInherit | unix.PerfBitExcludeGuest + config.Bits = unix.PerfBitInherit // Group leader should have this flag set to disable counting until all group would be prepared. if leader { diff --git a/perf/collector_libpfm_test.go b/perf/collector_libpfm_test.go index 4f43f0d682..4bd96880c7 100644 --- a/perf/collector_libpfm_test.go +++ b/perf/collector_libpfm_test.go @@ -172,13 +172,13 @@ func TestSetGroupAttributes(t *testing.T) { setAttributes(attributes, true) assert.Equal(t, uint64(65536), attributes.Sample_type) assert.Equal(t, uint64(0xf), attributes.Read_format) - assert.Equal(t, uint64(0x100003), attributes.Bits) + assert.Equal(t, uint64(0x3), attributes.Bits) attributes = createPerfEventAttr(event) setAttributes(attributes, false) assert.Equal(t, uint64(65536), attributes.Sample_type) assert.Equal(t, uint64(0xf), attributes.Read_format) - assert.Equal(t, uint64(0x100002), attributes.Bits) + assert.Equal(t, uint64(0x2), attributes.Bits) } func TestNewCollector(t *testing.T) {