mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-08 16:11:18 +00:00
Merge pull request #3544 from cesanta/profile
disable ifc profiling wip code, fix debug leftovers
This commit is contained in:
4 files changed
+11
-10
No files matched your search
+5
-4
@@ -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);
|
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) {
|
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",
|
const char *names[] = {"TCPIP_EV_ST_CHG", "TCPIP_EV_DHCP_DNS",
|
||||||
"TCPIP_EV_DHCP_SNTP", "TCPIP_EV_ARP",
|
"TCPIP_EV_DHCP_SNTP", "TCPIP_EV_ARP",
|
||||||
"TCPIP_EV_TIMER_1S", "TCPIP_EV_WIFI_SCAN_RESULT",
|
"TCPIP_EV_TIMER_1S", "TCPIP_EV_WIFI_SCAN_RESULT",
|
||||||
"TCPIP_EV_WIFI_SCAN_END", "TCPIP_EV_WIFI_CONNECT_ERR",
|
"TCPIP_EV_WIFI_SCAN_END", "TCPIP_EV_WIFI_CONNECT_ERR",
|
||||||
"TCPIP_EV_DRIVER", "TCPIP_EV_USER"};
|
"TCPIP_EV_DRIVER", "MG_TCPIP_EV_ST6_CHG",
|
||||||
if (ev != MG_TCPIP_EV_POLL && ev < (int) (sizeof(names) / sizeof(names[0]))) {
|
"TCPIP_EV_USER"};
|
||||||
MG_PROF_ADD(c, names[ev]);
|
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
|
#endif
|
||||||
// Fire protocol handler first, user handler second. See #2559
|
// Fire protocol handler first, user handler second. See #2559
|
||||||
|
|||||||
+5
-4
@@ -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);
|
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) {
|
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",
|
const char *names[] = {"TCPIP_EV_ST_CHG", "TCPIP_EV_DHCP_DNS",
|
||||||
"TCPIP_EV_DHCP_SNTP", "TCPIP_EV_ARP",
|
"TCPIP_EV_DHCP_SNTP", "TCPIP_EV_ARP",
|
||||||
"TCPIP_EV_TIMER_1S", "TCPIP_EV_WIFI_SCAN_RESULT",
|
"TCPIP_EV_TIMER_1S", "TCPIP_EV_WIFI_SCAN_RESULT",
|
||||||
"TCPIP_EV_WIFI_SCAN_END", "TCPIP_EV_WIFI_CONNECT_ERR",
|
"TCPIP_EV_WIFI_SCAN_END", "TCPIP_EV_WIFI_CONNECT_ERR",
|
||||||
"TCPIP_EV_DRIVER", "TCPIP_EV_USER"};
|
"TCPIP_EV_DRIVER", "MG_TCPIP_EV_ST6_CHG",
|
||||||
if (ev != MG_TCPIP_EV_POLL && ev < (int) (sizeof(names) / sizeof(names[0]))) {
|
"TCPIP_EV_USER"};
|
||||||
MG_PROF_ADD(c, names[ev]);
|
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
|
#endif
|
||||||
// Fire protocol handler first, user handler second. See #2559
|
// Fire protocol handler first, user handler second. See #2559
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "iobuf.h"
|
#include "iobuf.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
// Macros to record timestamped events that happens with a connection.
|
// 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
|
// They are saved into a c->prof IO buffer, each event is a name and a 32-bit
|
||||||
|
|||||||
@@ -392,8 +392,6 @@ static void test_http_server(struct mg_mgr *mgr) {
|
|||||||
#endif
|
#endif
|
||||||
ASSERT(c != NULL);
|
ASSERT(c != NULL);
|
||||||
ASSERT (mg_send(c, "NADA", 0)); // check mg_send allows len=0
|
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,
|
pthread_create(&thread_id, NULL, poll_thread,
|
||||||
mgr); // simpler this way, no concurrency anyway
|
mgr); // simpler this way, no concurrency anyway
|
||||||
MG_DEBUG(("CURL"));
|
MG_DEBUG(("CURL"));
|
||||||
|
|||||||
Reference in new issue
Block a user