Skip to content
Snippets Groups Projects
Commit a9b95e22 authored by Olivier Dion's avatar Olivier Dion Committed by Sébastien Blin
Browse files

tracepoint: Add ice-transport tracepoints

Change-Id: I68e28cdaea0a3989b805c1b8dffb5a64e498f206
parent 2ef0a8af
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "upnp/upnp_control.h" #include "upnp/upnp_control.h"
#include "transport/peer_channel.h" #include "transport/peer_channel.h"
#include "jami/callmanager_interface.h" #include "jami/callmanager_interface.h"
#include "tracepoint.h"
#include <pjlib.h> #include <pjlib.h>
...@@ -1096,6 +1097,10 @@ IceTransport::Impl::onReceiveData(unsigned comp_id, void* pkt, pj_size_t size) ...@@ -1096,6 +1097,10 @@ IceTransport::Impl::onReceiveData(unsigned comp_id, void* pkt, pj_size_t size)
{ {
ASSERT_COMP_ID(comp_id, compCount_); 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) if (size == 0)
return; return;
...@@ -1147,6 +1152,9 @@ void ...@@ -1147,6 +1152,9 @@ void
IceTransport::initIceInstance(const IceTransportOptions& options) IceTransport::initIceInstance(const IceTransportOptions& options)
{ {
pimpl_->initIceInstance(options); pimpl_->initIceInstance(options);
jami_tracepoint(ice_transport_context,
reinterpret_cast<uint64_t>(this));
} }
bool bool
...@@ -1679,6 +1687,10 @@ IceTransport::send(unsigned compId, const unsigned char* buf, size_t len) ...@@ -1679,6 +1687,10 @@ IceTransport::send(unsigned compId, const unsigned char* buf, size_t len)
if (isTCPEnabled()) if (isTCPEnabled())
dlk.lock(); 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_, auto status = pj_ice_strans_sendto2(pimpl_->icest_,
compId, compId,
buf, buf,
...@@ -1686,6 +1698,8 @@ IceTransport::send(unsigned compId, const unsigned char* buf, size_t len) ...@@ -1686,6 +1698,8 @@ IceTransport::send(unsigned compId, const unsigned char* buf, size_t len)
remote.pjPtr(), remote.pjPtr(),
remote.getLength()); remote.getLength());
jami_tracepoint(ice_transport_send_status, status);
if (status == PJ_EPENDING && isTCPEnabled()) { if (status == PJ_EPENDING && isTCPEnabled()) {
// NOTE; because we are in TCP, the sent size will count the header (2 // NOTE; because we are in TCP, the sent size will count the header (2
// bytes length). // bytes length).
......
...@@ -44,6 +44,63 @@ LTTNG_UST_TRACEPOINT_EVENT( ...@@ -44,6 +44,63 @@ LTTNG_UST_TRACEPOINT_EVENT(
LTTNG_UST_TP_FIELDS(lttng_ust_field_integer(uint64_t, cookie, cookie)) 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 */ #endif /* TRACEPOINT_DEF_H */
#include <lttng/tracepoint-event.h> #include <lttng/tracepoint-event.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment