X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=probes%2Flttng-kretprobes.c;h=2da3143cd0d4d081170e988273faf452cd0d4105;hb=d92127bf7371a958a8979665f52b933a9c239ba0;hp=d25862b1f451cc7b949985e895cc83625da02fab;hpb=1c124020c743254923d8e76ab5dcd1f69709982e;p=lttng-modules.git diff --git a/probes/lttng-kretprobes.c b/probes/lttng-kretprobes.c index d25862b1..2da3143c 100644 --- a/probes/lttng-kretprobes.c +++ b/probes/lttng-kretprobes.c @@ -1,27 +1,14 @@ -/* -* probes/lttng-kretprobes.c +/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) + * + * probes/lttng-kretprobes.c * * LTTng kretprobes integration module. * * Copyright (C) 2009-2012 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; only - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include -#include +#include #include #include #include @@ -29,6 +16,7 @@ #include #include #include +#include enum lttng_kretprobe_type { EVENT_ENTRY = 0, @@ -48,7 +36,7 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi, enum lttng_kretprobe_type type) { struct lttng_krp *lttng_krp = - container_of(krpi->rp, struct lttng_krp, krp); + container_of(lttng_get_kretprobe(krpi), struct lttng_krp, krp); struct lttng_event *event = lttng_krp->event[type]; struct lttng_probe_ctx lttng_probe_ctx = { @@ -63,14 +51,14 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi, unsigned long parent_ip; } payload; - if (unlikely(!READ_ONCE(chan->session->active))) + if (unlikely(!LTTNG_READ_ONCE(chan->session->active))) return 0; - if (unlikely(!READ_ONCE(chan->enabled))) + if (unlikely(!LTTNG_READ_ONCE(chan->enabled))) return 0; - if (unlikely(!READ_ONCE(event->enabled))) + if (unlikely(!LTTNG_READ_ONCE(event->enabled))) return 0; - payload.ip = (unsigned long) krpi->rp->kp.addr; + payload.ip = (unsigned long) lttng_get_kretprobe(krpi)->kp.addr; payload.parent_ip = (unsigned long) krpi->ret_addr; lib_ring_buffer_ctx_init(&ctx, chan->chan, <tng_probe_ctx, sizeof(payload), @@ -233,7 +221,7 @@ int lttng_kretprobes_register(const char *name, * Well.. kprobes itself puts the page fault handler on the blacklist, * but we can never be too careful. */ - wrapper_vmalloc_sync_all(); + wrapper_vmalloc_sync_mappings(); ret = register_kretprobe(<tng_krp->krp); if (ret)