diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug.h b/hiviewdfx/hidebug/include/hidebug/hidebug.h index 287cf4433ecb57135baac30af4337b5e5e16ab09..242377c99bee37f2a6ca60dfde3942142c03ac14 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug.h @@ -246,6 +246,21 @@ HiDebug_Backtrace_Object OH_HiDebug_CreateBacktraceObject(void); */ void OH_HiDebug_DestroyBacktraceObject(HiDebug_Backtrace_Object object); +/** + * @brief Obtain the graphics memory summary of application. + * + * @param interval If the cache of graphics memory is longer than interval (unit: second), the latest + * 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. + * {@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_GetGraphicsMemorySummary(uint32_t interval, HiDebug_GraphicsMemorySummary *summary); + #ifdef __cplusplus } #endif // __cplusplus diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h index 9ff70423aea0c8e2d928491eb5240f253dd0f1bb..ce767a08e1416ccb1a5b40bca21d2a227028556c 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h @@ -313,6 +313,23 @@ typedef struct HiDebug_StackFrame { */ typedef struct HiDebug_Backtrace_Object__* HiDebug_Backtrace_Object; +/** + * @brief Defines the graphics memory summary structure type. + * + * @since 21 + */ +typedef struct HiDebug_GraphicsMemorySummary { + /** + * GL memory + */ + uint32_t gl; + + /** + * graph memory + */ + uint32_t graph; +} HiDebug_GraphicsMemorySummary; + #ifdef __cplusplus } #endif // __cplusplus diff --git a/hiviewdfx/hidebug/libhidebug.ndk.json b/hiviewdfx/hidebug/libhidebug.ndk.json index ec903bef43d1816bcbdb4de6e13b97b4f3172e82..ac8921126918a48846216aac0ac941a056632422 100644 --- a/hiviewdfx/hidebug/libhidebug.ndk.json +++ b/hiviewdfx/hidebug/libhidebug.ndk.json @@ -43,6 +43,10 @@ "first_introduced": "14", "name": "OH_HiDebug_GetGraphicsMemory" }, + { + "first_introduced": "21", + "name": "OH_HiDebug_GetGraphicsMemorySummary" + }, { "first_introduced": "20", "name": "OH_HiDebug_SetMallocDispatchTable"