X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Fregression%2Fust%2Fmulti-lib%2Fmulti-lib-test.c;h=6ebb13d7a4c9eaa6fefa304d784af1e000dc14dc;hb=d3a684eebfe788a7527368d65d7f020bdd1e61d9;hp=b5b2f314764af0ee5ff32706b1850fc464e34821;hpb=8ac478d0ad55edd322b2a4c6931e452d809bf5f3;p=deliverable%2Flttng-tools.git diff --git a/tests/regression/ust/multi-lib/multi-lib-test.c b/tests/regression/ust/multi-lib/multi-lib-test.c index b5b2f3147..6ebb13d7a 100644 --- a/tests/regression/ust/multi-lib/multi-lib-test.c +++ b/tests/regression/ust/multi-lib/multi-lib-test.c @@ -1,18 +1,8 @@ /* - * Copyright (C) - 2018 Francis Deslauriers + * Copyright (C) 2018 Francis Deslauriers * - * 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; version 2.1 of the License. + * SPDX-License-Identifier: LGPL-2.1-only * - * 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 @@ -25,6 +15,7 @@ #include "callsites.h" #endif +void exec_callsite(); void exec_callsite() { #if HAS_CALLSITES @@ -32,7 +23,7 @@ void exec_callsite() #endif } -void print_list(void) +static void print_list(void) { fprintf(stderr, "Test list (-t X):\n"); fprintf(stderr, "\t0: dlopen() all libraries pass in arguments and execute " @@ -41,7 +32,8 @@ void print_list(void) fprintf(stderr, "\t2: simulate the upgrade of a library containing the callsites using dlopen() and dlclose(). \n"); } -int dl_open_all(int nb_libraries, char **libraries) +#if HAS_CALLSITES +static int dl_open_all(int nb_libraries, char **libraries) { int i, ret = 0; void **handles; @@ -66,12 +58,14 @@ error: free(handles); return ret; } +#endif +#if HAS_CALLSITES /* * Takes 2 paths to libraries, dlopen() the first, trace, dlopen() the second, * and dlclose the first to simulate the upgrade of a library. */ -int upgrade_lib(int nb_libraries, char **libraries) +static int upgrade_lib(int nb_libraries, char **libraries) { int i, ret = 0; void *handles[2]; @@ -102,12 +96,14 @@ int upgrade_lib(int nb_libraries, char **libraries) error: return ret; } +#endif +#if !HAS_CALLSITES /* * Simulate the upgrade of a library containing a callsite. * Receives two libraries containing callsites for the same tracepoint. */ -int upgrade_callsite(int nb_libraries, char **libraries) +static int upgrade_callsite(int nb_libraries, char **libraries) { int ret = 0; void *handles[2]; @@ -169,6 +165,7 @@ int upgrade_callsite(int nb_libraries, char **libraries) error: return ret; } +#endif int main(int argc, const char **argv) {