From ab28f1021eb3a2b594681aebac239ba905e5cb36 Mon Sep 17 00:00:00 2001 From: Marek Niepieklo Date: Mon, 8 Feb 2021 12:57:02 +0100 Subject: [PATCH] [EGD-5664] Fix excessive logging in USB-CDC Remove excessive logging in USB-CDC, which slows down transfer --- module-bsp/board/linux/usb_cdc/usb_cdc.cpp | 24 ++++++++++++++++--- module-bsp/board/rt1051/bsp/usb | 2 +- .../service-desktop/WorkerDesktop.cpp | 3 +-- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/module-bsp/board/linux/usb_cdc/usb_cdc.cpp b/module-bsp/board/linux/usb_cdc/usb_cdc.cpp index 163d0e6edef9963e130fafcf585bde59f3752bf8..b7dd58773ab7bca8a7138219f1f62dab987cc56a 100644 --- a/module-bsp/board/linux/usb_cdc/usb_cdc.cpp +++ b/module-bsp/board/linux/usb_cdc/usb_cdc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include "bsp/usb/usb.hpp" @@ -7,6 +7,25 @@ #include #include +#ifndef DEUBG_USB +#undef LOG_PRINTF +#undef LOG_TRACE +#undef LOG_DEBUG +#undef LOG_INFO +#undef LOG_WARN +#undef LOG_ERROR +#undef LOG_FATAL +#undef LOG_CUSTOM + +#define LOG_PRINTF(...) +#define LOG_TRACE(...) +#define LOG_DEBUG(...) +#define LOG_INFO(...) +#define LOG_WARN(...) +#define LOG_ERROR(...) +#define LOG_FATAL(...) +#define LOG_CUSTOM(loggerLevel, ...) +#endif namespace bsp { int fd; @@ -39,8 +58,7 @@ namespace bsp ssize_t length = read(fd, &inputData[0], SERIAL_BUFFER_LEN); if (length > 0) { - LOG_DEBUG( - "[ServiceDesktop:BSP_Driver] Received: %d signs: [%s]", static_cast(length), inputData); + LOG_DEBUG("[ServiceDesktop:BSP_Driver] Received: %d signs", static_cast(length)); #if USBCDC_ECHO_ENABLED bool usbCdcEchoEnabledPrev = usbCdcEchoEnabled; diff --git a/module-bsp/board/rt1051/bsp/usb b/module-bsp/board/rt1051/bsp/usb index 88b775af153a7020ea998245d2b4fcd4fc16217a..b9c54f6e7bbbcb83b164af02267b31e8f78701ea 160000 --- a/module-bsp/board/rt1051/bsp/usb +++ b/module-bsp/board/rt1051/bsp/usb @@ -1 +1 @@ -Subproject commit 88b775af153a7020ea998245d2b4fcd4fc16217a +Subproject commit b9c54f6e7bbbcb83b164af02267b31e8f78701ea diff --git a/module-services/service-desktop/WorkerDesktop.cpp b/module-services/service-desktop/WorkerDesktop.cpp index b377d1a899bb23c05767bf77aad2bf8e1882ffde..5d7147badff9a9e89542153ed57bdbe400f837a1 100644 --- a/module-services/service-desktop/WorkerDesktop.cpp +++ b/module-services/service-desktop/WorkerDesktop.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include "service-desktop/ServiceDesktop.hpp" @@ -74,7 +74,6 @@ bool WorkerDesktop::handleMessage(uint32_t queueID) return false; } - LOG_DEBUG("handeMessage sending %d bytes using usbCDCSend", static_cast(sendMsg->length())); bsp::usbCDCSend(sendMsg); delete sendMsg; }