perf icon indicating copy to clipboard operation
perf copied to clipboard

Missing events due to early return on perfhup

Open pwaller opened this issue 4 years ago • 0 comments

I've been messing around with perf, using inherit to trace a process tree.

What I've found is that when the process tree exits, we get HUP on the poll, and whatever events are in the kernel buffer at that time are lost.

I'm not sure I fully understand what's going on, but I've found anecdotally that here:

https://github.com/acln0/perf/blob/6861f4b5b828ac9ec30ec0eddc8d4fef199a3299/record.go#L130-L133

If I insert:

if ev.readRawRecordNonblock(raw) {
	return nil
}

Before return ErrDisabled, then it appears the events are not lost.

pwaller avatar May 10 '20 10:05 pwaller