From: Michael Jeanson Date: Fri, 9 Apr 2021 18:04:28 +0000 (-0400) Subject: Move liblttng-ust-python-agent to 'src/lib/' X-Git-Tag: v2.13.0-rc1~140 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f1b5fe11a15ca3bc3e45074673eeff5992d3daaf;p=lttng-ust.git Move liblttng-ust-python-agent to 'src/lib/' Move all public libraries under 'src/lib/'. This is part of an effort to standardize our autotools setup across projects to simplify maintenance. Change-Id: If0eb731cc8f7faa860153f163b57f14292b7f522 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/.gitignore b/.gitignore index bb9079bf..e0cbc8cb 100644 --- a/.gitignore +++ b/.gitignore @@ -144,7 +144,8 @@ cscope.* /src/liblttng-ust-java-agent/jni/log4j/Makefile /src/liblttng-ust-java/Makefile /src/liblttng-ust-libc-wrapper/Makefile -/src/liblttng-ust-python-agent/Makefile +/src/lib/lttng-ust-python-agent/Makefile +/src/lib/Makefile /src/liblttng-ust/Makefile /src/libringbuffer/Makefile /src/python-lttngust/Makefile diff --git a/configure.ac b/configure.ac index c9bf1e86..2b03cee3 100644 --- a/configure.ac +++ b/configure.ac @@ -539,7 +539,8 @@ AC_CONFIG_FILES([ src/liblttng-ust-java/Makefile src/liblttng-ust-libc-wrapper/Makefile src/liblttng-ust/Makefile - src/liblttng-ust-python-agent/Makefile + src/lib/lttng-ust-python-agent/Makefile + src/lib/Makefile src/libringbuffer/Makefile src/lttng-ust-ctl.pc src/lttng-ust.pc diff --git a/src/Makefile.am b/src/Makefile.am index a5e8ac94..881eea26 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,6 +7,7 @@ SUBDIRS = \ libcounter \ liblttng-ust \ liblttng-ust-ctl \ + lib \ liblttng-ust-fd \ liblttng-ust-fork \ liblttng-ust-libc-wrapper \ @@ -25,9 +26,7 @@ SUBDIRS += liblttng-ust-java-agent endif if ENABLE_PYTHON_AGENT -SUBDIRS += \ - python-lttngust \ - liblttng-ust-python-agent +SUBDIRS += python-lttngust endif pkgconfigdir = $(libdir)/pkgconfig diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am new file mode 100644 index 00000000..1b70e530 --- /dev/null +++ b/src/lib/Makefile.am @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-only + +SUBDIRS = + +if ENABLE_PYTHON_AGENT +SUBDIRS += lttng-ust-python-agent +endif diff --git a/src/lib/lttng-ust-python-agent/Makefile.am b/src/lib/lttng-ust-python-agent/Makefile.am new file mode 100644 index 00000000..f0ce5890 --- /dev/null +++ b/src/lib/lttng-ust-python-agent/Makefile.am @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: LGPL-2.1-only + +# tracepoint provider: always built/installed (does not depend on Python per se) +AM_CFLAGS += -I$(srcdir) -fno-strict-aliasing + +lib_LTLIBRARIES = liblttng-ust-python-agent.la + +liblttng_ust_python_agent_la_SOURCES = lttng_ust_python.c lttng_ust_python.h +liblttng_ust_python_agent_la_LIBADD = \ + -lc \ + $(top_builddir)/src/liblttng-ust/liblttng-ust.la + +# Follow the main library soname for co-installability +liblttng_ust_python_agent_la_LDFLAGS = -version-info $(LTTNG_UST_LIBRARY_VERSION) diff --git a/src/lib/lttng-ust-python-agent/lttng_ust_python.c b/src/lib/lttng-ust-python-agent/lttng_ust_python.c new file mode 100644 index 00000000..f2efb4ea --- /dev/null +++ b/src/lib/lttng-ust-python-agent/lttng_ust_python.c @@ -0,0 +1,25 @@ +/* + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (C) 2014 David Goulet + */ + +#define _LGPL_SOURCE +#define TRACEPOINT_DEFINE +#define TRACEPOINT_CREATE_PROBES +#include "lttng_ust_python.h" + +/* + * The tracepoint fired by the agent. + */ + +void py_tracepoint(const char *asctime, const char *msg, + const char *logger_name, const char *funcName, unsigned int lineno, + unsigned int int_loglevel, unsigned int thread, const char *threadName); +void py_tracepoint(const char *asctime, const char *msg, + const char *logger_name, const char *funcName, unsigned int lineno, + unsigned int int_loglevel, unsigned int thread, const char *threadName) +{ + tracepoint(lttng_python, event, asctime, msg, logger_name, funcName, + lineno, int_loglevel, thread, threadName); +} diff --git a/src/lib/lttng-ust-python-agent/lttng_ust_python.h b/src/lib/lttng-ust-python-agent/lttng_ust_python.h new file mode 100644 index 00000000..29440e2a --- /dev/null +++ b/src/lib/lttng-ust-python-agent/lttng_ust_python.h @@ -0,0 +1,45 @@ +/* + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (C) 2014 - David Goulet + */ + +#undef TRACEPOINT_PROVIDER +#define TRACEPOINT_PROVIDER lttng_python + +#if !defined(_TRACEPOINT_LTTNG_UST_PYTHON_H) || defined(TRACEPOINT_HEADER_MULTI_READ) +#define _TRACEPOINT_LTTNG_UST_PYTHON_H + +#include +#include + +TRACEPOINT_EVENT(lttng_python, event, + TP_ARGS( + const char *, asctime, + const char *, msg, + const char *, logger_name, + const char *, funcName, + int, lineno, + int, int_loglevel, + int, thread, + const char *, threadName + ), + TP_FIELDS( + ctf_string(asctime, asctime) + ctf_string(msg, msg) + ctf_string(logger_name, logger_name) + ctf_string(funcName, funcName) + ctf_integer(unsigned int, lineno, lineno) + ctf_integer(unsigned int, int_loglevel, int_loglevel) + ctf_integer(unsigned int, thread, thread) + ctf_string(threadName, threadName) + ) +) + +#endif /* _TRACEPOINT_LTTNG_UST_PYTHON_H */ + +#undef TRACEPOINT_INCLUDE +#define TRACEPOINT_INCLUDE "./lttng_ust_python.h" + +/* This part must be outside ifdef protection */ +#include diff --git a/src/liblttng-ust-python-agent/Makefile.am b/src/liblttng-ust-python-agent/Makefile.am deleted file mode 100644 index f0ce5890..00000000 --- a/src/liblttng-ust-python-agent/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only - -# tracepoint provider: always built/installed (does not depend on Python per se) -AM_CFLAGS += -I$(srcdir) -fno-strict-aliasing - -lib_LTLIBRARIES = liblttng-ust-python-agent.la - -liblttng_ust_python_agent_la_SOURCES = lttng_ust_python.c lttng_ust_python.h -liblttng_ust_python_agent_la_LIBADD = \ - -lc \ - $(top_builddir)/src/liblttng-ust/liblttng-ust.la - -# Follow the main library soname for co-installability -liblttng_ust_python_agent_la_LDFLAGS = -version-info $(LTTNG_UST_LIBRARY_VERSION) diff --git a/src/liblttng-ust-python-agent/lttng_ust_python.c b/src/liblttng-ust-python-agent/lttng_ust_python.c deleted file mode 100644 index f2efb4ea..00000000 --- a/src/liblttng-ust-python-agent/lttng_ust_python.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (C) 2014 David Goulet - */ - -#define _LGPL_SOURCE -#define TRACEPOINT_DEFINE -#define TRACEPOINT_CREATE_PROBES -#include "lttng_ust_python.h" - -/* - * The tracepoint fired by the agent. - */ - -void py_tracepoint(const char *asctime, const char *msg, - const char *logger_name, const char *funcName, unsigned int lineno, - unsigned int int_loglevel, unsigned int thread, const char *threadName); -void py_tracepoint(const char *asctime, const char *msg, - const char *logger_name, const char *funcName, unsigned int lineno, - unsigned int int_loglevel, unsigned int thread, const char *threadName) -{ - tracepoint(lttng_python, event, asctime, msg, logger_name, funcName, - lineno, int_loglevel, thread, threadName); -} diff --git a/src/liblttng-ust-python-agent/lttng_ust_python.h b/src/liblttng-ust-python-agent/lttng_ust_python.h deleted file mode 100644 index 29440e2a..00000000 --- a/src/liblttng-ust-python-agent/lttng_ust_python.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (C) 2014 - David Goulet - */ - -#undef TRACEPOINT_PROVIDER -#define TRACEPOINT_PROVIDER lttng_python - -#if !defined(_TRACEPOINT_LTTNG_UST_PYTHON_H) || defined(TRACEPOINT_HEADER_MULTI_READ) -#define _TRACEPOINT_LTTNG_UST_PYTHON_H - -#include -#include - -TRACEPOINT_EVENT(lttng_python, event, - TP_ARGS( - const char *, asctime, - const char *, msg, - const char *, logger_name, - const char *, funcName, - int, lineno, - int, int_loglevel, - int, thread, - const char *, threadName - ), - TP_FIELDS( - ctf_string(asctime, asctime) - ctf_string(msg, msg) - ctf_string(logger_name, logger_name) - ctf_string(funcName, funcName) - ctf_integer(unsigned int, lineno, lineno) - ctf_integer(unsigned int, int_loglevel, int_loglevel) - ctf_integer(unsigned int, thread, thread) - ctf_string(threadName, threadName) - ) -) - -#endif /* _TRACEPOINT_LTTNG_UST_PYTHON_H */ - -#undef TRACEPOINT_INCLUDE -#define TRACEPOINT_INCLUDE "./lttng_ust_python.h" - -/* This part must be outside ifdef protection */ -#include