From 39fbcc475e70b7b80bdded1923aec553d8aea1ee Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Tue, 28 Feb 2017 14:32:08 +1030 Subject: [PATCH] Track call stats of mdp port handlers --- overlay_mdp.c | 4 ++++ overlay_packet.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/overlay_mdp.c b/overlay_mdp.c index 55e3bc1f..36f7834a 100644 --- a/overlay_mdp.c +++ b/overlay_mdp.c @@ -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; } } diff --git a/overlay_packet.h b/overlay_packet.h index f47246d0..7f1e4399 100644 --- a/overlay_packet.h +++ b/overlay_packet.h @@ -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