aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>2011-03-16 19:05:33 -0400
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>2011-03-16 19:05:33 -0400
commite032cef3edb7e309d0becd2d90fd55982c4e70c1 (patch)
treeb225e1c87677610c34b6d0292ad160d67798333e /kernel
parent9cc4e6457af0cfad08393bb38e455ad6005f60eb (diff)
downloadlinux-linaro-android-e032cef3edb7e309d0becd2d90fd55982c4e70c1.tar.gz
markers-fix-compaction
markers fix compaction Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/marker.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/marker.c b/kernel/marker.c
index 815fc3c00b1..b8affbf884f 100644
--- a/kernel/marker.c
+++ b/kernel/marker.c
@@ -37,6 +37,8 @@ static const int marker_debug;
/*
* markers_mutex nests inside module_mutex. Markers mutex protects the builtin
* and module markers and the hash table.
+ * markers_mutex nests inside the trace lock, to ensure event ID consistency
+ * between the hash table and the marker section.
*/
static DEFINE_MUTEX(markers_mutex);
@@ -783,7 +785,7 @@ void marker_update_probe_range(struct marker *begin,
* Site effect : marker_set_format may delete the marker entry (creating a
* replacement).
*/
-static void marker_update_probes(void)
+void marker_update_probes(void)
{
/* Core kernel markers */
marker_update_probe_range(__start___markers, __stop___markers);
@@ -879,6 +881,7 @@ error_remove_marker:
WARN_ON(ret_err);
end:
mutex_unlock(&markers_mutex);
+ marker_update_probes(); /* for compaction on error path */
return ret;
}
EXPORT_SYMBOL_GPL(marker_probe_register);
@@ -1090,7 +1093,10 @@ EXPORT_SYMBOL_GPL(marker_get_fmt_from_id);
* markers_compact_event_ids - Compact markers event IDs and reassign channels
*
* Called when no channel users are active by the channel infrastructure.
- * Called with lock_markers() and channel mutex held.
+ * Called with trace lock, lock_markers() and channel mutex held.
+ *
+ * marker_update_probes() must be executed after compaction before releasing the
+ * trace lock.
*/
void markers_compact_event_ids(void)
{
@@ -1100,6 +1106,8 @@ void markers_compact_event_ids(void)
struct hlist_node *node, *next;
int ret;
+ _ltt_channels_reset_event_ids();
+
for (i = 0; i < MARKER_TABLE_SIZE; i++) {
head = &marker_table[i];
hlist_for_each_entry_safe(entry, node, next, head, hlist) {