From 4a07141dc1f25a9524aa3a175ba3ad23ca8d2a47 Mon Sep 17 00:00:00 2001 From: anderskov Date: Tue, 28 Jun 2022 10:21:33 +0800 Subject: [PATCH] enhance process_plugin Signed-off-by: anderskov --- OAT.xml | 2 + device/BUILD.gn | 1 + device/ohos_test.xml | 19 +- .../include/process_data_plugin.h | 48 +- .../src/process_data_plugin.cpp | 406 +++++++++++++++-- device/plugins/process_plugin/test/BUILD.gn | 56 +++ .../test/resources/proc/11/cmdline | 1 + .../process_plugin/test/resources/proc/11/io | 7 + .../test/resources/proc/11/smaps_rollup | 21 + .../test/resources/proc/11/stat | 1 + .../test/resources/proc/11/status | 37 ++ .../test/resources/proc/11/task/11/cmdline | 1 + .../test/resources/proc/1872/cmdline | 1 + .../test/resources/proc/1872/io | 7 + .../test/resources/proc/1872/smaps_rollup | 21 + .../test/resources/proc/1872/stat | 1 + .../test/resources/proc/1872/status | 37 ++ .../resources/proc/1872/task/1872/cmdline | 1 + .../resources/proc/1872/task/1873/cmdline | 1 + .../resources/proc/1872/task/1965/cmdline | 1 + .../process_plugin/test/resources/proc/stat | 14 + .../test/unittest/process_plugin_unittest.cpp | 410 ++++++++++++++++++ .../process_data/process_plugin_config.proto | 3 + .../process_data/process_plugin_result.proto | 27 ++ 24 files changed, 1055 insertions(+), 69 deletions(-) create mode 100755 device/plugins/process_plugin/test/BUILD.gn create mode 100755 device/plugins/process_plugin/test/resources/proc/11/cmdline create mode 100755 device/plugins/process_plugin/test/resources/proc/11/io create mode 100755 device/plugins/process_plugin/test/resources/proc/11/smaps_rollup create mode 100755 device/plugins/process_plugin/test/resources/proc/11/stat create mode 100755 device/plugins/process_plugin/test/resources/proc/11/status create mode 100755 device/plugins/process_plugin/test/resources/proc/11/task/11/cmdline create mode 100755 device/plugins/process_plugin/test/resources/proc/1872/cmdline create mode 100755 device/plugins/process_plugin/test/resources/proc/1872/io create mode 100755 device/plugins/process_plugin/test/resources/proc/1872/smaps_rollup create mode 100755 device/plugins/process_plugin/test/resources/proc/1872/stat create mode 100755 device/plugins/process_plugin/test/resources/proc/1872/status create mode 100755 device/plugins/process_plugin/test/resources/proc/1872/task/1872/cmdline create mode 100755 device/plugins/process_plugin/test/resources/proc/1872/task/1873/cmdline create mode 100755 device/plugins/process_plugin/test/resources/proc/1872/task/1965/cmdline create mode 100755 device/plugins/process_plugin/test/resources/proc/stat create mode 100755 device/plugins/process_plugin/test/unittest/process_plugin_unittest.cpp diff --git a/OAT.xml b/OAT.xml index 55875b61b..493fb475d 100644 --- a/OAT.xml +++ b/OAT.xml @@ -62,6 +62,7 @@ Note:If the text contains special characters, please escape them according to th + @@ -86,6 +87,7 @@ Note:If the text contains special characters, please escape them according to th + diff --git a/device/BUILD.gn b/device/BUILD.gn index 2f3239cc7..15d25df50 100644 --- a/device/BUILD.gn +++ b/device/BUILD.gn @@ -61,6 +61,7 @@ group("unittest") { "plugins/hiperf_plugin/test:unittest", "plugins/memory_plugin/test:unittest", "plugins/network_plugin/test:unittest", + "plugins/process_plugin/test:unittest", "services/ipc/test:unittest", "services/plugin_service/test:unittest", "services/profiler_service/test:unittest", diff --git a/device/ohos_test.xml b/device/ohos_test.xml index bd26ff004..8b5863378 100644 --- a/device/ohos_test.xml +++ b/device/ohos_test.xml @@ -117,10 +117,23 @@