X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libust%2Ftracepoint.c;h=cc2adf15e8e8c7ded54281be445528ac4086dcc0;hb=fbca6b624335eef18c8d86194aeb101a720168f4;hp=8a9ed0131a8152289261f44892065544459336a8;hpb=6cb88bc04f67ebc3264d3832f4ce5cca2c642ab4;p=ust.git diff --git a/libust/tracepoint.c b/libust/tracepoint.c index 8a9ed01..cc2adf1 100644 --- a/libust/tracepoint.c +++ b/libust/tracepoint.c @@ -2,19 +2,19 @@ * Copyright (C) 2008 Mathieu Desnoyers * Copyright (C) 2009 Pierre-Marc Fournier * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * 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; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * 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 General Public License for more details. + * 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 General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * 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 * * Ported to userspace by Pierre-Marc Fournier. */ @@ -32,11 +32,13 @@ #include -#include "kernelcompat.h" -#include "tracepoint.h" +#include +#include #include "usterr.h" -#include "list.h" -#include "urcu.h" +//#include "list.h" + +#define _LGPL_SOURCE +#include //extern struct tracepoint __start___tracepoints[] __attribute__((visibility("hidden"))); //extern struct tracepoint __stop___tracepoints[] __attribute__((visibility("hidden"))); @@ -309,6 +311,17 @@ void tracepoint_update_probe_range(struct tracepoint *begin, mutex_unlock(&tracepoints_mutex); } +static void lib_update_tracepoints(void) +{ + struct tracepoint_lib *lib; + +//ust// mutex_lock(&module_mutex); + list_for_each_entry(lib, &libs, list) + tracepoint_update_probe_range(lib->tracepoints_start, + lib->tracepoints_start + lib->tracepoints_count); +//ust// mutex_unlock(&module_mutex); +} + /* * Update probes, removing the faulty probes. */ @@ -494,6 +507,33 @@ void tracepoint_probe_update_all(void) } //ust// EXPORT_SYMBOL_GPL(tracepoint_probe_update_all); +/* + * Returns 0 if current not found. + * Returns 1 if current found. + */ +int lib_get_iter_tracepoints(struct tracepoint_iter *iter) +{ + struct tracepoint_lib *iter_lib; + int found = 0; + +//ust// mutex_lock(&module_mutex); + list_for_each_entry(iter_lib, &libs, list) { + if (iter_lib < iter->lib) + continue; + else if (iter_lib > iter->lib) + iter->tracepoint = NULL; + found = tracepoint_get_iter_range(&iter->tracepoint, + iter_lib->tracepoints_start, + iter_lib->tracepoints_start + iter_lib->tracepoints_count); + if (found) { + iter->lib = iter_lib; + break; + } + } +//ust// mutex_unlock(&module_mutex); + return found; +} + /** * tracepoint_get_iter_range - Get a next tracepoint iterator given a range. * @tracepoint: current tracepoints (in), next tracepoint (out) @@ -530,7 +570,7 @@ static void tracepoint_get_iter(struct tracepoint_iter *iter) //ust// } /* tracepoints in libs. */ found = lib_get_iter_tracepoints(iter); -end: +//ust// end: if (!found) tracepoint_iter_reset(iter); } @@ -598,44 +638,6 @@ void tracepoint_iter_reset(struct tracepoint_iter *iter) //ust// #endif /* CONFIG_MODULES */ -/* - * Returns 0 if current not found. - * Returns 1 if current found. - */ -int lib_get_iter_tracepoints(struct tracepoint_iter *iter) -{ - struct tracepoint_lib *iter_lib; - int found = 0; - -//ust// mutex_lock(&module_mutex); - list_for_each_entry(iter_lib, &libs, list) { - if (iter_lib < iter->lib) - continue; - else if (iter_lib > iter->lib) - iter->tracepoint = NULL; - found = marker_get_iter_range(&iter->tracepoint, - iter_lib->tracepoints_start, - iter_lib->tracepoints_start + iter_lib->tracepoints_count); - if (found) { - iter->lib = iter_lib; - break; - } - } -//ust// mutex_unlock(&module_mutex); - return found; -} - -void lib_update_tracepoints(void) -{ - struct tracepoint_lib *lib; - -//ust// mutex_lock(&module_mutex); - list_for_each_entry(lib, &libs, list) - tracepoint_update_probe_range(lib->tracepoints_start, - lib->tracepoints_start + lib->tracepoints_count); -//ust// mutex_unlock(&module_mutex); -} - static void (*new_tracepoint_cb)(struct tracepoint *) = NULL; void tracepoint_set_new_tracepoint_cb(void (*cb)(struct tracepoint *))