AC_CHECK_HEADER([lttng/tracepoint.h], [],
AC_MSG_ERROR([lttng/tracepoint.h not found (liblttng-ust-dev)]))
+AC_CHECK_PROG([LTTNG_GEN_TP_CHECK], [lttng-gen-tp], [yes])
+if test x"$LTTNG_GEN_TP_CHECK" != "xyes"; then
+ AC_MSG_FAILURE([lttng-gen-tp not found])
+fi
+AC_SUBST([LTTNG_GEN_TP_PROG], [lttng-gen-tp])
+
+
# Checks for typedefs, structures, and compiler characteristics.
#AC_HEADER_STDBOOL
#AC_C_CONST
#include "common/config.h"
#include "include/utime.h"
#include "common/Clock.h"
-#include "tracing/mutex.tp.h"
+#include "tracing/mutex.h"
Mutex::Mutex(const char *n, bool r, bool ld,
bool bt,
#include "include/assert.h"
#include "common/config.h"
-#include "tracing/osd.tp.h"
+#include "tracing/osd.h"
#define dout_subsys ceph_subsys_osd
#undef dout_prefix
#include "messages/MOSDSubOp.h"
#include "messages/MOSDSubOpReply.h"
#include "common/BackTrace.h"
-#include "tracing/pg.tp.h"
+#include "tracing/pg.h"
#include <sstream>
#include "json_spirit/json_spirit_value.h"
#include "json_spirit/json_spirit_reader.h"
#include "include/assert.h" // json_spirit clobbers it
-#include "tracing/osd.tp.h"
+#include "tracing/osd.h"
#define dout_subsys ceph_subsys_osd
#define DOUT_PREFIX_ARGS this, osd->whoami, get_osdmap()
+%.c %.h: %.tp
+ $(LTTNG_GEN_TP_PROG) $<
+ rm -f $<.o
+
+dist_noinst_DATA = mutex.tp osd.tp pg.tp
+
libtracepoints_la_SOURCES = \
- mutex.tp.c \
- mutex.tp.h \
- osd.tp.c \
- osd.tp.h \
- pg.tp.h \
- pg.tp.c
+ mutex.c \
+ mutex.h \
+ osd.c \
+ osd.h \
+ pg.h \
+ pg.c
libtracepoints_la_LIBADD = -llttng-ust -ldl
libtracepoints_la_CPPFLAGS = -DTRACEPOINT_PROBE_DYNAMIC_LINKAGE
libtracepoints_la_LDFLAGS =
noinst_LTLIBRARIES = libtracepoints.la
+
+BUILT_SOURCES = mutex.h osd.h pg.h
+
+CLEANFILES = $(libtracepoints_la_SOURCES)
-Add New Provider
-================
-
-## Create tracepoint definition file
-
-Add tracepoint definitions for the provider into a `.tp` file. Documentation
-on defining a tracepoint can be found in `man lttng-ust`. By convention files
-are named according to the logical sub-system they correspond to (e.g.
-`mutex.tp`, `pg.tp`).
+Installation
+============
-## Generate tracepoint source files
+The LTTng libraries that ship with Ubuntu 12.04 have been very buggy, and the
+generated header files using `lttng-gen-tp` have needed to be fixed just to
+compile in the Ceph tree. The packages available in Ubuntu 14.04 seem to work
+alright, and for older versions please install LTTng from the LTTng PPA.
-The `.tp` file is converted into source files using the `lttng-gen-tp` tool.
+ https://launchpad.net/~lttng/+archive/ppa
- lttng-gen-tp mutex.tp -o mutex.tp.h -o mutex.tp.c
+Then install as normal
-## Add source files to libtracepoints.la
+ apt-get install lttng-tools liblttng-ust-dev
-Modify Makefile.am to include the generated source files from the previous
-step.
-
-## Commit changes to Git
-
-Commit both the source `.tp` file as well as the generated sources, and the
-changes to Makefile.am.
+Add/Update Provider
+================
-Add Tracepoint to Existing Provider
-===================================
+## Create tracepoint definition file
-New tracepoints can be added to an existing provider by updating the
-corresponding `.tp` file and re-generating the source files. Make sure to
-commit the updated files back into Git.
+Add tracepoint definitions for the provider into a `.tp` file. Documentation
+on defining a tracepoint can be found in `man lttng-ust`. By convention files
+are named according to the logical sub-system they correspond to (e.g.
+`mutex.tp`, `pg.tp`). Place the `.tp` file into the `src/tracing` directory
+and modify the automake file `src/tracing/Makefile.am` accordingly.
+++ /dev/null
-
-#define TRACEPOINT_CREATE_PROBES
-/*
- * The header containing our TRACEPOINT_EVENTs.
- */
-#define TRACEPOINT_DEFINE
-#include "mutex.tp.h"
+++ /dev/null
-
-#undef TRACEPOINT_PROVIDER
-#define TRACEPOINT_PROVIDER mutex
-
-#undef TRACEPOINT_INCLUDE
-#define TRACEPOINT_INCLUDE "./mutex.tp.h"
-
-#if !defined(MUTEX_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
-#define MUTEX_TP_H
-
-#include <lttng/tracepoint.h>
-
-TRACEPOINT_EVENT(mutex, lock_enter,
- TP_ARGS(
- const void *, addr,
- const char *, name),
- TP_FIELDS(
- ctf_integer_hex(unsigned long, addr, addr)
- ctf_string(name, name)
- )
-)
-
-TRACEPOINT_EVENT(mutex, lock_exit,
- TP_ARGS(
- const void *, addr,
- const char *, name),
- TP_FIELDS(
- ctf_integer_hex(unsigned long, addr, addr)
- ctf_string(name, name)
- )
-)
-
-TRACEPOINT_EVENT(mutex, unlock,
- TP_ARGS(
- const void *, addr,
- const char *, name),
- TP_FIELDS(
- ctf_integer_hex(unsigned long, addr, addr)
- ctf_string(name, name)
- )
-)
-
-#endif /* MUTEX_TP_H */
-
-#include <lttng/tracepoint-event.h>
+++ /dev/null
-
-#define TRACEPOINT_CREATE_PROBES
-/*
- * The header containing our TRACEPOINT_EVENTs.
- */
-#define TRACEPOINT_DEFINE
-#include "osd.tp.h"
+++ /dev/null
-
-#undef TRACEPOINT_PROVIDER
-#define TRACEPOINT_PROVIDER osd
-
-#undef TRACEPOINT_INCLUDE
-#define TRACEPOINT_INCLUDE "./osd.tp.h"
-
-#if !defined(OSD_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
-#define OSD_TP_H
-
-#include <lttng/tracepoint.h>
-
-TRACEPOINT_EVENT(osd, prepare_tx_enter,
- TP_ARGS(
- // osd_reqid_t
- uint8_t, type,
- int64_t, num,
- uint64_t, tid,
- int32_t, inc),
- TP_FIELDS(
- ctf_integer(uint8_t, type, type)
- ctf_integer(int64_t, num, num)
- ctf_integer(uint64_t, tid, tid)
- ctf_integer(int32_t, inc, inc)
- )
-)
-
-TRACEPOINT_EVENT(osd, prepare_tx_exit,
- TP_ARGS(
- // osd_reqid_t
- uint8_t, type,
- int64_t, num,
- uint64_t, tid,
- int32_t, inc),
- TP_FIELDS(
- ctf_integer(uint8_t, type, type)
- ctf_integer(int64_t, num, num)
- ctf_integer(uint64_t, tid, tid)
- ctf_integer(int32_t, inc, inc)
- )
-)
-
-TRACEPOINT_EVENT(osd, ms_fast_dispatch,
- TP_ARGS(
- // osd_reqid_t
- uint8_t, type,
- int64_t, num,
- uint64_t, tid,
- int32_t, inc),
- TP_FIELDS(
- ctf_integer(uint8_t, type, type)
- ctf_integer(int64_t, num, num)
- ctf_integer(uint64_t, tid, tid)
- ctf_integer(int32_t, inc, inc)
- )
-)
-
-TRACEPOINT_EVENT(osd, opwq_process_start,
- TP_ARGS(
- // osd_reqid_t
- uint8_t, type,
- int64_t, num,
- uint64_t, tid,
- int32_t, inc),
- TP_FIELDS(
- ctf_integer(uint8_t, type, type)
- ctf_integer(int64_t, num, num)
- ctf_integer(uint64_t, tid, tid)
- ctf_integer(int32_t, inc, inc)
- )
-)
-
-TRACEPOINT_EVENT(osd, opwq_process_finish,
- TP_ARGS(
- // osd_reqid_t
- uint8_t, type,
- int64_t, num,
- uint64_t, tid,
- int32_t, inc),
- TP_FIELDS(
- ctf_integer(uint8_t, type, type)
- ctf_integer(int64_t, num, num)
- ctf_integer(uint64_t, tid, tid)
- ctf_integer(int32_t, inc, inc)
- )
-)
-
-#endif /* OSD_TP_H */
-
-#include <lttng/tracepoint-event.h>
+++ /dev/null
-
-#define TRACEPOINT_CREATE_PROBES
-/*
- * The header containing our TRACEPOINT_EVENTs.
- */
-#define TRACEPOINT_DEFINE
-#include "pg.tp.h"
+++ /dev/null
-
-#undef TRACEPOINT_PROVIDER
-#define TRACEPOINT_PROVIDER pg
-
-#undef TRACEPOINT_INCLUDE
-#define TRACEPOINT_INCLUDE "./pg.tp.h"
-
-#if !defined(PG_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
-#define PG_TP_H
-
-#include <lttng/tracepoint.h>
-
-TRACEPOINT_EVENT(pg, queue_op,
- TP_ARGS(
- // osd_reqid_t
- uint8_t, type,
- int64_t, num,
- uint64_t, tid,
- int32_t, inc),
- TP_FIELDS(
- ctf_integer(uint8_t, type, type)
- ctf_integer(int64_t, num, num)
- ctf_integer(uint64_t, tid, tid)
- ctf_integer(int32_t, inc, inc)
- )
-)
-
-#endif /* PG_TP_H */
-
-#include <lttng/tracepoint-event.h>