Skip to content

Commit 088b67a

Browse files
[ESP32] Added a config option to set the permit list size for esp32 traces. (project-chip#32035)
* Added a config option to set the permit list size for esp32 traces - Fixes project-chip#31536 * Addressed review comments
1 parent 1e5212d commit 088b67a

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

config/esp32/components/chip/Kconfig

+10
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,16 @@ menu "CHIP Device Layer"
966966
default n
967967
help
968968
This option enables the system statistics to be sent to the insights cloud.
969+
970+
config MAX_PERMIT_LIST_SIZE
971+
int "Set permit list size for Insights traces"
972+
range 5 30
973+
depends on ESP_INSIGHTS_ENABLED
974+
default 20
975+
help
976+
Maximum number of group entries that can be included in the permit list for reporting
977+
the traces to insights.
978+
969979
endmenu
970980

971981

src/tracing/esp32_trace/counter.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424

2525
namespace Insights {
2626

27-
/*
28-
*
27+
/**
2928
* This class is used to monotonically increment the counters as per the label of the counter macro
3029
* 'MATTER_TRACE_COUNTER(label)' and report the metrics to esp-insights.
3130
* As per the label of the counter macro, it adds the counter in the linked list with the name label if not
@@ -37,7 +36,7 @@ class ESPInsightsCounter
3736
{
3837
private:
3938
static ESPInsightsCounter * mHead; // head of the counter list
40-
const char * label; // unique key
39+
const char * label; // unique key ,it is used as a static string.
4140
int instanceCount;
4241
ESPInsightsCounter * mNext; // pointer to point to the next entry in the list
4342
bool registered = false;

src/tracing/esp32_trace/esp32_tracing.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace Tracing {
3232
namespace Insights {
3333
namespace {
3434

35-
constexpr size_t kPermitListMaxSize = 20;
35+
constexpr size_t kPermitListMaxSize = CONFIG_MAX_PERMIT_LIST_SIZE;
3636
using HashValue = uint32_t;
3737

3838
// Implements a murmurhash with 0 seed.

0 commit comments

Comments
 (0)