mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
tracepoint: Add ice-transport tracepoints
Change-Id: I68e28cdaea0a3989b805c1b8dffb5a64e498f206
This commit is contained in:

committed by
Sébastien Blin

parent
2ef0a8af97
commit
a9b95e223d
@ -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).
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user