From: Jonathan Rajotte Date: Tue, 11 Feb 2020 20:59:02 +0000 (-0500) Subject: sessiond: agent: enable events matching event notifiers X-Git-Tag: v2.13.0-rc1~354 X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=44760c20f4fc255b63894ca758cf2ee5f253220b;hp=44760c20f4fc255b63894ca758cf2ee5f253220b;p=lttng-tools.git sessiond: agent: enable events matching event notifiers Per event notifier domain agents -------------------------------- A `struct agent` instance encapsulates the agent events of an agent domain for a given session. In the context of event notifiers, there is no session involved to scope the agent instance. Hence, per-domain instances are maintained to control event-notifiers enabled by triggers. Agent event enable count ------------------------ Agents act as a pre-filter on user space tracer events. In order to honor triggers use event notifiers (on-event-hit conditions), the register/unregister trigger commands are modified to ensure 'agent' domain events are created and enabled/disabled suitably for the user space tracer to be invoked. Note that since agent events are a "filter" before event enablers, an event-rule targetting a ring buffer and an identical event-rule targetting an event notifier can be enabled. The action to take when the event is hit is completely opaque to the agents. In such cases, the same agent event instance needs to be enabled and the current implementation doesn't allow duplicate agent events. Hence, `struct agent_event`'s enabled state is now a counter which accounts for all enabled event-rules that require this agent event to be enabled. The agent event is enabled when one or more event rules matching it are enabled and it is disabled when that count reached zero. To ensure no code checks for the agent_event's enabled state by comparing to '1', a new `AGENT_EVENT_IS_ENABLED` macro is introduced. The existing code using the `enabled` attribute directly is modified to use it. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: I363db1e4bd7d7d73c75b8576c6323ee41e31aa00 Depends-on: lttng-ust: I5a800fc92e588c2a6a0e26282b0ad5f31c044479 ---