Track call stats of mdp port handlers

This commit is contained in:
Jeremy Lakeman 2017-02-28 14:32:08 +10:30
parent 9ec46f2279
commit 39fbcc475e
2 changed files with 7 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -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