From 0ce8f9632caff56a29cbb796954ab3fa2c5975e2 Mon Sep 17 00:00:00 2001 From: lucicop Date: Fri, 22 Jul 2022 21:33:49 +0300 Subject: [PATCH] Add function to reset heap high watermarks (#21105) --- src/platform/qpg/DiagnosticDataProviderImpl.cpp | 6 ++++++ src/platform/qpg/DiagnosticDataProviderImpl.h | 2 ++ third_party/qpg_sdk/qpg_executable.gni | 4 ++-- third_party/qpg_sdk/repo | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/platform/qpg/DiagnosticDataProviderImpl.cpp b/src/platform/qpg/DiagnosticDataProviderImpl.cpp index bde10b3cac0d71..e8b056879149df 100644 --- a/src/platform/qpg/DiagnosticDataProviderImpl.cpp +++ b/src/platform/qpg/DiagnosticDataProviderImpl.cpp @@ -69,6 +69,12 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & cu return CHIP_NO_ERROR; } +CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks() +{ + qvCHIP_ResetHeapStats(); + return CHIP_NO_ERROR; +} + DiagnosticDataProvider & GetDiagnosticDataProviderImpl() { return DiagnosticDataProviderImpl::GetDefaultInstance(); diff --git a/src/platform/qpg/DiagnosticDataProviderImpl.h b/src/platform/qpg/DiagnosticDataProviderImpl.h index ab6e1ed09bb8d4..d4d0c47224b5f7 100644 --- a/src/platform/qpg/DiagnosticDataProviderImpl.h +++ b/src/platform/qpg/DiagnosticDataProviderImpl.h @@ -39,9 +39,11 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider // ===== Methods that implement the PlatformManager abstract interface. + bool SupportsWatermarks() override { return true; } CHIP_ERROR GetCurrentHeapFree(uint64_t & currentHeapFree) override; CHIP_ERROR GetCurrentHeapUsed(uint64_t & currentHeapUsed) override; CHIP_ERROR GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) override; + CHIP_ERROR ResetWatermarks() override; }; /** diff --git a/third_party/qpg_sdk/qpg_executable.gni b/third_party/qpg_sdk/qpg_executable.gni index 454040e25d728f..4950939182b1b4 100644 --- a/third_party/qpg_sdk/qpg_executable.gni +++ b/third_party/qpg_sdk/qpg_executable.gni @@ -97,7 +97,7 @@ template("qpg_executable") { gen_ota_header("$executable_target_name.ota") { ota_header_script_name = "${root_out_dir}/${executable_target_name}.ota" out_dir = rebase_path(root_out_dir, root_build_dir) - ota_header_generator = "${qpg_sdk_root}/Tools/ota/generate_ota_img.py" + ota_header_generator = "${qpg_sdk_root}/Tools/Ota/generate_ota_img.py" ota_header_options = [ string_join("=", @@ -119,7 +119,7 @@ template("qpg_executable") { [ "--pem_file_path", rebase_path(qpg_sdk_root, root_build_dir) + - "/Tools/ota/example_private_key.pem.example", + "/Tools/Ota/example_private_key.pem.example", ]), "--pem_password=test1234", "--sign", diff --git a/third_party/qpg_sdk/repo b/third_party/qpg_sdk/repo index fa660d1762c709..35ccb383fb401a 160000 --- a/third_party/qpg_sdk/repo +++ b/third_party/qpg_sdk/repo @@ -1 +1 @@ -Subproject commit fa660d1762c70938430d058f5830777770356bbd +Subproject commit 35ccb383fb401ad8ed02162a33915b1dff2af9d0