diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug.h b/hiviewdfx/hidebug/include/hidebug/hidebug.h index 287cf4433ecb57135baac30af4337b5e5e16ab09..f097a060c55ffb4ec475a46a0a52d46768f6b3e3 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug.h @@ -1,3 +1,4 @@ + /* * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -34,13 +35,10 @@ * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ - #ifndef HIVIEWDFX_HIDEBUG_H #define HIVIEWDFX_HIDEBUG_H - #include #include "hidebug_type.h" - #ifdef __cplusplus extern "C" { #endif // __cplusplus @@ -159,7 +157,7 @@ HiDebug_ErrorCode OH_HiDebug_StopAppTraceCapture(); * @param value Indicates value of graphics memory, in kibibytes. * @return Result code * {@link HIDEBUG_SUCCESS} Get graphics memory success. - * {@link HIDEBUG_INVALID_ARGUMENT} Invalid argument,value is null. + * {@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 14 */ @@ -246,9 +244,24 @@ HiDebug_Backtrace_Object OH_HiDebug_CreateBacktraceObject(void); */ void OH_HiDebug_DestroyBacktraceObject(HiDebug_Backtrace_Object object); +/** + * @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); #ifdef __cplusplus } #endif // __cplusplus -/** @} */ +/** @} */ +/** @} */ #endif // HIVIEWDFX_HIDEBUG_H \ No newline at end of file diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h index 9ff70423aea0c8e2d928491eb5240f253dd0f1bb..0d1b798a45f78da36cabde2b51a45f4452716dfb 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h @@ -185,7 +185,7 @@ typedef enum HiDebug_TraceFlag { * @brief Defines structure type for MallocDispatch table. * * @since 20 - */ +*/ typedef struct HiDebug_MallocDispatch { void* (*malloc)(size_t); void* (*calloc)(size_t, size_t); @@ -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 GraphicsMemorySummary { + /** + * GL memory + */ + uint32_t gl; + + /** + * graph memory + */ + uint32_t graph; +} GraphicsMemorySummary; + #ifdef __cplusplus } #endif // __cplusplus @@ -510,6 +527,7 @@ typedef struct HiDebug_Backtrace_Object__* HiDebug_Backtrace_Object; */ #define HIDEBUG_TRACE_TAG_BLUETOOTH (1ULL << 60) +/** @} */ /** @} */ #endif // HIVIEWDFX_HIDEBUG_TYPE_H \ No newline at end of file