X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-tracepoint.c;h=8298b3970b6256eb9cdf40ca1e43a416c501c9c3;hb=edfdcb685c3f56dde803244449f79ad7bed03798;hp=13f9c247d440ca3dc7d69e44a995ec8b90f99370;hpb=20591cf76d5dfd42d61a18bd494b40a70a04dd59;p=lttng-modules.git diff --git a/lttng-tracepoint.c b/lttng-tracepoint.c index 13f9c247..8298b397 100644 --- a/lttng-tracepoint.c +++ b/lttng-tracepoint.c @@ -1,26 +1,12 @@ -/* +/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) + * * lttng-tracepoint.c * * LTTng adaptation layer for Linux kernel 3.15+ tracepoints. * * Copyright (C) 2014 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 @@ -29,7 +15,9 @@ #include #include -#include "lttng-tracepoint.h" +#include +#include +#include /* * Protect the tracepoint table. lttng_tracepoint_mutex nests within @@ -119,7 +107,7 @@ struct tracepoint_entry *get_tracepoint(const char *name) u32 hash = jhash(name, strlen(name), 0); head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)]; - hlist_for_each_entry(e, head, hlist) { + lttng_hlist_for_each_entry(e, head, hlist) { if (!strcmp(name, e->name)) return e; } @@ -139,7 +127,7 @@ struct tracepoint_entry *add_tracepoint(const char *name) u32 hash = jhash(name, name_len - 1, 0); head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)]; - hlist_for_each_entry(e, head, hlist) { + lttng_hlist_for_each_entry(e, head, hlist) { if (!strcmp(name, e->name)) { printk(KERN_NOTICE "tracepoint %s busy\n", name); @@ -241,7 +229,7 @@ int lttng_tracepoint_coming(struct tp_module *tp_mod) struct tracepoint_entry *e; struct lttng_tp_probe *p; - tp = tp_mod->mod->tracepoints_ptrs[i]; + tp = lttng_tracepoint_ptr_deref(&tp_mod->mod->tracepoints_ptrs[i]); e = get_tracepoint(tp->name); if (!e) { e = add_tracepoint(tp->name); @@ -268,7 +256,7 @@ int lttng_tracepoint_coming(struct tp_module *tp_mod) } } mutex_unlock(<tng_tracepoint_mutex); - return 0; + return NOTIFY_OK; } static @@ -282,7 +270,7 @@ int lttng_tracepoint_going(struct tp_module *tp_mod) struct tracepoint_entry *e; struct lttng_tp_probe *p; - tp = tp_mod->mod->tracepoints_ptrs[i]; + tp = lttng_tracepoint_ptr_deref(&tp_mod->mod->tracepoints_ptrs[i]); e = get_tracepoint(tp->name); if (!e || !e->tp) continue;