Bug #689
closedFilters and context: the man pages need a clarification
100%
Description
Reading the enable-event
man pages, one can get the impression that filters have the same relation with context that they have with the event's payload fields: one could expect them to fail (and thus exclude events) if the context fields they use have not been added to the channel.
That is not the case: filters have global access to the context, and the add-context
command acts quite independently of event filtering.
Updated by David Goulet almost 11 years ago
- Status changed from New to Confirmed
Updated by David Goulet over 10 years ago
- Status changed from Confirmed to Feedback
Not sure what to clarify here but what about maybe rephrasing this part:
Context information can be used for filtering. The examples below shows...
to something like:
Filters can be applied on context fields. The examples below shows...
Is this the part that is not clear?
Updated by Daniel U. Thibault over 10 years ago
add-context [OPTIONS] Add context to event(s) and/or channel(s). A context is basically extra information appended to a channel. For instance, you could ask the tracer to add the PID informa? tion for all events in a channel. You can also add performance monitoring unit counters (perf PMU) using the perf kernel API). For example, this command will add the context information 'prio' and two perf counters (hardware branch misses and cache misses), to all events in the trace data output: # lttng add-context -k -t prio -t perf:branch-misses \ -t perf:cache-misses [...] enable-event NAME[,NAME2,...] [-k|-u] [OPTIONS] Enable tracing event [...] OPTIONS: [...] --filter 'expression' Set a filter on a newly enabled event. Filter expression on event fields and context. Event recording depends on evaluation. Only specify on first activation of a given event within a session. Filter only allowed when enabling events within a session before tracing is started. If the filter fails to link with the event within the traced domain, the event will be discarded. Currently, filter is only implemented for the user-space tracer. [...] Context information can be used for filtering. The exam? ples below show usage of context filtering on process name (with a wildcard), process ID range, and unique thread ID for filtering. The process and thread ID of running applications can be found under columns "PID" and "LWP" of the "ps -eLf" command. '$ctx.procname == "demo*"' '$ctx.vpid >= 4433 && $ctx.vpid < 4455' '$ctx.vtid == 1234'
I think this part:
--filter 'expression' [...] started. If the filter fails to link with the event within the traced domain, the event will be discarded. Currently, filter is only implemented for the user-space tracer. [...] Context information can be used for filtering. The exam? ples below show usage of context filtering on process name (with a wildcard), process ID range, and unique thread ID for filtering. The process and thread ID of running applications can be found under columns "PID" and "LWP" of the "ps -eLf" command. '$ctx.procname == "demo*"' '$ctx.vpid >= 4433 && $ctx.vpid < 4455' '$ctx.vtid == 1234'
needs a paragraph added:
Context information is available to all filters whether or not the add-context command has been used to add it to the event's channel, as long as the context field exists for that domain. For example, the filter examples given above will never fail to link: no add-context is required for the event's channel.
My point is simply that add-context does change the filter's context, it only serves to make chosen context fields explicit in the event record.
Updated by David Goulet over 10 years ago
- Status changed from Feedback to Confirmed
Updated by David Goulet over 10 years ago
- Status changed from Confirmed to Resolved
- % Done changed from 0 to 100
Applied in changeset 2ff2da660e784c99958e8ca5d9b10fbb49151693.