Re: [PATCH] perf session: Add option to copy events when queueing

From: David Ahern
Date: Tue Sep 17 2013 - 00:14:19 EST


On 9/16/13 10:40 AM, Frederic Weisbecker wrote:
Yes. I could make it the default behavior; just overhead in doing
that (malloc/copy for each event).

Are there any tool that don't suffer from this bug somehow? If not then it must
be applied unconditionally.

I believe only 'live' commands would be affected: top, kvm stat live, my local scheduling daemon. perf-trace bypasses session and time ordering (though I question that decision).

---8<---

size of event is determined by mmap_event (mmap2_event in latest
code) which is > 4096 because of the filename argument. Including
the event directly in sample_queue would balloon memory usage
(learned this the hard way!).

Ah then perhaps we can allocate with the dynamic size of the event?

Yes, that's how I have it my patch -- allocate memory based on header size and copy in the queue_event function. I think we agree on this part now.

---8<---

Although the mirrored os->sample_buffer condition check is a bit ugly and should move to
a function. But the idea is there.

Ok. That should be a separate patch. Are you going to submit that one?

Yeah, unless you beat me at it :)

That's not going to happen on my end due to a recent time constraint (jury duty - minimum 1 week trial). At best I can do a patch in early October.

David

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/