mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-04-07 19:14:17 +00:00
Track call stats of mdp port handlers
This commit is contained in:
parent
9ec46f2279
commit
39fbcc475e
@ -639,7 +639,11 @@ static int overlay_saw_mdp_frame(
|
||||
struct internal_binding *binding;
|
||||
for (binding = SECTION_START(bindings); binding < SECTION_END(bindings); ++binding) {
|
||||
if (binding->port == header->destination_port){
|
||||
struct call_stats call_stats;
|
||||
call_stats.totals = &binding->stats;
|
||||
fd_func_enter(__HERE__, &call_stats);
|
||||
binding->function(header, payload);
|
||||
fd_func_exit(__HERE__, &call_stats);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "feature.h"
|
||||
#include "overlay_address.h"
|
||||
#include "section.h"
|
||||
#include "fdqueue.h"
|
||||
|
||||
#define FRAME_NOT_SENT -1
|
||||
#define FRAME_DONT_SEND -2
|
||||
@ -139,6 +140,7 @@ int _overlay_send_frame(struct __sourceloc whence, struct internal_mdp_header *h
|
||||
struct internal_binding{
|
||||
mdp_port_t port;
|
||||
int (*function)(struct internal_mdp_header *header, struct overlay_buffer *payload);
|
||||
struct profile_total stats;
|
||||
};
|
||||
|
||||
DECLARE_SECTION(struct internal_binding, bindings);
|
||||
@ -149,6 +151,7 @@ DECLARE_SECTION(struct internal_binding, bindings);
|
||||
static struct internal_binding BIND ## FUNC IN_SECTION(bindings) = { \
|
||||
.port = PORT, \
|
||||
.function = FUNC, \
|
||||
.stats.name = #FUNC, \
|
||||
}
|
||||
|
||||
#endif //__SERVAL_DNA__OVERLAY_PACKET_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user