From: Mathieu Desnoyers Date: Fri, 4 Mar 2011 14:13:15 +0000 (-0500) Subject: Remove duplicated marker id dump X-Git-Tag: v0.12~11 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d558d6536889525d9636c149e127d882420fa39f;p=ust.git Remove duplicated marker id dump 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 --- diff --git a/libust/marker.c b/libust/marker.c index dc2747f..96d1409 100644 --- a/libust/marker.c +++ b/libust/marker.c @@ -693,20 +693,6 @@ void marker_update_probe_range(struct marker * const *begin, /* * 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); } diff --git a/libust/tracer.c b/libust/tracer.c index 435c22d..100dec0 100644 --- a/libust/tracer.c +++ b/libust/tracer.c @@ -902,11 +902,11 @@ int ltt_trace_start(const char *trace_name) 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);