#include "include/assert.h"
#include "common/config.h"
+#include "tracing/osd.tp.h"
#define dout_subsys ceph_subsys_osd
#undef dout_prefix
return;
}
OpRequestRef op = op_tracker.create_request<OpRequest>(m);
+ {
+ osd_reqid_t reqid = op->get_reqid();
+ tracepoint(osd, ms_fast_dispatch, reqid.name._type,
+ reqid.name._num, reqid.tid, reqid.inc);
+ }
OSDMapRef nextmap = service.get_nextmap_reserved();
Session *session = static_cast<Session*>(m->get_connection()->get_priv());
assert(session);
sdata->pg_for_processing.erase(&*(item.first));
}
+ // osd:opwq_process marks the point at which an operation has been dequeued
+ // and will begin to be handled by a worker thread.
+ {
+ osd_reqid_t reqid = op->get_reqid();
+ tracepoint(osd, opwq_process_start, reqid.name._type,
+ reqid.name._num, reqid.tid, reqid.inc);
+ }
+
lgeneric_subdout(osd->cct, osd, 30) << "dequeue status: ";
Formatter *f = new_formatter("json");
f->open_object_section("q");
*_dout << dendl;
osd->dequeue_op(item.first, op, tp_handle);
- (item.first)->unlock();
+ {
+ osd_reqid_t reqid = op->get_reqid();
+ tracepoint(osd, opwq_process_finish, reqid.name._type,
+ reqid.name._num, reqid.tid, reqid.inc);
+ }
+
+ (item.first)->unlock();
}
void OSD::ShardedOpWQ::_enqueue(pair<PGRef, OpRequestRef> item) {
#include "osd/osd_types.h"
-
OpRequest::OpRequest(Message *req, OpTracker *tracker) :
TrackedOp(tracker, req->get_recv_stamp()),
rmw_flags(0), request(req),
#include "messages/MOSDSubOp.h"
#include "messages/MOSDSubOpReply.h"
#include "common/BackTrace.h"
+#include "tracing/pg.tp.h"
#include <sstream>
return;
}
osd->op_wq.queue(make_pair(PGRef(this), op));
+ {
+ // after queue() to include any locking costs
+ osd_reqid_t reqid = op->get_reqid();
+ tracepoint(pg, queue_op, reqid.name._type,
+ reqid.name._num, reqid.tid, reqid.inc);
+ }
}
void PG::replay_queued_ops()
#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"
#define dout_subsys ceph_subsys_osd
#define DOUT_PREFIX_ARGS this, osd->whoami, get_osdmap()
p->second->ondisk_read_lock();
}
+ {
+ osd_reqid_t reqid = ctx->op->get_reqid();
+ tracepoint(osd, prepare_tx_enter, reqid.name._type,
+ reqid.name._num, reqid.tid, reqid.inc);
+ }
+
int result = prepare_transaction(ctx);
+ {
+ osd_reqid_t reqid = ctx->op->get_reqid();
+ tracepoint(osd, prepare_tx_exit, reqid.name._type,
+ reqid.name._num, reqid.tid, reqid.inc);
+ }
+
if (op->may_read()) {
dout(10) << " dropping ondisk_read_lock" << dendl;
obc->ondisk_read_unlock();
libtracepoints_la_SOURCES = \
mutex.tp.c \
- mutex.tp.h
+ mutex.tp.h \
+ osd.tp.c \
+ osd.tp.h \
+ pg.tp.h \
+ pg.tp.c
libtracepoints_la_LIBADD = -llttng-ust -ldl
libtracepoints_la_CPPFLAGS = -DTRACEPOINT_PROBE_DYNAMIC_LINKAGE
--- /dev/null
+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)
+ )
+)
--- /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
+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)
+ )
+)
--- /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>