Skip to content

Commit

Permalink
Added a config option to set the permit list size for esp32 traces
Browse files Browse the repository at this point in the history
  • Loading branch information
shripad621git committed Feb 9, 2024
1 parent 31903de commit 82990e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 6 additions & 0 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,12 @@ menu "CHIP Device Layer"
default n
help
This option enables the system statistics to be sent to the insights cloud.

config INSIGHTS_TRACE_PERMIT_LIST_SIZE
int "Config option to set permitlist size"
range 5 30
depends on ESP_INSIGHTS_ENABLED
default 20
endmenu


Expand Down
5 changes: 2 additions & 3 deletions src/tracing/esp32_trace/counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

namespace Insights {

/*
*
/**
* This class is used to monotonically increment the counters as per the label of the counter macro
* 'MATTER_TRACE_COUNTER(label)' and report the metrics to esp-insights.
* As per the label of the counter macro, it adds the counter in the linked list with the name label if not
Expand All @@ -37,7 +36,7 @@ class ESPInsightsCounter
{
private:
static ESPInsightsCounter * mHead; // head of the counter list
const char * label; // unique key
const char * label; // unique key ,it is used as a static string.
int instanceCount;
ESPInsightsCounter * mNext; // pointer to point to the next entry in the list
bool registered = false;
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/esp32_trace/esp32_tracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Tracing {
namespace Insights {
namespace {

constexpr size_t kPermitListMaxSize = 20;
constexpr size_t kPermitListMaxSize = CONFIG_INSIGHTS_TRACE_PERMIT_LIST_SIZE;
using HashValue = uint32_t;

// Implements a murmurhash with 0 seed.
Expand Down

0 comments on commit 82990e4

Please sign in to comment.