diff --git a/components/lwip/api/api_lib.c b/components/lwip/api/api_lib.c index 86ee5576ab..087115f0b9 100755 --- a/components/lwip/api/api_lib.c +++ b/components/lwip/api/api_lib.c @@ -508,8 +508,10 @@ netconn_recv_data(struct netconn *conn, void **new_buf) } #endif /* (LWIP_UDP || LWIP_RAW) */ -#ifdef ESP_PERF - if (len > DBG_PERF_FILTER_LEN) { DBG_PERF_PATH_SET(DBG_PERF_DIR_RX, DBG_PERF_POINT_SOC_IN); } +#if ESP_PERF + if (len > DBG_PERF_FILTER_LEN) { + DBG_PERF_PATH_SET(DBG_PERF_DIR_RX, DBG_PERF_POINT_SOC_IN); + } #endif #if LWIP_SO_RCVBUF diff --git a/components/lwip/api/api_msg.c b/components/lwip/api/api_msg.c index 87e5aeb8e5..878cd289b0 100755 --- a/components/lwip/api/api_msg.c +++ b/components/lwip/api/api_msg.c @@ -202,8 +202,10 @@ recv_udp(void *arg, struct udp_pcb *pcb, struct pbuf *p, #endif /* LWIP_NETBUF_RECVINFO */ } -#ifdef ESP_PERF - if (p->len > DBG_PERF_FILTER_LEN) DBG_PERF_PATH_SET(DBG_PERF_DIR_RX, DBG_PERF_POINT_LWIP_OUT); +#if ESP_PERF + if (p->len > DBG_PERF_FILTER_LEN) { + DBG_PERF_PATH_SET(DBG_PERF_DIR_RX, DBG_PERF_POINT_LWIP_OUT); + } #endif len = p->tot_len; diff --git a/components/lwip/api/sockets.c b/components/lwip/api/sockets.c index c163b3ac0b..7335246eb9 100755 --- a/components/lwip/api/sockets.c +++ b/components/lwip/api/sockets.c @@ -1437,6 +1437,7 @@ lwip_sendto(int s, const void *data, size_t size, int flags, #else /* LWIP_NETIF_TX_SINGLE_PBUF */ err = netbuf_ref(&buf, data, short_size); #endif /* LWIP_NETIF_TX_SINGLE_PBUF */ + if (err == ERR_OK) { DBG_PERF_PATH_SET(DBG_PERF_DIR_TX, DBG_PERF_POINT_SOC_OUT); /* send the data */ diff --git a/components/lwip/api/tcpip.c b/components/lwip/api/tcpip.c index dfb235718b..f3422af706 100755 --- a/components/lwip/api/tcpip.c +++ b/components/lwip/api/tcpip.c @@ -219,7 +219,7 @@ tcpip_inpkt(struct pbuf *p, struct netif *inp, netif_input_fn input_fn) msg->msg.inp.p = p; msg->msg.inp.netif = inp; msg->msg.inp.input_fn = input_fn; -#ifdef ESP_PERF +#if ESP_PERF if (p->len > DBG_PERF_FILTER_LEN) { DBG_PERF_PATH_SET(DBG_PERF_DIR_RX, DBG_PERF_POINT_WIFI_OUT); } diff --git a/components/lwip/netif/ethernet.c b/components/lwip/netif/ethernet.c index 5d618f6a31..90f62583bc 100755 --- a/components/lwip/netif/ethernet.c +++ b/components/lwip/netif/ethernet.c @@ -72,8 +72,10 @@ ethernet_input(struct pbuf *p, struct netif *netif) s16_t ip_hdr_offset = SIZEOF_ETH_HDR; #endif /* LWIP_ARP || ETHARP_SUPPORT_VLAN */ -#ifdef ESP_PERF - if (p->len > DBG_PERF_FILTER_LEN) DBG_PERF_PATH_SET(DBG_PERF_DIR_RX, DBG_PERF_POINT_LWIP_IN); +#if ESP_PERF + if (p->len > DBG_PERF_FILTER_LEN) { + DBG_PERF_PATH_SET(DBG_PERF_DIR_RX, DBG_PERF_POINT_LWIP_IN); + } #endif if (p->len <= SIZEOF_ETH_HDR) {