Skip to content

Commit

Permalink
[ESP32] Added a config option to set the permit list size for esp32 t…
Browse files Browse the repository at this point in the history
…races. (#32035)

* Added a config option to set the permit list size for esp32 traces

- Fixes #31536

* Addressed review comments
  • Loading branch information
shripad621git authored and pull[bot] committed Apr 11, 2024
1 parent 58b540b commit 4421881
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
10 changes: 10 additions & 0 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,16 @@ menu "CHIP Device Layer"
default n
help
This option enables the system statistics to be sent to the insights cloud.

config MAX_PERMIT_LIST_SIZE
int "Set permit list size for Insights traces"
range 5 30
depends on ESP_INSIGHTS_ENABLED
default 20
help
Maximum number of group entries that can be included in the permit list for reporting
the traces to insights.

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 @@ -32,7 +32,7 @@ namespace Tracing {
namespace Insights {
namespace {

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

// Implements a murmurhash with 0 seed.
Expand Down

0 comments on commit 4421881

Please sign in to comment.