From 0802c5fb75ce4b953ab881631e21f41d0b0487bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=B5=B7=E9=94=8B?= Date: Sat, 26 Jul 2025 15:24:47 +0800 Subject: [PATCH 1/3] =?UTF-8?q?HiDebug=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=9B=BE=E5=BD=A2=E5=86=85=E5=AD=98=E6=A6=82=E8=A6=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周海锋 --- hiviewdfx/hidebug/include/hidebug/hidebug.h | 30 +++++++++++++++++++ .../hidebug/include/hidebug/hidebug_type.h | 29 +++++++++++------- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug.h b/hiviewdfx/hidebug/include/hidebug/hidebug.h index 76182c86a..0a2e49c4f 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug.h @@ -165,6 +165,36 @@ HiDebug_ErrorCode OH_HiDebug_StopAppTraceCapture(); */ HiDebug_ErrorCode OH_HiDebug_GetGraphicsMemory(uint32_t *value); +/** + * @brief Create the graphics memory summary of application. + * + * @param summary Indicates value of graphics memory summary, in kibibytes. + * @param forceRefresh Whether to bypass the cache and retrieve fresh data. + * @return Result code + * {@link HIDEBUG_SUCCESS} Get graphics memory success. + * {@link HIDEBUG_INVALID_ARGUMENT} Invalid argument,value is null. + * {@link HIDEBUG_TRACE_ABNORMAL} Failed to get the application memory due to a remote exception. + * @since 21 + */ +HiDebug_ErrorCode OH_HiDebug_CreateGraphicsMemorySummary(GraphicsMemorySummary **summary, bool forceRefresh); + +/** + * @brief Get the graphics memory category of application. + * + * @param summary Indicates value of graphics memory summary, in kibibytes. + * @param category Indicates category of graphics memory. + * @since 21 + */ +void OH_HiDebug_GetGraphicsMemoryCategory(GraphicsMemorySummary *summary, const char *category); + +/** + * @brief Destory the graphics memory summary of application. + * + * @param summary Indicates value of graphics memory summary, in kibibytes. + * @since 21 + */ +void OH_HiDebug_DestroyGraphicsMemorySummary(GraphicsMemorySummary **summary); + /** * @brief Replace MallocDispatch table with developer-defined memory allocation functions. * diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h index 73c566a35..c0a1b70b7 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h @@ -169,6 +169,13 @@ typedef struct HiDebug_MemoryLimit { uint64_t vssLimit; } HiDebug_MemoryLimit; +/** + * @brief Defines the graphics memory summary handle. + * + * @since 21 + */ +typedef struct GraphicsMemorySummary GraphicsMemorySummary; + /** * @brief Enum for trace flag. * @@ -205,32 +212,32 @@ typedef struct HiDebug_JsStackFrame { * The pc relative to the start of current file in /proc/self/maps */ uint64_t relativePc; - + /** * The line number of the source code from url */ int32_t line; - + /** * The column number of the source code from url */ int32_t column; - + /** * The name parsed by pc from /proc/self/maps, maybe NULL */ const char* mapName; - + /** * The functionName of current frame, maybe NULL */ const char* functionName; - + /** * The url of current frame, maybe NULL */ const char* url; - + /** * The packageName of current frame, maybe NULL */ @@ -247,27 +254,27 @@ typedef struct HiDebug_NativeStackFrame { * The pc relative to the start of current file in /proc/self/maps */ uint64_t relativePc; - + /** * The pc relative to the start of current function */ uint64_t funcOffset; - + /** * The name parsed by pc from /proc/self/maps */ const char* mapName; - + /** * The functionName parsed by relativePc from symbol table in elf, maybe NULL */ const char* functionName; - + /** * The buildId parsed from .note.gnu.build-id in elf, maybe NULL */ const char* buildId; - + /** * Reserved, maybe NULL */ -- Gitee From 6502473b4d4adebe0f7700cde5e776550cbc0168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=B5=B7=E9=94=8B?= Date: Mon, 28 Jul 2025 16:30:52 +0800 Subject: [PATCH 2/3] =?UTF-8?q?HiDebug=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=9B=BE=E5=BD=A2=E5=86=85=E5=AD=98=E6=A6=82=E8=A6=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周海锋 --- hiviewdfx/hidebug/include/hidebug/hidebug.h | 22 +++---------------- .../hidebug/include/hidebug/hidebug_type.h | 14 ++++++++++-- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug.h b/hiviewdfx/hidebug/include/hidebug/hidebug.h index 0a2e49c4f..f7907bf81 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug.h @@ -168,32 +168,16 @@ HiDebug_ErrorCode OH_HiDebug_GetGraphicsMemory(uint32_t *value); /** * @brief Create the graphics memory summary of application. * + * @param interval If the cache of graphics memory is older than interval (unit: second), than the latest + * graphics memory data will be obtained. * @param summary Indicates value of graphics memory summary, in kibibytes. - * @param forceRefresh Whether to bypass the cache and retrieve fresh data. * @return Result code * {@link HIDEBUG_SUCCESS} Get graphics memory success. * {@link HIDEBUG_INVALID_ARGUMENT} Invalid argument,value is null. * {@link HIDEBUG_TRACE_ABNORMAL} Failed to get the application memory due to a remote exception. * @since 21 */ -HiDebug_ErrorCode OH_HiDebug_CreateGraphicsMemorySummary(GraphicsMemorySummary **summary, bool forceRefresh); - -/** - * @brief Get the graphics memory category of application. - * - * @param summary Indicates value of graphics memory summary, in kibibytes. - * @param category Indicates category of graphics memory. - * @since 21 - */ -void OH_HiDebug_GetGraphicsMemoryCategory(GraphicsMemorySummary *summary, const char *category); - -/** - * @brief Destory the graphics memory summary of application. - * - * @param summary Indicates value of graphics memory summary, in kibibytes. - * @since 21 - */ -void OH_HiDebug_DestroyGraphicsMemorySummary(GraphicsMemorySummary **summary); +HiDebug_ErrorCode OH_HiDebug_GetGraphicsMemorySummary(uint32_t interval, GraphicsMemorySummary *summary); /** * @brief Replace MallocDispatch table with developer-defined memory allocation functions. diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h index c0a1b70b7..bb3a1ed09 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h @@ -170,11 +170,21 @@ typedef struct HiDebug_MemoryLimit { } HiDebug_MemoryLimit; /** - * @brief Defines the graphics memory summary handle. + * @brief Defines the graphics memory summary structure type. * * @since 21 */ -typedef struct GraphicsMemorySummary GraphicsMemorySummary; +typedef struct GraphicsMemorySummary { + /** + * GL memory + */ + uint32_t gl; + + /** + * graph memory + */ + uint32_t graph; +} GraphicsMemorySummary; /** * @brief Enum for trace flag. -- Gitee From 90f376f492805e7a5bdbd3fb4e777940fc05465f Mon Sep 17 00:00:00 2001 From: blueshame Date: Wed, 6 Aug 2025 15:57:27 +0800 Subject: [PATCH 3/3] =?UTF-8?q?HiDebug=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=9B=BE=E5=BD=A2=E5=86=85=E5=AD=98=E6=A6=82=E8=A6=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: blueshame --- hiviewdfx/hidebug/include/hidebug/hidebug.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug.h b/hiviewdfx/hidebug/include/hidebug/hidebug.h index f7907bf81..90eebc3b7 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug.h @@ -169,7 +169,8 @@ HiDebug_ErrorCode OH_HiDebug_GetGraphicsMemory(uint32_t *value); * @brief Create the graphics memory summary of application. * * @param interval If the cache of graphics memory is older than interval (unit: second), than the latest - * graphics memory data will be obtained. + * graphics memory data will be obtained. The interval value range is 2 seconds to + * 3600 seconds, If interval is an invalid value, the default value is 300 seconds. * @param summary Indicates value of graphics memory summary, in kibibytes. * @return Result code * {@link HIDEBUG_SUCCESS} Get graphics memory success. -- Gitee