Skip to content

Commit

Permalink
Delete exclude guest flag which causing problems on some configurations.
Browse files Browse the repository at this point in the history
Signed-off-by: Paweł Szulik <pawel.szulik@intel.com>
  • Loading branch information
Paweł Szulik committed Oct 5, 2020
1 parent 2e9277b commit 728879c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion perf/collector_libpfm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions perf/collector_libpfm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 728879c

Please sign in to comment.