X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=probes%2Flttng-kretprobes.c;h=2da3143cd0d4d081170e988273faf452cd0d4105;hb=39192dfbea6041eefea1676c554ba73946793c71;hp=49b7de82d86e32ed0a9afd81d971159f43d80aa4;hpb=a8f2d0c75c9cc179fc9e7f7ca17ea3b3b3b5af41;p=lttng-modules.git diff --git a/probes/lttng-kretprobes.c b/probes/lttng-kretprobes.c index 49b7de82..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) @@ -311,8 +299,8 @@ int lttng_kretprobes_event_enable_state(struct lttng_event *event, EXPORT_SYMBOL_GPL(lttng_kretprobes_event_enable_state); MODULE_LICENSE("GPL and additional rights"); -MODULE_AUTHOR("Mathieu Desnoyers"); -MODULE_DESCRIPTION("Linux Trace Toolkit Kretprobes Support"); +MODULE_AUTHOR("Mathieu Desnoyers "); +MODULE_DESCRIPTION("LTTng kretprobes probes"); MODULE_VERSION(__stringify(LTTNG_MODULES_MAJOR_VERSION) "." __stringify(LTTNG_MODULES_MINOR_VERSION) "." __stringify(LTTNG_MODULES_PATCHLEVEL_VERSION)