oprofile: warn on freeing event buffer too early
authorRobert Richter <robert.richter@amd.com>
Fri, 9 Oct 2009 01:17:44 +0000 (03:17 +0200)
committerRobert Richter <robert.richter@amd.com>
Fri, 9 Oct 2009 19:32:05 +0000 (21:32 +0200)
commitc0868934e536e0ff508f2d359d006b25abc4970d
tree54932dfb00ee6731a1d3421eba1a87ed025f72dd
parent066b3aa8454bee3cdc665d86b5de812d8d0513b3
oprofile: warn on freeing event buffer too early

A race shouldn't happen since all workqueues or handlers are canceled
or flushed before the event buffer is freed. A warning is triggered
now if the buffer is freed too early.

Also, this patch adds some comments about event buffer protection,
reworks some code and adds code to clear buffer_pos during alloc and
free of the event buffer.

Cc: David Rientjes <rientjes@google.com>
Cc: Stephane Eranian <eranian@google.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
drivers/oprofile/event_buffer.c