diff --git a/src/ice_transport.cpp b/src/ice_transport.cpp index cf5700e62934223fde99da16685b5131e481a5d1..144081a0d37ab3b64aab242974490b92443d1f41 100644 --- a/src/ice_transport.cpp +++ b/src/ice_transport.cpp @@ -26,6 +26,7 @@ #include "upnp/upnp_control.h" #include "transport/peer_channel.h" #include "jami/callmanager_interface.h" +#include "tracepoint.h" #include <pjlib.h> @@ -1096,6 +1097,10 @@ IceTransport::Impl::onReceiveData(unsigned comp_id, void* pkt, pj_size_t size) { ASSERT_COMP_ID(comp_id, compCount_); + jami_tracepoint_if_enabled(ice_transport_recv, + reinterpret_cast<uint64_t>(this), + comp_id, size, + getRemoteAddress(comp_id).toString().c_str()); if (size == 0) return; @@ -1147,6 +1152,9 @@ void IceTransport::initIceInstance(const IceTransportOptions& options) { pimpl_->initIceInstance(options); + + jami_tracepoint(ice_transport_context, + reinterpret_cast<uint64_t>(this)); } bool @@ -1679,6 +1687,10 @@ IceTransport::send(unsigned compId, const unsigned char* buf, size_t len) if (isTCPEnabled()) dlk.lock(); + jami_tracepoint(ice_transport_send, + reinterpret_cast<uint64_t>(this), + compId, len, remote.toString().c_str()); + auto status = pj_ice_strans_sendto2(pimpl_->icest_, compId, buf, @@ -1686,6 +1698,8 @@ IceTransport::send(unsigned compId, const unsigned char* buf, size_t len) remote.pjPtr(), remote.getLength()); + jami_tracepoint(ice_transport_send_status, status); + if (status == PJ_EPENDING && isTCPEnabled()) { // NOTE; because we are in TCP, the sent size will count the header (2 // bytes length). diff --git a/src/jami/tracepoint-def.h b/src/jami/tracepoint-def.h index 3d2d32f354b51057646de92941dcbb951aaed359..f1d90280d794fd2dae4fefe12e8a36b8c1ddcd1a 100644 --- a/src/jami/tracepoint-def.h +++ b/src/jami/tracepoint-def.h @@ -44,6 +44,63 @@ LTTNG_UST_TRACEPOINT_EVENT( LTTNG_UST_TP_FIELDS(lttng_ust_field_integer(uint64_t, cookie, cookie)) ) +LTTNG_UST_TRACEPOINT_EVENT( + jami, + ice_transport_context, + LTTNG_UST_TP_ARGS( + uint64_t, context + ), + LTTNG_UST_TP_FIELDS( + lttng_ust_field_integer(uint64_t, ice_context, context) + ) +) + +LTTNG_UST_TRACEPOINT_EVENT( + jami, + ice_transport_send, + LTTNG_UST_TP_ARGS( + uint64_t, context, + unsigned, component, + size_t, len, + const char*, remote_addr + ), + LTTNG_UST_TP_FIELDS( + lttng_ust_field_integer(uint64_t, ice_context, context) + lttng_ust_field_integer(unsigned, component, component) + lttng_ust_field_integer(size_t, packet_length, len) + lttng_ust_field_string(remote_addr, remote_addr) + ) +) + +LTTNG_UST_TRACEPOINT_EVENT( + jami, + ice_transport_send_status, + LTTNG_UST_TP_ARGS( + int, status + ), + LTTNG_UST_TP_FIELDS( + lttng_ust_field_integer(int, pj_status, status) + ) +) + +LTTNG_UST_TRACEPOINT_EVENT( + jami, + ice_transport_recv, + LTTNG_UST_TP_ARGS( + uint64_t, context, + unsigned, component, + size_t, len, + const char*, remote_addr + ), + LTTNG_UST_TP_FIELDS( + lttng_ust_field_integer(uint64_t, ice_context, context) + lttng_ust_field_integer(unsigned, component, component) + lttng_ust_field_integer(size_t, packet_length, len) + lttng_ust_field_string(remote_addr, remote_addr) + ) +) + + #endif /* TRACEPOINT_DEF_H */ #include <lttng/tracepoint-event.h>