diff --git a/mongoose.c b/mongoose.c index 20a37233..3b00704c 100644 --- a/mongoose.c +++ b/mongoose.c @@ -6652,14 +6652,15 @@ uint8_t mg_l2_ip6put(enum mg_l2type type, uint8_t *addr, uint8_t *opts); bool mg_l2_poll(struct mg_tcpip_if *ifp, bool expired_1000ms); static void mg_tcpip_call(struct mg_tcpip_if *ifp, int ev, void *ev_data) { -#if MG_ENABLE_PROFILE +#if 0 && MG_ENABLE_PROFILE const char *names[] = {"TCPIP_EV_ST_CHG", "TCPIP_EV_DHCP_DNS", "TCPIP_EV_DHCP_SNTP", "TCPIP_EV_ARP", "TCPIP_EV_TIMER_1S", "TCPIP_EV_WIFI_SCAN_RESULT", "TCPIP_EV_WIFI_SCAN_END", "TCPIP_EV_WIFI_CONNECT_ERR", - "TCPIP_EV_DRIVER", "TCPIP_EV_USER"}; - if (ev != MG_TCPIP_EV_POLL && ev < (int) (sizeof(names) / sizeof(names[0]))) { - MG_PROF_ADD(c, names[ev]); + "TCPIP_EV_DRIVER", "MG_TCPIP_EV_ST6_CHG", + "TCPIP_EV_USER"}; + if (ev != MG_TCPIP_EV_TIMER_1S && ev < (int) (sizeof(names) / sizeof(names[0]))) { + MG_PROF_ADD(ifp, names[ev]); // TODO(): call MG_PROF_DUMP() MG_PROF_FREE() } #endif // Fire protocol handler first, user handler second. See #2559 diff --git a/src/net_builtin.c b/src/net_builtin.c index faca0f31..f81ec450 100644 --- a/src/net_builtin.c +++ b/src/net_builtin.c @@ -210,14 +210,15 @@ uint8_t mg_l2_ip6put(enum mg_l2type type, uint8_t *addr, uint8_t *opts); bool mg_l2_poll(struct mg_tcpip_if *ifp, bool expired_1000ms); static void mg_tcpip_call(struct mg_tcpip_if *ifp, int ev, void *ev_data) { -#if MG_ENABLE_PROFILE +#if 0 && MG_ENABLE_PROFILE const char *names[] = {"TCPIP_EV_ST_CHG", "TCPIP_EV_DHCP_DNS", "TCPIP_EV_DHCP_SNTP", "TCPIP_EV_ARP", "TCPIP_EV_TIMER_1S", "TCPIP_EV_WIFI_SCAN_RESULT", "TCPIP_EV_WIFI_SCAN_END", "TCPIP_EV_WIFI_CONNECT_ERR", - "TCPIP_EV_DRIVER", "TCPIP_EV_USER"}; - if (ev != MG_TCPIP_EV_POLL && ev < (int) (sizeof(names) / sizeof(names[0]))) { - MG_PROF_ADD(c, names[ev]); + "TCPIP_EV_DRIVER", "MG_TCPIP_EV_ST6_CHG", + "TCPIP_EV_USER"}; + if (ev != MG_TCPIP_EV_TIMER_1S && ev < (int) (sizeof(names) / sizeof(names[0]))) { + MG_PROF_ADD(ifp, names[ev]); // TODO(): call MG_PROF_DUMP() MG_PROF_FREE() } #endif // Fire protocol handler first, user handler second. See #2559 diff --git a/src/profile.h b/src/profile.h index 905afd98..2a5381b8 100644 --- a/src/profile.h +++ b/src/profile.h @@ -1,5 +1,6 @@ #pragma once #include "iobuf.h" +#include "util.h" // Macros to record timestamped events that happens with a connection. // They are saved into a c->prof IO buffer, each event is a name and a 32-bit diff --git a/test/mip_x_test.c b/test/mip_x_test.c index 739d75b3..6d3fd4b9 100644 --- a/test/mip_x_test.c +++ b/test/mip_x_test.c @@ -392,8 +392,6 @@ static void test_http_server(struct mg_mgr *mgr) { #endif ASSERT(c != NULL); ASSERT (mg_send(c, "NADA", 0)); // check mg_send allows len=0 - MG_INFO(("%s", cmd)); - MG_INFO(("%p %u %.*s", opts.key.buf, opts.key.len, opts.key.len, opts.key.buf)); pthread_create(&thread_id, NULL, poll_thread, mgr); // simpler this way, no concurrency anyway MG_DEBUG(("CURL"));