Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESP32] Added new Matter Traces in esp32 platform for diagnosis #36873

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ee8624e
esp32 diagnostic trace
pimpalemahesh Oct 10, 2024
06ead62
esp32 diagnostic trace changes
pimpalemahesh Oct 25, 2024
6175cdf
example/temperature-measurement-app
pimpalemahesh Nov 14, 2024
1bd882a
backend: Add description for diagnosticstorage interface, remove unnc…
pimpalemahesh Nov 15, 2024
d83dc21
temperature_measurement_app: Review changes
pimpalemahesh Nov 19, 2024
168a5ac
esp32_diagnostic_trace: Review changes
pimpalemahesh Nov 26, 2024
a98b1f8
backend: Replace linkedlist with map for counter diagnostics
pimpalemahesh Nov 21, 2024
51b0772
backend: Pass diagnostic storage as a parameter to backend
pimpalemahesh Nov 27, 2024
3338979
esp32_diagnostic_trace: Return actual data size
pimpalemahesh Dec 1, 2024
321c392
temperature_measurement_app: Review changes
pimpalemahesh Nov 19, 2024
5a80c25
backend: Replace linkedlist with map for counter diagnostics
pimpalemahesh Nov 21, 2024
ec041b9
esp32_diagnostic_trace: add CircularDiagnosticBuffer class to improve…
pimpalemahesh Dec 6, 2024
0befb4f
esp32_diagnostic_trace: add extra tlv closing bytes check before copy…
pimpalemahesh Dec 9, 2024
7e88a79
diagnostic_storage: unify diagnostic entries into a single type
pimpalemahesh Dec 10, 2024
4ce5d09
diagnostic_storage: remove redundant code
pimpalemahesh Dec 10, 2024
48ad096
backend: Remove redundant code, allow only permited value to trace in…
pimpalemahesh Dec 11, 2024
e8db459
example: Remove redundant code
pimpalemahesh Dec 11, 2024
14cceae
esp32: add ble related diagnostics to platform
pimpalemahesh Nov 28, 2024
792af96
esp32: add wifi related diagnostics to platform
pimpalemahesh Nov 28, 2024
fd99413
esp32: add heap related diagnostics to platform
pimpalemahesh Dec 9, 2024
a3e478d
esp32: add freertos task related diagnostics to platform
pimpalemahesh Dec 17, 2024
da1f8b0
restyle changes
pimpalemahesh Dec 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
backend: Remove redundant code, allow only permited value to trace in…
…stant
  • Loading branch information
pimpalemahesh authored and esp committed Dec 11, 2024
commit 48ad096e085a079e120a9ace34cdbcdefec534e0
2 changes: 1 addition & 1 deletion src/tracing/esp32_diagnostic_trace/Counter.cpp
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@
* limitations under the License.
*/

#include <tracing/esp32_diagnostic_trace/Counter.h>
#include <esp_log.h>
#include <tracing/esp32_diagnostic_trace/Counter.h>

namespace chip {
namespace Tracing {
25 changes: 9 additions & 16 deletions src/tracing/esp32_diagnostic_trace/DiagnosticTracing.cpp
Original file line number Diff line number Diff line change
@@ -27,12 +27,6 @@ namespace chip {
namespace Tracing {
namespace Diagnostics {

#define LOG_HEAP_INFO(label, group, entry_exit) \
do \
{ \
ESP_DIAG_EVENT("MTR_TRC", "%s - %s - %s", entry_exit, label, group); \
} while (0)

constexpr size_t kPermitListMaxSize = CONFIG_MAX_PERMIT_LIST_SIZE;
using HashValue = uint32_t;

@@ -72,7 +66,8 @@ HashValue gPermitList[kPermitListMaxSize] = { MurmurHash("PASESession"),
MurmurHash("GeneralCommissioning"),
MurmurHash("OperationalCredentials"),
MurmurHash("CASEServer"),
MurmurHash("Fabric") }; // namespace
MurmurHash("Fabric"),
MurmurHash("Resolver") }; // namespace

bool IsPermitted(const char * str)
{
@@ -149,23 +144,21 @@ void ESP32Diagnostics::TraceBegin(const char * label, const char * group)
}
}

void ESP32Diagnostics::TraceEnd(const char * label, const char * group)
void ESP32Diagnostics::TraceEnd(const char * label, const char * group) {}

void ESP32Diagnostics::TraceInstant(const char * label, const char * value)
{
if (IsPermitted(group))
if (!IsPermitted(value))
{
StoreDiagnostics(label, group);
StoreDiagnostics(label, value);
}
}

void ESP32Diagnostics::TraceInstant(const char * label, const char * group)
{
StoreDiagnostics(label, group);
}

void ESP32Diagnostics::StoreDiagnostics(const char * label, const char * group)
{
Diagnostic<const char *> trace(label, group, esp_log_timestamp());
VerifyOrReturn(mStorageInstance.Store(trace) == CHIP_NO_ERROR, ChipLogError(DeviceLayer, "Failed to store Trace Diagnostic data"));
VerifyOrReturn(mStorageInstance.Store(trace) == CHIP_NO_ERROR,
ChipLogError(DeviceLayer, "Failed to store Trace Diagnostic data"));
}

} // namespace Diagnostics
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ class Scoped
{
public:
inline Scoped(const char * label, const char * group) : mLabel(label), mGroup(group) { MATTER_TRACE_BEGIN(label, group); }
inline ~Scoped() {}
inline ~Scoped() { MATTER_TRACE_END(mLabel, mGroup); }

private:
const char * mLabel;