| add hidumper --mem pid -t timeInterval Signed-off-by: yu-tengao <yutengao3@huawei.com> | 1 年前 |
| update docs Signed-off-by: shawn_he <shawn.he@huawei.com> | 4 年前 |
| fix(hidumper): reorder UTs sequentially and remove unnecessary comment - Move MemoryDumperTest021-026 before MemoryUtilTest001 for sequential ordering (001-026 continuous) - Remove '// decimal base' comment on const int base Co-Authored-By: Agent Signed-off-by: denganliang <denganliang3@h-partners.com> Change-Id: Ie62729afc506f6f2ebce5a8aa7971a7b6593e6b5 | 19 天前 |
| Description:add ScanOrphanVnodeOverLimit interface Signed-off-by: EurusHomles-zH <zhouhang65@huawei.com> | 1 个月前 |
| fix(hidumper): lock g_pluginMutex in CollectGpumem and avoid silent empty GPU section CollectGpumem accessed the global function pointer g_createPluginFn without g_pluginMutex, while its sibling QueryMemInfo holds the lock for its whole body. This is an unconditional data race (UB) on a shared global and a reachable use-after-free across concurrent hidumper --mem --show-gpumem calls: a thread whose LoadPlugin failed (no refcount) can read a non-null g_createPluginFn set by another thread's successful LoadPlugin, then call it after that thread's UnloadPlugin has dlclose'd the .so. This is the same crash pattern that 0d21bed added g_pluginMutex to fix; CollectGpumem was the one unlocked path left out. Reachability note: this path is only reachable on products where hidumper_hiviewdfx_plugin_enable=ON (i.e. global_parts_info. hmoshiviewdfx_profiler_ext is defined), because that GN flag gates the --show-gpumem CLI option via #ifdef in dump_implement.cpp. On products where the plugin is not enabled showGpumem is always false and GetGpumem early-returns; these changes are dead code there but harmless and correct where the race is real. Changes: - CollectGpumem: hold g_pluginMutex across the g_createPluginFn read and call (mirror QueryMemInfo), closing the TOCTOU/UAF window and the non-atomic read UB. With the lock in place, even a failed-load instance is safe (read+call under lock; UnloadPlugin's dlclose is mutually excluded), so no separate LoadPlugin-return-value gate is needed. - GetGpumem: call CollectGpumem before pushing the "GPU:" title and emit an in-band "Error [RUNTIME]: gpumem plugin is not loaded; --show-gpumem is unavailable." hint when it returns empty (mirrors the Error [CATEGORY]: convention in dump_implement.cpp), instead of a silent title-only empty section (regression after !780 reverted PR#728's in-tree /dev/bbox collector). - Tests (test/unittest/common/BUILD.gn now defines HIDUMPER_HIVIEWDFX_PLUGIN_ENABLE on the HidumperMemoryTest target to mirror the production build flag, so #ifdef in the test file tracks whether the plugin is enabled rather than always taking #else as before): - MemoryInfo017: relax ASSERT_TRUE(GetGpumem return) to a content- based ASSERT_FALSE(result->empty()), since GetGpumem now returns false when the plugin is unavailable (would break on devices where the .so is absent). - MemoryInfo018: HDMP-001 race regression guard. Concurrent LoadPlugin/UnloadPlugin (writers of g_createPluginFn, dlclose of the .so) race with CollectGpumem (reader, now locked). The previous form called the broad GetMemoryInfoByPid concurrently and aborted in CollectProcessMemoryDetail (an unrelated non-thread-safe collector); the narrowed form isolates the GPU plugin path and reproduces the actual fix-targeted race. Where the plugin .so is absent LoadPlugin is a failed-dlopen no-op and the test passes trivially; where the .so is deployed it exercises the real race. - MemoryInfo019: GetGpumem(showGpumem=false) early-return branch. - MemoryInfo020: GetGpumem(showGpumem=true); branch on the build-time HIDUMPER_HIVIEWDFX_PLUGIN_ENABLE macro to assert by whether the plugin is loaded. When the plugin is enabled (macro defined), query the pid of com.ohos.sceneboard (the GPU-holding process; init pid 1 holds no GPU memory, so collectGpumem(1) legitimately returns empty and would false-fail ASSERT_TRUE(res)), expect res==true with a ["GPU:"] title row followed by the data rows the plugin's collectGpumem returned. A plugin-enabled product whose .so is not deployed/loadable makes res==false and is treated as a failure (real deployment bug). If sceneboard is not running (virt/headless), the GPU path cannot be exercised and the test is skipped. When the plugin is not enabled (macro undefined), expect res==false with an "Error [RUNTIME]" in-band hint. Verified locally where the plugin is not enabled (rk3568, .so absent, #else branch): MemoryInfo020 passes on device. The #if branch was compile-checked by temporarily forcing the macro on for the HidumperMemoryTest target. Signed-off-by: denganliang <denganliang3@h-partners.com> Change-Id: Ia6aceec823d5349ea481ba4f11d1ea725b9e6082 | 27 天前 |
| add hidumper plugin Signed-off-by: 王俊龙 <wangjunlong8@h-partners.com> | 7 个月前 |
| Description:add ScanOrphanVnodeOverLimit interface Signed-off-by: EurusHomles-zH <zhouhang65@huawei.com> | 1 个月前 |
| fix(hidumper): reorder UTs sequentially and remove unnecessary comment - Move MemoryDumperTest021-026 before MemoryUtilTest001 for sequential ordering (001-026 continuous) - Remove '// decimal base' comment on const int base Co-Authored-By: Agent Signed-off-by: denganliang <denganliang3@h-partners.com> Change-Id: Ie62729afc506f6f2ebce5a8aa7971a7b6593e6b5 | 19 天前 |
| fix: add pac_ret to hidumper_client dependencies zidl_client and utils are dependencies of hidumper_client which has branch_protector_ret = pac_ret configured. Add the same configuration to these source targets to ensure consistent PAC branch protection. Co-Authored-By: Agent Signed-off-by: denganliang <denganliang3@h-partners.com> Change-Id: I6f9a1b9236ebbf2e451072d6ca51f324c0196323 | 3 个月前 |
| update hidumper code Signed-off-by: lutao <lutao31@huawei.com> | 4 年前 |
| add hidumper plugin Signed-off-by: 王俊龙 <wangjunlong8@h-partners.com> | 7 个月前 |
| Signed-off-by: yangjunpeng4@huawei.com <yangjunpeng4@huawei.com> | 3 年前 |
| update hidumper code Signed-off-by: lutao <lutao31@huawei.com> | 4 年前 |
| update hidumper code Signed-off-by: lutao <lutao31@huawei.com> | 4 年前 |
| add hidumper gpumem Signed-off-by: yutengao1987 <yutengao3@h-partners.com> | 5 个月前 |
| add hidumper gpumem Signed-off-by: yutengao1987 <yutengao3@h-partners.com> | 5 个月前 |
| fix: add bounds_checking_function dependency for targets using securec.h 部分 BUILD.gn target 的 .cpp 源码显式 include 了 securec.h, 但这些 target 仅声明了 c_utils:utils 依赖,未显式声明 bounds_checking_function:libsec_shared。按部件自查规则补充该依赖。 变更内容: - bundle.json: deps.components 增加 bounds_checking_function - frameworks/native/BUILD.gn: dump_main、dump_framework、hidumperclient_source - services/BUILD.gn: hidumperservice_source、hidumperservice_cpu_source、 hidumperservice_cpu_source_test、hidumpermemory_source - interfaces/innerkits/BUILD.gn: lib_dump_usage - test/unittest/common/BUILD.gn: HidumperServiceTest、MemoryDumperTest、 HidumperInnerkitsTest Co-Authored-By: Agent Signed-off-by: denganliang <denganliang3@h-partners.com> Change-Id: Id08494afbad24ae04b0a6f72f0163addef72af66 | 2 个月前 |
| fix: 使用profiler_ext装配条件控制hidumper插件使能 将hidumper_hiviewdfx_plugin_enable的装配判断条件从 hmoshiviewdfx_programable_kernel_engine改为hmoshiviewdfx_profiler_ext, 使插件装配与profiler_ext部件关联。 Co-Authored-By: Agent Signed-off-by: denganliang <denganliang3@h-partners.com> Change-Id: I4c038c36461880327ab6ce7ab8b3622aa0f73bac | 2 个月前 |
| update hisysevent for hidumper Signed-off-by: lixing0101 <lixing141@huawei.com> | 1 年前 |