Skip to content

Missing events due to early return on perfhup #23

Open
@pwaller

Description

@pwaller

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:

perf/record.go

Lines 130 to 133 in 6861f4b

if resp.perfhup {
// Saw POLLHUP on ev.perffd. See also the
// documentation for ErrDisabled.
return ErrDisabled

If I insert:

if ev.readRawRecordNonblock(raw) {
	return nil
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions