Marker ID is already dumped at:
- trace start (with marker dump)
- when a marker is enabled (probe callback associated with marker).
So this should cover all cases:
- either we have a marker in a lib/program that is already enabled, and start
tracing after a library is loaded, for which the marker dump will catch the
marker id.
- or we have a marker in a lib/program that is not enabled, and start tracing
after a library is loaded. If after that we enable the marker, an event
describing the marker ID will be generated.
- or if have tracing running, and then we enable a marker (connect probe to
marker) for a marker located in a yet-unloaded library. In this case, the
marker ID event is generated when we connect the probe to the marker, even if
the library is not yet loaded.
The cases are similar for the marker format, except that it is valid to have an
unknown marker format when we connect a marker probe. In that case, the format
will be written into the trace by marker_set_format, called upon library load.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
/*
* ignore error, continue
*/
-
- /* This is added for UST. We emit a core_marker_id event
- * for markers that are already registered to a probe
- * upon library load. Otherwise, no core_marker_id will
- * be generated for these markers. Is this the right thing
- * to do?
- */
- trace_mark(metadata, core_marker_id,
- "channel %s name %s event_id %hu "
- "int #1u%zu long #1u%zu pointer #1u%zu "
- "size_t #1u%zu alignment #1u%u",
- (*iter)->channel, (*iter)->name, mark_entry->event_id,
- sizeof(int), sizeof(long), sizeof(void *),
- sizeof(size_t), ltt_get_alignment());
} else {
disable_marker(*iter);
}
ltt_unlock_traces();
/*
- * Call the kernel state dump.
- * Events will be mixed with real kernel events, it's ok.
+ * Call the process-wide state dump.
* Notice that there is no protection on the trace : that's exactly
* why we iterate on the list and check for trace equality instead of
- * directly using this trace handle inside the logging function.
+ * directly using this trace handle inside the logging function: we want
+ * to record events only in a single trace in the trace session list.
*/
ltt_dump_marker_state(trace);