[lttng-dev] [PATCH lttng-tools 1/2] Add rcu_read_ongoing() assertions around process_client_msg
Jérémie Galarneau
jeremie.galarneau at efficios.com
Tue Sep 8 08:24:47 EDT 2015
Merged, thanks!
Jérémie
On Mon, Sep 7, 2015 at 10:36 AM, Mathieu Desnoyers
<mathieu.desnoyers at efficios.com> wrote:
> process_client_msg ensures that RCU read-side lock should not be held
> when calling it. Validate this using rcu_read_ongoing() at the entry and
> exit points of this function. This allows us to catch unbalanced RCU
> read-side lock within commands quickly.
>
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
> ---
> src/bin/lttng-sessiond/main.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c
> index 7c48e4d..0e7de6e 100644
> --- a/src/bin/lttng-sessiond/main.c
> +++ b/src/bin/lttng-sessiond/main.c
> @@ -2972,6 +2972,8 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int sock,
>
> DBG("Processing client command %d", cmd_ctx->lsm->cmd_type);
>
> + assert(!rcu_read_ongoing());
> +
> *sock_error = 0;
>
> switch (cmd_ctx->lsm->cmd_type) {
> @@ -4059,6 +4061,7 @@ setup_error:
> session_unlock_list();
> }
> init_setup_error:
> + assert(!rcu_read_ongoing());
> return ret;
> }
>
> --
> 2.1.4
>
--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list