sessiond: agent: enable events matching event notifiers
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 11 Feb 2020 20:59:02 +0000 (15:59 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 4 Feb 2021 21:02:51 +0000 (16:02 -0500)
commit44760c20f4fc255b63894ca758cf2ee5f253220b
tree60dc23d1572a79154c48d620341ec5188aef125f
parentce0b1d61919f37517a6212f7af2afe0fa1b1dcb0
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 <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I363db1e4bd7d7d73c75b8576c6323ee41e31aa00
Depends-on: lttng-ust: I5a800fc92e588c2a6a0e26282b0ad5f31c044479
16 files changed:
include/lttng/event-rule/event-rule-internal.h
src/bin/lttng-sessiond/agent-thread.c
src/bin/lttng-sessiond/agent.c
src/bin/lttng-sessiond/agent.h
src/bin/lttng-sessiond/client.c
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/event.c
src/bin/lttng-sessiond/event.h
src/bin/lttng-sessiond/globals.c
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/save.c
src/bin/lttng-sessiond/ust-app.c
src/bin/lttng-sessiond/utils.c
src/bin/lttng-sessiond/utils.h
src/common/event-rule/event-rule.c
src/common/event-rule/tracepoint.c
This page took 0.027303 seconds and 5 git commands to generate.