diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug.h b/hiviewdfx/hidebug/include/hidebug/hidebug.h index 76182c86ac54d313c66d03d7b145608514452a55..90eebc3b715ce2fa748f04d0b03cd35935a85855 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug.h @@ -165,6 +165,21 @@ HiDebug_ErrorCode OH_HiDebug_StopAppTraceCapture(); */ 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. 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, 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 73c566a35f55d60913694822a70b77f8094696ea..bb3a1ed093b5037ac762d616cfcf22f83ed095b7 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h @@ -169,6 +169,23 @@ typedef struct HiDebug_MemoryLimit { uint64_t vssLimit; } HiDebug_MemoryLimit; +/** + * @brief Defines the graphics memory summary structure type. + * + * @since 21 + */ +typedef struct GraphicsMemorySummary { + /** + * GL memory + */ + uint32_t gl; + + /** + * graph memory + */ + uint32_t graph; +} GraphicsMemorySummary; + /** * @brief Enum for trace flag. * @@ -205,32 +222,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 +264,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 */