diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..51c63e295 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,15 @@ +*.tgz filter=lfs diff=lfs merge=lfs -text +*.trp filter=lfs diff=lfs merge=lfs -text +*.apk filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.mp4 filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.asm filter=lfs diff=lfs merge=lfs -text +*.8svn filter=lfs diff=lfs merge=lfs -text +*.9svn filter=lfs diff=lfs merge=lfs -text +*.dylib filter=lfs diff=lfs merge=lfs -text +*.exe filter=lfs diff=lfs merge=lfs -text +*.a filter=lfs diff=lfs merge=lfs -text +*.so filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.dll filter=lfs diff=lfs merge=lfs -text diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..e454a5258 --- /dev/null +++ b/LICENSE @@ -0,0 +1,178 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + diff --git a/OAT.xml b/OAT.xml new file mode 100755 index 000000000..c54dd7ef5 --- /dev/null +++ b/OAT.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 0f9b0a457..000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# developtools_profiler - -#### Description -Performance profiler that provides an analytics tool for the memory, bytrace plug-in, and IDE, as well as plug-in capabilities | 性能调优模块,提供了实时内存、bytrace插件和ide侧的分析工具,并提供了插件化能力 - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index 1b2ff8c93..000000000 --- a/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# developtools_profiler - -#### 介绍 -Performance profiler that provides an analytics tool for the memory, bytrace plug-in, and IDE, as well as plug-in capabilities | 性能调优模块,提供了实时内存、bytrace插件和ide侧的分析工具,并提供了插件化能力 - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README_zh.md b/README_zh.md new file mode 100755 index 000000000..234d5345f --- /dev/null +++ b/README_zh.md @@ -0,0 +1,374 @@ +# 性能调优组件 + +- [简介](#section6874544183112) +- [架构图](#section1514713331342) +- [目录](#section1742612449345) +- [说明](#section2165102016359) + - [接口说明](#section558917318367) + - [使用说明](#section681316903611) + - [调测验证:](#section35362541215) + - [\#ZH-CN\_TOPIC\_0000001149491319/section3753165410213](#section3753165410213) + +- [相关仓](#section1293495681320) + +## 简介 + +性能调优组件包含系统和应用调优框架,旨在为开发者提供一套性能调优平台,可以用来分析内存、性能等问题。 + +该组件整体分为PC端和设备端两部分,PC端最终作为deveco studio的插件进行发布,内部主要包括分为UI绘制、设备管理、进程管理、插件管理、数据导入、数据存储、 数据分析、Session管理、配置管理等模块;设备端主要包括命令行工具、服务进程、插件集合、应用程序组件等模块。设备端提供了插件扩展能力,对外提供了插件接口,基于该扩展能力可以按需定义自己的能力,并集成到框架中来,目前基于插件能力已经完成了实时内存插件和trace插件。下文会重点对设备端提供的插件能力进行介绍。 + +## 架构图 + +![](figures/zh-cn_image_0000001162598155.png) + +## 目录 + +``` +/developtools/profiler +├── device # 设备侧代码目录 +│ └── base +│ ├── include # 基础功能的头文件代码目录 +│ ├── src # 基础功能的源文件代码目录 +│ ├── test # 基础功能的测试代码目录 +│ └── cmds +│ ├── include # 对外命令行模块的头文件代码目录 +│ ├── src # 对外命令行模块的源文件代码目录 +│ ├── test # 对外命令行模块的测试代码目录 +│ └── plugins +│ ├── api # 插件模块对外提供的接口文件代码目录 +│ └── include # 插件模块对外提供的接口头文件代码目录 +│ └── src # 插件模块对外提供的接口源文件代码目录 +│ ├── memory_plugin # 内存插件模块代码目录 +│ └── include # 内存插件模块头文件代码目录 +│ └── src # 内存插件模块源文件代码目录 +│ └── test # 内存插件模块测试代码目录 +│ ├── trace_plugin # trace插件模块代码目录 +│ └── include # trace插件模块头文件代码目录 +│ └── src # trace插件模块源文件代码目录 +│ └── test # trace插件模块测试代码目录 +├── host # 主机侧代码目录 +│ └── ohosprofiler # 主机侧调优模块代码目录 +│ └── src # 主机侧调优模块源文件代码目录 +├── protos # 项目中的proto格式文件的代码目录 +│ └── innerkits # 对内部子系统暴露的头文件存放目录 +│ └── builtin # JS应用框架对外暴露JS三方module API接口存放目录 +├── trace_analyzer # bytrace解析模块的代码目录 +│ └── include # bytrace解析模块的公共头文件存放目录 +│ └── src # bytrace解析模块功能源文件存放目录 +├── interfaces # 项目中接口的代码目录 +│ └── innerkits # 模块间接口的代码目录 +│ └── kits # 对外提供接口存放目录 +``` + +## 说明 + +下面针对设备端对外提供的插件扩展能力进行接口和使用说明。 + +### 接口说明 + +下面是设备端插件模块对外提供的接口: + +- PluginModuleCallbacks为插件模块对外提供的回调接口,插件管理模块通过该回调接口列表与每一个插件模块进行交互,每一个新增插件都需要实现该接口列表中的函数。 + +**表 1** PluginModuleCallbacks接口列表 + + + + + + + + + + + + + + + + + + + + + + + + +

接口名

+

类型

+

描述

+

PluginModuleCallbacks::onPluginSessionStart

+

int (*PluginSessionStartCallback)(const uint8_t* configData, uint32_t configSize);

+
  • 功能:

    插件会话开始接口,开始插件会话时会被调用,用来下发插件配置

    +
  • 输入参数:

    configData:配置信息内存块起始地址

    +

    configSize:配置信息内存块字节数

    +
  • 返回值:

    0:成功

    +

    -1:失败

    +
+

PluginModuleCallbacks::onPluginReportResult

+

int (*PluginReportResultCallback)(uint8_t* bufferData, uint32_t bufferSize);

+
  • 功能:

    插件结果上报接口类型,当任务下发后,框架采集任务会周期性调用此接口请求回填数据

    +
  • 输入参数:

    bufferData: 存放结果的内存缓冲区起始地址

    +

    bufferSize: 存放结果的内存缓冲区的字节数

    +
  • 返回值:

    大于0:已经填充的内存字节数

    +

    等于0:没有填充任何内容

    +

    小于0:失败

    +
+

PluginModuleCallbacks::onPluginSessionStop

+

int (*PluginSessionStopCallback)();

+
  • 功能:

    采集会话结束接口

    +
  • 返回值:

    0:成功

    +

    -1:失败

    +
+

PluginModuleCallbacks::onRegisterWriterStruct

+

int (*RegisterWriterStructCallback)(WriterStruct* writer);

+
  • 功能:

    采集框架注册写数据接口,当插件管理模块向插件注册此接口,插件可以主动调用write句柄,进行写入数据

    +
  • 输入参数:

    writer 写者指针

    +
  • 返回值:

    0:成功

    +

    -1:失败

    +
+
+ +- WriterStruct是上面onRegisterWriterStruct接口中的参数,主要实现写数据接口,将插件中采集的数据通过该接口进行写入。 + +**表 2** WriterStruct接口列表 + + + + + + + + + + + + + + + + +

接口名

+

类型

+

描述

+

WriterStruct::write

+

long (*WriteFuncPtr)(WriterStruct* writer, const void* data, size_t size);

+
  • 功能:

    写接口,将插件中采集的数据通过writer进行写入

    +
  • 输入参数:

    writer:写者指针

    +

    data:数据缓冲区首字节指针

    +

    size: 数据缓冲区的字节数

    +
  • 返回值:

    0:成功

    +

    -1:失败

    +
+

WriterStruct::flush

+

bool (*FlushFuncPtr)(WriterStruct* writer);

+
  • 功能:

    触发数据上传接口

    +
  • 输入参数:

    writer:写者指针

    +
  • 返回值:

    true:成功

    +

    false:失败

    +
+
+ +- 下面是插件模块对外提供的总入口,主要包括表1中的插件模块回调函数以及插件名称、插件模块需要申请的内存大小。 + +**表 3** PluginModuleStruct接口列表 + + + + + + + + + + + + + + + + + + + + +

接口名

+

类型

+

描述

+

PluginModuleStruct::callbacks

+

PluginModuleCallbacks*

+

功能:定义插件回调函数列表

+

PluginModuleStruct::name

+

C style string

+

功能:定义插件名称

+

PluginModuleStruct::resultBufferSizeHint

+

uint32_t

+

功能:用于提示插件管理模块调用数据上报接口时使用的内存缓冲区字节数

+
+ +### 使用说明 + +下面介绍在设备端基于性能调优框架提供的插件能力,新增一个插件涉及到的关键开发步骤: + +1. 编写proto数据定义文件_plugin\_data.proto_,定义数据源格式,数据源格式决定了插件上报哪些数据: + + ``` + message PluginData { + int32 pid = 1; + string name = 2; + uint64 count1 = 3; + uint64 count2 = 4; + uint64 count3 = 5; + ...... + } + ``` + +2. 编写数据数据源配置文件_plugin\_config.proto_,采集的行为可以根据配置进行变化,可以设置数据源上报间隔等信息: + + ``` + message PluginConfig { + int32 pid = 1; + bool report_interval = 2; + int report_counter_id_1 = 3; + int report_counter_id_2 = 4; + ...... + } + ``` + +3. 定义PluginModuleCallbacks实现插件回调接口;定义PluginModuleStruct类型的g\_pluginModule全局变量,注册插件信息。 + + ``` + static PluginModuleCallbacks callbacks = { +     PluginSessionStart, +     PluginReportResult, +     PluginSessionStop, + }; + PluginModuleStruct g_pluginModule = {&callbacks, "test-plugin", MAX_BUFFER_SIZE}; + ``` + +4. 通过PluginSessionStart(名字可以自己定义)实现插件回调接口列表的onPluginSessionStart接口,主要处理插件的开始流程。 + + ``` + int PluginSessionStart(const uint8_t* configData, uint32_t configSize) + { + ...... + return 0; + } + ``` + +5. 通过PluginReportResult(名字可以自己定义)实现插件回调接口列表的onPluginReportResult接口,将插件内部采集的信息通过该接口进行上报: + + ``` + int PluginReportResult(uint8_t* bufferData, uint32_t bufferSize) + { + ...... + return 0; + } + ``` + +6. 通过PluginSessionStop(名字可以自己定义)实现插件回调接口列表的onPluginSessionStop接口,主要进行插件停止后的操作流程。 + + ``` + int PluginSessionStop() + { + ...... + return 0; + } + ``` + +7. 编写proto gn构建脚本, 生成protobuf源文件,protobuf源文件编译生成目标文件: + + ``` + action("plugin_cpp_gen") { + script = "${OHOS_PROFILER_DIR}/build/protoc.sh" //依赖的编译工具链 + sources = [ //定义的插件相关的proto文件,比如插件配置文件、插件数据对应的proto文件 + "plugin_data.proto", + "plugin_config.proto", + ] + outputs = [ //通过protoc编译生成的结果文件 + "plugin_data.pb.h", + "plugin_data.pb.cc", + "plugin_config.pb.h", + "plugin_config.pb.cc", + ] + args = [ + "--cpp_out", + "$proto_rel_out_dir", + "--proto_path", + rebase_path(".", root_build_dir), + ] + deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + ] + } + ohos_source_set("plug_cpp") { //将定义的proto文件生成cpp文件 + deps = [ + ":plugin_cpp_gen", + ] + public_deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + ] + include_dirs = [ "$proto_out_dir" ] + sources = [ //目标plug_cpp中包括的源文件 + "plugin_data.pb.h", + "plugin_data.pb.cc", + "plugin_config.pb.h", + "plugin_config.pb.cc", + ] + } + ``` + +8. 编写插件GN构建脚本: + + ``` + ohos_shared_library("***plugin") { + output_name = "***plugin" + sources = [ + "src/***plugin.cpp", //插件中的源文件 + ] + include_dirs = [ + "../api/include", + "${OHOS_PROFILER_DIR}/device/base/include", + ] + deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc_lib", + "${OHOS_PROFILER_DIR}/protos/types/plugins/**:plug_cpp", //上面ohos_source_set中生成的plug_cpp + ] + install_enable = true + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + } + ``` + + +### 调测验证: + +插件动态库生成后,可以自己编写测试代码,通过dlopen加载动态库,并调用上面代码中实现的插件模块回调函数进行验证。 + +``` +int main(int argc, char** argv) +{ + void* handle; + PluginModuleStruct* memplugin; +    handle = dlopen("./libplugin.z.so", RTLD_LAZY); //动态打开上面生成的插件动态库 +    if (handle == nullptr) { +        HILOGD("dlopen err:%s.", dlerror()); +        return 0; +    } + memplugin = (PluginModuleStruct*)dlsym(handle, "g_pluginModule"); //获取开发步骤3中定义的g_pluginModule全局变量 + //check memplugin->callbacks // 通过该指针调用上面开发步骤3中定义的回调函数 + return 0; +``` + +## 相关仓 + +研发工具链子系统 + +**developtools\_profiler** + +developtools\_hdc\_standard + +developtools\_bytrace\_standard + diff --git a/build/config.gni b/build/config.gni new file mode 100755 index 000000000..2721b5505 --- /dev/null +++ b/build/config.gni @@ -0,0 +1,35 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +OHOS_PROFILER_DIR = get_path_info("..", "abspath") +OHOS_PROFILER_3RDPARTY_DIR = get_path_info("../../../third_party/", "abspath") +OHOS_PROFILER_3RDPARTY_GRPC_DIR = "${OHOS_PROFILER_3RDPARTY_DIR}/grpc" +OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR = + "${OHOS_PROFILER_3RDPARTY_DIR}/protobuf" +OHOS_PROFILER_3RDPARTY_GOOGLETEST_DIR = + "${OHOS_PROFILER_3RDPARTY_DIR}/googletest" + +OHOS_PROFILER_SUBSYS_NAME = "developtools" +OHOS_PROFILER_PART_NAME = "profiler" +OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH = "profiler" + +build_l2 = false +if (getenv("BUILD_L2") == "true") { + build_l2 = true +} +print("build_l2 =", build_l2) +print("OHOS_PROFILER_DIR = ", OHOS_PROFILER_DIR) +print("OHOS_PROFILER_3RDPARTY_DIR = ", OHOS_PROFILER_3RDPARTY_DIR) +print("OHOS_PROFILER_3RDPARTY_GRPC_DIR = ", OHOS_PROFILER_3RDPARTY_GRPC_DIR) +print("OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR = ", OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR) +print("OHOS_PROFILER_3RDPARTY_GOOGLETEST_DIR", OHOS_PROFILER_3RDPARTY_GOOGLETEST_DIR) diff --git a/build/gcov.sh b/build/gcov.sh new file mode 100755 index 000000000..5ad6b336c --- /dev/null +++ b/build/gcov.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -e +DIR=$(dirname $(realpath ${BASH_SOURCE[0]})) +TOP=$(realpath $DIR/../../..) +CLANG_DIR=$TOP/prebuilts/clang/host/linux-x86/clang-r353983c +if [ ! -e "$CLANG_DIR" ]; then + CLANG_DIR=$TOP/prebuilts/clang/ohos/linux-x86_64/llvm +fi +$CLANG_DIR/bin/llvm-cov gcov $@ diff --git a/build/lcov.sh b/build/lcov.sh new file mode 100755 index 000000000..39d266824 --- /dev/null +++ b/build/lcov.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -e +DIR=$(dirname $(realpath ${BASH_SOURCE[0]})) +TOP=$(realpath $DIR/../../..) +HOST_OUT=$TOP/hos/out/hos-arm/clang_x64 +if [ ! -e "$HOST_OUT" ]; then + HOST_OUT=$TOP/out/ohos-arm-release/clang_x64 +fi + + +# collect and convert all gcno and gcda to test.info +lcov -c -d $HOST_OUT -o test.info --gcov-tool $DIR/gcov.sh +if [ $? -ne 0 ]; then + echo "Install lcov: sudo apt install lcov" +fi + +# filter out system headers +lcov -r test.info \ + '/usr/include/*' \ + '*/hos/out/*' \ + '*/hos/third_party/*' \ + '*/third_party/grpc/*' \ + -o test.info + +# generate html report +genhtml -o html test.info diff --git a/build/protoc.sh b/build/protoc.sh new file mode 100755 index 000000000..275fa09ee --- /dev/null +++ b/build/protoc.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +THIS_DIR=$(dirname ${BASH_SOURCE[0]}) +PROJECT_TOP=$(realpath $THIS_DIR/../../..) + +OHOS_X64_OUT=$PROJECT_TOP/$2/clang_x64 +LIBCXX_X64_OUT=$PROJECT_TOP/$1/ndk/libcxx/linux_x86_64 +SUBSYS_X64_OUT=$PROJECT_TOP/$2/clang_x64/developtools/developtools +PROTOC=$PROJECT_TOP/$2/clang_x64/developtools/developtools/protoc + +PARAMS=$* +PARAMS_FILTER="$1 $2" +echo "EXEC: LD_LIBRARY_PATH=$LIBCXX_X64_OUT:$SUBSYS_X64_OUT $PROTOC ${PARAMS[@]:${#PARAMS_FILTER}}" +LD_LIBRARY_PATH=$LIBCXX_X64_OUT:$SUBSYS_X64_OUT exec $PROTOC ${PARAMS[@]:${#PARAMS_FILTER}} diff --git a/build/run.sh b/build/run.sh new file mode 100755 index 000000000..cd27dd1b6 --- /dev/null +++ b/build/run.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -e +DIR=$(dirname $(realpath ${BASH_SOURCE[0]})) +TOP=$(realpath $DIR/../../..) +SUBSYS=developtools +HOST_OUT=$TOP/hos/out/hos-arm/clang_x64 +LIB_PATH=$LIB_PATH:$HOST_OUT/devtools/devtools +LIB_PATH=$LIB_PATH:$HOST_OUT/$SUBSYS/$SUBSYS +LIB_PATH=$LIB_PATH:$HOST_OUT/common/common +LIB_PATH=$LIB_PATH:$LD_LIBRARY_PATH + +# remove old coverage data +find $HOST_OUT -name '*.gcda' | xargs rm -v + +# run UT executable +echo LD_LIBRARY_PATH=$LIB_PATH $@ +LD_LIBRARY_PATH=$LIB_PATH $@ diff --git a/device/.clang-format b/device/.clang-format new file mode 120000 index 000000000..247fd6725 --- /dev/null +++ b/device/.clang-format @@ -0,0 +1 @@ +../tools/.clang-format \ No newline at end of file diff --git a/device/BUILD.gn b/device/BUILD.gn new file mode 100755 index 000000000..16555dc98 --- /dev/null +++ b/device/BUILD.gn @@ -0,0 +1,38 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("base/config.gni") + +group("hiprofiler_targets") { + deps = [ + "cmds:hiprofiler_cmd", + "plugins/api:hiprofiler_plugins", + "plugins/memory_plugin:memdataplugin", + "services/profiler_service:hiprofilerd", + "services/shared_memory:shared_memory", + "plugins/bytrace_plugin:bytraceplugin", + ] +} + +group("unittest") { + testonly = true + deps = [ + "base/test:unittest", + "plugins/api/test:unittest", + "plugins/memory_plugin/test:unittest", + "services/ipc/test:unittest", + "services/plugin_service/test:unittest", + "services/profiler_service/test:unittest", + "services/shared_memory/test:unittest", + ] +} diff --git a/device/base/BUILD.gn b/device/base/BUILD.gn new file mode 100755 index 000000000..8fbd228f4 --- /dev/null +++ b/device/base/BUILD.gn @@ -0,0 +1,60 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("config.gni") + +# compile options for gcov +config("hiprofiler_test_config") { + cflags = [] + if (enable_debuginfo) { + cflags += [ "-g" ] + } + + if (enable_coverage && current_toolchain == host_toolchain) { + cflags += [ + # clang coverage options: + "--coverage", + "-mllvm", + "-limited-coverage-experimental=true", + "-fno-use-cxa-atexit", + ] + ldflags = [ "--coverage" ] + } +} + +config("hiprofiler_base_config") { + include_dirs = [ + "include", + "//utils/native/base/include" + ] +} + +ohos_source_set("hiprofiler_base") { + sources = [ + "src/schedule_task_manager.cpp", + ] + + public_configs = [ + ":hiprofiler_test_config", + ":hiprofiler_base_config", + ] + if (current_toolchain != host_toolchain) { + defines = [ "HAVE_HILOG" ] + if (build_l2) { + external_deps = [ "shared_library:libhilog" ] + } else { + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + } + } +} diff --git a/device/base/config.gni b/device/base/config.gni new file mode 100755 index 000000000..d667c8d7f --- /dev/null +++ b/device/base/config.gni @@ -0,0 +1,32 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("../../build/config.gni") + +build_tests = false +enable_debuginfo = false +enable_coverage = false + +if (getenv("BUILD_UT") == "true") { + build_tests = true + enable_debuginfo = true + enable_coverage = true +} + +if (getenv("BUILD_MT") == "true") { + build_tests = true + enable_debuginfo = true +} +print("build_tests = ", build_tests) +print("enable_debuginfo =", enable_debuginfo) +print("enable_coverage =", enable_coverage) diff --git a/device/base/include/logging.h b/device/base/include/logging.h new file mode 100755 index 000000000..0c4b912de --- /dev/null +++ b/device/base/include/logging.h @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LOGGING_H +#define LOGGING_H + +#ifndef LOG_TAG +#define LOG_TAG "" +#endif + +#ifdef HAVE_HILOG +#include "hilog/log.h" + +#undef LOG_TAG +#define LOG_TAG "Hiprofiler" + +#else +#include +#include +#include +#include +#include +#include +#include +#include + +static inline long GetTid() +{ + return syscall(SYS_gettid); +} + +enum { + HILOG_UNKNOWN = 0, + HILOG_DEFAULT, + HILOG_VERBOSE, + HILOG_DEBUG, + HILOG_INFO, + HILOG_WARN, + HILOG_ERROR, + HILOG_FATAL, + HILOG_SILENT, +}; + +namespace { +constexpr int NS_PER_MS_LOG = 1000 * 1000; +} + +static inline std::string GetTimeStr() +{ + char timeStr[64]; + struct timespec ts; + struct tm tmStruct; + clock_gettime(CLOCK_REALTIME, &ts); + localtime_r(&ts.tv_sec, &tmStruct); + size_t used = strftime(timeStr, sizeof(timeStr), "%m-%d %H:%M:%S", &tmStruct); + snprintf_s(&timeStr[used], sizeof(timeStr) - used, sizeof(timeStr) - used - 1, ".%03ld", + ts.tv_nsec / NS_PER_MS_LOG); + return timeStr; +} + +typedef const char *ConstCharPtr; + +static inline int HiLogPrintArgs(int prio, ConstCharPtr tag, ConstCharPtr fmt, va_list vargs) +{ + static std::mutex mtx; + static std::vector prioNames = {"U", " ", "V", "D", "I", "W", "E", "F", "S"}; + std::unique_lock lock(mtx); + int count = + fprintf(stderr, "%s %7d %7ld %5s %s ", GetTimeStr().c_str(), getpid(), GetTid(), prioNames[prio].c_str(), tag); + count += vfprintf(stderr, fmt, vargs); + count += fprintf(stderr, "\n"); + return count; +} + +static inline int __hilog_log_print(int prio, ConstCharPtr tag, ConstCharPtr fmt, ...) +{ + int count; + va_list vargs; + + va_start(vargs, fmt); + count = HiLogPrintArgs(prio, tag, fmt, vargs); + va_end(vargs); + return count; +} + +#define HILOG_DEBUG(LOG_CORE, fmt, ...) __hilog_log_print(HILOG_DEBUG, LOG_TAG, fmt, ##__VA_ARGS__) +#define HILOG_INFO(LOG_CORE, fmt, ...) __hilog_log_print(HILOG_INFO, LOG_TAG, fmt, ##__VA_ARGS__) +#define HILOG_WARN(LOG_CORE, fmt, ...) __hilog_log_print(HILOG_WARN, LOG_TAG, fmt, ##__VA_ARGS__) +#define HILOG_ERROR(LOG_CORE, fmt, ...) __hilog_log_print(HILOG_ERROR, LOG_TAG, fmt, ##__VA_ARGS__) + +#endif + +#define STD_PTR(K, T) std::K##_ptr + +#define CHECK_NOTNULL(ptr, retval, fmt, ...) \ + do { \ + if (ptr == nullptr) { \ + HILOG_WARN(LOG_CORE, "CHECK_NOTNULL(%s) in %s:%d FAILED, " fmt, #ptr, __func__, __LINE__, ##__VA_ARGS__); \ + return retval; \ + } \ + } while (0) + +#define CHECK_TRUE(expr, retval, fmt, ...) \ + do { \ + if (!(expr)) { \ + HILOG_WARN(LOG_CORE, "CHECK_TRUE(%s) in %s:%d FAILED, " fmt, #expr, __func__, __LINE__, ##__VA_ARGS__); \ + return retval; \ + } \ + } while (0) + +#define RETURN_IF(expr, retval, fmt, ...) \ + do { \ + if ((expr)) { \ + HILOG_WARN(LOG_CORE, fmt, ##__VA_ARGS__); \ + return retval; \ + } \ + } while (0) + +#endif diff --git a/device/base/include/schedule_task_manager.h b/device/base/include/schedule_task_manager.h new file mode 100644 index 000000000..0ce47f5dc --- /dev/null +++ b/device/base/include/schedule_task_manager.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SCHEDULE_TASK_MANAGER_H +#define SCHEDULE_TASK_MANAGER_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "logging.h" + +class ScheduleTaskManager { +public: + static ScheduleTaskManager& GetInstance(); + + using ms = std::chrono::milliseconds; + + bool ScheduleTask(const std::string& name, + const std::function& callback, + const std::chrono::milliseconds& repeatInterval); + + bool ScheduleTask(const std::string& name, + const std::function& callback, + const std::chrono::milliseconds& repeatInterval, + std::chrono::milliseconds initialDelay); + + bool UnscheduleTask(const std::string& name); + + void Shutdown(); + + ScheduleTaskManager(); + ~ScheduleTaskManager(); + +private: + using Clock = std::chrono::steady_clock; + using TimePoint = std::chrono::time_point; + + struct Task { + std::string name; + std::function callback; + std::chrono::milliseconds repeatInterval; + std::chrono::milliseconds initialDelay; + TimePoint lastRunTime; + }; + using SharedTask = STD_PTR(shared, Task); + using WeakTask = STD_PTR(weak, Task); + + static std::chrono::milliseconds NormalizeInterval(std::chrono::milliseconds interval); + + void DumpTask(const SharedTask& task); + + void ScheduleThread(); + + bool TakeFront(TimePoint& time, WeakTask& task); + +private: + mutable std::mutex taskMutex_; + std::condition_variable taskCv_; + std::atomic runScheduleThread_ = true; + std::multimap timeMap_; + std::unordered_map taskMap_; + std::thread scheduleThread_; +}; + +#endif // !SCHEDULE_TASK_MANAGER_H \ No newline at end of file diff --git a/device/base/src/schedule_task_manager.cpp b/device/base/src/schedule_task_manager.cpp new file mode 100644 index 000000000..8735b28df --- /dev/null +++ b/device/base/src/schedule_task_manager.cpp @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "schedule_task_manager.h" + +#include +#include +#include + +#include "logging.h" +#include "securec.h" + +namespace { +constexpr std::chrono::milliseconds POLL_INTERVAL = std::chrono::milliseconds(5000); +constexpr std::chrono::milliseconds MIN_REPEAT_INTERVAL = std::chrono::milliseconds(10); +constexpr std::chrono::milliseconds ZERO_INTERVAL = std::chrono::milliseconds(0); +} // namespace + +ScheduleTaskManager& ScheduleTaskManager::GetInstance() +{ + static ScheduleTaskManager instance; + return instance; +} + +ScheduleTaskManager::ScheduleTaskManager() +{ + scheduleThread_ = std::thread(&ScheduleTaskManager::ScheduleThread, this); +} + +ScheduleTaskManager::~ScheduleTaskManager() +{ + Shutdown(); + if (scheduleThread_.joinable()) { + scheduleThread_.join(); + } +} + +void ScheduleTaskManager::Shutdown() +{ + std::lock_guard guard(taskMutex_); + runScheduleThread_ = false; + taskCv_.notify_one(); +} + +std::chrono::milliseconds ScheduleTaskManager::NormalizeInterval(std::chrono::milliseconds interval) +{ + if (interval <= ZERO_INTERVAL) { + return ZERO_INTERVAL; + } + if (interval < MIN_REPEAT_INTERVAL) { + return MIN_REPEAT_INTERVAL; + } + return interval / MIN_REPEAT_INTERVAL * MIN_REPEAT_INTERVAL; +} + +bool ScheduleTaskManager::ScheduleTask(const std::string& name, + const std::function& callback, + const std::chrono::milliseconds& repeatInterval) +{ + return ScheduleTask(name, callback, repeatInterval, repeatInterval); +} + +bool ScheduleTaskManager::ScheduleTask(const std::string& name, + const std::function& callback, + const std::chrono::milliseconds& repeatInterval, + std::chrono::milliseconds initialDelay) +{ + auto task = std::make_shared(); + + task->name = name; + task->callback = callback; + task->initialDelay = initialDelay; + task->repeatInterval = NormalizeInterval(repeatInterval); + + std::lock_guard guard(taskMutex_); + if (taskMap_.count(name) > 0) { + HILOG_WARN(LOG_CORE, "task name %s already exists!", name.c_str()); + return false; + } + + taskMap_[name] = task; + timeMap_.insert(std::make_pair(Clock::now() + initialDelay, task)); + taskCv_.notify_one(); + + HILOG_DEBUG(LOG_CORE, "add schedule %s, total: %zu ", name.c_str(), taskMap_.size()); + return true; +} + +bool ScheduleTaskManager::UnscheduleTask(const std::string& name) +{ + HILOG_DEBUG(LOG_CORE, "del schedule %s, total: %zu", name.c_str(), taskMap_.size()); + std::unique_lock lck(taskMutex_); + auto it = taskMap_.find(name); + if (it != taskMap_.end()) { + taskMap_.erase(it); + return true; + } + return false; +} + +bool ScheduleTaskManager::TakeFront(TimePoint& time, WeakTask& task) +{ + std::unique_lock lck(taskMutex_); + + // thread wait until task insert or shutdown + while (timeMap_.empty() && runScheduleThread_) { + taskCv_.wait_for(lck, POLL_INTERVAL); + } + + if (!runScheduleThread_) { + return false; + } + + time = timeMap_.begin()->first; + task = timeMap_.begin()->second; + timeMap_.erase(timeMap_.begin()); + return true; +} + +void ScheduleTaskManager::DumpTask(const SharedTask& task) +{ + if (task) { + long msecs = std::chrono::duration_cast(task->lastRunTime.time_since_epoch()).count(); + HILOG_DEBUG(LOG_CORE, "{name = %s, interval = %lld, delay = %lld, lastRun = %ld}", + task->name.c_str(), task->repeatInterval.count(), task->initialDelay.count(), msecs); + } +} + +void ScheduleTaskManager::ScheduleThread() +{ + while (true) { + // take front task from task queue + TimePoint targetTime; + WeakTask targetTask; + if (!TakeFront(targetTime, targetTask)) { + break; + } + + // delay to target time + auto currentTime = Clock::now(); + if (targetTime >= currentTime) { + std::this_thread::sleep_for(targetTime - currentTime); + } + + // promote to shared_ptr + auto task = targetTask.lock(); + DumpTask(task); + + if (task != nullptr) { + // call task callback + task->callback(); + task->lastRunTime = currentTime; + + // re-insert task to map if it's a repeat task + if (task->repeatInterval.count() != 0) { + std::unique_lock guard(taskMutex_); + timeMap_.insert(std::make_pair(targetTime + task->repeatInterval, task)); + } + } + } +} diff --git a/device/base/test/BUILD.gn b/device/base/test/BUILD.gn new file mode 100755 index 000000000..69f42ea3f --- /dev/null +++ b/device/base/test/BUILD.gn @@ -0,0 +1,53 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/test.gni") +import("../../base/config.gni") + +module_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/device" +config("module_private_config") { + visibility = [":*"] + if (current_toolchain != host_toolchain) { + defines = [ "HAVE_HILOG" ] + } +} + +ohos_unittest("hiprofiler_base_ut") { + module_out_path = module_output_path + deps = [ + "../:hiprofiler_base", + "//third_party/googletest:gtest", + ] + configs = [ + ":module_private_config" + ] + include_dirs = [ "//third_party/googletest/googletest/include/gtest" ] + sources = [ + "unittest/schedule_task_manager_test.cpp", + ] + cflags = [ + "-Wno-inconsistent-missing-override", + "-Dprivate=public", #allow test code access private members + ] + external_deps = [ + "hiviewdfx_hilog_native:libhilog", + ] + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} + +group("unittest") { + testonly = true + deps = [ + ":hiprofiler_base_ut", + ] +} diff --git a/device/base/test/unittest/schedule_task_manager_test.cpp b/device/base/test/unittest/schedule_task_manager_test.cpp new file mode 100755 index 000000000..580d5a3ee --- /dev/null +++ b/device/base/test/unittest/schedule_task_manager_test.cpp @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include +#include +#include + +#include "schedule_task_manager.h" + +using namespace testing::ext; + +namespace { +class ScheduleTaskManagerTest : public testing::Test { +protected: + static void SetUpTestCase() {} + static void TearDownTestCase() {} +}; + +/** + * @tc.name: base + * @tc.desc: Get Instance. + * @tc.type: FUNC + */ +HWTEST_F(ScheduleTaskManagerTest, GetInstance, TestSize.Level1) +{ + ScheduleTaskManager::GetInstance(); +} + +/** + * @tc.name: base + * @tc.desc: Single task processing. + * @tc.type: FUNC + */ +HWTEST_F(ScheduleTaskManagerTest, ScheduleTaskOneshot, TestSize.Level1) +{ + std::atomic count = 0; + ScheduleTaskManager::ms initalDelay{10}; + + ScheduleTaskManager scheduleTaskManager; + EXPECT_TRUE(scheduleTaskManager.ScheduleTask( + "task-1", [&]() { count++; }, ScheduleTaskManager::ms{0}, initalDelay)); + + std::this_thread::sleep_for(initalDelay + initalDelay); + EXPECT_EQ(count.load(), 1); +} + +/** + * @tc.name: base + * @tc.desc: Repetitive task processing. + * @tc.type: FUNC + */ +HWTEST_F(ScheduleTaskManagerTest, ScheduleTaskRepeated, TestSize.Level1) +{ + std::atomic count = 0; + constexpr int cnt = 5; + + ScheduleTaskManager::ms repeatInterval{100}; + ScheduleTaskManager::ms initalDelay{10}; + + ScheduleTaskManager scheduleTaskManager; + EXPECT_TRUE(scheduleTaskManager.ScheduleTask( + "task-2", [&]() { count++; }, repeatInterval, initalDelay)); + + int expected = 0; + std::this_thread::sleep_for(initalDelay + initalDelay); + for (int i = 0; i < cnt; i++) { + expected++; + EXPECT_EQ(count.load(), expected); + std::this_thread::sleep_for(repeatInterval); + } +} + +/** + * @tc.name: base + * @tc.desc: Unschedule Task. + * @tc.type: FUNC + */ +HWTEST_F(ScheduleTaskManagerTest, UnscheduleTask, TestSize.Level1) +{ + std::atomic count = 0; + constexpr int cnt = 5; + + std::string taskName = "task-3"; + ScheduleTaskManager::ms repeatInterval{100}; + ScheduleTaskManager::ms initalDelay{10}; + + ScheduleTaskManager scheduleTaskManager; + EXPECT_TRUE(scheduleTaskManager.ScheduleTask( + taskName, [&]() { count++; }, repeatInterval)); + + int expected = 0; + std::this_thread::sleep_for(initalDelay); + for (int i = 0; i < cnt; i++) { + std::this_thread::sleep_for(repeatInterval); + expected++; + EXPECT_EQ(count.load(), expected); + } + + EXPECT_TRUE(scheduleTaskManager.UnscheduleTask(taskName)); + scheduleTaskManager.Shutdown(); + + EXPECT_EQ(count.load(), expected); +} +} // namespace \ No newline at end of file diff --git a/device/cmds/BUILD.gn b/device/cmds/BUILD.gn new file mode 100755 index 000000000..300c5ea89 --- /dev/null +++ b/device/cmds/BUILD.gn @@ -0,0 +1,41 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("../base/config.gni") + +ohos_source_set("command_line") { + sources = [ + "src/command_line.cpp", + "src/command_param.cpp", + "src/command_param_switch.cpp", + "src/command_param_text.cpp", + ] + include_dirs = [ "include" ] +} +ohos_executable("hiprofiler_cmd") { + sources = [ + "src/main.cpp", + ] + include_dirs = [ "include" ] + deps = [ + ":command_line", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + "${OHOS_PROFILER_DIR}/protos/services:profiler_services_proto", + "${OHOS_PROFILER_DIR}/protos/services:service_types_proto", + ] + + install_enable = true + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} diff --git a/device/cmds/include/command_line.h b/device/cmds/include/command_line.h new file mode 100644 index 000000000..fb2f684b5 --- /dev/null +++ b/device/cmds/include/command_line.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef COMMAND_LINE_H +#define COMMAND_LINE_H + +#include "command_param.h" +#include "command_param_switch.h" +#include "command_param_text.h" +#include + +#ifdef VT100_ENABLE +#define VT100_RED "\033[31m" +#define VT100_GREEN "\033[32m" +#define VT100_YELLOW "\033[33m" +#define VT100_BLUE "\033[34m" +#define VT100_PURPLE "\033[35m" +#define VT100_CYAN "\033[36m" +#define VT100_WHITE "\033[37m" + +#define VT100_CLOSE "\033[0m" +#define VT100_BRIGHT "\033[1m" +#define VT100_UNDERLINE "\033[4m" +#define VT100_FLASH "\033[5m" +#else +#define VT100_RED "" +#define VT100_GREEN "" +#define VT100_YELLOW "" +#define VT100_BLUE "" +#define VT100_PURPLE "" +#define VT100_CYAN "" +#define VT100_WHITE "" + +#define VT100_CLOSE "" +#define VT100_BRIGHT "" +#define VT100_UNDERLINE "" +#define VT100_FLASH "" +#endif + +class CommandLine { +public: + static CommandLine& GetInstance(); + + int AnalyzeParam(std::vector argv); + + void AddParamSwitch(const std::string& filter1, const std::string& filter2, bool &pbool, const std::string& desc); + void AddParamText(const std::string& filter1, + const std::string& filter2, + std::string& pstr, + const std::string& desc); + + void PrintHelp(); + +private: + CommandLine(); + ~CommandLine(); + + int paramIdx_; + std::map> commandParams_; + + int CheckParam(const std::string& s1, const std::string& s2); +}; + +#endif \ No newline at end of file diff --git a/device/cmds/include/command_param.h b/device/cmds/include/command_param.h new file mode 100755 index 000000000..0aff4e2ef --- /dev/null +++ b/device/cmds/include/command_param.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef COMMAND_PARAM_H +#define COMMAND_PARAM_H + +#include +#include +#include +#include + +enum PARAM_TYPE { PARAM_TYPE_SWITCH, PARAM_TYPE_TEXT }; + +class CommandParam { +public: + enum PARAM_TYPE paramType_; + std::string sDescriptor_; + + std::list paramFilter_; + + void AddFilter(const std::string& filterName); + bool IsInFilter(const std::string& filterName); +}; + +#endif \ No newline at end of file diff --git a/device/cmds/include/command_param_switch.h b/device/cmds/include/command_param_switch.h new file mode 100755 index 000000000..8dd62bf74 --- /dev/null +++ b/device/cmds/include/command_param_switch.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef COMMAND_SWITCH_H +#define COMMAND_SWITCH_H + +#include "command_param.h" + +class CommandParamSwitch : public CommandParam { +public: + CommandParamSwitch(bool& value); + ~CommandParamSwitch() {} + void SetValue(bool value); + +private: + bool& boolSwitch_; +}; + +#endif \ No newline at end of file diff --git a/device/cmds/include/command_param_text.h b/device/cmds/include/command_param_text.h new file mode 100755 index 000000000..c091249c4 --- /dev/null +++ b/device/cmds/include/command_param_text.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef COMMAND_TEXT_H +#define COMMAND_TEXT_H + +#include "command_param.h" + +class CommandParamText : public CommandParam { +public: + CommandParamText(std::string& s); + ~CommandParamText() {} + void SetValue(const std::string& s); + +private: + std::string& stringText_; +}; + +#endif \ No newline at end of file diff --git a/device/cmds/src/command_line.cpp b/device/cmds/src/command_line.cpp new file mode 100644 index 000000000..0b682ac9d --- /dev/null +++ b/device/cmds/src/command_line.cpp @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "command_line.h" +#include +#include +#include +#include +#include +#include "command_param.h" +#include "command_param_switch.h" +#include "command_param_text.h" + +CommandLine& CommandLine::GetInstance() +{ + static CommandLine commandLine; + return commandLine; +} + +CommandLine::CommandLine() +{ + paramIdx_ = 0; +} +CommandLine::~CommandLine() {} + +void CommandLine::AddParamText(const std::string& filter1, + const std::string& filter2, + std::string& pstr, + const std::string& desc) +{ + auto pret = std::make_shared(pstr); + if (!filter1.empty()) { + pret->AddFilter(filter1); + } + if (!filter2.empty()) { + pret->AddFilter(filter2); + } + pret->paramType_ = PARAM_TYPE_TEXT; + pret->sDescriptor_ = desc; + commandParams_[paramIdx_++] = pret; +} + +void CommandLine::AddParamSwitch(const std::string& filter1, + const std::string& filter2, + bool &pbool, + const std::string& desc) +{ + auto pret = std::make_shared(pbool); + if (!filter1.empty()) { + pret->AddFilter(filter1); + } + if (!filter2.empty()) { + pret->AddFilter(filter2); + } + pret->paramType_ = PARAM_TYPE_SWITCH; + pret->sDescriptor_ = desc; + commandParams_[paramIdx_++] = pret; +} + +namespace { +const int USED_PARAM_ONE = 1; +const int USED_PARAM_TWO = 2; +const int USED_PARAM_ERR = 99999; + +const int MAX_TAB_COUNT = 2; +} // namespace + +int CommandLine::CheckParam(const std::string& s1, const std::string& s2) +{ + for (auto it = commandParams_.begin(); it != commandParams_.end(); ++it) { + auto p = it->second; + if (!p->IsInFilter(s1)) { + continue; + } + switch (p->paramType_) { + case PARAM_TYPE_SWITCH: { + CommandParamSwitch* pswitch = (CommandParamSwitch*)p.get(); + pswitch->SetValue(true); + return USED_PARAM_ONE; + } break; + case PARAM_TYPE_TEXT: { + CommandParamText* ptext = (CommandParamText*)p.get(); + if (s2 != "") { + ptext->SetValue(s2); + return USED_PARAM_TWO; + } + printf("%s lost content\n", s1.c_str()); + return USED_PARAM_ERR; + } break; + default: + printf("unknown type\n"); + break; + } + } + printf("unknown param '%s'\n", s1.c_str()); + return USED_PARAM_ERR; +} +int CommandLine::AnalyzeParam(std::vector argv) +{ + size_t i = 1; + while (i < argv.size()) { + i += CheckParam(argv[i], (i + 1 < argv.size()) ? argv[i + 1] : ""); + } + if (i >= USED_PARAM_ERR) { + return -1; + } + return 1; +} + +void CommandLine::PrintHelp() +{ + printf("%shelp :\n", VT100_RED); + for (auto it = commandParams_.begin(); it != commandParams_.end(); ++it) { + auto p = it->second; + + int i = 0; + for (std::string temp : p->paramFilter_) { + i++; + if (i == 1) { + printf(" %-16s", temp.c_str()); + } else { + printf(" %-2s", temp.c_str()); + break; + } + } + for (; i < MAX_TAB_COUNT; i++) { + printf(" "); + } + printf(" : %s\n", p->sDescriptor_.c_str()); + } + printf("%s", VT100_CLOSE); +} diff --git a/device/cmds/src/command_param.cpp b/device/cmds/src/command_param.cpp new file mode 100755 index 000000000..04a241d42 --- /dev/null +++ b/device/cmds/src/command_param.cpp @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "command_param.h" +#include +#include +#include + +void CommandParam::AddFilter(const std::string& filterName) +{ + if (IsInFilter(filterName)) { + return; + } + paramFilter_.push_back(filterName); +} +bool CommandParam::IsInFilter(const std::string& filterName) +{ + return std::any_of(paramFilter_.begin(), paramFilter_.end(), + [filterName](std::string s) { return s == filterName; }); +} \ No newline at end of file diff --git a/device/cmds/src/command_param_switch.cpp b/device/cmds/src/command_param_switch.cpp new file mode 100755 index 000000000..36dec3ad9 --- /dev/null +++ b/device/cmds/src/command_param_switch.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "command_param_switch.h" + +CommandParamSwitch::CommandParamSwitch(bool& value) : boolSwitch_(value) {} + +void CommandParamSwitch::SetValue(bool value) +{ + boolSwitch_ = value; +} \ No newline at end of file diff --git a/device/cmds/src/command_param_text.cpp b/device/cmds/src/command_param_text.cpp new file mode 100755 index 000000000..0be16b0f6 --- /dev/null +++ b/device/cmds/src/command_param_text.cpp @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "command_param_text.h" + +CommandParamText::CommandParamText(std::string& s) : stringText_(s) {} +void CommandParamText::SetValue(const std::string& s) +{ + stringText_ = s; +} \ No newline at end of file diff --git a/device/cmds/src/main.cpp b/device/cmds/src/main.cpp new file mode 100644 index 000000000..5bb8046f3 --- /dev/null +++ b/device/cmds/src/main.cpp @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "command_line.h" +#include "profiler_service.grpc.pb.h" +#include "google/protobuf/text_format.h" + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace { +const int ADDR_BUFFER_SIZE = 128; +const int MS_PER_S = 1000; + +std::string GetIpAddr() +{ + char addressBuffer[ADDR_BUFFER_SIZE] = {0}; + struct ifaddrs* ifAddrStruct = nullptr; + void* tmpAddrPtr = nullptr; + + getifaddrs(&ifAddrStruct); + + while (ifAddrStruct != nullptr) { + if (ifAddrStruct->ifa_addr->sa_family == AF_INET) { + // is a valid IP4 Address + tmpAddrPtr = &((reinterpret_cast(ifAddrStruct->ifa_addr))->sin_addr); + inet_ntop(AF_INET, tmpAddrPtr, addressBuffer, INET_ADDRSTRLEN); + if (strcmp(addressBuffer, "127.0.0.1") != 0) { + return addressBuffer; + } + } else if (ifAddrStruct->ifa_addr->sa_family == AF_INET6) { // check it is IP6 + // is a valid IP6 Address + tmpAddrPtr = &((reinterpret_cast(ifAddrStruct->ifa_addr))->sin_addr); + inet_ntop(AF_INET6, tmpAddrPtr, addressBuffer, INET6_ADDRSTRLEN); + } + ifAddrStruct = ifAddrStruct->ifa_next; + } + return addressBuffer; +} + +std::string ReadFileToString(const std::string& fileName) +{ + std::ifstream inputString(fileName, std::ios::in); + if (!inputString) { + printf("can't open %s\n", fileName.c_str()); + return ""; + } + std::string content(std::istreambuf_iterator {inputString}, std::istreambuf_iterator {}); + return content; +} + +std::string ReadConfigContent(const std::string& configFileName) +{ + std::string content; + if (configFileName == "-") { // Read configuration information from standard input + std::string line; + while (std::getline(std::cin, line)) { + content += line + "\n"; + } + } else { + content = ReadFileToString(configFileName); + } + return content; +} + +std::unique_ptr MakeCreateRequest(const std::string& configFileName, + const std::string& keepSecond, const std::string& outputFileName) +{ + auto request = std::make_unique(); + auto sessionConfig = request->mutable_session_config(); + if (!request || !sessionConfig) { + return nullptr; + } + + std::string content = ReadConfigContent(configFileName); + if (content.empty()) { + return nullptr; + } + if (!google::protobuf::TextFormat::ParseFromString(content, request.get())) { + printf("config file [%s] format error!\n", configFileName.c_str()); + return nullptr; + } + + request->set_request_id(0); + if (!keepSecond.empty()) { + int ks = std::stoi(keepSecond); + if (ks > 0) { + sessionConfig->set_sample_duration(ks * MS_PER_S); + } + } + if (!outputFileName.empty()) { + sessionConfig->set_result_file(outputFileName); + } + return request; +} + +std::unique_ptr GetProfilerServiceStub() +{ + auto grpcChannel = grpc::CreateChannel("localhost:50051", grpc::InsecureChannelCredentials()); + if (grpcChannel == nullptr) { + printf("FAIL\nCreate gRPC channel failed!\n"); + return nullptr; + } + return IProfilerService::NewStub(grpcChannel); +} + +uint32_t CreateSession(const std::string& configFileName, + const std::string& keepSecond, const std::string& outputFileName) +{ + auto profilerStub = GetProfilerServiceStub(); + if (profilerStub == nullptr) { + printf("FAIL\nGet profiler service stub failed!\n"); + return 0; + } + + auto request = MakeCreateRequest(configFileName, keepSecond, outputFileName); + if (!request) { + printf("FAIL\nMakeCreateRequest failed!\n"); + return 0; + } + + CreateSessionResponse createResponse; + grpc::ClientContext createSessionContext; + grpc::Status status = profilerStub->CreateSession(&createSessionContext, *request, &createResponse); + if (!status.ok()) { + printf("FAIL\nCreateSession FAIL\n"); + return 0; + } + + return createResponse.session_id(); +} + +bool StartSession(const std::string& configFileName, + const std::string& keepSecond, const std::string& outputFileName) +{ + uint32_t sessionId = CreateSession(configFileName, keepSecond, outputFileName); + auto profilerStub = GetProfilerServiceStub(); + if (profilerStub == nullptr) { + printf("FAIL\nGet profiler service stub failed!\n"); + return false; + } + + StartSessionRequest startRequest; + StartSessionResponse startResponse; + startRequest.set_request_id(0); + startRequest.set_session_id(sessionId); + grpc::ClientContext startSessionContext; + grpc::Status status = profilerStub->StartSession(&startSessionContext, startRequest, &startResponse); + if (!status.ok()) { + printf("FAIL\nStartSession FAIL\n"); + return false; + } + + return true; +} +} // namespace + +int main(int argc, char* argv[]) +{ + CommandLine* pCmdLine = &CommandLine::GetInstance(); + + bool isGetGrpcAddr = false; + pCmdLine->AddParamSwitch("--getport", "-q", isGetGrpcAddr, "get grpc address"); + + std::string configFileName; + pCmdLine->AddParamText("--config", "-c", configFileName, "start trace by config file"); + + std::string traceKeepSecond; + pCmdLine->AddParamText("--time", "-t", traceKeepSecond, "trace time"); + + std::string outputFileName; + pCmdLine->AddParamText("--out", "-o", outputFileName, "output file name"); + + bool isHelp = false; + pCmdLine->AddParamSwitch("--help", "-h", isHelp, "make some help"); + + bool isBackground = false; + pCmdLine->AddParamSwitch("--background", "-d", isBackground, "run in background"); + + std::vector argvVector; + for (int i = 0; i < argc; i++) { + argvVector.push_back(argv[i]); + } + if (argc < 1 || pCmdLine->AnalyzeParam(argvVector) < 0 || isHelp) { + pCmdLine->PrintHelp(); + exit(0); + } + if (isGetGrpcAddr) { + auto profilerStub = GetProfilerServiceStub(); + if (profilerStub == nullptr) { + printf("FAIL\nGet profiler service stub failed!\n"); + return -1; + } + + GetCapabilitiesRequest request; + GetCapabilitiesResponse response; + request.set_request_id(0); + + grpc::ClientContext context; + grpc::Status status = profilerStub->GetCapabilities(&context, request, &response); + if (!status.ok()) { + printf("FAIL\nService not started\n"); + return -1; + } + + printf("OK\nip:%s\nport:50051\n", GetIpAddr().c_str()); + return 0; + } + + if (!configFileName.empty()) { + // Read the configFileName,convert to protobuf object,structure 'CreateSession',Send 'StartSession' command to + // profilerd + if (StartSession(configFileName, traceKeepSecond, outputFileName)) { + printf("OK\ntracing...\n"); + } + exit(0); + } + + return 0; +} diff --git a/device/format-code.sh b/device/format-code.sh new file mode 100755 index 000000000..6842278a8 --- /dev/null +++ b/device/format-code.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +set -e + +DIR=$(dirname $(realpath ${BASH_SOURCE[0]})) +TOP=$(realpath $DIR/../../..) +CLANG_DIR=$TOP/prebuilts/clang/ohos/linux-x86_64/llvm/bin +GN_DIR=$TOP/prebuilts/build-tools/linux-x86/bin + +export PATH=$CLANG_DIR:$GN_DIR:$PATH +echo "formatting C/C++ code ..." +find $@ -name '*.h' -o -name '*.cpp' | xargs clang-format --verbose -i + +echo "formatting GN code ..." +find $@ -name '*.gn' -o -name '*.gni' | xargs gn format diff --git a/device/plugins/api/BUILD.gn b/device/plugins/api/BUILD.gn new file mode 100755 index 000000000..6c60c6d54 --- /dev/null +++ b/device/plugins/api/BUILD.gn @@ -0,0 +1,81 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("../../base/config.gni") + +config("hiprofiler_plugins_config") { + include_dirs = [ + "./include", + "./src", + "../../base/include/", + "${OHOS_PROFILER_DIR}/device/services/ipc/include", + "${OHOS_PROFILER_DIR}/device/services/shared_memory/include", + "${OHOS_PROFILER_DIR}/interfaces/kits", + ] + cflags = [ "-pthread" ] + if (current_toolchain != host_toolchain) { + cflags += [ "-DHAVE_HILOG" ] + } +} + +ohos_source_set("plugins_sources") { + include_dirs = [ + "./include", + "../../base/include/", + "${OHOS_PROFILER_DIR}/interfaces/kits", + "//utils/native/base/include", + ] + sources = [ + "src/buffer_writer.cpp", + "src/command_poller.cpp", + "src/plugin_module.cpp", + "src/plugin_manager.cpp", + "src/plugin_watcher.cpp", + "src/writer_adapter.cpp", + ] + public_deps = [ + "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory", + "${OHOS_PROFILER_DIR}/protos/services:plugin_services_proto", + "${OHOS_PROFILER_DIR}/protos/services:service_types_proto", + "../../base:hiprofiler_base", + "//utils/native/base:utilsbase", + ] + public_configs = [ ":hiprofiler_plugins_config" ] + if (current_toolchain != host_toolchain) { + if (build_l2) { + external_deps = [ "shared_library:libhilog" ] + } else { + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + } + } +} + +ohos_executable("hiprofiler_plugins") { + deps = [ + ":plugins_sources", + ] + sources = [ + "src/main.cpp", + ] + if (current_toolchain != host_toolchain) { + defines = [ "HAVE_HILOG" ] + if (build_l2) { + external_deps = [ "shared_library:libhilog" ] + } else { + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + } + } + install_enable = true + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} diff --git a/device/plugins/api/include/writer.h b/device/plugins/api/include/writer.h new file mode 100755 index 000000000..2e74ec46e --- /dev/null +++ b/device/plugins/api/include/writer.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef WRITER_H +#define WRITER_H + +#include + +class Writer { +public: + virtual ~Writer() {} + virtual long Write(const void* data, size_t size) = 0; + virtual bool Flush() = 0; +}; + +#endif // !WRITER_H diff --git a/device/plugins/api/src/buffer_writer.cpp b/device/plugins/api/src/buffer_writer.cpp new file mode 100644 index 000000000..9996f33cc --- /dev/null +++ b/device/plugins/api/src/buffer_writer.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "buffer_writer.h" +#include "command_poller.h" +#include "logging.h" +#include "plugin_service_types.pb.h" +#include "share_memory_allocator.h" + +BufferWriter::BufferWriter(std::string name, + uint32_t size, + int fd, + const CommandPollerPtr& cp, + uint32_t pluginId) + : pluginName_(name) +{ + HILOG_DEBUG(LOG_CORE, "CreateMemoryBlockRemote %s %d %d", name.c_str(), size, fd); + shareMemoryBlock_ = ShareMemoryAllocator::GetInstance().CreateMemoryBlockRemote(name, size, fd); + if (shareMemoryBlock_ == nullptr) { + HILOG_DEBUG(LOG_CORE, "shareMemoryBlock_ == nullptr="); + } + commandPoller_ = cp; + pluginId_ = pluginId; +} + +BufferWriter::~BufferWriter() +{ + ShareMemoryAllocator::GetInstance().ReleaseMemoryBlockRemote(pluginName_); +} + +long BufferWriter::Write(const void* data, size_t size) +{ + if (shareMemoryBlock_ == nullptr) { + return false; + } + HILOG_DEBUG(LOG_CORE, "BufferWriter Write %zu", size); + return shareMemoryBlock_->PutRaw(reinterpret_cast(data), static_cast(size)); +} + +bool BufferWriter::WriteProtobuf(google::protobuf::Message& pmsg) +{ + if (shareMemoryBlock_ == nullptr) { + return false; + } + HILOG_DEBUG(LOG_CORE, "BufferWriter Write %zu", pmsg.ByteSizeLong()); + return shareMemoryBlock_->PutProtobuf(pmsg); +} + +bool BufferWriter::Flush() +{ + return true; +} diff --git a/device/plugins/api/src/buffer_writer.h b/device/plugins/api/src/buffer_writer.h new file mode 100755 index 000000000..5f8456627 --- /dev/null +++ b/device/plugins/api/src/buffer_writer.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BUFFER_WRITER_H +#define BUFFER_WRITER_H + +#include +#include "plugin_module_api.h" +#include "share_memory_allocator.h" +#include "writer.h" + +class CommandPoller; + +using CommandPollerPtr = STD_PTR(shared, CommandPoller); + +class BufferWriter : public Writer { +public: + BufferWriter(std::string name, uint32_t size, int fd, const CommandPollerPtr& cp, uint32_t pluginId); + ~BufferWriter(); + long Write(const void* data, size_t size) override; + bool Flush() override; + + bool WriteProtobuf(google::protobuf::Message& pmsg); + +private: + std::string pluginName_; + std::shared_ptr shareMemoryBlock_; + CommandPollerPtr commandPoller_; + uint32_t pluginId_; +}; + +#endif // BUFFER_WRITER_H diff --git a/device/plugins/api/src/command_poller.cpp b/device/plugins/api/src/command_poller.cpp new file mode 100644 index 000000000..7b84a4335 --- /dev/null +++ b/device/plugins/api/src/command_poller.cpp @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "command_poller.h" +#include "buffer_writer.h" +#include "plugin_manager.h" +#include "socket_context.h" + +CommandPoller::CommandPoller(const PluginManagerPtr& p) + : requestIdAutoIncrease_(1), pluginManager_(p) +{ + Connect(DEFAULT_UNIX_SOCKET_PATH); +} + +CommandPoller::~CommandPoller() {} + +uint32_t CommandPoller::GetRequestId() +{ + return requestIdAutoIncrease_++; +} + +bool CommandPoller::OnCreateSessionCmd(const CreateSessionCmd& cmd, SocketContext& context) const +{ + HILOG_DEBUG(LOG_CORE, "OnCreateSessionCmd PROC"); + uint32_t bufferSize = cmd.buffer_sizes(0); + ProfilerPluginConfig config = cmd.plugin_configs(0); + std::vector configVec; + configVec.push_back(config); + + auto pluginManager = pluginManager_.lock(); // promote to shared_ptr + CHECK_NOTNULL(pluginManager, false, "promote FAILED!"); + + if (!pluginManager->LoadPlugin(config.name())) { + HILOG_DEBUG(LOG_CORE, "OnCreateSessionCmd FAIL 1"); + return false; + } + int fd = -1; + if (bufferSize != 0) { + HILOG_DEBUG(LOG_CORE, "OnCreateSessionCmd bufferSize = %d", bufferSize); + fd = context.ReceiveFileDiscriptor(); + HILOG_DEBUG(LOG_CORE, "OnCreateSessionCmd fd = %d", fd); + } + if (!pluginManager->CreateWriter(config.name(), bufferSize, fd)) { + HILOG_DEBUG(LOG_CORE, "OnCreateSessionCmd CreateWriter FAIL"); + return false; + } + if (!pluginManager->CreatePluginSession(configVec)) { + HILOG_DEBUG(LOG_CORE, "OnCreateSessionCmd CreatePluginSession FAIL"); + return false; + } + HILOG_DEBUG(LOG_CORE, "OnCreateSessionCmd OK"); + return true; +} + +bool CommandPoller::OnDestroySessionCmd(const DestroySessionCmd& cmd) const +{ + HILOG_DEBUG(LOG_CORE, "OnDestroySessionCmd PROC"); + uint32_t pluginId = cmd.plugin_ids(0); + std::vector pluginIdVec; + pluginIdVec.push_back(pluginId); + + auto pluginManager = pluginManager_.lock(); // promote to shared_ptr + CHECK_NOTNULL(pluginManager, false, "promote FAILED!"); + + if (!pluginManager->DestroyPluginSession(pluginIdVec)) { + HILOG_DEBUG(LOG_CORE, "OnDestroySessionCmd DestroyPluginSession FAIL"); + return false; + } + if (!pluginManager->ResetWriter(pluginId)) { + HILOG_DEBUG(LOG_CORE, "OnDestroySessionCmd ResetWriter FAIL"); + return false; + } + if (!pluginManager->UnloadPlugin(pluginId)) { + HILOG_DEBUG(LOG_CORE, "OnDestroySessionCmd UnloadPlugin FAIL"); + return false; + } + HILOG_DEBUG(LOG_CORE, "OnDestroySessionCmd OK"); + return true; +} + +bool CommandPoller::OnStartSessionCmd(const StartSessionCmd& cmd) const +{ + HILOG_DEBUG(LOG_CORE, "OnStartSessionCmd PROC"); + std::vector pluginIds; + pluginIds.push_back(cmd.plugin_ids(0)); + std::vector configVec; + configVec.push_back(cmd.plugin_configs(0)); + + auto pluginManager = pluginManager_.lock(); // promote to shared_ptr + CHECK_NOTNULL(pluginManager, false, "promote FAILED!"); + + if (!pluginManager->StartPluginSession(pluginIds, configVec)) { + HILOG_DEBUG(LOG_CORE, "OnStartSessionCmd FAIL"); + return false; + } + HILOG_DEBUG(LOG_CORE, "OnStartSessionCmd OK"); + return true; +} + +bool CommandPoller::OnStopSessionCmd(const StopSessionCmd& cmd) const +{ + HILOG_DEBUG(LOG_CORE, "OnStopSessionCmd PROC"); + std::vector pluginIds; + pluginIds.push_back(cmd.plugin_ids(0)); + + auto pluginManager = pluginManager_.lock(); // promote to shared_ptr + CHECK_NOTNULL(pluginManager, false, "promote FAILED!"); + + if (!pluginManager->StopPluginSession(pluginIds)) { + HILOG_DEBUG(LOG_CORE, "OnStopSessionCmd FAIL"); + return false; + } + HILOG_DEBUG(LOG_CORE, "OnStopSessionCmd OK"); + return true; +} + +bool CommandPoller::OnGetCommandResponse(SocketContext& context, ::GetCommandResponse& response) +{ + HILOG_DEBUG(LOG_CORE, "OnGetCommandResponse"); + std::this_thread::sleep_for(std::chrono::milliseconds(10)); + NotifyResultRequest nrr; + nrr.set_request_id(1); + nrr.set_command_id(response.command_id()); + PluginResult* pr = nrr.add_result(); + ProfilerPluginState* status = pr->mutable_status(); + + if (response.has_create_session_cmd()) { + if (OnCreateSessionCmd(response.create_session_cmd(), context)) { + status->set_state(ProfilerPluginState::LOADED); + } else { + status->set_state(ProfilerPluginState::REGISTERED); + } + } else if (response.has_destroy_session_cmd()) { + if (OnDestroySessionCmd(response.destroy_session_cmd())) { + status->set_state(ProfilerPluginState::REGISTERED); + } else { + status->set_state(ProfilerPluginState::LOADED); + } + } else if (response.has_start_session_cmd()) { + if (OnStartSessionCmd(response.start_session_cmd())) { + status->set_state(ProfilerPluginState::IN_SESSION); + } else { + status->set_state(ProfilerPluginState::LOADED); + } + } else if (response.has_stop_session_cmd()) { + if (OnStopSessionCmd(response.stop_session_cmd())) { + status->set_state(ProfilerPluginState::LOADED); + } else { + status->set_state(ProfilerPluginState::IN_SESSION); + } + } else { + HILOG_DEBUG(LOG_CORE, "OnGetCommandResponse FAIL"); + return false; + } + HILOG_DEBUG(LOG_CORE, "OnGetCommandResponse OK %d", nrr.command_id()); + NotifyResult(nrr); + return true; +} diff --git a/device/plugins/api/src/command_poller.h b/device/plugins/api/src/command_poller.h new file mode 100755 index 000000000..bc4b31898 --- /dev/null +++ b/device/plugins/api/src/command_poller.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef COMMAND_POLLER_H +#define COMMAND_POLLER_H + +#include + +class PluginManager; +class CreateSessionCmd; +class DestroySessionCmd; +class StartSessionCmd; +class StopSessionCmd; + +#include "logging.h" +#include "plugin_service.ipc.h" + +using PluginManagerPtr = STD_PTR(shared, PluginManager); + +class CommandPoller final : public IPluginServiceClient { +public: + explicit CommandPoller(const PluginManagerPtr& p); + ~CommandPoller(); + + bool OnCreateSessionCmd(const CreateSessionCmd& cmd, SocketContext& context) const; + bool OnDestroySessionCmd(const DestroySessionCmd& cmd) const; + bool OnStartSessionCmd(const StartSessionCmd& cmd) const; + bool OnStopSessionCmd(const StopSessionCmd& cmd) const; + + uint32_t GetRequestId(); + +protected: + bool OnGetCommandResponse(SocketContext& context, ::GetCommandResponse& response) override; + +private: + uint32_t requestIdAutoIncrease_; + std::weak_ptr pluginManager_; +}; + +#endif // !COMMAND_POLLER_H \ No newline at end of file diff --git a/device/plugins/api/src/main.cpp b/device/plugins/api/src/main.cpp new file mode 100755 index 000000000..3ed95273e --- /dev/null +++ b/device/plugins/api/src/main.cpp @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "command_poller.h" +#include "logging.h" +#include "plugin_manager.h" +#include "plugin_service_types.pb.h" +#include "plugin_watcher.h" +#include "schedule_task_manager.h" +#include "writer_adapter.h" + +namespace { +#if defined(__i386__) || defined(__x86_64__) +const char DEFAULT_PLUGIN_PATH[] = "./"; +#else +const char DEFAULT_PLUGIN_PATH[] = "/data/local/tmp/"; +#endif + +const int SLEEP_ONE_SECOND = 1000; +} // namespace + +int main(int argc, char* argv[]) +{ + std::string pluginDir(DEFAULT_PLUGIN_PATH); + if (argv[1] != nullptr) { + HILOG_DEBUG(LOG_CORE, "pluginDir = %s", argv[1]); + pluginDir = argv[1]; + } + + auto pluginManager = std::make_shared(); + CHECK_NOTNULL(pluginManager, 1, "create PluginManager FAILED!"); + + auto commandPoller = std::make_shared(pluginManager); + CHECK_NOTNULL(commandPoller, 1, "create CommandPoller FAILED!"); + pluginManager->SetCommandPoller(commandPoller); + + PluginWatcher watcher(pluginManager); + watcher.ScanPlugins(pluginDir); + watcher.WatchPlugins(pluginDir); + + while (true) { + std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_ONE_SECOND)); + } + + return 0; +} diff --git a/device/plugins/api/src/plugin_manager.cpp b/device/plugins/api/src/plugin_manager.cpp new file mode 100644 index 000000000..96fb3f8a6 --- /dev/null +++ b/device/plugins/api/src/plugin_manager.cpp @@ -0,0 +1,358 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "plugin_manager.h" + +#include + +#include "command_poller.h" +#include "logging.h" +#include "plugin_service_types.pb.h" + +PluginManager::~PluginManager() {} + +void PluginManager::SetCommandPoller(const CommandPollerPtr& p) +{ + this->commandPoller_ = p; +} + +bool PluginManager::AddPlugin(const std::string& pluginPath) +{ + PluginModuleInfo info; + + if (pluginIds_.find(pluginPath) != pluginIds_.end()) { + HILOG_DEBUG(LOG_CORE, "already add"); + return false; + } + auto plugin = std::make_shared(pluginPath); + if (!plugin->Load()) { + HILOG_DEBUG(LOG_CORE, "load failed"); + return false; + } + + if (!plugin->BindFunctions()) { + HILOG_DEBUG(LOG_CORE, "BindFunctions failed %s", pluginPath.c_str()); + return false; + } + + if (!plugin->GetInfo(info)) { + HILOG_DEBUG(LOG_CORE, "getinfo failed"); + return false; + } + + HILOG_DEBUG(LOG_CORE, "add plugin name = %s", pluginPath.c_str()); + + if (!plugin->Unload()) { + HILOG_DEBUG(LOG_CORE, "unload failed"); + return false; + } + + RegisterPluginRequest request; + request.set_request_id(commandPoller_->GetRequestId()); + request.set_path(pluginPath); + request.set_sha256(""); + request.set_name(pluginPath); + request.set_buffer_size_hint(0); + RegisterPluginResponse response; + + if (commandPoller_->RegisterPlugin(request, response)) { + if (response.status() == 0) { + HILOG_DEBUG(LOG_CORE, "response.plugin_id() = %d", response.plugin_id()); + pluginIds_[pluginPath] = response.plugin_id(); + pluginModules_.insert(std::pair>(response.plugin_id(), plugin)); + HILOG_DEBUG(LOG_CORE, "RegisterPlugin OK"); + } else { + HILOG_DEBUG(LOG_CORE, "RegisterPlugin FAIL 1"); + return false; + } + } else { + HILOG_DEBUG(LOG_CORE, "RegisterPlugin FAIL 2"); + return false; + } + + return true; +} + +bool PluginManager::RemovePlugin(const std::string& pluginPath) +{ + auto it = pluginIds_.find(pluginPath); + if (it == pluginIds_.end()) { + HILOG_DEBUG(LOG_CORE, "plugin not exist"); + return false; + } + uint32_t index = it->second; + + UnregisterPluginRequest request; + request.set_request_id(commandPoller_->GetRequestId()); + request.set_plugin_id(index); + UnregisterPluginResponse response; + if (commandPoller_->UnregisterPlugin(request, response)) { + if (response.status() != 0) { + HILOG_DEBUG(LOG_CORE, "RegisterPlugin FAIL 1"); + return false; + } + } else { + HILOG_DEBUG(LOG_CORE, "RegisterPlugin FAIL 2"); + return false; + } + + auto itPluginModules = pluginModules_.find(index); + if (it == pluginIds_.end()) { + HILOG_DEBUG(LOG_CORE, "plugin not exist"); + return false; + } + pluginModules_.erase(itPluginModules); + pluginIds_.erase(it); + return true; +} + +bool PluginManager::LoadPlugin(const std::string& pluginPath) +{ + HILOG_DEBUG(LOG_CORE, "size = %zu", pluginIds_.size()); + auto it = pluginIds_.find(pluginPath); + if (it == pluginIds_.end()) { + HILOG_DEBUG(LOG_CORE, "plugin not exist"); + return false; + } + uint32_t index = it->second; + + if (!pluginModules_[index]->Load()) { + return false; + } + if (!pluginModules_[index]->BindFunctions()) { + return false; + } + return true; +} + +bool PluginManager::UnloadPlugin(const std::string& pluginPath) +{ + auto it = pluginIds_.find(pluginPath); + if (it == pluginIds_.end()) { + HILOG_DEBUG(LOG_CORE, "plugin not exist"); + return false; + } + + return UnloadPlugin(it->second); +} + +bool PluginManager::UnloadPlugin(const uint32_t pluginId) +{ + HILOG_INFO(LOG_CORE, "%s:UnloadPlugin ready!", __func__); + if (pluginModules_.find(pluginId) == pluginModules_.end()) { + HILOG_DEBUG(LOG_CORE, "plugin not exist"); + return false; + } + if (!pluginModules_[pluginId]->Unload()) { + return false; + } + return true; +} + +bool PluginManager::CreatePluginSession(const std::vector& config) +{ + HILOG_DEBUG(LOG_CORE, "CreatePluginSession"); + + for (size_t idx = 0; idx < config.size(); ++idx) { + HILOG_DEBUG(LOG_CORE, "config->name() = %s", config[idx].name().c_str()); + auto it = pluginIds_.find(config[idx].name()); + if (it == pluginIds_.end()) { + HILOG_DEBUG(LOG_CORE, "plugin not find"); + return false; + } + + HILOG_DEBUG(LOG_CORE, "index = %d", it->second); + pluginModules_[it->second]->SetConfigData(config[idx].config_data()); + } + return true; +} + +bool PluginManager::DestroyPluginSession(const std::vector& pluginIds) +{ + for (uint32_t id : pluginIds) { + auto it = pluginModules_.find(id); + if (it == pluginModules_.end()) { + HILOG_DEBUG(LOG_CORE, "plugin not find"); + return false; + } + } + return true; +} + +bool PluginManager::StartPluginSession(const std::vector& pluginIds, + const std::vector& config) +{ + HILOG_INFO(LOG_CORE, "%s: ready!", __func__); + size_t idx = 0; + + for (uint32_t id : pluginIds) { + auto it = pluginModules_.find(id); + if (it == pluginModules_.end()) { + HILOG_DEBUG(LOG_CORE, "plugin not find"); + return false; + } + auto configData = pluginModules_[id]->GetConfigData(); + if (!pluginModules_[id]->StartSession( + reinterpret_cast(configData.c_str()), configData.size())) { + return false; + } + if (pluginModules_[id]->GetSampleMode() == PluginModule::POLLING) { + if (idx > config.size()) { + HILOG_WARN(LOG_CORE, "idx %d out of size %zu", idx, config.size()); + return false; + } + uint32_t sampleInterval = config[idx].sample_interval(); + std::string pluginName = config[idx].name(); + HILOG_DEBUG(LOG_CORE, "sampleInterval = %d", sampleInterval); + HILOG_DEBUG(LOG_CORE, "name = %s", pluginName.c_str()); + if (!scheduleTaskManager_.ScheduleTask(pluginName, std::bind(&PluginManager::PullResult, this, id), + ScheduleTaskManager::ms(sampleInterval))) { + HILOG_DEBUG(LOG_CORE, "ScheduleTask failed"); + return false; + } + } + + idx++; + } + + return true; +} + +bool PluginManager::StopPluginSession(const std::vector& pluginIds) +{ + HILOG_INFO(LOG_CORE, "%s:stop session ready!", __func__); + for (uint32_t id : pluginIds) { + if (pluginModules_.find(id) == pluginModules_.end()) { + HILOG_DEBUG(LOG_CORE, "plugin not find"); + return false; + } + if (pluginModules_[id]->GetSampleMode() == PluginModule::POLLING) { + for (auto it : pluginIds_) { + if (it.second == id) { + HILOG_DEBUG(LOG_CORE, "find plugin name = %s", it.first.c_str()); + if (!scheduleTaskManager_.UnscheduleTask(it.first)) { + return false; + } + } + } + } + if (!pluginModules_[id]->StopSession()) { + return false; + } + } + return true; +} + +bool PluginManager::SubmitResult(const PluginResult& pluginResult) +{ + HILOG_DEBUG(LOG_CORE, "==================SubmitResult ==============="); + NotifyResultRequest request; + if (commandPoller_ == nullptr) { + HILOG_DEBUG(LOG_CORE, "SubmitResult:commandPoller_ is null"); + return false; + } + request.set_request_id(commandPoller_->GetRequestId()); + request.set_command_id(0); + PluginResult* p = request.add_result(); + *p = pluginResult; + NotifyResultResponse response; + if (!commandPoller_->NotifyResult(request, response)) { + HILOG_DEBUG(LOG_CORE, "SubmitResult FAIL 1"); + return false; + } + if (response.status() != 0) { + HILOG_DEBUG(LOG_CORE, "SubmitResult FAIL 2"); + return false; + } + HILOG_DEBUG(LOG_CORE, "SubmitResult OK"); + return true; +} + +bool PluginManager::PullResult(uint32_t pluginId) +{ + HILOG_INFO(LOG_CORE, "%s: ready!", __func__); + uint32_t size = 0; + std::string name; + HILOG_DEBUG(LOG_CORE, "PullResult pluginId = %d", pluginId); + auto it = pluginModules_.find(pluginId); + if (it == pluginModules_.end()) { + HILOG_DEBUG(LOG_CORE, "plugin not find"); + return false; + } + pluginModules_[pluginId]->GetBufferSizeHint(size); + pluginModules_[pluginId]->GetPluginName(name); + std::unique_ptr buffer {new (std::nothrow) uint8_t[size]}; + if (buffer == nullptr) { + HILOG_DEBUG(LOG_CORE, "buffer new failed!"); + } else { + HILOG_DEBUG(LOG_CORE, "buffer new success!"); + } + + int length = it->second->ReportResult(buffer.get(), size); + if (length < 0) { + return false; + } + HILOG_DEBUG(LOG_CORE, "PullResult length = %d", length); + HILOG_DEBUG(LOG_CORE, "PullResult name = %s", name.c_str()); + + ProfilerPluginData pluginData; + pluginData.set_name(name); + pluginData.set_status(0); + pluginData.set_data(buffer.get(), length); + + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + + pluginData.set_clock_id(ProfilerPluginData::CLOCKID_REALTIME); + pluginData.set_tv_sec(ts.tv_sec); + pluginData.set_tv_nsec(ts.tv_nsec); + + auto writer = pluginModules_[pluginId]->GetWriter(); + CHECK_NOTNULL(writer, false, "PullResult GetWriter nullptr"); + + std::static_pointer_cast(writer)->WriteProtobuf(pluginData); + return true; +} + +bool PluginManager::CreateWriter(std::string pluginName, uint32_t bufferSize, int fd) +{ + auto it = pluginIds_.find(pluginName); + if (it == pluginIds_.end()) { + HILOG_DEBUG(LOG_CORE, "plugin not exist"); + return false; + } + uint32_t index = it->second; + + if (bufferSize > 0) { + HILOG_DEBUG(LOG_CORE, "%s Use ShareMemory %d", pluginName.c_str(), bufferSize); + pluginModules_[index]->RegisterWriter( + std::make_shared(pluginName, bufferSize, fd, commandPoller_, index)); + } else { + HILOG_ERROR(LOG_CORE, "no shared memory buffer allocated!"); + return false; + } + return true; +} + +bool PluginManager::ResetWriter(uint32_t pluginId) +{ + if (pluginModules_.find(pluginId) == pluginModules_.end()) { + HILOG_DEBUG(LOG_CORE, "plugin not exist"); + return false; + } + HILOG_DEBUG(LOG_CORE, "ResetWriter %u", pluginId); + pluginModules_[pluginId]->RegisterWriter(nullptr); + return true; +} diff --git a/device/plugins/api/src/plugin_manager.h b/device/plugins/api/src/plugin_manager.h new file mode 100644 index 000000000..efac5576b --- /dev/null +++ b/device/plugins/api/src/plugin_manager.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PLUGIN_MANAGER_H +#define PLUGIN_MANAGER_H + +#include +#include +#include +#include + +#include "plugin_module.h" +#include "schedule_task_manager.h" + +class ProfilerPluginConfig; +class PluginResult; +class CommandPoller; + +class PluginManager { +public: + virtual ~PluginManager(); + bool AddPlugin(const std::string& pluginPath); + bool RemovePlugin(const std::string& pluginPath); + + bool LoadPlugin(const std::string& pluginPath); + bool UnloadPlugin(const std::string& pluginPath); + bool UnloadPlugin(const uint32_t pluginId); + + // CommandPoller will call the following four interfaces after receiving the command + bool CreatePluginSession(const std::vector& config); + bool DestroyPluginSession(const std::vector& pluginIds); + bool StartPluginSession(const std::vector& pluginIds, const std::vector& config); + bool StopPluginSession(const std::vector& pluginIds); + + // call the 'PluginModule::ReportResult' and 'PluginManager::SubmitResult' according to 'pluginId' + // creat PluginResult for current plug-in inside + bool PullResult(uint32_t pluginId); + + // for test + virtual bool SubmitResult(const PluginResult& pluginResult); + bool CreateWriter(std::string pluginName, uint32_t bufferSize, int fd); + bool ResetWriter(uint32_t pluginId); + void SetCommandPoller(const CommandPollerPtr& p); + +private: + std::map> pluginModules_; + std::map pluginIds_; // pluginName maps to pluginId + CommandPollerPtr commandPoller_; + ScheduleTaskManager scheduleTaskManager_; +}; + +#endif // PLUGIN_MANAGER_H diff --git a/device/plugins/api/src/plugin_module.cpp b/device/plugins/api/src/plugin_module.cpp new file mode 100644 index 000000000..98f9242da --- /dev/null +++ b/device/plugins/api/src/plugin_module.cpp @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "plugin_module.h" + +#include +#include + +#include "logging.h" +#include "plugin_module_api.h" + +PluginModule::PluginModule(const std::string& path) : handle_(nullptr), path_(path), structPtr_(nullptr) {} + +PluginModule::~PluginModule() {} + +std::string PluginModule::ComputeSha256() +{ + return ""; +} + +bool PluginModule::Load() +{ + char realPath[PATH_MAX + 1] = {0}; + if (handle_ != nullptr) { + HILOG_DEBUG(LOG_CORE, "already open"); + return false; + } + + if (realpath(path_.c_str(), realPath) == nullptr) { + HILOG_ERROR(LOG_CORE, "so filename invalid, errno=%d", errno); + return false; + } + + std::string rpath = realPath; // for SC warning + handle_ = dlopen(rpath.c_str(), RTLD_NOW); + if (handle_ == nullptr) { + HILOG_DEBUG(LOG_CORE, "dlopen err:%s.", dlerror()); + return false; + } + return true; +} + +bool PluginModule::Unload() +{ + HILOG_INFO(LOG_CORE, "%s:unload ready!", __func__); + if (handle_ != nullptr) { + HILOG_INFO(LOG_CORE, "Unload plugin"); + int ret = dlclose(handle_); + HILOG_INFO(LOG_CORE, "Unload plugin ret = %d", ret); + handle_ = nullptr; + structPtr_ = nullptr; + return true; + } + + return false; +} + +bool PluginModule::GetInfo(PluginModuleInfo& info) +{ + if (handle_ != nullptr) { + if (structPtr_ == nullptr) { + return false; + } + info.bufferSizeHint = structPtr_->resultBufferSizeHint; + info.name.assign(structPtr_->name); + return true; + } + return false; +} + +PluginModule::SampleMode PluginModule::GetSampleMode() const +{ + if (structPtr_ && structPtr_->callbacks) { + if (structPtr_->callbacks->onPluginReportResult != nullptr) { + return POLLING; + } else if (structPtr_->callbacks->onRegisterWriterStruct != nullptr) { + return STREAMING; + } + } + return UNKNOWN; +} + +void PluginModule::SetConfigData(const std::string& data) +{ + configData_ = data; +} + +std::string PluginModule::GetConfigData() const +{ + return configData_; +} + +bool PluginModule::GetPluginName(std::string& pluginName) +{ + if (handle_ != nullptr) { + if (structPtr_ == nullptr) { + return false; + } + pluginName.assign(structPtr_->name); + return true; + } + return false; +} + +bool PluginModule::GetBufferSizeHint(uint32_t& bufferSizeHint) +{ + if (handle_ != nullptr) { + if (structPtr_ == nullptr) { + return false; + } + bufferSizeHint = structPtr_->resultBufferSizeHint; + return true; + } + return false; +} + +bool PluginModule::IsLoaded() +{ + return (handle_ != nullptr); +} +bool PluginModule::BindFunctions() +{ + if (handle_ == nullptr) { + HILOG_DEBUG(LOG_CORE, "plugin not load"); + return false; + } + if (structPtr_ == nullptr) { + structPtr_ = (PluginModuleStruct*)dlsym(handle_, "g_pluginModule"); + if (structPtr_ == nullptr) { + HILOG_DEBUG(LOG_CORE, "structPtr_ == nullptr"); + return false; + } + } + + if (structPtr_->callbacks == nullptr) { + HILOG_DEBUG(LOG_CORE, "structPtr_->callbacks == nullptr"); + return false; + } + + if ((structPtr_->callbacks->onPluginSessionStart == nullptr) || + (structPtr_->callbacks->onPluginSessionStop == nullptr)) { + HILOG_DEBUG(LOG_CORE, "onPluginSessionStart == nullptr"); + return false; + } + + return true; +} + +bool PluginModule::StartSession(const uint8_t* buffer, uint32_t size) +{ + HILOG_DEBUG(LOG_CORE, "StartSession"); + if (handle_ == nullptr) { + HILOG_DEBUG(LOG_CORE, "plugin not load"); + return false; + } + HILOG_DEBUG(LOG_CORE, "size = %u, ", size); + + if (structPtr_ != nullptr && structPtr_->callbacks != nullptr) { + if (structPtr_->callbacks->onPluginSessionStart) { + return (structPtr_->callbacks->onPluginSessionStart(buffer, size) == 0); + } + } + return false; +} + +bool PluginModule::StopSession() +{ + HILOG_INFO(LOG_CORE, "%s:stop Session ready!", __func__); + if (handle_ == nullptr) { + HILOG_DEBUG(LOG_CORE, "plugin not load"); + return false; + } + if (structPtr_ != nullptr && structPtr_->callbacks != nullptr) { + if (structPtr_->callbacks->onPluginSessionStop != nullptr) { + return (structPtr_->callbacks->onPluginSessionStop() == 0); + } + } + return false; +} + +int32_t PluginModule::ReportResult(uint8_t* buffer, uint32_t size) +{ + HILOG_INFO(LOG_CORE, "%s: ready!", __func__); + HILOG_DEBUG(LOG_CORE, "ReportResult"); + if (handle_ == nullptr) { + HILOG_DEBUG(LOG_CORE, "plugin not open"); + return -1; + } + if (first_) { + lastTime_ = std::chrono::steady_clock::now(); + first_ = false; + } else { + std::chrono::steady_clock::time_point t1 = std::chrono::steady_clock::now(); + std::chrono::duration interval = + std::chrono::duration_cast>(t1 - lastTime_); + HILOG_DEBUG(LOG_CORE, "the id equals %u interval is %d milli seconds", size, interval.count()); + lastTime_ = t1; + } + + if (structPtr_ != nullptr && structPtr_->callbacks != nullptr) { + if (structPtr_->callbacks->onPluginReportResult != nullptr) { + HILOG_INFO(LOG_CORE, "%s: call plugin ready!", __func__); + return structPtr_->callbacks->onPluginReportResult(buffer, size); + } + } + + return -1; +} + +bool PluginModule::RegisterWriter(const BufferWriterPtr writer) +{ + writerAdapter_ = std::make_shared(); + writerAdapter_->SetWriter(writer); + if (structPtr_ != nullptr && structPtr_->callbacks != nullptr) { + if (structPtr_->callbacks->onRegisterWriterStruct != nullptr) { + return structPtr_->callbacks->onRegisterWriterStruct(writerAdapter_->GetStruct()); + } + } + return true; +} + +WriterPtr PluginModule::GetWriter() +{ + if (writerAdapter_ == nullptr) { + HILOG_DEBUG(LOG_CORE, "PluginModule 111111, nullptr"); + return nullptr; + } + return writerAdapter_->GetWriter(); +} diff --git a/device/plugins/api/src/plugin_module.h b/device/plugins/api/src/plugin_module.h new file mode 100644 index 000000000..bbac0bcc0 --- /dev/null +++ b/device/plugins/api/src/plugin_module.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PLUGIN_MODULE_H +#define PLUGIN_MODULE_H + +#include +#include +#include + +#include "buffer_writer.h" +#include "writer_adapter.h" + +struct PluginModuleInfo { + std::string name; + uint32_t bufferSizeHint = 0; +}; + +struct PluginModuleStruct; +struct WriterStruct; + +using BufferWriterPtr = STD_PTR(shared, BufferWriter); + +class PluginModule { +public: + enum SampleMode { + UNKNOWN, + POLLING, + STREAMING, + }; + explicit PluginModule(const std::string& path = ""); + ~PluginModule(); + std::string ComputeSha256(); + + bool Load(); + bool Unload(); + + SampleMode GetSampleMode() const; + bool GetInfo(PluginModuleInfo& info); + bool GetPluginName(std::string& pluginName); + bool GetBufferSizeHint(uint32_t& bufferSizeHint); + + bool IsLoaded(); + bool BindFunctions(); + + bool StartSession(const uint8_t* buffer, uint32_t size); + bool StopSession(); + int32_t ReportResult(uint8_t* buffer, uint32_t size); + + bool RegisterWriter(const BufferWriterPtr writer); + WriterPtr GetWriter(); + + void SetConfigData(const std::string& data); + std::string GetConfigData() const; + +private: + void* handle_; + std::string path_; + std::string pluginName_; + std::string configData_; + PluginModuleStruct* structPtr_; + + std::shared_ptr writerAdapter_; + + std::chrono::steady_clock::time_point lastTime_; + bool first_ = true; +}; + +#endif // !PLUGIN_MODULE_H diff --git a/device/plugins/api/src/plugin_watcher.cpp b/device/plugins/api/src/plugin_watcher.cpp new file mode 100755 index 000000000..7f0c58d08 --- /dev/null +++ b/device/plugins/api/src/plugin_watcher.cpp @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "plugin_watcher.h" + +#include +#include +#include +#include +#include +#include + +#include "logging.h" +#include "plugin_manager.h" +#include "securec.h" + +namespace { +constexpr uint32_t MAX_BUF_SIZE = 1024; +} // namespace + +PluginWatcher::PluginWatcher(const PluginManagerPtr& pluginManager) + : inotifyFd_(-1), pluginManager_(pluginManager), runMonitor_(true) +{ + inotifyFd_ = inotify_init1(IN_CLOEXEC | IN_NONBLOCK); + if (inotifyFd_ < 0) { + HILOG_INFO(LOG_CORE, "%s inotify_init1 failed! inotifyFd_ : %d", __FUNCTION__, inotifyFd_); + } else { + monitorThread_ = std::thread(&PluginWatcher::Monitor, this); + } +} + +PluginWatcher::~PluginWatcher() +{ + runMonitor_ = false; + for (auto it = wdToDir_.begin(); it != wdToDir_.end(); ++it) { + inotify_rm_watch(inotifyFd_, it->first); + } + + if (inotifyFd_ != -1) { + close(inotifyFd_); + } + monitorThread_.join(); +} + +void PluginWatcher::ScanPlugins(const std::string& pluginDir) +{ + DIR* dir = nullptr; + struct dirent* entry = nullptr; + char fullpath[PATH_MAX + 1] = {0}; + realpath(pluginDir.c_str(), fullpath); + HILOG_INFO(LOG_CORE, "scan plugin from directory %s", fullpath); + dir = opendir(fullpath); + if (dir == nullptr) { + return; + } + while (true) { + entry = readdir(dir); + if (!entry) { + HILOG_INFO(LOG_CORE, "%s readdir finish!", __FUNCTION__); + break; + } + std::string fileName = entry->d_name; + if (entry->d_type & DT_REG) { + size_t pos = fileName.rfind(".so"); + if (pos != std::string::npos && (pos == fileName.length() - strlen(".so"))) { + OnPluginAdded(std::string(fullpath) + '/' + fileName); + } + } + } + closedir(dir); + return; +} + +void PluginWatcher::WatchPlugins(const std::string& pluginDir) +{ + char fullpath[PATH_MAX + 1] = {0}; + realpath(pluginDir.c_str(), fullpath); + + int wd = inotify_add_watch(inotifyFd_, fullpath, IN_ALL_EVENTS); + if (wd < 0) { + HILOG_INFO(LOG_CORE, "inotify_add_watch add directory %s failed", pluginDir.c_str()); + return; + } + HILOG_INFO(LOG_CORE, "inotify_add_watch add directory %s success", fullpath); + std::lock_guard guard(mtx_); + wdToDir_.insert(std::pair(wd, std::string(fullpath))); +} + +void PluginWatcher::Monitor() +{ + const struct inotify_event* event = nullptr; + char buffer[MAX_BUF_SIZE] = {'\0'}; + struct timeval time; + char* ptr = nullptr; + int ret = 0; + + while (runMonitor_) { + fd_set rFds; + FD_ZERO(&rFds); + FD_SET(inotifyFd_, &rFds); + time.tv_sec = 1; + time.tv_usec = 0; + ret = select(inotifyFd_ + 1, &rFds, nullptr, nullptr, &time); + if (ret < 0) { + continue; + } else if (!ret) { + continue; + } else if (FD_ISSET(inotifyFd_, &rFds)) { + ssize_t readLength = read(inotifyFd_, buffer, MAX_BUF_SIZE); + if (readLength == -1) { + continue; + } + for (ptr = buffer; ptr < buffer + readLength; ptr += sizeof(struct inotify_event) + event->len) { + event = reinterpret_cast(ptr); + std::unique_lock guard(mtx_, std::adopt_lock); + const std::string& pluginDir = wdToDir_[event->wd]; + guard.unlock(); + if (event->mask & IN_ISDIR) { + continue; + } + std::string fileName = event->name; + size_t pos = fileName.rfind(".so"); + if (pos == std::string::npos || (pos != fileName.length() - strlen(".so"))) { + continue; + } + switch (event->mask) { + case IN_CLOSE_WRITE: + case IN_MOVED_TO: + OnPluginAdded(pluginDir + '/' + fileName); + break; + case IN_DELETE: + case IN_MOVED_FROM: + OnPluginRemoved(pluginDir + '/' + fileName); + break; + default: + break; + } + } + if (memset_s(buffer, MAX_BUF_SIZE, 0, MAX_BUF_SIZE) != EOK) { + HILOG_ERROR(LOG_CORE, "memset_s error!"); + } + } + } +} + +void PluginWatcher::OnPluginAdded(const std::string& pluginPath) +{ + auto pluginManager = pluginManager_.lock(); + if (pluginManager != nullptr) { + if (pluginManager->AddPlugin(pluginPath)) { + HILOG_INFO(LOG_CORE, "plugin %s add success", pluginPath.c_str()); + } else { + HILOG_INFO(LOG_CORE, "pluginPath %s add failed", pluginPath.c_str()); + } + } else { + HILOG_INFO(LOG_CORE, "%s weak_ptr pluginManager lock failed!", __FUNCTION__); + } +} + +void PluginWatcher::OnPluginRemoved(const std::string& pluginPath) +{ + auto pluginManager = pluginManager_.lock(); + if (pluginManager != nullptr) { + if (pluginManager->RemovePlugin(pluginPath)) { + HILOG_INFO(LOG_CORE, "pluginPath %s remove success", pluginPath.c_str()); + } else { + HILOG_INFO(LOG_CORE, "pluginPath %s remove failed", pluginPath.c_str()); + } + } else { + HILOG_INFO(LOG_CORE, "%s weak_ptr pluginManager lock failed!", __FUNCTION__); + } +} \ No newline at end of file diff --git a/device/plugins/api/src/plugin_watcher.h b/device/plugins/api/src/plugin_watcher.h new file mode 100755 index 000000000..41902af2e --- /dev/null +++ b/device/plugins/api/src/plugin_watcher.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PLUGIN_WATCHER_H +#define PLUGIN_WATCHER_H + +#include + +#include +#include +#include +#include +#include +class PluginManager; + +using PluginManagerPtr = STD_PTR(shared, PluginManager); + +class PluginWatcher { +public: + explicit PluginWatcher(const PluginManagerPtr& pluginManager); + ~PluginWatcher(); + + void ScanPlugins(const std::string& pluginDir); + + void WatchPlugins(const std::string& pluginDir); + +private: + int inotifyFd_; + std::weak_ptr pluginManager_; + std::map wdToDir_; + std::thread monitorThread_; + std::mutex mtx_; + bool runMonitor_; + + virtual void OnPluginAdded(const std::string& pluginPath); + virtual void OnPluginRemoved(const std::string& pluginPath); + void MonitorEventName(uint32_t mask, const std::string& fileName, const std::string& pluginDir); + void Monitor(); +}; + +#endif // !PLUGIN_WATCHER_H diff --git a/device/plugins/api/src/writer_adapter.cpp b/device/plugins/api/src/writer_adapter.cpp new file mode 100755 index 000000000..ee8f9a343 --- /dev/null +++ b/device/plugins/api/src/writer_adapter.cpp @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "writer_adapter.h" + +WriterAdapter::WriterAdapter() +{ + writerStruct_.write = &WriterAdapter::WriteFunc; + writerStruct_.flush = &WriterAdapter::FlushFunc; +} + +WriterAdapter::~WriterAdapter() {} + +void WriterAdapter::SetWriter(const WriterPtr& writer) +{ + writer_ = writer; +} + +WriterPtr WriterAdapter::GetWriter() +{ + return writer_; +} + +const WriterStruct* WriterAdapter::GetStruct() +{ + return &writerStruct_; +} + +long WriterAdapter::WriteFunc(WriterStruct* writer, const void* data, size_t size) +{ + WriterAdapter* writerAdaptor = reinterpret_cast(writer); + if (writerAdaptor && writerAdaptor->writer_) { + return writerAdaptor->writer_->Write(data, size); + } + return 0; +} + +bool WriterAdapter::FlushFunc(WriterStruct* writer) +{ + WriterAdapter* writerAdaptor = reinterpret_cast(writer); + if (writerAdaptor && writerAdaptor->writer_) { + return writerAdaptor->writer_->Flush(); + } + return false; +} diff --git a/device/plugins/api/src/writer_adapter.h b/device/plugins/api/src/writer_adapter.h new file mode 100755 index 000000000..862cbb88b --- /dev/null +++ b/device/plugins/api/src/writer_adapter.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef WRITER_ADAPTER_H +#define WRITER_ADAPTER_H + +#include +#include "logging.h" +#include "plugin_module_api.h" +#include "writer.h" + +using WriterPtr = STD_PTR(shared, Writer); +class WriterAdapter { +public: + WriterAdapter(); + ~WriterAdapter(); + const WriterStruct* GetStruct(); + void SetWriter(const WriterPtr& writer); + WriterPtr GetWriter(); + +private: + static long WriteFunc(WriterStruct* writer, const void* data, size_t size); + static bool FlushFunc(WriterStruct* writer); + +private: + WriterStruct writerStruct_; + WriterPtr writer_; +}; + +#endif // !WRITER_ADAPTER_H diff --git a/device/plugins/api/test/BUILD.gn b/device/plugins/api/test/BUILD.gn new file mode 100755 index 000000000..7d9c9d9a9 --- /dev/null +++ b/device/plugins/api/test/BUILD.gn @@ -0,0 +1,64 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/test.gni") +import("../../../base/config.gni") + +module_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/device" +config("module_private_config") { + visibility = [":*"] +} + +config("cflags_config") { + cflags = [ + "-Wno-sign-compare", + "-pthread", + "-Dprivate=public", #allow test code access private members + "-Dprotected=public", #allow test code access private members + ] +} + +ohos_unittest("hiprofiler_plugins_ut") { + module_out_path = module_output_path + deps = [ + "../:plugins_sources", + "${OHOS_PROFILER_DIR}/device/services/plugin_service:hiprofiler_plugin_service", + "${OHOS_PROFILER_DIR}/device/services/profiler_service:profiler_service", + "//third_party/googletest:gmock", + "//third_party/googletest:gtest", + ] + include_dirs = [ + "//third_party/googletest/googletest/include/gtest", + ] + sources = [ + "unittest/writer_adapter_test.cpp", + "unittest/plugin_manager_test.cpp", + "unittest/plugin_watcher_test.cpp", + "unittest/services_ipc_test.cpp", + "unittest/services_profiler_service_test.cpp", + "unittest/services_shared_memory_test.cpp", + "unittest/services_plugin_service_test.cpp", + ] + configs = [ ":cflags_config" ] + external_deps = [ + "hiviewdfx_hilog_native:libhilog", + ] + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} + +group("unittest") { + testonly = true + deps = [ + ":hiprofiler_plugins_ut", + ] +} diff --git a/device/plugins/api/test/unittest/plugin_manager_test.cpp b/device/plugins/api/test/unittest/plugin_manager_test.cpp new file mode 100644 index 000000000..e268ac39e --- /dev/null +++ b/device/plugins/api/test/unittest/plugin_manager_test.cpp @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include + +#include "command_poller.h" +#include "grpc/impl/codegen/log.h" +#include "logging.h" +#include "plugin_manager.h" +#include "plugin_service.h" +#include "plugin_service.ipc.h" +#include "profiler_service.h" +#include "socket_context.h" + +using google::protobuf::Message; +using namespace testing::ext; + +namespace { +const static std::string SUCCESS_PLUGIN_NAME = "libmemdataplugin.z.so"; +std::string g_testPluginDir("/data/local/tmp/"); + +class PluginManagerTest : public ::testing::Test { +protected: + static constexpr auto TEMP_DELAY = std::chrono::milliseconds(20); + static void SetUpTestCase() + { +#if defined(__i386__) || defined(__x86_64__) + char pluginDir[PATH_MAX + 1] = {0}; + if (readlink("/proc/self/exe", pluginDir, PATH_MAX) > 0) { + char* pos = strrchr(pluginDir, '/'); + if (pos != nullptr) { + *(pos++) = '\0'; + printf("-----> pluginDir = %s\n", pluginDir); + g_testPluginDir = pluginDir; + } + } +#endif + printf("======> pluginDir = %s\n", g_testPluginDir.c_str()); + + std::this_thread::sleep_for(TEMP_DELAY); + printf("SetUpTestCase success\n"); + } + static void TearDownTestCase() + { + } +}; + +/** + * @tc.name: plugin + * @tc.desc: Plug-in normal loading and removal process test. + * @tc.type: FUNC + */ +HWTEST_F(PluginManagerTest, SuccessPlugin, TestSize.Level1) +{ + auto pluginManage = std::make_shared(); + auto commandPoller = std::make_shared(pluginManage); + pluginManage->SetCommandPoller(commandPoller); + + const uint8_t configData[] = {0x30, 0x01, 0x38, 0x01, 0x42, 0x01, 0x01}; + ProfilerPluginConfig config; + const std::vector pluginIdsVector = {1}; + config.set_name(g_testPluginDir + "/" + SUCCESS_PLUGIN_NAME); + config.set_config_data((const void*)configData, 7); + config.set_sample_interval(1000); + + EXPECT_FALSE(pluginManage->LoadPlugin(g_testPluginDir + "/" + SUCCESS_PLUGIN_NAME)); + EXPECT_FALSE(pluginManage->UnloadPlugin(g_testPluginDir + "/" + SUCCESS_PLUGIN_NAME)); + EXPECT_FALSE(pluginManage->AddPlugin(g_testPluginDir + "/" + SUCCESS_PLUGIN_NAME)); + EXPECT_FALSE(pluginManage->AddPlugin(g_testPluginDir + "/" + SUCCESS_PLUGIN_NAME)); + EXPECT_FALSE(pluginManage->RemovePlugin(g_testPluginDir + "/" + SUCCESS_PLUGIN_NAME)); + EXPECT_FALSE(pluginManage->RemovePlugin(g_testPluginDir + "/" + SUCCESS_PLUGIN_NAME)); + EXPECT_FALSE(pluginManage->AddPlugin(g_testPluginDir + "/" + SUCCESS_PLUGIN_NAME)); + EXPECT_FALSE(pluginManage->LoadPlugin(g_testPluginDir + "/" + SUCCESS_PLUGIN_NAME)); + EXPECT_FALSE(pluginManage->LoadPlugin(g_testPluginDir + "/" + SUCCESS_PLUGIN_NAME)); + EXPECT_FALSE(pluginManage->UnloadPlugin(g_testPluginDir + "/" + SUCCESS_PLUGIN_NAME)); + + EXPECT_FALSE(pluginManage->LoadPlugin(g_testPluginDir + "/" + SUCCESS_PLUGIN_NAME)); + + std::vector configVec; + configVec.push_back(config); + EXPECT_FALSE(pluginManage->CreatePluginSession(configVec)); + + EXPECT_FALSE(pluginManage->StartPluginSession(pluginIdsVector, configVec)); + std::this_thread::sleep_for(TEMP_DELAY); + + EXPECT_FALSE(pluginManage->StopPluginSession(pluginIdsVector)); + + EXPECT_FALSE(pluginManage->DestroyPluginSession(pluginIdsVector)); +} + +/** + * @tc.name: plugin + * @tc.desc: get sample Mode. + * @tc.type: FUNC + */ +HWTEST_F(PluginManagerTest, GetSampleMode, TestSize.Level1) +{ + PluginModule pluginModule; + pluginModule.GetSampleMode(); +} + +/** + * @tc.name: plugin + * @tc.desc: Plug-in data acquisition process test. + * @tc.type: FUNC + */ +HWTEST_F(PluginManagerTest, PluginManager, TestSize.Level1) +{ + PluginManager pluginManager; + PluginModuleInfo info; + pluginManager.UnloadPlugin(0); + PluginResult pluginResult; + pluginManager.SubmitResult(pluginResult); + pluginManager.PullResult(0); + pluginManager.CreateWriter("", 0, -1); + pluginManager.ResetWriter(-1); + + PluginModule pluginModule; + pluginModule.ComputeSha256(); + pluginModule.Unload(); + pluginModule.GetInfo(info); + std::string str("memory-plugin"); + pluginModule.GetPluginName(str); + uint32_t num = 0; + pluginModule.GetBufferSizeHint(num); + pluginModule.IsLoaded(); + + BufferWriter bufferWriter("", 0, -1, nullptr, 0); + bufferWriter.Write(nullptr, 0); + bufferWriter.Flush(); +} +} // namespace diff --git a/device/plugins/api/test/unittest/plugin_watcher_test.cpp b/device/plugins/api/test/unittest/plugin_watcher_test.cpp new file mode 100755 index 000000000..be85da446 --- /dev/null +++ b/device/plugins/api/test/unittest/plugin_watcher_test.cpp @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "plugin_manager.h" +#include "plugin_watcher.h" + +#include "logging.h" + +using namespace testing::ext; + +namespace { +static std::vector g_cmpFileList; +static std::vector g_createFileList = { + "lib_6.so", "lib_5.so", "lib_8.so", "lib_4.so", "test1.txt" +}; +std::vector g_createFdList; + +static std::vector g_addFileList = { + "libadd_6.so", "libadd_5.so", "libadd_8.so", "libadd_4.so", "test2.txt" +}; + +static std::vector g_expectFileList = { + "libadd_6.so", "libadd_5.so", "libadd_8.so", "libadd_4.so", + "lib_6.so", "lib_5.so", "lib_8.so", "lib_4.so" +}; + +static int g_defaultFileMode = 0777; + +#if defined(__i386__) || defined(__x86_64__) +const static std::string DEFAULT_TEST_PATH = "./"; +#else +const static std::string DEFAULT_TEST_PATH = "/data/local/tmp/"; +#endif + +class PluginWatchTest : public ::testing::Test { +protected: + static constexpr int TEMP_DELAY = 10 * 1000; + static void SetUpTestCase() {} + static void TearDownTestCase() {} + + void SetUp() override {} + void TearDown() override {} +}; + +class MockPluginWatcher : public PluginWatcher { +public: + MockPluginWatcher(const PluginManagerPtr& pluginManager) : PluginWatcher(pluginManager) {} + ~MockPluginWatcher() = default; + MOCK_METHOD1(OnPluginAdded, void(const std::string&)); + MOCK_METHOD1(OnPluginRemoved, void(const std::string&)); +}; + +static void OnPluginAddedStub(const std::string& path) +{ + g_cmpFileList.push_back(path); + sort(g_cmpFileList.begin(), g_cmpFileList.end()); + return; +} + +static void OnPluginRemovedStub(const std::string& path) +{ + for (auto iter = g_cmpFileList.cbegin(); iter != g_cmpFileList.cend(); iter++) { + if (*iter == path) { + g_cmpFileList.erase(iter); + break; + } + } + + return; +} + +static void CreateFile() +{ + for (auto it : g_createFileList) { + int fd = creat(it.c_str(), g_defaultFileMode); + g_createFdList.push_back(fd); + } +} + +static void AddFile() +{ + for (auto it : g_addFileList) { + int fd = creat(it.c_str(), g_defaultFileMode); + if (fd < 0) { + return; + } + write(fd, "testcase", 1); + close(fd); + } + + return; +} + +static void DeleteFile() +{ + for (auto it : g_createFileList) { + for (auto fd : g_createFdList) { + close(fd); + } + remove(it.c_str()); + } + for (auto it : g_addFileList) { + remove(it.c_str()); + } + return; +} + +static bool CheckFileList() +{ + sort(g_expectFileList.begin(), g_expectFileList.end()); + if (g_expectFileList.size() != g_cmpFileList.size()) { + return false; + } + + for (size_t i = 0; i < g_expectFileList.size(); i++) { + char fullpath[PATH_MAX + 1] = {0}; + realpath(g_expectFileList.at(i).c_str(), fullpath); + if (g_cmpFileList.at(i) != fullpath) { + return false; + } + } + + return true; +} + +/** + * @tc.name: plugin + * @tc.desc: Monitor the plugin loading in the test directory. + * @tc.type: FUNC + */ +HWTEST_F(PluginWatchTest, SingleWatchDirTest, TestSize.Level1) +{ + auto pluginManage = std::make_shared(); + MockPluginWatcher watcher(pluginManage); + + EXPECT_CALL(watcher, OnPluginAdded(testing::_)).WillRepeatedly(testing::Invoke(OnPluginAddedStub)); + EXPECT_CALL(watcher, OnPluginRemoved(testing::_)).WillRepeatedly(testing::Invoke(OnPluginRemovedStub)); + + g_createFdList.clear(); + CreateFile(); + watcher.ScanPlugins(DEFAULT_TEST_PATH); + watcher.WatchPlugins(DEFAULT_TEST_PATH); + usleep(TEMP_DELAY); + AddFile(); + usleep(TEMP_DELAY); + EXPECT_EQ(CheckFileList(), false); + DeleteFile(); + usleep(TEMP_DELAY); + EXPECT_EQ(g_cmpFileList.empty(), true); +} + +/** + * @tc.name: plugin + * @tc.desc: Plug-in process exception test. + * @tc.type: FUNC + */ +HWTEST_F(PluginWatchTest, OnPluginAdded, TestSize.Level1) +{ + const auto pluginManage = std::make_shared(); + PluginWatcher pluginWatcher(pluginManage); + pluginWatcher.OnPluginAdded(""); + pluginWatcher.OnPluginRemoved(""); +} +} // namespace diff --git a/device/plugins/api/test/unittest/services_ipc_test.cpp b/device/plugins/api/test/unittest/services_ipc_test.cpp new file mode 100644 index 000000000..50ba6cf01 --- /dev/null +++ b/device/plugins/api/test/unittest/services_ipc_test.cpp @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "client_map.h" +#include "plugin_service.ipc.h" +#include "service_entry.h" +#include "socket_context.h" +#include "unix_socket_client.h" +#include "unix_socket_server.h" + +using namespace testing::ext; + +namespace { +class ServicesIpcTest : public ::testing::Test { +protected: + static constexpr auto TEMP_DELAY = std::chrono::milliseconds(10); + static void SetUpTestCase() {} + static void TearDownTestCase() {} +}; + +/** + * @tc.name: ipc + * @tc.desc: Socket send/recv interface. + * @tc.type: FUNC + */ +HWTEST_F(ServicesIpcTest, ProtocolProc, TestSize.Level1) +{ + ServiceBase serviceBase; + SocketContext socketContext; + ASSERT_FALSE(serviceBase.ProtocolProc(socketContext, 0, nullptr, 0)); + ASSERT_TRUE(!socketContext.SendRaw(-1, nullptr, 0, 0)); + ASSERT_TRUE(!socketContext.SendFileDescriptor(-1)); + ASSERT_EQ(socketContext.ReceiveFileDiscriptor(), -1); + ASSERT_EQ(socketContext.RawProtocolProc(-1, nullptr, -1), -1); +} + +/** + * @tc.name: ipc + * @tc.desc: Client link. + * @tc.type: FUNC + */ +HWTEST_F(ServicesIpcTest, ClientSocket, TestSize.Level1) +{ + ServiceEntry serviceEntry; + ClientMap::GetInstance().PutClientSocket(0, serviceEntry); + ASSERT_EQ(ClientMap::GetInstance().AutoRelease(), 1); + + ClientConnection* clientConnection = new ClientConnection(0, serviceEntry); + ASSERT_EQ(clientConnection->RawProtocolProc(-1, nullptr, 0), -1); +} + +/** + * @tc.name: plugin + * @tc.desc: Abnormal client link. + * @tc.type: FUNC + */ +HWTEST_F(ServicesIpcTest, unixSocketClient, TestSize.Level1) +{ + UnixSocketClient unixSocketClient; + ServiceBase serviceBase; + ASSERT_TRUE(!unixSocketClient.Connect("asdf", serviceBase)); +} + +/** + * @tc.name: plugin + * @tc.desc: Start unixSocket Server. + * @tc.type: FUNC + */ +HWTEST_F(ServicesIpcTest, UnixSocketServer, TestSize.Level1) +{ + UnixSocketServer unixSocketServer; + + unixSocketServer.UnixSocketAccept(nullptr); + + ServiceEntry serviceEntry; + ASSERT_TRUE(unixSocketServer.StartServer("", serviceEntry)); +} + +/** + * @tc.name: plugin + * @tc.desc: Server process monitoring. + * @tc.type: FUNC + */ +HWTEST_F(ServicesIpcTest, ServiceEntry, TestSize.Level1) +{ + ServiceEntry serviceEntry; + IPluginServiceServer pluginService; + serviceEntry.StartServer("test_unix_socket_service_entry"); + serviceEntry.RegisterService(pluginService); + serviceEntry.FindServiceByName(pluginService.serviceName_); + + std::this_thread::sleep_for(TEMP_DELAY); + + GetTimeMS(); + GetTimeUS(); + GetTimeNS(); + + IPluginServiceClient pluginClient; + ASSERT_FALSE(pluginClient.Connect("")); + std::this_thread::sleep_for(TEMP_DELAY); +} +} // namespace \ No newline at end of file diff --git a/device/plugins/api/test/unittest/services_plugin_service_test.cpp b/device/plugins/api/test/unittest/services_plugin_service_test.cpp new file mode 100755 index 000000000..4842db515 --- /dev/null +++ b/device/plugins/api/test/unittest/services_plugin_service_test.cpp @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "plugin_service.h" +#include "plugin_session.h" +#include "profiler_data_repeater.h" + +using namespace testing::ext; +using PluginServicePtr = STD_PTR(shared, PluginService); + +class ServicesPluginServiceTest : public ::testing::Test { +protected: + static void SetUpTestCase() {} + static void TearDownTestCase() {} +}; + +/** + * @tc.name: plugin + * @tc.desc: Session flow test, get session id by plugin name. + * @tc.type: FUNC + */ +HWTEST_F(ServicesPluginServiceTest, PluginService1, TestSize.Level1) +{ + PluginServicePtr pluginService = std::make_shared(); + ProfilerPluginConfig ppc; + ppc.set_name("abc.so"); + ppc.set_plugin_sha256("ASDFAADSF"); + ppc.set_sample_interval(20); + + pluginService->CreatePluginSession(ppc, std::make_shared(4096)); + pluginService->StartPluginSession(ppc); + pluginService->StopPluginSession("abc.so"); + pluginService->DestroyPluginSession("abc.so"); + pluginService->GetPluginIdByName("abc.so"); +} + +/** + * @tc.name: plugin + * @tc.desc: Session flow test, get plugin status. + * @tc.type: FUNC + */ +HWTEST_F(ServicesPluginServiceTest, PluginService2, TestSize.Level1) +{ + PluginServicePtr pluginService = std::make_shared(); + ProfilerPluginConfig ppc; + ppc.set_name("abc.so"); + ppc.set_plugin_sha256("ASDFAADSF"); + ppc.set_sample_interval(20); + + ProfilerSessionConfig::BufferConfig bc; + bc.set_pages(1); + bc.set_policy(ProfilerSessionConfig_BufferConfig_Policy_RECYCLE); + + pluginService->CreatePluginSession(ppc, bc, std::make_shared(4096)); + pluginService->StartPluginSession(ppc); + pluginService->StopPluginSession("abc.so"); + pluginService->GetPluginStatus(); + + PluginInfo pi; + pi.id = 0; + pi.name = "abc.so"; + pi.path = "abc.so"; + pi.sha256 = "asdfasdf"; + pluginService->RemovePluginInfo(pi); +} diff --git a/device/plugins/api/test/unittest/services_profiler_service_test.cpp b/device/plugins/api/test/unittest/services_profiler_service_test.cpp new file mode 100644 index 000000000..ed4a84fce --- /dev/null +++ b/device/plugins/api/test/unittest/services_profiler_service_test.cpp @@ -0,0 +1,435 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "logging.h" +#include "plugin_service.h" +#include "plugin_session.h" +#include "profiler_capability_manager.h" +#include "profiler_data_repeater.h" +#include "profiler_service.h" +#include "result_demuxer.h" +#include "trace_file_reader.h" +#include "trace_file_writer.h" + +using namespace testing::ext; + +namespace { +#if defined(__i386__) || defined(__x86_64__) +const std::string DEFAULT_TEST_PATH("./"); +#else +const std::string DEFAULT_TEST_PATH("/data/local/tmp/"); +#endif + +using PluginServicePtr = STD_PTR(shared, PluginService); +using ProfilerDataRepeaterPtr = STD_PTR(shared, ProfilerDataRepeater); +using ProfilerServicePtr = STD_PTR(shared, ProfilerService); +using ProfilerPluginDataPtr = STD_PTR(shared, ProfilerPluginData); + +constexpr int DATA_MAX_SIZE = 10; + +class ServicesProfilerServiceTest : public ::testing::Test { +protected: + ProfilerPluginConfig config; + ProfilerSessionConfig::BufferConfig bufferConfig; + PluginInfo pluginInfo; + PluginServicePtr service; + ProfilerDataRepeaterPtr repeater; + ProfilerServicePtr service_; + std::unique_ptr context_; + std::atomic requestCounter{0}; + + static void SetUpTestCase() {} + static void TearDownTestCase() {} + + void SetUp() override + { + config.set_name("test_session"); + bufferConfig.set_pages(0); + pluginInfo.name = config.name(); + service = std::make_shared(); + repeater = std::make_shared(DATA_MAX_SIZE); + if (service) { + service->AddPluginInfo(pluginInfo); + } + + service_ = std::make_shared(service); + context_ = std::make_unique(); + } + void TearDown() override + { + if (service) { + service->RemovePluginInfo(pluginInfo); + } + ProfilerCapabilityManager::GetInstance().pluginCapabilities_.clear(); + } +}; + +/** + * @tc.name: plugin + * @tc.desc: Plugin session flow test. + * @tc.type: FUNC + */ +HWTEST_F(ServicesProfilerServiceTest, PluginSession, TestSize.Level1) +{ + auto session = std::make_shared(config, nullptr, nullptr); + EXPECT_NE(session, nullptr); + EXPECT_FALSE(session->IsAvailable()); + + EXPECT_FALSE(session->Create()); + config.set_name("test_session2"); + session = std::make_shared(config, service, repeater); + repeater->Size(); + + session.reset(); + config.set_name("test_session3"); + session = std::make_shared(config, service, repeater); + + ASSERT_NE(session->GetState(), PluginSession::CREATED); + EXPECT_FALSE(session->Start()); + ASSERT_NE(session->GetState(), PluginSession::STARTED); + EXPECT_FALSE(session->Stop()); + ASSERT_NE(session->GetState(), PluginSession::CREATED); + EXPECT_FALSE(session->Destroy()); + EXPECT_EQ(session->GetState(), PluginSession::INITIAL); + + // recreate is OK + EXPECT_FALSE(session->Create()); + EXPECT_FALSE(session->Destroy()); + repeater->Reset(); +} + +/** + * @tc.name: plugin + * @tc.desc: Streaming session test. + * @tc.type: FUNC + */ +HWTEST_F(ServicesProfilerServiceTest, TraceFileWriter, TestSize.Level1) +{ + std::string path = "trace.bin"; + auto writer = std::make_shared(path); + EXPECT_NE(writer, nullptr); + + std::string testData = "Hello, Wrold!"; + EXPECT_EQ(writer->Write(testData.data(), testData.size()), sizeof(uint32_t) + testData.size()); + EXPECT_EQ(writer->Flush(), true); + + ProfilerPluginData pluginData; + pluginData.set_name("ABC"); + pluginData.set_status(0); + pluginData.set_data("DEF"); + EXPECT_GT(writer->Write(pluginData), 0); +} + +/** + * @tc.name: plugin + * @tc.desc: Streaming session test. + * @tc.type: FUNC + */ +HWTEST_F(ServicesProfilerServiceTest, TraceFileReader, TestSize.Level1) +{ + std::string path = "trace-write-msg.bin"; + auto writer = std::make_shared(path); + ASSERT_NE(writer, nullptr); + + constexpr int n = 100; + for (int i = 1; i <= n; i++) { + ProfilerPluginData pluginData{}; + pluginData.set_name("test_name"); + pluginData.set_status(i); + pluginData.set_data("Hello, Wrold!"); + long bytes = writer->Write(pluginData); + EXPECT_EQ(bytes, sizeof(uint32_t) + pluginData.ByteSizeLong()); + HILOG_INFO(LOG_CORE, "[%d/%d] write %ld bytes to %s.", i, n, bytes, path.c_str()); + } + writer.reset(); // make sure write done! + + auto reader = std::make_shared(); + ASSERT_NE(reader, nullptr); + ASSERT_TRUE(reader->Open(path)); + for (int i = 1; i <= n; i++) { + ProfilerPluginData data{}; + long bytes = reader->Read(data); + HILOG_INFO(LOG_CORE, "data = {%s, %d, %s}", data.name().c_str(), data.status(), data.data().c_str()); + HILOG_INFO(LOG_CORE, "read %ld bytes from %s", bytes, path.c_str()); + } + + ASSERT_TRUE(reader->Open(path)); + long bytes = 0; + do { + ProfilerPluginData data{}; + bytes = reader->Read(data); + HILOG_INFO(LOG_CORE, "data = {%s, %d, %s}", data.name().c_str(), data.status(), data.data().c_str()); + HILOG_INFO(LOG_CORE, "read %ld bytes from %s", bytes, path.c_str()); + } while (bytes > 0); + + ASSERT_EQ(reader->Read(nullptr, 0), 0); +} + +/** + * @tc.name: service + * @tc.desc: Streaming session report result test. + * @tc.type: FUNC + */ +HWTEST_F(ServicesProfilerServiceTest, ResultDemuxer1, TestSize.Level1) +{ + std::string path = "demux.bin"; + ProfilerDataRepeaterPtr repeater = std::make_shared(DATA_MAX_SIZE); + + auto demuxer = std::make_shared(repeater); + EXPECT_NE(demuxer, nullptr); + demuxer->SetTraceWriter(nullptr); + + auto writer = std::make_shared(path); + EXPECT_NE(writer, nullptr); + demuxer->SetTraceWriter(writer); + + const int putCount = 20; + const int putDelayUs = 10 * 1000; + demuxer->StartTakeResults(); + std::thread dataProducer([=] { + for (int i = 0; i < putCount; i++) { + auto pluginData = std::make_shared(); + ASSERT_NE(pluginData, nullptr); + pluginData->set_name("test-" + std::to_string(i)); + pluginData->set_status(i); + repeater->PutPluginData(pluginData); + HILOG_DEBUG(LOG_CORE, "put test data %d...", i); + usleep(putDelayUs); + } + repeater->PutPluginData(nullptr); + }); + + HILOG_DEBUG(LOG_CORE, "wating producer thread done..."); + dataProducer.join(); +} + +/** + * @tc.name: service + * @tc.desc: Streaming session report result test. + * @tc.type: FUNC + */ +HWTEST_F(ServicesProfilerServiceTest, ResultDemuxer2, TestSize.Level1) +{ + std::string path = "demux.bin"; + ProfilerDataRepeaterPtr repeater = std::make_shared(DATA_MAX_SIZE); + + auto demuxer = std::make_shared(repeater); + ASSERT_NE(demuxer, nullptr); + + auto writer = std::make_shared(path); + EXPECT_NE(writer, nullptr); + demuxer->SetTraceWriter(writer); + + const int putCount = 30; + const int putDelayUs = 10 * 1000; + demuxer->StartTakeResults(); + std::thread dataProducer([=] { + for (int i = 0; i < putCount; i++) { + auto pluginData = std::make_shared(); + ASSERT_NE(pluginData, nullptr); + pluginData->set_name("AB-" + std::to_string(i)); + pluginData->set_status(i); + + HILOG_DEBUG(LOG_CORE, "put test data %d...", i); + if (!repeater->PutPluginData(pluginData)) { + HILOG_WARN(LOG_CORE, "put test data %d FAILED!", i); + break; + } + usleep(putDelayUs); + } + }); + + usleep((putCount / 2) * putDelayUs); + demuxer->StopTakeResults(); + + repeater->Close(); + HILOG_DEBUG(LOG_CORE, "wating producer thread done..."); + dataProducer.join(); +} + +/** + * @tc.name: server + * @tc.desc: Profiler capacity management. + * @tc.type: FUNC + */ +HWTEST_F(ServicesProfilerServiceTest, ProfilerCapabilityManager, TestSize.Level1) +{ + std::vector caps = ProfilerCapabilityManager::GetInstance().GetCapabilities(); + for (int i = 0; i < caps.size(); i++) { + auto cap = caps[i]; + EXPECT_TRUE(ProfilerCapabilityManager::GetInstance().RemoveCapability(cap.name())); + } + caps.clear(); + + EXPECT_EQ(ProfilerCapabilityManager::GetInstance().GetCapability("xxx"), nullptr); + EXPECT_EQ(ProfilerCapabilityManager::GetInstance().GetCapabilities().size(), 0); + + caps = ProfilerCapabilityManager::GetInstance().GetCapabilities(); + EXPECT_EQ(caps.size(), 0); + + const int n = 10; + for (int i = 0; i < n; i++) { + ProfilerPluginCapability cap; + cap.set_path("/system/lib/libcap_" + std::to_string(i) + ".so"); + cap.set_name("cap_" + std::to_string(i)); + EXPECT_TRUE(ProfilerCapabilityManager::GetInstance().AddCapability(cap)); + EXPECT_EQ(ProfilerCapabilityManager::GetInstance().GetCapabilities().size(), i + 1); + } + + for (int i = 0; i < n; i++) { + ProfilerPluginCapability cap; + cap.set_name("cap_" + std::to_string(i)); + auto capPtr = ProfilerCapabilityManager::GetInstance().GetCapability(cap.name()); + ASSERT_NE(capPtr, nullptr); + EXPECT_EQ(capPtr->name(), cap.name()); + } + + ProfilerPluginCapability cap1; + cap1.set_path("/system/lib/libcap1.so"); + cap1.set_name("cap1"); + EXPECT_TRUE(ProfilerCapabilityManager::GetInstance().AddCapability(cap1)); + + cap1.set_path("/system/lib/libcap2.so"); + EXPECT_TRUE(ProfilerCapabilityManager::GetInstance().UpdateCapability(cap1.name(), cap1)); + EXPECT_TRUE(ProfilerCapabilityManager::GetInstance().RemoveCapability(cap1.name())); + + caps = ProfilerCapabilityManager::GetInstance().GetCapabilities(); + EXPECT_EQ(caps.size(), n); + for (int i = 0; i < caps.size(); i++) { + auto cap = caps[i]; + EXPECT_TRUE(ProfilerCapabilityManager::GetInstance().RemoveCapability(cap.name())); + + EXPECT_EQ(ProfilerCapabilityManager::GetInstance().GetCapabilities().size(), n - (i + 1)); + } +} + +/** + * @tc.name: server + * @tc.desc: Profiler data repeater. + * @tc.type: FUNC + */ +HWTEST_F(ServicesProfilerServiceTest, ProfilerDataRepeater, TestSize.Level1) +{ + const int itemCounts = 10000; + const int bufferSize = itemCounts; + auto inDataRepeater = std::make_shared(bufferSize); + ASSERT_NE(inDataRepeater, nullptr); + + auto outDataRepeater = std::make_shared(bufferSize); + ASSERT_NE(outDataRepeater, nullptr); + + auto f = [](int x) { return 2 * x + 1; }; + std::thread worker([&]() { + for (int i = 0; i < itemCounts; i++) { + auto xData = inDataRepeater->TakePluginData(); + + // compute in worker thread + int x = xData ? std::stoi(xData->data()) : 0; + int y = f(x); + + auto yData = std::make_shared(); + yData->set_data(std::to_string(y)); + outDataRepeater->PutPluginData(yData); + } + }); + + std::vector yVec; + for (int i = 0; i < itemCounts; i++) { + int x0 = i; + auto xData = std::make_shared(); + xData->set_data(std::to_string(x0)); + inDataRepeater->PutPluginData(xData); + + int y0 = f(x0); + yVec.push_back(y0); + } + worker.join(); + + std::vector pluginDataVec; + auto count = outDataRepeater->TakePluginData(pluginDataVec); + EXPECT_EQ(count, yVec.size()); + + for (size_t i = 0; i < pluginDataVec.size(); i++) { + auto yData = pluginDataVec[i]; + int y = yData ? std::stoi(yData->data()) : 0; + EXPECT_EQ(y, yVec[i]); + } +} + +/** + * @tc.name: server + * @tc.desc: Session flow test. + * @tc.type: FUNC + */ +HWTEST_F(ServicesProfilerServiceTest, ProfilerService1, TestSize.Level1) +{ + ASSERT_NE(service_, nullptr); + ASSERT_NE(context_, nullptr); + + GetCapabilitiesRequest request; + GetCapabilitiesResponse response; + + ProfilerPluginCapability cap; + cap.set_name("cap1"); + ProfilerCapabilityManager::GetInstance().AddCapability(cap); + + request.set_request_id(++requestCounter); + auto status = service_->GetCapabilities(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); + EXPECT_GT(response.capabilities_size(), 0); + HILOG_DEBUG(LOG_CORE, "GetCapabilities, capabilities_size = %d", response.capabilities_size()); +} + +/** + * @tc.name: server + * @tc.desc: Session flow test. + * @tc.type: FUNC + */ +HWTEST_F(ServicesProfilerServiceTest, ProfilerService2, TestSize.Level1) +{ + ASSERT_NE(service_, nullptr); + ASSERT_NE(context_, nullptr); + + CreateSessionRequest request; + CreateSessionResponse response; + + auto status = service_->CreateSession(context_.get(), &request, &response); + EXPECT_NE(status.error_code(), grpc::StatusCode::OK); + + StartSessionRequest startrequest; + StartSessionResponse startresponse; + startrequest.set_session_id(0); + startrequest.set_request_id(++requestCounter); + status = service_->StartSession(context_.get(), &startrequest, &startresponse); + EXPECT_NE(status.error_code(), grpc::StatusCode::OK); + + StopSessionRequest stoprequest; + StopSessionResponse stopresponse; + stoprequest.set_session_id(0); + stoprequest.set_request_id(++requestCounter); + status = service_->StopSession(context_.get(), &stoprequest, &stopresponse); + EXPECT_NE(status.error_code(), grpc::StatusCode::OK); + + DestroySessionRequest destroyrequest; + DestroySessionResponse destroyresponse; + destroyrequest.set_session_id(0); + destroyrequest.set_request_id(++requestCounter); + status = service_->DestroySession(context_.get(), &destroyrequest, &destroyresponse); + EXPECT_NE(status.error_code(), grpc::StatusCode::OK); +} +} // namespace diff --git a/device/plugins/api/test/unittest/services_shared_memory_test.cpp b/device/plugins/api/test/unittest/services_shared_memory_test.cpp new file mode 100755 index 000000000..bcec802f0 --- /dev/null +++ b/device/plugins/api/test/unittest/services_shared_memory_test.cpp @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "plugin_service_types.pb.h" +#include "share_memory_allocator.h" +#include "share_memory_block.h" + +using namespace testing::ext; + +namespace { +class ServicesSharedMemoryTest : public ::testing::Test { +protected: + static void SetUpTestCase() {} + static void TearDownTestCase() {} +}; + +/** + * @tc.name: server + * @tc.desc: Shared memory flow test. + * @tc.type: FUNC + */ +HWTEST_F(ServicesSharedMemoryTest, SharedMemoryBlock, TestSize.Level1) +{ + ShareMemoryBlock shareMemoryBlock; + ASSERT_TRUE(shareMemoryBlock.CreateBlock("testname", 1024)); + + shareMemoryBlock.GetName(); + shareMemoryBlock.GetSize(); + shareMemoryBlock.GetfileDescriptor(); + + shareMemoryBlock.SetDropType(ShareMemoryBlock::DropType::DROP_NONE); + int8_t data[100]; + for (int i = 0; i < 20; i++) { + *((uint32_t*)data) = i; + shareMemoryBlock.PutRaw(data, 100); + } + int8_t* p = shareMemoryBlock.GetFreeMemory(100); + ASSERT_TRUE(p == nullptr); + do { + p = const_cast(shareMemoryBlock.GetDataPoint()); + printf("%p,p=%d\n", p, *((int*)p)); + } while (shareMemoryBlock.Next() && shareMemoryBlock.GetDataSize() > 0); + + NotifyResultResponse response; + response.set_status(123); + ASSERT_TRUE(shareMemoryBlock.PutProtobuf(response)); + ASSERT_TRUE(shareMemoryBlock.GetDataSize() > 0); + response.ParseFromArray(shareMemoryBlock.GetDataPoint(), shareMemoryBlock.GetDataSize()); + ASSERT_TRUE(response.status() == 123); + + ASSERT_TRUE(shareMemoryBlock.ReleaseBlock()); +} + +/** + * @tc.name: server + * @tc.desc: Shared memory abnormal flow test. + * @tc.type: FUNC + */ +HWTEST_F(ServicesSharedMemoryTest, SharedMemoryAllocator, TestSize.Level1) +{ + ASSERT_TRUE(ShareMemoryAllocator::GetInstance().CreateMemoryBlockLocal("testname", 1) == + nullptr); // 创建内存块大小<1024,返回空 + ASSERT_TRUE(ShareMemoryAllocator::GetInstance().CreateMemoryBlockLocal("testname", 1024) != nullptr); // 成功创建 + ASSERT_TRUE(ShareMemoryAllocator::GetInstance().CreateMemoryBlockLocal("testname", 1024) == + nullptr); // 创建同名内存块返回空 + + ASSERT_TRUE(ShareMemoryAllocator::GetInstance().ReleaseMemoryBlockLocal("testname")); + ASSERT_FALSE(ShareMemoryAllocator::GetInstance().ReleaseMemoryBlockLocal("or")); // 释放不存在的内存块返回-1 +} +} // namespace \ No newline at end of file diff --git a/device/plugins/api/test/unittest/writer_adapter_test.cpp b/device/plugins/api/test/unittest/writer_adapter_test.cpp new file mode 100755 index 000000000..27ebad777 --- /dev/null +++ b/device/plugins/api/test/unittest/writer_adapter_test.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "writer_adapter.h" +#include +#include + +using namespace testing::ext; + +namespace { +class WriterAdapterTest : public ::testing::Test { +protected: + static void SetUpTestCase() {} + static void TearDownTestCase() {} +}; + +/** + * @tc.name: plugin + * @tc.desc: Write data to shared memory through writer. + * @tc.type: FUNC + */ +HWTEST_F(WriterAdapterTest, Writer, TestSize.Level1) +{ + WriterAdapter writerAdapter; + writerAdapter.GetWriter(); + writerAdapter.GetStruct(); +} + +/** + * @tc.name: plugin + * @tc.desc: Write data to shared memory through writer. + * @tc.type: FUNC + */ +HWTEST_F(WriterAdapterTest, Func, TestSize.Level1) +{ + WriterAdapter writerAdapter; + writerAdapter.WriteFunc(nullptr, nullptr, 0); + writerAdapter.FlushFunc(nullptr); +} +} // namespace \ No newline at end of file diff --git a/device/plugins/bytrace_plugin/BUILD.gn b/device/plugins/bytrace_plugin/BUILD.gn new file mode 100755 index 000000000..1881f832b --- /dev/null +++ b/device/plugins/bytrace_plugin/BUILD.gn @@ -0,0 +1,61 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("../../base/config.gni") + +config("bytraceplugin_config") { + include_dirs = [ + "../api/include", + "${OHOS_PROFILER_DIR}/interfaces/kits", + "../../services/profiler_service/src", + "../../base/include", + "include", + "//utils/native/base/include", + ] +} + +ohos_shared_library("bytraceplugin") { + output_name = "bytraceplugin" + sources = [ + "src/bytrace_module.cpp", + ] + public_configs = [ ":bytraceplugin_config" ] + public_deps = [ + "${OHOS_PROFILER_DIR}/protos/types/plugins/bytrace_plugin:bytrace_plugin_protos_cpp", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc_lib", + ] + if (current_toolchain != host_toolchain) { + defines = [ "HAVE_HILOG" ] + if (build_l2) { + external_deps = [ "shared_library:libhilog" ] + } else { + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + } + } + install_enable = true + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} + +ohos_executable("test_bytraceplugin") { + output_name = "test_bytraceplugin" + sources = [ + "src/run_test.cpp", + ] + deps = [ + ":bytraceplugin", + ] + install_enable = true + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} diff --git a/device/plugins/bytrace_plugin/include/bytrace_module.h b/device/plugins/bytrace_plugin/include/bytrace_module.h new file mode 100755 index 000000000..70e5d141f --- /dev/null +++ b/device/plugins/bytrace_plugin/include/bytrace_module.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BYTRACE_MODULE_H +#define BYTRACE_MODULE_H + +#include "plugin_module_api.h" + +int BytracePluginSessionStart(const uint8_t* configData, const uint32_t configSize); + +int BytraceRegisterWriterStruct(WriterStruct* writer); + +int BytracePluginSessionStop(); + +#endif // BYTRACE_MODULE_H \ No newline at end of file diff --git a/device/plugins/bytrace_plugin/src/bytrace_module.cpp b/device/plugins/bytrace_plugin/src/bytrace_module.cpp new file mode 100644 index 000000000..de2e2005b --- /dev/null +++ b/device/plugins/bytrace_plugin/src/bytrace_module.cpp @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "bytrace_module.h" + +#include +#include +#include +#include +#include +#include + +#include "bytrace_plugin_config.pb.h" +#include "logging.h" +#include "securec.h" + +namespace { +const std::string CMD_PATH = "/system/bin/bytrace"; +int g_processNum = -1; +constexpr uint32_t MAX_BUFFER_SIZE = 4 * 1024 * 1024; + +bool RunWithConfig(const BytracePluginConfig& config) +{ + std::vector args; + args.push_back("bytrace"); + if (config.buffe_size() != 0) { + args.push_back("-b"); + args.push_back(std::to_string(config.buffe_size())); + } + if (config.time() != 0) { + args.push_back("-t"); + args.push_back(std::to_string(config.time())); + } + if (!config.clock().empty()) { + args.push_back("--trace_clock"); + args.push_back(config.clock()); + } + if (!config.outfile_name().empty()) { + args.push_back("-o"); + args.push_back(config.outfile_name()); + } + if (!config.categories().empty()) { + for (std::string category : config.categories()) { + args.push_back(category); + } + } + + std::vector params; + std::string cmdPrintStr = ""; + for (std::string& it : args) { + cmdPrintStr += (it + " "); + params.push_back(const_cast(it.c_str())); + } + params.push_back(nullptr); + HILOG_INFO(LOG_CORE, "call bytrace::Run: %s", cmdPrintStr.c_str()); + + execv(CMD_PATH.data(), ¶ms[0]); + return true; +} +} // namespace + +int BytracePluginSessionStart(const uint8_t* configData, const uint32_t configSize) +{ + BytracePluginConfig config; + HILOG_INFO(LOG_CORE, "BytracePluginSessionStart %u", configSize); + CHECK_TRUE(config.ParseFromArray(configData, configSize), 0, "parse config FAILED!"); + + g_processNum = fork(); + CHECK_TRUE(g_processNum >= 0, -1, "create process FAILED!"); + + if (g_processNum == 0) { + // child process + CHECK_TRUE(RunWithConfig(config), 0, "run bytrace FAILED!"); + _exit(0); + } + + return 0; +} + +int BytraceRegisterWriterStruct(const WriterStruct* writer) +{ + return 0; +} + +int BytracePluginSessionStop() +{ + if (g_processNum > 0) { + // parent process + int status = 0; + // judge if child process have exited. + if (waitpid(g_processNum, &status, WNOHANG) == 0) { + // send SIGKILL to child process. + if (kill(g_processNum, SIGINT)) { + HILOG_WARN(LOG_CORE, "BytracePluginSessionStop kill child process failed."); + } else { + HILOG_INFO(LOG_CORE, "BytracePluginSessionStop kill child process success."); + } + } + // report child process exit status. + if (WIFEXITED(status)) { + HILOG_INFO(LOG_CORE, "child %d exit with status %d!", g_processNum, + WEXITSTATUS(static_cast(status))); + } else if (WIFSIGNALED(status)) { + HILOG_INFO(LOG_CORE, "child %d exit with signal %d!", g_processNum, + WTERMSIG(static_cast(status))); + } else if (WIFSTOPPED(status)) { + HILOG_INFO(LOG_CORE, "child %d stopped by signal %d", g_processNum, + WSTOPSIG(static_cast(status))); + } else { + HILOG_INFO(LOG_CORE, "child %d otherwise", g_processNum); + } + } + return 0; +} + +static PluginModuleCallbacks g_callbacks = { + BytracePluginSessionStart, + nullptr, // onPluginReportResult + BytracePluginSessionStop, + BytraceRegisterWriterStruct, +}; + +PluginModuleStruct g_pluginModule = {&g_callbacks, "bytrace_plugin", MAX_BUFFER_SIZE}; diff --git a/device/plugins/bytrace_plugin/src/run_test.cpp b/device/plugins/bytrace_plugin/src/run_test.cpp new file mode 100644 index 000000000..b07c0681b --- /dev/null +++ b/device/plugins/bytrace_plugin/src/run_test.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "bytrace_module.h" +#include "bytrace_plugin_config.pb.h" +#include "logging.h" + +namespace { +constexpr uint32_t TRACE_TIME = 8; +constexpr uint32_t WAIT_TIME = 9; +constexpr uint32_t BUFFE_SIZE = 1024; +} + +int main() +{ + WriterStruct writer; + BytraceRegisterWriterStruct(&writer); + + BytracePluginConfig config; + config.set_clock("boot"); + config.set_time(TRACE_TIME); + config.set_buffe_size(BUFFE_SIZE); + config.set_outfile_name("/data/local/tmp/bytrace.txt"); + config.add_categories("sched"); + + std::vector buffer(config.ByteSizeLong()); + CHECK_TRUE(config.SerializeToArray(buffer.data(), buffer.size()), 0, "Serialize config FAILED!"); + CHECK_TRUE(BytracePluginSessionStart(reinterpret_cast(buffer.data()), buffer.size()) == 0, 0, + "call start callback FAILED!"); + sleep(WAIT_TIME); + BytracePluginSessionStop(); + return 0; +} diff --git a/device/plugins/memory_plugin/BUILD.gn b/device/plugins/memory_plugin/BUILD.gn new file mode 100755 index 000000000..cb3fe7330 --- /dev/null +++ b/device/plugins/memory_plugin/BUILD.gn @@ -0,0 +1,49 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("../../base/config.gni") + +ohos_shared_library("memdataplugin") { + output_name = "memdataplugin" + sources = [ + "src/buffer_splitter.cpp", + "src/memory_data_plugin.cpp", + "src/memory_module.cpp", + "src/smaps_stats.cpp", + ] + include_dirs = [ + "include", + "../api/include", + "${OHOS_PROFILER_DIR}/interfaces/kits", + "${OHOS_PROFILER_DIR}/device/base/include", + "//utils/native/base/include", + ] + deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc_lib", + "${OHOS_PROFILER_DIR}/protos/types/plugins/memory_data:memory_data_cpp", + "//utils/native/base:utilsbase", + ] + if (current_toolchain != host_toolchain) { + defines = [ "HAVE_HILOG" ] + if (build_l2) { + external_deps = [ "shared_library:libhilog" ] + } else { + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + } + } + public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ] + install_enable = true + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} diff --git a/device/plugins/memory_plugin/include/buffer_splitter.h b/device/plugins/memory_plugin/include/buffer_splitter.h new file mode 100755 index 000000000..0aee7ec05 --- /dev/null +++ b/device/plugins/memory_plugin/include/buffer_splitter.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _BUFFER_SPLITTER_H_ +#define _BUFFER_SPLITTER_H_ + +#include + +/** + * Description: Buffer Splitter Class + * The BufferSplitter class object splits the buffer content by moving the pointer + * Except for the last character, other buffer contents are not modified during the segmentation + */ + +class BufferSplitter { +public: + /* During construction, buf[size-1] will be forcibly modified to '\ 0' + The constructor will automatically call the NextLine to initialize the first line of data */ + BufferSplitter(const char* buf, int size); + + ~BufferSplitter() {} + /* Find and update the next line header pointer, and line length. Length does not include '\ n' and '\ 0' */ + bool NextLine(); + + /* Find and update the NextWord's head pointer and Word length according to the delimiter within the + current line range. The length calculation does not include the 'delimiter' */ + /* When the current line cannot find a specific 'delimiter', it can + be split from the current position according to the new 'delimiter' */ + bool NextWord(char delimiter); + + const char* CurWord() + { + return curWord_; + } + size_t CurWordSize() const + { + return curWordSize_; + } + char* CurLine() + { + return curLine_; + } + size_t CurLineSize() const + { + return curLineSize_; + } + +private: + char* curWord_ = nullptr; + size_t curWordSize_ = 0; + char* next_; + char* curLine_ = nullptr; + size_t curLineSize_ = 0; + char* nextLine_; + char* end_; +}; +#endif diff --git a/device/plugins/memory_plugin/include/memory_data_plugin.h b/device/plugins/memory_plugin/include/memory_data_plugin.h new file mode 100755 index 000000000..99a648d61 --- /dev/null +++ b/device/plugins/memory_plugin/include/memory_data_plugin.h @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MEMORY_DATA_PLUGIN_H +#define MEMORY_DATA_PLUGIN_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "logging.h" +#include "memory_plugin_config.pb.h" +#include "memory_plugin_result.pb.h" +#include "smaps_stats.h" + +struct Proto2StrMapping { + int protobufid; + const char* procstr; +}; + +constexpr Proto2StrMapping meminfoMapping[] = { + {SysMeminfoType::MEMINFO_UNSPECIFIED, "MemUnspecified"}, + {SysMeminfoType::MEMINFO_MEM_TOTAL, "MemTotal"}, + {SysMeminfoType::MEMINFO_MEM_FREE, "MemFree"}, + {SysMeminfoType::MEMINFO_MEM_AVAILABLE, "MemAvailable"}, + {SysMeminfoType::MEMINFO_BUFFERS, "Buffers"}, + {SysMeminfoType::MEMINFO_CACHED, "Cached"}, + {SysMeminfoType::MEMINFO_SWAP_CACHED, "SwapCached"}, + {SysMeminfoType::MEMINFO_ACTIVE, "Active"}, + {SysMeminfoType::MEMINFO_INACTIVE, "Inactive"}, + {SysMeminfoType::MEMINFO_ACTIVE_ANON, "Active(anon)"}, + {SysMeminfoType::MEMINFO_INACTIVE_ANON, "Inactive(anon)"}, + {SysMeminfoType::MEMINFO_ACTIVE_FILE, "Active(file)"}, + {SysMeminfoType::MEMINFO_INACTIVE_FILE, "Inactive(file)"}, + {SysMeminfoType::MEMINFO_UNEVICTABLE, "Unevictable"}, + {SysMeminfoType::MEMINFO_MLOCKED, "Mlocked"}, + {SysMeminfoType::MEMINFO_SWAP_TOTAL, "SwapTotal"}, + {SysMeminfoType::MEMINFO_SWAP_FREE, "SwapFree"}, + {SysMeminfoType::MEMINFO_DIRTY, "Dirty"}, + {SysMeminfoType::MEMINFO_WRITEBACK, "Writeback"}, + {SysMeminfoType::MEMINFO_ANON_PAGES, "AnonPages"}, + {SysMeminfoType::MEMINFO_MAPPED, "Mapped"}, + {SysMeminfoType::MEMINFO_SHMEM, "Shmem"}, +}; + +struct ProcStatusMapping { + int procid; + const char* procstr; +}; + +enum StatusType { + PRO_TGID = 1, + PRO_NAME, + PRO_VMSIZE, + PRO_VMRSS, + PRO_RSSANON, + PRO_RSSFILE, + PRO_RSSSHMEM, + PRO_VMSWAP, + PRO_VMLCK, + PRO_VMHWM, +}; + +constexpr ProcStatusMapping procStatusMapping[] = { + {StatusType::PRO_TGID, "Tgid"}, {StatusType::PRO_NAME, "Name"}, {StatusType::PRO_VMSIZE, "VmSize"}, + {StatusType::PRO_VMRSS, "VmRSS"}, {StatusType::PRO_RSSANON, "RssAnon"}, {StatusType::PRO_RSSFILE, "RssFile"}, + {StatusType::PRO_RSSSHMEM, "RssShmem"}, {StatusType::PRO_VMSWAP, "VmSwap"}, {StatusType::PRO_VMLCK, "VmLck"}, + {StatusType::PRO_VMHWM, "VmHWM"}, +}; + +enum ErrorType { + RET_NULL_ADDR, + RET_IVALID_PID, + RET_TGID_VALUE_NULL, + RET_FAIL = -1, + RET_SUCC = 0, +}; + +enum FileType { + FILE_STATUS = 0, + FILE_OOM, + FILE_SMAPS, +}; + +struct ProcfdMapping { + int procid; + const char* file; +}; + +constexpr ProcfdMapping procfdMapping[] = { + {FileType::FILE_STATUS, "status"}, + {FileType::FILE_OOM, "oom_score_adj"}, + {FileType::FILE_SMAPS, "smaps"}, +}; + +class MemoryDataPlugin { +public: + MemoryDataPlugin(); + ~MemoryDataPlugin(); + int Start(const uint8_t* configData, uint32_t configSize); + int Report(uint8_t* configData, uint32_t configSize); + int Stop(); + void SetPath(char* path) + { + testpath_ = path; + }; + void WriteProcesseList(MemoryData& data); + void WriteProcinfoByPidfds(ProcessMemoryInfo* processinfo, int32_t pid); + DIR* OpenDestDir(const char* dirPath); + int32_t GetValidPid(DIR* dirp); + // for test change static + int ParseNumber(std::string line); + +private: + /* data */ + MemoryConfig protoConfig_; + + void* buffer_; + int meminfoFd_; + int vmstatFd_; + std::map meminfoCounters_; + + void InitProto2StrVector(); + std::vector meminfoStrList_; + // SmapsStats * + void WriteVmstat(MemoryData& data); + void WriteMeminfo(MemoryData& data); + + std::unordered_map> pidFds_; + std::vector seenPids_; + char* testpath_; + int32_t err_; + int32_t ReadFile(int fd); + std::vector OpenProcPidFiles(int32_t pid); + int32_t ReadProcPidFile(int32_t pid, const char* pFileName); + void WriteProcessInfo(MemoryData& data, int32_t pid); + void SetEmptyProcessInfo(ProcessMemoryInfo* processinfo); + void WriteOomInfo(ProcessMemoryInfo* processinfo, int32_t pid); + void WriteProcess(ProcessMemoryInfo* processinfo, const char* pFile, uint32_t fileLen, int32_t pid); + void WriteAppsummary(ProcessMemoryInfo* processinfo, SmapsStats& smapInfo); + void SetProcessInfo(ProcessMemoryInfo* processinfo, int key, const char* word); + + bool BufnCmp(const char* src, int srcLen, const char* key, int keyLen); + bool addPidBySort(int32_t pid); + int GetProcStatusId(const char* src, int srcLen); + + bool ParseMemInfo(const char* data, ProcessMemoryInfo* memoryInfo); + bool GetMemInfoByDumpsys(uint32_t pid, ProcessMemoryInfo* memoryInfo); +}; + +#endif diff --git a/device/plugins/memory_plugin/include/smaps_stats.h b/device/plugins/memory_plugin/include/smaps_stats.h new file mode 100755 index 000000000..09624e5d0 --- /dev/null +++ b/device/plugins/memory_plugin/include/smaps_stats.h @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SMAPS_STATS_H +#define SMAPS_STATS_H + +#include "logging.h" +#include +#include +#include +#include +#include +#include +#include +#include + +struct stats_t { + int pss; + int swappablePss; + int rss; + int privateDirty; + int sharedDirty; + int privateClean; + int sharedClean; + int swappedOut; + int swappedOutPss; +}; + +enum NumType { + FIFTH_FIELD = 5, + HEX_BASE = 16, + DEC_BASE = 10, +}; + +struct MapPiecesInfo_t { + uint64_t start_addr; + uint64_t end_addr; + + std::string name; +}; + +struct MemUsageInfo_t { + uint64_t vss; + uint64_t rss; + uint64_t pss; + uint64_t uss; + + uint64_t swap; + uint64_t swap_pss; + + uint64_t private_clean; + uint64_t private_dirty; + uint64_t shared_clean; + uint64_t shared_dirty; +}; + +enum vmemifoType { + VMHEAP_NULL = -2, + VMHEAP_NEEDFIX = -1, + VMHEAP_UNKNOWN, + VMHEAP_DALVIK, + VMHEAP_NATIVE, + + VMHEAP_DALVIK_OTHER, + VMHEAP_STACK, + VMHEAP_CURSOR, + VMHEAP_ASHMEM, + VMHEAP_GL_DEV, + VMHEAP_UNKNOWN_DEV, + VMHEAP_SO, + VMHEAP_JAR, + VMHEAP_TTF, + VMHEAP_DEX, + VMHEAP_OAT, + VMHEAP_ART, + VMHEAP_UNKNOWN_MAP, + VMHEAP_GRAPHICS, + VMHEAP_GL, + VMHEAP_OTHER_MEMTRACK, + + // Dalvik extra sections (heap). + VMHEAP_DALVIK_NORMAL, + VMHEAP_DALVIK_LARGE, + VMHEAP_DALVIK_ZYGOTE, + VMHEAP_DALVIK_NON_MOVING, + + // Dalvik other extra sections. + VMHEAP_DALVIK_OTHER_LINEARALLOC, + VMHEAP_DALVIK_OTHER_ACCOUNTING, + VMHEAP_DALVIK_OTHER_ZYGOTE_CODE_CACHE, + VMHEAP_DALVIK_OTHER_APP_CODE_CACHE, + VMHEAP_DALVIK_OTHER_COMPILER_METADATA, + VMHEAP_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE, + + // Boot vdex / app dex / app vdex + VMHEAP_DEX_BOOT_VDEX, + VMHEAP_DEX_APP_DEX, + VMHEAP_DEX_APP_VDEX, + + // App art, boot art. + VMHEAP_ART_APP, + VMHEAP_ART_BOOT, + + _NUM_HEAP, + _NUM_EXCLUSIVE_HEAP = VMHEAP_OTHER_MEMTRACK + 1, + _NUM_CORE_HEAP = VMHEAP_NATIVE + 1 +}; + +enum OpsType { + OPS_START = 1, + OPS_END, +}; + +struct vMeminfoAreaMapping { + int ops; + const char* heapstr; + int heapid[2]; +}; + +constexpr vMeminfoAreaMapping vmaMemheap[] = { + {OpsType::OPS_START, "[heap]", {vmemifoType::VMHEAP_NATIVE, vmemifoType::VMHEAP_NULL}}, + {OpsType::OPS_START, "[stack", {vmemifoType::VMHEAP_STACK, vmemifoType::VMHEAP_NULL}}, +}; + +// [anon: +constexpr vMeminfoAreaMapping vmaMemanon[] = { + {OpsType::OPS_START, "[anon:libc_malloc]", {vmemifoType::VMHEAP_NATIVE, vmemifoType::VMHEAP_NULL}}, + {OpsType::OPS_START, "[anon:scudo:", {vmemifoType::VMHEAP_NATIVE, vmemifoType::VMHEAP_NULL}}, + {OpsType::OPS_START, "[anon:GWP-ASan", {vmemifoType::VMHEAP_NATIVE, vmemifoType::VMHEAP_NULL}}, + {OpsType::OPS_START, "[anon:stack_and_tls:", {vmemifoType::VMHEAP_STACK, vmemifoType::VMHEAP_NULL}}, + {OpsType::OPS_START, + "[anon:dalvik-LinearAlloc", + {vmemifoType::VMHEAP_DALVIK_OTHER, vmemifoType::VMHEAP_DALVIK_OTHER_LINEARALLOC}}, + {OpsType::OPS_START, "[anon:dalvik-alloc space", {vmemifoType::VMHEAP_DALVIK, vmemifoType::VMHEAP_DALVIK_NORMAL}}, + {OpsType::OPS_START, "[anon:dalvik-main space", {vmemifoType::VMHEAP_DALVIK, vmemifoType::VMHEAP_DALVIK_NORMAL}}, + {OpsType::OPS_START, + "[anon:dalvik-large object space", + {vmemifoType::VMHEAP_DALVIK, vmemifoType::VMHEAP_DALVIK_LARGE}}, + {OpsType::OPS_START, + "[anon:dalvik-free list large object space", + {vmemifoType::VMHEAP_DALVIK, vmemifoType::VMHEAP_DALVIK_LARGE}}, + {OpsType::OPS_START, + "[anon:dalvik-non moving space", + {vmemifoType::VMHEAP_DALVIK, vmemifoType::VMHEAP_DALVIK_NON_MOVING}}, + {OpsType::OPS_START, "[anon:dalvik-zygote space", {vmemifoType::VMHEAP_DALVIK, vmemifoType::VMHEAP_DALVIK_ZYGOTE}}, + {OpsType::OPS_START, + "[anon:dalvik-indirect ref", + {vmemifoType::VMHEAP_DALVIK_OTHER, vmemifoType::VMHEAP_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE}}, + {OpsType::OPS_START, + "[anon:dalvik-jit-code-cache", + {vmemifoType::VMHEAP_DALVIK_OTHER, vmemifoType::VMHEAP_DALVIK_OTHER_APP_CODE_CACHE}}, + {OpsType::OPS_START, + "[anon:dalvik-data-code-cache", + {vmemifoType::VMHEAP_DALVIK_OTHER, vmemifoType::VMHEAP_DALVIK_OTHER_APP_CODE_CACHE}}, + {OpsType::OPS_START, + "[anon:dalvik-CompilerMetadata", + {vmemifoType::VMHEAP_DALVIK_OTHER, vmemifoType::VMHEAP_DALVIK_OTHER_COMPILER_METADATA}}, + {OpsType::OPS_START, + "[anon:dalvik-", + {vmemifoType::VMHEAP_DALVIK_OTHER, vmemifoType::VMHEAP_DALVIK_OTHER_ACCOUNTING}}, + {OpsType::OPS_START, "[anon:", {vmemifoType::VMHEAP_UNKNOWN, vmemifoType::VMHEAP_NULL}}, +}; + +constexpr vMeminfoAreaMapping vmaMemfd[] = { + {OpsType::OPS_START, + "/memfd:jit-cache", + {vmemifoType::VMHEAP_DALVIK_OTHER, vmemifoType::VMHEAP_DALVIK_OTHER_APP_CODE_CACHE}}, + {OpsType::OPS_START, + "/memfd:jit-zygote-cache", + {vmemifoType::VMHEAP_DALVIK_OTHER, vmemifoType::VMHEAP_DALVIK_OTHER_ZYGOTE_CODE_CACHE}}, +}; +// dev +constexpr vMeminfoAreaMapping vmaMemdev[] = { + {OpsType::OPS_START, "/dev/kgsl-3d0", {vmemifoType::VMHEAP_GL_DEV, vmemifoType::VMHEAP_NULL}}, + {OpsType::OPS_START, "/dev/ashmem/CursorWindow", {vmemifoType::VMHEAP_CURSOR, vmemifoType::VMHEAP_NULL}}, + {OpsType::OPS_START, + "/dev/ashmem/jit-zygote-cache", + {vmemifoType::VMHEAP_DALVIK_OTHER, vmemifoType::VMHEAP_DALVIK_OTHER_ZYGOTE_CODE_CACHE}}, + {OpsType::OPS_START, "/dev/ashmem", {vmemifoType::VMHEAP_ASHMEM, vmemifoType::VMHEAP_NULL}}, + {OpsType::OPS_START, "/dev/", {vmemifoType::VMHEAP_UNKNOWN_DEV, vmemifoType::VMHEAP_NULL}}, +}; + +constexpr vMeminfoAreaMapping vmaMemsuffix[] = { + {OpsType::OPS_END, ".so", {vmemifoType::VMHEAP_SO, vmemifoType::VMHEAP_NULL}}, + {OpsType::OPS_END, ".jar", {vmemifoType::VMHEAP_JAR, vmemifoType::VMHEAP_NULL}}, + {OpsType::OPS_END, ".ttf", {vmemifoType::VMHEAP_TTF, vmemifoType::VMHEAP_NULL}}, + {OpsType::OPS_END, ".oat", {vmemifoType::VMHEAP_OAT, vmemifoType::VMHEAP_NULL}}, + + {OpsType::OPS_END, ".odex", {vmemifoType::VMHEAP_DEX, vmemifoType::VMHEAP_DEX_APP_DEX}}, + + {OpsType::OPS_END, ".vdex", {vmemifoType::VMHEAP_DEX, vmemifoType::VMHEAP_NEEDFIX}}, + {OpsType::OPS_END, ".art", {vmemifoType::VMHEAP_ART, vmemifoType::VMHEAP_NEEDFIX}}, + {OpsType::OPS_END, ".art]", {vmemifoType::VMHEAP_ART, vmemifoType::VMHEAP_NEEDFIX}}, +}; + +class SmapsStats { +public: + SmapsStats() {} + SmapsStats(const std::string path) : testpath_(path){}; + ~SmapsStats() {} + bool ParseMaps(int pid); + int GetProcessJavaHeap(); + int GetProcessNativeHeap(); + int GetProcessCode(); + int GetProcessStack(); + int GetProcessGraphics(); + int GetProcessPrivateOther(); + int GetProcessSystem(); + +private: + stats_t stats_[_NUM_HEAP] = {{0}}; + bool lastline_ = false; + std::string testpath_; + + int GetTotalPrivateClean(); + int GetTotalPrivateDirty(); + int GetPrivate(int type); + int GetTotalPss(); + int GetTotalSwappedOutPss(); + void ReviseStatsData(); + + bool ReadVmemareasFile(const std::string& path); + bool ParseMapHead(std::string& line, MapPiecesInfo_t& head); + bool SetMapAddrInfo(std::string& line, MapPiecesInfo_t& head); + bool GetMemUsageField(std::string& line, MemUsageInfo_t& memusage); + void CollectVmemAreasData(const MapPiecesInfo_t& mempic, + const MemUsageInfo_t& memusage, + uint64_t& prevEnd, + int& prevHeap); + bool GetVmaIndex(std::string name, uint32_t namesz, int32_t heapIndex[2], bool& swappable); + uint64_t GetSwapablepssValue(const MemUsageInfo_t& memusage, bool swappable); + void SetVmemAreasData(int index, uint64_t swapablePss, const MemUsageInfo_t& usage); + void HeapIndexFix(std::string name, const char* key, int32_t heapIndex[2]); + bool GetVMAStuId(int ops, + std::string name, + const vMeminfoAreaMapping* vma, + int count, + int32_t heapIndex[2], + bool& swappable); +}; + +#endif \ No newline at end of file diff --git a/device/plugins/memory_plugin/src/buffer_splitter.cpp b/device/plugins/memory_plugin/src/buffer_splitter.cpp new file mode 100755 index 000000000..a69ef8ebd --- /dev/null +++ b/device/plugins/memory_plugin/src/buffer_splitter.cpp @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "buffer_splitter.h" + +BufferSplitter::BufferSplitter(const char* buf, int size) +{ + next_ = const_cast(buf); + nextLine_ = const_cast(buf); + end_ = next_ + size; + if (size) { + next_[size - 1] = '\0'; + NextLine(); + } +} + +bool BufferSplitter::NextLine() +{ + char delimiter = '\n'; + curLine_ = nullptr; + curLineSize_ = 0; + curWord_ = nullptr; + curWordSize_ = 0; + + if (next_ < end_) { + next_ = nextLine_; + } + for (; next_ < end_; next_++) { + if (*next_ == delimiter) { + continue; + } + curLine_ = next_; + while (true) { + if (++next_ >= end_) { + curLineSize_ = static_cast(end_ - curLine_ - 1); + next_ = curLine_; + nextLine_ = end_; + break; + } + if (*next_ == delimiter) { + nextLine_ = ++next_; + next_ = curLine_; + curLineSize_ = static_cast(nextLine_ - curLine_ - 1); + break; + } + } + if (curLineSize_ > 0) { + return true; + } + curLine_ = nullptr; + break; + } + return false; +} + +bool BufferSplitter::NextWord(char delimiter) +{ + char* nextBak = next_; + curWord_ = nullptr; + curWordSize_ = 0; + + for (; next_ < nextLine_; next_++) { + if (isspace(*next_) || *next_ == delimiter) { + continue; + } + curWord_ = next_; + while (true) { + if (++next_ >= nextLine_) { + curWordSize_ = 0; + curWord_ = nullptr; + next_ = nextBak; + break; + } + + if (*next_ == delimiter) { + curWordSize_ = static_cast(next_ - curWord_); + ++next_; + break; + } + } + if (curWordSize_ > 0) { + return true; + } + break; + } + return false; +} \ No newline at end of file diff --git a/device/plugins/memory_plugin/src/memory_data_plugin.cpp b/device/plugins/memory_plugin/src/memory_data_plugin.cpp new file mode 100644 index 000000000..6617cb875 --- /dev/null +++ b/device/plugins/memory_plugin/src/memory_data_plugin.cpp @@ -0,0 +1,644 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "memory_data_plugin.h" + +#include + +#include "buffer_splitter.h" +#include "securec.h" +#include "smaps_stats.h" + +namespace { +static const char* CMD_FORMAT = "dumpsys meminfo --local "; +constexpr size_t READ_BUFFER_SIZE = 1024 * 16; +static const int BUF_MAX_LEN = 2048; +} // namespace + +MemoryDataPlugin::MemoryDataPlugin() +{ + buffer_ = nullptr; + meminfoFd_ = -1; + vmstatFd_ = -1; + testpath_ = nullptr; + err_ = -1; + InitProto2StrVector(); + SetPath(const_cast("/proc")); +} + +MemoryDataPlugin::~MemoryDataPlugin() +{ + HILOG_INFO(LOG_CORE, "plugin:~MemoryDataPlugin!"); + if (buffer_ != nullptr) { + free(buffer_); + buffer_ = nullptr; + } + if (meminfoFd_ > 0) { + close(meminfoFd_); + meminfoFd_ = -1; + } + if (vmstatFd_ > 0) { + close(vmstatFd_); + vmstatFd_ = -1; + } + for (auto it = pidFds_.begin(); it != pidFds_.end(); it++) { + for (int i = FILE_STATUS; i <= FILE_SMAPS; i++) { + if (it->second[i] != -1) { + close(it->second[i]); + } + } + } + return; +} + +void MemoryDataPlugin::InitProto2StrVector() +{ + int maxprotobufid = 0; + for (unsigned int i = 0; i < sizeof(meminfoMapping) / sizeof(meminfoMapping[0]); i++) { + maxprotobufid = std::max(meminfoMapping[i].protobufid, maxprotobufid); + } + meminfoStrList_.resize(maxprotobufid + 1); + + for (unsigned int i = 0; i < sizeof(meminfoMapping) / sizeof(meminfoMapping[0]); i++) { + meminfoStrList_[meminfoMapping[i].protobufid] = meminfoMapping[i].procstr; + } + return; +} + +int MemoryDataPlugin::Start(const uint8_t* configData, uint32_t configSize) +{ + buffer_ = malloc(READ_BUFFER_SIZE); + if (buffer_ == nullptr) { + HILOG_ERROR(LOG_CORE, "plugin:malloc buffer_ fail"); + return RET_FAIL; + } + + if (protoConfig_.ParseFromArray(configData, configSize) <= 0) { + HILOG_ERROR(LOG_CORE, "plugin:ParseFromArray failed"); + return RET_FAIL; + } + + if (protoConfig_.report_sysmem_mem_info()) { + char fileName[PATH_MAX + 1] = {0}; + char realPath[PATH_MAX + 1] = {0}; + if (snprintf_s(fileName, sizeof(fileName), sizeof(fileName) - 1, "%s/meminfo", testpath_) < 0) { + HILOG_ERROR(LOG_CORE, "snprintf_s error"); + } + if (realpath(fileName, realPath) == nullptr) { + HILOG_ERROR(LOG_CORE, "plugin:realpath failed, errno=%d", errno); + return RET_FAIL; + } + meminfoFd_ = open(realPath, O_RDONLY | O_CLOEXEC); + if (meminfoFd_ == -1) { + HILOG_ERROR(LOG_CORE, "plugin:open failed, fileName, errno=%d", errno); + return RET_FAIL; + } + } + if (protoConfig_.report_sysmem_vmem_info()) { + vmstatFd_ = open("/proc/vmstat", O_RDONLY | O_CLOEXEC); + if (vmstatFd_ == -1) { + HILOG_ERROR(LOG_CORE, "plugin:Failed to open(/proc/vmstat), errno=%d", errno); + return RET_FAIL; + } + } + + if (protoConfig_.sys_meminfo_counters().size() > 0) { + for (int i = 0; i < protoConfig_.sys_meminfo_counters().size(); i++) { + if (meminfoStrList_[protoConfig_.sys_meminfo_counters(i)]) { + meminfoCounters_.emplace(meminfoStrList_[protoConfig_.sys_meminfo_counters(i)], + protoConfig_.sys_meminfo_counters(i)); + } + } + } + + if (protoConfig_.pid().size() > 0) { + for (int i = 0; i < protoConfig_.pid().size(); i++) { + int32_t pid = protoConfig_.pid(i); + pidFds_.emplace(pid, OpenProcPidFiles(pid)); + } + } + + HILOG_INFO(LOG_CORE, "plugin:start success!"); + return RET_SUCC; +} + +void MemoryDataPlugin::WriteMeminfo(MemoryData& data) +{ + int readsize = ReadFile(meminfoFd_); + if (readsize == RET_FAIL) { + HILOG_ERROR(LOG_CORE, "%s:read meminfoFd fail!", __func__); + return; + } + BufferSplitter totalbuffer((const char*)buffer_, readsize); + + do { + if (!totalbuffer.NextWord(':')) { + continue; + } + const_cast(totalbuffer.CurWord())[totalbuffer.CurWordSize()] = '\0'; + auto it = meminfoCounters_.find(totalbuffer.CurWord()); + if (it == meminfoCounters_.end()) { + continue; + } + + int counter_id = it->second; + if (!totalbuffer.NextWord(' ')) { + continue; + } + auto value = static_cast(strtoll(totalbuffer.CurWord(), nullptr, DEC_BASE)); + auto* meminfo = data.add_meminfo(); + + meminfo->set_key(static_cast(counter_id)); + meminfo->set_value(value); + } while (totalbuffer.NextLine()); + + return; +} + +void MemoryDataPlugin::WriteVmstat(MemoryData& data) +{ + return; +} + +void MemoryDataPlugin::WriteAppsummary(ProcessMemoryInfo* processinfo, SmapsStats& smapInfo) +{ + processinfo->mutable_memsummary()->set_java_heap(smapInfo.GetProcessJavaHeap()); + processinfo->mutable_memsummary()->set_native_heap(smapInfo.GetProcessNativeHeap()); + processinfo->mutable_memsummary()->set_code(smapInfo.GetProcessCode()); + processinfo->mutable_memsummary()->set_stack(smapInfo.GetProcessStack()); + processinfo->mutable_memsummary()->set_graphics(smapInfo.GetProcessGraphics()); + processinfo->mutable_memsummary()->set_private_other(smapInfo.GetProcessPrivateOther()); + processinfo->mutable_memsummary()->set_system(smapInfo.GetProcessSystem()); +} + +int MemoryDataPlugin::ParseNumber(std::string line) +{ + return atoi(line.substr(line.find_first_of("01234567890")).c_str()); +} + +bool MemoryDataPlugin::ParseMemInfo(const char* data, ProcessMemoryInfo* memoryInfo) +{ + bool ready = false; + bool done = false; + std::istringstream ss(data); + std::string line; + + while (std::getline(ss, line)) { + HILOG_INFO(LOG_CORE, "line: %s", line.c_str()); + std::string s(line); + if (s.find("App Summary") != s.npos) { + HILOG_INFO(LOG_CORE, "ready"); + ready = true; + continue; + } + + if (ready) { + if (s.find("Java Heap:") != s.npos) { + memoryInfo->mutable_memsummary()->set_java_heap(ParseNumber(s)); + continue; + } + if (s.find("Native Heap:") != s.npos) { + memoryInfo->mutable_memsummary()->set_native_heap(ParseNumber(s)); + continue; + } + if (s.find("Code:") != s.npos) { + memoryInfo->mutable_memsummary()->set_code(ParseNumber(s)); + continue; + } + if (s.find("Stack:") != s.npos) { + memoryInfo->mutable_memsummary()->set_stack(ParseNumber(s)); + continue; + } + if (s.find("Graphics:") != s.npos) { + memoryInfo->mutable_memsummary()->set_graphics(ParseNumber(s)); + continue; + } + if (s.find("Private Other:") != s.npos) { + memoryInfo->mutable_memsummary()->set_private_other(ParseNumber(s)); + continue; + } + if (s.find("System:") != s.npos) { + memoryInfo->mutable_memsummary()->set_system(ParseNumber(s)); + done = true; + break; + } + } + } + return done; +} + +bool MemoryDataPlugin::GetMemInfoByDumpsys(uint32_t pid, ProcessMemoryInfo* memoryInfo) +{ + std::string fullCmd = CMD_FORMAT + std::to_string(pid); + HILOG_INFO(LOG_CORE, "popen cmd = %s", fullCmd.c_str()); + + std::unique_ptr buffer {new (std::nothrow) uint8_t[BUF_MAX_LEN]}; + std::unique_ptr fp(popen(fullCmd.c_str(), "r"), pclose); + if (!fp) { + HILOG_INFO(LOG_CORE, "popen error"); + return false; + } + HILOG_INFO(LOG_CORE, "popen ok"); + + fread(buffer.get(), 1, BUF_MAX_LEN, fp.get()); + buffer.get()[BUF_MAX_LEN - 1] = '\0'; + + return ParseMemInfo(reinterpret_cast(buffer.get()), memoryInfo); +} + +int MemoryDataPlugin::Report(uint8_t* data, uint32_t dataSize) +{ + MemoryData dataProto; + uint32_t length; + + if (protoConfig_.report_process_tree()) { + HILOG_DEBUG(LOG_CORE, "plugin:report process list"); + WriteProcesseList(dataProto); + } + + if (protoConfig_.report_sysmem_mem_info()) { + HILOG_DEBUG(LOG_CORE, "plugin:report system mem_info list"); + WriteMeminfo(dataProto); + } + + if (protoConfig_.report_sysmem_vmem_info()) { + HILOG_DEBUG(LOG_CORE, "plugin:report system vmem_info list"); + WriteVmstat(dataProto); + } + + if (protoConfig_.pid().size() > 0) { + HILOG_DEBUG(LOG_CORE, "plugin:set pid counter, cnt = %d", protoConfig_.pid().size()); + + for (int i = 0; i < protoConfig_.pid().size(); i++) { + int32_t pid = protoConfig_.pid(i); + + auto* processinfo = dataProto.add_processesinfo(); + if (protoConfig_.report_process_mem_info()) { + HILOG_DEBUG(LOG_CORE, "plugin:need report meminfo pid(%d)", pid); + WriteProcinfoByPidfds(processinfo, pid); + } + + if (protoConfig_.report_app_mem_info()) { + if (protoConfig_.report_app_mem_by_dumpsys()) { + HILOG_DEBUG(LOG_CORE, "plugin:report_app_mem_by_dumpsys"); + GetMemInfoByDumpsys(pid, processinfo); + } else { + HILOG_DEBUG(LOG_CORE, "plugin:need report appmeminfo pid(%d)", pid); + SmapsStats smapInfo; + smapInfo.ParseMaps(pid); + WriteAppsummary(processinfo, smapInfo); + } + } + } + } + + length = dataProto.ByteSizeLong(); + if (length > dataSize) { + return -length; + } + if (dataProto.SerializeToArray(data, length) > 0) { + HILOG_DEBUG(LOG_CORE, "plugin:report success! length = %d", length); + return length; + } + return 0; +} + +int MemoryDataPlugin::Stop() +{ + if (buffer_ != nullptr) { + free(buffer_); + buffer_ = nullptr; + } + if (meminfoFd_ > 0) { + close(meminfoFd_); + meminfoFd_ = -1; + } + if (vmstatFd_ > 0) { + close(vmstatFd_); + vmstatFd_ = -1; + } + for (auto it = pidFds_.begin(); it != pidFds_.end(); it++) { + for (int i = FILE_STATUS; i <= FILE_SMAPS; i++) { + if (it->second[i] != -1) { + close(it->second[i]); + } + } + } + HILOG_INFO(LOG_CORE, "plugin:stop success!"); + return 0; +} + +void MemoryDataPlugin::WriteProcinfoByPidfds(ProcessMemoryInfo* processinfo, int32_t pid) +{ + char* end = nullptr; + int32_t readSize; + + readSize = ReadFile(pidFds_[pid][FILE_STATUS]); + if (readSize != RET_FAIL) { + WriteProcess(processinfo, (char*)buffer_, readSize, pid); + } else { + SetEmptyProcessInfo(processinfo); + } + if (ReadFile(pidFds_[pid][FILE_OOM]) != RET_FAIL) { + processinfo->set_oom_score_adj(strtol((char*)buffer_, &end, DEC_BASE)); + } else { + processinfo->set_oom_score_adj(0); + } + return; +} + +int32_t MemoryDataPlugin::ReadFile(int fd) +{ + if ((buffer_ == nullptr) || (fd == -1)) { + HILOG_ERROR(LOG_CORE, "%s:Empty address, or invalid fd", __func__); + return RET_FAIL; + } + int readsize = pread(fd, buffer_, READ_BUFFER_SIZE - 1, 0); + if (readsize <= 0) { + HILOG_ERROR(LOG_CORE, "Failed to read(%d), errno=%d", fd, errno); + err_ = errno; + return RET_FAIL; + } + return readsize; +} + +std::vector MemoryDataPlugin::OpenProcPidFiles(int32_t pid) +{ + int fd = -1; + char fileName[PATH_MAX + 1] = {0}; + char realPath[PATH_MAX + 1] = {0}; + int count = sizeof(procfdMapping) / sizeof(procfdMapping[0]); + std::vector profds; + + for (int i = 0; i < count; i++) { + if (snprintf_s(fileName, sizeof(fileName), sizeof(fileName) - 1, + "%s/%d/%s", testpath_, pid, procfdMapping[i].file) < 0) { + HILOG_ERROR(LOG_CORE, "snprintf_s error"); + } + if (realpath(fileName, realPath) == nullptr) { + HILOG_ERROR(LOG_CORE, "plugin:realpath failed, errno=%d", errno); + } + fd = open(realPath, O_RDONLY | O_CLOEXEC); + if (fd == -1) { + HILOG_ERROR(LOG_CORE, "Failed to open(%s), errno=%d", fileName, errno); + } + profds.emplace(profds.begin() + i, fd); + } + return profds; +} + +DIR* MemoryDataPlugin::OpenDestDir(const char* dirPath) +{ + DIR* destDir = nullptr; + + destDir = opendir(dirPath); + if (destDir == nullptr) { + HILOG_ERROR(LOG_CORE, "Failed to opendir(%s), errno=%d", dirPath, errno); + } + + return destDir; +} + +int32_t MemoryDataPlugin::GetValidPid(DIR* dirp) +{ + if (!dirp) return 0; + while (struct dirent* dirEnt = readdir(dirp)) { + if (dirEnt->d_type != DT_DIR) { + continue; + } + + int32_t pid = atoi(dirEnt->d_name); + if (pid) { + return pid; + } + } + return 0; +} + +int32_t MemoryDataPlugin::ReadProcPidFile(int32_t pid, const char* pFileName) +{ + char fileName[PATH_MAX + 1] = {0}; + char realPath[PATH_MAX + 1] = {0}; + int fd = -1; + ssize_t bytesRead; + + if (snprintf_s(fileName, sizeof(fileName), sizeof(fileName) - 1, "%s/%d/%s", testpath_, pid, pFileName) < 0) { + HILOG_ERROR(LOG_CORE, "snprintf_s error"); + } + if (realpath(fileName, realPath) == nullptr) { + HILOG_ERROR(LOG_CORE, "plugin:realpath failed, errno=%d", errno); + return RET_FAIL; + } + fd = open(realPath, O_RDONLY | O_CLOEXEC); + if (fd == -1) { + HILOG_INFO(LOG_CORE, "Failed to open(%s), errno=%d", fileName, errno); + err_ = errno; + return RET_FAIL; + } + if (buffer_ == nullptr) { + HILOG_INFO(LOG_CORE, "%s:Empty address, buffer_ is NULL", __func__); + err_ = RET_NULL_ADDR; + close(fd); + return RET_FAIL; + } + bytesRead = read(fd, buffer_, READ_BUFFER_SIZE - 1); + if (bytesRead <= 0) { + close(fd); + HILOG_INFO(LOG_CORE, "Failed to read(%s), errno=%d", fileName, errno); + err_ = errno; + return RET_FAIL; + } + close(fd); + + return bytesRead; +} + +bool MemoryDataPlugin::BufnCmp(const char* src, int srcLen, const char* key, int keyLen) +{ + if (!src || !key || (srcLen < keyLen)) { + return false; + } + for (int i = 0; i < keyLen; i++) { + if (*src++ != *key++) { + return false; + } + } + return true; +} + +bool MemoryDataPlugin::addPidBySort(int32_t pid) +{ + auto pidsEnd = seenPids_.end(); + auto it = std::lower_bound(seenPids_.begin(), pidsEnd, pid); + if (it != pidsEnd && *it == pid) { + return false; + } + it = seenPids_.insert(it, std::move(pid)); + return true; +} + +int MemoryDataPlugin::GetProcStatusId(const char* src, int srcLen) +{ + int count; + + count = sizeof(procStatusMapping) / sizeof(procStatusMapping[0]); + for (int i = 0; i < count; i++) { + if (BufnCmp(src, srcLen, procStatusMapping[i].procstr, strlen(procStatusMapping[i].procstr))) { + return procStatusMapping[i].procid; + } + } + return RET_FAIL; +} + +void MemoryDataPlugin::SetProcessInfo(ProcessMemoryInfo* processinfo, int key, const char* word) +{ + char* end = nullptr; + + switch (key) { + case PRO_TGID: { + processinfo->set_pid(strtoul(word, &end, DEC_BASE)); + } break; + case PRO_VMSIZE: { + uint64_t vm_size_kb = strtoul(word, &end, DEC_BASE); + processinfo->set_vm_size_kb(vm_size_kb); + } break; + case PRO_VMRSS: { + uint64_t vm_rss_kb = strtoul(word, &end, DEC_BASE); + processinfo->set_vm_rss_kb(vm_rss_kb); + } break; + case PRO_RSSANON: { + uint64_t rss_anon_kb = strtoul(word, &end, DEC_BASE); + processinfo->set_rss_anon_kb(rss_anon_kb); + } break; + case PRO_RSSFILE: { + uint64_t rss_file_kb = strtoul(word, &end, DEC_BASE); + processinfo->set_rss_file_kb(rss_file_kb); + } break; + case PRO_RSSSHMEM: { + uint64_t rss_shmem_kb = strtoul(word, &end, DEC_BASE); + processinfo->set_rss_shmem_kb(rss_shmem_kb); + } break; + case PRO_VMSWAP: { + uint64_t vm_swap_kb = strtoul(word, &end, DEC_BASE); + processinfo->set_vm_swap_kb(vm_swap_kb); + } break; + case PRO_VMLCK: { + uint64_t vm_locked_kb = strtoul(word, &end, DEC_BASE); + processinfo->set_vm_locked_kb(vm_locked_kb); + } break; + case PRO_VMHWM: { + uint64_t vm_hwm_kb = strtoul(word, &end, DEC_BASE); + processinfo->set_vm_hwm_kb(vm_hwm_kb); + } break; + default: + break; + } + return; +} + +void MemoryDataPlugin::WriteProcess(ProcessMemoryInfo* processinfo, const char* pFile, uint32_t fileLen, int32_t pid) +{ + BufferSplitter totalbuffer(const_cast(pFile), fileLen + 1); + + do { + totalbuffer.NextWord(':'); + if (!totalbuffer.CurWord()) { + return; + } + + int key = GetProcStatusId(totalbuffer.CurWord(), totalbuffer.CurWordSize()); + totalbuffer.NextWord('\n'); + if (!totalbuffer.CurWord()) { + continue; + } + if (key == PRO_NAME) { + processinfo->set_name(totalbuffer.CurWord(), totalbuffer.CurWordSize()); + } + SetProcessInfo(processinfo, key, totalbuffer.CurWord()); + } while (totalbuffer.NextLine()); + // update process name + int32_t ret = ReadProcPidFile(pid, "cmdline"); + if (ret > 0) { + processinfo->set_name(static_cast(buffer_), strlen(static_cast(buffer_))); + HILOG_ERROR(LOG_CORE, "%s:update process name=%s", __func__, processinfo->name().c_str()); + } +} + +void MemoryDataPlugin::SetEmptyProcessInfo(ProcessMemoryInfo* processinfo) +{ + processinfo->set_pid(-1); + processinfo->set_name("null"); + processinfo->set_vm_size_kb(0); + processinfo->set_vm_rss_kb(0); + processinfo->set_rss_anon_kb(0); + processinfo->set_rss_file_kb(0); + processinfo->set_rss_shmem_kb(0); + processinfo->set_vm_swap_kb(0); + processinfo->set_vm_locked_kb(0); + processinfo->set_vm_hwm_kb(0); + processinfo->set_oom_score_adj(0); +} + +void MemoryDataPlugin::WriteOomInfo(ProcessMemoryInfo* processinfo, int32_t pid) +{ + char* end = nullptr; + + if (ReadProcPidFile(pid, "oom_score_adj") == RET_FAIL) { + processinfo->set_oom_score_adj(0); + return; + } + if (buffer_ == nullptr) { + processinfo->set_oom_score_adj(0); + HILOG_ERROR(LOG_CORE, "%s:invalid params, read buffer_ is NULL", __func__); + return; + } + processinfo->set_oom_score_adj(strtol((char*)buffer_, &end, DEC_BASE)); +} + +void MemoryDataPlugin::WriteProcessInfo(MemoryData& data, int32_t pid) +{ + int32_t ret = ReadProcPidFile(pid, "status"); + if (ret == RET_FAIL) { + SetEmptyProcessInfo(data.add_processesinfo()); + return; + } + if ((buffer_ == nullptr) || (ret == 0)) { + HILOG_ERROR(LOG_CORE, "%s:invalid params, read buffer_ is NULL", __func__); + return; + } + auto* processinfo = data.add_processesinfo(); + WriteProcess(processinfo, (char*)buffer_, ret, pid); + WriteOomInfo(processinfo, pid); +} + +void MemoryDataPlugin::WriteProcesseList(MemoryData& data) +{ + DIR* procDir = nullptr; + + procDir = OpenDestDir(testpath_); + if (procDir == nullptr) { + return; + } + + while (int32_t pid = GetValidPid(procDir)) { + if (find(seenPids_.begin(), seenPids_.end(), pid) == seenPids_.end()) { + addPidBySort(pid); + } + } + + for (unsigned int i = 0; i < seenPids_.size(); i++) { + WriteProcessInfo(data, seenPids_[i]); + } + closedir(procDir); +} diff --git a/device/plugins/memory_plugin/src/memory_module.cpp b/device/plugins/memory_plugin/src/memory_module.cpp new file mode 100755 index 000000000..1148f446d --- /dev/null +++ b/device/plugins/memory_plugin/src/memory_module.cpp @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "memory_data_plugin.h" +#include +#include +#include "plugin_module_api.h" + +namespace { +constexpr uint32_t MAX_BUFFER_SIZE = 4 * 1024 * 1024; +std::unique_ptr g_plugin = nullptr; +std::mutex g_taskMutex; +} // namespace + +static int MemDataPluginSessionStart(const uint8_t* configData, uint32_t configSize) +{ + std::lock_guard guard(g_taskMutex); + g_plugin = std::make_unique(); + return g_plugin->Start(configData, configSize); +} + +static int MemPluginReportResult(uint8_t* bufferData, uint32_t bufferSize) +{ + std::lock_guard guard(g_taskMutex); + return g_plugin->Report(bufferData, bufferSize); +} + +static int MemPluginSessionStop() +{ + std::lock_guard guard(g_taskMutex); + HILOG_INFO(LOG_CORE, "%s:stop Session success!", __func__); + g_plugin->Stop(); + g_plugin = nullptr; + return 0; +} + +static int MemRegisterWriterStruct(const WriterStruct* writer) +{ + return 0; +} + +static PluginModuleCallbacks g_callbacks = { + MemDataPluginSessionStart, + MemPluginReportResult, + MemPluginSessionStop, + MemRegisterWriterStruct, +}; + +PluginModuleStruct g_pluginModule = {&g_callbacks, "memory-plugin", MAX_BUFFER_SIZE}; diff --git a/device/plugins/memory_plugin/src/smaps_stats.cpp b/device/plugins/memory_plugin/src/smaps_stats.cpp new file mode 100755 index 000000000..4c20151d5 --- /dev/null +++ b/device/plugins/memory_plugin/src/smaps_stats.cpp @@ -0,0 +1,422 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "smaps_stats.h" + +#include "securec.h" + +namespace { +bool MatchHead(const std::string& name, const char* str) +{ + return strncmp(name.c_str(), str, strlen(str)) == 0; +} + +bool MatchTail(const std::string& name, std::string str) +{ + int index = name.size() - str.size(); + if (index < 0) { + return false; + } + return (name.substr(index) == str); +} +} // namespace +bool SmapsStats::ParseMaps(int pid) +{ + std::string smaps_path = std::string("/proc/") + std::to_string(pid) + std::string("/smaps"); + if (testpath_.size() > 0) { + smaps_path = testpath_ + std::to_string(pid) + std::string("/smaps"); + } + HILOG_INFO(LOG_CORE, "smaps path:%s", smaps_path.c_str()); + ReadVmemareasFile(smaps_path); + ReviseStatsData(); + return true; +} + +bool SmapsStats::ReadVmemareasFile(const std::string& path) +{ + bool findMapHead = false; + MapPiecesInfo_t mappic = {0}; + MemUsageInfo_t memusage = {0}; + uint64_t prevEnd = 0; + int prevHeap = 0; + std::ifstream input(path, std::ios::in); + if (input.fail()) { + HILOG_ERROR(LOG_CORE, "open %s failed, errno = %d", path.c_str(), errno); + return false; + } + do { + if (!input.good()) { + return false; + } + std::string line; + getline(input, line); + line += '\n'; + if (!findMapHead) { + // 00400000-00409000 r-xp 00000000 fc:00 426998 /usr/lib/gvfs/gvfsd-http + ParseMapHead(line, mappic); + findMapHead = true; + continue; + } + if (findMapHead && GetMemUsageField(line, memusage)) { + if (!lastline_) { + continue; + } + } + CollectVmemAreasData(mappic, memusage, prevEnd, prevHeap); + findMapHead = false; + lastline_ = false; + } while (!input.eof()); + input.close(); + + return true; +} + +bool SmapsStats::GetVMAStuId(int ops, + std::string name, + const vMeminfoAreaMapping* vma, + int count, + int32_t heapIndex[2], + bool& swappable) +{ + for (int i = 0; i < count; i++) { + if (ops == OPS_START) { + if (MatchHead(name, vma[i].heapstr)) { + heapIndex[0] = vma[i].heapid[0]; + heapIndex[1] = vma[i].heapid[1]; + swappable = false; + return true; + } + } else if (ops == OPS_END) { + if (MatchTail(name, vma[i].heapstr)) { + if (vma[i].heapid[1] == VMHEAP_NEEDFIX) { + HeapIndexFix(name, vma[i].heapstr, heapIndex); + } else { + heapIndex[0] = vma[i].heapid[0]; + heapIndex[1] = vma[i].heapid[1]; + } + swappable = true; + return true; + } + } + } + return false; +} + +bool SmapsStats::GetVmaIndex(std::string name, uint32_t namesz, int32_t heapIndex[2], bool& swappable) +{ + switch (name[0]) { + case '[': + if (MatchHead(name, "[heap]") || MatchHead(name, "[stack")) { + int count = sizeof(vmaMemheap) / sizeof(vmaMemheap[0]); + return GetVMAStuId(OPS_START, name, vmaMemheap, count, heapIndex, swappable); + } else if (MatchHead(name, "[anon:")) { + if (MatchHead(name, "[anon:dalvik-")) { + int count = sizeof(vmaMemsuffix) / sizeof(vmaMemsuffix[0]); + if (GetVMAStuId(OPS_END, name, vmaMemsuffix, count, heapIndex, swappable)) { + return true; + } + } + int count = sizeof(vmaMemanon) / sizeof(vmaMemanon[0]); + return GetVMAStuId(OPS_START, name, vmaMemanon, count, heapIndex, swappable); + } + break; + case '/': + if (MatchHead(name, "/memfd:")) { + int count = sizeof(vmaMemfd) / sizeof(vmaMemfd[0]); + return GetVMAStuId(OPS_START, name, vmaMemfd, count, heapIndex, swappable); + } else if (MatchHead(name, "/dev/")) { + int count = sizeof(vmaMemdev) / sizeof(vmaMemdev[0]); + return GetVMAStuId(OPS_START, name, vmaMemdev, count, heapIndex, swappable); + } else { + int count = sizeof(vmaMemsuffix) / sizeof(vmaMemsuffix[0]); + return GetVMAStuId(OPS_END, name, vmaMemsuffix, count, heapIndex, swappable); + } + break; + default: + int count = sizeof(vmaMemsuffix) / sizeof(vmaMemsuffix[0]); + return GetVMAStuId(OPS_END, name, vmaMemsuffix, count, heapIndex, swappable); + break; + } + if (namesz > strlen(".dex") && strstr(name.c_str(), ".dex") != nullptr) { + heapIndex[0] = VMHEAP_DEX; + heapIndex[1] = VMHEAP_DEX_APP_DEX; + swappable = true; + return true; + } + return false; +} + +void SmapsStats::CollectVmemAreasData(const MapPiecesInfo_t& mempic, + const MemUsageInfo_t& memusage, + uint64_t& prevEnd, + int& prevHeap) +{ + std::string name; + int32_t heapIndex[2] = {VMHEAP_UNKNOWN, VMHEAP_NULL}; + bool swappable = false; + uint64_t swapablePss = 0; + + if (MatchTail(mempic.name, " (deleted)")) { + name = mempic.name.substr(0, mempic.name.size() - strlen(" (deleted)")); + } else { + name = mempic.name; + } + uint32_t namesz = name.size(); + if (!GetVmaIndex(name, namesz, heapIndex, swappable)) { + if (namesz > 0) { + heapIndex[0] = VMHEAP_UNKNOWN_MAP; + } else if (mempic.start_addr == prevEnd && prevHeap == VMHEAP_SO) { + // bss section of a shared library + heapIndex[0] = VMHEAP_SO; + } + } + prevEnd = mempic.end_addr; + prevHeap = heapIndex[0]; + swapablePss = GetSwapablepssValue(memusage, swappable); + SetVmemAreasData(heapIndex[0], swapablePss, memusage); + if ((heapIndex[1] != VMHEAP_NULL) && (heapIndex[1] != VMHEAP_NEEDFIX)) { + SetVmemAreasData(heapIndex[1], swapablePss, memusage); + } +} + +void SmapsStats::ReviseStatsData() +{ + // Summary data to VMHEAP_UNKNOWN + for (int i = _NUM_CORE_HEAP; i < _NUM_EXCLUSIVE_HEAP; i++) { + stats_[VMHEAP_UNKNOWN].pss += stats_[i].pss; + stats_[VMHEAP_UNKNOWN].swappablePss += stats_[i].swappablePss; + stats_[VMHEAP_UNKNOWN].rss += stats_[i].rss; + stats_[VMHEAP_UNKNOWN].privateDirty += stats_[i].privateDirty; + stats_[VMHEAP_UNKNOWN].sharedDirty += stats_[i].sharedDirty; + stats_[VMHEAP_UNKNOWN].privateClean += stats_[i].privateClean; + stats_[VMHEAP_UNKNOWN].sharedClean += stats_[i].sharedClean; + stats_[VMHEAP_UNKNOWN].swappedOut += stats_[i].swappedOut; + stats_[VMHEAP_UNKNOWN].swappedOutPss += stats_[i].swappedOutPss; + } +} + +bool SmapsStats::SetMapAddrInfo(std::string& line, MapPiecesInfo_t& head) +{ + const char* pStr = line.c_str(); + char* end = nullptr; + // start_addr + head.start_addr = strtoull(pStr, &end, HEX_BASE); + if (end == pStr || *end != '-') { + return false; + } + pStr = end + 1; + // end_addr + head.end_addr = strtoull(pStr, &end, HEX_BASE); + if (end == pStr) { + return false; + } + return true; +} + +bool SmapsStats::ParseMapHead(std::string& line, MapPiecesInfo_t& head) +{ + if (!SetMapAddrInfo(line, head)) { + return false; + } + size_t newlineops = 0; + size_t wordsz = 0; + std::string newline = line; + for (int i = 0; i < FIFTH_FIELD; i++) { + std::string word = newline; + wordsz = word.find(" "); + if (wordsz == std::string::npos) { + return false; + } + word = newline.substr(0, wordsz); + + newlineops = newline.find_first_not_of(" ", wordsz); + newline = newline.substr(newlineops); + } + head.name = newline.substr(0, newline.size() - 1); + return true; +} + +bool SmapsStats::GetMemUsageField(std::string& line, MemUsageInfo_t& memusage) +{ + char field[64]; + int len; + const char* pLine = line.c_str(); + + int ret = sscanf_s(pLine, "%63s %n", field, sizeof(field), &len); + if (ret == 1 && *field && field[strlen(field) - 1] == ':') { + const char* c = pLine + len; + std::string strfield(field); + switch (field[0]) { + case 'P': + if (MatchHead(strfield, "Pss:")) { + memusage.pss = strtoull(c, nullptr, DEC_BASE); + } else if (MatchHead(strfield, "Private_Clean:")) { + uint64_t prcl = strtoull(c, nullptr, DEC_BASE); + memusage.private_clean = prcl; + memusage.uss += prcl; + } else if (MatchHead(strfield, "Private_Dirty:")) { + uint64_t prdi = strtoull(c, nullptr, DEC_BASE); + memusage.private_dirty = prdi; + memusage.uss += prdi; + } + break; + case 'S': + if (MatchHead(strfield, "Size:")) { + memusage.vss = strtoull(c, nullptr, DEC_BASE); + } else if (MatchHead(strfield, "Shared_Clean:")) { + memusage.shared_clean = strtoull(c, nullptr, DEC_BASE); + } else if (MatchHead(strfield, "Shared_Dirty:")) { + memusage.shared_dirty = strtoull(c, nullptr, DEC_BASE); + } else if (MatchHead(strfield, "Swap:")) { + memusage.swap = strtoull(c, nullptr, DEC_BASE); + } else if (MatchHead(strfield, "SwapPss:")) { + memusage.swap_pss = strtoull(c, nullptr, DEC_BASE); + } + break; + case 'R': + if (MatchHead(strfield, "Rss:")) { + memusage.rss = strtoull(c, nullptr, DEC_BASE); + } + break; + case 'V': + if (MatchHead(strfield, "VmFlags:")) { + lastline_ = true; + } + break; + default: + break; + } + return true; + } + + return false; +} + +uint64_t SmapsStats::GetSwapablepssValue(const MemUsageInfo_t& memusage, bool swappable) +{ + const MemUsageInfo_t& usage = memusage; + uint64_t swapablePss = 0; + + if (swappable && (usage.pss > 0)) { + float sharing_proportion = 0.0f; + if ((usage.shared_clean > 0) || (usage.shared_dirty > 0)) { + sharing_proportion = (usage.pss - usage.uss) / (usage.shared_clean + usage.shared_dirty); + } + swapablePss = (sharing_proportion * usage.shared_clean) + usage.private_clean; + } + return swapablePss; +} + +void SmapsStats::SetVmemAreasData(int index, uint64_t swapablePss, const MemUsageInfo_t& usage) +{ + stats_[index].pss += usage.pss; + stats_[index].swappablePss += swapablePss; + stats_[index].rss += usage.rss; + stats_[index].privateDirty += usage.private_dirty; + stats_[index].sharedDirty += usage.shared_dirty; + stats_[index].privateClean += usage.private_clean; + stats_[index].sharedClean += usage.shared_clean; + stats_[index].swappedOut += usage.swap; + stats_[index].swappedOutPss += usage.swap_pss; +} + +void SmapsStats::HeapIndexFix(std::string name, const char* key, int32_t heapIndex[2]) +{ + if (!strncmp(key, ".vdex", sizeof(".vdex"))) { + if ((strstr(name.c_str(), "@boot") != nullptr) || (strstr(name.c_str(), "/boot") != nullptr) || + (strstr(name.c_str(), "/apex") != nullptr)) { + heapIndex[0] = VMHEAP_DEX; + heapIndex[1] = VMHEAP_DEX_BOOT_VDEX; + } else { + heapIndex[0] = VMHEAP_DEX; + heapIndex[1] = VMHEAP_DEX_APP_VDEX; + } + } else if (!strncmp(key, ".art", sizeof(".art")) || !strncmp(key, ".art]", sizeof(".art]"))) { + if ((strstr(name.c_str(), "@boot") != nullptr) || (strstr(name.c_str(), "/boot") != nullptr) || + (strstr(name.c_str(), "/apex") != nullptr)) { + heapIndex[0] = VMHEAP_ART; + heapIndex[1] = VMHEAP_ART_BOOT; + } else { + heapIndex[0] = VMHEAP_ART; + heapIndex[1] = VMHEAP_ART_APP; + } + } +} + +int SmapsStats::GetProcessJavaHeap() +{ + return stats_[VMHEAP_DALVIK].privateDirty + GetPrivate(VMHEAP_ART); +} + +int SmapsStats::GetProcessNativeHeap() +{ + return stats_[VMHEAP_NATIVE].privateDirty; +} + +int SmapsStats::GetProcessCode() +{ + return GetPrivate(VMHEAP_SO) + GetPrivate(VMHEAP_JAR) + GetPrivate(VMHEAP_TTF) + + GetPrivate(VMHEAP_DEX) + GetPrivate(VMHEAP_OAT) + + GetPrivate(VMHEAP_DALVIK_OTHER_ZYGOTE_CODE_CACHE) + + GetPrivate(VMHEAP_DALVIK_OTHER_APP_CODE_CACHE); +} + +int SmapsStats::GetProcessStack() +{ + return stats_[VMHEAP_STACK].privateDirty; +} + +int SmapsStats::GetProcessGraphics() +{ + return GetPrivate(VMHEAP_GL_DEV) + GetPrivate(VMHEAP_GRAPHICS) + GetPrivate(VMHEAP_GL); +} + +int SmapsStats::GetProcessPrivateOther() +{ + return GetTotalPrivateClean() + GetTotalPrivateDirty() - GetProcessJavaHeap() - GetProcessNativeHeap() - + GetProcessCode() - GetProcessStack() - GetProcessGraphics(); +} + +int SmapsStats::GetProcessSystem() +{ + return GetTotalPss() - GetTotalPrivateClean() - GetTotalPrivateDirty(); +} + +int SmapsStats::GetTotalPrivateClean() +{ + return stats_[VMHEAP_UNKNOWN].privateClean + stats_[VMHEAP_NATIVE].privateClean + + stats_[VMHEAP_DALVIK].privateClean; +} + +int SmapsStats::GetTotalPrivateDirty() +{ + return stats_[VMHEAP_UNKNOWN].privateDirty + stats_[VMHEAP_NATIVE].privateDirty + + stats_[VMHEAP_DALVIK].privateDirty; +} + +int SmapsStats::GetPrivate(int type) +{ + return stats_[type].privateDirty + stats_[type].privateClean; +} + +int SmapsStats::GetTotalPss() +{ + return stats_[VMHEAP_UNKNOWN].pss + stats_[VMHEAP_NATIVE].pss + stats_[VMHEAP_DALVIK].pss + GetTotalSwappedOutPss(); +} + +int SmapsStats::GetTotalSwappedOutPss() +{ + return stats_[VMHEAP_UNKNOWN].swappedOutPss + stats_[VMHEAP_NATIVE].swappedOutPss + + stats_[VMHEAP_DALVIK].swappedOutPss; +} diff --git a/device/plugins/memory_plugin/test/BUILD.gn b/device/plugins/memory_plugin/test/BUILD.gn new file mode 100644 index 000000000..df7d17530 --- /dev/null +++ b/device/plugins/memory_plugin/test/BUILD.gn @@ -0,0 +1,60 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/test.gni") +import("../../../base/config.gni") + +module_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/device" +config("module_private_config") { + visibility = [":*"] + if (current_toolchain != host_toolchain) { + defines = [ "HAVE_HILOG" ] + } +} + +ohos_unittest("memdataplugin_ut") { + module_out_path = module_output_path + sources = [ + "unittest/buffer_splitter_unittest.cpp", + "unittest/memory_data_plugin_unittest.cpp", + ] + deps = [ + "${OHOS_PROFILER_DIR}/device/plugins/memory_plugin:memdataplugin", + "${OHOS_PROFILER_DIR}/protos/types/plugins/memory_data:memory_data_cpp", + "//third_party/googletest:gtest_main", + ] + include_dirs = [ + "../include", + "../../api/include", + "${OHOS_PROFILER_DIR}/interfaces/kits", + "${OHOS_PROFILER_DIR}/device/base/include", + "//third_party/googletest/googletest/include/gtest", + ] + cflags = [ + "-Wno-inconsistent-missing-override", + "-Dprivate=public", #allow test code access private members + ] + external_deps = [ + "hiviewdfx_hilog_native:libhilog", + ] + configs = [ ":module_private_config" ] + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + resource_config_file = get_path_info("utresources/ohos_test.xml", "abspath") +} + +group("unittest") { + testonly = true + deps = [ + ":memdataplugin_ut", + ] +} diff --git a/device/plugins/memory_plugin/test/unittest/buffer_splitter_unittest.cpp b/device/plugins/memory_plugin/test/unittest/buffer_splitter_unittest.cpp new file mode 100644 index 000000000..9eca326b4 --- /dev/null +++ b/device/plugins/memory_plugin/test/unittest/buffer_splitter_unittest.cpp @@ -0,0 +1,446 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +#include +#include + +#include "buffer_splitter.h" + +using namespace testing::ext; + +using ConstCharPtr = std::unique_ptr::pointer; + +namespace { +class BufferSplitterUnittest : public ::testing::Test { +public: + static void SetUpTestCase() {} + + static void TearDownTestCase() {} + void SetUp() {} + void TearDown() {} +}; + +struct TestElement { + int32_t index; + ConstCharPtr curLine; + size_t curLineSz; + ConstCharPtr curWord; + size_t curWordSz; +}; + +/** + * @tc.name: memory plugin + * @tc.desc: Constructed function test. + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, constructorWithNullptr, TestSize.Level1) +{ + char* text = nullptr; + int readsize = 0; + BufferSplitter totalbuffer(text, readsize); + EXPECT_EQ(nullptr, totalbuffer.CurLine()); + EXPECT_EQ((size_t)0, totalbuffer.CurLineSize()); + EXPECT_EQ(nullptr, totalbuffer.CurWord()); + EXPECT_EQ((size_t)0, totalbuffer.CurWordSize()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Constructed function test. + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, constructorWith1lengthBuffer01, TestSize.Level1) +{ + char text[] = {'\0'}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + EXPECT_EQ(nullptr, totalbuffer.CurLine()); + EXPECT_EQ((size_t)0, totalbuffer.CurLineSize()); + EXPECT_EQ(nullptr, totalbuffer.CurWord()); + EXPECT_EQ((size_t)0, totalbuffer.CurWordSize()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Constructed function test. + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, constructorWith1lengthBuffer02, TestSize.Level1) +{ + char text[] = {'\n'}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + EXPECT_EQ(nullptr, totalbuffer.CurLine()); + EXPECT_EQ((size_t)0, totalbuffer.CurLineSize()); + EXPECT_EQ(nullptr, totalbuffer.CurWord()); + EXPECT_EQ((size_t)0, totalbuffer.CurWordSize()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Constructed function test. + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, constructorWith1lengthBuffer03, TestSize.Level1) +{ + char text[] = {'3'}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + EXPECT_EQ(nullptr, totalbuffer.CurLine()); + EXPECT_EQ((size_t)0, totalbuffer.CurLineSize()); + EXPECT_EQ(nullptr, totalbuffer.CurWord()); + EXPECT_EQ((size_t)0, totalbuffer.CurWordSize()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Constructed function test. + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, constructorWith1LineBuffer, TestSize.Level1) +{ + char text[] = {'a', 'b', 'c', 'd', '\0'}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + + TestElement expect = {0, text, 4, nullptr, 0}; + EXPECT_EQ(expect.curLine, totalbuffer.CurLine()); + EXPECT_EQ(expect.curLineSz, totalbuffer.CurLineSize()); + EXPECT_EQ(expect.curWord, totalbuffer.CurWord()); + EXPECT_EQ(expect.curWordSz, totalbuffer.CurWordSize()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Constructed function test. + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, constructorWithMultipleLinesBuffer, TestSize.Level1) +{ + char text[] = {'a', 'b', 'c', 'd', '\n', '1', '2', '3', '4', '5', '\0'}; + TestElement expect = {0, text, 4, nullptr, 0}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + + EXPECT_EQ(expect.curLine, totalbuffer.CurLine()); + EXPECT_EQ(expect.curLineSz, totalbuffer.CurLineSize()); + EXPECT_EQ(expect.curWord, totalbuffer.CurWord()); + EXPECT_EQ(expect.curWordSz, totalbuffer.CurWordSize()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Test NextLine(). + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, NextLineWithOnlyOneLineBuffer, TestSize.Level1) +{ + char text[] = {'a', 'b', 'c', 'd', '\0'}; + TestElement expect = {0, text, 4, nullptr, 0}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + + EXPECT_EQ(expect.curLine, totalbuffer.CurLine()); + EXPECT_EQ(expect.curLineSz, totalbuffer.CurLineSize()); + EXPECT_EQ(expect.curWord, totalbuffer.CurWord()); + EXPECT_EQ(expect.curWordSz, totalbuffer.CurWordSize()); + + EXPECT_FALSE(totalbuffer.NextLine()); + EXPECT_EQ(nullptr, totalbuffer.CurLine()); + EXPECT_EQ((size_t)0, totalbuffer.CurLineSize()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Test NextLine(). + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, NextLineWithMultipleLinesBuffer, TestSize.Level1) +{ + char text[] = {'a', 'b', 'c', 'd', '\n', '1', '2', '3', '4', '5', '6', '\0'}; + TestElement expect[] = {{0, text, 4, nullptr, 0}, {5, &text[5], 6, nullptr, 0}}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + + size_t i = 0; + do { + EXPECT_EQ(expect[i].curLine, totalbuffer.CurLine()); + EXPECT_EQ(expect[i].curLineSz, totalbuffer.CurLineSize()); + EXPECT_EQ(expect[i].curWord, totalbuffer.CurWord()); + EXPECT_EQ(expect[i].curWordSz, totalbuffer.CurWordSize()); + i++; + } while (totalbuffer.NextLine()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Test NextWord(). + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, NextWordWithOnlyOneLineBuffer01, TestSize.Level1) +{ + char text[] = {'a', 'b', ' ', 'c', 'd', '\0'}; + TestElement expect = {0, text, 5, text, 2}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + + EXPECT_EQ(expect.curLine, totalbuffer.CurLine()); + EXPECT_EQ(expect.curLineSz, totalbuffer.CurLineSize()); + EXPECT_TRUE(totalbuffer.NextWord(' ')); + EXPECT_EQ(expect.curWord, totalbuffer.CurWord()); + EXPECT_EQ(expect.curWordSz, totalbuffer.CurWordSize()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Test NextWord(). + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, NextWordWithOnlyOneLineBuffer02, TestSize.Level1) +{ + char text[] = {'a', 'b', ' ', 'c', 'd', ' ', '\0'}; + TestElement expect[] = {{0, text, 6, text, 2}, {0, text, 4, &text[3], 2}}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + + EXPECT_EQ(expect[0].curLine, totalbuffer.CurLine()); + EXPECT_EQ(expect[0].curLineSz, totalbuffer.CurLineSize()); + size_t cnt = sizeof(expect) / sizeof(expect[0]); + for (size_t i = 0; i < cnt; i++) { + EXPECT_TRUE(totalbuffer.NextWord(' ')); + EXPECT_EQ(expect[i].curWord, totalbuffer.CurWord()); + EXPECT_EQ(expect[i].curWordSz, totalbuffer.CurWordSize()); + } +} + +/** + * @tc.name: memory plugin + * @tc.desc: Test NextWord(). + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, NextWordWithOnlyOneLineBuffer03, TestSize.Level1) +{ + char text[] = {'a', 'b', ' ', 'c', 'd', ' ', '\0'}; + TestElement expect = {0, text, 6, text, 6}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + + EXPECT_EQ(expect.curLine, totalbuffer.CurLine()); + EXPECT_EQ(expect.curLineSz, totalbuffer.CurLineSize()); + EXPECT_TRUE(totalbuffer.NextWord('\0')); + EXPECT_EQ(expect.curWord, totalbuffer.CurWord()); + EXPECT_EQ(expect.curWordSz, totalbuffer.CurWordSize()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Test NextWord(). + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, NextWordWithOnlyOneLineBuffer04, TestSize.Level1) +{ + char text[] = {'a', 'b', ' ', 'c', 'd', ' ', '\0'}; + TestElement expect = {0, text, 6, nullptr, 0}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + + EXPECT_EQ(expect.curLine, totalbuffer.CurLine()); + EXPECT_EQ(expect.curLineSz, totalbuffer.CurLineSize()); + EXPECT_FALSE(totalbuffer.NextWord('e')); + EXPECT_EQ(expect.curWord, totalbuffer.CurWord()); + EXPECT_EQ(expect.curWordSz, totalbuffer.CurWordSize()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Test NextWord(). + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, NextWordWithMultipleLinesBuffer01, TestSize.Level1) +{ + char text[] = {'a', 'b', ' ', 'c', 'd', ' ', '\n', '1', '2', ' ', '3', '4', '5', ' ', '6', '\0'}; + TestElement expect[] = { + {0, text, 6, text, 2}, {0, text, 6, &text[3], 2}, {0, text, 6, &text[7], 2}, {0, text, 4, &text[10], 3}}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + size_t expectWordCnt = 2; + size_t curLineCnt = 0; + do { + for (size_t i = 0; i < expectWordCnt; i++) { + EXPECT_TRUE(totalbuffer.NextWord(' ')); + EXPECT_EQ(expect[(curLineCnt * 2) + i].curWord, totalbuffer.CurWord()); + EXPECT_EQ(expect[(curLineCnt * 2) + i].curWordSz, totalbuffer.CurWordSize()); + } + curLineCnt++; + } while (totalbuffer.NextLine()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Test NextWord(). + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, NextWordWithMultipleLinesBuffer02, TestSize.Level1) +{ + char text[] = {'a', 'b', ' ', 'c', 'd', ' ', '\n', '1', '2', ' ', '3', '4', '5', ' ', '6', '\0'}; + TestElement expect[] = { + {0, text, 6, text, 2}, {0, text, 6, nullptr, 0}, {0, text, 6, &text[7], 2}, {0, text, 4, nullptr, 0}}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + size_t expectWordCnt = 2; + size_t curLineCnt = 0; + do { + for (size_t i = 0; i < expectWordCnt; i++) { + if (i == 0) { + EXPECT_TRUE(totalbuffer.NextWord(' ')); + } + if (i == 1) { + EXPECT_FALSE(totalbuffer.NextWord('#')); + } + EXPECT_EQ(expect[(curLineCnt * 2) + i].curWord, totalbuffer.CurWord()); + EXPECT_EQ(expect[(curLineCnt * 2) + i].curWordSz, totalbuffer.CurWordSize()); + } + curLineCnt++; + } while (totalbuffer.NextLine()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Test NextWord(). + * @tc.type: FUNC + */ +HWTEST_F(BufferSplitterUnittest, NextWordWithMultipleLinesBuffer03, TestSize.Level1) +{ + char text[] = {'a', 'b', ' ', 'c', 'd', ' ', '\n', '1', '2', ' ', '3', '4', '5', ' ', '6', '\0'}; + TestElement expect[] = { + {0, text, 6, nullptr, 0}, {0, text, 6, text, 2}, {0, text, 6, nullptr, 0}, {0, text, 6, &text[7], 2}}; + int readsize = sizeof(text); + BufferSplitter totalbuffer(text, readsize); + size_t expectWordCnt = 2; + size_t curLineCnt = 0; + do { + for (size_t i = 0; i < expectWordCnt; i++) { + if (i == 0) { + EXPECT_FALSE(totalbuffer.NextWord('#')); + } + if (i == 1) { + EXPECT_TRUE(totalbuffer.NextWord(' ')); + } + EXPECT_EQ(expect[(curLineCnt * 2) + i].curWord, totalbuffer.CurWord()); + EXPECT_EQ(expect[(curLineCnt * 2) + i].curWordSz, totalbuffer.CurWordSize()); + } + curLineCnt++; + } while (totalbuffer.NextLine()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Test the scene that actually used,parse /proc/meminfo. + * @tc.type: FUNC + */ +namespace { +char g_kMockMeminfo[] = R"( +MemTotal: 16168736 kB +MemFree: 7154492 kB +MemAvailable: 15481028 kB +Buffers: 2397540 kB +Cached: 4711136 kB +SwapCached: 27628 kB +Active: 5556068 kB +Inactive: 1644560 kB +Active(anon): 62580 kB +Inactive(anon): 43352 kB +Active(file): 5493488 kB +Inactive(file): 1601208 kB +Unevictable: 388 kB +Mlocked: 0 kB +SwapTotal: 16777180 kB +SwapFree: 16500700 kB +Dirty: 0 kB +Writeback: 0 kB +AnonPages: 87672 kB +Mapped: 116988 kB +Shmem: 13980 kB +KReclaimable: 1568904 kB +Slab: 1641176 kB +SReclaimable: 1568904 kB +SUnreclaim: 72272 kB +KernelStack: 7008 kB +PageTables: 28244 kB +NFS_Unstable: 0 kB +Bounce: 0 kB +WritebackTmp: 0 kB +CommitLimit: 24861548 kB +Committed_AS: 2569488 kB +VmallocTotal: 34359738367 kB +VmallocUsed: 34260 kB +VmallocChunk: 0 kB +Percpu: 2912 kB +HardwareCorrupted: 0 kB +AnonHugePages: 0 kB +ShmemHugePages: 0 kB +ShmemPmdMapped: 0 kB +FileHugePages: 0 kB +FilePmdMapped: 0 kB +CmaTotal: 0 kB +CmaFree: 0 kB +HugePages_Total: 0 +HugePages_Free: 0 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +Hugepagesize: 2048 kB +Hugetlb: 0 kB +DirectMap4k: 1997488 kB +DirectMap2M: 14548992 kB +DirectMap1G: 0 kB)"; +} + +HWTEST_F(BufferSplitterUnittest, MemInfoBufferTEST, TestSize.Level1) +{ + int readsize = sizeof(g_kMockMeminfo); + BufferSplitter totalbuffer(g_kMockMeminfo, readsize); + + struct CStrCmp { + bool operator()(const char* a, const char* b) const + { + return strcmp(a, b) < 0; + } + }; + std::map meminfo_counters_ = {{"MemTotal", 16168736}, + {"Active", 5556068}, + {"Inactive(anon)", 43352}, + {"HugePages_Total", 0}, + {"DirectMap1G", 0}}; + + do { + if (!totalbuffer.NextWord(':')) { + continue; + } + const_cast(totalbuffer.CurWord())[totalbuffer.CurWordSize()] = '\0'; + auto it = meminfo_counters_.find(totalbuffer.CurWord()); + if (it == meminfo_counters_.end()) { + continue; + } + + int counter_id = it->second; + if (!totalbuffer.NextWord(' ')) { + continue; + } + auto value = static_cast(strtoll(totalbuffer.CurWord(), nullptr, 10)); + EXPECT_EQ((uint64_t)counter_id, value); + } while (totalbuffer.NextLine()); +} +} // namespace \ No newline at end of file diff --git a/device/plugins/memory_plugin/test/unittest/memory_data_plugin_unittest.cpp b/device/plugins/memory_plugin/test/unittest/memory_data_plugin_unittest.cpp new file mode 100755 index 000000000..0b93816b1 --- /dev/null +++ b/device/plugins/memory_plugin/test/unittest/memory_data_plugin_unittest.cpp @@ -0,0 +1,579 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "memory_data_plugin.h" + +using namespace testing::ext; + +namespace { +#if defined(__i386__) || defined(__x86_64__) +const std::string DEFAULT_TEST_PATH("./"); +#else +const std::string DEFAULT_TEST_PATH("/data/local/tmp/"); +#endif +constexpr uint32_t BUF_SIZE = 4 * 1024 * 1024; +constexpr uint32_t BIT_WIDTH = 35; + +std::string g_path; +const std::vector g_expectPidList = { + 1, 2, 11 +}; + +struct TestElement { + int32_t pid; + std::string name; + // data from /proc/$pid/stat + uint64_t vm_size_kb; + uint64_t vm_rss_kb; + uint64_t rss_anon_kb; + uint64_t rss_file_kb; + uint64_t rss_shmem_kb; + uint64_t vm_swap_kb; + uint64_t vm_locked_kb; + uint64_t vm_hwm_kb; + int64_t oom_score_adj; + + uint64_t java_heap; + uint64_t native_heap; + uint64_t code; + uint64_t stack; + uint64_t graphics; + uint64_t private_other; +}; + +TestElement g_singlepid = {-1, "null", 0, 0}; +TestElement g_pidtarget[] = { + {1, "systemd", 226208, 9388, 2984, 6404, 0, 0, 0, 9616, -1, 3036, 4256, 288, 748, 0, 1388}, + {2, "kthreadd", 0, 0, 0, 0, 0, 0, 0, 0, -100, 3036, 4260, 336, 760, 0, 4204}, + {11, "rcu_sched", 0, 0, 0, 0, 0, 0, 0, 0, 0, 3036, 4272, 392, 772, 0, 7168}, +}; + +unsigned long g_meminfo[] = {16168696, 1168452, 12363564, 2726188, 7370484, 29260, 8450388, 4807668, + 2535372, 658832, 4148836, 132, 0, 63999996, 62211580, 0}; +std::string GetFullPath(std::string path); + +class MemoryDataPluginTest : public ::testing::Test { +public: + static void SetUpTestCase(); + + static void TearDownTestCase() + { + if (access(g_path.c_str(), F_OK) == 0) { + std::string str = "rm -rf " + GetFullPath(DEFAULT_TEST_PATH) + "utresources"; + printf("TearDown--> %s\r\n", str.c_str()); + system(str.c_str()); + } + } + void SetUp() {} + void TearDown() {} +}; + +string Getexepath() +{ + char buf[PATH_MAX] = ""; + std::string path = "/proc/self/exe"; + size_t rslt = readlink(path.c_str(), buf, sizeof(buf)); + if (rslt < 0 || (rslt >= sizeof(buf))) { + return ""; + } + buf[rslt] = '\0'; + for (int i = rslt; i >= 0; i--) { + if (buf[i] == '/') { + buf[i + 1] = '\0'; + break; + } + } + return buf; +} + +void MyPrintfProcessMemoryInfo(MemoryData memoryData) +{ + int index = memoryData.processesinfo_size(); + for (int i = 0; i < index; ++i) { + ProcessMemoryInfo it = memoryData.processesinfo(i); + std::cout << it.pid() << "\t"; + std::cout << std::setw(BIT_WIDTH) << std::setfill(' ') << it.name().c_str() << "\t"; + std::cout << it.vm_size_kb() << "\t"; + std::cout << it.vm_rss_kb() << "\t"; + std::cout << it.rss_anon_kb() << "\t"; + std::cout << it.rss_file_kb() << "\t"; + std::cout << it.rss_shmem_kb() << "\t"; + std::cout << it.vm_locked_kb() << "\t"; + std::cout << it.vm_hwm_kb() << "\t"; + + std::cout << it.oom_score_adj() << "\t"; + if (it.has_memsummary()) { + std::cout << "appsummary:\t"; + AppSummary app = it.memsummary(); + std::cout << app.java_heap() << "\t"; + std::cout << app.native_heap() << "\t"; + std::cout << app.code() << "\t"; + std::cout << app.stack() << "\t"; + std::cout << app.graphics() << "\t"; + std::cout << app.private_other() << "\t"; + std::cout << app.system() << "\t"; + } + std::cout << std::endl; + } +} + +bool PluginStub(std::vector processList, MemoryDataPlugin& memoryPlugin, MemoryData& memoryData) +{ + MemoryConfig protoConfig; + int configSize; + int ret; + + // set config + if (processList.size() != 0) { + protoConfig.set_report_process_mem_info(true); + protoConfig.set_report_app_mem_info(true); + for (size_t i = 0; i < processList.size(); i++) { + protoConfig.add_pid(processList.at(i)); + } + } else { + protoConfig.set_report_process_tree(true); + } + + // serialize + configSize = protoConfig.ByteSizeLong(); + std::vector configData(configSize); + ret = protoConfig.SerializeToArray(configData.data(), configData.size()); + + // start + ret = memoryPlugin.Start(configData.data(), configData.size()); + if (ret < 0) { + return false; + } + printf("ut: serialize success start plugin ret = %d\n", ret); + + // report + std::vector bufferData(BUF_SIZE); + ret = memoryPlugin.Report(bufferData.data(), bufferData.size()); + if (ret > 0) { + memoryData.ParseFromArray(bufferData.data(), ret); + MyPrintfProcessMemoryInfo(memoryData); + return true; + } + + return false; +} + +bool pluginMeminfoStub(MemoryDataPlugin& memoryPlugin, MemoryData& memoryData) +{ + MemoryConfig protoConfig; + int configSize; + int ret; + + protoConfig.set_report_sysmem_mem_info(true); + + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_MEM_TOTAL); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_MEM_FREE); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_MEM_AVAILABLE); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_BUFFERS); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_CACHED); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_SWAP_CACHED); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_ACTIVE); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_INACTIVE); + + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_ACTIVE_ANON); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_INACTIVE_ANON); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_INACTIVE_FILE); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_UNEVICTABLE); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_MLOCKED); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_SWAP_TOTAL); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_SWAP_FREE); + protoConfig.add_sys_meminfo_counters(SysMeminfoType::MEMINFO_DIRTY); + + // serialize + configSize = protoConfig.ByteSizeLong(); + std::vector configData(configSize); + ret = protoConfig.SerializeToArray(configData.data(), configData.size()); + + // start + ret = memoryPlugin.Start(configData.data(), configData.size()); + if (ret < 0) { + return false; + } + printf("ut: serialize success start plugin ret = %d\n", ret); + + // report + std::vector bufferData(BUF_SIZE); + ret = memoryPlugin.Report(bufferData.data(), bufferData.size()); + if (ret > 0) { + memoryData.ParseFromArray(bufferData.data(), ret); + return true; + } + + return false; +} + +bool pluginWriteVmstat(MemoryDataPlugin& memoryPlugin, MemoryData& memoryData) +{ + MemoryConfig protoConfig; + int configSize; + int ret; + + protoConfig.set_report_sysmem_vmem_info(true); + + // serialize + configSize = protoConfig.ByteSizeLong(); + std::vector configData(configSize); + ret = protoConfig.SerializeToArray(configData.data(), configData.size()); + + // start + ret = memoryPlugin.Start(configData.data(), configData.size()); + if (ret < 0) { + return false; + } + printf("ut: serialize success start plugin ret = %d\n", ret); + + // report + std::vector bufferData(BUF_SIZE); + ret = memoryPlugin.Report(bufferData.data(), bufferData.size()); + if (ret > 0) { + memoryData.ParseFromArray(bufferData.data(), ret); + return true; + } + + return false; +} + +bool pluginDumpsys(MemoryDataPlugin& memoryPlugin, MemoryData& memoryData) +{ + MemoryConfig protoConfig; + int configSize; + int ret; + + protoConfig.set_report_process_mem_info(true); + protoConfig.set_report_app_mem_info(true); + protoConfig.add_pid(1); + protoConfig.set_report_app_mem_by_dumpsys(true); + + // serialize + configSize = protoConfig.ByteSizeLong(); + std::vector configData(configSize); + ret = protoConfig.SerializeToArray(configData.data(), configData.size()); + + // start + ret = memoryPlugin.Start(configData.data(), configData.size()); + if (ret < 0) { + return false; + } + printf("ut: serialize success start plugin ret = %d\n", ret); + + // report + std::vector bufferData(BUF_SIZE); + ret = memoryPlugin.Report(bufferData.data(), bufferData.size()); + if (ret > 0) { + memoryData.ParseFromArray(bufferData.data(), ret); + return true; + } + + return false; +} + +std::string GetFullPath(std::string path) +{ + if (path.size() > 0 && path[0] != '/') { + return Getexepath() + path; + } + return path; +} + +#if defined(__i386__) || defined(__x86_64__) +bool CreatTestResource(std::string path, std::string exepath) +{ + std::string str = "cp -r " + path + "utresources " + exepath; + printf("CreatTestResource:%s\n", str.c_str()); + + pid_t status = system(str.c_str()); + if (-1 == status) { + printf("system error!"); + } else { + printf("exit status value = [0x%x]\n", status); + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) == 0) { + return true; + } else { + printf("run shell script fail, script exit code: %d\n", WEXITSTATUS(status)); + return false; + } + } else { + printf("exit status = [%d]\n", WEXITSTATUS(status)); + return true; + } + } + return false; +} +#endif + +void MemoryDataPluginTest::SetUpTestCase() +{ + g_path = GetFullPath(DEFAULT_TEST_PATH); + printf("g_path:%s\n", g_path.c_str()); + EXPECT_NE("", g_path); +#if defined(__i386__) || defined(__x86_64__) + if (DEFAULT_TEST_PATH != g_path) { + if ((access(std::string(g_path + "utresources/proc").c_str(), F_OK) != 0) && + (access(std::string(DEFAULT_TEST_PATH + "utresources/proc").c_str(), F_OK) == 0)) { + EXPECT_TRUE(CreatTestResource(DEFAULT_TEST_PATH, g_path)); + } + g_path += "utresources/proc"; + } +#else + g_path += "utresources/proc"; +#endif + printf("g_path:%s\n", g_path.c_str()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Test whether the path exists. + * @tc.type: FUNC + */ +HWTEST_F(MemoryDataPluginTest, Testpath, TestSize.Level1) +{ + EXPECT_NE(g_path, ""); + printf("g_path:%s\n", g_path.c_str()); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Pid list test in a specific directory. + * @tc.type: FUNC + */ +HWTEST_F(MemoryDataPluginTest, Testpidlist, TestSize.Level1) +{ + MemoryDataPlugin* memoryPlugin = new MemoryDataPlugin(); + + printf("g_path:%s\n", g_path.c_str()); + DIR* dir = memoryPlugin->OpenDestDir(g_path.c_str()); + EXPECT_NE(nullptr, dir); + + std::vector cmpPidList; + while (int32_t pid = memoryPlugin->GetValidPid(dir)) { + printf("pid = %d\n", pid); + cmpPidList.push_back(pid); + } + sort(cmpPidList.begin(), cmpPidList.end()); + closedir(dir); + EXPECT_EQ(cmpPidList, g_expectPidList); + delete memoryPlugin; +} + +/** + * @tc.name: memory plugin + * @tc.desc: Mem information test for specific pid. + * @tc.type: FUNC + */ +HWTEST_F(MemoryDataPluginTest, Testpluginformeminfo, TestSize.Level1) +{ + MemoryDataPlugin memoryPlugin; + MemoryData memoryData; + memoryPlugin.SetPath(const_cast(g_path.c_str())); + printf("Testpluginformeminfo:setPath=%s\n", g_path.c_str()); + EXPECT_TRUE(pluginMeminfoStub(memoryPlugin, memoryData)); + + int index = memoryData.meminfo().size(); + EXPECT_EQ(16, index); + printf("Testpluginformeminfo:index=%d\n", index); + for (int i = 0; i < index; ++i) { + EXPECT_EQ(g_meminfo[i], memoryData.meminfo(i).value()); + } + printf("\n"); + + // stop + memoryPlugin.Stop(); +} + +/** + * @tc.name: memory plugin + * @tc.desc: pid list information test for specific pid. + * @tc.type: FUNC + */ +HWTEST_F(MemoryDataPluginTest, Testpluginforsinglepid, TestSize.Level1) +{ + MemoryDataPlugin memoryPlugin; + MemoryData memoryData; + std::vector pid; + pid.push_back(5); + memoryPlugin.SetPath(const_cast(g_path.c_str())); + printf("Testpluginforsinglepid:setPath=%s\n", g_path.c_str()); + EXPECT_TRUE(PluginStub(pid, memoryPlugin, memoryData)); + int index = memoryData.processesinfo_size(); + EXPECT_EQ(1, index); + printf("Testpluginforsinglepid:index=%d\n", index); + + ProcessMemoryInfo it = memoryData.processesinfo(0); + EXPECT_EQ(g_singlepid.pid, it.pid()); + printf("pid=%d\r\n", it.pid()); + EXPECT_EQ(g_singlepid.name, it.name()); + EXPECT_EQ(g_singlepid.vm_size_kb, it.vm_size_kb()); + EXPECT_EQ(g_singlepid.vm_rss_kb, it.vm_rss_kb()); + EXPECT_EQ(g_singlepid.rss_anon_kb, it.rss_anon_kb()); + EXPECT_EQ(g_singlepid.rss_file_kb, it.rss_file_kb()); + EXPECT_EQ(g_singlepid.rss_shmem_kb, it.rss_shmem_kb()); + EXPECT_EQ(g_singlepid.vm_locked_kb, it.vm_locked_kb()); + EXPECT_EQ(g_singlepid.vm_hwm_kb, it.vm_hwm_kb()); + + EXPECT_EQ(g_singlepid.oom_score_adj, it.oom_score_adj()); + + EXPECT_TRUE(it.has_memsummary()); + AppSummary app = it.memsummary(); + EXPECT_EQ(g_singlepid.java_heap, app.java_heap()); + EXPECT_EQ(g_singlepid.native_heap, app.native_heap()); + EXPECT_EQ(g_singlepid.code, app.code()); + EXPECT_EQ(g_singlepid.stack, app.stack()); + EXPECT_EQ(g_singlepid.graphics, app.graphics()); + EXPECT_EQ(g_singlepid.private_other, app.private_other()); + + // stop + memoryPlugin.Stop(); +} + +/** + * @tc.name: memory plugin + * @tc.desc: pid list information test for specific pids. + * @tc.type: FUNC + */ +HWTEST_F(MemoryDataPluginTest, Testpluginforpids, TestSize.Level1) +{ + std::vector cmpPidList = g_expectPidList; + EXPECT_NE((size_t)0, cmpPidList.size()); + MemoryDataPlugin memoryPlugin; + MemoryData memoryData; + memoryPlugin.SetPath(const_cast(g_path.c_str())); + printf("Testpluginforpids:setPath=%s\n", g_path.c_str()); + EXPECT_TRUE(PluginStub(cmpPidList, memoryPlugin, memoryData)); + int index = memoryData.processesinfo_size(); + EXPECT_EQ(3, index); + printf("Testpluginforpids:index=%d\n", index); + for (int i = 0; i < index; ++i) { + ProcessMemoryInfo it = memoryData.processesinfo(i); + EXPECT_EQ(g_pidtarget[i].pid, it.pid()); + printf("%d:pid=%d\r\n", i, it.pid()); + EXPECT_EQ(g_pidtarget[i].name, it.name()); + EXPECT_EQ(g_pidtarget[i].vm_size_kb, it.vm_size_kb()); + EXPECT_EQ(g_pidtarget[i].vm_rss_kb, it.vm_rss_kb()); + EXPECT_EQ(g_pidtarget[i].rss_anon_kb, it.rss_anon_kb()); + EXPECT_EQ(g_pidtarget[i].rss_file_kb, it.rss_file_kb()); + EXPECT_EQ(g_pidtarget[i].rss_shmem_kb, it.rss_shmem_kb()); + EXPECT_EQ(g_pidtarget[i].vm_locked_kb, it.vm_locked_kb()); + EXPECT_EQ(g_pidtarget[i].vm_hwm_kb, it.vm_hwm_kb()); + + EXPECT_EQ(g_pidtarget[i].oom_score_adj, it.oom_score_adj()); + + EXPECT_TRUE(it.has_memsummary()); + } + // stop + memoryPlugin.Stop(); +} + +/** + * @tc.name: memory plugin + * @tc.desc: pid list information test for process tree. + * @tc.type: FUNC + */ +HWTEST_F(MemoryDataPluginTest, Testpluginforlist, TestSize.Level1) +{ + std::vector cmpPidList = g_expectPidList; + EXPECT_NE((size_t)0, cmpPidList.size()); + MemoryDataPlugin memoryPlugin; + std::vector pid; + MemoryData memoryData; + memoryPlugin.SetPath(const_cast(g_path.c_str())); + printf("Testpluginforlist:setPath=%s\n", g_path.c_str()); + EXPECT_TRUE(PluginStub(pid, memoryPlugin, memoryData)); + int index = memoryData.processesinfo_size(); + EXPECT_EQ(3, index); + printf("Testpluginforlist:index=%d, pidsize=", index); + std::cout << pid.size() << std::endl; + for (int i = 0; i < index; ++i) { + ProcessMemoryInfo it = memoryData.processesinfo(i); + EXPECT_EQ(g_pidtarget[i].pid, it.pid()); + printf("%d:pid=%d\r\n", i, it.pid()); + EXPECT_EQ(g_pidtarget[i].name, it.name()); + EXPECT_EQ(g_pidtarget[i].vm_size_kb, it.vm_size_kb()); + EXPECT_EQ(g_pidtarget[i].vm_rss_kb, it.vm_rss_kb()); + EXPECT_EQ(g_pidtarget[i].rss_anon_kb, it.rss_anon_kb()); + EXPECT_EQ(g_pidtarget[i].rss_file_kb, it.rss_file_kb()); + EXPECT_EQ(g_pidtarget[i].rss_shmem_kb, it.rss_shmem_kb()); + EXPECT_EQ(g_pidtarget[i].vm_locked_kb, it.vm_locked_kb()); + EXPECT_EQ(g_pidtarget[i].vm_hwm_kb, it.vm_hwm_kb()); + + EXPECT_EQ(g_pidtarget[i].oom_score_adj, it.oom_score_adj()); + + EXPECT_TRUE(!it.has_memsummary()); + } + // stop + memoryPlugin.Stop(); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Smaps stats info test for specific pids. + * @tc.type: FUNC + */ +HWTEST_F(MemoryDataPluginTest, TestSmapsStatsInfo, TestSize.Level1) +{ + SmapsStats smap(std::string(g_path + "/")); + for (size_t i = 0; i < g_expectPidList.size(); i++) { + EXPECT_TRUE(smap.ParseMaps(g_expectPidList[i])); + EXPECT_EQ(g_pidtarget[i].java_heap, (uint64_t)(smap.GetProcessJavaHeap())); + EXPECT_EQ(g_pidtarget[i].native_heap, (uint64_t)(smap.GetProcessNativeHeap())); + EXPECT_EQ(g_pidtarget[i].code, (uint64_t)(smap.GetProcessCode())); + EXPECT_EQ(g_pidtarget[i].stack, (uint64_t)(smap.GetProcessStack())); + EXPECT_EQ(g_pidtarget[i].graphics, (uint64_t)(smap.GetProcessGraphics())); + EXPECT_EQ(g_pidtarget[i].private_other, (uint64_t)(smap.GetProcessPrivateOther())); + } +} + +/** + * @tc.name: memory plugin + * @tc.desc: Vmstat info test for specific pids. + * @tc.type: FUNC + */ +HWTEST_F(MemoryDataPluginTest, TestpluginWriteVmstat, TestSize.Level1) +{ + MemoryDataPlugin memoryPlugin; + MemoryData memoryData; + memoryPlugin.SetPath(const_cast(g_path.c_str())); + printf("Testpluginformeminfo:setPath=%s\n", g_path.c_str()); + EXPECT_FALSE(pluginWriteVmstat(memoryPlugin, memoryData)); + // stop + memoryPlugin.Stop(); +} + +/** + * @tc.name: memory plugin + * @tc.desc: Get information through Dumpsys. + * @tc.type: FUNC + */ +HWTEST_F(MemoryDataPluginTest, TestpluginDumpsys, TestSize.Level1) +{ + MemoryDataPlugin memoryPlugin; + MemoryData memoryData; + memoryPlugin.SetPath(const_cast(g_path.c_str())); + printf("Testpluginformeminfo:setPath=%s\n", g_path.c_str()); + EXPECT_TRUE(pluginDumpsys(memoryPlugin, memoryData)); + std::string line = "01234567890"; + memoryPlugin.ParseNumber(line); + // stop + memoryPlugin.Stop(); +} +} // namespace diff --git a/device/plugins/memory_plugin/test/utresources/ohos_test.xml b/device/plugins/memory_plugin/test/utresources/ohos_test.xml new file mode 100644 index 000000000..defafe9b7 --- /dev/null +++ b/device/plugins/memory_plugin/test/utresources/ohos_test.xml @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/device/plugins/memory_plugin/test/utresources/proc/1/oom_score_adj b/device/plugins/memory_plugin/test/utresources/proc/1/oom_score_adj new file mode 100755 index 000000000..3a2e3f498 --- /dev/null +++ b/device/plugins/memory_plugin/test/utresources/proc/1/oom_score_adj @@ -0,0 +1 @@ +-1 diff --git a/device/plugins/memory_plugin/test/utresources/proc/1/smaps b/device/plugins/memory_plugin/test/utresources/proc/1/smaps new file mode 100755 index 000000000..73de81290 --- /dev/null +++ b/device/plugins/memory_plugin/test/utresources/proc/1/smaps @@ -0,0 +1,46233 @@ +12c00000-2ac00000 rw-p 00000000 00:00 0 [anon:dalvik-main space (region space)] +Name: [anon:dalvik-main space (region space)] +Size: 393216 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 1748 kB +Pss: 1748 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 1748 kB +Referenced: 1748 kB +Anonymous: 1748 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +5d304000-5d307000 r--p 00000000 fd:04 252 /system/bin/app_process32 +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 12 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me dw +5d307000-5d30b000 r-xp 00002000 fd:04 252 /system/bin/app_process32 +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 16 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 16 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me dw +5d30b000-5d30c000 r--p 00005000 fd:04 252 /system/bin/app_process32 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me dw ac +5d30c000-5d30d000 rw-p 00005000 fd:04 252 /system/bin/app_process32 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me dw ac +5d30d000-5d30e000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +702f2000-704cf000 rw-p 00000000 00:00 0 [anon:dalvik-/apex/com.art/javalib/boot.art] +Name: [anon:dalvik-/apex/com.art/javalib/boot.art] +Size: 1908 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 1908 kB +Pss: 316 kB +Shared_Clean: 0 kB +Shared_Dirty: 1640 kB +Private_Clean: 0 kB +Private_Dirty: 268 kB +Referenced: 1772 kB +Anonymous: 1908 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +704cf000-70512000 rw-p 00000000 00:00 0 [anon:dalvik-/apex/com.art/javalib/boot-core-libart.art] +Name: [anon:dalvik-/apex/com.art/javalib/boot-core-libart.art] +Size: 268 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 268 kB +Pss: 58 kB +Shared_Clean: 0 kB +Shared_Dirty: 216 kB +Private_Clean: 0 kB +Private_Dirty: 52 kB +Referenced: 252 kB +Anonymous: 268 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +70512000-705b0000 rw-p 00000000 00:00 0 [anon:dalvik-/apex/com.art/javalib/boot-core-icu4j.art] +Name: [anon:dalvik-/apex/com.art/javalib/boot-core-icu4j.art] +Size: 632 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 632 kB +Pss: 41 kB +Shared_Clean: 0 kB +Shared_Dirty: 608 kB +Private_Clean: 0 kB +Private_Dirty: 24 kB +Referenced: 440 kB +Anonymous: 632 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +705b0000-705d9000 rw-p 00000000 00:00 0 [anon:dalvik-/apex/com.art/javalib/boot-okhttp.art] +Name: [anon:dalvik-/apex/com.art/javalib/boot-okhttp.art] +Size: 164 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 164 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 164 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 164 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +705d9000-7060f000 rw-p 00000000 00:00 0 [anon:dalvik-/apex/com.art/javalib/boot-bouncycastle.art] +Name: [anon:dalvik-/apex/com.art/javalib/boot-bouncycastle.art] +Size: 216 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 216 kB +Pss: 6 kB +Shared_Clean: 0 kB +Shared_Dirty: 216 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 116 kB +Anonymous: 216 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +7060f000-7061a000 rw-p 00000000 00:00 0 [anon:dalvik-/apex/com.art/javalib/boot-apache-xml.art] +Name: [anon:dalvik-/apex/com.art/javalib/boot-apache-xml.art] +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 44 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 44 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +7061a000-7069c000 r--p 00000000 07:a8 59 /apex/com.art/javalib/x86/boot.oat +Size: 520 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 504 kB +Pss: 14 kB +Shared_Clean: 504 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 472 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +7069c000-70945000 r-xp 00082000 07:a8 59 /apex/com.art/javalib/x86/boot.oat +Size: 2724 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 2724 kB +Pss: 84 kB +Shared_Clean: 2724 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 2724 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +70945000-70946000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +70946000-70948000 r--p 00000000 07:a8 60 /apex/com.art/javalib/x86/boot.vdex +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +70948000-70949000 r--p 0032b000 07:a8 59 /apex/com.art/javalib/x86/boot.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +70949000-7094a000 rw-p 0032c000 07:a8 59 /apex/com.art/javalib/x86/boot.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +7094a000-7095a000 r--p 00000000 07:a8 53 /apex/com.art/javalib/x86/boot-core-libart.oat +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +7095a000-709ac000 r-xp 00010000 07:a8 53 /apex/com.art/javalib/x86/boot-core-libart.oat +Size: 328 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 328 kB +Pss: 9 kB +Shared_Clean: 328 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 328 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +709ac000-709ad000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +709ad000-709ae000 r--p 00000000 07:a8 54 /apex/com.art/javalib/x86/boot-core-libart.vdex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +709ae000-709af000 r--p 00062000 07:a8 53 /apex/com.art/javalib/x86/boot-core-libart.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +709af000-709b0000 rw-p 00063000 07:a8 53 /apex/com.art/javalib/x86/boot-core-libart.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +709b0000-709db000 r--p 00000000 07:a8 50 /apex/com.art/javalib/x86/boot-core-icu4j.oat +Size: 172 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +709db000-70aa4000 r-xp 0002b000 07:a8 50 /apex/com.art/javalib/x86/boot-core-icu4j.oat +Size: 804 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 804 kB +Pss: 35 kB +Shared_Clean: 804 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 804 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +70aa4000-70aa5000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +70aa5000-70aa6000 r--p 00000000 07:a8 51 /apex/com.art/javalib/x86/boot-core-icu4j.vdex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +70aa6000-70aa7000 r--p 000f4000 07:a8 50 /apex/com.art/javalib/x86/boot-core-icu4j.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +70aa7000-70aa8000 rw-p 000f5000 07:a8 50 /apex/com.art/javalib/x86/boot-core-icu4j.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +70aa8000-70ab3000 r--p 00000000 07:a8 56 /apex/com.art/javalib/x86/boot-okhttp.oat +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 44 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 44 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +70ab3000-70ae4000 r-xp 0000b000 07:a8 56 /apex/com.art/javalib/x86/boot-okhttp.oat +Size: 196 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +70ae4000-70ae5000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +70ae5000-70ae6000 r--p 00000000 07:a8 57 /apex/com.art/javalib/x86/boot-okhttp.vdex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +70ae6000-70ae7000 r--p 0003c000 07:a8 56 /apex/com.art/javalib/x86/boot-okhttp.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +70ae7000-70ae8000 rw-p 0003d000 07:a8 56 /apex/com.art/javalib/x86/boot-okhttp.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +70ae8000-70af3000 r--p 00000000 07:a8 47 /apex/com.art/javalib/x86/boot-bouncycastle.oat +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 44 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 44 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +70af3000-70b05000 r-xp 0000b000 07:a8 47 /apex/com.art/javalib/x86/boot-bouncycastle.oat +Size: 72 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +70b05000-70b06000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +70b06000-70b07000 r--p 00000000 07:a8 48 /apex/com.art/javalib/x86/boot-bouncycastle.vdex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +70b07000-70b08000 r--p 0001d000 07:a8 47 /apex/com.art/javalib/x86/boot-bouncycastle.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +70b08000-70b09000 rw-p 0001e000 07:a8 47 /apex/com.art/javalib/x86/boot-bouncycastle.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +70b09000-70b0e000 r--p 00000000 07:a8 44 /apex/com.art/javalib/x86/boot-apache-xml.oat +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +70b0e000-70b0f000 r--p 00000000 07:a8 45 /apex/com.art/javalib/x86/boot-apache-xml.vdex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +70b0f000-70b10000 r--p 00005000 07:a8 44 /apex/com.art/javalib/x86/boot-apache-xml.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +70b10000-70b11000 rw-p 00006000 07:a8 44 /apex/com.art/javalib/x86/boot-apache-xml.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +70b11000-71418000 rw-p 00000000 00:00 0 [anon:dalvik-/system/framework/boot-framework.art] +Name: [anon:dalvik-/system/framework/boot-framework.art] +Size: 9244 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 9244 kB +Pss: 605 kB +Shared_Clean: 0 kB +Shared_Dirty: 8900 kB +Private_Clean: 0 kB +Private_Dirty: 344 kB +Referenced: 6056 kB +Anonymous: 9244 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +71418000-71449000 rw-p 00000000 00:00 0 [anon:dalvik-/system/framework/boot-ext.art] +Name: [anon:dalvik-/system/framework/boot-ext.art] +Size: 196 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 196 kB +Pss: 5 kB +Shared_Clean: 0 kB +Shared_Dirty: 196 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 128 kB +Anonymous: 196 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +71449000-71575000 rw-p 00000000 00:00 0 [anon:dalvik-/system/framework/boot-telephony-common.art] +Name: [anon:dalvik-/system/framework/boot-telephony-common.art] +Size: 1200 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 1200 kB +Pss: 34 kB +Shared_Clean: 0 kB +Shared_Dirty: 1200 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 484 kB +Anonymous: 1200 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +71575000-715f8000 rw-p 00000000 00:00 0 [anon:dalvik-/system/framework/boot-voip-common.art] +Name: [anon:dalvik-/system/framework/boot-voip-common.art] +Size: 524 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 524 kB +Pss: 14 kB +Shared_Clean: 0 kB +Shared_Dirty: 524 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 220 kB +Anonymous: 524 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +715f8000-71615000 rw-p 00000000 00:00 0 [anon:dalvik-/system/framework/boot-ims-common.art] +Name: [anon:dalvik-/system/framework/boot-ims-common.art] +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 116 kB +Pss: 3 kB +Shared_Clean: 0 kB +Shared_Dirty: 116 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 44 kB +Anonymous: 116 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +71615000-71618000 rw-p 00000000 00:00 0 [anon:dalvik-/system/framework/boot-framework-atb-backward-compatibility.art] +Name: [anon:dalvik-/system/framework/boot-framework-atb-backward-compatibility.art] +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +71618000-71819000 r--p 00000000 fd:04 1442 /system/framework/x86/boot-framework.oat +Size: 2052 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 1496 kB +Pss: 51 kB +Shared_Clean: 1496 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 1372 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +71819000-72115000 r-xp 00201000 fd:04 1442 /system/framework/x86/boot-framework.oat +Size: 9200 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 6408 kB +Pss: 215 kB +Shared_Clean: 6408 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 6408 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +72115000-72117000 r--p 00afd000 fd:04 1442 /system/framework/x86/boot-framework.oat +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +72117000-72118000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +72118000-72122000 r--p 00000000 fd:04 1325 /system/framework/boot-framework.vdex +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 1 kB +Shared_Clean: 40 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 40 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +72122000-72123000 r--p 00aff000 fd:04 1442 /system/framework/x86/boot-framework.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +72123000-72124000 rw-p 00b00000 fd:04 1442 /system/framework/x86/boot-framework.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +72124000-72129000 r--p 00000000 fd:04 1436 /system/framework/x86/boot-ext.oat +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +72129000-7213e000 r-xp 00005000 fd:04 1436 /system/framework/x86/boot-ext.oat +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +7213e000-7213f000 r--p 0001a000 fd:04 1436 /system/framework/x86/boot-ext.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +7213f000-72140000 r--p 00000000 fd:04 1323 /system/framework/boot-ext.vdex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +72140000-72141000 r--p 0001b000 fd:04 1436 /system/framework/x86/boot-ext.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +72141000-72142000 rw-p 0001c000 fd:04 1436 /system/framework/x86/boot-ext.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +72142000-7214a000 r--p 00000000 fd:04 1448 /system/framework/x86/boot-telephony-common.oat +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 0 kB +Shared_Clean: 32 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 32 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +7214a000-7214b000 r--p 00000000 fd:04 1327 /system/framework/boot-telephony-common.vdex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +7214b000-7214c000 r--p 00008000 fd:04 1448 /system/framework/x86/boot-telephony-common.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +7214c000-7214d000 rw-p 00009000 fd:04 1448 /system/framework/x86/boot-telephony-common.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +7214d000-72152000 r--p 00000000 fd:04 1451 /system/framework/x86/boot-voip-common.oat +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +72152000-72153000 r-xp 00005000 fd:04 1451 /system/framework/x86/boot-voip-common.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +72153000-72154000 r--p 00000000 fd:04 1328 /system/framework/boot-voip-common.vdex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +72154000-72155000 r--p 00006000 fd:04 1451 /system/framework/x86/boot-voip-common.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +72155000-72156000 rw-p 00007000 fd:04 1451 /system/framework/x86/boot-voip-common.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +72156000-72158000 r--p 00000000 fd:04 1445 /system/framework/x86/boot-ims-common.oat +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +72158000-72159000 r--p 00000000 fd:04 1326 /system/framework/boot-ims-common.vdex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +72159000-7215a000 r--p 00002000 fd:04 1445 /system/framework/x86/boot-ims-common.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +7215a000-7215b000 rw-p 00003000 fd:04 1445 /system/framework/x86/boot-ims-common.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +7215b000-7215d000 r--p 00000000 fd:04 1439 /system/framework/x86/boot-framework-atb-backward-compatibility.oat +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +7215d000-7215e000 r--p 00000000 fd:04 1324 /system/framework/boot-framework-atb-backward-compatibility.vdex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +7215e000-7215f000 r--p 00002000 fd:04 1439 /system/framework/x86/boot-framework-atb-backward-compatibility.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +7215f000-72160000 rw-p 00003000 fd:04 1439 /system/framework/x86/boot-framework-atb-backward-compatibility.oat +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +72160000-72458000 rw-p 00000000 00:00 0 [anon:dalvik-zygote space] +Name: [anon:dalvik-zygote space] +Size: 3040 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 3040 kB +Pss: 626 kB +Shared_Clean: 0 kB +Shared_Dirty: 2484 kB +Private_Clean: 0 kB +Private_Dirty: 556 kB +Referenced: 2956 kB +Anonymous: 3040 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +72458000-72459000 rw-p 00000000 00:00 0 [anon:dalvik-non moving space] +Name: [anon:dalvik-non moving space] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +72459000-72461000 rw-p 00000000 00:00 0 [anon:dalvik-non moving space] +Name: [anon:dalvik-non moving space] +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 32 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 32 kB +Referenced: 32 kB +Anonymous: 32 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +72461000-75961000 ---p 00000000 00:00 0 [anon:dalvik-non moving space] +Name: [anon:dalvik-non moving space] +Size: 54272 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +75961000-76160000 rw-p 00000000 00:00 0 [anon:dalvik-non moving space] +Name: [anon:dalvik-non moving space] +Size: 8188 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +c567c000-c567d000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c567d000-c5780000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4273] +Name: [anon:stack_and_tls:4273] +Size: 1036 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 4 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c5780000-c5782000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5782000-c5885000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4270] +Name: [anon:stack_and_tls:4270] +Size: 1036 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 4 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c5885000-c5887000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5887000-c5888000 ---p 00000000 00:00 0 [anon:stack_and_tls:4258] +Name: [anon:stack_and_tls:4258] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5888000-c5986000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4258] +Name: [anon:stack_and_tls:4258] +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 20 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 20 kB +Referenced: 4 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c5986000-c5988000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5988000-c5989000 ---p 00000000 00:00 0 [anon:stack_and_tls:4257] +Name: [anon:stack_and_tls:4257] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5989000-c5a87000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4257] +Name: [anon:stack_and_tls:4257] +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 20 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 20 kB +Referenced: 4 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c5a87000-c5a89000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5a89000-c5a8a000 ---p 00000000 00:00 0 [anon:stack_and_tls:4256] +Name: [anon:stack_and_tls:4256] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5a8a000-c5b88000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4256] +Name: [anon:stack_and_tls:4256] +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 20 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 20 kB +Referenced: 4 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c5b88000-c5b8a000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5b8a000-c5b8b000 ---p 00000000 00:00 0 [anon:stack_and_tls:4205] +Name: [anon:stack_and_tls:4205] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5b8b000-c5c91000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4205] +Name: [anon:stack_and_tls:4205] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 24 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 24 kB +Referenced: 8 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c5c91000-c5c93000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5c93000-c5c94000 ---p 00000000 00:00 0 [anon:stack_and_tls:4201] +Name: [anon:stack_and_tls:4201] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5c94000-c5d92000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4201] +Name: [anon:stack_and_tls:4201] +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 24 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 24 kB +Referenced: 20 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c5d92000-c5d94000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5d94000-c5d95000 ---p 00000000 00:00 0 [anon:stack_and_tls:4155] +Name: [anon:stack_and_tls:4155] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5d95000-c5e9b000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4155] +Name: [anon:stack_and_tls:4155] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 24 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 24 kB +Referenced: 20 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c5e9b000-c5e9d000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5e9d000-c5e9e000 ---p 00000000 00:00 0 [anon:stack_and_tls:4151] +Name: [anon:stack_and_tls:4151] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c5e9e000-c5fa4000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4151] +Name: [anon:stack_and_tls:4151] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 24 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 24 kB +Referenced: 8 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c5fa4000-c5fa5000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c61b7000-c61b8000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c61b8000-c61b9000 ---p 00000000 00:00 0 [anon:stack_and_tls:4147] +Name: [anon:stack_and_tls:4147] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c61b9000-c62bf000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4147] +Name: [anon:stack_and_tls:4147] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 24 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 24 kB +Referenced: 8 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c62bf000-c62c0000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c6a6b000-c6a7b000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 28 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 28 kB +Referenced: 0 kB +Anonymous: 28 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +c6ac0000-c6b00000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 16 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +c6b1c000-c6b1d000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c6b1d000-c6b1e000 ---p 00000000 00:00 0 [anon:stack_and_tls:4133] +Name: [anon:stack_and_tls:4133] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c6b1e000-c6c24000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4133] +Name: [anon:stack_and_tls:4133] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 8 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c6c24000-c6c26000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c6c26000-c6c27000 ---p 00000000 00:00 0 [anon:stack_and_tls:4132] +Name: [anon:stack_and_tls:4132] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c6c27000-c6d2d000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4132] +Name: [anon:stack_and_tls:4132] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 8 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c6d2d000-c6d2f000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c6d2f000-c6d30000 ---p 00000000 00:00 0 [anon:stack_and_tls:4130] +Name: [anon:stack_and_tls:4130] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c6d30000-c6e36000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4130] +Name: [anon:stack_and_tls:4130] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 32 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 32 kB +Referenced: 28 kB +Anonymous: 32 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c6e36000-c6e38000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c6e38000-c6e39000 ---p 00000000 00:00 0 [anon:stack_and_tls:4129] +Name: [anon:stack_and_tls:4129] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c6e39000-c6f3f000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4129] +Name: [anon:stack_and_tls:4129] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 28 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 28 kB +Referenced: 24 kB +Anonymous: 28 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c6f3f000-c6f40000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7077000-c7078000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7078000-c7079000 ---p 00000000 00:00 0 [anon:stack_and_tls:31679] +Name: [anon:stack_and_tls:31679] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7079000-c7177000 rw-p 00000000 00:00 0 [anon:stack_and_tls:31679] +Name: [anon:stack_and_tls:31679] +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 16 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 16 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c7177000-c7179000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7179000-c71ff000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 536 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 524 kB +Pss: 524 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 524 kB +Referenced: 44 kB +Anonymous: 524 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +c71ff000-c7200000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7200000-c7240000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 68 kB +Pss: 68 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 68 kB +Referenced: 0 kB +Anonymous: 68 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +c725b000-c725c000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c725c000-c725d000 ---p 00000000 00:00 0 [anon:stack_and_tls:4121] +Name: [anon:stack_and_tls:4121] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c725d000-c7363000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4121] +Name: [anon:stack_and_tls:4121] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 20 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 20 kB +Referenced: 8 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c7363000-c7365000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7365000-c7366000 ---p 00000000 00:00 0 [anon:stack_and_tls:4125] +Name: [anon:stack_and_tls:4125] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7366000-c746c000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4125] +Name: [anon:stack_and_tls:4125] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 24 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 24 kB +Referenced: 8 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c746c000-c746e000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c746e000-c746f000 ---p 00000000 00:00 0 [anon:stack_and_tls:4109] +Name: [anon:stack_and_tls:4109] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c746f000-c7575000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4109] +Name: [anon:stack_and_tls:4109] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 8 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c7575000-c7577000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7577000-c7578000 ---p 00000000 00:00 0 [anon:stack_and_tls:4100] +Name: [anon:stack_and_tls:4100] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7578000-c767e000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4100] +Name: [anon:stack_and_tls:4100] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 32 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 32 kB +Referenced: 28 kB +Anonymous: 32 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c767e000-c7680000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7680000-c7681000 ---p 00000000 00:00 0 [anon:stack_and_tls:4074] +Name: [anon:stack_and_tls:4074] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7681000-c7787000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4074] +Name: [anon:stack_and_tls:4074] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 24 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 24 kB +Referenced: 8 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c7787000-c7789000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7789000-c778a000 ---p 00000000 00:00 0 [anon:stack_and_tls:4067] +Name: [anon:stack_and_tls:4067] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c778a000-c7890000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4067] +Name: [anon:stack_and_tls:4067] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 16 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 8 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c7890000-c7892000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7892000-c7893000 ---p 00000000 00:00 0 [anon:stack_and_tls:4066] +Name: [anon:stack_and_tls:4066] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7893000-c7999000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4066] +Name: [anon:stack_and_tls:4066] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 16 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 8 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c7999000-c799b000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c799b000-c799c000 ---p 00000000 00:00 0 [anon:stack_and_tls:4060] +Name: [anon:stack_and_tls:4060] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c799c000-c7a9a000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4060] +Name: [anon:stack_and_tls:4060] +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 20 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 20 kB +Referenced: 16 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c7a9a000-c7a9c000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7a9c000-c7a9d000 ---p 00000000 00:00 0 [anon:stack_and_tls:4059] +Name: [anon:stack_and_tls:4059] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7a9d000-c7ba3000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4059] +Name: [anon:stack_and_tls:4059] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 24 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 24 kB +Referenced: 8 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c7ba3000-c7ba5000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7ba5000-c7ba6000 ---p 00000000 00:00 0 [anon:stack_and_tls:4058] +Name: [anon:stack_and_tls:4058] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7ba6000-c7cac000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4058] +Name: [anon:stack_and_tls:4058] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 20 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 20 kB +Referenced: 8 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c7cac000-c7cae000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7cae000-c7caf000 ---p 00000000 00:00 0 [anon:stack_and_tls:4050] +Name: [anon:stack_and_tls:4050] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7caf000-c7db5000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4050] +Name: [anon:stack_and_tls:4050] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 24 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 24 kB +Referenced: 16 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c7db5000-c7db6000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7e48000-c7e49000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7e49000-c7e4a000 ---p 00000000 00:00 0 [anon:stack_and_tls:4031] +Name: [anon:stack_and_tls:4031] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c7e4a000-c7f48000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4031] +Name: [anon:stack_and_tls:4031] +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 16 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 8 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c7f48000-c7f49000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c8799000-c87d5000 r--p 00000000 fd:02 572 /product/priv-app/CarrierServices/oat/x86/CarrierServices.odex +Size: 240 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 112 kB +Pss: 112 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 112 kB +Private_Dirty: 0 kB +Referenced: 88 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +c87d5000-c87db000 r-xp 0003c000 fd:02 572 /product/priv-app/CarrierServices/oat/x86/CarrierServices.odex +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +c87db000-c87ea000 r--p 00000000 fd:02 573 /product/priv-app/CarrierServices/oat/x86/CarrierServices.vdex +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 4 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +c87ea000-c87eb000 r--p 00042000 fd:02 572 /product/priv-app/CarrierServices/oat/x86/CarrierServices.odex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +c87eb000-c87ec000 rw-p 00043000 fd:02 572 /product/priv-app/CarrierServices/oat/x86/CarrierServices.odex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +c8899000-c88a8000 r--p 00000000 fd:04 1398 /system/framework/oat/x86/org.apache.http.legacy.odex +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 4 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +c88a8000-c88eb000 r-xp 0000f000 fd:04 1398 /system/framework/oat/x86/org.apache.http.legacy.odex +Size: 268 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +c88eb000-c88ec000 r--p 00052000 fd:04 1398 /system/framework/oat/x86/org.apache.http.legacy.odex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +c88ec000-c88ed000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +c88ed000-c88ef000 r--p 00000000 fd:04 1399 /system/framework/oat/x86/org.apache.http.legacy.vdex +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +c88ef000-c88f0000 r--p 00053000 fd:04 1398 /system/framework/oat/x86/org.apache.http.legacy.odex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +c88f0000-c88f1000 rw-p 00054000 fd:04 1398 /system/framework/oat/x86/org.apache.http.legacy.odex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +c891c000-c891d000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c891d000-c891e000 ---p 00000000 00:00 0 [anon:stack_and_tls:4030] +Name: [anon:stack_and_tls:4030] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c891e000-c8a1c000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4030] +Name: [anon:stack_and_tls:4030] +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 20 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 20 kB +Referenced: 16 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c8a1c000-c8a1e000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c8a1e000-c8a1f000 ---p 00000000 00:00 0 [anon:stack_and_tls:4029] +Name: [anon:stack_and_tls:4029] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c8a1f000-c8b1d000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4029] +Name: [anon:stack_and_tls:4029] +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 16 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 8 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c8b1d000-c8b1f000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c8b1f000-c8b20000 ---p 00000000 00:00 0 [anon:stack_and_tls:4028] +Name: [anon:stack_and_tls:4028] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c8b20000-c8c1e000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4028] +Name: [anon:stack_and_tls:4028] +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 20 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 20 kB +Referenced: 16 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c8c1e000-c8c1f000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c8c1f000-c8d1d000 r--p 00000000 00:1e 4 /dev/binderfs/binder +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 8 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr dc nr mm +c8d1d000-c8d1e000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c8d1e000-c8d1f000 ---p 00000000 00:00 0 [anon:stack_and_tls:4027] +Name: [anon:stack_and_tls:4027] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c8d1f000-c8e25000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4027] +Name: [anon:stack_and_tls:4027] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 8 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c8e25000-c8e27000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c8e27000-c8e28000 ---p 00000000 00:00 0 [anon:stack_and_tls:4026] +Name: [anon:stack_and_tls:4026] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c8e28000-c8f2e000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4026] +Name: [anon:stack_and_tls:4026] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 16 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 12 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c8f2e000-c8f30000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c8f30000-c8f31000 ---p 00000000 00:00 0 [anon:stack_and_tls:4025] +Name: [anon:stack_and_tls:4025] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c8f31000-c9037000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4025] +Name: [anon:stack_and_tls:4025] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 16 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 8 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c9037000-c9039000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c9039000-c903a000 ---p 00000000 00:00 0 [anon:stack_and_tls:4024] +Name: [anon:stack_and_tls:4024] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c903a000-c9140000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4024] +Name: [anon:stack_and_tls:4024] +Size: 1048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 16 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 12 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +c9140000-c9141000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +c9141000-c9142000 ---p 00000000 00:00 0 [anon:dalvik-Jit thread pool worker thread 0] +Name: [anon:dalvik-Jit thread pool worker thread 0] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +c9142000-c9143000 ---p 00000000 00:00 0 [anon:dalvik-Jit thread pool worker thread 0] +Name: [anon:dalvik-Jit thread pool worker thread 0] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +c9143000-c9242000 rw-p 00000000 00:00 0 [anon:dalvik-Jit thread pool worker thread 0] +Name: [anon:dalvik-Jit thread pool worker thread 0] +Size: 1020 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 20 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 20 kB +Referenced: 12 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +c9242000-cb242000 rw-s 00000000 00:01 62556 /memfd:jit-cache (deleted) +Size: 32768 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 84 kB +Pss: 44 kB +Shared_Clean: 0 kB +Shared_Dirty: 80 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 84 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr sh mr mw me ms dc +cb242000-cd242000 r--s 02000000 00:01 62556 /memfd:jit-cache (deleted) +Size: 32768 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 64 kB +Shared_Clean: 0 kB +Shared_Dirty: 128 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 128 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd sh mr mw me ms dc +cd242000-d5442000 ---p 00000000 00:00 0 [anon:libwebview reservation] +Name: [anon:libwebview reservation] +Size: 133120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +d5442000-d5443000 r--p 00000000 fd:04 2026 /system/lib/libwebviewchromium_loader.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5443000-d5445000 r-xp 00000000 fd:04 2026 /system/lib/libwebviewchromium_loader.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d5445000-d5446000 r--p 00001000 fd:04 2026 /system/lib/libwebviewchromium_loader.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5446000-d5447000 rw-p 00001000 fd:04 2026 /system/lib/libwebviewchromium_loader.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d546e000-d54e5000 r--p 00000000 fd:04 1419 /system/framework/org.apache.http.legacy.jar +Size: 476 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 13 kB +Shared_Clean: 128 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 108 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d54e5000-d54eb000 r--p 00000000 fd:03 465 /vendor/lib/libdrm.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d54eb000-d54f9000 r-xp 00005000 fd:03 465 /vendor/lib/libdrm.so +Size: 56 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d54f9000-d54fa000 r--p 00012000 fd:03 465 /vendor/lib/libdrm.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d54fa000-d54fb000 rw-p 00012000 fd:03 465 /vendor/lib/libdrm.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d54fb000-d54fc000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5513000-d5514000 r--p 00000000 07:d0 108 /apex/com.vndk.v30/lib/hardware.graphics.common@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5514000-d5515000 r-xp 00000000 07:d0 108 /apex/com.vndk.v30/lib/hardware.graphics.common@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d5515000-d5516000 r--p 00000000 07:d0 108 /apex/com.vndk.v30/lib/hardware.graphics.common@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5544000-d5554000 r--p 00000000 fd:03 454 /vendor/lib/libGLESv1_enc.so +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5554000-d5572000 r-xp 0000f000 fd:03 454 /vendor/lib/libGLESv1_enc.so +Size: 120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d5572000-d5573000 r--p 0002c000 fd:03 454 /vendor/lib/libGLESv1_enc.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5573000-d5574000 rw-p 0002c000 fd:03 454 /vendor/lib/libGLESv1_enc.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d559d000-d55bf000 r--p 00000000 fd:03 455 /vendor/lib/libGLESv2_enc.so +Size: 136 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d55bf000-d55fe000 r-xp 00021000 fd:03 455 /vendor/lib/libGLESv2_enc.so +Size: 252 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d55fe000-d55ff000 r--p 0005f000 fd:03 455 /vendor/lib/libGLESv2_enc.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d55ff000-d5600000 rw-p 0005f000 fd:03 455 /vendor/lib/libGLESv2_enc.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5619000-d5621000 r--p 00000000 fd:03 460 /vendor/lib/libohosemu.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5621000-d562b000 r-xp 00007000 fd:03 460 /vendor/lib/libohosemu.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d562b000-d562c000 r--p 00010000 fd:03 460 /vendor/lib/libohosemu.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d562c000-d562d000 rw-p 00010000 fd:03 460 /vendor/lib/libohosemu.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5640000-d5687000 r--p 00000000 07:d0 236 /apex/com.vndk.v30/lib/libc++.so +Size: 284 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5687000-d56ef000 r-xp 00046000 07:d0 236 /apex/com.vndk.v30/lib/libc++.so +Size: 416 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d56ef000-d56f3000 r--p 000ad000 07:d0 236 /apex/com.vndk.v30/lib/libc++.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d56f3000-d56f4000 rw-p 000b0000 07:d0 236 /apex/com.vndk.v30/lib/libc++.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d56f4000-d56f6000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d571a000-d5730000 r--p 00000000 07:d0 281 /apex/com.vndk.v30/lib/libprocessgroup.so +Size: 88 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5730000-d575b000 r-xp 00015000 07:d0 281 /apex/com.vndk.v30/lib/libprocessgroup.so +Size: 172 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d575b000-d575d000 r--p 0003f000 07:d0 281 /apex/com.vndk.v30/lib/libprocessgroup.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d575d000-d575e000 rw-p 00040000 07:d0 281 /apex/com.vndk.v30/lib/libprocessgroup.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d57ac000-d57b0000 r--p 00000000 fd:03 459 /vendor/lib/lib_renderControl_enc.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d57b0000-d57b7000 r-xp 00003000 fd:03 459 /vendor/lib/lib_renderControl_enc.so +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d57b7000-d57b8000 r--p 00009000 fd:03 459 /vendor/lib/lib_renderControl_enc.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d57b8000-d57b9000 rw-p 00009000 fd:03 459 /vendor/lib/lib_renderControl_enc.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d57c5000-d57c6000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +d57c6000-d57e3000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 96 kB +Pss: 96 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 96 kB +Referenced: 0 kB +Anonymous: 96 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d57e3000-d57e4000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +d57e4000-d57e5000 r--p 00000000 07:d0 109 /apex/com.vndk.v30/lib/hardware.graphics.common@1.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d57e5000-d57e6000 r-xp 00000000 07:d0 109 /apex/com.vndk.v30/lib/hardware.graphics.common@1.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d57e6000-d57e7000 r--p 00000000 07:d0 109 /apex/com.vndk.v30/lib/hardware.graphics.common@1.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d57e7000-d5807000 rw-p 00000000 00:00 0 [anon:dalvik-CompilerMetadata] +Name: [anon:dalvik-CompilerMetadata] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5807000-d5812000 r--p 00000000 fd:03 456 /vendor/lib/libOpenglCodecCommon.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5812000-d5823000 r-xp 0000a000 fd:03 456 /vendor/lib/libOpenglCodecCommon.so +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d5823000-d5824000 r--p 0001a000 fd:03 456 /vendor/lib/libOpenglCodecCommon.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5825000-d5845000 rw-p 00000000 00:00 0 [anon:dalvik-CompilerMetadata] +Name: [anon:dalvik-CompilerMetadata] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5845000-d5851000 r--p 00000000 07:d0 117 /apex/com.vndk.v30/lib/hardware.graphics.mapper@3.0.so +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5851000-d5861000 r-xp 0000b000 07:d0 117 /apex/com.vndk.v30/lib/hardware.graphics.mapper@3.0.so +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d5861000-d5863000 r--p 0001a000 07:d0 117 /apex/com.vndk.v30/lib/hardware.graphics.mapper@3.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5863000-d5864000 rw-p 0001b000 07:d0 117 /apex/com.vndk.v30/lib/hardware.graphics.mapper@3.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d586b000-d588b000 rw-p 00000000 00:00 0 [anon:dalvik-CompilerMetadata] +Name: [anon:dalvik-CompilerMetadata] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d588b000-d5894000 r--p 00000000 fd:03 457 /vendor/lib/libOpenglSystemCommon.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5894000-d589f000 r-xp 00008000 fd:03 457 /vendor/lib/libOpenglSystemCommon.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d589f000-d58a1000 r--p 00012000 fd:03 457 /vendor/lib/libOpenglSystemCommon.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d58a1000-d58a2000 rw-p 00013000 fd:03 457 /vendor/lib/libOpenglSystemCommon.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d58b9000-d58d9000 rw-p 00000000 00:00 0 [anon:dalvik-CompilerMetadata] +Name: [anon:dalvik-CompilerMetadata] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d58d9000-d5921000 r--p 00000000 07:d0 261 /apex/com.vndk.v30/lib/libhidlbase.so +Size: 288 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5921000-d59ac000 r-xp 00047000 07:d0 261 /apex/com.vndk.v30/lib/libhidlbase.so +Size: 556 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d59ac000-d59b3000 r--p 000d1000 07:d0 261 /apex/com.vndk.v30/lib/libhidlbase.so +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 28 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 28 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d59b3000-d59b4000 rw-p 000d7000 07:d0 261 /apex/com.vndk.v30/lib/libhidlbase.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d59c1000-d59c5000 r--p 00000000 fd:03 439 /vendor/lib/hw/hardware.graphics.mapper@3.0-impl-ranchu.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d59c5000-d59c9000 r-xp 00003000 fd:03 439 /vendor/lib/hw/hardware.graphics.mapper@3.0-impl-ranchu.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d59c9000-d59ca000 r--p 00006000 fd:03 439 /vendor/lib/hw/hardware.graphics.mapper@3.0-impl-ranchu.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d59d0000-d5a10000 rw-p 00000000 00:00 0 [anon:dalvik-CompilerMetadata] +Name: [anon:dalvik-CompilerMetadata] +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5a10000-d5a16000 r--p 00000000 07:d0 248 /apex/com.vndk.v30/lib/libcutils.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5a16000-d5a1f000 r-xp 00005000 07:d0 248 /apex/com.vndk.v30/lib/libcutils.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d5a1f000-d5a21000 r--p 0000d000 07:d0 248 /apex/com.vndk.v30/lib/libcutils.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5a21000-d5a22000 rw-p 0000e000 07:d0 248 /apex/com.vndk.v30/lib/libcutils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5a23000-d5a24000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +d5a24000-d5a28000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5a42000-d5a62000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 20 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 20 kB +Referenced: 20 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5a62000-d5a72000 r--p 00000000 07:d0 231 /apex/com.vndk.v30/lib/libbase.so +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5a72000-d5ab8000 r-xp 0000f000 07:d0 231 /apex/com.vndk.v30/lib/libbase.so +Size: 280 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d5ab8000-d5aba000 r--p 00054000 07:d0 231 /apex/com.vndk.v30/lib/libbase.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5aba000-d5abb000 rw-p 00055000 07:d0 231 /apex/com.vndk.v30/lib/libbase.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5abc000-d5abd000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +d5abd000-d5ac1000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5ad2000-d5ae0000 r--p 00000000 07:d0 299 /apex/com.vndk.v30/lib/libutils.so +Size: 56 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5ae0000-d5aef000 r-xp 0000d000 07:d0 299 /apex/com.vndk.v30/lib/libutils.so +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d5aef000-d5af0000 r--p 0001b000 07:d0 299 /apex/com.vndk.v30/lib/libutils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5af0000-d5af1000 rw-p 0001b000 07:d0 299 /apex/com.vndk.v30/lib/libutils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5af3000-d5af4000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +d5af4000-d5af8000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5b0a000-d5bae000 r--p 00000000 fd:03 527 /vendor/lib/libvulkan_enc.so +Size: 656 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5bae000-d5c7c000 r-xp 000a3000 fd:03 527 /vendor/lib/libvulkan_enc.so +Size: 824 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d5c7c000-d5c7f000 r--p 00170000 fd:03 527 /vendor/lib/libvulkan_enc.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5c7f000-d5c80000 rw-p 00172000 fd:03 527 /vendor/lib/libvulkan_enc.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5c80000-d5c81000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +d5c81000-d5c85000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5c87000-d5ca7000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5ca7000-d5ca8000 r--p 00000000 07:d0 110 /apex/com.vndk.v30/lib/hardware.graphics.common@1.2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5ca8000-d5ca9000 r-xp 00000000 07:d0 110 /apex/com.vndk.v30/lib/hardware.graphics.common@1.2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d5ca9000-d5caa000 r--p 00000000 07:d0 110 /apex/com.vndk.v30/lib/hardware.graphics.common@1.2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5cac000-d5cad000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +d5cad000-d5cb1000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5cba000-d5cbb000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +d5cbb000-d5cbf000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5cc8000-d5cce000 r--p 00000000 fd:04 1774 /system/lib/libcompiler_rt.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5cce000-d5ce1000 r-xp 00005000 fd:04 1774 /system/lib/libcompiler_rt.so +Size: 76 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d5ce1000-d5ce2000 r--p 00017000 fd:04 1774 /system/lib/libcompiler_rt.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5ce2000-d5ce3000 rw-p 00017000 fd:04 1774 /system/lib/libcompiler_rt.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5ce3000-d5cf2000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5cf6000-d5cf7000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +d5cf7000-d5d15000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 120 kB +Pss: 120 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 120 kB +Referenced: 100 kB +Anonymous: 120 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5d15000-d5d16000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +d5d16000-d5d36000 rw-p 00000000 00:00 0 [anon:dalvik-CompilerMetadata] +Name: [anon:dalvik-CompilerMetadata] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5d36000-d5d38000 r--p 00000000 fd:04 1358 /system/framework/oat/x86/test.base.odex +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5d38000-d5d39000 r--p 00000000 fd:04 1359 /system/framework/oat/x86/test.base.vdex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5d39000-d5d3a000 r--p 00002000 fd:04 1358 /system/framework/oat/x86/test.base.odex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5d3a000-d5d3b000 rw-p 00003000 fd:04 1358 /system/framework/oat/x86/test.base.odex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5d3f000-d5d5f000 rw-p 00000000 00:00 0 [anon:dalvik-CompilerMetadata] +Name: [anon:dalvik-CompilerMetadata] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5d5f000-d5d61000 r--p 00000000 fd:04 1356 /system/framework/oat/x86/hidl.manager-V1.0-java.odex +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5d61000-d5d62000 r--p 00000000 fd:04 1357 /system/framework/oat/x86/hidl.manager-V1.0-java.vdex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5d62000-d5d63000 r--p 00002000 fd:04 1356 /system/framework/oat/x86/hidl.manager-V1.0-java.odex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5d63000-d5d64000 rw-p 00003000 fd:04 1356 /system/framework/oat/x86/hidl.manager-V1.0-java.odex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5d78000-d5d98000 rw-p 00000000 00:00 0 [anon:dalvik-CompilerMetadata] +Name: [anon:dalvik-CompilerMetadata] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5d98000-d5d9a000 r--p 00000000 fd:04 1354 /system/framework/oat/x86/hidl.base-V1.0-java.odex +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5d9a000-d5d9b000 r--p 00000000 fd:04 1355 /system/framework/oat/x86/hidl.base-V1.0-java.vdex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d5d9b000-d5d9c000 r--p 00002000 fd:04 1354 /system/framework/oat/x86/hidl.base-V1.0-java.odex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d5d9c000-d5d9d000 rw-p 00003000 fd:04 1354 /system/framework/oat/x86/hidl.base-V1.0-java.odex +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5dae000-d5dce000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 128 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 128 kB +Referenced: 128 kB +Anonymous: 128 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5dce000-d5dcf000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +d5dcf000-d5ded000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 120 kB +Pss: 120 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 120 kB +Referenced: 100 kB +Anonymous: 120 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d5ded000-d5dee000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +d5dee000-d5e3c000 r--s 00000000 fd:04 2315 /system/usr/hyphen-data/hyph-hu.hyb +Size: 312 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +d7f83000-d7f88000 r--p 00000000 fd:04 1969 /system/lib/librs_jni.so +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d7f88000-d7f93000 r-xp 00004000 fd:04 1969 /system/lib/librs_jni.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d7f93000-d7f94000 r--p 0000e000 fd:04 1969 /system/lib/librs_jni.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d7f94000-d7f95000 rw-p 0000e000 fd:04 1969 /system/lib/librs_jni.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d7faa000-d7fca000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 32 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 32 kB +Referenced: 32 kB +Anonymous: 32 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d7fca000-d8096000 r--p 00000000 fd:04 1961 /system/lib/libprotobuf-cpp-full.so +Size: 816 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d8096000-d8215000 r-xp 000cb000 fd:04 1961 /system/lib/libprotobuf-cpp-full.so +Size: 1532 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d8215000-d821c000 r--p 00249000 fd:04 1961 /system/lib/libprotobuf-cpp-full.so +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 28 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 28 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d821c000-d821d000 rw-p 0024f000 fd:04 1961 /system/lib/libprotobuf-cpp-full.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d821d000-d821e000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d821f000-d8220000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +d8220000-d8224000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d8233000-d8253000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d8253000-d8254000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +d8254000-d8258000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d8269000-d82dd000 r--p 00000000 fd:04 1985 /system/lib/libsonivox.so +Size: 464 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 2 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d82dd000-d82de000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +d82de000-d82f5000 r-xp 00074000 fd:04 1985 /system/lib/libsonivox.so +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d82f5000-d82f7000 r--p 0008a000 fd:04 1985 /system/lib/libsonivox.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d82f7000-d82f8000 rw-p 0008b000 fd:04 1985 /system/lib/libsonivox.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d82f8000-d82fd000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d8317000-d8337000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 128 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 128 kB +Referenced: 128 kB +Anonymous: 128 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d8337000-d833a000 r--p 00000000 fd:04 1890 /system/lib/libmediadrmmetrics_consumer.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 12 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d833a000-d833f000 r-xp 00002000 fd:04 1890 /system/lib/libmediadrmmetrics_consumer.so +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d833f000-d8340000 r--p 00006000 fd:04 1890 /system/lib/libmediadrmmetrics_consumer.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d834b000-d835d000 r--p 00000000 fd:04 1907 /system/lib/libmtp.so +Size: 72 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 72 kB +Pss: 4 kB +Shared_Clean: 72 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 72 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d835d000-d8379000 r-xp 00011000 fd:04 1907 /system/lib/libmtp.so +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d8379000-d837b000 r--p 0002c000 fd:04 1907 /system/lib/libmtp.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d837b000-d837c000 rw-p 0002d000 fd:04 1907 /system/lib/libmtp.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d8387000-d8396000 r--p 00000000 fd:04 1891 /system/lib/libmediadrmmetrics_full.so +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 5 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d8396000-d83aa000 r-xp 0000e000 fd:04 1891 /system/lib/libmediadrmmetrics_full.so +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d83aa000-d83ac000 r--p 00021000 fd:04 1891 /system/lib/libmediadrmmetrics_full.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d83ac000-d83ad000 rw-p 00022000 fd:04 1891 /system/lib/libmediadrmmetrics_full.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d83c0000-d83f3000 r--p 00000000 fd:04 1885 /system/lib/libmedia_jni.so +Size: 204 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 10 kB +Shared_Clean: 128 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d83f3000-d843b000 r-xp 00032000 fd:04 1885 /system/lib/libmedia_jni.so +Size: 288 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d843b000-d843f000 r--p 00079000 fd:04 1885 /system/lib/libmedia_jni.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d843f000-d8440000 rw-p 0007c000 fd:04 1885 /system/lib/libmedia_jni.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d8440000-d8441000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +d8441000-d8445000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d8445000-d8446000 r--p 00000000 fd:04 1708 /system/lib/libasyncio.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d8446000-d8447000 r-xp 00000000 fd:04 1708 /system/lib/libasyncio.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d8447000-d8448000 r--p 00000000 fd:04 1708 /system/lib/libasyncio.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d844b000-d846b000 r--s 00000000 00:11 7266 /dev/__properties__/u:object_r:exported_radio_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +d846b000-d848b000 r--s 00000000 00:11 7194 /dev/__properties__/u:object_r:binder_cache_telephony_server_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +d848b000-d848f000 r--p 00000000 fd:04 1711 /system/lib/libaudioeffect_jni.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 16 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 16 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d848f000-d8496000 r-xp 00003000 fd:04 1711 /system/lib/libaudioeffect_jni.so +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d8496000-d8497000 r--p 00009000 fd:04 1711 /system/lib/libaudioeffect_jni.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d8497000-d8498000 rw-p 00009000 fd:04 1711 /system/lib/libaudioeffect_jni.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d849d000-d84dd000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 256 kB +Pss: 256 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 256 kB +Referenced: 256 kB +Anonymous: 256 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d84dd000-d84e5000 r--p 00000000 fd:04 1986 /system/lib/libsoundpool.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +d84e5000-d84f1000 r-xp 00007000 fd:04 1986 /system/lib/libsoundpool.so +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +d84f1000-d84f2000 r--p 00012000 fd:04 1986 /system/lib/libsoundpool.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +d84f2000-d84f3000 rw-p 00012000 fd:04 1986 /system/lib/libsoundpool.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d84f6000-d84f7000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +d84f7000-d84fb000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d8500000-d85c0000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 768 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 184 kB +Pss: 153 kB +Shared_Clean: 0 kB +Shared_Dirty: 32 kB +Private_Clean: 0 kB +Private_Dirty: 152 kB +Referenced: 108 kB +Anonymous: 184 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d85d3000-d8643000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 448 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 448 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 448 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 448 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d8643000-d86c0000 r--s 00000000 07:c0 18 /apex/com.tzdata/etc/tz/tzdata +Size: 500 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +d86c0000-d8700000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d871a000-d873a000 r--s 00000000 00:11 7342 /dev/__properties__/u:object_r:use_memfd_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +d873a000-d9080000 r--s 00000000 fd:04 1066 /system/fonts/NotoColorEmoji.ttf +Size: 9496 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +d9080000-d90c0000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 28 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 28 kB +Referenced: 24 kB +Anonymous: 40 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d90c0000-d90c1000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +d90c1000-d90c5000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +d90df000-da880000 r--s 00000000 fd:04 1258 /system/fonts/NotoSerifCJK-Regular.ttc +Size: 24196 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +da880000-da940000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 768 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 140 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 132 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 8 kB +Anonymous: 140 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +da953000-dbcb7000 r--s 00000000 fd:04 1092 /system/fonts/NotoSansCJK-Regular.ttc +Size: 19856 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dbcb7000-dbd65000 r--s 00000000 fd:04 1216 /system/fonts/NotoSansSymbols-Regular-Subsetted.ttf +Size: 696 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dbd65000-dbdc1000 r--s 00000000 fd:04 1242 /system/fonts/NotoSansTibetan-Bold.ttf +Size: 368 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dbdc1000-dbe24000 r--s 00000000 fd:04 1243 /system/fonts/NotoSansTibetan-Regular.ttf +Size: 396 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dbe24000-dbea0000 r--s 00000000 fd:04 1109 /system/fonts/NotoSansEgyptianHieroglyphs-Regular.ttf +Size: 496 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dbea0000-dbf1b000 r--s 00000000 fd:04 1100 /system/fonts/NotoSansCuneiform-Regular.ttf +Size: 492 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dbf1b000-dbf63000 r--s 00000000 fd:04 1308 /system/fonts/SourceSansPro-Bold.ttf +Size: 288 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dbf63000-dbfab000 r--s 00000000 fd:04 1312 /system/fonts/SourceSansPro-SemiBold.ttf +Size: 288 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dbfab000-dbffc000 r--s 00000000 fd:04 1301 /system/fonts/RobotoCondensed-BoldItalic.ttf +Size: 324 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dbffc000-dc047000 r--s 00000000 fd:04 1300 /system/fonts/RobotoCondensed-Bold.ttf +Size: 300 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dc047000-dc098000 r--s 00000000 fd:04 1306 /system/fonts/RobotoCondensed-MediumItalic.ttf +Size: 324 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dc098000-dc0e3000 r--s 00000000 fd:04 1305 /system/fonts/RobotoCondensed-Medium.ttf +Size: 300 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dc0e3000-dc134000 r--s 00000000 fd:04 1302 /system/fonts/RobotoCondensed-Italic.ttf +Size: 324 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dc134000-dc17e000 r--s 00000000 fd:04 1307 /system/fonts/RobotoCondensed-Regular.ttf +Size: 296 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dc17e000-dc1d0000 r--s 00000000 fd:04 1304 /system/fonts/RobotoCondensed-LightItalic.ttf +Size: 328 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dc1d0000-dc21a000 r--s 00000000 fd:04 1303 /system/fonts/RobotoCondensed-Light.ttf +Size: 296 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dc21a000-dc26c000 r--s 00000000 fd:04 1291 /system/fonts/Roboto-BoldItalic.ttf +Size: 328 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dc26c000-dc2b7000 r--s 00000000 fd:04 1290 /system/fonts/Roboto-Bold.ttf +Size: 300 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dc2b7000-dc308000 r--s 00000000 fd:04 1289 /system/fonts/Roboto-BlackItalic.ttf +Size: 324 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dc308000-dc320000 r--p 00000000 07:80 21 /apex/com.conscrypt/lib/libjavacrypto.so +Size: 96 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 96 kB +Pss: 3 kB +Shared_Clean: 96 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 84 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +dc320000-dc34a000 r-xp 00017000 07:80 21 /apex/com.conscrypt/lib/libjavacrypto.so +Size: 168 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 168 kB +Pss: 12 kB +Shared_Clean: 168 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 168 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +dc34a000-dc34b000 r--p 00040000 07:80 21 /apex/com.conscrypt/lib/libjavacrypto.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +dc34b000-dc34d000 rw-p 00040000 07:80 21 /apex/com.conscrypt/lib/libjavacrypto.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +dc35f000-dc383000 r--s 00000000 fd:04 2331 /system/usr/hyphen-data/hyph-nn.hyb +Size: 144 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dc383000-dc3cb000 r--p 00000000 07:80 19 /apex/com.conscrypt/lib/libc++.so +Size: 288 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +dc3cb000-dc436000 r-xp 00047000 07:80 19 /apex/com.conscrypt/lib/libc++.so +Size: 428 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 84 kB +Pss: 6 kB +Shared_Clean: 84 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 84 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +dc436000-dc43a000 r--p 000b1000 07:80 19 /apex/com.conscrypt/lib/libc++.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +dc43a000-dc43b000 rw-p 000b4000 07:80 19 /apex/com.conscrypt/lib/libc++.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +dc43b000-dc43d000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +dc43e000-dc43f000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +dc43f000-dc443000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +dc443000-dc497000 r--p 00000000 07:80 20 /apex/com.conscrypt/lib/libcrypto.so +Size: 336 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 7 kB +Shared_Clean: 128 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 88 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +dc497000-dc573000 r-xp 00053000 07:80 20 /apex/com.conscrypt/lib/libcrypto.so +Size: 880 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 756 kB +Pss: 62 kB +Shared_Clean: 756 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 756 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +dc573000-dc57d000 r--p 0012e000 07:80 20 /apex/com.conscrypt/lib/libcrypto.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 40 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 36 kB +Anonymous: 40 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +dc57d000-dc57e000 rw-p 00137000 07:80 20 /apex/com.conscrypt/lib/libcrypto.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +dc57e000-dc57f000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +dc57f000-dc580000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +dc580000-dc584000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +dc595000-dc5ae000 r--p 00000000 07:80 22 /apex/com.conscrypt/lib/libssl.so +Size: 100 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 6 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +dc5ae000-dc5f1000 r-xp 00018000 07:80 22 /apex/com.conscrypt/lib/libssl.so +Size: 268 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +dc5f1000-dc5f3000 r--p 0005a000 07:80 22 /apex/com.conscrypt/lib/libssl.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +dc5f3000-dc5f4000 rw-p 0005b000 07:80 22 /apex/com.conscrypt/lib/libssl.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +dc5f6000-dc5f7000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +dc5f7000-dc5fb000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +dc600000-dc680000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 512 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 176 kB +Pss: 113 kB +Shared_Clean: 0 kB +Shared_Dirty: 64 kB +Private_Clean: 0 kB +Private_Dirty: 112 kB +Referenced: 0 kB +Anonymous: 176 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +dc680000-dde80000 r--s 00000000 07:70 14 /apex/com.i18n/etc/icu/icudt66l.dat +Size: 24576 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 224 kB +Pss: 6 kB +Shared_Clean: 224 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 224 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +dde80000-ddec0000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 72 kB +Pss: 72 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 72 kB +Referenced: 32 kB +Anonymous: 72 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ddec0000-ddee4000 r--s 00000000 fd:04 2329 /system/usr/hyphen-data/hyph-nb.hyb +Size: 144 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +ddee4000-ddee5000 r--p 00000000 07:60 20 /apex/com.os.statsd/lib/libstats_jni.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +ddee5000-ddee6000 r-xp 00000000 07:60 20 /apex/com.os.statsd/lib/libstats_jni.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +ddee6000-ddee7000 r--p 00000000 07:60 20 /apex/com.os.statsd/lib/libstats_jni.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +ddeea000-ddeeb000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +ddeeb000-ddeef000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ddf00000-ddfc0000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 768 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 156 kB +Pss: 70 kB +Shared_Clean: 0 kB +Shared_Dirty: 88 kB +Private_Clean: 0 kB +Private_Dirty: 68 kB +Referenced: 68 kB +Anonymous: 156 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ddfc6000-ddfe4000 r--s 00000000 fd:04 2293 /system/usr/hyphen-data/hyph-de-ch-1901.hyb +Size: 120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +ddffc000-de01c000 r--s 00000000 00:11 7193 /dev/__properties__/u:object_r:binder_cache_system_server_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +de01c000-de01d000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +de01d000-de01e000 ---p 00000000 00:00 0 [anon:stack_and_tls:4022] +Name: [anon:stack_and_tls:4022] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +de01e000-de11c000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4022] +Name: [anon:stack_and_tls:4022] +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 8 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +de11c000-de11e000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +de11e000-de11f000 ---p 00000000 00:00 0 [anon:stack_and_tls:4021] +Name: [anon:stack_and_tls:4021] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +de11f000-de21d000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4021] +Name: [anon:stack_and_tls:4021] +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 4 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +de21d000-de21f000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +de21f000-de220000 ---p 00000000 00:00 0 [anon:stack_and_tls:4020] +Name: [anon:stack_and_tls:4020] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +de220000-de31e000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4020] +Name: [anon:stack_and_tls:4020] +Size: 1016 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 4 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +de31e000-de31f000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +de31f000-de414000 rw-p 00000000 00:00 0 [anon:dalvik-allocspace non moving space mark-bitmap 1] +Name: [anon:dalvik-allocspace non moving space mark-bitmap 1] +Size: 980 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +de414000-de509000 rw-p 00000000 00:00 0 [anon:dalvik-allocspace non moving space live-bitmap 1] +Name: [anon:dalvik-allocspace non moving space live-bitmap 1] +Size: 980 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +de509000-e0509000 r--s 00000000 00:01 62556 /memfd:jit-cache (deleted) +Size: 32768 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 80 kB +Pss: 40 kB +Shared_Clean: 0 kB +Shared_Dirty: 80 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 80 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd sh mr mw me ms +e0509000-e2509000 r-xs 02000000 00:01 62556 /memfd:jit-cache (deleted) +Size: 32768 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 64 kB +Shared_Clean: 0 kB +Shared_Dirty: 128 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 128 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex sh mr mw me ms +e2509000-e4509000 r--s 00000000 00:01 14155 /memfd:jit-zygote-cache (deleted) +Size: 32768 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 32 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 32 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd sh mr mw me ms +e4509000-e6509000 r-xs 02000000 00:01 14155 /memfd:jit-zygote-cache (deleted) +Size: 32768 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 44 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 44 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex sh mr mw me ms +e6509000-e6550000 r--p 00000000 07:a8 114 /apex/com.art/lib/libvixl.so +Size: 284 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e6550000-e6662000 r-xp 00046000 07:a8 114 /apex/com.art/lib/libvixl.so +Size: 1096 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e6662000-e6665000 r--p 00157000 07:a8 114 /apex/com.art/lib/libvixl.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e6665000-e6666000 rw-p 00159000 07:a8 114 /apex/com.art/lib/libvixl.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e6668000-e6669000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e6669000-e666d000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e666d000-e668b000 r--s 00000000 fd:04 2291 /system/usr/hyphen-data/hyph-de-1996.hyb +Size: 120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e668b000-e6754000 r--p 00000000 07:a8 66 /apex/com.art/lib/libart-compiler.so +Size: 804 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 3 kB +Shared_Clean: 128 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 128 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e6754000-e69ec000 r-xp 000c8000 07:a8 66 /apex/com.art/lib/libart-compiler.so +Size: 2656 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 2244 kB +Pss: 74 kB +Shared_Clean: 2244 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 2244 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e69ec000-e69f7000 r--p 0035f000 07:a8 66 /apex/com.art/lib/libart-compiler.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 44 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 40 kB +Anonymous: 44 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e69f7000-e69f8000 rw-p 00369000 07:a8 66 /apex/com.art/lib/libart-compiler.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e6a14000-e6a18000 r--p 00000000 07:a8 102 /apex/com.art/lib/libopenjdkjvm.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e6a18000-e6a1d000 r-xp 00003000 07:a8 102 /apex/com.art/lib/libopenjdkjvm.so +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e6a1d000-e6a1e000 r--p 00007000 07:a8 102 /apex/com.art/lib/libopenjdkjvm.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e6a22000-e6a40000 r--s 00000000 fd:04 2289 /system/usr/hyphen-data/hyph-de-1901.hyb +Size: 120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e6a40000-e6a55000 r--p 00000000 07:a8 100 /apex/com.art/lib/libopenjdk.so +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e6a55000-e6a73000 r-xp 00014000 07:a8 100 /apex/com.art/lib/libopenjdk.so +Size: 120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 120 kB +Pss: 3 kB +Shared_Clean: 120 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 120 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e6a73000-e6a74000 r--p 00031000 07:a8 100 /apex/com.art/lib/libopenjdk.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e6a74000-e6a76000 rw-p 00031000 07:a8 100 /apex/com.art/lib/libopenjdk.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e6a7b000-e6a9b000 r--s 00000000 00:11 7353 /dev/__properties__/u:object_r:vndk_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e6a9b000-e6a9c000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +e6a9c000-e6ab9000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 116 kB +Pss: 7 kB +Shared_Clean: 0 kB +Shared_Dirty: 112 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 116 kB +Anonymous: 116 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e6ab9000-e6aba000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +e6aba000-e82ba000 r--s 00000000 07:70 14 /apex/com.i18n/etc/icu/icudt66l.dat +Size: 24576 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 892 kB +Pss: 51 kB +Shared_Clean: 892 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 824 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms rr +e82ba000-e82bb000 r--p 00000000 07:a8 65 /apex/com.art/lib/libohosio.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e82bb000-e82bc000 r-xp 00000000 07:a8 65 /apex/com.art/lib/libohosio.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e82bc000-e82bd000 r--p 00000000 07:a8 65 /apex/com.art/lib/libohosio.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e82bd000-e82be000 rw-p 00000000 07:a8 65 /apex/com.art/lib/libohosio.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e82c0000-e82d1000 r--p 00000000 07:a8 92 /apex/com.art/lib/libjavacore.so +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e82d1000-e82f6000 r-xp 00010000 07:a8 92 /apex/com.art/lib/libjavacore.so +Size: 148 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 148 kB +Pss: 4 kB +Shared_Clean: 148 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 148 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e82f6000-e82f8000 r--p 00034000 07:a8 92 /apex/com.art/lib/libjavacore.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e82f8000-e82f9000 rw-p 00035000 07:a8 92 /apex/com.art/lib/libjavacore.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e82f9000-e82fa000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e82fb000-e82fc000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e82fc000-e8300000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8309000-e830e000 r--p 00000000 07:a8 89 /apex/com.art/lib/libicu_jni.so +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e830e000-e8314000 r-xp 00004000 07:a8 89 /apex/com.art/lib/libicu_jni.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 24 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 24 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e8314000-e8316000 r--p 00009000 07:a8 89 /apex/com.art/lib/libicu_jni.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e8316000-e8317000 rw-p 0000a000 07:a8 89 /apex/com.art/lib/libicu_jni.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8321000-e8341000 r--s 00000000 00:11 7253 /dev/__properties__/u:object_r:exported3_radio_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e8341000-e8343000 r--p 00000000 fd:04 2027 /system/lib/libwebviewchromium_plat_support.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e8343000-e8345000 r-xp 00001000 fd:04 2027 /system/lib/libwebviewchromium_plat_support.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e8345000-e8346000 r--p 00002000 fd:04 2027 /system/lib/libwebviewchromium_plat_support.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e8346000-e8347000 rw-p 00002000 fd:04 2027 /system/lib/libwebviewchromium_plat_support.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8348000-e834a000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e834a000-e834b000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e834b000-e834f000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e834f000-e8350000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e8350000-e8354000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8354000-e8355000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e8355000-e8359000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8359000-e835a000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e835a000-e835e000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e835e000-e83a9000 r--s 00000000 fd:04 1288 /system/fonts/Roboto-Black.ttf +Size: 300 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e83a9000-e83aa000 r--p 00000000 fd:04 2006 /system/lib/libstdc++.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e83aa000-e83ad000 r-xp 00000000 fd:04 2006 /system/lib/libstdc++.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e83ad000-e83ae000 r--p 00002000 fd:04 2006 /system/lib/libstdc++.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e83af000-e83b0000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e83b0000-e83b4000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e83c5000-e83e3000 r--p 00000000 fd:04 1574 /system/lib/hardware.renderscript@1.0.so +Size: 120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 2 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e83e3000-e843a000 r-xp 0001d000 fd:04 1574 /system/lib/hardware.renderscript@1.0.so +Size: 348 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e843a000-e843d000 r--p 00073000 fd:04 1574 /system/lib/hardware.renderscript@1.0.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e843d000-e843e000 rw-p 00075000 fd:04 1574 /system/lib/hardware.renderscript@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e843e000-e8440000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8440000-e8441000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e8441000-e8445000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8445000-e8446000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e8446000-e844a000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e844a000-e844d000 r--p 00000000 fd:04 2020 /system/lib/libutilscallstack.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 12 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e844d000-e8450000 r-xp 00002000 fd:04 2020 /system/lib/libutilscallstack.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e8450000-e8451000 r--p 00004000 fd:04 2020 /system/lib/libutilscallstack.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e8452000-e8454000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8483000-e848a000 r--p 00000000 fd:04 1687 /system/lib/libRS.so +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 1 kB +Shared_Clean: 28 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 28 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e848a000-e8495000 r-xp 00006000 fd:04 1687 /system/lib/libRS.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e8495000-e8496000 r--p 00010000 fd:04 1687 /system/lib/libRS.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e8496000-e8497000 rw-p 00010000 fd:04 1687 /system/lib/libRS.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8498000-e849a000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e849a000-e84d8000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 248 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 248 kB +Pss: 6 kB +Shared_Clean: 0 kB +Shared_Dirty: 248 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 248 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e84d8000-e84d9000 r--p 00000000 fd:04 1686 /system/lib/libOpenSLES.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e84d9000-e84db000 r-xp 00000000 fd:04 1686 /system/lib/libOpenSLES.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e84db000-e84dc000 r--p 00001000 fd:04 1686 /system/lib/libOpenSLES.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e84dc000-e84dd000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e84dd000-e84e1000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e84e1000-e84e2000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e84e2000-e84e6000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e84e6000-e84e7000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e84e7000-e84eb000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e84eb000-e850b000 r--s 00000000 00:11 7290 /dev/__properties__/u:object_r:log_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e850b000-e850c000 r--p 00000000 fd:04 1685 /system/lib/libOpenMAXAL.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e850c000-e850d000 r-xp 00000000 fd:04 1685 /system/lib/libOpenMAXAL.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e850d000-e850f000 r--p 00000000 fd:04 1685 /system/lib/libOpenMAXAL.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e850f000-e8513000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8513000-e8522000 r--s 00000000 fd:04 2297 /system/usr/hyphen-data/hyph-en-us.hyb +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e8522000-e8542000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 120 kB +Pss: 120 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 120 kB +Referenced: 120 kB +Anonymous: 120 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8542000-e8544000 r--p 00000000 fd:04 1856 /system/lib/libjnigraphics.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e8544000-e8547000 r-xp 00001000 fd:04 1856 /system/lib/libjnigraphics.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e8547000-e8548000 r--p 00003000 fd:04 1856 /system/lib/libjnigraphics.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e8548000-e854a000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e854c000-e854d000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e854d000-e8551000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8551000-e8552000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e8552000-e8556000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8556000-e8576000 r--s 00000000 00:11 7205 /dev/__properties__/u:object_r:config_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e8576000-e8582000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 48 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 48 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 48 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8582000-e858f000 r--p 00000000 fd:04 1754 /system/lib/libcamera2ndk.so +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 52 kB +Pss: 1 kB +Shared_Clean: 52 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e858f000-e85af000 r-xp 0000c000 fd:04 1754 /system/lib/libcamera2ndk.so +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e85af000-e85b1000 r--p 0002b000 fd:04 1754 /system/lib/libcamera2ndk.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e85b1000-e85b2000 rw-p 0002c000 fd:04 1754 /system/lib/libcamera2ndk.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e85b3000-e85b5000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e85b5000-e85b6000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +e85b6000-e85c7000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e85c7000-e85c8000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +e85c8000-e85ec000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 144 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 144 kB +Pss: 3 kB +Shared_Clean: 0 kB +Shared_Dirty: 144 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 144 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e85ec000-e85ef000 r--p 00000000 fd:04 1699 /system/lib/libamidi.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 12 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e85ef000-e85f4000 r-xp 00002000 fd:04 1699 /system/lib/libamidi.so +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e85f4000-e85f5000 r--p 00006000 fd:04 1699 /system/lib/libamidi.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e85f5000-e85f6000 rw-p 00006000 fd:04 1699 /system/lib/libamidi.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e85f8000-e85fa000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e85fa000-e85fb000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e85fb000-e85ff000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e85ff000-e8603000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8603000-e861d000 r--p 00000000 fd:04 1695 /system/lib/libaaudio_internal.so +Size: 104 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 48 kB +Pss: 1 kB +Shared_Clean: 48 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e861d000-e8638000 r-xp 00019000 fd:04 1695 /system/lib/libaaudio_internal.so +Size: 108 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e8638000-e863c000 r--p 00033000 fd:04 1695 /system/lib/libaaudio_internal.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e863c000-e863d000 rw-p 00036000 fd:04 1695 /system/lib/libaaudio_internal.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e863e000-e8648000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 40 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 40 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8648000-e864c000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e864c000-e866c000 r--s 00000000 00:11 7296 /dev/__properties__/u:object_r:media_variant_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e866c000-e866f000 r--p 00000000 fd:04 1694 /system/lib/libaaudio.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 12 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e866f000-e8670000 r-xp 00002000 fd:04 1694 /system/lib/libaaudio.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e8670000-e8672000 r--p 00002000 fd:04 1694 /system/lib/libaaudio.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e8673000-e8693000 r--s 00000000 00:11 7257 /dev/__properties__/u:object_r:exported_camera_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e8693000-e86a3000 r--p 00000000 07:a8 107 /apex/com.art/lib/libperfetto_hprof.so +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e86a3000-e86fc000 r-xp 0000f000 07:a8 107 /apex/com.art/lib/libperfetto_hprof.so +Size: 356 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 112 kB +Pss: 3 kB +Shared_Clean: 112 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 112 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e86fc000-e86fe000 r--p 00067000 07:a8 107 /apex/com.art/lib/libperfetto_hprof.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e86fe000-e8700000 rw-p 00068000 07:a8 107 /apex/com.art/lib/libperfetto_hprof.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8701000-e8703000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8703000-e870c000 r--s 00000000 fd:04 2307 /system/usr/hyphen-data/hyph-ga.hyb +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e870c000-e87d0000 r--p 00000000 fd:04 1914 /system/lib/libndk_translation.so +Size: 784 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 2 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e87d0000-e8945000 r-xp 000c3000 fd:04 1914 /system/lib/libndk_translation.so +Size: 1492 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e8945000-e8958000 r--p 00237000 fd:04 1914 /system/lib/libndk_translation.so +Size: 76 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 76 kB +Pss: 2 kB +Shared_Clean: 0 kB +Shared_Dirty: 76 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 76 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e8958000-e8959000 rw-p 00249000 fd:04 1914 /system/lib/libndk_translation.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8959000-e895b000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e895b000-e895c000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e895c000-e8960000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8960000-e8974000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 80 kB +Pss: 2 kB +Shared_Clean: 0 kB +Shared_Dirty: 80 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 80 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8974000-e8995000 r--s 00000000 fd:04 1073 /system/fonts/NotoSansAnatolianHieroglyphs-Regular.otf +Size: 132 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e8995000-e89a6000 r--p 00000000 fd:04 1700 /system/lib/libohos.so +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e89a6000-e89b7000 r-xp 00010000 fd:04 1700 /system/lib/libohos.so +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e89b7000-e89b9000 r--p 00020000 fd:04 1700 /system/lib/libohos.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e89b9000-e89ba000 rw-p 00021000 fd:04 1700 /system/lib/libohos.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e89ba000-e89bb000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e89bb000-e89bf000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e89bf000-e89c3000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e89c7000-e89d3000 r--s 00000000 fd:04 2295 /system/usr/hyphen-data/hyph-en-gb.hyb +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e89d3000-e89db000 r--p 00000000 fd:04 1956 /system/lib/libpowermanager.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 1 kB +Shared_Clean: 32 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 32 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e89db000-e89e3000 r-xp 00007000 fd:04 1956 /system/lib/libpowermanager.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e89e3000-e89e6000 r--p 0000e000 fd:04 1956 /system/lib/libpowermanager.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e89e6000-e89e7000 rw-p 00010000 fd:04 1956 /system/lib/libpowermanager.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e89e8000-e89e9000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e89e9000-e89ed000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e89ed000-e8a3e000 r--s 00000000 fd:04 1296 /system/fonts/Roboto-MediumItalic.ttf +Size: 324 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e8a3e000-e8a8d000 r--p 00000000 fd:04 2031 /system/lib/libxml2.so +Size: 316 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 72 kB +Pss: 2 kB +Shared_Clean: 72 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 72 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e8a8d000-e8b7b000 r-xp 0004e000 fd:04 2031 /system/lib/libxml2.so +Size: 952 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e8b7b000-e8b7d000 r--p 0013b000 fd:04 2031 /system/lib/libxml2.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e8b7d000-e8b7e000 rw-p 0013c000 fd:04 2031 /system/lib/libxml2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8b7e000-e8b7f000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8b81000-e8b91000 r--p 00000000 07:30 21 /apex/com.d/lib/libadconnection_client.so +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 1 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e8b91000-e8bbb000 r-xp 0000f000 07:30 21 /apex/com.d/lib/libadconnection_client.so +Size: 168 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 108 kB +Pss: 3 kB +Shared_Clean: 108 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 108 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e8bbb000-e8bbd000 r--p 00038000 07:30 21 /apex/com.d/lib/libadconnection_client.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e8bbd000-e8bbe000 rw-p 00039000 07:30 21 /apex/com.d/lib/libadconnection_client.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8bbe000-e8bbf000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8bbf000-e8bc1000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8bc1000-e8bc5000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8bc5000-e8bc9000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8bc9000-e8bcd000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8bcd000-e8bd1000 r--p 00000000 07:a8 62 /apex/com.art/lib/libadconnection.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 16 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 16 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +e8bd1000-e8bdb000 r-xp 00003000 07:a8 62 /apex/com.art/lib/libadconnection.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 1 kB +Shared_Clean: 40 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 40 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +e8bdb000-e8bdd000 r--p 0000c000 07:a8 62 /apex/com.art/lib/libadconnection.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e8bdd000-e8bde000 rw-p 0000d000 07:a8 62 /apex/com.art/lib/libadconnection.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8bdf000-e8be0000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +e8be0000-e8be4000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8be4000-e8c00000 r--s 00000000 fd:04 1169 /system/fonts/NotoSansMongolian-Regular.ttf +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +e8c00000-e8cc0000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 768 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 54 kB +Shared_Clean: 0 kB +Shared_Dirty: 76 kB +Private_Clean: 0 kB +Private_Dirty: 52 kB +Referenced: 68 kB +Anonymous: 128 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8cc0000-e8cc2000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8cc2000-e8cda000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 96 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 96 kB +Pss: 2 kB +Shared_Clean: 0 kB +Shared_Dirty: 96 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 96 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8cda000-e8d80000 r--p 00000000 07:a0 22 /apex/com.wifi/javalib/framework-wifi.jar +Size: 664 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 196 kB +Pss: 8 kB +Shared_Clean: 196 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 160 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +e8d80000-e8f40000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 1792 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 748 kB +Pss: 509 kB +Shared_Clean: 0 kB +Shared_Dirty: 248 kB +Private_Clean: 0 kB +Private_Dirty: 500 kB +Referenced: 284 kB +Anonymous: 748 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8f40000-e8f45000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 20 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e8f45000-e90d5000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 1600 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 20 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +e90d5000-ea0d5000 rw-p 00000000 00:00 0 [anon:dalvik-region-space inter region ref bitmap] +Name: [anon:dalvik-region-space inter region ref bitmap] +Size: 16384 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ea0d5000-ea2d5000 rw-p 00000000 00:00 0 [anon:dalvik-rb copying gc mark stack] +Name: [anon:dalvik-rb copying gc mark stack] +Size: 2048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ea2d5000-eb2d5000 rw-p 00000000 00:00 0 [anon:dalvik-concurrent copying gc mark stack] +Name: [anon:dalvik-concurrent copying gc mark stack] +Size: 16384 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +eb2d5000-ebad6000 rw-p 00000000 00:00 0 [anon:dalvik-live stack] +Name: [anon:dalvik-live stack] +Size: 8196 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ebad6000-ebad7000 ---p 00000000 00:00 0 [anon:dalvik-Sentinel fault page] +Name: [anon:dalvik-Sentinel fault page] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +ebad7000-ebadd000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 24 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ebadd000-ebade000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +ebade000-ebae2000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ebae2000-ebaef000 r--s 00000000 fd:04 2283 /system/usr/hyphen-data/hyph-cu.hyb +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +ebaef000-ebb40000 r--s 00000000 fd:04 1292 /system/fonts/Roboto-Italic.ttf +Size: 324 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +ebb40000-ebb80000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 28 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 28 kB +Referenced: 16 kB +Anonymous: 28 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ebb80000-ebb99000 r--s 00000000 fd:04 1088 /system/fonts/NotoSansBhaiksuki-Regular.otf +Size: 100 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +ebb99000-ebbb8000 r--s 00000000 fd:04 1249 /system/fonts/NotoSansYi-Regular.ttf +Size: 124 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +ebbb8000-ebcb8000 rw-p 00000000 00:00 0 [anon:dalvik-non-moving-space inter region ref bitmap] +Name: [anon:dalvik-non-moving-space inter region ref bitmap] +Size: 1024 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ebcb8000-ebeb8000 rw-p 00000000 00:00 0 [anon:dalvik-rb copying gc mark stack] +Name: [anon:dalvik-rb copying gc mark stack] +Size: 2048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ebeb8000-ec6b9000 rw-p 00000000 00:00 0 [anon:dalvik-allocation stack] +Name: [anon:dalvik-allocation stack] +Size: 8196 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ec6b9000-ecaba000 rw-p 00000000 00:00 0 [anon:dalvik-card table] +Name: [anon:dalvik-card table] +Size: 4100 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 40 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 40 kB +Referenced: 40 kB +Anonymous: 40 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ecaba000-edaba000 rw-p 00000000 00:00 0 [anon:dalvik-region space live bitmap] +Name: [anon:dalvik-region space live bitmap] +Size: 16384 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 28 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 28 kB +Referenced: 28 kB +Anonymous: 28 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +edaba000-edbba000 rw-p 00000000 00:00 0 [anon:dalvik-allocspace zygote / non moving space mark-bitmap 0] +Name: [anon:dalvik-allocspace zygote / non moving space mark-bitmap 0] +Size: 1024 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 48 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 48 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 48 kB +Anonymous: 48 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +edbba000-edcba000 rw-p 00000000 00:00 0 [anon:dalvik-allocspace zygote / non moving space live-bitmap 0] +Name: [anon:dalvik-allocspace zygote / non moving space live-bitmap 0] +Size: 1024 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +edcba000-edd83000 r--p 00000000 fd:04 1432 /system/framework/voip-common.jar +Size: 804 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 152 kB +Pss: 4 kB +Shared_Clean: 152 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 152 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +edd83000-ee080000 r--p 00000000 fd:04 1430 /system/framework/telephony-common.jar +Size: 3060 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 320 kB +Pss: 8 kB +Shared_Clean: 320 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 320 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +ee080000-ee140000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 768 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 292 kB +Pss: 94 kB +Shared_Clean: 0 kB +Shared_Dirty: 204 kB +Private_Clean: 0 kB +Private_Dirty: 88 kB +Referenced: 36 kB +Anonymous: 292 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ee141000-ee14d000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 48 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 48 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 48 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ee14d000-ee14f000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ee14f000-ee150000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +ee150000-ee153000 rw-p 00000000 00:00 0 [anon:stack_and_tls:4023] +Name: [anon:stack_and_tls:4023] +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +ee153000-ee155000 ---p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +ee155000-ee16f000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 104 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ee16f000-ee170000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +ee170000-ee295000 r--p 01b4d000 fd:04 1341 /system/framework/framework.jar +Size: 1172 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 236 kB +Pss: 7 kB +Shared_Clean: 236 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 236 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +ee295000-eeb86000 r--p 0125d000 fd:04 1341 /system/framework/framework.jar +Size: 9156 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 3716 kB +Pss: 119 kB +Shared_Clean: 3716 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 3320 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +eeb86000-ef4b9000 r--p 0092b000 fd:04 1341 /system/framework/framework.jar +Size: 9420 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 5360 kB +Pss: 223 kB +Shared_Clean: 5356 kB +Shared_Dirty: 0 kB +Private_Clean: 4 kB +Private_Dirty: 0 kB +Referenced: 5004 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +ef4b9000-efde5000 r--p 00000000 fd:04 1341 /system/framework/framework.jar +Size: 9392 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4864 kB +Pss: 166 kB +Shared_Clean: 4864 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4148 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +efde5000-eff0d000 r--p 00000000 07:a8 36 /apex/com.art/javalib/apache-xml.jar +Size: 1184 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +eff0d000-f0064000 r--p 00000000 07:a8 37 /apex/com.art/javalib/bouncycastle.jar +Size: 1372 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 204 kB +Pss: 5 kB +Shared_Clean: 204 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 204 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f0064000-f02e0000 r--p 00004000 07:a8 38 /apex/com.art/javalib/core-icu4j.jar +Size: 2544 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 616 kB +Pss: 29 kB +Shared_Clean: 616 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 568 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f02e0000-f0382000 r--p 00000000 07:a8 39 /apex/com.art/javalib/core-libart.jar +Size: 648 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 584 kB +Pss: 18 kB +Shared_Clean: 584 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 416 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f0382000-f0840000 r--p 00000000 07:a8 40 /apex/com.art/javalib/core-oj.jar +Size: 4856 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 3780 kB +Pss: 149 kB +Shared_Clean: 3780 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 3104 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f0840000-f0a00000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 1792 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 368 kB +Pss: 260 kB +Shared_Clean: 0 kB +Shared_Dirty: 112 kB +Private_Clean: 0 kB +Private_Dirty: 256 kB +Referenced: 92 kB +Anonymous: 368 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f0a00000-f0a06000 r--s 00000000 fd:04 2301 /system/usr/hyphen-data/hyph-et.hyb +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f0a06000-f0a08000 r--p 00000000 fd:04 1707 /system/lib/libartpalette-system.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f0a08000-f0a0a000 r-xp 00001000 fd:04 1707 /system/lib/libartpalette-system.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f0a0a000-f0a0b000 r--p 00002000 fd:04 1707 /system/lib/libartpalette-system.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f0a0b000-f0a0c000 rw-p 00002000 fd:04 1707 /system/lib/libartpalette-system.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f0a0c000-f0a0e000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f0a0e000-f0a75000 r--p 00000000 07:98 18 /apex/com.media/javalib/updatable-media.jar +Size: 412 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 136 kB +Pss: 5 kB +Shared_Clean: 136 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 136 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f0a75000-f0a77000 r--p 00000000 fd:04 2015 /system/lib/libtombstoned_client.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f0a77000-f0a7a000 r-xp 00001000 fd:04 2015 /system/lib/libtombstoned_client.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f0a7a000-f0a7b000 r--p 00003000 fd:04 2015 /system/lib/libtombstoned_client.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f0a7c000-f0a87000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 44 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 44 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f0a87000-f0a89000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f0a89000-f0a92000 r--s 00000000 fd:04 2285 /system/usr/hyphen-data/hyph-cy.hyb +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f0a92000-f0a93000 r--p 00000000 fd:04 1981 /system/lib/libsigchain.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f0a93000-f0a96000 r-xp 00000000 fd:04 1981 /system/lib/libsigchain.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f0a96000-f0a97000 r--p 00002000 fd:04 1981 /system/lib/libsigchain.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f0a98000-f0aa8000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 64 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 64 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f0aa8000-f0aa9000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f0aa9000-f0ac3000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 104 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f0ac3000-f0ac4000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f0ac4000-f0ac6000 r--p 00000000 07:a8 82 /apex/com.art/lib/libdexfile_external.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f0ac6000-f0ac9000 r-xp 00001000 07:a8 82 /apex/com.art/lib/libdexfile_external.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f0ac9000-f0aca000 r--p 00003000 07:a8 82 /apex/com.art/lib/libdexfile_external.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f0aca000-f0acb000 rw-p 00003000 07:a8 82 /apex/com.art/lib/libdexfile_external.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f0acc000-f0b38000 r--p 00000000 07:80 17 /apex/com.conscrypt/javalib/conscrypt.jar +Size: 432 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 432 kB +Pss: 13 kB +Shared_Clean: 432 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 384 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f0b38000-f0b51000 r--p 00000000 07:a8 81 /apex/com.art/lib/libdexfile.so +Size: 100 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f0b51000-f0b7d000 r-xp 00018000 07:a8 81 /apex/com.art/lib/libdexfile.so +Size: 176 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 176 kB +Pss: 5 kB +Shared_Clean: 176 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 176 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f0b7d000-f0b7f000 r--p 00043000 07:a8 81 /apex/com.art/lib/libdexfile.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f0b7f000-f0b8a000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 44 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 44 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f0b8a000-f0b8b000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f0b8b000-f0ba5000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 104 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f0ba5000-f0ba6000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f0ba6000-f0cd7000 r--p 00000000 07:a8 69 /apex/com.art/lib/libart.so +Size: 1220 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 384 kB +Pss: 10 kB +Shared_Clean: 384 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 384 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f0cd7000-f1364000 r-xp 00130000 07:a8 69 /apex/com.art/lib/libart.so +Size: 6708 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 5684 kB +Pss: 159 kB +Shared_Clean: 5684 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 5684 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1364000-f136d000 r--p 007bc000 07:a8 69 /apex/com.art/lib/libart.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 36 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 28 kB +Anonymous: 36 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f136d000-f1370000 rw-p 007c4000 07:a8 69 /apex/com.art/lib/libart.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 12 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1370000-f1372000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1372000-f137b000 r--p 00000000 fd:04 1318 /system/framework/test.base.jar +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 3 kB +Shared_Clean: 36 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 36 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f137b000-f1381000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 24 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1381000-f1392000 r--p 00000000 07:a8 110 /apex/com.art/lib/libprofile.so +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1392000-f13b9000 r-xp 00010000 07:a8 110 /apex/com.art/lib/libprofile.so +Size: 156 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 152 kB +Pss: 5 kB +Shared_Clean: 152 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 152 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f13b9000-f13bb000 r--p 00036000 07:a8 110 /apex/com.art/lib/libprofile.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f13bb000-f13bc000 rw-p 00037000 07:a8 110 /apex/com.art/lib/libprofile.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f13bc000-f13c0000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f13c1000-f13c9000 r--p 00000000 fd:04 1317 /system/framework/hidl.manager-V1.0-java.jar +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f13c9000-f13ca000 r--p 00000000 07:a8 76 /apex/com.art/lib/libartpalette.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f13ca000-f13cc000 r-xp 00000000 07:a8 76 /apex/com.art/lib/libartpalette.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f13cc000-f13cd000 r--p 00001000 07:a8 76 /apex/com.art/lib/libartpalette.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f13cd000-f13ce000 rw-p 00001000 07:a8 76 /apex/com.art/lib/libartpalette.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f13d3000-f13da000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 28 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 28 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f13da000-f13fb000 r--s 00000000 fd:04 1079 /system/fonts/NotoSansBamum-Regular.ttf +Size: 132 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f13fb000-f1415000 r--s 00000000 fd:04 1071 /system/fonts/NotoSansAdlam-VF.ttf +Size: 104 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1415000-f1434000 r--p 00000000 07:a8 70 /apex/com.art/lib/libartbase.so +Size: 124 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 1 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1434000-f1490000 r-xp 0001e000 07:a8 70 /apex/com.art/lib/libartbase.so +Size: 368 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 304 kB +Pss: 12 kB +Shared_Clean: 304 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 304 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1490000-f1491000 r--p 00079000 07:a8 70 /apex/com.art/lib/libartbase.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1491000-f1492000 rw-p 00079000 07:a8 70 /apex/com.art/lib/libartbase.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1492000-f1498000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 20 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 20 kB +Referenced: 0 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1498000-f14a4000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 48 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 48 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 48 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f14a4000-f14c0000 r--s 00000000 fd:04 1175 /system/fonts/NotoSansMyanmarUI-Bold.otf +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f14c0000-f1600000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 1280 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 216 kB +Pss: 150 kB +Shared_Clean: 0 kB +Shared_Dirty: 68 kB +Private_Clean: 0 kB +Private_Dirty: 148 kB +Referenced: 76 kB +Anonymous: 216 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1601000-f1603000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1603000-f160e000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 44 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 44 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f160e000-f161b000 r--p 00000000 fd:04 1998 /system/lib/libstagefright_framecapture_utils.so +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 48 kB +Pss: 1 kB +Shared_Clean: 48 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 48 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f161b000-f1638000 r-xp 0000c000 fd:04 1998 /system/lib/libstagefright_framecapture_utils.so +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1638000-f163a000 r--p 00028000 fd:04 1998 /system/lib/libstagefright_framecapture_utils.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f163a000-f163b000 rw-p 00029000 fd:04 1998 /system/lib/libstagefright_framecapture_utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f163b000-f163d000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f163d000-f1641000 r--s 00000000 fd:04 2299 /system/usr/hyphen-data/hyph-es.hyb +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1641000-f165e000 r--s 00000000 fd:04 1176 /system/fonts/NotoSansMyanmarUI-Medium.otf +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f165e000-f169e000 r--p 00000000 fd:04 1789 /system/lib/libdng_sdk.so +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f169e000-f172e000 r-xp 0003f000 fd:04 1789 /system/lib/libdng_sdk.so +Size: 576 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f172e000-f1732000 r--p 000ce000 fd:04 1789 /system/lib/libdng_sdk.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1732000-f1733000 rw-p 000d1000 fd:04 1789 /system/lib/libdng_sdk.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1733000-f174c000 r--s 00000000 fd:04 1149 /system/fonts/NotoSansLepcha-Regular.ttf +Size: 100 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f174c000-f1764000 r--p 00000000 fd:04 1502 /system/lib/hardware.cas@1.0.so +Size: 96 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 72 kB +Pss: 2 kB +Shared_Clean: 72 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 72 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1764000-f1793000 r-xp 00017000 fd:04 1502 /system/lib/hardware.cas@1.0.so +Size: 188 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1793000-f1797000 r--p 00045000 fd:04 1502 /system/lib/hardware.cas@1.0.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1797000-f1798000 rw-p 00048000 fd:04 1502 /system/lib/hardware.cas@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1799000-f179e000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 20 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f179e000-f17ba000 r--s 00000000 fd:04 1177 /system/fonts/NotoSansMyanmarUI-Regular.otf +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f17ba000-f17dc000 r--s 00000000 fd:04 1278 /system/fonts/NotoSerifMyanmar-Bold.otf +Size: 136 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f17dc000-f17e4000 r--p 00000000 fd:04 2014 /system/lib/libtinyxml2.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 1 kB +Shared_Clean: 32 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 32 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f17e4000-f17f0000 r-xp 00007000 fd:04 2014 /system/lib/libtinyxml2.so +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f17f0000-f17f1000 r--p 00012000 fd:04 2014 /system/lib/libtinyxml2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f17f1000-f17f2000 rw-p 00012000 fd:04 2014 /system/lib/libtinyxml2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f17f2000-f17f9000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 28 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 28 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f17f9000-f17ff000 r--s 00000000 fd:04 1248 /system/fonts/NotoSansWarangCiti-Regular.otf +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f17ff000-f1821000 r--s 00000000 fd:04 1279 /system/fonts/NotoSerifMyanmar-Regular.otf +Size: 136 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1821000-f182c000 r--p 00000000 fd:04 1537 /system/lib/hardware.graphics.mapper@2.1.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 0 kB +Shared_Clean: 44 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 44 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f182c000-f183b000 r-xp 0000a000 fd:04 1537 /system/lib/hardware.graphics.mapper@2.1.so +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f183b000-f183d000 r--p 00018000 fd:04 1537 /system/lib/hardware.graphics.mapper@2.1.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f183d000-f183e000 rw-p 00019000 fd:04 1537 /system/lib/hardware.graphics.mapper@2.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f183f000-f1841000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1841000-f1847000 r--s 00000000 fd:04 1165 /system/fonts/NotoSansMasaramGondi-Regular.otf +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1847000-f1889000 r--p 00000000 07:50 17 /apex/com.runtime/lib/libc.so +Size: 264 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 164 kB +Pss: 17 kB +Shared_Clean: 148 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 164 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1889000-f1935000 r-xp 00041000 07:50 17 /apex/com.runtime/lib/libc.so +Size: 688 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 688 kB +Pss: 6 kB +Shared_Clean: 688 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 688 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1935000-f1938000 r--p 000ec000 07:50 17 /apex/com.runtime/lib/libc.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1938000-f193a000 rw-p 000ee000 07:50 17 /apex/com.runtime/lib/libc.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f193a000-f193d000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f193d000-f193e000 r--p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f193e000-f194d000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 36 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 36 kB +Referenced: 36 kB +Anonymous: 36 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f194d000-f195e000 r--s 00000000 fd:04 1181 /system/fonts/NotoSansNewa-Regular.otf +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f195e000-f19b0000 r--s 00000000 fd:04 1294 /system/fonts/Roboto-LightItalic.ttf +Size: 328 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f19b0000-f19d1000 r--p 00000000 fd:04 2001 /system/lib/libstagefright_omx.so +Size: 132 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f19d1000-f19d2000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f19d2000-f19fb000 r-xp 00021000 fd:04 2001 /system/lib/libstagefright_omx.so +Size: 164 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f19fb000-f19ff000 r--p 00049000 fd:04 2001 /system/lib/libstagefright_omx.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f19ff000-f1a00000 rw-p 0004c000 fd:04 2001 /system/lib/libstagefright_omx.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1a00000-f1a07000 r--s 00000000 fd:04 1144 /system/fonts/NotoSansKhojki-Regular.otf +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1a07000-f1a17000 r--s 00000000 fd:04 1164 /system/fonts/NotoSansMarchen-Regular.otf +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1a17000-f1a1f000 r--p 00000000 fd:04 2033 /system/lib/libz.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 0 kB +Shared_Clean: 32 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 32 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1a1f000-f1a2f000 r-xp 00007000 fd:04 2033 /system/lib/libz.so +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 2 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1a2f000-f1a31000 r--p 00016000 fd:04 2033 /system/lib/libz.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1a31000-f1a32000 rw-p 00017000 fd:04 2033 /system/lib/libz.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1a32000-f1a36000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1a36000-f1a3e000 r--s 00000000 fd:04 1120 /system/fonts/NotoSansGunjalaGondi-Regular.otf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1a3e000-f1a5b000 r--s 00000000 fd:04 1173 /system/fonts/NotoSansMyanmar-Medium.otf +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1a5b000-f1a64000 r--p 00000000 fd:04 1596 /system/lib/hidl.token@1.0.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 1 kB +Shared_Clean: 36 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 36 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1a64000-f1a71000 r-xp 00008000 fd:04 1596 /system/lib/hidl.token@1.0.so +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1a71000-f1a73000 r--p 00014000 fd:04 1596 /system/lib/hidl.token@1.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1a73000-f1a74000 rw-p 00015000 fd:04 1596 /system/lib/hidl.token@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1a74000-f1a8f000 r--s 00000000 fd:04 1172 /system/fonts/NotoSansMyanmar-Bold.otf +Size: 108 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1a8f000-f1a90000 r--p 00000000 fd:04 2008 /system/lib/libsync.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1a90000-f1a92000 r-xp 00000000 fd:04 2008 /system/lib/libsync.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1a92000-f1a93000 r--p 00001000 fd:04 2008 /system/lib/libsync.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1a93000-f1a94000 rw-p 00001000 fd:04 2008 /system/lib/libsync.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1a94000-f1a98000 r--s 00000000 fd:04 1247 /system/fonts/NotoSansWancho-Regular.otf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1a98000-f1aa8000 r--s 00000000 fd:04 1246 /system/fonts/NotoSansVai-Regular.ttf +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1aa8000-f1acc000 r--s 00000000 fd:04 1141 /system/fonts/NotoSansKhmer-VF.ttf +Size: 144 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1acc000-f1b02000 r--p 00000000 fd:04 1553 /system/lib/hardware.media.c2@1.0.so +Size: 216 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 2 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1b02000-f1b72000 r-xp 00035000 fd:04 1553 /system/lib/hardware.media.c2@1.0.so +Size: 448 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1b72000-f1b78000 r--p 000a4000 fd:04 1553 /system/lib/hardware.media.c2@1.0.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 24 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1b78000-f1b79000 rw-p 000a9000 fd:04 1553 /system/lib/hardware.media.c2@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1b7a000-f1b7c000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1b7c000-f1b80000 r--s 00000000 fd:04 1125 /system/fonts/NotoSansHanifiRohingya-Regular.otf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1b80000-f1b9b000 r--s 00000000 fd:04 1174 /system/fonts/NotoSansMyanmar-Regular.otf +Size: 108 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1b9b000-f1ba5000 r--p 00000000 fd:04 1524 /system/lib/hardware.graphics.allocator@3.0.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 1 kB +Shared_Clean: 40 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 40 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1ba5000-f1bb0000 r-xp 00009000 fd:04 1524 /system/lib/hardware.graphics.allocator@3.0.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1bb0000-f1bb2000 r--p 00013000 fd:04 1524 /system/lib/hardware.graphics.allocator@3.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1bb2000-f1bb3000 rw-p 00014000 fd:04 1524 /system/lib/hardware.graphics.allocator@3.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1bb4000-f1bb6000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1bb6000-f1bc2000 r--s 00000000 fd:04 1224 /system/fonts/NotoSansTaiTham-Regular.ttf +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1bc2000-f1bd7000 r--s 00000000 fd:04 1210 /system/fonts/NotoSansSinhalaUI-Bold.otf +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1bd7000-f1bd8000 r--p 00000000 fd:04 1529 /system/lib/hardware.graphics.common@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1bd8000-f1bd9000 r-xp 00000000 fd:04 1529 /system/lib/hardware.graphics.common@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1bd9000-f1bda000 r--p 00000000 fd:04 1529 /system/lib/hardware.graphics.common@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1bdb000-f1bf2000 r--s 00000000 fd:04 1211 /system/fonts/NotoSansSinhalaUI-Medium.otf +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1bf2000-f1c07000 r--s 00000000 fd:04 1212 /system/fonts/NotoSansSinhalaUI-Regular.otf +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1c07000-f1c1c000 r--s 00000000 fd:04 1280 /system/fonts/NotoSerifSinhala-Bold.otf +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1c1c000-f1c1d000 r--p 00000000 fd:04 1827 /system/lib/libhardware.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1c1d000-f1c1e000 r-xp 00000000 fd:04 1827 /system/lib/libhardware.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1c1e000-f1c1f000 r--p 00001000 fd:04 1827 /system/lib/libhardware.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1c1f000-f1c2c000 r--s 00000000 fd:04 1220 /system/fonts/NotoSansSyriacWestern-Regular.ttf +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1c2c000-f1c41000 r--s 00000000 fd:04 1207 /system/fonts/NotoSansSinhala-Bold.otf +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1c41000-f1c43000 r--p 00000000 fd:04 1721 /system/lib/libaudiopolicy.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1c43000-f1c46000 r-xp 00001000 fd:04 1721 /system/lib/libaudiopolicy.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1c46000-f1c47000 r--p 00003000 fd:04 1721 /system/lib/libaudiopolicy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1c47000-f1c8f000 r--s 00000000 fd:04 1311 /system/fonts/SourceSansPro-Regular.ttf +Size: 288 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1c8f000-f1c90000 r--p 00000000 fd:04 1784 /system/lib/libdexfile_support.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1c90000-f1c92000 r-xp 00000000 fd:04 1784 /system/lib/libdexfile_support.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1c92000-f1c93000 r--p 00001000 fd:04 1784 /system/lib/libdexfile_support.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1c93000-f1c94000 rw-p 00001000 fd:04 1784 /system/lib/libdexfile_support.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1c94000-f1c96000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1c96000-f1cad000 r--s 00000000 fd:04 1208 /system/fonts/NotoSansSinhala-Medium.otf +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1cad000-f1cc2000 r--s 00000000 fd:04 1209 /system/fonts/NotoSansSinhala-Regular.otf +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1cc2000-f1cd4000 r--p 00000000 fd:04 1997 /system/lib/libstagefright_foundation.so +Size: 72 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1cd4000-f1cd5000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f1cd5000-f1cf5000 r-xp 00012000 fd:04 1997 /system/lib/libstagefright_foundation.so +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1cf5000-f1cf6000 r--p 00031000 fd:04 1997 /system/lib/libstagefright_foundation.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1cf6000-f1cf7000 rw-p 00031000 fd:04 1997 /system/lib/libstagefright_foundation.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1cf7000-f1cf9000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1cf9000-f1d08000 r--s 00000000 fd:04 1152 /system/fonts/NotoSansLinearB-Regular.ttf +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1d08000-f1d1c000 r--s 00000000 fd:04 1192 /system/fonts/NotoSansOriyaUI-Bold.ttf +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1d1c000-f1d21000 r--p 00000000 fd:04 2021 /system/lib/libvibrator.so +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1d21000-f1d25000 r-xp 00004000 fd:04 2021 /system/lib/libvibrator.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1d25000-f1d27000 r--p 00007000 fd:04 2021 /system/lib/libvibrator.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1d27000-f1d28000 rw-p 00008000 fd:04 2021 /system/lib/libvibrator.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1d28000-f1d29000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1d29000-f1d36000 r--s 00000000 fd:04 1218 /system/fonts/NotoSansSyriacEastern-Regular.ttf +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1d36000-f1d4a000 r--s 00000000 fd:04 1193 /system/fonts/NotoSansOriyaUI-Regular.ttf +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1d4a000-f1d56000 r--p 00000000 fd:04 1892 /system/lib/libmediadrmmetrics_lite.so +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 48 kB +Pss: 3 kB +Shared_Clean: 48 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 48 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1d56000-f1d67000 r-xp 0000b000 fd:04 1892 /system/lib/libmediadrmmetrics_lite.so +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1d67000-f1d69000 r--p 0001b000 fd:04 1892 /system/lib/libmediadrmmetrics_lite.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1d69000-f1d6a000 rw-p 0001c000 fd:04 1892 /system/lib/libmediadrmmetrics_lite.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1d6a000-f1d6b000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1d6b000-f1d74000 r--s 00000000 fd:04 1151 /system/fonts/NotoSansLinearA-Regular.otf +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1d74000-f1d89000 r--s 00000000 fd:04 1190 /system/fonts/NotoSansOriya-Bold.ttf +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1d89000-f1d90000 r--p 00000000 fd:04 1735 /system/lib/libbinder_ndk.so +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 0 kB +Shared_Clean: 28 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 28 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1d90000-f1d9a000 r-xp 00006000 fd:04 1735 /system/lib/libbinder_ndk.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1d9a000-f1d9b000 r--p 0000f000 fd:04 1735 /system/lib/libbinder_ndk.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1d9b000-f1d9c000 rw-p 0000f000 fd:04 1735 /system/lib/libbinder_ndk.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1d9d000-f1d9f000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1d9f000-f1dea000 r--s 00000000 fd:04 1295 /system/fonts/Roboto-Medium.ttf +Size: 300 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1dea000-f1ded000 r--p 00000000 fd:04 1911 /system/lib/libnativewindow.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 12 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1ded000-f1df1000 r-xp 00002000 fd:04 1911 /system/lib/libnativewindow.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1df1000-f1df2000 r--p 00005000 fd:04 1911 /system/lib/libnativewindow.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1df3000-f1df5000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1df5000-f1e04000 r--s 00000000 fd:04 1134 /system/fonts/NotoSansKaithi-Regular.ttf +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1e04000-f1e0e000 r--p 00000000 fd:04 1750 /system/lib/libbufferhubqueue.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 1 kB +Shared_Clean: 40 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 40 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1e0e000-f1e22000 r-xp 00009000 fd:04 1750 /system/lib/libbufferhubqueue.so +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1e22000-f1e23000 r--p 0001c000 fd:04 1750 /system/lib/libbufferhubqueue.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1e23000-f1e24000 rw-p 0001c000 fd:04 1750 /system/lib/libbufferhubqueue.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1e24000-f1e2b000 r--s 00000000 fd:04 1205 /system/fonts/NotoSansSharada-Regular.otf +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1e2b000-f1e40000 r--s 00000000 fd:04 1191 /system/fonts/NotoSansOriya-Regular.ttf +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1e40000-f1e48000 r--p 00000000 fd:04 1823 /system/lib/libgralloctypes.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 0 kB +Shared_Clean: 32 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 32 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1e48000-f1e52000 r-xp 00007000 fd:04 1823 /system/lib/libgralloctypes.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1e52000-f1e54000 r--p 00010000 fd:04 1823 /system/lib/libgralloctypes.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1e54000-f1e55000 rw-p 00011000 fd:04 1823 /system/lib/libgralloctypes.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1e55000-f1e57000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1e57000-f1e6b000 r--s 00000000 fd:04 1137 /system/fonts/NotoSansKannadaUI-Bold.ttf +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1e6b000-f1e7f000 r--s 00000000 fd:04 1138 /system/fonts/NotoSansKannadaUI-Regular.ttf +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1e7f000-f1e9b000 r--s 00000000 fd:04 1234 /system/fonts/NotoSansTeluguUI-Bold.ttf +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1e9b000-f1ea5000 r--p 00000000 fd:04 1501 /system/lib/hardware.cas.native@1.0.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 1 kB +Shared_Clean: 32 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 32 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1ea5000-f1eb2000 r-xp 00009000 fd:04 1501 /system/lib/hardware.cas.native@1.0.so +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1eb2000-f1eb3000 r--p 00015000 fd:04 1501 /system/lib/hardware.cas.native@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1eb3000-f1eb4000 rw-p 00015000 fd:04 1501 /system/lib/hardware.cas.native@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1eb4000-f1eb6000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1eb6000-f1ebc000 r--s 00000000 fd:04 1168 /system/fonts/NotoSansMiao-Regular.otf +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1ebc000-f1ed8000 r--s 00000000 fd:04 1235 /system/fonts/NotoSansTeluguUI-Regular.ttf +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1ed8000-f1ee0000 r--p 00000000 fd:04 1909 /system/lib/libnativedisplay.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 1 kB +Shared_Clean: 32 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 32 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1ee0000-f1eea000 r-xp 00007000 fd:04 1909 /system/lib/libnativedisplay.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1eea000-f1eeb000 r--p 00010000 fd:04 1909 /system/lib/libnativedisplay.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1eeb000-f1eec000 rw-p 00010000 fd:04 1909 /system/lib/libnativedisplay.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1eed000-f1ef9000 r--s 00000000 fd:04 1219 /system/fonts/NotoSansSyriacEstrangela-Regular.ttf +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1ef9000-f1f1e000 r--s 00000000 fd:04 1284 /system/fonts/NotoSerifTelugu-Bold.ttf +Size: 148 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1f1e000-f1f21000 r--p 00000000 fd:04 1667 /system/lib/capture_state_listener-aidl-V1-cpp.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 12 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1f21000-f1f23000 r-xp 00002000 fd:04 1667 /system/lib/capture_state_listener-aidl-V1-cpp.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1f23000-f1f25000 r--p 00003000 fd:04 1667 /system/lib/capture_state_listener-aidl-V1-cpp.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1f25000-f1f26000 rw-p 00004000 fd:04 1667 /system/lib/capture_state_listener-aidl-V1-cpp.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1f27000-f1f29000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1f29000-f1f30000 r--s 00000000 fd:04 1199 /system/fonts/NotoSansPhagsPa-Regular.ttf +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1f30000-f1f55000 r--s 00000000 fd:04 1285 /system/fonts/NotoSerifTelugu-Regular.ttf +Size: 148 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1f55000-f1f57000 r--p 00000000 fd:04 1720 /system/lib/libaudiomanager.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1f57000-f1f59000 r-xp 00001000 fd:04 1720 /system/lib/libaudiomanager.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f1f59000-f1f5b000 r--p 00002000 fd:04 1720 /system/lib/libaudiomanager.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f1f5b000-f1f5c000 rw-p 00003000 fd:04 1720 /system/lib/libaudiomanager.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f1f5d000-f1f66000 r--s 00000000 fd:04 1217 /system/fonts/NotoSansSymbols-Regular-Subsetted2.ttf +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1f66000-f1f81000 r--s 00000000 fd:04 1232 /system/fonts/NotoSansTelugu-Bold.ttf +Size: 108 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f1f81000-f1fb4000 r--p 00000000 fd:04 1962 /system/lib/libprotobuf-cpp-lite.so +Size: 204 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f1fb4000-f2002000 r-xp 00032000 fd:04 1962 /system/lib/libprotobuf-cpp-lite.so +Size: 312 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f2002000-f2004000 r--p 0007f000 fd:04 1962 /system/lib/libprotobuf-cpp-lite.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f2004000-f2005000 rw-p 00080000 fd:04 1962 /system/lib/libprotobuf-cpp-lite.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f2005000-f2007000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f2007000-f2048000 r--s 00000000 fd:04 1251 /system/fonts/NotoSerif-BoldItalic.ttf +Size: 260 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2048000-f2056000 r--p 00000000 fd:04 1454 /system/lib/frameworks.bufferhub@1.0.so +Size: 56 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 56 kB +Pss: 2 kB +Shared_Clean: 56 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 56 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2056000-f206b000 r-xp 0000d000 fd:04 1454 /system/lib/frameworks.bufferhub@1.0.so +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f206b000-f206e000 r--p 00021000 fd:04 1454 /system/lib/frameworks.bufferhub@1.0.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f206e000-f206f000 rw-p 00023000 fd:04 1454 /system/lib/frameworks.bufferhub@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f206f000-f2086000 r--s 00000000 fd:04 1270 /system/fonts/NotoSerifKannada-Bold.ttf +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2086000-f20a9000 r--p 00000000 07:a8 64 /apex/com.art/lib/libohosicu.so +Size: 140 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 68 kB +Pss: 1 kB +Shared_Clean: 68 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 68 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f20a9000-f20bc000 r-xp 00022000 07:a8 64 /apex/com.art/lib/libohosicu.so +Size: 76 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 76 kB +Pss: 2 kB +Shared_Clean: 76 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 76 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f20bc000-f20be000 r--p 00034000 07:a8 64 /apex/com.art/lib/libohosicu.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f20be000-f20bf000 rw-p 00035000 07:a8 64 /apex/com.art/lib/libohosicu.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f20bf000-f20c1000 r--s 00000000 fd:04 2339 /system/usr/hyphen-data/hyph-sl.hyb +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f20c1000-f20d8000 r--s 00000000 fd:04 1271 /system/fonts/NotoSerifKannada-Regular.ttf +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f20d8000-f20e1000 r--p 00000000 fd:04 1557 /system/lib/hardware.memtrack@1.0.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 1 kB +Shared_Clean: 36 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 36 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f20e1000-f20eb000 r-xp 00008000 fd:04 1557 /system/lib/hardware.memtrack@1.0.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f20eb000-f20ed000 r--p 00011000 fd:04 1557 /system/lib/hardware.memtrack@1.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f20ed000-f20ee000 rw-p 00012000 fd:04 1557 /system/lib/hardware.memtrack@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f20ef000-f20f1000 r--s 00000000 fd:04 2325 /system/usr/hyphen-data/hyph-mn-cyrl.hyb +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f20f1000-f2100000 r--s 00000000 fd:04 1098 /system/fonts/NotoSansCherokee-Regular.ttf +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2100000-f2107000 r--p 00000000 fd:04 1895 /system/lib/libmediametrics.so +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 0 kB +Shared_Clean: 28 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 28 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2107000-f2108000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f2108000-f2114000 r-xp 00007000 fd:04 1895 /system/lib/libmediametrics.so +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f2114000-f2115000 r--p 00012000 fd:04 1895 /system/lib/libmediametrics.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f2115000-f2116000 rw-p 00012000 fd:04 1895 /system/lib/libmediametrics.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f2116000-f211b000 r--s 00000000 fd:04 1167 /system/fonts/NotoSansMeroitic-Regular.otf +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f211b000-f2130000 r--s 00000000 fd:04 1136 /system/fonts/NotoSansKannada-Regular.ttf +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2130000-f214c000 r--s 00000000 fd:04 1233 /system/fonts/NotoSansTelugu-Regular.ttf +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f214c000-f2158000 r--p 00000000 fd:04 1538 /system/lib/hardware.graphics.mapper@3.0.so +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 48 kB +Pss: 1 kB +Shared_Clean: 48 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 48 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2158000-f2168000 r-xp 0000b000 fd:04 1538 /system/lib/hardware.graphics.mapper@3.0.so +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f2168000-f216a000 r--p 0001a000 fd:04 1538 /system/lib/hardware.graphics.mapper@3.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f216a000-f216b000 rw-p 0001b000 fd:04 1538 /system/lib/hardware.graphics.mapper@3.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f216b000-f216d000 r--s 00000000 fd:04 2305 /system/usr/hyphen-data/hyph-fr.hyb +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f216d000-f21b8000 r--s 00000000 fd:04 1297 /system/fonts/Roboto-Regular.ttf +Size: 300 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f21b8000-f241d000 r--p 00000000 fd:04 1949 /system/lib/libpdfium.so +Size: 2452 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f241d000-f26a7000 r-xp 00264000 fd:04 1949 /system/lib/libpdfium.so +Size: 2600 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f26a7000-f26b3000 r--p 004ed000 fd:04 1949 /system/lib/libpdfium.so +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 48 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 48 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 48 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f26b3000-f26b7000 rw-p 004f8000 fd:04 1949 /system/lib/libpdfium.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f26b7000-f26ba000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f26ba000-f26ce000 r--s 00000000 fd:04 1135 /system/fonts/NotoSansKannada-Bold.ttf +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f26ce000-f26e2000 r--s 00000000 fd:04 1085 /system/fonts/NotoSansBengaliUI-Bold.otf +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f26e2000-f26e4000 r--p 00000000 fd:04 1828 /system/lib/libhardware_legacy.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f26e4000-f26e7000 r-xp 00001000 fd:04 1828 /system/lib/libhardware_legacy.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f26e7000-f26e8000 r--p 00003000 fd:04 1828 /system/lib/libhardware_legacy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f26e8000-f26e9000 rw-p 00003000 fd:04 1828 /system/lib/libhardware_legacy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f26e9000-f26eb000 r--s 00000000 fd:04 2287 /system/usr/hyphen-data/hyph-da.hyb +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f26eb000-f2701000 r--s 00000000 fd:04 1086 /system/fonts/NotoSansBengaliUI-Medium.otf +Size: 88 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2701000-f2718000 r--p 00000000 fd:04 1847 /system/lib/libinput.so +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2718000-f2737000 r-xp 00016000 fd:04 1847 /system/lib/libinput.so +Size: 124 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f2737000-f273b000 r--p 00034000 fd:04 1847 /system/lib/libinput.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f273b000-f273c000 rw-p 00037000 fd:04 1847 /system/lib/libinput.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f273c000-f273e000 r--s 00000000 fd:04 2277 /system/usr/hyphen-data/hyph-be.hyb +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f273e000-f275b000 r--s 00000000 fd:04 1256 /system/fonts/NotoSerifBengali-Bold.ttf +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f275b000-f275d000 r--p 00000000 fd:04 1937 /system/lib/libnetd_client.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f275d000-f275e000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f275e000-f2763000 r-xp 00002000 fd:04 1937 /system/lib/libnetd_client.so +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f2763000-f2764000 r--p 00006000 fd:04 1937 /system/lib/libnetd_client.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f2764000-f2765000 rw-p 00006000 fd:04 1937 /system/lib/libnetd_client.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f2766000-f276d000 r--s 00000000 fd:04 1244 /system/fonts/NotoSansTifinagh-Regular.otf +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f276d000-f2781000 r--s 00000000 fd:04 1087 /system/fonts/NotoSansBengaliUI-Regular.otf +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2781000-f2790000 r--p 00000000 fd:04 1539 /system/lib/hardware.graphics.mapper@4.0.so +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 1 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2790000-f27a7000 r-xp 0000e000 fd:04 1539 /system/lib/hardware.graphics.mapper@4.0.so +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f27a7000-f27a9000 r--p 00024000 fd:04 1539 /system/lib/hardware.graphics.mapper@4.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f27a9000-f27aa000 rw-p 00025000 fd:04 1539 /system/lib/hardware.graphics.mapper@4.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f27ab000-f27b0000 r--s 00000000 fd:04 1163 /system/fonts/NotoSansManichaean-Regular.otf +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f27b0000-f27cd000 r--s 00000000 fd:04 1257 /system/fonts/NotoSerifBengali-Regular.ttf +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f27cd000-f27e9000 r--s 00000000 fd:04 1118 /system/fonts/NotoSansGujaratiUI-Bold.ttf +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f27e9000-f27ea000 r--p 00000000 fd:04 1594 /system/lib/hidl.safe_union@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f27ea000-f27eb000 r-xp 00000000 fd:04 1594 /system/lib/hidl.safe_union@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f27eb000-f27ec000 r--p 00000000 fd:04 1594 /system/lib/hidl.safe_union@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f27ed000-f280a000 r--s 00000000 fd:04 1119 /system/fonts/NotoSansGujaratiUI-Regular.ttf +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f280a000-f2817000 r--p 00000000 fd:04 1770 /system/lib/libcodec2_client.so +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 48 kB +Pss: 2 kB +Shared_Clean: 48 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 48 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2817000-f282e000 r-xp 0000c000 fd:04 1770 /system/lib/libcodec2_client.so +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f282e000-f282f000 r--p 00022000 fd:04 1770 /system/lib/libcodec2_client.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f282f000-f2830000 rw-p 00022000 fd:04 1770 /system/lib/libcodec2_client.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f2831000-f2834000 r--s 00000000 fd:04 1198 /system/fonts/NotoSansPauCinHau-Regular.otf +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2834000-f2849000 r--s 00000000 fd:04 1082 /system/fonts/NotoSansBengali-Bold.otf +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2849000-f2857000 r--p 00000000 fd:04 1593 /system/lib/hidl.memory@1.0.so +Size: 56 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 52 kB +Pss: 2 kB +Shared_Clean: 52 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 52 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2857000-f286d000 r-xp 0000d000 fd:04 1593 /system/lib/hidl.memory@1.0.so +Size: 88 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f286d000-f286f000 r--p 00022000 fd:04 1593 /system/lib/hidl.memory@1.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f286f000-f2870000 rw-p 00023000 fd:04 1593 /system/lib/hidl.memory@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f2870000-f2874000 r--s 00000000 fd:04 1196 /system/fonts/NotoSansPahawhHmong-Regular.otf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2874000-f288a000 r--s 00000000 fd:04 1083 /system/fonts/NotoSansBengali-Medium.otf +Size: 88 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f288a000-f28bc000 r--p 00000000 fd:04 1829 /system/lib/libharfbuzz_ng.so +Size: 200 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f28bc000-f294e000 r-xp 00031000 fd:04 1829 /system/lib/libharfbuzz_ng.so +Size: 584 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f294e000-f294f000 r--p 000c2000 fd:04 1829 /system/lib/libharfbuzz_ng.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f294f000-f2950000 rw-p 000c2000 fd:04 1829 /system/lib/libharfbuzz_ng.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f2950000-f2953000 r--s 00000000 fd:04 1197 /system/fonts/NotoSansPalmyrene-Regular.otf +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2953000-f295f000 r--s 00000000 fd:04 1093 /system/fonts/NotoSansCanadianAboriginal-Regular.ttf +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f295f000-f29aa000 r--s 00000000 fd:04 1293 /system/fonts/Roboto-Light.ttf +Size: 300 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f29aa000-f29b0000 r--p 00000000 fd:04 1749 /system/lib/libbufferhub.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 24 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 24 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f29b0000-f29ba000 r-xp 00005000 fd:04 1749 /system/lib/libbufferhub.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f29ba000-f29bb000 r--p 0000e000 fd:04 1749 /system/lib/libbufferhub.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f29bb000-f29bc000 rw-p 0000e000 fd:04 1749 /system/lib/libbufferhub.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f29bc000-f29bf000 r--s 00000000 fd:04 1186 /system/fonts/NotoSansOldPermic-Regular.otf +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f29bf000-f29c3000 r--s 00000000 fd:04 1225 /system/fonts/NotoSansTaiViet-Regular.ttf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f29c3000-f29ce000 r--p 00000000 fd:04 1536 /system/lib/hardware.graphics.mapper@2.0.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 0 kB +Shared_Clean: 44 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 44 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f29ce000-f29dc000 r-xp 0000a000 fd:04 1536 /system/lib/hardware.graphics.mapper@2.0.so +Size: 56 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f29dc000-f29de000 r--p 00017000 fd:04 1536 /system/lib/hardware.graphics.mapper@2.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f29de000-f29df000 rw-p 00018000 fd:04 1536 /system/lib/hardware.graphics.mapper@2.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f29df000-f29e7000 r--s 00000000 fd:04 1095 /system/fonts/NotoSansChakma-Regular.otf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f29e7000-f2a04000 r--s 00000000 fd:04 1116 /system/fonts/NotoSansGujarati-Bold.ttf +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2a04000-f2a17000 r--p 00000000 fd:04 1889 /system/lib/libmediadrm.so +Size: 76 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2a17000-f2a34000 r-xp 00012000 fd:04 1889 /system/lib/libmediadrm.so +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f2a34000-f2a37000 r--p 0002e000 fd:04 1889 /system/lib/libmediadrm.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f2a37000-f2a38000 rw-p 00030000 fd:04 1889 /system/lib/libmediadrm.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f2a38000-f2a40000 r--s 00000000 fd:04 1078 /system/fonts/NotoSansBalinese-Regular.ttf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2a40000-f2a5e000 r--s 00000000 fd:04 1117 /system/fonts/NotoSansGujarati-Regular.ttf +Size: 120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2a5e000-f2a9a000 r--p 00000000 fd:04 1710 /system/lib/libaudioclient.so +Size: 240 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 68 kB +Pss: 2 kB +Shared_Clean: 68 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 68 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2a9a000-f2af3000 r-xp 0003b000 fd:04 1710 /system/lib/libaudioclient.so +Size: 356 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 252 kB +Pss: 23 kB +Shared_Clean: 252 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 252 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f2af3000-f2afc000 r--p 00093000 fd:04 1710 /system/lib/libaudioclient.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 36 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 16 kB +Anonymous: 36 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f2afc000-f2afd000 rw-p 0009b000 fd:04 1710 /system/lib/libaudioclient.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f2afd000-f2aff000 r--s 00000000 fd:04 1213 /system/fonts/NotoSansSoraSompeng-Regular.otf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2aff000-f2b13000 r--s 00000000 fd:04 1084 /system/fonts/NotoSansBengali-Regular.otf +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2b13000-f2b15000 r--p 00000000 fd:04 1528 /system/lib/hardware.graphics.common-V1-ndk_platform.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2b15000-f2b18000 r-xp 00001000 fd:04 1528 /system/lib/hardware.graphics.common-V1-ndk_platform.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f2b18000-f2b19000 r--p 00003000 fd:04 1528 /system/lib/hardware.graphics.common-V1-ndk_platform.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f2b19000-f2b1a000 rw-p 00003000 fd:04 1528 /system/lib/hardware.graphics.common-V1-ndk_platform.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f2b1a000-f2b1c000 r--s 00000000 fd:04 1185 /system/fonts/NotoSansOldNorthArabian-Regular.otf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2b1c000-f2b20000 r--s 00000000 fd:04 1215 /system/fonts/NotoSansSylotiNagri-Regular.ttf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2b20000-f2b28000 r--s 00000000 fd:04 1147 /system/fonts/NotoSansLaoUI-Bold.ttf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2b28000-f2b43000 r--s 00000000 fd:04 1106 /system/fonts/NotoSansDevanagariUI-Bold.otf +Size: 108 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2b43000-f2b8a000 r--p 00000000 fd:04 1751 /system/lib/libc++.so +Size: 284 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 1 kB +Shared_Clean: 128 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 128 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2b8a000-f2bf2000 r-xp 00046000 fd:04 1751 /system/lib/libc++.so +Size: 416 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 412 kB +Pss: 3 kB +Shared_Clean: 412 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 412 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f2bf2000-f2bf6000 r--p 000ad000 fd:04 1751 /system/lib/libc++.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 16 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f2bf6000-f2bf7000 rw-p 000b0000 fd:04 1751 /system/lib/libc++.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f2bf7000-f2bf9000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f2bfa000-f2c02000 r--s 00000000 fd:04 1148 /system/fonts/NotoSansLaoUI-Regular.ttf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2c02000-f2c12000 r--p 00000000 fd:04 1682 /system/lib/libGLESv2.so +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2c12000-f2c1a000 r-xp 0000f000 fd:04 1682 /system/lib/libGLESv2.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f2c1a000-f2c1b000 r--p 00016000 fd:04 1682 /system/lib/libGLESv2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f2c1b000-f2c20000 r--s 00000000 fd:04 1204 /system/fonts/NotoSansSaurashtra-Regular.ttf +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2c20000-f2c28000 r--s 00000000 fd:04 1274 /system/fonts/NotoSerifLao-Bold.ttf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2c28000-f2c44000 r--s 00000000 fd:04 1107 /system/fonts/NotoSansDevanagariUI-Medium.otf +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2c44000-f2c48000 r--p 00000000 fd:04 1781 /system/lib/libdataloader.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 16 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 16 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2c48000-f2c53000 r-xp 00003000 fd:04 1781 /system/lib/libdataloader.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f2c53000-f2c55000 r--p 0000d000 fd:04 1781 /system/lib/libdataloader.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f2c55000-f2c56000 rw-p 0000e000 fd:04 1781 /system/lib/libdataloader.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f2c57000-f2c5b000 r--s 00000000 fd:04 1187 /system/fonts/NotoSansOldPersian-Regular.ttf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2c5b000-f2c98000 r--s 00000000 fd:04 1252 /system/fonts/NotoSerif-Italic.ttf +Size: 244 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f2c98000-f2e63000 r--p 00000000 fd:04 1839 /system/lib/libhwui.so +Size: 1836 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 192 kB +Pss: 9 kB +Shared_Clean: 192 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 192 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f2e63000-f3590000 r-xp 001ca000 fd:04 1839 /system/lib/libhwui.so +Size: 7348 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 636 kB +Pss: 29 kB +Shared_Clean: 636 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 636 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3590000-f35a7000 r--p 008f6000 fd:04 1839 /system/lib/libhwui.so +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 92 kB +Pss: 2 kB +Shared_Clean: 0 kB +Shared_Dirty: 92 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 16 kB +Anonymous: 92 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f35a7000-f35a9000 rw-p 0090c000 fd:04 1839 /system/lib/libhwui.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f35a9000-f35ad000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f35ad000-f35c0000 r--s 00000000 fd:04 1281 /system/fonts/NotoSerifSinhala-Regular.otf +Size: 76 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f35c0000-f35cf000 r--p 00000000 07:a8 98 /apex/com.art/lib/libnativeloader.so +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 1 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f35cf000-f35fe000 r-xp 0000e000 07:a8 98 /apex/com.art/lib/libnativeloader.so +Size: 188 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 184 kB +Pss: 5 kB +Shared_Clean: 184 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 184 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f35fe000-f35ff000 r--p 0003c000 07:a8 98 /apex/com.art/lib/libnativeloader.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f35ff000-f3600000 rw-p 0003c000 07:a8 98 /apex/com.art/lib/libnativeloader.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3600000-f3608000 r--s 00000000 fd:04 1275 /system/fonts/NotoSerifLao-Regular.ttf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3608000-f3685000 r--p 00000000 fd:04 1992 /system/lib/libstagefright.so +Size: 500 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3685000-f3686000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f3686000-f37d5000 r-xp 0007d000 fd:04 1992 /system/lib/libstagefright.so +Size: 1340 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f37d5000-f37de000 r--p 001cb000 fd:04 1992 /system/lib/libstagefright.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 36 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 36 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f37de000-f37df000 rw-p 001d3000 fd:04 1992 /system/lib/libstagefright.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f37df000-f37e1000 r--s 00000000 fd:04 1179 /system/fonts/NotoSansNabataean-Regular.otf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f37e1000-f37ea000 r--s 00000000 fd:04 1142 /system/fonts/NotoSansKhmerUI-Bold.ttf +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f37ea000-f383b000 r--s 00000000 fd:04 1299 /system/fonts/Roboto-ThinItalic.ttf +Size: 324 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f383b000-f38e2000 r--p 00000000 07:a8 91 /apex/com.art/lib/libicuuc.so +Size: 668 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 380 kB +Pss: 13 kB +Shared_Clean: 380 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 344 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f38e2000-f39f2000 r-xp 000a6000 07:a8 91 /apex/com.art/lib/libicuuc.so +Size: 1088 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 1060 kB +Pss: 38 kB +Shared_Clean: 1060 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 1060 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f39f2000-f39fe000 r--p 001b5000 07:a8 91 /apex/com.art/lib/libicuuc.so +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 48 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 48 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 28 kB +Anonymous: 48 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f39fe000-f39ff000 rw-p 001c0000 07:a8 91 /apex/com.art/lib/libicuuc.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f39ff000-f3a00000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3a00000-f3a02000 r--s 00000000 fd:04 1171 /system/fonts/NotoSansMultani-Regular.otf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3a02000-f3a0e000 r--s 00000000 fd:04 1272 /system/fonts/NotoSerifKhmer-Bold.otf +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3a0e000-f3a0f000 r--p 00000000 fd:04 1902 /system/lib/libmemtrack.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3a0f000-f3a11000 r-xp 00000000 fd:04 1902 /system/lib/libmemtrack.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3a11000-f3a12000 r--p 00001000 fd:04 1902 /system/lib/libmemtrack.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3a12000-f3a13000 rw-p 00001000 fd:04 1902 /system/lib/libmemtrack.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3a14000-f3a19000 r--s 00000000 fd:04 1178 /system/fonts/NotoSansNKo-Regular.ttf +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3a19000-f3a65000 r--s 00000000 fd:04 1298 /system/fonts/Roboto-Thin.ttf +Size: 304 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3a65000-f3a89000 r--p 00000000 fd:04 1948 /system/lib/libpcre2.so +Size: 144 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3a89000-f3ab8000 r-xp 00023000 fd:04 1948 /system/lib/libpcre2.so +Size: 188 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3ab8000-f3ab9000 r--p 00051000 fd:04 1948 /system/lib/libpcre2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3ab9000-f3aba000 rw-p 00051000 fd:04 1948 /system/lib/libpcre2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3aba000-f3ac8000 r--s 00000000 fd:04 1160 /system/fonts/NotoSansMalayalamUI-Medium.otf +Size: 56 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3ac8000-f3ace000 r--p 00000000 fd:04 1780 /system/lib/libcutils.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 24 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 24 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3ace000-f3ad8000 r-xp 00005000 fd:04 1780 /system/lib/libcutils.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 0 kB +Shared_Clean: 40 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 40 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3ad8000-f3ada000 r--p 0000e000 fd:04 1780 /system/lib/libcutils.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3ada000-f3adb000 rw-p 0000f000 fd:04 1780 /system/lib/libcutils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3adb000-f3ae3000 r--s 00000000 fd:04 1145 /system/fonts/NotoSansLao-Bold.ttf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3ae3000-f3b20000 r--s 00000000 fd:04 1250 /system/fonts/NotoSerif-Bold.ttf +Size: 244 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3b20000-f3b27000 r--p 00000000 fd:04 1995 /system/lib/libstagefright_bufferqueue_helper.so +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 24 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 24 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3b27000-f3b28000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f3b28000-f3b36000 r-xp 00007000 fd:04 1995 /system/lib/libstagefright_bufferqueue_helper.so +Size: 56 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3b36000-f3b38000 r--p 00014000 fd:04 1995 /system/lib/libstagefright_bufferqueue_helper.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3b38000-f3b44000 r--s 00000000 fd:04 1159 /system/fonts/NotoSansMalayalamUI-Bold.otf +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3b44000-f3b55000 r--p 00000000 fd:04 2025 /system/lib/libvulkan.so +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3b55000-f3b71000 r-xp 00010000 fd:04 2025 /system/lib/libvulkan.so +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3b71000-f3b73000 r--p 0002b000 fd:04 2025 /system/lib/libvulkan.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3b73000-f3b74000 rw-p 0002c000 fd:04 2025 /system/lib/libvulkan.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3b74000-f3b77000 r--s 00000000 fd:04 1223 /system/fonts/NotoSansTaiLe-Regular.ttf +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3b77000-f3b83000 r--s 00000000 fd:04 1161 /system/fonts/NotoSansMalayalamUI-Regular.otf +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3b83000-f3ba0000 r--s 00000000 fd:04 1103 /system/fonts/NotoSansDevanagari-Bold.otf +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3ba0000-f3ba5000 r--p 00000000 fd:04 1756 /system/lib/libcamera_metadata.so +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3ba5000-f3baa000 r-xp 00004000 fd:04 1756 /system/lib/libcamera_metadata.so +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3baa000-f3bac000 r--p 00008000 fd:04 1756 /system/lib/libcamera_metadata.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3bac000-f3bad000 rw-p 00009000 fd:04 1756 /system/lib/libcamera_metadata.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3bae000-f3bb8000 r--s 00000000 fd:04 1143 /system/fonts/NotoSansKhmerUI-Regular.ttf +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3bb8000-f3bc5000 r--s 00000000 fd:04 1276 /system/fonts/NotoSerifMalayalam-Bold.ttf +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3bc5000-f3bc7000 r--p 00000000 07:60 22 /apex/com.os.statsd/lib/libstatssocket.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3bc7000-f3bc9000 r-xp 00001000 07:60 22 /apex/com.os.statsd/lib/libstatssocket.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3bc9000-f3bca000 r--p 00002000 07:60 22 /apex/com.os.statsd/lib/libstatssocket.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3bca000-f3bcb000 rw-p 00002000 07:60 22 /apex/com.os.statsd/lib/libstatssocket.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3bcb000-f3bcc000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3bcd000-f3bda000 r--s 00000000 fd:04 1277 /system/fonts/NotoSerifMalayalam-Regular.ttf +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3bda000-f3be6000 r--s 00000000 fd:04 1156 /system/fonts/NotoSansMalayalam-Bold.otf +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3be6000-f3c05000 r--s 00000000 fd:04 1104 /system/fonts/NotoSansDevanagari-Medium.otf +Size: 124 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3c05000-f3c69000 r--p 00000000 fd:04 1826 /system/lib/libgui.so +Size: 400 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3c69000-f3cef000 r-xp 00063000 fd:04 1826 /system/lib/libgui.so +Size: 536 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3cef000-f3cfd000 r--p 000e8000 fd:04 1826 /system/lib/libgui.so +Size: 56 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 56 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 56 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 56 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3cfd000-f3cfe000 rw-p 000f5000 fd:04 1826 /system/lib/libgui.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3cfe000-f3d00000 r--s 00000000 fd:04 1170 /system/fonts/NotoSansMro-Regular.otf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3d00000-f3d0e000 r--s 00000000 fd:04 1157 /system/fonts/NotoSansMalayalam-Medium.otf +Size: 56 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3d0e000-f3d0f000 r--p 00000000 fd:04 1908 /system/lib/libnativebridge_lazy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3d0f000-f3d11000 r-xp 00000000 fd:04 1908 /system/lib/libnativebridge_lazy.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3d11000-f3d12000 r--p 00001000 fd:04 1908 /system/lib/libnativebridge_lazy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3d12000-f3d13000 rw-p 00001000 fd:04 1908 /system/lib/libnativebridge_lazy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3d13000-f3d1d000 r--s 00000000 fd:04 1273 /system/fonts/NotoSerifKhmer-Regular.otf +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3d1d000-f3d41000 r--s 00000000 fd:04 1111 /system/fonts/NotoSansEthiopic-Bold.ttf +Size: 144 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3d41000-f3d47000 r--p 00000000 fd:04 1938 /system/lib/libnetdbpf.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3d47000-f3d48000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f3d48000-f3d64000 r-xp 00006000 fd:04 1938 /system/lib/libnetdbpf.so +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3d64000-f3d65000 r--p 00021000 fd:04 1938 /system/lib/libnetdbpf.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3d65000-f3d85000 r--s 00000000 fd:04 1261 /system/fonts/NotoSerifEthiopic-Bold.otf +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3d85000-f3da5000 r--p 00000000 fd:04 1989 /system/lib/libsqlite.so +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 108 kB +Pss: 4 kB +Shared_Clean: 108 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 108 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3da5000-f3ec6000 r-xp 0001f000 fd:04 1989 /system/lib/libsqlite.so +Size: 1156 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 1028 kB +Pss: 50 kB +Shared_Clean: 1028 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 1028 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3ec6000-f3ec8000 r--p 0013f000 fd:04 1989 /system/lib/libsqlite.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3ec8000-f3eca000 rw-p 00140000 fd:04 1989 /system/lib/libsqlite.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3eca000-f3ed2000 r--s 00000000 fd:04 1146 /system/fonts/NotoSansLao-Regular.ttf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3ed2000-f3ede000 r--s 00000000 fd:04 1158 /system/fonts/NotoSansMalayalam-Regular.otf +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3ede000-f3f01000 r--s 00000000 fd:04 1112 /system/fonts/NotoSansEthiopic-Regular.ttf +Size: 140 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3f01000-f3f2c000 r--p 00000000 fd:04 1755 /system/lib/libcamera_client.so +Size: 172 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 76 kB +Pss: 2 kB +Shared_Clean: 76 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 76 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3f2c000-f3f5e000 r-xp 0002a000 fd:04 1755 /system/lib/libcamera_client.so +Size: 200 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3f5e000-f3f65000 r--p 0005b000 fd:04 1755 /system/lib/libcamera_client.so +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 28 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 28 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3f65000-f3f66000 rw-p 00061000 fd:04 1755 /system/lib/libcamera_client.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3f66000-f3f83000 r--s 00000000 fd:04 1105 /system/fonts/NotoSansDevanagari-Regular.otf +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3f83000-f3fa1000 r--s 00000000 fd:04 1069 /system/fonts/NotoNaskhArabicUI-Bold.ttf +Size: 120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3fa1000-f3faa000 r--p 00000000 fd:04 1843 /system/lib/libimg_utils.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 1 kB +Shared_Clean: 36 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 36 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3faa000-f3fb3000 r-xp 00008000 fd:04 1843 /system/lib/libimg_utils.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3fb3000-f3fb5000 r--p 00010000 fd:04 1843 /system/lib/libimg_utils.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3fb5000-f3fb6000 rw-p 00011000 fd:04 1843 /system/lib/libimg_utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f3fb7000-f3fd3000 r--s 00000000 fd:04 1262 /system/fonts/NotoSerifEthiopic-Regular.otf +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3fd3000-f3ff1000 r--s 00000000 fd:04 1070 /system/fonts/NotoNaskhArabicUI-Regular.ttf +Size: 120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3ff1000-f3ff3000 r--p 00000000 fd:04 1988 /system/lib/libspeexresampler.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f3ff3000-f3ff6000 r-xp 00001000 fd:04 1988 /system/lib/libspeexresampler.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f3ff6000-f3ff7000 r--p 00003000 fd:04 1988 /system/lib/libspeexresampler.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f3ff7000-f3ffd000 r--s 00000000 fd:04 1140 /system/fonts/NotoSansKharoshthi-Regular.ttf +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f3ffd000-f4005000 r--s 00000000 fd:04 1229 /system/fonts/NotoSansTamilUI-Bold.otf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4005000-f400e000 r--s 00000000 fd:04 1230 /system/fonts/NotoSansTamilUI-Medium.otf +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f400e000-f401b000 r--p 00000000 fd:04 1506 /system/lib/hardware.configstore@1.1.so +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 52 kB +Pss: 1 kB +Shared_Clean: 52 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 52 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f401b000-f402a000 r-xp 0000c000 fd:04 1506 /system/lib/hardware.configstore@1.1.so +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f402a000-f402c000 r--p 0001a000 fd:04 1506 /system/lib/hardware.configstore@1.1.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f402c000-f402d000 rw-p 0001b000 fd:04 1506 /system/lib/hardware.configstore@1.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f402d000-f4047000 r--s 00000000 fd:04 1108 /system/fonts/NotoSansDevanagariUI-Regular.otf +Size: 104 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4047000-f4054000 r--p 00000000 fd:04 1599 /system/lib/system.suspend@1.0.so +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 52 kB +Pss: 1 kB +Shared_Clean: 52 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 52 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4054000-f4066000 r-xp 0000c000 fd:04 1599 /system/lib/system.suspend@1.0.so +Size: 72 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4066000-f4068000 r--p 0001d000 fd:04 1599 /system/lib/system.suspend@1.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4068000-f4069000 rw-p 0001e000 fd:04 1599 /system/lib/system.suspend@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4069000-f406a000 r--s 00000000 00:01 16470 /dev/ashmem/ea81e662-1a15-41d1-810f-1aa99e59a948 (deleted) +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd sh mr ms +f406a000-f4070000 r--s 00000000 fd:04 1099 /system/fonts/NotoSansCoptic-Regular.ttf +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4070000-f4078000 r--s 00000000 fd:04 1231 /system/fonts/NotoSansTamilUI-Regular.otf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4078000-f4095000 r--s 00000000 fd:04 1067 /system/fonts/NotoNaskhArabic-Bold.ttf +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4095000-f40ae000 r--p 00000000 fd:04 1980 /system/lib/libsfplugin_ccodec_utils.so +Size: 100 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f40ae000-f40af000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f40af000-f40f8000 r-xp 00019000 fd:04 1980 /system/lib/libsfplugin_ccodec_utils.so +Size: 292 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f40f8000-f40fa000 r--p 00061000 fd:04 1980 /system/lib/libsfplugin_ccodec_utils.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f40fa000-f40fb000 rw-p 00062000 fd:04 1980 /system/lib/libsfplugin_ccodec_utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f40fb000-f40fd000 r--s 00000000 fd:04 1127 /system/fonts/NotoSansHatran-Regular.otf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f40fd000-f411a000 r--s 00000000 fd:04 1068 /system/fonts/NotoNaskhArabic-Regular.ttf +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f411a000-f4145000 r--p 00000000 fd:04 1818 /system/lib/libft2.so +Size: 172 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 52 kB +Pss: 2 kB +Shared_Clean: 52 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 52 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4145000-f41b3000 r-xp 0002a000 fd:04 1818 /system/lib/libft2.so +Size: 440 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f41b3000-f41b7000 r--p 00097000 fd:04 1818 /system/lib/libft2.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f41b7000-f41b8000 r--s 00076000 fd:04 1419 /system/framework/org.apache.http.legacy.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f41b8000-f41c0000 r--s 00000000 fd:04 1282 /system/fonts/NotoSerifTamil-Bold.otf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f41c0000-f41c8000 r--s 00000000 fd:04 1283 /system/fonts/NotoSerifTamil-Regular.otf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f41c8000-f41d0000 r--s 00000000 fd:04 1226 /system/fonts/NotoSansTamil-Bold.otf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f41d0000-f41ea000 r--s 00000000 fd:04 1309 /system/fonts/SourceSansPro-BoldItalic.ttf +Size: 104 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f41ea000-f41f2000 r--p 00000000 fd:04 1713 /system/lib/libaudiofoundation.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 0 kB +Shared_Clean: 32 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 32 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f41f2000-f41fd000 r-xp 00007000 fd:04 1713 /system/lib/libaudiofoundation.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f41fd000-f41fe000 r--p 00011000 fd:04 1713 /system/lib/libaudiofoundation.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f41fe000-f41ff000 rw-p 00011000 fd:04 1713 /system/lib/libaudiofoundation.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f41ff000-f4200000 r--s 00008000 fd:04 1318 /system/framework/test.base.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4200000-f4204000 r--s 00000000 fd:04 1180 /system/fonts/NotoSansNewTaiLue-Regular.ttf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4204000-f420d000 r--s 00000000 fd:04 1227 /system/fonts/NotoSansTamil-Medium.otf +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f420d000-f42e5000 r--p 00000000 07:a8 90 /apex/com.art/lib/libicui18n.so +Size: 864 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 192 kB +Pss: 5 kB +Shared_Clean: 192 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 192 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f42e5000-f449d000 r-xp 000d7000 07:a8 90 /apex/com.art/lib/libicui18n.so +Size: 1760 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 1472 kB +Pss: 110 kB +Shared_Clean: 1472 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 1472 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f449d000-f44a8000 r--p 0028e000 07:a8 90 /apex/com.art/lib/libicui18n.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 44 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 36 kB +Anonymous: 44 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f44a8000-f44a9000 rw-p 00298000 07:a8 90 /apex/com.art/lib/libicui18n.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f44a9000-f44aa000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f44aa000-f44ab000 r--s 00000000 00:11 7391 /dev/cgroup_info/cgroup.rc +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f44ab000-f44b1000 r--s 00000000 fd:04 1089 /system/fonts/NotoSansBrahmi-Regular.ttf +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f44b1000-f44b9000 r--s 00000000 fd:04 1228 /system/fonts/NotoSansTamil-Regular.otf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f44b9000-f44d3000 r--s 00000000 fd:04 1313 /system/fonts/SourceSansPro-SemiBoldItalic.ttf +Size: 104 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f44d3000-f44d4000 r--p 00000000 fd:04 1595 /system/lib/hidl.token@1.0-utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f44d4000-f44d6000 r-xp 00000000 fd:04 1595 /system/lib/hidl.token@1.0-utils.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f44d6000-f44d7000 r--p 00001000 fd:04 1595 /system/lib/hidl.token@1.0-utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f44d7000-f44d8000 rw-p 00001000 fd:04 1595 /system/lib/hidl.token@1.0-utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f44d8000-f44da000 r--s 00000000 fd:04 1080 /system/fonts/NotoSansBassaVah-Regular.otf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f44da000-f4517000 r--s 00000000 fd:04 1253 /system/fonts/NotoSerif-Regular.ttf +Size: 244 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4517000-f451e000 r--p 00000000 fd:04 1782 /system/lib/libdatasource.so +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 0 kB +Shared_Clean: 28 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 28 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f451e000-f451f000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f451f000-f452a000 r-xp 00007000 fd:04 1782 /system/lib/libdatasource.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f452a000-f452c000 r--p 00011000 fd:04 1782 /system/lib/libdatasource.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f452c000-f452d000 rw-p 00012000 fd:04 1782 /system/lib/libdatasource.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f452d000-f4530000 r--s 00000000 fd:04 1214 /system/fonts/NotoSansSundanese-Regular.ttf +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4530000-f454d000 r--s 00000000 fd:04 1061 /system/fonts/DancingScript-Bold.ttf +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f454d000-f4589000 r--p 00000000 fd:04 1773 /system/lib/libcodec2_vndk.so +Size: 240 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 2 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4589000-f45ed000 r-xp 0003b000 fd:04 1773 /system/lib/libcodec2_vndk.so +Size: 400 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f45ed000-f45ef000 r--p 0009e000 fd:04 1773 /system/lib/libcodec2_vndk.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f45ef000-f45f0000 rw-p 0009f000 fd:04 1773 /system/lib/libcodec2_vndk.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f45f0000-f45f1000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f45f1000-f4601000 r--s 00000000 fd:04 1264 /system/fonts/NotoSerifGujarati-Bold.ttf +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4601000-f461e000 r--s 00000000 fd:04 1062 /system/fonts/DancingScript-Regular.ttf +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f461e000-f4624000 r--p 00000000 fd:04 1824 /system/lib/libgraphicsenv.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 24 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 24 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4624000-f462a000 r-xp 00005000 fd:04 1824 /system/lib/libgraphicsenv.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 24 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 24 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f462a000-f462b000 r--p 0000a000 fd:04 1824 /system/lib/libgraphicsenv.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f462b000-f462c000 rw-p 0000a000 fd:04 1824 /system/lib/libgraphicsenv.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f462c000-f4630000 r--s 00000000 fd:04 1166 /system/fonts/NotoSansMeeteiMayek-Regular.ttf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4630000-f4650000 rw-p 00000000 00:00 0 [anon:dalvik-CompilerMetadata] +Name: [anon:dalvik-CompilerMetadata] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4650000-f46de000 r--p 00000000 fd:04 1702 /system/lib/libohos_runtime.so +Size: 568 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 196 kB +Pss: 5 kB +Shared_Clean: 196 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 196 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f46de000-f47d7000 r-xp 0008d000 fd:04 1702 /system/lib/libohos_runtime.so +Size: 996 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 796 kB +Pss: 22 kB +Shared_Clean: 796 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 796 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f47d7000-f47e4000 r--p 00185000 fd:04 1702 /system/lib/libohos_runtime.so +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 52 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 52 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 24 kB +Anonymous: 52 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f47e4000-f47e6000 rw-p 00191000 fd:04 1702 /system/lib/libohos_runtime.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f47e6000-f47e7000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f47e7000-f4801000 r--s 00000000 fd:04 1310 /system/fonts/SourceSansPro-Italic.ttf +Size: 104 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4801000-f4810000 r--p 00000000 fd:04 1950 /system/lib/libpdx_default_transport.so +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 1 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4810000-f4827000 r-xp 0000e000 fd:04 1950 /system/lib/libpdx_default_transport.so +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4827000-f4828000 r--p 00024000 fd:04 1950 /system/lib/libpdx_default_transport.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4828000-f4829000 rw-p 00024000 fd:04 1950 /system/lib/libpdx_default_transport.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4829000-f482a000 r--s 00000000 fd:04 2347 /system/usr/hyphen-data/hyph-und-ethi.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f482a000-f4830000 r--s 00000000 fd:04 1096 /system/fonts/NotoSansCham-Bold.ttf +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4830000-f4840000 r--s 00000000 fd:04 1265 /system/fonts/NotoSerifGujarati-Regular.ttf +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4840000-f484b000 r--p 00000000 fd:04 1800 /system/lib/libexpat.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 1 kB +Shared_Clean: 40 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 40 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f484b000-f4866000 r-xp 0000a000 fd:04 1800 /system/lib/libexpat.so +Size: 108 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4866000-f4869000 r--p 00024000 fd:04 1800 /system/lib/libexpat.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4869000-f486c000 r--s 00000000 fd:04 1203 /system/fonts/NotoSansSamaritan-Regular.ttf +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f486c000-f4880000 r--s 00000000 fd:04 1259 /system/fonts/NotoSerifDevanagari-Bold.ttf +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4880000-f4889000 r--p 00000000 fd:04 1525 /system/lib/hardware.graphics.allocator@4.0.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 0 kB +Shared_Clean: 36 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 36 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4889000-f4894000 r-xp 00008000 fd:04 1525 /system/lib/hardware.graphics.allocator@4.0.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4894000-f4895000 r--p 00012000 fd:04 1525 /system/lib/hardware.graphics.allocator@4.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4895000-f4896000 rw-p 00012000 fd:04 1525 /system/lib/hardware.graphics.allocator@4.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4896000-f489a000 r--s 00000000 fd:04 1162 /system/fonts/NotoSansMandaic-Regular.ttf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f489a000-f48a2000 r--s 00000000 fd:04 1123 /system/fonts/NotoSansGurmukhiUI-Bold.ttf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f48a2000-f48dd000 r--s 00000000 07:c0 14 /apex/com.tzdata/etc/icu/icu_tzdata.dat +Size: 236 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f48dd000-f48e8000 r--p 00000000 fd:04 1884 /system/lib/libmedia_helper.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 44 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 44 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f48e8000-f48f2000 r-xp 0000a000 fd:04 1884 /system/lib/libmedia_helper.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f48f2000-f48f4000 r--p 00013000 fd:04 1884 /system/lib/libmedia_helper.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f48f4000-f48f8000 r--s 00000000 fd:04 1114 /system/fonts/NotoSansGlagolitic-Regular.ttf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f48f8000-f4900000 r--s 00000000 fd:04 1124 /system/fonts/NotoSansGurmukhiUI-Regular.ttf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4900000-f491a000 r--p 00000000 07:50 20 /apex/com.runtime/lib/libm.so +Size: 104 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 0 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f491a000-f4935000 r-xp 00019000 07:50 20 /apex/com.runtime/lib/libm.so +Size: 108 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4935000-f4937000 r--p 00033000 07:50 20 /apex/com.runtime/lib/libm.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4937000-f4938000 rw-p 00034000 07:50 20 /apex/com.runtime/lib/libm.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4938000-f493a000 r--s 00000000 fd:04 1245 /system/fonts/NotoSansUgaritic-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f493a000-f4942000 r--s 00000000 fd:04 1266 /system/fonts/NotoSerifGurmukhi-Bold.otf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4942000-f494f000 r--p 00000000 fd:04 1728 /system/lib/libaudioutils.so +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 52 kB +Pss: 1 kB +Shared_Clean: 52 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 52 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f494f000-f4966000 r-xp 0000c000 fd:04 1728 /system/lib/libaudioutils.so +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4966000-f4967000 r--p 00022000 fd:04 1728 /system/lib/libaudioutils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4967000-f4968000 r--s 00000000 fd:04 2345 /system/usr/hyphen-data/hyph-tk.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4968000-f496c000 r--s 00000000 fd:04 1081 /system/fonts/NotoSansBatak-Regular.ttf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f496c000-f498c000 rw-p 00000000 00:00 0 [anon:dalvik-CompilerMetadata] +Name: [anon:dalvik-CompilerMetadata] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f498c000-f49d4000 r--p 00000000 fd:04 1835 /system/lib/libhidlbase.so +Size: 288 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 2 kB +Shared_Clean: 128 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 128 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f49d4000-f4a5f000 r-xp 00047000 fd:04 1835 /system/lib/libhidlbase.so +Size: 556 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4a5f000-f4a66000 r--p 000d1000 fd:04 1835 /system/lib/libhidlbase.so +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 28 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 28 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4a66000-f4a67000 rw-p 000d7000 fd:04 1835 /system/lib/libhidlbase.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4a67000-f4a6d000 r--s 00000000 fd:04 1097 /system/fonts/NotoSansCham-Regular.ttf +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4a6d000-f4a8d000 r--s 00000000 00:11 7317 /dev/__properties__/u:object_r:qemu_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4a8d000-f4a8e000 r--p 00000000 fd:04 1886 /system/lib/libmedia_jni_utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4a8e000-f4a90000 r-xp 00000000 fd:04 1886 /system/lib/libmedia_jni_utils.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4a90000-f4a91000 r--p 00001000 fd:04 1886 /system/lib/libmedia_jni_utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4a91000-f4a92000 r--s 00000000 fd:04 2343 /system/usr/hyphen-data/hyph-te.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4a92000-f4aa6000 r--s 00000000 fd:04 1260 /system/fonts/NotoSerifDevanagari-Regular.ttf +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4aa6000-f4ac6000 r--s 00000000 00:11 7252 /dev/__properties__/u:object_r:exported3_default_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4ac6000-f4ad9000 r--p 00000000 fd:04 1678 /system/lib/libEGL.so +Size: 76 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4ad9000-f4af3000 r-xp 00012000 fd:04 1678 /system/lib/libEGL.so +Size: 104 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 76 kB +Pss: 1 kB +Shared_Clean: 76 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 76 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4af3000-f4af6000 r--p 0002b000 fd:04 1678 /system/lib/libEGL.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4af6000-f4af7000 rw-p 0002d000 fd:04 1678 /system/lib/libEGL.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4af7000-f4afb000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4afb000-f4aff000 r--s 00000000 fd:04 1072 /system/fonts/NotoSansAhom-Regular.otf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4aff000-f4b13000 r--s 00000000 fd:04 1263 /system/fonts/NotoSerifGeorgian-VF.ttf +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4b13000-f4b19000 r--p 00000000 fd:04 1973 /system/lib/libselinux.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4b19000-f4b2b000 r-xp 00005000 fd:04 1973 /system/lib/libselinux.so +Size: 72 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 72 kB +Pss: 1 kB +Shared_Clean: 72 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 72 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4b2b000-f4b2c000 r--p 00016000 fd:04 1973 /system/lib/libselinux.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4b2c000-f4b2d000 rw-p 00016000 fd:04 1973 /system/lib/libselinux.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4b2d000-f4b2e000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4b2e000-f4b2f000 r--s 00000000 fd:04 2341 /system/usr/hyphen-data/hyph-ta.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4b2f000-f4b37000 r--s 00000000 fd:04 1121 /system/fonts/NotoSansGurmukhi-Bold.ttf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4b37000-f4b57000 rw-p 00000000 00:00 0 [anon:dalvik-CompilerMetadata] +Name: [anon:dalvik-CompilerMetadata] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4b57000-f4b66000 r--p 00000000 fd:04 1505 /system/lib/hardware.configstore@1.0.so +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 1 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4b66000-f4b7d000 r-xp 0000e000 fd:04 1505 /system/lib/hardware.configstore@1.0.so +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4b7d000-f4b7f000 r--p 00024000 fd:04 1505 /system/lib/hardware.configstore@1.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4b7f000-f4b80000 rw-p 00025000 fd:04 1505 /system/lib/hardware.configstore@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4b80000-f4b82000 r--s 00000000 fd:04 1222 /system/fonts/NotoSansTagbanwa-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4b82000-f4b96000 r--p 00000000 fd:04 1554 /system/lib/hardware.media.c2@1.1.so +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4b96000-f4bb4000 r-xp 00013000 fd:04 1554 /system/lib/hardware.media.c2@1.1.so +Size: 120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4bb4000-f4bb7000 r--p 00030000 fd:04 1554 /system/lib/hardware.media.c2@1.1.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4bb7000-f4bb8000 rw-p 00032000 fd:04 1554 /system/lib/hardware.media.c2@1.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4bb8000-f4bbf000 r--s 00000000 fd:04 1267 /system/fonts/NotoSerifGurmukhi-Regular.otf +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4bbf000-f4bc7000 r--s 00000000 fd:04 1122 /system/fonts/NotoSansGurmukhi-Regular.ttf +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4bc7000-f4be7000 rw-p 00000000 00:00 0 [anon:dalvik-CompilerMetadata] +Name: [anon:dalvik-CompilerMetadata] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4be7000-f4be8000 r--p 00000000 fd:04 1946 /system/lib/libpackagelistparser.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4be8000-f4be9000 r-xp 00000000 fd:04 1946 /system/lib/libpackagelistparser.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4be9000-f4bea000 r--p 00000000 fd:04 1946 /system/lib/libpackagelistparser.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4bea000-f4bec000 r--s 00000000 fd:04 1221 /system/fonts/NotoSansTagalog-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4bec000-f4c0c000 r--s 00000000 00:11 7319 /dev/__properties__/u:object_r:radio_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4c0c000-f4c2c000 r--s 00000000 00:11 7254 /dev/__properties__/u:object_r:exported3_system_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4c2c000-f4c2d000 r--p 00000000 fd:04 1960 /system/lib/libprocinfo.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4c2d000-f4c2f000 r-xp 00000000 fd:04 1960 /system/lib/libprocinfo.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4c2f000-f4c31000 r--p 00001000 fd:04 1960 /system/lib/libprocinfo.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4c31000-f4c32000 r--s 00000000 fd:04 2337 /system/usr/hyphen-data/hyph-pt.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4c32000-f4c36000 r--s 00000000 fd:04 1236 /system/fonts/NotoSansThaana-Bold.ttf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4c36000-f4c56000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 19 kB +Shared_Clean: 0 kB +Shared_Dirty: 112 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 72 kB +Anonymous: 128 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4c56000-f4c60000 r--p 00000000 fd:04 1523 /system/lib/hardware.graphics.allocator@2.0.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 0 kB +Shared_Clean: 40 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 40 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4c60000-f4c6b000 r-xp 00009000 fd:04 1523 /system/lib/hardware.graphics.allocator@2.0.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4c6b000-f4c6d000 r--p 00013000 fd:04 1523 /system/lib/hardware.graphics.allocator@2.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4c6d000-f4c6e000 rw-p 00014000 fd:04 1523 /system/lib/hardware.graphics.allocator@2.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4c6e000-f4c89000 r--s 00000000 fd:04 1065 /system/fonts/DroidSansMono.ttf +Size: 108 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4c89000-f4ca6000 r--p 00000000 fd:04 1510 /system/lib/hardware.drm@1.1.so +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 84 kB +Pss: 4 kB +Shared_Clean: 84 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 84 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4ca6000-f4cd5000 r-xp 0001c000 fd:04 1510 /system/lib/hardware.drm@1.1.so +Size: 188 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4cd5000-f4cd9000 r--p 0004a000 fd:04 1510 /system/lib/hardware.drm@1.1.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4cd9000-f4cda000 rw-p 0004d000 fd:04 1510 /system/lib/hardware.drm@1.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4cda000-f4d1a000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 140 kB +Pss: 27 kB +Shared_Clean: 0 kB +Shared_Dirty: 116 kB +Private_Clean: 0 kB +Private_Dirty: 24 kB +Referenced: 48 kB +Anonymous: 140 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4d1a000-f4d1e000 r--p 00000000 fd:04 1783 /system/lib/libdebuggerd_client.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 16 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 16 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4d1e000-f4d23000 r-xp 00003000 fd:04 1783 /system/lib/libdebuggerd_client.so +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4d23000-f4d24000 r--p 00007000 fd:04 1783 /system/lib/libdebuggerd_client.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4d24000-f4d28000 r--s 00000000 fd:04 1237 /system/fonts/NotoSansThaana-Regular.ttf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4d28000-f4d39000 r--s 00000000 fd:04 1113 /system/fonts/NotoSansGeorgian-VF.ttf +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4d39000-f4d59000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 19 kB +Shared_Clean: 0 kB +Shared_Dirty: 112 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 80 kB +Anonymous: 128 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4d59000-f4d5a000 r--p 00000000 fd:04 1898 /system/lib/libmediandk_utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4d5a000-f4d5b000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f4d5b000-f4d5d000 r-xp 00001000 fd:04 1898 /system/lib/libmediandk_utils.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4d5d000-f4d5e000 r--p 00002000 fd:04 1898 /system/lib/libmediandk_utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4d5e000-f4d5f000 r--s 00000000 fd:04 2335 /system/usr/hyphen-data/hyph-pa.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4d5f000-f4d63000 r--s 00000000 fd:04 1255 /system/fonts/NotoSerifArmenian-Regular.otf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4d63000-f4d67000 r--s 00000000 fd:04 1074 /system/fonts/NotoSansArmenian-Bold.otf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4d67000-f4d6b000 r--s 00000000 fd:04 1075 /system/fonts/NotoSansArmenian-Medium.otf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4d6b000-f4d70000 r--s 00000000 fd:04 1240 /system/fonts/NotoSansThaiUI-Bold.ttf +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4d70000-f4dab000 r--s 00000000 07:c0 14 /apex/com.tzdata/etc/icu/icu_tzdata.dat +Size: 236 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms rr +f4dab000-f4dae000 r--p 00000000 fd:04 1996 /system/lib/libstagefright_codecbase.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 12 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4dae000-f4daf000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f4daf000-f4db3000 r-xp 00003000 fd:04 1996 /system/lib/libstagefright_codecbase.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4db3000-f4db4000 r--p 00006000 fd:04 1996 /system/lib/libstagefright_codecbase.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4db4000-f4db5000 r--s 00000000 fd:04 2333 /system/usr/hyphen-data/hyph-or.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4db5000-f4dbb000 r--s 00000000 fd:04 1241 /system/fonts/NotoSansThaiUI-Regular.ttf +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4dbb000-f4dc0000 r--s 00000000 fd:04 1286 /system/fonts/NotoSerifThai-Bold.ttf +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4dc0000-f4deb000 r--p 00000000 fd:04 1511 /system/lib/hardware.drm@1.2.so +Size: 172 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 84 kB +Pss: 4 kB +Shared_Clean: 84 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 84 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4deb000-f4e33000 r-xp 0002a000 fd:04 1511 /system/lib/hardware.drm@1.2.so +Size: 288 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4e33000-f4e39000 r--p 00071000 fd:04 1511 /system/lib/hardware.drm@1.2.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 24 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4e39000-f4e3a000 rw-p 00076000 fd:04 1511 /system/lib/hardware.drm@1.2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4e3a000-f4e3d000 r--s 00000000 fd:04 1202 /system/fonts/NotoSansRunic-Regular.ttf +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4e3d000-f4e42000 r--s 00000000 fd:04 1287 /system/fonts/NotoSerifThai-Regular.ttf +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4e42000-f4e47000 r--s 00000000 fd:04 1238 /system/fonts/NotoSansThai-Bold.ttf +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4e47000-f4e4d000 r--s 00000000 fd:04 1239 /system/fonts/NotoSansThai-Regular.ttf +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4e4d000-f4e52000 r--s 00000000 fd:04 1268 /system/fonts/NotoSerifHebrew-Bold.ttf +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4e52000-f4e58000 r--p 00000000 fd:04 2034 /system/lib/libziparchive.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 24 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 24 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4e58000-f4e60000 r-xp 00005000 fd:04 2034 /system/lib/libziparchive.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 0 kB +Shared_Clean: 32 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 32 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4e60000-f4e61000 r--p 0000c000 fd:04 2034 /system/lib/libziparchive.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4e61000-f4e62000 r--s 00000000 fd:04 2327 /system/usr/hyphen-data/hyph-mr.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4e62000-f4e67000 r--s 00000000 fd:04 1269 /system/fonts/NotoSerifHebrew-Regular.ttf +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4e67000-f4e6c000 r--s 00000000 fd:04 1128 /system/fonts/NotoSansHebrew-Bold.ttf +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4e6c000-f4e8c000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 32 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 32 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 32 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4e8c000-f4e8e000 r--p 00000000 fd:04 2040 /system/lib/server_configurable_flags.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4e8e000-f4e90000 r-xp 00001000 fd:04 2040 /system/lib/server_configurable_flags.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4e90000-f4e91000 r--p 00002000 fd:04 2040 /system/lib/server_configurable_flags.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4e91000-f4e93000 r--s 00000000 fd:04 1206 /system/fonts/NotoSansShavian-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4e93000-f4e98000 r--s 00000000 fd:04 1129 /system/fonts/NotoSansHebrew-Regular.ttf +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4e98000-f4ed8000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 212 kB +Pss: 72 kB +Shared_Clean: 0 kB +Shared_Dirty: 144 kB +Private_Clean: 0 kB +Private_Dirty: 68 kB +Referenced: 160 kB +Anonymous: 212 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4ed8000-f4edc000 r--p 00000000 fd:04 1873 /system/lib/liblog.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 16 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 16 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4edc000-f4ee9000 r-xp 00003000 fd:04 1873 /system/lib/liblog.so +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 52 kB +Pss: 0 kB +Shared_Clean: 52 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 52 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4ee9000-f4eea000 r--p 0000f000 fd:04 1873 /system/lib/liblog.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4eea000-f4eeb000 rw-p 0000f000 fd:04 1873 /system/lib/liblog.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4eeb000-f4eec000 r--s 00000000 fd:04 2323 /system/usr/hyphen-data/hyph-ml.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4eec000-f4eee000 r--s 00000000 fd:04 1201 /system/fonts/NotoSansRejang-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4eee000-f4eff000 r--s 00000000 fd:04 1060 /system/fonts/CutiveMono.ttf +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4eff000-f4f00000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f4f00000-f4f2f000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 188 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4f2f000-f4f30000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f4f30000-f4f33000 r--p 00000000 fd:04 1836 /system/lib/libhidlmemory.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 12 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4f33000-f4f35000 r-xp 00002000 fd:04 1836 /system/lib/libhidlmemory.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4f35000-f4f36000 r--p 00003000 fd:04 1836 /system/lib/libhidlmemory.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4f36000-f4f37000 rw-p 00003000 fd:04 1836 /system/lib/libhidlmemory.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4f37000-f4f38000 r--s 00000000 fd:04 2321 /system/usr/hyphen-data/hyph-la.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4f38000-f4f47000 r--s 00000000 fd:04 1059 /system/fonts/ComingSoon.ttf +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4f47000-f4f72000 r--p 00000000 fd:04 1705 /system/lib/libohosfw.so +Size: 172 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 140 kB +Pss: 5 kB +Shared_Clean: 140 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 140 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4f72000-f4fb9000 r-xp 0002a000 fd:04 1705 /system/lib/libohosfw.so +Size: 284 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 280 kB +Pss: 8 kB +Shared_Clean: 280 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 280 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4fb9000-f4fbc000 r--p 00070000 fd:04 1705 /system/lib/libohosfw.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4fbc000-f4fbd000 rw-p 00072000 fd:04 1705 /system/lib/libohosfw.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4fbd000-f4fc7000 r--s 00000000 fd:04 1058 /system/fonts/CarroisGothicSC-Regular.ttf +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4fc7000-f4fc8000 r--s 00000000 fd:04 2319 /system/usr/hyphen-data/hyph-kn.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f4fc8000-f4fcc000 r--p 00000000 fd:04 1316 /system/framework/hidl.base-V1.0-java.jar +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4fcc000-f4fe0000 r--p 00000000 fd:04 1887 /system/lib/libmedia_omx.so +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 2 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f4fe0000-f4fe1000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f4fe1000-f4ff9000 r-xp 00014000 fd:04 1887 /system/lib/libmedia_omx.so +Size: 96 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f4ff9000-f4ffd000 r--p 0002b000 fd:04 1887 /system/lib/libmedia_omx.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f4ffd000-f4ffe000 rw-p 0002e000 fd:04 1887 /system/lib/libmedia_omx.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f4ffe000-f5001000 r--s 00000000 fd:04 1194 /system/fonts/NotoSansOsage-Regular.ttf +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5001000-f5018000 r--s 0033c000 fd:04 1430 /system/framework/telephony-common.jar +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5018000-f5019000 r--p 00000000 fd:04 1531 /system/lib/hardware.graphics.common@1.2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5019000-f501a000 r-xp 00000000 fd:04 1531 /system/lib/hardware.graphics.common@1.2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f501a000-f501b000 r--p 00000000 fd:04 1531 /system/lib/hardware.graphics.common@1.2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f501b000-f501c000 r--s 00000000 fd:04 2317 /system/usr/hyphen-data/hyph-hy.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f501c000-f503a000 r--s 00201000 fd:04 1338 /system/framework/ext.jar +Size: 120 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f503a000-f5048000 r--p 00000000 07:d8 13 /apex/com.tethering/javalib/framework-tethering.jar +Size: 56 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 1 kB +Shared_Clean: 36 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 36 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5048000-f504b000 r--p 00000000 07:a8 97 /apex/com.art/lib/libnativehelper.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 12 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f504b000-f504e000 r-xp 00002000 07:a8 97 /apex/com.art/lib/libnativehelper.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 12 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f504e000-f5050000 r--p 00004000 07:a8 97 /apex/com.art/lib/libnativehelper.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5050000-f5051000 rw-p 00005000 07:a8 97 /apex/com.art/lib/libnativehelper.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5051000-f5055000 r--s 00000000 fd:04 1076 /system/fonts/NotoSansArmenian-Regular.otf +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5055000-f5056000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5056000-f505a000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f505a000-f505b000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f505b000-f5089000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 184 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5089000-f508a000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f508a000-f509c000 r--p 00000000 fd:04 1913 /system/lib/libnblog.so +Size: 72 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 2 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f509c000-f50bc000 r-xp 00011000 fd:04 1913 /system/lib/libnblog.so +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f50bc000-f50bd000 r--p 00030000 fd:04 1913 /system/lib/libnblog.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f50bd000-f50be000 rw-p 00030000 fd:04 1913 /system/lib/libnblog.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f50be000-f50c0000 r--s 00000000 fd:04 1200 /system/fonts/NotoSansPhoenician-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f50c0000-f50c1000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +f50c1000-f50c5000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f50c5000-f50d8000 r--p 00000000 07:60 17 /apex/com.os.statsd/javalib/framework-statsd.jar +Size: 76 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 76 kB +Pss: 2 kB +Shared_Clean: 76 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 76 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f50d8000-f50d9000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f50d9000-f50f3000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 104 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f50f3000-f50f4000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f50f4000-f510b000 r--p 00000000 fd:04 1526 /system/lib/hardware.graphics.bufferqueue@1.0.so +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 88 kB +Pss: 4 kB +Shared_Clean: 88 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 88 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f510b000-f5136000 r-xp 00016000 fd:04 1526 /system/lib/hardware.graphics.bufferqueue@1.0.so +Size: 172 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5136000-f5139000 r--p 00040000 fd:04 1526 /system/lib/hardware.graphics.bufferqueue@1.0.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5139000-f513a000 rw-p 00042000 fd:04 1526 /system/lib/hardware.graphics.bufferqueue@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f513a000-f513c000 r--s 00000000 fd:04 1195 /system/fonts/NotoSansOsmanya-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f513c000-f513d000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +f513d000-f5141000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5146000-f5147000 r--p 00000000 fd:04 1679 /system/lib/libETC1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5147000-f514a000 r-xp 00000000 fd:04 1679 /system/lib/libETC1.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f514a000-f514b000 r--p 00002000 fd:04 1679 /system/lib/libETC1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f514b000-f5150000 rw-p 00000000 00:00 0 [anon:dalvik-large object space allocation] +Name: [anon:dalvik-large object space allocation] +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5150000-f5151000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +f5151000-f5155000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5155000-f5160000 r--p 00000000 07:38 16 /apex/com.mediaprovider/javalib/framework-mediaprovider.jar +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 44 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 44 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5160000-f5161000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f5161000-f5184000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 140 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 140 kB +Pss: 3 kB +Shared_Clean: 0 kB +Shared_Dirty: 140 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 140 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5184000-f5185000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f5185000-f518d000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f518d000-f518e000 r--p 00000000 07:50 18 /apex/com.runtime/lib/libdl.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f518e000-f518f000 r-xp 00000000 07:50 18 /apex/com.runtime/lib/libdl.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f518f000-f5190000 r--p 00000000 07:50 18 /apex/com.runtime/lib/libdl.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5190000-f5191000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f5191000-f5192000 r--p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5192000-f5193000 r--s 00000000 fd:04 2313 /system/usr/hyphen-data/hyph-hr.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5193000-f5195000 r--s 00000000 fd:04 1189 /system/fonts/NotoSansOldTurkic-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5195000-f51d1000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 240 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f51d1000-f51e4000 r--p 00000000 fd:04 1994 /system/lib/libstagefright_bufferpool@2.0.1.so +Size: 76 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f51e4000-f51fb000 r-xp 00012000 fd:04 1994 /system/lib/libstagefright_bufferpool@2.0.1.so +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f51fb000-f51fc000 r--p 00028000 fd:04 1994 /system/lib/libstagefright_bufferpool@2.0.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f51fc000-f51fd000 rw-p 00028000 fd:04 1994 /system/lib/libstagefright_bufferpool@2.0.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f51fd000-f51fe000 r--s 00000000 fd:04 2311 /system/usr/hyphen-data/hyph-hi.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f51fe000-f5202000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5202000-f5203000 r--p 00000000 fd:04 1504 /system/lib/hardware.configstore-utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5203000-f5205000 r-xp 00000000 fd:04 1504 /system/lib/hardware.configstore-utils.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5205000-f5206000 r--p 00001000 fd:04 1504 /system/lib/hardware.configstore-utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5206000-f526a000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 400 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f526a000-f5281000 r--p 00000000 fd:04 2030 /system/lib/libwilhelm.so +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5281000-f52a7000 r-xp 00016000 fd:04 2030 /system/lib/libwilhelm.so +Size: 152 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f52a7000-f52aa000 r--p 0003b000 fd:04 2030 /system/lib/libwilhelm.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f52aa000-f52ab000 rw-p 0003d000 fd:04 2030 /system/lib/libwilhelm.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f52ab000-f52ac000 r--s 00000000 fd:04 2309 /system/usr/hyphen-data/hyph-gu.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f52ac000-f52ec000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f52ec000-f52f0000 r--p 00000000 fd:04 1830 /system/lib/libheif.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 16 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 16 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f52f0000-f52f3000 r-xp 00003000 fd:04 1830 /system/lib/libheif.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f52f3000-f52f5000 r--p 00005000 fd:04 1830 /system/lib/libheif.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f52f5000-f532d000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 224 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f532d000-f532e000 r--p 00000000 fd:04 1834 /system/lib/libhidlallocatorutils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f532e000-f532f000 r-xp 00000000 fd:04 1834 /system/lib/libhidlallocatorutils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f532f000-f5330000 r--p 00000000 fd:04 1834 /system/lib/libhidlallocatorutils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5330000-f5331000 r--s 00000000 fd:04 2303 /system/usr/hyphen-data/hyph-eu.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5331000-f5333000 r--s 00000000 fd:04 1188 /system/fonts/NotoSansOldSouthArabian-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5333000-f535b000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 160 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f535b000-f5383000 r--p 00000000 fd:04 1979 /system/lib/libsfplugin_ccodec.so +Size: 160 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 68 kB +Pss: 2 kB +Shared_Clean: 68 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 68 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5383000-f5384000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f5384000-f53fa000 r-xp 00028000 fd:04 1979 /system/lib/libsfplugin_ccodec.so +Size: 472 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f53fa000-f53fe000 r--p 0009d000 fd:04 1979 /system/lib/libsfplugin_ccodec.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f53fe000-f53ff000 rw-p 000a0000 fd:04 1979 /system/lib/libsfplugin_ccodec.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f53ff000-f541b000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f541b000-f541d000 r--p 00000000 fd:04 1888 /system/lib/libmedia_omx_client.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f541d000-f541e000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f541e000-f5421000 r-xp 00002000 fd:04 1888 /system/lib/libmedia_omx_client.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5421000-f5422000 r--p 00004000 fd:04 1888 /system/lib/libmedia_omx_client.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5422000-f544a000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 160 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f544a000-f5456000 r--p 00000000 fd:04 1903 /system/lib/libmemunreachable.so +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 44 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 44 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5456000-f547c000 r-xp 0000b000 fd:04 1903 /system/lib/libmemunreachable.so +Size: 152 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f547c000-f547e000 r--p 00030000 fd:04 1903 /system/lib/libmemunreachable.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f547e000-f547f000 rw-p 00031000 fd:04 1903 /system/lib/libmemunreachable.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f547f000-f5481000 r--s 00000000 fd:04 1184 /system/fonts/NotoSansOldItalic-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5481000-f54b9000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 224 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f54b9000-f54ba000 r--p 00000000 fd:04 1556 /system/lib/hardware.media@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f54ba000-f54bb000 r-xp 00000000 fd:04 1556 /system/lib/hardware.media@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f54bb000-f54bc000 r--p 00000000 fd:04 1556 /system/lib/hardware.media@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f54bc000-f54bd000 r--s 00000000 fd:04 2281 /system/usr/hyphen-data/hyph-bn.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f54bd000-f54e1000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 144 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f54e1000-f5504000 r--p 00000000 fd:04 2016 /system/lib/libui.so +Size: 140 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 92 kB +Pss: 2 kB +Shared_Clean: 92 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 92 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5504000-f552e000 r-xp 00022000 fd:04 2016 /system/lib/libui.so +Size: 168 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f552e000-f5530000 r--p 0004b000 fd:04 2016 /system/lib/libui.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5530000-f5531000 rw-p 0004c000 fd:04 2016 /system/lib/libui.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5531000-f5533000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5533000-f5547000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5547000-f5548000 r--p 00000000 fd:04 1759 /system/lib/libcgrouprc.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5548000-f554a000 r-xp 00000000 fd:04 1759 /system/lib/libcgrouprc.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f554a000-f554b000 r--p 00001000 fd:04 1759 /system/lib/libcgrouprc.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f554b000-f554c000 rw-p 00001000 fd:04 1759 /system/lib/libcgrouprc.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f554c000-f5594000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 288 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5594000-f55a4000 r--p 00000000 fd:04 1897 /system/lib/libmediandk.so +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f55a4000-f55b8000 r-xp 0000f000 fd:04 1897 /system/lib/libmediandk.so +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f55b8000-f55ba000 r--p 00022000 fd:04 1897 /system/lib/libmediandk.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f55ba000-f55bb000 rw-p 00023000 fd:04 1897 /system/lib/libmediandk.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f55bb000-f55bc000 r--s 00000000 fd:04 2279 /system/usr/hyphen-data/hyph-bg.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f55bc000-f55be000 r--s 00000000 fd:04 1183 /system/fonts/NotoSansOlChiki-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f55be000-f55ce000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f55ce000-f55dc000 r--p 00000000 fd:04 2019 /system/lib/libutils.so +Size: 56 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 48 kB +Pss: 0 kB +Shared_Clean: 48 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 48 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f55dc000-f55eb000 r-xp 0000d000 fd:04 2019 /system/lib/libutils.so +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 0 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f55eb000-f55ec000 r--p 0001b000 fd:04 2019 /system/lib/libutils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f55ec000-f55ed000 rw-p 0001b000 fd:04 2019 /system/lib/libutils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f55ed000-f55ef000 r--s 00000000 fd:04 1182 /system/fonts/NotoSansOgham-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f55ef000-f560f000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f560f000-f5613000 r--p 00000000 fd:04 1745 /system/lib/libbpf_ohos.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 16 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 16 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5613000-f561e000 r-xp 00003000 fd:04 1745 /system/lib/libbpf_ohos.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f561e000-f561f000 r--p 0000d000 fd:04 1745 /system/lib/libbpf_ohos.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f561f000-f5620000 rw-p 0000d000 fd:04 1745 /system/lib/libbpf_ohos.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5620000-f5622000 r--s 00000000 fd:04 1155 /system/fonts/NotoSansLydian-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5622000-f564e000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 176 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f564e000-f5659000 r--p 00000000 fd:04 1730 /system/lib/libbacktrace.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 0 kB +Shared_Clean: 36 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 36 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5659000-f5675000 r-xp 0000a000 fd:04 1730 /system/lib/libbacktrace.so +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5675000-f5678000 r--p 00025000 fd:04 1730 /system/lib/libbacktrace.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5678000-f5679000 rw-p 00027000 fd:04 1730 /system/lib/libbacktrace.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5679000-f567a000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f567a000-f567c000 r--s 00000000 fd:04 1154 /system/fonts/NotoSansLycian-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f567c000-f5684000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5684000-f568a000 r--p 00000000 fd:04 2005 /system/lib/libstatslog.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 24 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 24 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f568a000-f5694000 r-xp 00005000 fd:04 2005 /system/lib/libstatslog.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5694000-f5695000 r--p 0000e000 fd:04 2005 /system/lib/libstatslog.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5695000-f5696000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5696000-f56ca000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 208 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f56ca000-f56db000 r--p 00000000 fd:04 1900 /system/lib/libmediautils.so +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f56db000-f56fc000 r-xp 00010000 fd:04 1900 /system/lib/libmediautils.so +Size: 132 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f56fc000-f56fe000 r--p 00030000 fd:04 1900 /system/lib/libmediautils.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f56fe000-f56ff000 rw-p 00031000 fd:04 1900 /system/lib/libmediautils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f56ff000-f5703000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5703000-f5729000 r--p 00000000 fd:04 2017 /system/lib/libunwindstack.so +Size: 152 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 108 kB +Pss: 3 kB +Shared_Clean: 108 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 108 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5729000-f577a000 r-xp 00025000 fd:04 2017 /system/lib/libunwindstack.so +Size: 324 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f577a000-f577e000 r--p 00075000 fd:04 2017 /system/lib/libunwindstack.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 16 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f577e000-f577f000 rw-p 00078000 fd:04 2017 /system/lib/libunwindstack.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f577f000-f5781000 r--s 00000000 fd:04 1153 /system/fonts/NotoSansLisu-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5781000-f57a5000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 144 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f57a5000-f57ab000 r--p 00000000 fd:04 1833 /system/lib/libhidl-gen-utils.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 24 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 24 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f57ab000-f57b3000 r-xp 00005000 fd:04 1833 /system/lib/libhidl-gen-utils.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f57b3000-f57b4000 r--p 0000c000 fd:04 1833 /system/lib/libhidl-gen-utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f57b4000-f57c4000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f57c4000-f57ca000 r--p 00000000 fd:04 1953 /system/lib/libpiex.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f57ca000-f57df000 r-xp 00005000 fd:04 1953 /system/lib/libpiex.so +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f57df000-f57e1000 r--p 00019000 fd:04 1953 /system/lib/libpiex.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f57e1000-f582d000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 304 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f582d000-f5832000 r--p 00000000 fd:04 1681 /system/lib/libGLESv1_CM.so +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5832000-f5836000 r-xp 00004000 fd:04 1681 /system/lib/libGLESv1_CM.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5836000-f5837000 r--p 00007000 fd:04 1681 /system/lib/libGLESv1_CM.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5837000-f583a000 r--s 00000000 fd:04 1150 /system/fonts/NotoSansLimbu-Regular.ttf +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f583a000-f5872000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 224 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5872000-f5874000 r--p 00000000 fd:04 2002 /system/lib/libstagefright_omx_utils.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5874000-f5875000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f5875000-f5878000 r-xp 00002000 fd:04 2002 /system/lib/libstagefright_omx_utils.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5878000-f5879000 r--p 00004000 fd:04 2002 /system/lib/libstagefright_omx_utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5879000-f587a000 rw-p 00004000 fd:04 2002 /system/lib/libstagefright_omx_utils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f587a000-f587c000 r--s 00000000 fd:04 1139 /system/fonts/NotoSansKayahLi-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f587c000-f5890000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5890000-f5896000 r--p 00000000 fd:04 1939 /system/lib/libnetdutils.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 24 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 24 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5896000-f5897000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f5897000-f58a4000 r-xp 00006000 fd:04 1939 /system/lib/libnetdutils.so +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f58a4000-f58a5000 r--p 00012000 fd:04 1939 /system/lib/libnetdutils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f58a5000-f58a6000 rw-p 00012000 fd:04 1939 /system/lib/libnetdutils.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f58a6000-f58a8000 r--s 00000000 fd:04 1132 /system/fonts/NotoSansInscriptionalParthian-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f58a8000-f58c4000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f58c4000-f590a000 r--p 00000000 fd:04 1734 /system/lib/libbinder.so +Size: 280 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 192 kB +Pss: 3 kB +Shared_Clean: 192 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 192 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f590a000-f595c000 r-xp 00045000 fd:04 1734 /system/lib/libbinder.so +Size: 328 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 264 kB +Pss: 3 kB +Shared_Clean: 264 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 264 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f595c000-f5967000 r--p 00096000 fd:04 1734 /system/lib/libbinder.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 44 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 24 kB +Anonymous: 44 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5967000-f5968000 rw-p 000a0000 fd:04 1734 /system/lib/libbinder.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5968000-f5980000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 96 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5980000-f5990000 r--p 00000000 fd:04 1731 /system/lib/libbase.so +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 0 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5990000-f59d6000 r-xp 0000f000 fd:04 1731 /system/lib/libbase.so +Size: 280 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 88 kB +Pss: 1 kB +Shared_Clean: 88 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 88 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f59d6000-f59d8000 r--p 00054000 fd:04 1731 /system/lib/libbase.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f59d8000-f59d9000 rw-p 00055000 fd:04 1731 /system/lib/libbase.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f59d9000-f59da000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f59da000-f59dc000 r--s 00000000 fd:04 1131 /system/fonts/NotoSansInscriptionalPahlavi-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f59dc000-f5a0c000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 192 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5a0c000-f5a0d000 r--p 00000000 fd:04 1910 /system/lib/libnativeloader_lazy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5a0d000-f5a0e000 r-xp 00000000 fd:04 1910 /system/lib/libnativeloader_lazy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5a0e000-f5a0f000 r--p 00000000 fd:04 1910 /system/lib/libnativeloader_lazy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5a0f000-f5a10000 rw-p 00000000 fd:04 1910 /system/lib/libnativeloader_lazy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5a11000-f5a13000 r--s 00000000 fd:04 1130 /system/fonts/NotoSansImperialAramaic-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5a13000-f5a77000 rw-p 00000000 00:00 0 [anon:linker_alloc] +Name: [anon:linker_alloc] +Size: 400 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 20 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 20 kB +Referenced: 0 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5a77000-f5a78000 r--p 00000000 fd:04 1853 /system/lib/libion.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5a78000-f5a7a000 r-xp 00000000 fd:04 1853 /system/lib/libion.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5a7a000-f5a7b000 r--p 00001000 fd:04 1853 /system/lib/libion.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5a7b000-f5a7c000 rw-p 00001000 fd:04 1853 /system/lib/libion.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5a7c000-f5aa8000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 176 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5aa8000-f5aaa000 r--p 00000000 07:a8 96 /apex/com.art/lib/libnativebridge.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5aaa000-f5aac000 r-xp 00001000 07:a8 96 /apex/com.art/lib/libnativebridge.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5aac000-f5aad000 r--p 00002000 07:a8 96 /apex/com.art/lib/libnativebridge.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5aad000-f5aae000 rw-p 00002000 07:a8 96 /apex/com.art/lib/libnativebridge.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5aaf000-f5ac3000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5ac3000-f5ad9000 r--p 00000000 fd:04 1552 /system/lib/hardware.media.bufferpool@2.0.so +Size: 88 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5ad9000-f5afc000 r-xp 00015000 fd:04 1552 /system/lib/hardware.media.bufferpool@2.0.so +Size: 140 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5afc000-f5aff000 r--p 00037000 fd:04 1552 /system/lib/hardware.media.bufferpool@2.0.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5aff000-f5b00000 rw-p 00039000 fd:04 1552 /system/lib/hardware.media.bufferpool@2.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5b00000-f5b04000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5b04000-f5b0b000 r--p 00000000 fd:04 1879 /system/lib/liblzma.so +Size: 28 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 0 kB +Shared_Clean: 28 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 28 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5b0b000-f5b2e000 r-xp 00006000 fd:04 1879 /system/lib/liblzma.so +Size: 140 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5b2e000-f5b2f000 r--p 00028000 fd:04 1879 /system/lib/liblzma.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5b2f000-f5b30000 rw-p 00028000 fd:04 1879 /system/lib/liblzma.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5b30000-f5b36000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5b36000-f5b37000 r--s 00000000 fd:05 376838 /data/resource-cache/product@overlay@EmulatorConfigOverlay@idmap +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5b37000-f5b57000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5b57000-f5b5d000 r--p 00000000 fd:04 2003 /system/lib/libstagefright_xmlparser.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5b5d000-f5b5e000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f5b5e000-f5b6e000 r-xp 00006000 fd:04 2003 /system/lib/libstagefright_xmlparser.so +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5b6e000-f5b6f000 r--p 00015000 fd:04 2003 /system/lib/libstagefright_xmlparser.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5b6f000-f5b70000 rw-p 00015000 fd:04 2003 /system/lib/libstagefright_xmlparser.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5b71000-f5bad000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 240 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5bad000-f5bb3000 r--p 00000000 fd:04 1883 /system/lib/libmedia_codeclist.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 24 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 24 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5bb3000-f5bb4000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f5bb4000-f5bbd000 r-xp 00006000 fd:04 1883 /system/lib/libmedia_codeclist.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5bbd000-f5bbe000 r--p 0000e000 fd:04 1883 /system/lib/libmedia_codeclist.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5bbe000-f5bbf000 rw-p 0000e000 fd:04 1883 /system/lib/libmedia_codeclist.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5bc0000-f5bc2000 r--s 00000000 fd:04 1126 /system/fonts/NotoSansHanunoo-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5bc2000-f5be2000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5be2000-f5be3000 r--p 00000000 fd:04 1503 /system/lib/hardware.common-V1-ndk_platform.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5be3000-f5be5000 r-xp 00000000 fd:04 1503 /system/lib/hardware.common-V1-ndk_platform.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5be5000-f5be6000 r--p 00001000 fd:04 1503 /system/lib/hardware.common-V1-ndk_platform.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5be6000-f5be7000 rw-p 00001000 fd:04 1503 /system/lib/hardware.common-V1-ndk_platform.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5be7000-f5bea000 r--s 00000000 fd:04 1110 /system/fonts/NotoSansElbasan-Regular.otf +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5bea000-f5c32000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 288 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5c32000-f5c35000 r--p 00000000 fd:04 1744 /system/lib/libbpf.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 12 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5c35000-f5c3b000 r-xp 00002000 fd:04 1744 /system/lib/libbpf.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5c3b000-f5c3c000 r--p 00007000 fd:04 1744 /system/lib/libbpf.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5c3c000-f5c3d000 r--s 00000000 fd:05 376837 /data/resource-cache/product@overlay@framework-res__auto_generated_rro_product@idmap +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5c3d000-f5c41000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5c41000-f5c7d000 r--p 00000000 fd:04 1857 /system/lib/libjpeg.so +Size: 240 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 2 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5c7d000-f5cdd000 r-xp 0003b000 fd:04 1857 /system/lib/libjpeg.so +Size: 384 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5cdd000-f5cde000 r--p 0009a000 fd:04 1857 /system/lib/libjpeg.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5cde000-f5cdf000 rw-p 0009a000 fd:04 1857 /system/lib/libjpeg.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5cdf000-f5ce1000 r--s 00000000 fd:04 1115 /system/fonts/NotoSansGothic-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5ce1000-f5d1d000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 240 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5d1d000-f5d2c000 r--p 00000000 fd:04 1693 /system/lib/libSurfaceFlingerProp.so +Size: 60 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 1 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5d2c000-f5d39000 r-xp 0000e000 fd:04 1693 /system/lib/libSurfaceFlingerProp.so +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5d39000-f5d3a000 r--p 0001a000 fd:04 1693 /system/lib/libSurfaceFlingerProp.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5d3a000-f5d3b000 rw-p 0001a000 fd:04 1693 /system/lib/libSurfaceFlingerProp.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5d3b000-f5d3e000 r--s 00000000 fd:04 1102 /system/fonts/NotoSansDeseret-Regular.ttf +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5d3e000-f5d6e000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 192 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5d6e000-f5d8b000 r--p 00000000 07:60 21 /apex/com.os.statsd/lib/libstatspull.so +Size: 116 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 2 kB +Shared_Clean: 28 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 28 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5d8b000-f5dac000 r-xp 0001c000 07:60 21 /apex/com.os.statsd/lib/libstatspull.so +Size: 132 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5dac000-f5daf000 r--p 0003c000 07:60 21 /apex/com.os.statsd/lib/libstatspull.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5daf000-f5db0000 rw-p 0003e000 07:60 21 /apex/com.os.statsd/lib/libstatspull.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5db0000-f5db2000 r--s 00000000 fd:04 1101 /system/fonts/NotoSansCypriot-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5db2000-f5dea000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 224 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5dea000-f5ded000 r--p 00000000 fd:04 2010 /system/lib/libtimeinstate.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 12 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5ded000-f5df7000 r-xp 00002000 fd:04 2010 /system/lib/libtimeinstate.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5df7000-f5df8000 r--p 0000b000 fd:04 2010 /system/lib/libtimeinstate.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5df8000-f5df9000 rw-p 0000b000 fd:04 2010 /system/lib/libtimeinstate.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5dfa000-f5dfc000 r--s 00000000 fd:04 1094 /system/fonts/NotoSansCarian-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5dfc000-f5e00000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5e00000-f5e25000 r--p 00000000 fd:04 1509 /system/lib/hardware.drm@1.0.so +Size: 148 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 112 kB +Pss: 6 kB +Shared_Clean: 112 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 112 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5e25000-f5e79000 r-xp 00024000 fd:04 1509 /system/lib/hardware.drm@1.0.so +Size: 336 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5e79000-f5e7e000 r--p 00077000 fd:04 1509 /system/lib/hardware.drm@1.0.so +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 20 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 20 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5e7e000-f5e7f000 rw-p 0007b000 fd:04 1509 /system/lib/hardware.drm@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5e7f000-f5e80000 r--s 00000000 fd:05 376836 /data/resource-cache/product@overlay@PixelConfigOverlayCommon@idmap +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5e80000-f5e98000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 96 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5e98000-f5ea1000 r--p 00000000 fd:04 1771 /system/lib/libcodec2_hidl_client@1.0.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 1 kB +Shared_Clean: 36 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 36 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5ea1000-f5eb3000 r-xp 00008000 fd:04 1771 /system/lib/libcodec2_hidl_client@1.0.so +Size: 72 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5eb3000-f5eb4000 r--p 00019000 fd:04 1771 /system/lib/libcodec2_hidl_client@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5eb5000-f5eb7000 r--s 00000000 fd:04 1091 /system/fonts/NotoSansBuhid-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5eb7000-f5ebb000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5ebb000-f5efb000 rw-p 00000000 00:00 0 [anon:dalvik-mark stack] +Name: [anon:dalvik-mark stack] +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5efb000-f5efd000 r--p 00000000 fd:04 1814 /system/lib/libfmq.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5efd000-f5eff000 r-xp 00001000 fd:04 1814 /system/lib/libfmq.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5eff000-f5f00000 r--p 00002000 fd:04 1814 /system/lib/libfmq.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5f00000-f5f03000 r--s 00000000 fd:04 1077 /system/fonts/NotoSansAvestan-Regular.ttf +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5f03000-f5f11000 r--p 00000000 fd:04 1954 /system/lib/libpng.so +Size: 56 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 56 kB +Pss: 1 kB +Shared_Clean: 56 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 56 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5f11000-f5f3a000 r-xp 0000d000 fd:04 1954 /system/lib/libpng.so +Size: 164 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5f3a000-f5f3b000 r--p 00035000 fd:04 1954 /system/lib/libpng.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5f3b000-f5f3e000 r--s 00000000 fd:04 1254 /system/fonts/NotoSerifArmenian-Bold.otf +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5f3e000-f5f46000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5f46000-f5f4b000 r--p 00000000 fd:04 1706 /system/lib/libappfuse.so +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 20 kB +Pss: 0 kB +Shared_Clean: 20 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 20 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5f4b000-f5f53000 r-xp 00004000 fd:04 1706 /system/lib/libappfuse.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5f53000-f5f54000 r--p 0000b000 fd:04 1706 /system/lib/libappfuse.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5f54000-f5f55000 rw-p 0000b000 fd:04 1706 /system/lib/libappfuse.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5f56000-f5f86000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 192 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5f86000-f5f87000 r--p 00000000 07:50 19 /apex/com.runtime/lib/libdl_ohos.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5f87000-f5f88000 r-xp 00000000 07:50 19 /apex/com.runtime/lib/libdl_ohos.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5f88000-f5f89000 r--p 00000000 07:50 19 /apex/com.runtime/lib/libdl_ohos.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5f89000-f5f8a000 r--s 00000000 fd:05 376835 /data/resource-cache/product@overlay@WebViewOverlay@idmap +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f5f8a000-f5fa2000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 96 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f5fa2000-f5fe7000 r--p 00000000 fd:04 1338 /system/framework/ext.jar +Size: 276 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 3 kB +Shared_Clean: 128 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 128 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5fe7000-f5fe8000 r--p 00000000 fd:04 1769 /system/lib/libcodec2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f5fe8000-f5fe9000 r-xp 00000000 fd:04 1769 /system/lib/libcodec2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f5fe9000-f5fea000 r--p 00000000 fd:04 1769 /system/lib/libcodec2.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f5feb000-f6013000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 160 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6013000-f6014000 r--p 00000000 fd:04 1772 /system/lib/libcodec2_hidl_client@1.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f6014000-f6015000 r-xp 00000000 fd:04 1772 /system/lib/libcodec2_hidl_client@1.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f6015000-f6016000 r--p 00000000 fd:04 1772 /system/lib/libcodec2_hidl_client@1.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6016000-f604e000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 224 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f604e000-f605b000 r--p 00000000 fd:04 1905 /system/lib/libminikin.so +Size: 52 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 48 kB +Pss: 1 kB +Shared_Clean: 48 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 48 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f605b000-f607b000 r-xp 0000c000 fd:04 1905 /system/lib/libminikin.so +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f607b000-f607d000 r--p 0002b000 fd:04 1905 /system/lib/libminikin.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f607d000-f607e000 rw-p 0002c000 fd:04 1905 /system/lib/libminikin.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f607e000-f6080000 r--s 00000000 fd:04 1090 /system/fonts/NotoSansBuginese-Regular.ttf +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6080000-f6084000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6084000-f608f000 r--p 00000000 fd:04 1844 /system/lib/libincfs.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 44 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 44 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f608f000-f60a5000 r-xp 0000a000 fd:04 1844 /system/lib/libincfs.so +Size: 88 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f60a5000-f60a6000 r--p 0001f000 fd:04 1844 /system/lib/libincfs.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f60a6000-f60a7000 rw-p 0001f000 fd:04 1844 /system/lib/libincfs.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f60a7000-f60d7000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 192 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f60d7000-f60e2000 r--p 00000000 fd:04 1974 /system/lib/libsensor.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 44 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 44 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f60e2000-f60eb000 r-xp 0000a000 fd:04 1974 /system/lib/libsensor.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f60eb000-f60ed000 r--p 00012000 fd:04 1974 /system/lib/libsensor.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f60ed000-f60ee000 rw-p 00013000 fd:04 1974 /system/lib/libsensor.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f60ee000-f6122000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 208 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6122000-f6124000 r--p 00000000 fd:04 2018 /system/lib/libusbhost.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f6124000-f6127000 r-xp 00001000 fd:04 2018 /system/lib/libusbhost.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f6127000-f6128000 r--p 00003000 fd:04 2018 /system/lib/libusbhost.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6128000-f6129000 r--s 00000000 fd:05 376834 /data/resource-cache/product@overlay@ConfigOverlay@idmap +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6129000-f612a000 r--s 0000d000 07:d8 13 /apex/com.tethering/javalib/framework-tethering.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f612a000-f612b000 r--s 000a5000 07:a0 22 /apex/com.wifi/javalib/framework-wifi.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f612b000-f6147000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 112 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6147000-f6148000 r--p 00000000 fd:04 2024 /system/lib/libvndksupport.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f6148000-f6149000 r-xp 00000000 fd:04 2024 /system/lib/libvndksupport.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f6149000-f614a000 r--p 00000000 fd:04 2024 /system/lib/libvndksupport.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f614a000-f614b000 rw-p 00000000 fd:04 2024 /system/lib/libvndksupport.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f614b000-f61ae000 r--p 00000000 07:a8 41 /apex/com.art/javalib/okhttp.jar +Size: 396 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 3 kB +Shared_Clean: 128 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 128 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f61ae000-f61c4000 r--p 00000000 fd:04 1958 /system/lib/libprocessgroup.so +Size: 88 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 0 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f61c4000-f61ef000 r-xp 00015000 fd:04 1958 /system/lib/libprocessgroup.so +Size: 172 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 164 kB +Pss: 3 kB +Shared_Clean: 164 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 164 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f61ef000-f61f1000 r--p 0003f000 fd:04 1958 /system/lib/libprocessgroup.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f61f1000-f61f2000 rw-p 00040000 fd:04 1958 /system/lib/libprocessgroup.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f61f2000-f61f3000 r--s 00000000 07:58 18 /apex/com.sdkext/javalib/framework-sdkextensions.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f61f3000-f61f4000 r--s 00000000 07:c8 13 /apex/com.permission/javalib/framework-permission.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f61f4000-f61f5000 r--s 00012000 07:60 17 /apex/com.os.statsd/javalib/framework-statsd.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f61f5000-f6201000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6201000-f6221000 rw-p 00000000 00:00 0 [anon:dalvik-large marked objects] +Name: [anon:dalvik-large marked objects] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 12 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6221000-f6222000 r--p 00000000 fd:04 1999 /system/lib/libstagefright_http_support.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f6222000-f6223000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f6223000-f6225000 r-xp 00001000 fd:04 1999 /system/lib/libstagefright_http_support.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f6225000-f6226000 r--p 00002000 fd:04 1999 /system/lib/libstagefright_http_support.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6226000-f6227000 r--s 0000a000 07:38 16 /apex/com.mediaprovider/javalib/framework-mediaprovider.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6227000-f6228000 r--s 00066000 07:98 18 /apex/com.media/javalib/updatable-media.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6228000-f6229000 r--s 0006b000 07:80 17 /apex/com.conscrypt/javalib/conscrypt.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6229000-f6269000 r--p 00000000 fd:04 1343 /system/framework/ims-common.jar +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 128 kB +Pss: 3 kB +Shared_Clean: 128 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 128 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6269000-f626d000 r--p 00000000 fd:04 1901 /system/lib/libmeminfo.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 16 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 16 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f626d000-f6276000 r-xp 00003000 fd:04 1901 /system/lib/libmeminfo.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f6276000-f6277000 r--p 0000b000 fd:04 1901 /system/lib/libmeminfo.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6277000-f6278000 rw-p 0000b000 fd:04 1901 /system/lib/libmeminfo.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6278000-f6284000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6284000-f6285000 r--p 00000000 fd:04 1703 /system/lib/libohos_runtime_lazy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f6285000-f6286000 r-xp 00000000 fd:04 1703 /system/lib/libohos_runtime_lazy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f6286000-f6287000 r--p 00000000 fd:04 1703 /system/lib/libohos_runtime_lazy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6287000-f6288000 rw-p 00000000 fd:04 1703 /system/lib/libohos_runtime_lazy.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6288000-f628a000 r--s 01c74000 fd:04 1341 /system/framework/framework.jar +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f628a000-f62a2000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 96 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f62a2000-f62c2000 rw-p 00000000 00:00 0 [anon:dalvik-large live objects] +Name: [anon:dalvik-large live objects] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f62c2000-f62d3000 r--p 00000000 fd:04 1512 /system/lib/hardware.drm@1.3.so +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f62d3000-f62e8000 r-xp 00010000 fd:04 1512 /system/lib/hardware.drm@1.3.so +Size: 84 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f62e8000-f62eb000 r--p 00024000 fd:04 1512 /system/lib/hardware.drm@1.3.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f62eb000-f62ec000 rw-p 00026000 fd:04 1512 /system/lib/hardware.drm@1.3.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f62ec000-f632c000 rw-p 00000000 00:00 0 +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f632c000-f632d000 r--p 00000000 fd:04 1530 /system/lib/hardware.graphics.common@1.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f632d000-f632e000 r-xp 00000000 fd:04 1530 /system/lib/hardware.graphics.common@1.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f632e000-f632f000 r--p 00000000 fd:04 1530 /system/lib/hardware.graphics.common@1.1.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f632f000-f6343000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6343000-f6353000 r--p 00000000 fd:04 1683 /system/lib/libGLESv3.so +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 60 kB +Pss: 2 kB +Shared_Clean: 60 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 60 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f6353000-f635b000 r-xp 0000f000 fd:04 1683 /system/lib/libGLESv3.so +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f635b000-f635c000 r--p 00016000 fd:04 1683 /system/lib/libGLESv3.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f635c000-f635d000 r--s 00000000 fd:04 1339 /system/framework/framework-atb-backward-compatibility.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f635d000-f635e000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f635e000-f6383000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 148 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 148 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 144 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 56 kB +Anonymous: 148 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6383000-f6384000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f6384000-f63d8000 r--p 00000000 fd:04 1776 /system/lib/libcrypto.so +Size: 336 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 108 kB +Pss: 3 kB +Shared_Clean: 108 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 108 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f63d8000-f64b4000 r-xp 00053000 fd:04 1776 /system/lib/libcrypto.so +Size: 880 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 144 kB +Pss: 6 kB +Shared_Clean: 144 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 144 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f64b4000-f64be000 r--p 0012e000 fd:04 1776 /system/lib/libcrypto.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 40 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 40 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f64be000-f64bf000 rw-p 00137000 fd:04 1776 /system/lib/libcrypto.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f64bf000-f64c0000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f64c0000-f64c2000 r--s 0027f000 07:a8 38 /apex/com.art/javalib/core-icu4j.jar +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f64c2000-f64c6000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f64c6000-f64e6000 r--s 00000000 00:11 7263 /dev/__properties__/u:object_r:exported_fingerprint_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f64e6000-f64f8000 r--p 00000000 fd:04 1692 /system/lib/libRScpp.so +Size: 72 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 2 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f64f8000-f6525000 r-xp 00011000 fd:04 1692 /system/lib/libRScpp.so +Size: 180 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f6525000-f6526000 r--p 0003d000 fd:04 1692 /system/lib/libRScpp.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6526000-f6527000 rw-p 0003d000 fd:04 1692 /system/lib/libRScpp.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6527000-f6528000 r--s 0003f000 fd:04 1343 /system/framework/ims-common.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6528000-f652a000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f652a000-f653a000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f653a000-f655a000 r--s 00000000 00:11 7312 /dev/__properties__/u:object_r:persist_debug_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f655a000-f6563000 r--p 00000000 fd:04 1591 /system/lib/hidl.allocator@1.0.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 1 kB +Shared_Clean: 36 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 36 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f6563000-f656f000 r-xp 00008000 fd:04 1591 /system/lib/hidl.allocator@1.0.so +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f656f000-f6571000 r--p 00013000 fd:04 1591 /system/lib/hidl.allocator@1.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6571000-f6572000 rw-p 00014000 fd:04 1591 /system/lib/hidl.allocator@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6572000-f6592000 r--s 00000000 00:11 7332 /dev/__properties__/u:object_r:system_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6592000-f65c0000 r--p 00000000 fd:04 2022 /system/lib/libvintf.so +Size: 184 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 72 kB +Pss: 2 kB +Shared_Clean: 72 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 72 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f65c0000-f6636000 r-xp 0002d000 fd:04 2022 /system/lib/libvintf.so +Size: 472 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f6636000-f6639000 r--p 000a2000 fd:04 2022 /system/lib/libvintf.so +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6639000-f663a000 rw-p 000a4000 fd:04 2022 /system/lib/libvintf.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f663a000-f663c000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f663e000-f6656000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 96 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6656000-f665f000 r--p 00000000 fd:04 1592 /system/lib/hidl.memory.token@1.0.so +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 1 kB +Shared_Clean: 36 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 36 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f665f000-f6669000 r-xp 00008000 fd:04 1592 /system/lib/hidl.memory.token@1.0.so +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f6669000-f666b000 r--p 00011000 fd:04 1592 /system/lib/hidl.memory.token@1.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f666b000-f666c000 rw-p 00012000 fd:04 1592 /system/lib/hidl.memory.token@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f666c000-f6680000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6680000-f6694000 r--p 00000000 fd:04 1527 /system/lib/hardware.graphics.bufferqueue@2.0.so +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f6694000-f66b9000 r-xp 00013000 fd:04 1527 /system/lib/hardware.graphics.bufferqueue@2.0.so +Size: 148 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f66b9000-f66bb000 r--p 00037000 fd:04 1527 /system/lib/hardware.graphics.bufferqueue@2.0.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f66bb000-f66bc000 rw-p 00038000 fd:04 1527 /system/lib/hardware.graphics.bufferqueue@2.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f66bc000-f66bd000 r--s 000c8000 fd:04 1432 /system/framework/voip-common.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f66bd000-f66c9000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f66c9000-f66f3000 r--p 00000000 fd:04 1555 /system/lib/hardware.media.omx@1.0.so +Size: 168 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 68 kB +Pss: 2 kB +Shared_Clean: 68 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 68 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f66f3000-f674b000 r-xp 00029000 fd:04 1555 /system/lib/hardware.media.omx@1.0.so +Size: 352 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f674b000-f6751000 r--p 00080000 fd:04 1555 /system/lib/hardware.media.omx@1.0.so +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 24 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6751000-f6752000 rw-p 00085000 fd:04 1555 /system/lib/hardware.media.omx@1.0.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6752000-f6753000 r--s 0012b000 07:a8 36 /apex/com.art/javalib/apache-xml.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6755000-f6769000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 80 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6769000-f6789000 r--s 00000000 00:11 7268 /dev/__properties__/u:object_r:exported_system_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6789000-f67bc000 r--p 00000000 fd:04 1882 /system/lib/libmedia.so +Size: 204 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 68 kB +Pss: 2 kB +Shared_Clean: 68 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 68 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f67bc000-f67bd000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f67bd000-f681b000 r-xp 00033000 fd:04 1882 /system/lib/libmedia.so +Size: 376 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me +f681b000-f6826000 r--p 00090000 fd:04 1882 /system/lib/libmedia.so +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 1 kB +Shared_Clean: 0 kB +Shared_Dirty: 44 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 44 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6826000-f6827000 rw-p 0009a000 fd:04 1882 /system/lib/libmedia.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6827000-f6828000 r--s 00156000 07:a8 37 /apex/com.art/javalib/bouncycastle.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6828000-f6840000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 96 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6840000-f6980000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 1280 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 616 kB +Pss: 431 kB +Shared_Clean: 0 kB +Shared_Dirty: 192 kB +Private_Clean: 0 kB +Private_Dirty: 424 kB +Referenced: 164 kB +Anonymous: 616 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6980000-f6982000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6982000-f6986000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6986000-f69a6000 r--s 00000000 00:11 7270 /dev/__properties__/u:object_r:exported_vold_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f69a6000-f69a7000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f69a7000-f69a8000 r--s 00062000 07:a8 41 /apex/com.art/javalib/okhttp.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f69a8000-f69b0000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f69b0000-f69d0000 r--s 00000000 00:11 7258 /dev/__properties__/u:object_r:exported_config_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f69d0000-f69f0000 r--s 00000000 00:11 7226 /dev/__properties__/u:object_r:dalvik_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f69f0000-f69f1000 r--s 00000000 fd:04 2275 /system/usr/hyphen-data/hyph-as.hyb +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f69f1000-f69f2000 r--s 000a1000 07:a8 39 /apex/com.art/javalib/core-libart.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f69f2000-f69f3000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f69f3000-f69f4000 rw-p 00000000 00:00 0 [anon:dalvik-mod union bitmap] +Name: [anon:dalvik-mod union bitmap] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f69f4000-f6a00000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6a00000-f6b40000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 1280 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 296 kB +Pss: 195 kB +Shared_Clean: 0 kB +Shared_Dirty: 104 kB +Private_Clean: 0 kB +Private_Dirty: 192 kB +Referenced: 24 kB +Anonymous: 296 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6b40000-f6b41000 r--p 00000000 07:58 18 /apex/com.sdkext/javalib/framework-sdkextensions.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6b41000-f6b42000 r--p 00000000 07:c8 13 /apex/com.permission/javalib/framework-permission.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6b42000-f6b43000 r--s 004c2000 07:a8 40 /apex/com.art/javalib/core-oj.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6b43000-f6b4f000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 48 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6b4f000-f6b5f000 r--p 00357000 fd:04 1441 /system/framework/x86/boot-framework.art +Size: 64 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 64 kB +Pss: 1 kB +Shared_Clean: 64 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 64 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f6b5f000-f6b7f000 r--s 00000000 00:11 7229 /dev/__properties__/u:object_r:default_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 28 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 28 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 28 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6b7f000-f6b80000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6b80000-f6b82000 rw-p 00000000 00:00 0 [anon:dalvik-indirect ref table] +Name: [anon:dalvik-indirect ref table] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6b82000-f6b83000 rw-p 00000000 00:00 0 [anon:dalvik-concurrent copying sweep array free buffer] +Name: [anon:dalvik-concurrent copying sweep array free buffer] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6b83000-f6ba3000 rw-p 00000000 00:00 0 [anon:dalvik-LinearAlloc] +Name: [anon:dalvik-LinearAlloc] +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6ba3000-f6bc3000 r--s 00000000 00:11 7259 /dev/__properties__/u:object_r:exported_dalvik_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6bc3000-f6bc4000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6bc4000-f6bcc000 rw-p 00000000 00:00 0 [anon:dalvik-thread local mark stack] +Name: [anon:dalvik-thread local mark stack] +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6bcc000-f6bcd000 r--p 00000000 fd:04 1339 /system/framework/framework-atb-backward-compatibility.jar +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f6bcd000-f6bce000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f6bce000-f6bdf000 rw-p 00000000 00:00 0 [anon:scudo:secondary] +Name: [anon:scudo:secondary] +Size: 68 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 40 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 40 kB +Referenced: 0 kB +Anonymous: 40 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6bdf000-f6be0000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f6be0000-f6c00000 r--s 00000000 00:11 7250 /dev/__properties__/u:object_r:exported2_system_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6c00000-f6c20000 r--s 00000000 00:11 7292 /dev/__properties__/u:object_r:logd_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6c20000-f6c40000 r--s 00000000 00:11 7291 /dev/__properties__/u:object_r:log_tag_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6c40000-f6c80000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 256 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 204 kB +Pss: 114 kB +Shared_Clean: 0 kB +Shared_Dirty: 92 kB +Private_Clean: 0 kB +Private_Dirty: 112 kB +Referenced: 76 kB +Anonymous: 204 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f6c80000-f6ca0000 r--s 00000000 00:11 7260 /dev/__properties__/u:object_r:exported_default_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 12 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6ca0000-f6cc0000 r--s 00000000 00:11 7202 /dev/__properties__/u:object_r:bq_config_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f6cc0000-f7080000 rw-p 00000000 00:00 0 [anon:scudo:primary] +Name: [anon:scudo:primary] +Size: 3840 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 1600 kB +Pss: 1037 kB +Shared_Clean: 0 kB +Shared_Dirty: 584 kB +Private_Clean: 0 kB +Private_Dirty: 1016 kB +Referenced: 812 kB +Anonymous: 1600 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f7080000-f7081000 rw-p 00000000 00:00 0 [anon:dalvik-concurrent copying sweep array free buffer] +Name: [anon:dalvik-concurrent copying sweep array free buffer] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f7081000-f7082000 rw-p 00000000 00:00 0 [anon:alloc_lob] +Name: [anon:alloc_lob] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f7082000-f7083000 r--p 00001000 fd:04 1438 /system/framework/x86/boot-framework-atb-backward-compatibility.art +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 1 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f7083000-f7084000 r--p 0000b000 fd:04 1444 /system/framework/x86/boot-ims-common.art +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f7084000-f7085000 r--p 0002b000 fd:04 1450 /system/framework/x86/boot-voip-common.art +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 1 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f7085000-f7087000 r--p 0006f000 fd:04 1447 /system/framework/x86/boot-telephony-common.art +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 1 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f7087000-f7088000 r--p 00015000 fd:04 1435 /system/framework/x86/boot-ext.art +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 1 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f7088000-f7089000 r--p 00002000 07:a8 43 /apex/com.art/javalib/x86/boot-apache-xml.art +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 1 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f7089000-f708d000 r--p 000b7000 07:a8 58 /apex/com.art/javalib/x86/boot.art +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 0 kB +Shared_Clean: 16 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 16 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f708d000-f70ad000 r--s 00000000 00:11 7227 /dev/__properties__/u:object_r:debug_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f70ad000-f70cd000 r--s 00000000 00:11 7357 /dev/__properties__/properties_serial +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f70cd000-f70d8000 r--s 00000000 00:11 7187 /dev/__properties__/property_info +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 44 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 44 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f70d8000-f70dc000 r--p 00000000 00:00 0 [anon:atexit handlers] +Name: [anon:atexit handlers] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f70dc000-f70fc000 r--s 00000000 00:11 7351 /dev/__properties__/u:object_r:vendor_socket_hook_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f70fc000-f711c000 r--s 00000000 00:11 7282 /dev/__properties__/u:object_r:heapprofd_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f711c000-f713c000 r--s 00000000 00:11 7248 /dev/__properties__/u:object_r:exported2_default_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f713c000-f7204000 r--p 00000000 00:00 0 [anon:linker_alloc] +Name: [anon:linker_alloc] +Size: 800 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f7204000-f7224000 r--s 00000000 00:11 7353 /dev/__properties__/u:object_r:vndk_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f7224000-f7226000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 0 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f7226000-f7227000 r--p 00015000 07:a8 46 /apex/com.art/javalib/x86/boot-bouncycastle.art +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 1 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f7227000-f7228000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f7228000-f7229000 r--p 00011000 07:a8 55 /apex/com.art/javalib/x86/boot-okhttp.art +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f7229000-f722d000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 8 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 0 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f722d000-f722f000 r--p 0003f000 07:a8 49 /apex/com.art/javalib/x86/boot-core-icu4j.art +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 0 kB +Shared_Clean: 8 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 8 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f722f000-f7231000 ---p 00000000 00:00 0 [anon:cfi shadow] +Name: [anon:cfi shadow] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f7231000-f7232000 r--p 00000000 00:00 0 [anon:cfi shadow] +Name: [anon:cfi shadow] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f7232000-f7233000 r--p 00000000 00:00 0 [anon:cfi shadow] +Name: [anon:cfi shadow] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f7233000-f7235000 ---p 00000000 00:00 0 [anon:cfi shadow] +Name: [anon:cfi shadow] +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f7235000-f7236000 r--p 00000000 00:00 0 [anon:cfi shadow] +Name: [anon:cfi shadow] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f7236000-f7237000 r--p 00000000 00:00 0 [anon:cfi shadow] +Name: [anon:cfi shadow] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f7237000-f7238000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f7238000-f723b000 rw-p 00000000 00:00 0 [anon:stack_and_tls:main] +Name: [anon:stack_and_tls:main] +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me nr +f723b000-f723c000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me nr +f723c000-f7245000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 36 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 20 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 12 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f7245000-f72a9000 r--p 00000000 00:00 0 [anon:linker_alloc] +Name: [anon:linker_alloc] +Size: 400 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 124 kB +Pss: 40 kB +Shared_Clean: 0 kB +Shared_Dirty: 88 kB +Private_Clean: 0 kB +Private_Dirty: 36 kB +Referenced: 80 kB +Anonymous: 124 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f72a9000-f72aa000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f72aa000-f72ca000 r--s 00000000 00:11 7227 /dev/__properties__/u:object_r:debug_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f72ca000-f72ea000 r--s 00000000 00:11 7248 /dev/__properties__/u:object_r:exported2_default_prop:s0 +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f72ea000-f72eb000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f72eb000-f72f3000 rw-p 00000000 00:00 0 +Size: 32 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f72f3000-f72f4000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me +f72f4000-f7314000 r--s 00000000 00:11 7357 /dev/__properties__/properties_serial +Size: 128 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f7314000-f7315000 rw-p 00000000 00:00 0 [anon:System property context nodes] +Name: [anon:System property context nodes] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f7315000-f7320000 r--s 00000000 00:11 7187 /dev/__properties__/property_info +Size: 44 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 44 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 44 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 44 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr me ms +f7320000-f7384000 r--p 00000000 00:00 0 [anon:linker_alloc] +Name: [anon:linker_alloc] +Size: 400 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 92 kB +Pss: 10 kB +Shared_Clean: 0 kB +Shared_Dirty: 84 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 80 kB +Anonymous: 92 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f7384000-f7385000 rw-p 00000000 00:00 0 [anon:alloc_small_objects] +Name: [anon:alloc_small_objects] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f7385000-f7386000 r--p 00000000 00:00 0 [anon:atexit handlers] +Name: [anon:atexit handlers] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 4 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f7386000-f7387000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me ac +f7387000-f738b000 rw-p 00000000 00:00 0 [anon:thread signal stack] +Name: [anon:thread signal stack] +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f738b000-f738c000 rw-p 00000000 00:00 0 [anon:arc4random data] +Name: [anon:arc4random data] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f738c000-f738d000 r--p 0001b000 07:a8 52 /apex/com.art/javalib/x86/boot-core-libart.art +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me +f738d000-f738e000 rw-p 00000000 00:00 0 [anon:System property context nodes] +Name: [anon:System property context nodes] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f738e000-f738f000 rw-p 00000000 00:00 0 [anon:arc4random data] +Name: [anon:arc4random data] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 0 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f738f000-f7392000 r--p 00000000 00:00 0 [vvar] +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr pf io de dd +f7392000-f7393000 r-xp 00000000 00:00 0 [vdso] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me de +f7393000-f73d1000 r--p 00000000 07:50 13 /apex/com.runtime/bin/linker +Size: 248 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 112 kB +Pss: 28 kB +Shared_Clean: 84 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 28 kB +Referenced: 112 kB +Anonymous: 28 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me dw +f73d1000-f74c9000 r-xp 0003d000 07:50 13 /apex/com.runtime/bin/linker +Size: 992 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 708 kB +Pss: 7 kB +Shared_Clean: 708 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 708 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me dw +f74c9000-f74ce000 r--p 00134000 07:50 13 /apex/com.runtime/bin/linker +Size: 20 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 12 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 8 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me dw ac +f74ce000-f74cf000 rw-p 00138000 07:50 13 /apex/com.runtime/bin/linker +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me dw ac +f74cf000-f74d2000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 0 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +f74d2000-f74d3000 r--p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 4 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac +f74d3000-f74d9000 rw-p 00000000 00:00 0 [anon:.bss] +Name: [anon:.bss] +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 4 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac +ff2db000-ff2dc000 ---p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me gd ac +ff2dc000-ffadb000 rw-p 00000000 00:00 0 [stack] +Size: 8188 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 36 kB +Pss: 32 kB +Shared_Clean: 0 kB +Shared_Dirty: 4 kB +Private_Clean: 0 kB +Private_Dirty: 32 kB +Referenced: 24 kB +Anonymous: 36 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me gd ac diff --git a/device/plugins/memory_plugin/test/utresources/proc/1/status b/device/plugins/memory_plugin/test/utresources/proc/1/status new file mode 100755 index 000000000..3814cf98a --- /dev/null +++ b/device/plugins/memory_plugin/test/utresources/proc/1/status @@ -0,0 +1,55 @@ +Name: systemd +Umask: 0000 +State: S (sleeping) +Tgid: 1 +Ngid: 0 +Pid: 1 +PPid: 0 +TracerPid: 0 +Uid: 0 0 0 0 +Gid: 0 0 0 0 +FDSize: 512 +Groups: +NStgid: 1 +NSpid: 1 +NSpgid: 1 +NSsid: 1 +VmPeak: 290996 kB +VmSize: 226208 kB +VmLck: 0 kB +VmPin: 0 kB +VmHWM: 9616 kB +VmRSS: 9388 kB +RssAnon: 2984 kB +RssFile: 6404 kB +RssShmem: 0 kB +VmData: 19420 kB +VmStk: 132 kB +VmExe: 1344 kB +VmLib: 10048 kB +VmPTE: 212 kB +VmSwap: 164 kB +HugetlbPages: 0 kB +CoreDumping: 0 +THP_enabled: 1 +Threads: 1 +SigQ: 0/62970 +SigPnd: 0000000000000000 +ShdPnd: 0000000000000000 +SigBlk: 7be3c0fe28014a03 +SigIgn: 0000000000001000 +SigCgt: 00000001800004ec +CapInh: 0000000000000000 +CapPrm: 0000003fffffffff +CapEff: 0000003fffffffff +CapBnd: 0000003fffffffff +CapAmb: 0000000000000000 +NoNewPrivs: 0 +Seccomp: 0 +Speculation_Store_Bypass: thread vulnerable +Cpus_allowed: 3f +Cpus_allowed_list: 0-5 +Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001 +Mems_allowed_list: 0 +voluntary_ctxt_switches: 78718 +nonvoluntary_ctxt_switches: 3443 diff --git a/device/plugins/memory_plugin/test/utresources/proc/11/oom_score_adj b/device/plugins/memory_plugin/test/utresources/proc/11/oom_score_adj new file mode 100755 index 000000000..573541ac9 --- /dev/null +++ b/device/plugins/memory_plugin/test/utresources/proc/11/oom_score_adj @@ -0,0 +1 @@ +0 diff --git a/device/plugins/memory_plugin/test/utresources/proc/11/smaps b/device/plugins/memory_plugin/test/utresources/proc/11/smaps new file mode 100755 index 000000000..513d73da2 --- /dev/null +++ b/device/plugins/memory_plugin/test/utresources/proc/11/smaps @@ -0,0 +1,713 @@ +564044f07000-564044f08000 r-xp 00000000 08:01 4587541 test/run +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me dw sd +564045107000-564045108000 r--p 00000000 08:01 4587541 test/run +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me dw ac sd +564045108000-564045109000 rw-p 00001000 08:01 4587541 test/run +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me dw ac sd +564045dbe000-564045ddf000 rw-p 00000000 00:00 0 [heap] +Size: 132 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 12 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7f46756f6000-7f467570d000 r-xp 00000000 08:01 923931 /lib/x86_64-linux-gnu/libgcc_s.so.1 +Size: 92 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 92 kB +Pss: 20 kB +Shared_Clean: 92 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 92 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me sd +7f467570d000-7f467590c000 ---p 00017000 08:01 923931 /lib/x86_64-linux-gnu/libgcc_s.so.1 +Size: 2044 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me sd +7f467590c000-7f467590d000 r--p 00016000 08:01 923931 /lib/x86_64-linux-gnu/libgcc_s.so.1 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac sd +7f467590d000-7f467590e000 rw-p 00017000 08:01 923931 /lib/x86_64-linux-gnu/libgcc_s.so.1 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7f467590e000-7f4675aab000 r-xp 00000000 08:01 929314 /lib/x86_64-linux-gnu/libm-2.27.so +Size: 1652 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 300 kB +Pss: 51 kB +Shared_Clean: 300 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 300 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me sd +7f4675aab000-7f4675caa000 ---p 0019d000 08:01 929314 /lib/x86_64-linux-gnu/libm-2.27.so +Size: 2044 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me sd +7f4675caa000-7f4675cab000 r--p 0019c000 08:01 929314 /lib/x86_64-linux-gnu/libm-2.27.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac sd +7f4675cab000-7f4675cac000 rw-p 0019d000 08:01 929314 /lib/x86_64-linux-gnu/libm-2.27.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7f4675cac000-7f4675e93000 r-xp 00000000 08:01 929310 /lib/x86_64-linux-gnu/libc-2.27.so +Size: 1948 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 1136 kB +Pss: 19 kB +Shared_Clean: 1136 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 1136 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me sd +7f4675e93000-7f4676093000 ---p 001e7000 08:01 929310 /lib/x86_64-linux-gnu/libc-2.27.so +Size: 2048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me sd +7f4676093000-7f4676097000 r--p 001e7000 08:01 929310 /lib/x86_64-linux-gnu/libc-2.27.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 16 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 16 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac sd +7f4676097000-7f4676099000 rw-p 001eb000 08:01 929310 /lib/x86_64-linux-gnu/libc-2.27.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7f4676099000-7f467609d000 rw-p 00000000 00:00 0 +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 12 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7f467609d000-7f4676216000 r-xp 00000000 08:01 1190514 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25 +Size: 1508 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 780 kB +Pss: 301 kB +Shared_Clean: 780 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 780 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me sd +7f4676216000-7f4676416000 ---p 00179000 08:01 1190514 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25 +Size: 2048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me sd +7f4676416000-7f4676420000 r--p 00179000 08:01 1190514 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25 +Size: 40 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 40 kB +Pss: 40 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 40 kB +Referenced: 40 kB +Anonymous: 40 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac sd +7f4676420000-7f4676422000 rw-p 00183000 08:01 1190514 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7f4676422000-7f4676426000 rw-p 00000000 00:00 0 +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7f4676426000-7f467644f000 r-xp 00000000 08:01 927476 /lib/x86_64-linux-gnu/ld-2.27.so +Size: 164 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 164 kB +Pss: 3 kB +Shared_Clean: 164 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 164 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me dw sd +7f4676634000-7f467663a000 rw-p 00000000 00:00 0 +Size: 24 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 24 kB +Pss: 24 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 24 kB +Referenced: 24 kB +Anonymous: 24 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7f467664f000-7f4676650000 r--p 00029000 08:01 927476 /lib/x86_64-linux-gnu/ld-2.27.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me dw ac sd +7f4676650000-7f4676651000 rw-p 0002a000 08:01 927476 /lib/x86_64-linux-gnu/ld-2.27.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me dw ac sd +7f4676651000-7f4676652000 rw-p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7ffe45c9a000-7ffe45cbb000 rw-p 00000000 00:00 0 [stack] +Size: 132 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 12 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me gd ac +7ffe45d41000-7ffe45d44000 r--p 00000000 00:00 0 [vvar] +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr pf io de dd sd +7ffe45d44000-7ffe45d45000 r-xp 00000000 00:00 0 [vdso] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me de sd +ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: ex diff --git a/device/plugins/memory_plugin/test/utresources/proc/11/status b/device/plugins/memory_plugin/test/utresources/proc/11/status new file mode 100755 index 000000000..f26fdf157 --- /dev/null +++ b/device/plugins/memory_plugin/test/utresources/proc/11/status @@ -0,0 +1,37 @@ +Name: rcu_sched +Umask: 0000 +State: I (idle) +Tgid: 11 +Ngid: 0 +Pid: 11 +PPid: 2 +TracerPid: 0 +Uid: 0 0 0 0 +Gid: 0 0 0 0 +FDSize: 64 +Groups: +NStgid: 11 +NSpid: 11 +NSpgid: 0 +NSsid: 0 +Threads: 1 +SigQ: 0/62967 +SigPnd: 0000000000000000 +ShdPnd: 0000000000000000 +SigBlk: 0000000000000000 +SigIgn: ffffffffffffffff +SigCgt: 0000000000000000 +CapInh: 0000000000000000 +CapPrm: 0000003fffffffff +CapEff: 0000003fffffffff +CapBnd: 0000003fffffffff +CapAmb: 0000000000000000 +NoNewPrivs: 0 +Seccomp: 0 +Speculation_Store_Bypass: thread vulnerable +Cpus_allowed: 3f +Cpus_allowed_list: 0-5 +Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001 +Mems_allowed_list: 0 +voluntary_ctxt_switches: 18962428 +nonvoluntary_ctxt_switches: 39 diff --git a/device/plugins/memory_plugin/test/utresources/proc/2/oom_score_adj b/device/plugins/memory_plugin/test/utresources/proc/2/oom_score_adj new file mode 100755 index 000000000..e96acb925 --- /dev/null +++ b/device/plugins/memory_plugin/test/utresources/proc/2/oom_score_adj @@ -0,0 +1 @@ +-100 diff --git a/device/plugins/memory_plugin/test/utresources/proc/2/smaps b/device/plugins/memory_plugin/test/utresources/proc/2/smaps new file mode 100755 index 000000000..ca8e7cc1c --- /dev/null +++ b/device/plugins/memory_plugin/test/utresources/proc/2/smaps @@ -0,0 +1,414 @@ +5637ebe15000-5637ebe16000 r-xp 00000000 08:01 4587541 test/run +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 4 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me dw sd +5637ec015000-5637ec016000 r--p 00000000 08:01 4587541 test/run +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me dw ac sd +5637ec016000-5637ec017000 rw-p 00001000 08:01 4587541 test/run +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me dw ac sd +5637ec60f000-5637ec630000 rw-p 00000000 00:00 0 [heap] +Size: 132 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7fa384a9e000-7fa384c85000 r-xp 00000000 08:01 929310 /lib/x86_64-linux-gnu/libc-2.27.so +Size: 1948 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 1200 kB +Pss: 20 kB +Shared_Clean: 1200 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 1200 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me sd +7fa384c85000-7fa384e85000 ---p 001e7000 08:01 929310 /lib/x86_64-linux-gnu/libc-2.27.so +Size: 2048 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: mr mw me sd +7fa384e85000-7fa384e89000 r--p 001e7000 08:01 929310 /lib/x86_64-linux-gnu/libc-2.27.so +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 16 kB +Pss: 16 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 16 kB +Referenced: 16 kB +Anonymous: 16 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me ac sd +7fa384e89000-7fa384e8b000 rw-p 001eb000 08:01 929310 /lib/x86_64-linux-gnu/libc-2.27.so +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7fa384e8b000-7fa384e8f000 rw-p 00000000 00:00 0 +Size: 16 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 12 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7fa384e8f000-7fa384eb8000 r-xp 00000000 08:01 927476 /lib/x86_64-linux-gnu/ld-2.27.so +Size: 164 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 164 kB +Pss: 3 kB +Shared_Clean: 164 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 164 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me dw sd +7fa3850a1000-7fa3850a3000 rw-p 00000000 00:00 0 +Size: 8 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 8 kB +Pss: 8 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 8 kB +Referenced: 8 kB +Anonymous: 8 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7fa3850b8000-7fa3850b9000 r--p 00029000 08:01 927476 /lib/x86_64-linux-gnu/ld-2.27.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr mw me dw ac sd +7fa3850b9000-7fa3850ba000 rw-p 0002a000 08:01 927476 /lib/x86_64-linux-gnu/ld-2.27.so +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me dw ac sd +7fa3850ba000-7fa3850bb000 rw-p 00000000 00:00 0 +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 4 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 4 kB +Referenced: 4 kB +Anonymous: 4 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me ac sd +7ffc54ec0000-7ffc54ee1000 rw-p 00000000 00:00 0 [stack] +Size: 132 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 12 kB +Pss: 12 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 12 kB +Referenced: 12 kB +Anonymous: 12 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd wr mr mw me gd ac +7ffc54f1c000-7ffc54f1f000 r--p 00000000 00:00 0 [vvar] +Size: 12 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd mr pf io de dd sd +7ffc54f1f000-7ffc54f20000 r-xp 00000000 00:00 0 [vdso] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 4 kB +Pss: 0 kB +Shared_Clean: 4 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 4 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: rd ex mr mw me de sd +ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall] +Size: 4 kB +KernelPageSize: 4 kB +MMUPageSize: 4 kB +Rss: 0 kB +Pss: 0 kB +Shared_Clean: 0 kB +Shared_Dirty: 0 kB +Private_Clean: 0 kB +Private_Dirty: 0 kB +Referenced: 0 kB +Anonymous: 0 kB +LazyFree: 0 kB +AnonHugePages: 0 kB +ShmemPmdMapped: 0 kB +FilePmdMapped: 0 kB +Shared_Hugetlb: 0 kB +Private_Hugetlb: 0 kB +Swap: 0 kB +SwapPss: 0 kB +Locked: 0 kB +THPeligible: 0 +VmFlags: ex diff --git a/device/plugins/memory_plugin/test/utresources/proc/2/status b/device/plugins/memory_plugin/test/utresources/proc/2/status new file mode 100755 index 000000000..2f3702f0d --- /dev/null +++ b/device/plugins/memory_plugin/test/utresources/proc/2/status @@ -0,0 +1,37 @@ +Name: kthreadd +Umask: 0000 +State: S (sleeping) +Tgid: 2 +Ngid: 0 +Pid: 2 +PPid: 0 +TracerPid: 0 +Uid: 0 0 0 0 +Gid: 0 0 0 0 +FDSize: 64 +Groups: +NStgid: 2 +NSpid: 2 +NSpgid: 0 +NSsid: 0 +Threads: 1 +SigQ: 0/62970 +SigPnd: 0000000000000000 +ShdPnd: 0000000000000000 +SigBlk: 0000000000000000 +SigIgn: ffffffffffffffff +SigCgt: 0000000000000000 +CapInh: 0000000000000000 +CapPrm: 0000003fffffffff +CapEff: 0000003fffffffff +CapBnd: 0000003fffffffff +CapAmb: 0000000000000000 +NoNewPrivs: 0 +Seccomp: 0 +Speculation_Store_Bypass: thread vulnerable +Cpus_allowed: 3f +Cpus_allowed_list: 0-5 +Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001 +Mems_allowed_list: 0 +voluntary_ctxt_switches: 3372 +nonvoluntary_ctxt_switches: 1 diff --git a/device/plugins/memory_plugin/test/utresources/proc/cmdline b/device/plugins/memory_plugin/test/utresources/proc/cmdline new file mode 100755 index 000000000..e69de29bb diff --git a/device/plugins/memory_plugin/test/utresources/proc/meminfo b/device/plugins/memory_plugin/test/utresources/proc/meminfo new file mode 100755 index 000000000..59d52d0b3 --- /dev/null +++ b/device/plugins/memory_plugin/test/utresources/proc/meminfo @@ -0,0 +1,53 @@ +MemTotal: 16168696 kB +MemFree: 1168452 kB +MemAvailable: 12363564 kB +Buffers: 2726188 kB +Cached: 7370484 kB +SwapCached: 29260 kB +Active: 8450388 kB +Inactive: 4807668 kB +Active(anon): 2535372 kB +Inactive(anon): 658832 kB +Active(file): 5915016 kB +Inactive(file): 4148836 kB +Unevictable: 132 kB +Mlocked: 0 kB +SwapTotal: 63999996 kB +SwapFree: 62211580 kB +Dirty: 0 kB +Writeback: 0 kB +AnonPages: 3142688 kB +Mapped: 161520 kB +Shmem: 32820 kB +KReclaimable: 1468312 kB +Slab: 1545180 kB +SReclaimable: 1468312 kB +SUnreclaim: 76868 kB +KernelStack: 9200 kB +PageTables: 46928 kB +NFS_Unstable: 0 kB +Bounce: 0 kB +WritebackTmp: 0 kB +CommitLimit: 72084344 kB +Committed_AS: 7746304 kB +VmallocTotal: 34359738367 kB +VmallocUsed: 37652 kB +VmallocChunk: 0 kB +Percpu: 3200 kB +HardwareCorrupted: 0 kB +AnonHugePages: 0 kB +ShmemHugePages: 0 kB +ShmemPmdMapped: 0 kB +FileHugePages: 0 kB +FilePmdMapped: 0 kB +CmaTotal: 0 kB +CmaFree: 0 kB +HugePages_Total: 0 +HugePages_Free: 0 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +Hugepagesize: 2048 kB +Hugetlb: 0 kB +DirectMap4k: 1315504 kB +DirectMap2M: 15230976 kB +DirectMap1G: 0 kB diff --git a/device/services/ipc/BUILD.gn b/device/services/ipc/BUILD.gn new file mode 100755 index 000000000..9c0b54e9c --- /dev/null +++ b/device/services/ipc/BUILD.gn @@ -0,0 +1,65 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("../../base/config.gni") + +ohos_source_set("ipc") { + sources = [ + "src/client_connection.cpp", + "src/client_map.cpp", + "src/service_entry.cpp", + "src/socket_context.cpp", + "src/unix_socket_client.cpp", + "src/unix_socket_server.cpp", + ] + include_dirs = [ + "include", + "../../base/include", + "//utils/native/base/include", + ] + if (current_toolchain != host_toolchain) { + defines = [ "HAVE_HILOG" ] + if (build_l2) { + external_deps = [ "shared_library:libhilog" ] + } else { + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + } + } + deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + "//utils/native/base:utilsbase", + ] + public_configs = [ "../../base:hiprofiler_test_config" ] +} + +ohos_executable("protoc_gen_ipc") { + sources = [ + "src/ipc_generator.cpp", + "src/ipc_generator_impl.cpp", + "src/main.cpp", + ] + + include_dirs = [ + "include", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}", + ] + public_configs = [ "../../base:hiprofiler_test_config" ] + deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc_lib", + ] + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} diff --git a/device/services/ipc/include/client_connection.h b/device/services/ipc/include/client_connection.h new file mode 100755 index 000000000..86b8fc2de --- /dev/null +++ b/device/services/ipc/include/client_connection.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CLIENT_CONNECTION_H +#define CLIENT_CONNECTION_H + +#include "service_entry.h" +#include "socket_context.h" +#include + +class ClientConnection final : public SocketContext { +public: + ClientConnection(int sfd, ServiceEntry& serviceEntry); + ~ClientConnection(); + + int RawProtocolProc(uint32_t pnum, const int8_t* buf, const uint32_t size) override; + + ServiceEntry* serviceEntry_; + std::string protoServiceName_; +}; + +#endif \ No newline at end of file diff --git a/device/services/ipc/include/client_map.h b/device/services/ipc/include/client_map.h new file mode 100755 index 000000000..9056bd15b --- /dev/null +++ b/device/services/ipc/include/client_map.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CLIENT_MAP_H +#define CLIENT_MAP_H + +#include "client_connection.h" +#include + +class ServiceEntry; + +class ClientMap { +public: + static ClientMap& GetInstance(); + int PutClientSocket(int socketFileDescriptor, ServiceEntry& p); + int AutoRelease(); + +private: + ClientMap(); + ~ClientMap(); + + std::map> socketClients_; +}; + +#endif \ No newline at end of file diff --git a/device/services/ipc/include/ipc_generator.h b/device/services/ipc/include/ipc_generator.h new file mode 100755 index 000000000..2d4770b5c --- /dev/null +++ b/device/services/ipc/include/ipc_generator.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef IPC_GENERATOR_H +#define IPC_GENERATOR_H + +#include "google/protobuf/compiler/code_generator.h" +#include "google/protobuf/compiler/plugin.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/io/coded_stream.h" +#include "google/protobuf/io/zero_copy_stream.h" +#include +#include +#include + +class IpcGeneratorImpl; + +class IpcGenerator : public google::protobuf::compiler::CodeGenerator { +public: + IpcGenerator(); + ~IpcGenerator(); + bool Generate(const google::protobuf::FileDescriptor* file, + const std::string& parameter, + google::protobuf::compiler::GeneratorContext* context, + std::string* error) const override; +}; + +#endif \ No newline at end of file diff --git a/device/services/ipc/include/ipc_generator_impl.h b/device/services/ipc/include/ipc_generator_impl.h new file mode 100644 index 000000000..e93061f09 --- /dev/null +++ b/device/services/ipc/include/ipc_generator_impl.h @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef IPC_GENERATOR_IMPL_H +#define IPC_GENERATOR_IMPL_H + +#include +#include + +class IpcServices { +public: + IpcServices() + { + methodCount_ = 0; + } + ~IpcServices() {} + std::string serviceName_; + std::map methodList_; + std::map requestList_; + std::map responseList_; + int methodCount_; + bool AddMethod(std::string method, std::string request, std::string response) + { + for (int i = 0; i < methodCount_; i++) { + if (methodList_[i] == method) { + return false; + } + } + methodList_[methodCount_] = method; + requestList_[methodCount_] = request; + responseList_[methodCount_] = response; + methodCount_++; + return true; + } +}; + +class IpcGeneratorImpl { +public: + IpcGeneratorImpl(); + ~IpcGeneratorImpl(); + + std::string SetNames(std::string fileName, std::string packageName); + bool AddService(std::string serviceName); + bool AddServiceMethod(std::string serviceName, + std::string methodName, + std::string requestName, + std::string responseName); + + std::string GenHeader(); + std::string GenSource(); + +private: + std::string fileName_ = ""; + std::string baseName_ = ""; + std::string packageName_ = ""; + std::string headFileName_ = ""; + + void GenerateHeader(std::string& header_str); + + std::string GenSendResponseImpl(int servicep, const std::string& server_class_name); + std::string GenOnResponseImpl(int servicep, const std::string& client_class_name); + + std::string GenServiceCallImpl(int servicep, const std::string& server_class_name); + std::string GenClientProcImpl(int servicep); + std::string GenClientRequestImpl(int servicep, const std::string& client_class_name); + std::string GenServiceProcImpl(int servicep); + + std::map serviceList_; + int serviceCount_ = 0; + + std::map enumMessageDict_; +}; + +#endif \ No newline at end of file diff --git a/device/services/ipc/include/service_base.h b/device/services/ipc/include/service_base.h new file mode 100755 index 000000000..a04e8480d --- /dev/null +++ b/device/services/ipc/include/service_base.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SERVICE_BASE_H +#define SERVICE_BASE_H + +#include + +class SocketContext; + +class ServiceBase { +public: + virtual ~ServiceBase() {} + virtual bool ProtocolProc(SocketContext& poc, uint32_t pnum, const int8_t* buf, const uint32_t size) + { + return false; + } + std::timed_mutex mWait_; + std::string serviceName_; +}; + +#endif \ No newline at end of file diff --git a/device/services/ipc/include/service_entry.h b/device/services/ipc/include/service_entry.h new file mode 100755 index 000000000..e80779c23 --- /dev/null +++ b/device/services/ipc/include/service_entry.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SERVICE_ENTRY_H +#define SERVICE_ENTRY_H + +#include "service_base.h" +#include +#include + +static const uint32_t PROTOCOL_TYPE_FILTER = 0xF0000000; + +enum ProtocolType { + PROTOCOL_TYPE_RAW = 0, + PROTOCOL_TYPE_PROTOBUF = 0x10000000, +}; + +struct ProtocolHead { + uint32_t protoType; + uint32_t protoSize; + int8_t datas[0]; +}; + +class UnixSocketServer; + +class ServiceEntry { +public: + ServiceEntry(); + ~ServiceEntry(); + + bool StartServer(const std::string& addrname); + + bool RegisterService(ServiceBase& psb); + + const ServiceBase* FindServiceByName(const std::string& service_name); + +private: + std::shared_ptr unixSocketServer_; + + std::map serviceMap_; +}; + +uint64_t GetTimeMS(); +uint64_t GetTimeUS(); +uint64_t GetTimeNS(); + +#endif \ No newline at end of file diff --git a/device/services/ipc/include/socket_context.h b/device/services/ipc/include/socket_context.h new file mode 100755 index 000000000..cfd87aafe --- /dev/null +++ b/device/services/ipc/include/socket_context.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SOCKET_CONTEXT_H +#define SOCKET_CONTEXT_H + +#include +#include +#include + +#if defined(__i386__) || defined(__x86_64__) +const static char DEFAULT_UNIX_SOCKET_PATH[] = "hiprofiler_unix_socket"; +#else +const static char DEFAULT_UNIX_SOCKET_PATH[] = "/data/local/tmp/hiprofiler_unix_socket"; +#endif + +class SocketContext; +class ServiceBase; +class ClientMap; + +enum ClientState { + CLIENT_STAT_WORKING, + CLIENT_STAT_WAIT_THREAD_EXIT, + CLIENT_STAT_THREAD_EXITED, +}; + +enum RawProtocol { + RAW_PROTOCOL_POINTTO_SERVICE = 1, +}; +struct RawPointToService { + char serviceName_[64]; +}; + +class SocketContext { +public: + SocketContext(); + virtual ~SocketContext(); + + bool SendRaw(uint32_t pnum, const int8_t* data, uint32_t size, int sockfd = -1); + bool SendProtobuf(uint32_t pnum, google::protobuf::Message& pmsg); + bool SendFileDescriptor(int fd); + int ReceiveFileDiscriptor(); + +protected: + friend class ClientMap; + int socketHandle_; + bool CreateRecvThread(); + enum ClientState clientState_; + uint64_t lastProcMS_; + + ServiceBase* serviceBase_; + + virtual int RawProtocolProc(uint32_t pnum, const int8_t* buf, const uint32_t size); + +private: + static void* UnixSocketRecv(void* pp); + std::thread recvThread_; +}; + +#endif \ No newline at end of file diff --git a/device/services/ipc/include/unix_socket_client.h b/device/services/ipc/include/unix_socket_client.h new file mode 100755 index 000000000..bd3390c8e --- /dev/null +++ b/device/services/ipc/include/unix_socket_client.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef UNIX_SOCKET_CLIENT_H +#define UNIX_SOCKET_CLIENT_H + +#include "socket_context.h" +#include + +class ServiceBase; + +class UnixSocketClient final : public SocketContext { +public: + UnixSocketClient(); + ~UnixSocketClient(); + + bool Connect(const std::string addrname, ServiceBase& serviceBase); +}; + +#endif \ No newline at end of file diff --git a/device/services/ipc/include/unix_socket_server.h b/device/services/ipc/include/unix_socket_server.h new file mode 100755 index 000000000..897a46a50 --- /dev/null +++ b/device/services/ipc/include/unix_socket_server.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef UNIX_SOCKET_SERVER_H +#define UNIX_SOCKET_SERVER_H + +#include "socket_context.h" +#include +#include + +class ServiceEntry; + +class UnixSocketServer { +public: + UnixSocketServer(); + ~UnixSocketServer(); + + int socketHandle_; + bool StartServer(const std::string& addrname, ServiceEntry& p); + + std::string sAddrName_; + // private: + ServiceEntry* serviceEntry_; + +private: + std::thread acceptThread_; + static void* UnixSocketAccept(void* p); +}; + +#endif \ No newline at end of file diff --git a/device/services/ipc/src/client_connection.cpp b/device/services/ipc/src/client_connection.cpp new file mode 100755 index 000000000..3222e9478 --- /dev/null +++ b/device/services/ipc/src/client_connection.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "client_connection.h" +#include +#include +#include +#include +#include +#include "logging.h" + +ClientConnection::ClientConnection(int sfd, ServiceEntry& serviceEntry) +{ + serviceBase_ = nullptr; + socketHandle_ = sfd; + clientState_ = CLIENT_STAT_WORKING; + lastProcMS_ = GetTimeMS(); + serviceEntry_ = &serviceEntry; + CreateRecvThread(); +} + +ClientConnection::~ClientConnection() +{ + HILOG_INFO(LOG_CORE, "Client Released"); +} + +int ClientConnection::RawProtocolProc(uint32_t pnum, const int8_t* buf, const uint32_t size) +{ + switch (pnum) { + case RAW_PROTOCOL_POINTTO_SERVICE: { + struct RawPointToService* prrs = (struct RawPointToService*)buf; + protoServiceName_ = prrs->serviceName_; + serviceBase_ = const_cast(serviceEntry_->FindServiceByName(protoServiceName_)); + HILOG_INFO(LOG_CORE, "RAW_PROTOCOL_POINTTO_SERVICE %s", protoServiceName_.c_str()); + } + return 1; + default: + break; + } + return -1; +} diff --git a/device/services/ipc/src/client_map.cpp b/device/services/ipc/src/client_map.cpp new file mode 100755 index 000000000..31e4d3292 --- /dev/null +++ b/device/services/ipc/src/client_map.cpp @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "client_map.h" +#include +#include +#include +#include +#include "logging.h" + +ClientMap& ClientMap::GetInstance() +{ + static ClientMap instance; + return instance; +} + +ClientMap::ClientMap() {} + +ClientMap::~ClientMap() {} + +int ClientMap::PutClientSocket(int socketFileDescriptor, ServiceEntry& p) +{ + if (socketClients_.find(socketFileDescriptor) == socketClients_.end()) { + socketClients_[socketFileDescriptor] = std::make_shared(socketFileDescriptor, p); + return 1; + } + return -1; +} + +int ClientMap::AutoRelease() +{ + for (auto iter = socketClients_.begin(); iter != socketClients_.end(); ++iter) { + auto p = iter->second; + switch (p->clientState_) { + case CLIENT_STAT_WORKING: + break; + case CLIENT_STAT_WAIT_THREAD_EXIT: + break; + case CLIENT_STAT_THREAD_EXITED: + HILOG_INFO(LOG_CORE, "AutoRelease release %d", iter->first); + socketClients_.erase(iter->first); + return 1; + break; + default: + break; + } + } + return 1; +} diff --git a/device/services/ipc/src/ipc_generator.cpp b/device/services/ipc/src/ipc_generator.cpp new file mode 100755 index 000000000..24846a118 --- /dev/null +++ b/device/services/ipc/src/ipc_generator.cpp @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ipc_generator.h" +#include "ipc_generator_impl.h" + +IpcGenerator::IpcGenerator() {} + +IpcGenerator::~IpcGenerator() {} + +bool IpcGenerator::Generate(const google::protobuf::FileDescriptor* file, + const std::string& parameter, + google::protobuf::compiler::GeneratorContext* context, + std::string* error) const +{ + auto pcsp = std::make_shared(); + std::string base_name = pcsp->SetNames(file->name(), file->package()); + + for (int i = 0; i < file->service_count(); i++) { + const google::protobuf::ServiceDescriptor* service = file->service(i); + pcsp->AddService(service->name()); + for (int j = 0; j < service->method_count(); j++) { + const google::protobuf::MethodDescriptor* method = service->method(j); + const google::protobuf::Descriptor* inputType = method->input_type(); + const google::protobuf::Descriptor* outputType = method->output_type(); + pcsp->AddServiceMethod(service->name(), method->name(), inputType->name(), outputType->name()); + } + } + + std::unique_ptr<::google::protobuf::io::ZeroCopyOutputStream> header_output(context->Open(base_name + ".ipc.h")); + std::unique_ptr<::google::protobuf::io::ZeroCopyOutputStream> source_output(context->Open(base_name + ".ipc.cc")); + + ::google::protobuf::io::CodedOutputStream header_out(header_output.get()); + ::google::protobuf::io::CodedOutputStream source_out(source_output.get()); + + std::string header_str = pcsp->GenHeader(); + header_out.WriteString(header_str); + + std::string source_str = pcsp->GenSource(); + source_out.WriteString(source_str); + + return true; +} \ No newline at end of file diff --git a/device/services/ipc/src/ipc_generator_impl.cpp b/device/services/ipc/src/ipc_generator_impl.cpp new file mode 100644 index 000000000..5f69776db --- /dev/null +++ b/device/services/ipc/src/ipc_generator_impl.cpp @@ -0,0 +1,455 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ipc_generator_impl.h" + +IpcGeneratorImpl::IpcGeneratorImpl() {} + +IpcGeneratorImpl::~IpcGeneratorImpl() {} + +namespace { +const std::string BASE_HEADER_STRING = R"( +#pragma once + +#include "#HEAD_FILE_NAME#.pb.h" +#include "service_base.h" +#include +#include + +class SocketContext; +class UnixSocketClient; + +#PROTOCOL_ENUM# + +class #SERVICE_CLASS_NAME#:public ServiceBase +{ +public: + #SERVICE_CLASS_NAME#(); + bool ProtocolProc(SocketContext &context, uint32_t pnum, const int8_t *buf, const uint32_t size) override; +#RESPONSE_DEFINE# +}; + +class #CLIENT_CLASS_NAME#:public ServiceBase +{ +public: + #CLIENT_CLASS_NAME#(); + + std::shared_ptr unixSocketClient_; + bool Connect(const std::string addrname); + bool ProtocolProc(SocketContext &context, uint32_t pnum, const int8_t *buf, const uint32_t size) override; + google::protobuf::Message *presponse; + uint32_t waitingFor; +#VIRTUAL_RESPONSE_FUNC# +}; +)"; + +const std::string BASE_SOURCE_STRING = R"( +#include "#HEAD_FILE_NAME#.ipc.h" +#include "#HEAD_FILE_NAME#.pb.h" +#include "socket_context.h" +#include "unix_socket_client.h" +#include "unix_socket_server.h" +#include + +namespace{ + const uint32_t WAIT_FOR_EVER=24*60*60*1000; +} + +#SERVICE_CLASS_NAME#::#SERVICE_CLASS_NAME#() +{ + serviceName_="#SERVICE_NAME#"; +} + +#RESPONSE_IMPLEMENT# + +#SERVICE_PROTOCOL_PROC_FUNC# +bool #SERVICE_CLASS_NAME#::ProtocolProc(SocketContext &context, uint32_t pnum, const int8_t *buf, const uint32_t size) +{ + switch (pnum) { +#SERVICE_PROTOCOL_PROC# + } + return false; +} + +#CLIENT_CLASS_NAME#::#CLIENT_CLASS_NAME#() +{ + unixSocketClient_=nullptr; + serviceName_="#SERVICE_NAME#"; +} +bool #CLIENT_CLASS_NAME#::Connect(const std::string addrname) +{ + if (unixSocketClient_!=nullptr) { + return false; + } + unixSocketClient_ = std::make_shared(); + if (!unixSocketClient_->Connect(addrname, *this)) { + unixSocketClient_=nullptr; + return false; + } + return true; +} + +#CLIENT_SEND_REQUEST_PROC_FUNC# + +#CLIENT_SEND_PROTOCOL_PROC_FUNC# +bool #CLIENT_CLASS_NAME#::ProtocolProc(SocketContext &context, uint32_t pnum, const int8_t *buf, const uint32_t size) +{ + switch (pnum) { +#CLIENT_PROTOCOL_PROC# + } + if (waitingFor==pnum) { + waitingFor=-1; + mWait_.unlock(); + } + return false; +} +)"; + +std::string SwapName(std::string s) +{ + std::string ret = ""; + bool b = true; + for (size_t i = 0; i < s.length(); i++) { + char c = s[i]; + if (c == '_') { + b = true; + } else if (b && c >= 'a' && c <= 'z') { + ret += (c + 'A' - 'a'); + b = false; + } else { + ret += c; + } + } + return ret; +} +std::string ReplaceStr(const std::string& base, const std::string& _from, const std::string& _to) +{ + std::string ret = base; + while (true) { + size_t pos = ret.find(_from, 0); + if (pos == std::string::npos) { + break; + } + ret.replace(pos, _from.length(), _to); + } + return ret; +} +} // namespace + +std::string IpcGeneratorImpl::SetNames(std::string fileName, std::string packageName) +{ + fileName_ = fileName; + packageName_ = packageName + "::"; + headFileName_ = ""; + + for (size_t i = 0; i < fileName.length(); i++) { + if (fileName.c_str()[i] == '.') { + break; + } + headFileName_ += fileName.c_str()[i]; + } + baseName_ = SwapName(headFileName_); + + serviceCount_ = 0; + + serviceList_.clear(); + enumMessageDict_.clear(); + + return headFileName_; +} + +bool IpcGeneratorImpl::AddService(std::string serviceName) +{ + for (int i = 0; i < serviceCount_; i++) { + if (serviceList_[i].serviceName_ == serviceName) { + return false; + } + } + serviceList_[serviceCount_].serviceName_ = serviceName; + serviceCount_++; + return true; +} + +bool IpcGeneratorImpl::AddServiceMethod(std::string serviceName, + std::string methodName, + std::string requestName, + std::string responseName) +{ + for (int i = 0; i < serviceCount_; i++) { + if (serviceList_[i].serviceName_ == serviceName) { + return serviceList_[i].AddMethod(methodName, requestName, responseName); + } + } + return false; +} + +void IpcGeneratorImpl::GenerateHeader(std::string& header_str) +{ + for (int i = 0; i < serviceCount_; i++) { + std::string server_class_name = serviceList_[i].serviceName_ + "Server"; + header_str = ReplaceStr(header_str, "#SERVICE_CLASS_NAME#", server_class_name); + + std::string tmp1 = ""; + std::string tmp2 = ""; + for (int j = 0; j < serviceList_[i].methodCount_; j++) { + tmp1 += "\tvirtual bool " + serviceList_[i].methodList_[j] + "(SocketContext &context," + packageName_ + + serviceList_[i].requestList_[j] + " &request," + packageName_ + serviceList_[i].responseList_[j] + + " &response);\n"; + + tmp2 += "\tbool SendResponse" + serviceList_[i].responseList_[j] + "(SocketContext &context," + + packageName_ + serviceList_[i].responseList_[j] + " &response);\n"; + } + tmp1 += "\n" + tmp2; + header_str = ReplaceStr(header_str, "#RESPONSE_DEFINE#", tmp1); + + std::string client_class_name = serviceList_[i].serviceName_ + "Client"; + header_str = ReplaceStr(header_str, "#CLIENT_CLASS_NAME#", client_class_name); + + tmp1 = ""; + for (int j = 0; j < serviceList_[i].methodCount_; j++) { + tmp1 += "\tbool " + serviceList_[i].methodList_[j] + "(" + packageName_ + serviceList_[i].requestList_[j]; + tmp1 += " &request," + packageName_ + serviceList_[i].responseList_[j]; + tmp1 += " &response,uint32_t timeout_ms=5000);\n"; + tmp1 += "\tbool " + serviceList_[i].methodList_[j] + "(" + packageName_ + serviceList_[i].requestList_[j]; + tmp1 += " &request);\n"; + } + tmp1 += "\n"; + for (int j = 0; j < serviceList_[i].methodCount_; j++) { + tmp1 += "\tvirtual bool On" + serviceList_[i].responseList_[j] + "(SocketContext &context," + packageName_; + tmp1 += serviceList_[i].responseList_[j] + " &response);\n"; + } + + header_str = ReplaceStr(header_str, "#VIRTUAL_RESPONSE_FUNC#", tmp1); + } +} + +std::string IpcGeneratorImpl::GenHeader() +{ + std::string header_str = BASE_HEADER_STRING; + std::string tmp1, tmp2; + header_str = ReplaceStr(header_str, "#HEAD_FILE_NAME#", headFileName_); + + if (serviceCount_ > 0) { + tmp1 = "enum {\n"; + for (int i = 0; i < serviceCount_; i++) { + for (int j = 0; j < serviceList_[i].methodCount_; j++) { + tmp1 += "\tIpcProtocol" + baseName_ + serviceList_[i].requestList_[j]; + tmp1 += "=" + std::to_string(j * 2) + ",\n"; + tmp1 += "\tIpcProtocol" + baseName_ + serviceList_[i].responseList_[j]; + tmp1 += "=" + std::to_string(j * 2 + 1) + ",\n"; + } + } + tmp1 += "};"; + } else { + tmp1 = ""; + } + header_str = ReplaceStr(header_str, "#PROTOCOL_ENUM#", tmp1); + + GenerateHeader(header_str); + header_str = ReplaceStr(header_str, "\t", " "); + return header_str; +} + +namespace { +const std::string SEND_RESPONSE_IMPL_STRING = R"( +bool #SERVER_CLASS_NAME#::SendResponse#RESPONSE_NAME#(SocketContext &context, + #PACKAGE_NAME##RESPONSE_NAME# &response) { + context.SendProtobuf(#ENUM_STR#, response); + return false; +} +)"; +} +std::string IpcGeneratorImpl::GenSendResponseImpl(int servicep, const std::string& server_class_name) +{ + std::string ret = ""; + for (int j = 0; j < serviceList_[servicep].methodCount_; j++) { + std::string enum_str = "IpcProtocol" + baseName_ + serviceList_[servicep].responseList_[j]; + std::string tmp = ReplaceStr(SEND_RESPONSE_IMPL_STRING, "#SERVER_CLASS_NAME#", server_class_name); + tmp = ReplaceStr(tmp, "#RESPONSE_NAME#", serviceList_[servicep].responseList_[j]); + tmp = ReplaceStr(tmp, "#PACKAGE_NAME#", packageName_); + tmp = ReplaceStr(tmp, "#ENUM_STR#", enum_str); + ret += tmp; + } + return ret; +} +namespace { +const std::string ON_RESPONSE_IMPL_STRING = R"( +bool #CLIENT_CLASS_NAME#::On#RESPONSE_NAME#(SocketContext &context, #PACKAGE_NAME##RESPONSE_NAME# &response) { + return false; +} +)"; +} +std::string IpcGeneratorImpl::GenOnResponseImpl(int servicep, const std::string& client_class_name) +{ + std::string ret = ""; + for (int j = 0; j < serviceList_[servicep].methodCount_; j++) { + std::string tmp = ReplaceStr(ON_RESPONSE_IMPL_STRING, "#CLIENT_CLASS_NAME#", client_class_name); + tmp = ReplaceStr(tmp, "#RESPONSE_NAME#", serviceList_[servicep].responseList_[j]); + tmp = ReplaceStr(tmp, "#PACKAGE_NAME#", packageName_); + ret += tmp; + } + return ret; +} +namespace { +const std::string SERVICE_CALL_IMPL_STRING = R"( +bool #SERVER_CLASS_NAME#::#METHOD_NAME#(SocketContext &context, + #PACKAGE_NAME##REQUEST_NAME# &request, + #PACKAGE_NAME##RESPONSE_NAME# &response){ + return false; +} +)"; +} +std::string IpcGeneratorImpl::GenServiceCallImpl(int servicep, const std::string& server_class_name) +{ + std::string ret = ""; + for (int j = 0; j < serviceList_[servicep].methodCount_; j++) { + std::string tmp = ReplaceStr(SERVICE_CALL_IMPL_STRING, "#SERVER_CLASS_NAME#", server_class_name); + tmp = ReplaceStr(tmp, "#SERVER_CLASS_NAME#", server_class_name); + tmp = ReplaceStr(tmp, "#METHOD_NAME#", serviceList_[servicep].methodList_[j]); + tmp = ReplaceStr(tmp, "#REQUEST_NAME#", serviceList_[servicep].requestList_[j]); + tmp = ReplaceStr(tmp, "#RESPONSE_NAME#", serviceList_[servicep].responseList_[j]); + tmp = ReplaceStr(tmp, "#PACKAGE_NAME#", packageName_); + ret += tmp; + } + return ret; +} +namespace { +const std::string CLIENT_PROC_IMPL_STRING = R"( + case IpcProtocol#BASE_NAME##REQUEST_NAME#:{ + #PACKAGE_NAME##REQUEST_NAME# request; + #PACKAGE_NAME##RESPONSE_NAME# response; + request.ParseFromArray(buf, size); + if (#METHOD_NAME#(context, request, response)) { + context.SendProtobuf(IpcProtocol#BASE_NAME##RESPONSE_NAME#, response); + } + } + break; +)"; +} +std::string IpcGeneratorImpl::GenClientProcImpl(int servicep) +{ + std::string ret = ""; + for (int j = 0; j < serviceList_[servicep].methodCount_; j++) { + std::string tmp = ReplaceStr(CLIENT_PROC_IMPL_STRING, "#BASE_NAME#", baseName_); + tmp = ReplaceStr(tmp, "#PACKAGE_NAME#", packageName_); + tmp = ReplaceStr(tmp, "#METHOD_NAME#", serviceList_[servicep].methodList_[j]); + tmp = ReplaceStr(tmp, "#REQUEST_NAME#", serviceList_[servicep].requestList_[j]); + tmp = ReplaceStr(tmp, "#RESPONSE_NAME#", serviceList_[servicep].responseList_[j]); + tmp = ReplaceStr(tmp, "#PACKAGE_NAME#", packageName_); + ret += tmp; + } + return ret; +} +namespace { +const std::string CLIENT_REQUEST_IMPL_STRING = R"( +bool #CLIENT_CLASS_NAME#::#METHOD_NAME#(#PACKAGE_NAME##REQUEST_NAME# &request, + #PACKAGE_NAME##RESPONSE_NAME# &response, + uint32_t timeout_ms) +{ + mWait_.lock(); + if (timeout_ms<=0) { + timeout_ms=WAIT_FOR_EVER; + } + waitingFor=IpcProtocol#BASE_NAME##RESPONSE_NAME#; + presponse=&response; + unixSocketClient_->SendProtobuf(IpcProtocol#BASE_NAME##REQUEST_NAME#, request); + + if (mWait_.try_lock_for(std::chrono::milliseconds(timeout_ms))) { + mWait_.unlock(); + return true; + } + waitingFor=-1; + mWait_.unlock(); + return false; +} +bool #CLIENT_CLASS_NAME#::#METHOD_NAME#(#PACKAGE_NAME##REQUEST_NAME# &request) +{ + unixSocketClient_->SendProtobuf(IpcProtocol#BASE_NAME##REQUEST_NAME#, request); + return true; +} +)"; +} +std::string IpcGeneratorImpl::GenClientRequestImpl(int servicep, const std::string& client_class_name) +{ + std::string ret = ""; + for (int j = 0; j < serviceList_[servicep].methodCount_; j++) { + std::string tmp = ReplaceStr(CLIENT_REQUEST_IMPL_STRING, "#CLIENT_CLASS_NAME#", client_class_name); + tmp = ReplaceStr(tmp, "#METHOD_NAME#", serviceList_[servicep].methodList_[j]); + tmp = ReplaceStr(tmp, "#PACKAGE_NAME#", packageName_); + tmp = ReplaceStr(tmp, "#REQUEST_NAME#", serviceList_[servicep].requestList_[j]); + tmp = ReplaceStr(tmp, "#RESPONSE_NAME#", serviceList_[servicep].responseList_[j]); + tmp = ReplaceStr(tmp, "#BASE_NAME#", baseName_); + ret += tmp; + } + return ret; +} +namespace { +const std::string SERVICE_PROC_IMPL_STRING = R"( + case IpcProtocol#BASE_NAME##RESPONSE_NAME#: + { + if (waitingFor==pnum) { + presponse->ParseFromArray(buf, size); + } + else { + #PACKAGE_NAME##RESPONSE_NAME# response#NUM#; + response#NUM#.ParseFromArray(buf, size); + On#RESPONSE_NAME#(context, response#NUM#); + } + } + break; +)"; +} +std::string IpcGeneratorImpl::GenServiceProcImpl(int servicep) +{ + std::string ret = ""; + for (int j = 0; j < serviceList_[servicep].methodCount_; j++) { + std::string tmp = ReplaceStr(SERVICE_PROC_IMPL_STRING, "#BASE_NAME#", baseName_); + tmp = ReplaceStr(tmp, "#RESPONSE_NAME#", serviceList_[servicep].responseList_[j]); + tmp = ReplaceStr(tmp, "#PACKAGE_NAME#", packageName_); + tmp = ReplaceStr(tmp, "#NUM#", std::to_string(j + 1)); + + ret += tmp; + } + return ret; +} + +std::string IpcGeneratorImpl::GenSource() +{ + std::string source_str = BASE_SOURCE_STRING; + + source_str = ReplaceStr(source_str, "#HEAD_FILE_NAME#", headFileName_); + + for (int i = 0; i < serviceCount_; i++) { + std::string server_class_name = serviceList_[i].serviceName_ + "Server"; + source_str = ReplaceStr(source_str, "#SERVICE_CLASS_NAME#", server_class_name); + source_str = ReplaceStr(source_str, "#SERVICE_NAME#", serviceList_[i].serviceName_); + std::string client_class_name = serviceList_[i].serviceName_ + "Client"; + source_str = ReplaceStr(source_str, "#CLIENT_CLASS_NAME#", client_class_name); + + source_str = ReplaceStr(source_str, "#RESPONSE_IMPLEMENT#", GenSendResponseImpl(i, server_class_name)); + source_str = ReplaceStr(source_str, "#CLIENT_SEND_REQUEST_PROC_FUNC#", GenOnResponseImpl(i, client_class_name)); + + source_str = ReplaceStr(source_str, "#SERVICE_PROTOCOL_PROC_FUNC#", GenServiceCallImpl(i, server_class_name)); + source_str = ReplaceStr(source_str, "#SERVICE_PROTOCOL_PROC#", GenClientProcImpl(i)); + source_str = ReplaceStr(source_str, "#SERVICE_NAME#", serviceList_[i].serviceName_); + + source_str = ReplaceStr(source_str, "#CLIENT_PROTOCOL_PROC#", GenServiceProcImpl(i)); + source_str = + ReplaceStr(source_str, "#CLIENT_SEND_PROTOCOL_PROC_FUNC#", GenClientRequestImpl(i, client_class_name)); + } + + source_str = ReplaceStr(source_str, "\t", " "); + return source_str; +} diff --git a/device/services/ipc/src/main.cpp b/device/services/ipc/src/main.cpp new file mode 100755 index 000000000..ad80d22c1 --- /dev/null +++ b/device/services/ipc/src/main.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ipc_generator.h" +#include + +int main(int argc, char* argv[]) +{ + IpcGenerator generator; + return google::protobuf::compiler::PluginMain(argc, argv, &generator); +} \ No newline at end of file diff --git a/device/services/ipc/src/service_entry.cpp b/device/services/ipc/src/service_entry.cpp new file mode 100755 index 000000000..77daa641d --- /dev/null +++ b/device/services/ipc/src/service_entry.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "service_entry.h" +#include "logging.h" +#include "service_base.h" +#include "unix_socket_server.h" + +ServiceEntry::ServiceEntry() +{ + unixSocketServer_ = nullptr; +} +ServiceEntry::~ServiceEntry() {} +bool ServiceEntry::StartServer(const std::string& addrname) +{ + CHECK_TRUE(unixSocketServer_ == nullptr, false, "Servier Already Started"); + + auto server = std::make_shared(); + + CHECK_TRUE(server->StartServer(addrname, *this), false, "StartServer FAIL"); + + unixSocketServer_ = server; + return true; +} + +bool ServiceEntry::RegisterService(ServiceBase& psb) +{ + CHECK_TRUE(serviceMap_.find(psb.serviceName_) == serviceMap_.end(), false, "RegisterService FAIL"); + serviceMap_[psb.serviceName_] = &psb; + return true; +} +const ServiceBase* ServiceEntry::FindServiceByName(const std::string& service_name) +{ + CHECK_TRUE(serviceMap_.find(service_name) != serviceMap_.end(), nullptr, "FindServiceByName FAIL %s", + service_name.c_str()); + + return serviceMap_[service_name]; +} + +namespace { +const int MS_PER_S = 1000; +const int US_PER_S = 1000000; +const int NS_PER_US = 1000; +const int NS_PER_S = 1000000000; +const int NS_PER_MS = 1000000; +} // namespace + +uint64_t GetTimeMS() +{ + struct timespec ts; + clock_gettime(CLOCK_BOOTTIME, &ts); + return ts.tv_sec * MS_PER_S + ts.tv_nsec / NS_PER_MS; +} + +uint64_t GetTimeUS() +{ + struct timespec ts; + clock_gettime(CLOCK_BOOTTIME, &ts); + return ts.tv_sec * US_PER_S + ts.tv_nsec / NS_PER_US; +} + +uint64_t GetTimeNS() +{ + struct timespec ts; + clock_gettime(CLOCK_BOOTTIME, &ts); + return ts.tv_sec * NS_PER_S + ts.tv_nsec; +} \ No newline at end of file diff --git a/device/services/ipc/src/socket_context.cpp b/device/services/ipc/src/socket_context.cpp new file mode 100755 index 000000000..316da08d0 --- /dev/null +++ b/device/services/ipc/src/socket_context.cpp @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "socket_context.h" + +#include +#include +#include +#include + +#include "logging.h" +#include "securec.h" +#include "service_base.h" +#include "service_entry.h" + +namespace { +const int PROTO_SIZE_MAX = 1024 * 1024; +const int MEMORY_BLOCK_UNIT = 4096; +} // namespace + +SocketContext::SocketContext() +{ + socketHandle_ = -1; + clientState_ = CLIENT_STAT_WORKING; + lastProcMS_ = 0; + serviceBase_ = nullptr; +} + +SocketContext::~SocketContext() +{ + if (socketHandle_ >= 0) { + close(socketHandle_); + socketHandle_ = -1; + } + if (recvThread_.joinable()) { + recvThread_.join(); + } +} + +int SocketContext::RawProtocolProc(uint32_t pnum, const int8_t* buf, const uint32_t size) +{ + return -1; +} + +bool ReceiveData(int sock, uint8_t* databuf, uint32_t size) +{ + uint32_t p = 0; + if (sock < 0) { + return false; + } + while (p < size) { + int ret = recv(sock, &databuf[p], size - p, 0); + if (ret <= 0) { + if (ret == -1 && errno == EAGAIN) { + continue; + } + return false; + } + p += ret; + } + return true; +} + +void* SocketContext::UnixSocketRecv(void* pp) +{ + pthread_setname_np(pthread_self(), "UnixSocketRecv"); + + uint32_t bufferSize = MEMORY_BLOCK_UNIT; + + SocketContext* pssr = (SocketContext*)pp; + std::vector buf(bufferSize); + + struct ProtocolHead* pph = (struct ProtocolHead*)buf.data(); + uint32_t head_size = sizeof(struct ProtocolHead); + + CHECK_TRUE(pssr->socketHandle_ != -1, nullptr, "UnixSocketRecv pssr->socketHandle_ ==-1"); + struct timeval timeout = {1, 0}; + CHECK_TRUE(setsockopt(pssr->socketHandle_, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)) == 0, nullptr, + "setsockopt %s", strerror(errno)); + while (pssr->socketHandle_ >= 0) { + if (!ReceiveData(pssr->socketHandle_, buf.data(), head_size)) { + HILOG_DEBUG(LOG_CORE, "====== IPC LOST CONNECT ======"); + break; + } + if (pph->protoSize > bufferSize) { + if (pph->protoSize > PROTO_SIZE_MAX) { + HILOG_ERROR(LOG_CORE, "buffer size out of range %d/%d", pph->protoSize, PROTO_SIZE_MAX); + break; + } + bufferSize = (pph->protoSize / MEMORY_BLOCK_UNIT + 1) * MEMORY_BLOCK_UNIT; + buf.resize(bufferSize); + pph = (struct ProtocolHead*)buf.data(); + } + + if (!ReceiveData(pssr->socketHandle_, buf.data() + head_size, pph->protoSize - head_size)) { + HILOG_DEBUG(LOG_CORE, "====== IPC LOST CONNECT ======"); + break; + } + switch (pph->protoType & PROTOCOL_TYPE_FILTER) { + case PROTOCOL_TYPE_RAW: + pssr->RawProtocolProc(pph->protoType & (~PROTOCOL_TYPE_FILTER), pph->datas, pph->protoSize - head_size); + break; + case PROTOCOL_TYPE_PROTOBUF: + if (pssr->serviceBase_ != nullptr) { + pssr->serviceBase_->ProtocolProc(*pssr, pph->protoType & (~PROTOCOL_TYPE_FILTER), pph->datas, + pph->protoSize - head_size); + } + break; + default: + HILOG_ERROR(LOG_CORE, "unknown protocol %d", pph->protoType); + break; + } + } + pssr->clientState_ = CLIENT_STAT_THREAD_EXITED; + return nullptr; +} + +bool SocketContext::CreateRecvThread() +{ + recvThread_ = std::thread(&SocketContext::UnixSocketRecv, this); + CHECK_TRUE(recvThread_.get_id() != std::thread::id(), false, "CreateRecvThread FAIL"); + return true; +} + +bool SocketContext::SendRaw(uint32_t pnum, const int8_t* data, uint32_t size, int sockfd) +{ + if (data == nullptr) { + return false; + } + if (sockfd == -1) { + sockfd = socketHandle_; + } + struct ProtocolHead phead; + phead.protoType = PROTOCOL_TYPE_RAW | pnum; + phead.protoSize = size + sizeof(struct ProtocolHead); + CHECK_TRUE(send(sockfd, reinterpret_cast(&phead), sizeof(struct ProtocolHead), 0) != -1, false, + "SendRaw Send Head ERR :%s", strerror(errno)); + + CHECK_TRUE(send(sockfd, data, size, 0) != -1, false, "SendRaw Send Data ERR : %s", strerror(errno)); + return true; +} + +bool SocketContext::SendProtobuf(uint32_t pnum, google::protobuf::Message& pmsg) +{ + int size = pmsg.ByteSizeLong(); + int8_t* data = reinterpret_cast(malloc(size)); + if (data == nullptr) { + return false; + } + pmsg.SerializeToArray(data, size); + struct ProtocolHead phead; + phead.protoType = PROTOCOL_TYPE_PROTOBUF | pnum; + phead.protoSize = size + sizeof(struct ProtocolHead); + send(socketHandle_, reinterpret_cast(&phead), sizeof(struct ProtocolHead), 0); + send(socketHandle_, data, size, 0); + + free(data); + return true; +} + +bool SocketContext::SendFileDescriptor(int fd) +{ + struct msghdr msg = {0}; + struct cmsghdr* cmsg = nullptr; + char buf[CMSG_SPACE(1 * sizeof(int))], data; + if (memset_s(buf, sizeof(buf), 0, sizeof(buf)) != EOK) { + HILOG_ERROR(LOG_CORE, "memset_s error!"); + } + struct iovec io = {.iov_base = &data, .iov_len = 1}; + msg.msg_iov = &io; + msg.msg_iovlen = 1; + msg.msg_control = buf; + msg.msg_controllen = sizeof(buf); + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(int) * 1); + if (memcpy_s(CMSG_DATA(cmsg), 1 * sizeof(int), &fd, 1 * sizeof(int)) != EOK) { + HILOG_ERROR(LOG_CORE, "memcpy_s error"); + } + + CHECK_TRUE(sendmsg(socketHandle_, &msg, 0) != -1, false, "SendFileDescriptor FAIL"); + return true; +} + +int SocketContext::ReceiveFileDiscriptor() +{ + struct msghdr msg = {0}; + struct cmsghdr* cmsg = nullptr; + char buf[CMSG_SPACE(1 * sizeof(int))], data; + struct iovec io = {.iov_base = &data, .iov_len = 1}; + msg.msg_iov = &io; + msg.msg_iovlen = 1; + msg.msg_control = buf; + msg.msg_controllen = sizeof(buf); + + CHECK_TRUE(recvmsg(socketHandle_, &msg, 0) != -1, -1, "ReceiveFileDiscriptor FAIL"); + + cmsg = CMSG_FIRSTHDR(&msg); + + return cmsg ? *(int*)CMSG_DATA(cmsg) : -1; +} diff --git a/device/services/ipc/src/unix_socket_client.cpp b/device/services/ipc/src/unix_socket_client.cpp new file mode 100755 index 000000000..7c674f5b4 --- /dev/null +++ b/device/services/ipc/src/unix_socket_client.cpp @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "unix_socket_client.h" + +#include +#include +#include +#include +#include + +#include "logging.h" +#include "securec.h" +#include "service_base.h" + +UnixSocketClient::UnixSocketClient() +{ + serviceBase_ = nullptr; + socketHandle_ = -1; +} + +UnixSocketClient::~UnixSocketClient() {} + +bool UnixSocketClient::Connect(const std::string addrname, ServiceBase& serviceBase) +{ + CHECK_TRUE(socketHandle_ == -1, false, "socketHandle_ != -1 Already Connected"); + + int sock = socket(AF_UNIX, SOCK_STREAM, 0); + CHECK_TRUE(sock != -1, false, "Unix Socket Create FAIL"); + + struct sockaddr_un addr; + if (memset_s(&addr, sizeof(struct sockaddr_un), 0, sizeof(struct sockaddr_un)) != EOK) { + HILOG_ERROR(LOG_CORE, "memset_s error!"); + } + addr.sun_family = AF_UNIX; + if (strncpy_s(addr.sun_path, UNIX_PATH_MAX, addrname.c_str(), sizeof(addr.sun_path) - 1) != EOK) { + HILOG_ERROR(LOG_CORE, "strncpy_s error!"); + } + + CHECK_TRUE(connect(sock, (struct sockaddr*)&addr, sizeof(struct sockaddr_un)) != -1, close(sock) != 0, + "Unix Socket Connect FAIL"); + + serviceBase_ = &serviceBase; + struct RawPointToService rrs; + if (strncpy_s(rrs.serviceName_, sizeof(rrs.serviceName_), + serviceBase_->serviceName_.c_str(), serviceBase_->serviceName_.size()) != EOK) { + HILOG_ERROR(LOG_CORE, "strncpy_s error!"); + } + rrs.serviceName_[serviceBase_->serviceName_.size()] = 0; + CHECK_TRUE( + SendRaw(RAW_PROTOCOL_POINTTO_SERVICE, reinterpret_cast(&rrs), sizeof(struct RawPointToService), sock), + close(sock) != 0, "Unix Socket SendRaw FAIL"); + CHECK_TRUE(CreateRecvThread(), close(sock) != 0, "Unix Socket Create Recv Thread FAIL"); + socketHandle_ = sock; + return true; +} diff --git a/device/services/ipc/src/unix_socket_server.cpp b/device/services/ipc/src/unix_socket_server.cpp new file mode 100755 index 000000000..f60bfde2f --- /dev/null +++ b/device/services/ipc/src/unix_socket_server.cpp @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "unix_socket_server.h" + +#include +#include +#include +#include +#include +#include + +#include "client_map.h" +#include "logging.h" +#include "securec.h" + +UnixSocketServer::UnixSocketServer() +{ + sAddrName_ = ""; + socketHandle_ = -1; + serviceEntry_ = nullptr; +} + +UnixSocketServer::~UnixSocketServer() +{ + if (socketHandle_ != 1) { + close(socketHandle_); + socketHandle_ = -1; + unlink(sAddrName_.c_str()); + } + if (acceptThread_.joinable()) { + acceptThread_.join(); + } +} + +void* UnixSocketServer::UnixSocketAccept(void* p) +{ + if (p == nullptr) { + return nullptr; + } + pthread_setname_np(pthread_self(), "UnixSocketAccept"); + + UnixSocketServer* puss = (UnixSocketServer*)p; + if (puss == nullptr) { + return nullptr; + } + CHECK_TRUE(puss->socketHandle_ != -1, nullptr, "Unix Socket Accept socketHandle_ == -1"); + int epfd = epoll_create(1); + struct epoll_event evt; + evt.data.fd = puss->socketHandle_; + evt.events = EPOLLIN | EPOLLET; + CHECK_TRUE(epoll_ctl(epfd, EPOLL_CTL_ADD, puss->socketHandle_, &evt) != -1, nullptr, "Unix Socket Server Exit"); + int nfds; + while (puss->socketHandle_ != -1) { + nfds = epoll_wait(epfd, &evt, 1, 1000); // timeout value set 1000. + if (nfds > 0) { + int clientSocket = accept(puss->socketHandle_, nullptr, nullptr); + HILOG_INFO(LOG_CORE, "Accept A Client %d", clientSocket); + ClientMap::GetInstance().PutClientSocket(clientSocket, *puss->serviceEntry_); + } + } + close(epfd); + return nullptr; +} + +namespace { +const int UNIX_SOCKET_LISTEN_COUNT = 5; +} +bool UnixSocketServer::StartServer(const std::string& addrname, ServiceEntry& p) +{ + CHECK_TRUE(socketHandle_ == -1, false, "StartServer FAIL socketHandle_ != -1"); + + struct sockaddr_un addr; + int sock = socket(AF_UNIX, SOCK_STREAM, 0); + CHECK_TRUE(sock != -1, false, "StartServer FAIL create socket ERR : %s", strerror(errno)); + + if (memset_s(&addr, sizeof(struct sockaddr_un), 0, sizeof(struct sockaddr_un)) != EOK) { + HILOG_ERROR(LOG_CORE, "memset_s error!"); + } + addr.sun_family = AF_UNIX; + if (strncpy_s(addr.sun_path, UNIX_PATH_MAX, addrname.c_str(), sizeof(addr.sun_path) - 1) != EOK) { + HILOG_ERROR(LOG_CORE, "strncpy_s error!"); + } + unlink(addrname.c_str()); + CHECK_TRUE(bind(sock, (struct sockaddr*)&addr, sizeof(struct sockaddr_un)) == 0, close(sock) != 0, + "StartServer FAIL bind ERR : %s", strerror(errno)); + + CHECK_TRUE(listen(sock, UNIX_SOCKET_LISTEN_COUNT) != -1, close(sock) != 0 && unlink(addrname.c_str()) == 0, + "StartServer FAIL listen ERR : %s", strerror(errno)); + + socketHandle_ = sock; + acceptThread_ = std::thread(&UnixSocketServer::UnixSocketAccept, this); + if (acceptThread_.get_id() == std::thread::id()) { + close(socketHandle_); + unlink(addrname.c_str()); + HILOG_ERROR(LOG_CORE, "StartServer FAIL pthread_create ERR : %s", strerror(errno)); + socketHandle_ = -1; + return false; + } + + serviceEntry_ = &p; + sAddrName_ = addrname; + return true; +} diff --git a/device/services/ipc/test/BUILD.gn b/device/services/ipc/test/BUILD.gn new file mode 100755 index 000000000..b5f9a4669 --- /dev/null +++ b/device/services/ipc/test/BUILD.gn @@ -0,0 +1,62 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/test.gni") +import("../../../base/config.gni") + +module_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/device" +config("module_private_config") { + visibility = [":*"] +} + +ohos_unittest("ipc_ut") { + module_out_path = module_output_path + sources = [ + "../src/ipc_generator_impl.cpp", + "unittest/client_connection_test.cpp", + "unittest/client_map_test.cpp", + "unittest/ipc_generator_impl_test.cpp", + "unittest/service_base_test.cpp", + "unittest/service_entry_test.cpp", + "unittest/socket_context_test.cpp", + "unittest/unix_socket_client_test.cpp", + "unittest/unix_socket_server_test.cpp", + ] + include_dirs = [ + "${OHOS_PROFILER_DIR}/device/services/ipc/include", + "//third_party/googletest/googletest/include/gtest", + ] + deps = [ + "../:ipc", + "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory", + "${OHOS_PROFILER_DIR}/protos/services:plugin_services_proto", + "${OHOS_PROFILER_DIR}/protos/services:service_types_proto", + "//third_party/googletest:gtest", + ] + cflags = [ + "-Wno-inconsistent-missing-override", + "-Dprivate=public", #allow test code access private members + "-Dprotected=public", #allow test code access private members + ] + external_deps = [ + "hiviewdfx_hilog_native:libhilog", + ] + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} + +group("unittest") { + testonly = true + deps = [ + ":ipc_ut", + ] +} diff --git a/device/services/ipc/test/unittest/client_connection_test.cpp b/device/services/ipc/test/unittest/client_connection_test.cpp new file mode 100755 index 000000000..42fa7dcca --- /dev/null +++ b/device/services/ipc/test/unittest/client_connection_test.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "client_connection.h" +#include "service_entry.h" + +using namespace testing::ext; + +namespace { +class ClientConnectionTest : public testing::Test { +public: + static void SetUpTestCase() {} + + static void TearDownTestCase() {} + void SetUp() {} + void TearDown() {} +}; + +/** + * @tc.name: Service + * @tc.desc: Client connection. + * @tc.type: FUNC + */ +HWTEST_F(ClientConnectionTest, RawProtocolProc, TestSize.Level1) +{ + ServiceEntry serviceEntry; + ClientConnection* clientConnection = new ClientConnection(0, serviceEntry); + ASSERT_EQ(clientConnection->RawProtocolProc(-1, nullptr, 0), -1); +} +} // namespace \ No newline at end of file diff --git a/device/services/ipc/test/unittest/client_map_test.cpp b/device/services/ipc/test/unittest/client_map_test.cpp new file mode 100755 index 000000000..b0bbc66b3 --- /dev/null +++ b/device/services/ipc/test/unittest/client_map_test.cpp @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "client_map.h" +#include "service_entry.h" + +using namespace testing::ext; + +namespace { +class ClientMapTest : public testing::Test { +public: + static void SetUpTestCase() {} + + static void TearDownTestCase() {} + void SetUp() {} + void TearDown() {} +}; + +/** + * @tc.name: Service + * @tc.desc: Client map performance. + * @tc.type: FUNC + */ +HWTEST_F(ClientMapTest, ClientSocket, TestSize.Level1) +{ + ServiceEntry serviceEntry; + ClientMap::GetInstance(); + ClientMap::GetInstance().PutClientSocket(0, serviceEntry); + ASSERT_EQ(ClientMap::GetInstance().AutoRelease(), 1); +} +} // namespace \ No newline at end of file diff --git a/device/services/ipc/test/unittest/ipc_generator_impl_test.cpp b/device/services/ipc/test/unittest/ipc_generator_impl_test.cpp new file mode 100644 index 000000000..c529f02c3 --- /dev/null +++ b/device/services/ipc/test/unittest/ipc_generator_impl_test.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "ipc_generator_impl.h" + +using namespace testing::ext; + +namespace { +class IpcGeneratorImplTest : public testing::Test { +public: + static void SetUpTestCase() {} + + static void TearDownTestCase() {} + void SetUp() {} + void TearDown() {} +}; + +/** + * @tc.name: Service + * @tc.desc: IPC process testing. + * @tc.type: FUNC + */ +HWTEST_F(IpcGeneratorImplTest, NormalCase, TestSize.Level1) +{ + IpcGeneratorImpl ipcGeneratorImpl; + ASSERT_TRUE(ipcGeneratorImpl.SetNames("test.proto", "") == "test"); + + ASSERT_TRUE(ipcGeneratorImpl.AddService("TestService")); + ASSERT_TRUE(!ipcGeneratorImpl.AddService("TestService")); + + ASSERT_TRUE(ipcGeneratorImpl.AddServiceMethod("TestService", "DoTest", "DoTestRequest", "DoTestResponse")); + ASSERT_TRUE(ipcGeneratorImpl.AddServiceMethod("TestService", "DoTest2", "DoTest2Request", "DoTest2Response")); + ASSERT_TRUE(!ipcGeneratorImpl.AddServiceMethod("TestService", "DoTest", "DoTestRequest", "DoTestResponse")); + ipcGeneratorImpl.GenHeader(); + ipcGeneratorImpl.GenSource(); +} +} // namespace \ No newline at end of file diff --git a/device/services/ipc/test/unittest/service_base_test.cpp b/device/services/ipc/test/unittest/service_base_test.cpp new file mode 100755 index 000000000..418acb816 --- /dev/null +++ b/device/services/ipc/test/unittest/service_base_test.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "service_base.h" +#include "socket_context.h" + +using namespace testing::ext; + +namespace { +class ServiceBaseTest : public testing::Test { +public: + static void SetUpTestCase() {} + static void TearDownTestCase() {} + void SetUp() {} + void TearDown() {} +}; + +/** + * @tc.name: Service + * @tc.desc: Abnormal socket detection.. + * @tc.type: FUNC + */ +HWTEST_F(ServiceBaseTest, ProtocolProc, TestSize.Level1) +{ + ServiceBase serviceBase; + SocketContext socketContext; + ASSERT_FALSE(serviceBase.ProtocolProc(socketContext, 0, nullptr, 0)); +} +} // namespace \ No newline at end of file diff --git a/device/services/ipc/test/unittest/service_entry_test.cpp b/device/services/ipc/test/unittest/service_entry_test.cpp new file mode 100755 index 000000000..5578d9da1 --- /dev/null +++ b/device/services/ipc/test/unittest/service_entry_test.cpp @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "plugin_service.ipc.h" +#include "service_entry.h" + +using namespace testing::ext; +namespace { +class ServiceEntryTest : public testing::Test { +public: + static void SetUpTestCase() {} + + static void TearDownTestCase() {} + void SetUp() {} + void TearDown() {} +}; + +/** + * @tc.name: Service + * @tc.desc: Server process monitoring. + * @tc.type: FUNC + */ +HWTEST_F(ServiceEntryTest, AllCase, TestSize.Level1) +{ + ServiceEntry serviceEntry; + IPluginServiceServer pluginService; + serviceEntry.StartServer("test_unix_socket_service_entry"); + serviceEntry.RegisterService(pluginService); + serviceEntry.FindServiceByName(pluginService.serviceName_); + + usleep(30000); + + IPluginServiceClient pluginClient; + ASSERT_FALSE(pluginClient.Connect("")); + + usleep(30000); +} + +/** + * @tc.name: Service + * @tc.desc: Gets the time in milliseconds. + * @tc.type: FUNC + */ +HWTEST_F(ServiceEntryTest, GetTimeMS, TestSize.Level1) +{ + GetTimeMS(); +} + +/** + * @tc.name: Service + * @tc.desc: Gets the time in microseconds. + * @tc.type: FUNC + */ +HWTEST_F(ServiceEntryTest, GetTimeUS, TestSize.Level1) +{ + GetTimeUS(); +} + +/** + * @tc.name: Service + * @tc.desc: Gets the time in nanoseconds. + * @tc.type: FUNC + */ +HWTEST_F(ServiceEntryTest, GetTimeNS, TestSize.Level1) +{ + GetTimeNS(); +} +} // namespace \ No newline at end of file diff --git a/device/services/ipc/test/unittest/socket_context_test.cpp b/device/services/ipc/test/unittest/socket_context_test.cpp new file mode 100755 index 000000000..274bd72e9 --- /dev/null +++ b/device/services/ipc/test/unittest/socket_context_test.cpp @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "socket_context.h" + +using namespace testing::ext; + +namespace { +class SocketContextTest : public testing::Test { +public: + static void SetUpTestCase() {} + + static void TearDownTestCase() {} + void SetUp() {} + void TearDown() {} +}; + +/** + * @tc.name: Service + * @tc.desc: Socket send file descriptor test. + * @tc.type: FUNC + */ +HWTEST_F(SocketContextTest, SendFileDescriptor, TestSize.Level1) +{ + SocketContext socketContext; + ASSERT_TRUE(!socketContext.SendFileDescriptor(-1)); +} + +/** + * @tc.name: Service + * @tc.desc: Abnormal socket detection. + * @tc.type: FUNC + */ +HWTEST_F(SocketContextTest, RawProtocolProc, TestSize.Level1) +{ + SocketContext socketContext; + ASSERT_EQ(socketContext.RawProtocolProc(-1, nullptr, -1), -1); +} + +/** + * @tc.name: Service + * @tc.desc: Socket sending test. + * @tc.type: FUNC + */ +HWTEST_F(SocketContextTest, SendRaw, TestSize.Level1) +{ + SocketContext socketContext; + ASSERT_TRUE(!socketContext.SendRaw(-1, nullptr, 0, 0)); +} + +/** + * @tc.name: Service + * @tc.desc: Socket receiving test. + * @tc.type: FUNC + */ +HWTEST_F(SocketContextTest, ReceiveFileDiscriptor, TestSize.Level1) +{ + SocketContext socketContext; + ASSERT_EQ(socketContext.ReceiveFileDiscriptor(), -1); +} +} // namespace \ No newline at end of file diff --git a/device/services/ipc/test/unittest/unix_socket_client_test.cpp b/device/services/ipc/test/unittest/unix_socket_client_test.cpp new file mode 100644 index 000000000..0664ffd70 --- /dev/null +++ b/device/services/ipc/test/unittest/unix_socket_client_test.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "service_base.h" +#include "unix_socket_client.h" + +using namespace testing::ext; + +namespace { +class UnixSocketClientTest : public testing::Test { +public: + static void SetUpTestCase() {} + + static void TearDownTestCase() {} + void SetUp() {} + void TearDown() {} +}; + +/** + * @tc.name: Service + * @tc.desc: Socket client connection. + * @tc.type: FUNC + */ +HWTEST_F(UnixSocketClientTest, Connect, TestSize.Level1) +{ + UnixSocketClient unixSocketClient; + ServiceBase serviceBase; + ASSERT_TRUE(!unixSocketClient.Connect("asdf", serviceBase)); +} +} // namespace \ No newline at end of file diff --git a/device/services/ipc/test/unittest/unix_socket_server_test.cpp b/device/services/ipc/test/unittest/unix_socket_server_test.cpp new file mode 100644 index 000000000..a107ff15c --- /dev/null +++ b/device/services/ipc/test/unittest/unix_socket_server_test.cpp @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "service_entry.h" +#include "unix_socket_server.h" + +using namespace testing::ext; + +namespace { +class UnixSocketServerTest : public testing::Test { +public: + static void SetUpTestCase() {} + + static void TearDownTestCase() {} + void SetUp() {} + void TearDown() {} +}; + +/** + * @tc.name: Service + * @tc.desc: Socket server receives client connection. + * @tc.type: FUNC + */ +HWTEST_F(UnixSocketServerTest, UnixSocketAccept, TestSize.Level1) +{ + UnixSocketServer unixSocketServer; + unixSocketServer.UnixSocketAccept(nullptr); +} + +/** + * @tc.name: Service + * @tc.desc: Start socket server. + * @tc.type: FUNC + */ +HWTEST_F(UnixSocketServerTest, StartServer, TestSize.Level1) +{ + UnixSocketServer unixSocketServer; + ServiceEntry serviceEntry; + ASSERT_TRUE(unixSocketServer.StartServer("", serviceEntry)); +} +} // namespace \ No newline at end of file diff --git a/device/services/plugin_service/BUILD.gn b/device/services/plugin_service/BUILD.gn new file mode 100755 index 000000000..d9389c973 --- /dev/null +++ b/device/services/plugin_service/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("../../base/config.gni") + +ohos_source_set("hiprofiler_plugin_service") { + public_deps = [ + "${OHOS_PROFILER_DIR}/device/services/profiler_service:profiler_service", + "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory", + "${OHOS_PROFILER_DIR}/protos/services:plugin_services_proto", + "${OHOS_PROFILER_DIR}/protos/services:service_types_proto", + ] + include_dirs = [ + "include", + "${OHOS_PROFILER_DIR}/device/services/ipc/include", + "${OHOS_PROFILER_DIR}/device/services/shared_memory/include", + "${OHOS_PROFILER_DIR}/device/services/profiler_service/include", + ] + sources = [ + "src/plugin_command_builder.cpp", + "src/plugin_service.cpp", + "src/plugin_service_impl.cpp", + ] + if (current_toolchain != host_toolchain) { + if (build_l2) { + external_deps = [ "shared_library:libhilog" ] + } else { + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + } + } +} diff --git a/device/services/plugin_service/include/plugin_service.h b/device/services/plugin_service/include/plugin_service.h new file mode 100755 index 000000000..89b19ee50 --- /dev/null +++ b/device/services/plugin_service/include/plugin_service.h @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PLUGIN_SERVICE_H +#define PLUGIN_SERVICE_H + +#include +#include +#include +#include +#include + +#include "common_types.pb.h" +#include "logging.h" +#include "plugin_service_types.pb.h" +#include "profiler_service_types.pb.h" +#include "service_entry.h" + +class PluginServiceImpl; +class ProfilerDataRepeater; +class SocketContext; +class ShareMemoryBlock; +class PluginCommandBuilder; + +using ProfilerDataRepeaterPtr = STD_PTR(shared, ProfilerDataRepeater); +using ProfilerPluginStatePtr = STD_PTR(shared, ProfilerPluginState); + +struct PluginInfo { + uint32_t id = 0; + std::string name; + std::string path; + std::string sha256; + uint32_t bufferSizeHint; + SocketContext* context; +}; + +struct PluginContext { + std::string path; + SocketContext* context; + ProfilerPluginConfig config; + ProfilerDataRepeaterPtr profilerDataRepeater; + std::shared_ptr shareMemoryBlock; + ProfilerPluginStatePtr profilerPluginState; + std::string sha256; + uint32_t bufferSizeHint; +}; + +class PluginService { +public: + PluginService(); + ~PluginService(); + + bool CreatePluginSession(const ProfilerPluginConfig& pluginConfig, + const ProfilerSessionConfig::BufferConfig& bufferConfig, + const ProfilerDataRepeaterPtr& dataRepeater); + bool CreatePluginSession(const ProfilerPluginConfig& pluginConfig, + const ProfilerDataRepeaterPtr& dataRepeater); + bool StartPluginSession(const ProfilerPluginConfig& config); + bool StopPluginSession(const std::string& pluginName); + bool DestroyPluginSession(const std::string& pluginName); + + bool AddPluginInfo(const PluginInfo& pluginInfo); + bool RemovePluginInfo(const PluginInfo& pluginInfo); + + bool AppendResult(NotifyResultRequest& request); + + std::vector GetPluginStatus(); + uint32_t GetPluginIdByName(std::string name); + +private: + std::map pluginContext_; + bool StartService(const std::string& unixSocketName); + + std::map nameIndex_; + + uint32_t pluginIdAutoIncrease_; + std::shared_ptr serviceEntry_; + std::shared_ptr pluginServiceImpl_; + std::shared_ptr pluginCommandBuilder_; + + std::mutex readShareMemory_; + void ReadShareMemoryOneTime(); + + enum ReadShareMemoryStatus { + READ_SHARE_MEMORY_FREE, + READ_SHARE_MEMORY_WORKING, + READ_SHARE_MEMORY_EXIT, + READ_SHARE_MEMORY_UNSPECIFIED, + }; + ReadShareMemoryStatus readShareMemoryThreadStatus_; // 0空闲等待,1工作中,2线程退出 + std::timed_mutex readShareMemoryThreadSleep_; + static void* ReadShareMemoryThread(void* p); + std::thread readShareMemoryThread_; + + uint32_t waitForCommandId_; + std::timed_mutex waitStopSession_; +}; + +#endif // PLUGIN_SERVICE_H \ No newline at end of file diff --git a/device/services/plugin_service/src/plugin_command_builder.cpp b/device/services/plugin_service/src/plugin_command_builder.cpp new file mode 100644 index 000000000..83ac7d4ce --- /dev/null +++ b/device/services/plugin_service/src/plugin_command_builder.cpp @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "plugin_command_builder.h" +#include "common_types.pb.h" +#include "logging.h" +#include "plugin_service_types.pb.h" + +PluginCommandBuilder::PluginCommandBuilder() +{ + cmdIdAutoIncrease_ = 1; +} + +PluginCommandBuilder::~PluginCommandBuilder() {} + +GetCommandResponsePtr PluginCommandBuilder::BuildCreateSessionCmd(const ProfilerPluginConfig& config, + uint32_t bufferSize) +{ + auto cmd = std::make_shared(); + cmd->set_status(0); + cmd->set_has_more(false); + cmd->set_command_id(cmdIdAutoIncrease_); + CreateSessionCmd* csc = cmd->mutable_create_session_cmd(); + csc->add_buffer_sizes(bufferSize); + ProfilerPluginConfig* ppc = csc->add_plugin_configs(); + *ppc = config; + commandHistory_[cmdIdAutoIncrease_] = cmd; + cmdIdAutoIncrease_++; + return cmd; +} + +GetCommandResponsePtr PluginCommandBuilder::BuildDestroySessionCmd(uint32_t pluginId) +{ + auto cmd = std::make_shared(); + cmd->set_status(0); + cmd->set_has_more(false); + cmd->set_command_id(cmdIdAutoIncrease_); + + DestroySessionCmd* dsc = cmd->mutable_destroy_session_cmd(); + dsc->add_plugin_ids(pluginId); + + commandHistory_[cmdIdAutoIncrease_] = cmd; + cmdIdAutoIncrease_++; + return cmd; +} + +GetCommandResponsePtr PluginCommandBuilder::BuildStartSessionCmd(const ProfilerPluginConfig& config, uint32_t pluginId) +{ + auto cmd = std::make_shared(); + cmd->set_status(0); + cmd->set_has_more(false); + cmd->set_command_id(cmdIdAutoIncrease_); + + StartSessionCmd* ssc = cmd->mutable_start_session_cmd(); + ssc->add_plugin_ids(pluginId); + ProfilerPluginConfig* ppc = ssc->add_plugin_configs(); + *ppc = config; + + commandHistory_[cmdIdAutoIncrease_] = cmd; + cmdIdAutoIncrease_++; + return cmd; +} + +GetCommandResponsePtr PluginCommandBuilder::BuildStopSessionCmd(uint32_t pluginId) +{ + auto cmd = std::make_shared(); + cmd->set_status(0); + cmd->set_has_more(false); + cmd->set_command_id(cmdIdAutoIncrease_); + + StopSessionCmd* ssc = cmd->mutable_stop_session_cmd(); + ssc->add_plugin_ids(pluginId); + + commandHistory_[cmdIdAutoIncrease_] = cmd; + cmdIdAutoIncrease_++; + return cmd; +} + +bool PluginCommandBuilder::GetedCommandResponse(uint32_t cmdId) +{ + if (commandHistory_.find(cmdId) == commandHistory_.end()) { + return false; + } + commandHistory_.erase(cmdId); + return true; +} \ No newline at end of file diff --git a/device/services/plugin_service/src/plugin_command_builder.h b/device/services/plugin_service/src/plugin_command_builder.h new file mode 100644 index 000000000..23224a2ef --- /dev/null +++ b/device/services/plugin_service/src/plugin_command_builder.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PLUGIN_COMMAND_BUILDER_H +#define PLUGIN_COMMAND_BUILDER_H + +#include "common_types.pb.h" +#include "logging.h" +#include "plugin_service_types.pb.h" + +using GetCommandResponsePtr = STD_PTR(shared, GetCommandResponse); + +class ProfilerPluginConfig; + +class PluginCommandBuilder { +public: + PluginCommandBuilder(); + ~PluginCommandBuilder(); + GetCommandResponsePtr BuildCreateSessionCmd(const ProfilerPluginConfig& config, uint32_t buffer_size); + GetCommandResponsePtr BuildDestroySessionCmd(uint32_t pluginId); + GetCommandResponsePtr BuildStartSessionCmd(const ProfilerPluginConfig& config, uint32_t pluginId); + GetCommandResponsePtr BuildStopSessionCmd(uint32_t pluginId); + + bool GetedCommandResponse(uint32_t cmdId); + +private: + std::map commandHistory_; + uint32_t cmdIdAutoIncrease_; +}; + +#endif // PLUGIN_COMMAND_BUILDER_H \ No newline at end of file diff --git a/device/services/plugin_service/src/plugin_service.cpp b/device/services/plugin_service/src/plugin_service.cpp new file mode 100755 index 000000000..dd3a4ba1c --- /dev/null +++ b/device/services/plugin_service/src/plugin_service.cpp @@ -0,0 +1,340 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "plugin_service.h" + +#include +#include +#include + +#include "plugin_command_builder.h" +#include "plugin_service_impl.h" +#include "profiler_capability_manager.h" +#include "profiler_data_repeater.h" +#include "securec.h" +#include "share_memory_allocator.h" +#include "socket_context.h" + + +namespace { +const int PAGE_BYTES = 4096; +} + +PluginService::PluginService() +{ + pluginIdAutoIncrease_ = 0; + waitForCommandId_ = 0; + StartService(DEFAULT_UNIX_SOCKET_PATH); + pluginCommandBuilder_ = std::make_shared(); + + waitStopSession_.lock(); + + readShareMemoryThreadStatus_ = READ_SHARE_MEMORY_FREE; + readShareMemoryThreadSleep_.lock(); + + readShareMemoryThread_ = std::thread(&PluginService::ReadShareMemoryThread, this); + if (readShareMemoryThread_.get_id() == std::thread::id()) { + HILOG_ERROR(LOG_CORE, "CreateReadShareMemoryThread FAIL"); + } +} + +PluginService::~PluginService() +{ + readShareMemoryThreadStatus_ = READ_SHARE_MEMORY_EXIT; + readShareMemoryThreadSleep_.unlock(); + readShareMemoryThread_.join(); +} + +bool PluginService::StartService(const std::string& unixSocketName) +{ + pluginServiceImpl_ = std::make_shared(*this); + serviceEntry_ = std::make_shared(); + if (!serviceEntry_->StartServer(unixSocketName)) { + pluginServiceImpl_ = nullptr; + serviceEntry_ = nullptr; + HILOG_DEBUG(LOG_CORE, "Start IPC Service FAIL"); + return false; + } + serviceEntry_->RegisterService(*pluginServiceImpl_.get()); + return true; +} + +bool PluginService::CreatePluginSession(const ProfilerPluginConfig& pluginConfig, + const ProfilerSessionConfig::BufferConfig& bufferConfig, + const ProfilerDataRepeaterPtr& dataRepeater) +{ + CHECK_TRUE(nameIndex_.find(pluginConfig.name()) != nameIndex_.end(), false, + "CreatePluginSession can't find plugin name %s", pluginConfig.name().c_str()); + + uint32_t idx = nameIndex_[pluginConfig.name()]; + pluginContext_[idx].profilerDataRepeater = dataRepeater; + + auto gcr = pluginCommandBuilder_->BuildCreateSessionCmd(pluginConfig, bufferConfig.pages() * PAGE_BYTES); + CHECK_TRUE(gcr != nullptr, false, "CreatePluginSession BuildCreateSessionCmd FAIL %s", pluginConfig.name().c_str()); + + auto smb = ShareMemoryAllocator::GetInstance().CreateMemoryBlockLocal(pluginConfig.name(), + bufferConfig.pages() * PAGE_BYTES); + CHECK_TRUE(smb != nullptr, false, "CreateMemoryBlockLocal FAIL %s", pluginConfig.name().c_str()); + + pluginContext_[idx].shareMemoryBlock = smb; + pluginContext_[idx].profilerPluginState->set_state(ProfilerPluginState::LOADED); + + pluginServiceImpl_->PushCommand(*pluginContext_[idx].context, gcr); + pluginContext_[idx].context->SendFileDescriptor(pluginContext_[idx].shareMemoryBlock->GetfileDescriptor()); + + HILOG_DEBUG(LOG_CORE, "pluginContext_[idx].shareMemoryBlock->GetfileDescriptor = %d", + pluginContext_[idx].shareMemoryBlock->GetfileDescriptor()); + return true; +} +bool PluginService::CreatePluginSession(const ProfilerPluginConfig& pluginConfig, + const ProfilerDataRepeaterPtr& dataRepeater) +{ + CHECK_TRUE(nameIndex_.find(pluginConfig.name()) != nameIndex_.end(), false, + "CreatePluginSession can't find plugin name %s", pluginConfig.name().c_str()); + + uint32_t idx = nameIndex_[pluginConfig.name()]; + HILOG_INFO(LOG_CORE, "idx=%d", idx); + pluginContext_[idx].profilerDataRepeater = dataRepeater; + + pluginContext_[idx].shareMemoryBlock = nullptr; + + auto gcr = pluginCommandBuilder_->BuildCreateSessionCmd(pluginConfig, 0); + CHECK_TRUE(gcr != nullptr, false, "CreatePluginSession BuildCreateSessionCmd FAIL %s", pluginConfig.name().c_str()); + + pluginContext_[idx].profilerPluginState->set_state(ProfilerPluginState::LOADED); + + pluginServiceImpl_->PushCommand(*pluginContext_[idx].context, gcr); + return true; +} + +bool PluginService::StartPluginSession(const ProfilerPluginConfig& config) +{ + CHECK_TRUE(nameIndex_.find(config.name()) != nameIndex_.end(), false, + "StartPluginSession can't find plugin name %s", config.name().c_str()); + + uint32_t idx = nameIndex_[config.name()]; + auto gcr = pluginCommandBuilder_->BuildStartSessionCmd(config, idx); + CHECK_TRUE(gcr != nullptr, false, "StartPluginSession BuildStartSessionCmd FAIL %s", config.name().c_str()); + + pluginContext_[idx].profilerPluginState->set_state(ProfilerPluginState::IN_SESSION); + pluginServiceImpl_->PushCommand(*pluginContext_[idx].context, gcr); + + if (readShareMemoryThreadStatus_ == READ_SHARE_MEMORY_FREE) { // Start the thread that reads shared memory + readShareMemoryThreadStatus_ = READ_SHARE_MEMORY_WORKING; + readShareMemoryThreadSleep_.unlock(); + } + return true; +} +bool PluginService::StopPluginSession(const std::string& pluginName) +{ + CHECK_TRUE(nameIndex_.find(pluginName) != nameIndex_.end(), false, "StopPluginSession can't find plugin name %s", + pluginName.c_str()); + + uint32_t idx = nameIndex_[pluginName]; + auto gcr = pluginCommandBuilder_->BuildStopSessionCmd(idx); + CHECK_TRUE(gcr != nullptr, false, "StopPluginSession BuildStopSessionCmd FAIL %s", pluginName.c_str()); + + pluginContext_[idx].profilerPluginState->set_state(ProfilerPluginState::LOADED); + pluginServiceImpl_->PushCommand(*pluginContext_[idx].context, gcr); + + waitForCommandId_ = gcr->command_id(); + HILOG_DEBUG(LOG_CORE, "=== StopPluginSession Waiting ... ==="); + // try lock for 30000 ms. + if (waitStopSession_.try_lock_for(std::chrono::milliseconds(30000))) { // Received command reply,and stopsession, + ReadShareMemoryOneTime(); // Read the shared memory data again before exiting to avoid losing it + HILOG_DEBUG(LOG_CORE, "=== ShareMemory Clear ==="); + } else { + HILOG_DEBUG(LOG_CORE, "=== StopPluginSession Waiting FAIL ==="); + return false; + } + HILOG_DEBUG(LOG_CORE, "=== StopPluginSession Waiting OK ==="); + + if (readShareMemoryThreadStatus_ == READ_SHARE_MEMORY_WORKING) { // Stop the thread reading shared memory + readShareMemoryThreadStatus_ = READ_SHARE_MEMORY_FREE; + } + + return true; +} +bool PluginService::DestroyPluginSession(const std::string& pluginName) +{ + CHECK_TRUE(nameIndex_.find(pluginName) != nameIndex_.end(), false, "DestroyPluginSession can't find plugin name %s", + pluginName.c_str()); + + uint32_t idx = nameIndex_[pluginName]; + + auto gcr = pluginCommandBuilder_->BuildDestroySessionCmd(idx); + CHECK_TRUE(gcr != nullptr, false, "DestroyPluginSession BuildDestroySessionCmd FAIL %s", pluginName.c_str()); + + if (pluginContext_[idx].shareMemoryBlock != nullptr) { + ShareMemoryAllocator::GetInstance().ReleaseMemoryBlockLocal(pluginName); + pluginContext_[idx].shareMemoryBlock = nullptr; + } + + pluginContext_[idx].profilerPluginState->set_state(ProfilerPluginState::REGISTERED); + + pluginServiceImpl_->PushCommand(*pluginContext_[idx].context, gcr); + return true; +} + +bool PluginService::AddPluginInfo(const PluginInfo& pluginInfo) +{ + if (nameIndex_.find(pluginInfo.name) == nameIndex_.end()) { // add new plugin + while (pluginContext_.find(pluginIdAutoIncrease_) != pluginContext_.end()) { + pluginIdAutoIncrease_++; + } + + ProfilerPluginCapability capability; + capability.set_path(pluginInfo.path); + capability.set_name(pluginInfo.name); + CHECK_TRUE(ProfilerCapabilityManager::GetInstance().AddCapability(capability), false, + "AddPluginInfo AddCapability FAIL"); + + pluginContext_[pluginIdAutoIncrease_].path = pluginInfo.path; + pluginContext_[pluginIdAutoIncrease_].context = pluginInfo.context; + pluginContext_[pluginIdAutoIncrease_].config.set_name(pluginInfo.name); + pluginContext_[pluginIdAutoIncrease_].config.set_plugin_sha256(pluginInfo.sha256); + pluginContext_[pluginIdAutoIncrease_].profilerPluginState = std::make_shared(); + pluginContext_[pluginIdAutoIncrease_].profilerPluginState->set_name(pluginInfo.name); + pluginContext_[pluginIdAutoIncrease_].profilerPluginState->set_state(ProfilerPluginState::REGISTERED); + + pluginContext_[pluginIdAutoIncrease_].sha256 = pluginInfo.sha256; + pluginContext_[pluginIdAutoIncrease_].bufferSizeHint = pluginInfo.bufferSizeHint; + + nameIndex_[pluginInfo.name] = pluginIdAutoIncrease_; + pluginIdAutoIncrease_++; + } else { // update sha256 or bufferSizeHint + uint32_t idx = nameIndex_[pluginInfo.name]; + + if (pluginInfo.sha256 != "") { + pluginContext_[idx].sha256 = pluginInfo.sha256; + } + if (pluginInfo.bufferSizeHint != 0) { + pluginContext_[idx].bufferSizeHint = pluginInfo.bufferSizeHint; + } + } + + return true; +} + +bool PluginService::RemovePluginInfo(const PluginInfo& pluginInfo) +{ + CHECK_TRUE(pluginContext_.find(pluginInfo.id) != pluginContext_.end(), false, + "RemovePluginInfo can't find plugin id %d", pluginInfo.id); + + CHECK_TRUE(ProfilerCapabilityManager::GetInstance().RemoveCapability(pluginContext_[pluginInfo.id].config.name()), + false, "RemovePluginInfo RemoveCapability FAIL %d", pluginInfo.id); + + nameIndex_.erase(pluginContext_[pluginInfo.id].config.name()); + pluginContext_.erase(pluginInfo.id); + return true; +} + +void PluginService::ReadShareMemoryOneTime() +{ + readShareMemory_.lock(); + for (auto it = pluginContext_.begin(); it != pluginContext_.end(); it++) { + PluginContext* pluginContext = &it->second; + if (pluginContext->shareMemoryBlock == nullptr) { + continue; + } + do { + uint32_t size = pluginContext->shareMemoryBlock->GetDataSize(); + if (size == 0) { + break; + } + + int8_t* p = const_cast(pluginContext->shareMemoryBlock->GetDataPoint()); + auto pluginData = std::make_shared(); + pluginData->ParseFromArray(reinterpret_cast(p), size); + HILOG_DEBUG(LOG_CORE, "Read ShareMemory %d", size); + if (!pluginContext->profilerDataRepeater->PutPluginData(pluginData)) { + } + if (!pluginContext->shareMemoryBlock->Next()) { + break; + } + } while (true); + } + readShareMemory_.unlock(); +} + +void* PluginService::ReadShareMemoryThread(void* p) +{ + pthread_setname_np(pthread_self(), "ReadMemThread"); + + PluginService* pluginService = (PluginService*)p; + if (pluginService == nullptr) { + return nullptr; + } + while (pluginService->readShareMemoryThreadStatus_ != READ_SHARE_MEMORY_EXIT) { + // try lock for 60000000 ms. + if (pluginService->readShareMemoryThreadSleep_.try_lock_for(std::chrono::milliseconds(60000000))) { + while (pluginService->readShareMemoryThreadStatus_ == READ_SHARE_MEMORY_WORKING) { + pluginService->ReadShareMemoryOneTime(); + usleep(10000); // sleep for 10000 us. + } + } + } + return nullptr; +} +bool PluginService::AppendResult(NotifyResultRequest& request) +{ + pluginCommandBuilder_->GetedCommandResponse(request.command_id()); + if (request.command_id() == waitForCommandId_) { + waitStopSession_.unlock(); + } + + int size = request.result_size(); + HILOG_DEBUG(LOG_CORE, "AppendResult size:%d,cmdid:%d,waitid:%d", size, request.command_id(), waitForCommandId_); + for (int i = 0; i < size; i++) { + PluginResult pr = request.result(i); + if (pr.data().size() > 0) { + HILOG_DEBUG(LOG_CORE, "AppendResult Size : %zu", pr.data().size()); + uint32_t pluginId = pr.plugin_id(); + if (pluginContext_[pluginId].profilerDataRepeater == nullptr) { + HILOG_DEBUG(LOG_CORE, "AppendResult profilerDataRepeater==nullptr %s %d", + pr.status().name().c_str(), pluginId); + return false; + } + auto pluginData = std::make_shared(); + pluginData->set_name(pr.status().name()); + pluginData->set_status(0); + pluginData->set_data(pr.data()); + if (!pluginContext_[pluginId].profilerDataRepeater->PutPluginData(pluginData)) { + return false; + } + } else { + HILOG_DEBUG(LOG_CORE, "Flush?Data From ShareMemory?"); + } + } + return true; +} + +std::vector PluginService::GetPluginStatus() +{ + std::vector ret; + std::map::iterator iter; + for (iter = pluginContext_.begin(); iter != pluginContext_.end(); iter++) { + ret.push_back(iter->second.profilerPluginState); + } + return ret; +} + +uint32_t PluginService::GetPluginIdByName(std::string name) +{ + if (nameIndex_.find(name) == nameIndex_.end()) { + return 0; + } + return nameIndex_[name]; +} diff --git a/device/services/plugin_service/src/plugin_service_impl.cpp b/device/services/plugin_service/src/plugin_service_impl.cpp new file mode 100755 index 000000000..c00c6b1a7 --- /dev/null +++ b/device/services/plugin_service/src/plugin_service_impl.cpp @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "plugin_service_impl.h" +#include "plugin_service.h" + +PluginServiceImpl::PluginServiceImpl(PluginService& p) +{ + pluginService = &p; +} + +PluginServiceImpl::~PluginServiceImpl() {} + + +bool PluginServiceImpl::RegisterPlugin(SocketContext& context, + ::RegisterPluginRequest& request, + ::RegisterPluginResponse& response) +{ + PluginInfo pluginInfo; + + pluginInfo.name = request.name(); + pluginInfo.path = request.path(); + pluginInfo.sha256 = request.sha256(); + pluginInfo.bufferSizeHint = request.buffer_size_hint(); + pluginInfo.context = &context; + + if (pluginService->AddPluginInfo(pluginInfo)) { + response.set_status(0); + response.set_plugin_id(pluginService->GetPluginIdByName(pluginInfo.name)); + HILOG_DEBUG(LOG_CORE, "RegisterPlugin OK"); + return true; + } + response.set_status(1); + HILOG_DEBUG(LOG_CORE, "RegisterPlugin FAIL"); + return false; +} +bool PluginServiceImpl::UnregisterPlugin(SocketContext& context, + ::UnregisterPluginRequest& request, + ::UnregisterPluginResponse& response) +{ + PluginInfo pluginInfo; + pluginInfo.id = request.plugin_id(); + + if (pluginService->RemovePluginInfo(pluginInfo)) { + response.set_status(0); + HILOG_DEBUG(LOG_CORE, "UnregisterPlugin OK"); + return true; + } + response.set_status(1); + HILOG_DEBUG(LOG_CORE, "UnregisterPlugin FAIL"); + return false; +} + +bool PluginServiceImpl::GetCommand(SocketContext& context, ::GetCommandRequest& request, ::GetCommandResponse& response) +{ + return false; +} + +bool PluginServiceImpl::NotifyResult(SocketContext& context, + ::NotifyResultRequest& request, + ::NotifyResultResponse& response) +{ + HILOG_DEBUG(LOG_CORE, "NotifyResult"); + if (pluginService->AppendResult(request)) { + response.set_status(0); + return true; + } + response.set_status(1); + return true; +} + +bool PluginServiceImpl::PushCommand(SocketContext& context, GetCommandResponsePtr command) +{ + SendResponseGetCommandResponse(context, *command.get()); + return true; +} diff --git a/device/services/plugin_service/src/plugin_service_impl.h b/device/services/plugin_service/src/plugin_service_impl.h new file mode 100755 index 000000000..14349c538 --- /dev/null +++ b/device/services/plugin_service/src/plugin_service_impl.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PLUGIN_SERVICE_IMPL_H +#define PLUGIN_SERVICE_IMPL_H + +#include "logging.h" +#include "plugin_service.ipc.h" +#include "socket_context.h" +class PluginService; + +using GetCommandResponsePtr = STD_PTR(shared, ::GetCommandResponse); + +class PluginServiceImpl final : public IPluginServiceServer { +public: + PluginServiceImpl(PluginService& p); + ~PluginServiceImpl(); + bool RegisterPlugin(SocketContext& context, + ::RegisterPluginRequest& request, + ::RegisterPluginResponse& response) override; + bool UnregisterPlugin(SocketContext& context, + ::UnregisterPluginRequest& request, + ::UnregisterPluginResponse& response) override; + bool GetCommand(SocketContext& context, ::GetCommandRequest& request, ::GetCommandResponse& response) override; + bool + NotifyResult(SocketContext& context, ::NotifyResultRequest& request, ::NotifyResultResponse& response) override; + + bool PushCommand(SocketContext& context, GetCommandResponsePtr command); + +private: + PluginService* pluginService; +}; + +#endif // PLUGIN_SERVICE_IMPL_H diff --git a/device/services/plugin_service/test/BUILD.gn b/device/services/plugin_service/test/BUILD.gn new file mode 100755 index 000000000..58f3be584 --- /dev/null +++ b/device/services/plugin_service/test/BUILD.gn @@ -0,0 +1,83 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/test.gni") +import("../../../base/config.gni") + +module_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/device" +config("module_private_config") { + visibility = [":*"] +} + +ohos_unittest("plugin_service_ut") { + module_out_path = module_output_path + sources = [ + "unittest/plugin_service_test.cpp", + "unittest/services_ipc_test.cpp", + ] + public_deps = [ + "${OHOS_PROFILER_DIR}/device/services/plugin_service:hiprofiler_plugin_service", + "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory", + "${OHOS_PROFILER_DIR}/protos/services:plugin_services_proto", + "${OHOS_PROFILER_DIR}/protos/services:service_types_proto", + ] + deps = [ + "//third_party/googletest:gtest_main", + "//third_party/googletest:gtest", + ] + include_dirs = [ "//third_party/googletest/googletest/include/gtest" ] + cflags = [ + "-Wno-inconsistent-missing-override", + "-Dprivate=public", #allow test code access private members + "-Dprotected=public", #allow test code access private members + ] + external_deps = [ + "hiviewdfx_hilog_native:libhilog", + ] + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} + +ohos_unittest("plugin_service_module_test") { + module_out_path = module_output_path + sources = [ + "moduletest/plugin_service_test.cpp", + "moduletest/services_ipc_test.cpp", + ] + public_deps = [ + "${OHOS_PROFILER_DIR}/device/services/plugin_service:hiprofiler_plugin_service", + "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory", + "${OHOS_PROFILER_DIR}/protos/services:plugin_services_proto", + "${OHOS_PROFILER_DIR}/protos/services:service_types_proto", + ] + deps = [ + "//third_party/googletest:gtest", + ] + include_dirs = [ "//third_party/googletest/googletest/include/gtest" ] + cflags = [ + "-Wno-inconsistent-missing-override", + "-Dprivate=public", #allow test code access private members + "-Dprotected=public", #allow test code access private members + ] + external_deps = [ + "hiviewdfx_hilog_native:libhilog", + ] + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} + +group("unittest") { + testonly = true + deps = [ + ":plugin_service_ut", + ":plugin_service_module_test" + ] +} diff --git a/device/services/plugin_service/test/moduletest/plugin_service_test.cpp b/device/services/plugin_service/test/moduletest/plugin_service_test.cpp new file mode 100644 index 000000000..bfaf1ae6e --- /dev/null +++ b/device/services/plugin_service/test/moduletest/plugin_service_test.cpp @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "plugin_service.ipc.h" +#include "socket_context.h" + +using namespace testing::ext; +namespace { +uint32_t g_pluginId; + +class PluginClient final : public IPluginServiceClient { +public: + bool OnRegisterPluginResponse(SocketContext& context, ::RegisterPluginResponse& response) override + { + printf("OnRegisterPluginResponse\n"); + + printf("RegisterPlugin status : %d\n", response.status()); + g_pluginId = response.plugin_id(); + printf("RegisterPlugin ID : %d\n", g_pluginId); + return true; + } + bool OnUnregisterPluginResponse(SocketContext& context, ::UnregisterPluginResponse& response) override + { + printf("OnUnregisterPluginResponse\n"); + return true; + } + bool OnGetCommandResponse(SocketContext& context, ::GetCommandResponse& response) override + { + printf("OnGetCommandResponse\n"); + return true; + } + bool OnNotifyResultResponse(SocketContext& context, ::NotifyResultResponse& response) override + { + printf("OnNotifyResultResponse\n"); + return true; + } +}; + +std::unique_ptr g_pluginClient; + +class ModuleTestPluginService : public testing::Test { +public: + static void SetUpTestCase() + { + g_pluginClient = std::make_unique(); + ASSERT_FALSE(g_pluginClient->Connect("")); + } + + static void TearDownTestCase() + { + usleep(1000000); // sleep 1000000 us. + g_pluginClient = nullptr; + } + void SetUp() {} + void TearDown() {} +}; + +HWTEST_F(ModuleTestPluginService, RegisterPlugin, TestSize.Level1) +{ + RegisterPluginRequest request; + RegisterPluginResponse response; + + request.set_request_id(1); + request.set_path("abc.so"); + request.set_sha256("ADSFAFASFASFASF"); + request.set_name("abc.so"); + ASSERT_TRUE(response.status() == 0); + g_pluginId = response.plugin_id(); + printf("RegisterPlugin ID : %d\n", g_pluginId); +} + +HWTEST_F(ModuleTestPluginService, RegisterPlugin_CallBack, TestSize.Level1) +{ + RegisterPluginRequest request; + + request.set_request_id(1); + request.set_path("def.so"); + request.set_sha256("ADSFAFASFASFASF"); + request.set_name("def.so"); +} +} // namespace \ No newline at end of file diff --git a/device/services/plugin_service/test/moduletest/services_ipc_test.cpp b/device/services/plugin_service/test/moduletest/services_ipc_test.cpp new file mode 100644 index 000000000..95d4287e9 --- /dev/null +++ b/device/services/plugin_service/test/moduletest/services_ipc_test.cpp @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "client_map.h" +#include "plugin_service.ipc.h" +#include "service_entry.h" +#include "socket_context.h" +#include "unix_socket_client.h" +#include "unix_socket_server.h" + +using namespace testing::ext; + +namespace { +class ServicesIpcTest : public ::testing::Test { +protected: + static void SetUpTestCase() {} + static void TearDownTestCase() {} +}; + +HWTEST_F(ServicesIpcTest, ProtocolProc, TestSize.Level1) +{ + ServiceBase serviceBase; + SocketContext socketContext; + ASSERT_FALSE(serviceBase.ProtocolProc(socketContext, 0, nullptr, 0)); + ASSERT_TRUE(!socketContext.SendRaw(-1, nullptr, 0, 0)); + ASSERT_TRUE(!socketContext.SendFileDescriptor(-1)); + ASSERT_EQ(socketContext.ReceiveFileDiscriptor(), -1); + ASSERT_EQ(socketContext.RawProtocolProc(-1, nullptr, -1), -1); +} + +HWTEST_F(ServicesIpcTest, ClientSocket, TestSize.Level1) +{ + ServiceEntry serviceEntry; + ClientMap::GetInstance().PutClientSocket(0, serviceEntry); + ASSERT_EQ(ClientMap::GetInstance().AutoRelease(), 1); + + ClientConnection* clientConnection = new ClientConnection(0, serviceEntry); + ASSERT_EQ(clientConnection->RawProtocolProc(-1, nullptr, 0), -1); +} + +HWTEST_F(ServicesIpcTest, unixSocketClient, TestSize.Level1) +{ + UnixSocketClient unixSocketClient; + ServiceBase serviceBase; + ASSERT_TRUE(!unixSocketClient.Connect("asdf", serviceBase)); +} + +HWTEST_F(ServicesIpcTest, UnixSocketServer, TestSize.Level1) +{ + UnixSocketServer unixSocketServer; + + unixSocketServer.UnixSocketAccept(nullptr); + + ServiceEntry serviceEntry; + ASSERT_TRUE(unixSocketServer.StartServer("", serviceEntry)); +} + +HWTEST_F(ServicesIpcTest, ServiceEntry, TestSize.Level1) +{ + ServiceEntry serviceEntry; + IPluginServiceServer pluginService; + serviceEntry.StartServer("test_unix_socket_service_entry"); + serviceEntry.RegisterService(pluginService); + serviceEntry.FindServiceByName(pluginService.serviceName_); + + usleep(30000); + + GetTimeMS(); + GetTimeUS(); + GetTimeNS(); + + IPluginServiceClient pluginClient; + ASSERT_FALSE(pluginClient.Connect("")); + usleep(30000); +} +} // namespace \ No newline at end of file diff --git a/device/services/plugin_service/test/unittest/plugin_service_test.cpp b/device/services/plugin_service/test/unittest/plugin_service_test.cpp new file mode 100644 index 000000000..dfcf36148 --- /dev/null +++ b/device/services/plugin_service/test/unittest/plugin_service_test.cpp @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "common_types.pb.h" +#include "plugin_service.h" +#include "plugin_service.ipc.h" +#include "profiler_data_repeater.h" +#include "profiler_service_types.pb.h" +#include "socket_context.h" + +using namespace testing::ext; + +namespace { +std::unique_ptr g_pluginService; +uint32_t g_pluginId; + +class PluginClientTest final : public IPluginServiceClient { +public: + bool OnGetCommandResponse(SocketContext& context, ::GetCommandResponse& response) override + { + return true; + } +}; + +std::unique_ptr g_pluginClient; +class UnitTestPluginService : public testing::Test { +public: + static void SetUpTestCase() + { + g_pluginService = std::make_unique(); + usleep(100000); // sleep for 100000 us. + g_pluginClient = std::make_unique(); + ASSERT_FALSE(g_pluginClient->Connect("")); + } + + static void TearDownTestCase() + { + g_pluginClient = nullptr; + g_pluginService = nullptr; + } + void SetUp() {} + void TearDown() {} +}; + +/** + * @tc.name: Service + * @tc.desc: Set plugin registration information. + * @tc.type: FUNC + */ +HWTEST_F(UnitTestPluginService, AddPluginInfo, TestSize.Level1) +{ + RegisterPluginRequest request; + RegisterPluginResponse response; + + request.set_request_id(1); + request.set_path("abc.so"); + request.set_sha256("asdfasdfasdfasfd"); + request.set_name("abc.so"); + ASSERT_TRUE(response.status() == 0); + g_pluginId = response.plugin_id(); +} + +/** + * @tc.name: Service + * @tc.desc: Set plugin configuration information. + * @tc.type: FUNC + */ +HWTEST_F(UnitTestPluginService, CreatePluginSession1, TestSize.Level1) +{ + ProfilerPluginConfig ppc; + ppc.set_name("abc.so"); + ppc.set_plugin_sha256("ASDFAADSF"); + ppc.set_sample_interval(20); + + g_pluginService->CreatePluginSession(ppc, std::make_shared(4096)); +} + +/** + * @tc.name: Service + * @tc.desc: Set session configuration. + * @tc.type: FUNC + */ +HWTEST_F(UnitTestPluginService, CreatePluginSession2, TestSize.Level1) +{ + ProfilerPluginConfig ppc; + ppc.set_name("abc.so"); + ppc.set_plugin_sha256("ASDFAADSF"); + ppc.set_sample_interval(20); + + ProfilerSessionConfig::BufferConfig bc; + bc.set_pages(1); + bc.set_policy(ProfilerSessionConfig_BufferConfig_Policy_RECYCLE); + + g_pluginService->CreatePluginSession(ppc, bc, std::make_shared(4096)); +} + +/** + * @tc.name: Service + * @tc.desc: Start plugin session. + * @tc.type: FUNC + */ +HWTEST_F(UnitTestPluginService, StartPluginSession, TestSize.Level1) +{ + ProfilerPluginConfig ppc; + ppc.set_name("abc.so"); + ppc.set_plugin_sha256("ASDFAADSF"); + ppc.set_sample_interval(20); + + g_pluginService->StartPluginSession(ppc); +} + +/** + * @tc.name: Service + * @tc.desc: Stop plugin session. + * @tc.type: FUNC + */ +HWTEST_F(UnitTestPluginService, StopPluginSession, TestSize.Level1) +{ + g_pluginService->StopPluginSession("abc.so"); +} + +/** + * @tc.name: Service + * @tc.desc: Destroy receiving test. + * @tc.type: FUNC + */ +HWTEST_F(UnitTestPluginService, DestroyPluginSession, TestSize.Level1) +{ + g_pluginService->DestroyPluginSession("abc.so"); +} + +/** + * @tc.name: Service + * @tc.desc: Remove the specified plugin. + * @tc.type: FUNC + */ +HWTEST_F(UnitTestPluginService, RemovePluginInfo, TestSize.Level1) +{ + UnregisterPluginRequest request; + PluginInfo pi; + pi.id = 0; + pi.name = "abc.so"; + pi.path = "abc.so"; + pi.sha256 = "asdfasdf"; + g_pluginService->RemovePluginInfo(pi); +} + +/** + * @tc.name: Service + * @tc.desc: Setting report results. + * @tc.type: FUNC + */ +HWTEST_F(UnitTestPluginService, AppendResult, TestSize.Level1) +{ + NotifyResultRequest nrr; + nrr.set_request_id(1); + nrr.set_command_id(1); +} + +/** + * @tc.name: Service + * @tc.desc: Get plugin status. + * @tc.type: FUNC + */ +HWTEST_F(UnitTestPluginService, GetPluginStatus, TestSize.Level1) +{ + auto status = g_pluginService->GetPluginStatus(); +} + +/** + * @tc.name: Service + * @tc.desc: Gets the plugin with the specified name. + * @tc.type: FUNC + */ +HWTEST_F(UnitTestPluginService, GetPluginIdByName, TestSize.Level1) +{ + g_pluginService->GetPluginIdByName("abc.so"); +} +} // namespace \ No newline at end of file diff --git a/device/services/plugin_service/test/unittest/services_ipc_test.cpp b/device/services/plugin_service/test/unittest/services_ipc_test.cpp new file mode 100644 index 000000000..34c37eb93 --- /dev/null +++ b/device/services/plugin_service/test/unittest/services_ipc_test.cpp @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "client_map.h" +#include "plugin_service.ipc.h" +#include "service_entry.h" +#include "socket_context.h" +#include "unix_socket_client.h" +#include "unix_socket_server.h" + +using namespace testing::ext; + +namespace { +class ServicesIpcTest : public ::testing::Test { +protected: + static void SetUpTestCase() {} + static void TearDownTestCase() {} +}; + +/** + * @tc.name: Service + * @tc.desc: Socket send/recv interface.. + * @tc.type: FUNC + */ +HWTEST_F(ServicesIpcTest, ProtocolProc, TestSize.Level1) +{ + ServiceBase serviceBase; + SocketContext socketContext; + ASSERT_FALSE(serviceBase.ProtocolProc(socketContext, 0, nullptr, 0)); + ASSERT_TRUE(!socketContext.SendRaw(-1, nullptr, 0, 0)); + ASSERT_TRUE(!socketContext.SendFileDescriptor(-1)); + ASSERT_EQ(socketContext.ReceiveFileDiscriptor(), -1); + ASSERT_EQ(socketContext.RawProtocolProc(-1, nullptr, -1), -1); +} + +/** + * @tc.name: Service + * @tc.desc: Client link. + * @tc.type: FUNC + */ +HWTEST_F(ServicesIpcTest, ClientSocket, TestSize.Level1) +{ + ServiceEntry serviceEntry; + ClientMap::GetInstance().PutClientSocket(0, serviceEntry); + ASSERT_EQ(ClientMap::GetInstance().AutoRelease(), 1); + + ClientConnection* clientConnection = new ClientConnection(0, serviceEntry); + ASSERT_EQ(clientConnection->RawProtocolProc(-1, nullptr, 0), -1); +} + +/** + * @tc.name: Service + * @tc.desc: Abnormal client link. + * @tc.type: FUNC + */ +HWTEST_F(ServicesIpcTest, unixSocketClient, TestSize.Level1) +{ + UnixSocketClient unixSocketClient; + ServiceBase serviceBase; + ASSERT_TRUE(!unixSocketClient.Connect("asdf", serviceBase)); +} + +/** + * @tc.name: Service + * @tc.desc: Start unixSocket Server. + * @tc.type: FUNC + */ +HWTEST_F(ServicesIpcTest, UnixSocketServer, TestSize.Level1) +{ + UnixSocketServer unixSocketServer; + + unixSocketServer.UnixSocketAccept(nullptr); + + ServiceEntry serviceEntry; + ASSERT_TRUE(unixSocketServer.StartServer("", serviceEntry)); +} + +/** + * @tc.name: Service + * @tc.desc: Server process monitoring. + * @tc.type: FUNC + */ +HWTEST_F(ServicesIpcTest, ServiceEntry, TestSize.Level1) +{ + ServiceEntry serviceEntry; + IPluginServiceServer pluginService; + serviceEntry.StartServer("test_unix_socket_service_entry"); + serviceEntry.RegisterService(pluginService); + serviceEntry.FindServiceByName(pluginService.serviceName_); + + usleep(30000); + + GetTimeMS(); + GetTimeUS(); + GetTimeNS(); + + IPluginServiceClient pluginClient; + ASSERT_FALSE(pluginClient.Connect("")); + usleep(30000); +} +} // namespace \ No newline at end of file diff --git a/device/services/profiler_service/BUILD.gn b/device/services/profiler_service/BUILD.gn new file mode 100755 index 000000000..16ccfc8db --- /dev/null +++ b/device/services/profiler_service/BUILD.gn @@ -0,0 +1,76 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("../../base/config.gni") + +config("profiler_service_config") { + include_dirs = [ + "//utils/native/base/include", + "../../plugins/api/include", + "../plugin_service/include", + "include", + "src", + "${OHOS_PROFILER_DIR}/device/services/ipc/include", + "${OHOS_PROFILER_DIR}/device/base/include", + ] + if (current_toolchain != host_toolchain) { + cflags = [ "-DHAVE_HILOG" ] + } +} + +ohos_source_set("profiler_service") { + sources = [ + "src/plugin_session.cpp", + "src/profiler_capability_manager.cpp", + "src/profiler_data_repeater.cpp", + "src/profiler_service.cpp", + "src/result_demuxer.cpp", + "src/trace_file_reader.cpp", + "src/trace_file_writer.cpp", + ] + public_deps = [ + "${OHOS_PROFILER_DIR}/protos/services:profiler_services_proto", + "${OHOS_PROFILER_DIR}/protos/services:service_types_proto", + ] + public_configs = [ + ":profiler_service_config", + "../../base:hiprofiler_test_config", + ] + if (current_toolchain != host_toolchain) { + if (build_l2) { + external_deps = [ "hilog:libhilog" ] + } else { + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + } + } +} + +ohos_executable("hiprofilerd") { + sources = [ + "src/main.cpp", + ] + deps = [ + ":profiler_service", + "../plugin_service:hiprofiler_plugin_service", + ] + if (current_toolchain != host_toolchain) { + if (build_l2) { + external_deps = [ "shared_library:libhilog" ] + } else { + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + } + } + install_enable = true + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} diff --git a/device/services/profiler_service/include/profiler_capability_manager.h b/device/services/profiler_service/include/profiler_capability_manager.h new file mode 100755 index 000000000..d543dca5b --- /dev/null +++ b/device/services/profiler_service/include/profiler_capability_manager.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PROFILER_CAPABILITY_MANAGER_H +#define PROFILER_CAPABILITY_MANAGER_H + +#include +#include +#include +#include + +#include "nocopyable.h" +#include "profiler_service_types.pb.h" + +class ProfilerCapabilityManager { +public: + static ProfilerCapabilityManager& GetInstance(); + + bool AddCapability(const ProfilerPluginCapability& capability); + + std::vector GetCapabilities() const; + + const ProfilerPluginCapability* GetCapability(const std::string& name) const; + + bool UpdateCapability(const std::string& name, const ProfilerPluginCapability& capability); + + bool RemoveCapability(const std::string& name); + +private: + ProfilerCapabilityManager() = default; + ~ProfilerCapabilityManager(); + +private: + mutable std::mutex mutex_; + std::vector pluginCapabilities_; + + DISALLOW_COPY_AND_MOVE(ProfilerCapabilityManager); +}; + +#endif diff --git a/device/services/profiler_service/include/profiler_data_repeater.h b/device/services/profiler_service/include/profiler_data_repeater.h new file mode 100755 index 000000000..a8afa67ca --- /dev/null +++ b/device/services/profiler_service/include/profiler_data_repeater.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PROFILER_DATA_REPEATER_H +#define PROFILER_DATA_REPEATER_H + +#include "logging.h" +#include "nocopyable.h" +#include "profiler_service_types.pb.h" +#include +#include +#include +#include + +using ProfilerPluginDataPtr = STD_PTR(shared, ProfilerPluginData); + +class ProfilerDataRepeater { +public: + explicit ProfilerDataRepeater(size_t maxSize); + ~ProfilerDataRepeater(); + + bool PutPluginData(const ProfilerPluginDataPtr& pluginData); + ProfilerPluginDataPtr TakePluginData(); + int TakePluginData(std::vector& pluginDataVec); + + void Close(); + + void Reset(); + + size_t Size(); + +private: + std::mutex mutex_; + std::condition_variable slotCondVar_; + std::condition_variable itemCondVar_; + std::deque dataQueue_; + size_t maxSize_; + bool closed_; + + DISALLOW_COPY_AND_MOVE(ProfilerDataRepeater); +}; + +using ProfilerDataRepeaterPtr = STD_PTR(shared, ProfilerDataRepeater); + +#endif // PROFILER_DATA_REPEATER_H \ No newline at end of file diff --git a/device/services/profiler_service/include/profiler_service.h b/device/services/profiler_service/include/profiler_service.h new file mode 100755 index 000000000..08942927e --- /dev/null +++ b/device/services/profiler_service/include/profiler_service.h @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PROFILER_SERVICE_H +#define PROFILER_SERVICE_H + +#include "logging.h" +#include "nocopyable.h" +#include "profiler_service.grpc.pb.h" +#include + +class PluginService; + +class PluginSession; +class ResultDemuxer; +class TraceFileWriter; +class ProfilerDataRepeater; + +using PluginSessionPtr = STD_PTR(shared, PluginSession); +using PluginServicePtr = STD_PTR(shared, PluginService); + +class ProfilerService : public IProfilerService::Service { +public: + ProfilerService(const PluginServicePtr& pluginService = nullptr); + + ~ProfilerService(); + + // get all plugin infos and capabilities. + ::grpc::Status GetCapabilities(::grpc::ServerContext* context, + const ::GetCapabilitiesRequest* request, + ::GetCapabilitiesResponse* response) override; + + // create tracing sesion and pass tracing config to plugins. + ::grpc::Status CreateSession(::grpc::ServerContext* context, + const ::CreateSessionRequest* request, + ::CreateSessionResponse* response) override; + + // start tracing session, active server side tracing triggers. + ::grpc::Status StartSession(::grpc::ServerContext* context, + const ::StartSessionRequest* request, + ::StartSessionResponse* response) override; + + // get server-side cached tracing data since current session started. + ::grpc::Status FetchData(::grpc::ServerContext* context, + const ::FetchDataRequest* request, + ::grpc::ServerWriter<::FetchDataResponse>* writer) override; + + // stop tracing session, deactive server side tracing triggers. + ::grpc::Status StopSession(::grpc::ServerContext* context, + const ::StopSessionRequest* request, + ::StopSessionResponse* response) override; + + // destroy tracing session. + ::grpc::Status DestroySession(::grpc::ServerContext* context, + const ::DestroySessionRequest* request, + ::DestroySessionResponse* response) override; + + bool StartService(const std::string& listenUri); + + void WaitServiceDone(); + + void StopService(); + +private: + static constexpr size_t DEFAULT_REPEATER_BUFFER_SIZE = 100; + + struct SessionContext { + uint32_t id; + std::mutex mutex; + ProfilerSessionConfig sessionConfig; + std::vector bufferConfigs; + std::vector pluginConfigs; + std::vector pluginStatus; + std::map pluginSessions; + std::shared_ptr dataRepeater; + std::shared_ptr traceFileWriter; + std::shared_ptr resultDemuxer; + + PluginSessionPtr CreatePluginSession(const PluginServicePtr& pluginService, + const ProfilerPluginConfig& pluginConfig); + + PluginSessionPtr CreatePluginSession(const PluginServicePtr& pluginService, + const ProfilerPluginConfig& pluginConfig, + const ProfilerSessionConfig::BufferConfig& bufferConfig); + + bool CheckBufferConfig(const ProfilerSessionConfig::BufferConfig& bufferConfig); + + bool CreatePluginSessions(const PluginServicePtr& pluginService); + bool RemovePluginSessions(const std::vector& nameList); + bool UpdatePluginSessions(const PluginServicePtr& pluginService, + const std::vector& configIndexes); + std::vector UpdatePluginConfigs(const std::vector& configList); + + SessionContext() = default; + ~SessionContext(); + + DISALLOW_COPY_AND_MOVE(SessionContext); + }; + + using SessionContextPtr = STD_PTR(shared, SessionContext); + + SessionContextPtr GetSessionContext(uint32_t sessionId) const; + + bool AddSessionContext(uint32_t sessionId, const SessionContextPtr& sessionCtx); + + bool RemoveSessionContext(uint32_t sessionId); + +private: + mutable std::mutex sessionContextMutex_; + PluginServicePtr pluginService_; + std::atomic sessionIdCounter_ {0}; + std::atomic responseIdCounter_ {0}; + std::map sessionContext_; + std::unique_ptr server_; + + DISALLOW_COPY_AND_MOVE(ProfilerService); +}; + +#endif // PROFILER_SERVICE_H diff --git a/device/services/profiler_service/src/main.cpp b/device/services/profiler_service/src/main.cpp new file mode 100755 index 000000000..1830ec704 --- /dev/null +++ b/device/services/profiler_service/src/main.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +#include "grpc/impl/codegen/log.h" +#include +#include "logging.h" +#include "plugin_service.h" +#include "profiler_service.h" + +namespace { +const std::string DEFAULT_SERVICE_LISTEN_URI = "0.0.0.0:50051"; +} + +int main(int argc, char* argv[]) +{ + gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG); + grpc::EnableDefaultHealthCheckService(true); + + auto service = std::make_shared(std::make_shared()); + CHECK_NOTNULL(service, -1, "ProfilerService create failed!"); + + std::string listenUri = DEFAULT_SERVICE_LISTEN_URI; + if (argc > 1) { + listenUri = argv[1]; + } + if (service->StartService(listenUri)) { + HILOG_INFO(LOG_CORE, "ProfilerService start SUCCESS!"); + service->WaitServiceDone(); + } + return 0; +} diff --git a/device/services/profiler_service/src/plugin_session.cpp b/device/services/profiler_service/src/plugin_session.cpp new file mode 100755 index 000000000..2490634d0 --- /dev/null +++ b/device/services/profiler_service/src/plugin_session.cpp @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#define LOG_TAG "PluginSession" +#include "plugin_session.h" +#include "logging.h" +#include "plugin_service.h" + +PluginSession::PluginSession(const ProfilerPluginConfig& pluginConfig, + const PluginServicePtr& pluginService, + const ProfilerDataRepeaterPtr& dataRepeater) + : state_(PluginSession::INITIAL), + withBufferConfig_(false), + pluginConfig_(pluginConfig), + pluginService_(pluginService), + dataRepeater_(dataRepeater) +{ + Create(); +} + +PluginSession::PluginSession(const ProfilerPluginConfig& pluginConfig, + const ProfilerSessionConfig::BufferConfig& bufferConfig, + const PluginServicePtr& pluginService, + const ProfilerDataRepeaterPtr& dataRepeater) + : state_(PluginSession::INITIAL), + withBufferConfig_(true), + pluginConfig_(pluginConfig), + bufferConfig_(bufferConfig), + pluginService_(pluginService), + dataRepeater_(dataRepeater) +{ + Create(); +} + +PluginSession::~PluginSession() +{ + Destroy(); +} + +bool PluginSession::Create() +{ + std::unique_lock lock(mutex_); + HILOG_INFO(LOG_CORE, "CreatePluginSession for %s...", pluginConfig_.name().c_str()); + CHECK_TRUE(state_ == INITIAL, false, "plugin state %d invalid!", state_); + + auto pluginService = pluginService_.lock(); // promote to shared_ptr + CHECK_NOTNULL(pluginService, false, "PluginSession::Create pluginService null!"); + + bool retval = false; + if (withBufferConfig_) { + retval = pluginService->CreatePluginSession(pluginConfig_, bufferConfig_, dataRepeater_); + HILOG_INFO(LOG_CORE, "CreatePluginSession with buffer for %s %s!", + pluginConfig_.name().c_str(), retval ? "OK" : "FAIL"); + } else { + retval = pluginService->CreatePluginSession(pluginConfig_, dataRepeater_); + HILOG_INFO(LOG_CORE, "CreatePluginSession for %s %s!", pluginConfig_.name().c_str(), retval ? "OK" : "FAIL"); + } + CHECK_TRUE(retval, false, "call PluginService::CreatePluginSession failed!"); + + state_ = CREATED; + return retval; +} + +bool PluginSession::Destroy() +{ + std::unique_lock lock(mutex_); + HILOG_INFO(LOG_CORE, "DestroyPluginSession for %s...", pluginConfig_.name().c_str()); + RETURN_IF(state_ == INITIAL, false, "plugin state %d, no need to destroy!", state_); + CHECK_TRUE(state_ == CREATED || state_ == STARTED, false, "plugin state %d invalid!", state_); + + auto pluginService = pluginService_.lock(); + CHECK_NOTNULL(pluginService, false, "PluginSession::Create pluginService null!"); + + bool retval = pluginService->DestroyPluginSession(pluginConfig_.name()); + HILOG_INFO(LOG_CORE, "DestroyPluginSession for %s %s!", pluginConfig_.name().c_str(), retval ? "OK" : "FAIL"); + CHECK_TRUE(retval, false, "call PluginService::DestroyPluginSession failed!"); + + state_ = INITIAL; + return true; +} + +bool PluginSession::IsAvailable() const +{ + std::unique_lock lock(mutex_); + return state_ != INITIAL; +} + +PluginSession::State PluginSession::GetState() const +{ + std::unique_lock lock(mutex_); + return state_; +} + +bool PluginSession::Start() +{ + std::unique_lock lock(mutex_); + HILOG_INFO(LOG_CORE, "StartPluginSession for %s...", pluginConfig_.name().c_str()); + CHECK_TRUE(state_ == CREATED, false, "plugin state %d invalid!", state_); + + auto pluginService = pluginService_.lock(); + CHECK_NOTNULL(pluginService, false, "PluginSession::Create pluginService null!"); + + bool retval = pluginService->StartPluginSession(pluginConfig_); + HILOG_INFO(LOG_CORE, "StartPluginSession for %s %s!", pluginConfig_.name().c_str(), retval ? "OK" : "FAIL"); + CHECK_TRUE(retval, false, "call PluginService::StartPluginSession failed!"); + + state_ = STARTED; + return retval; +} + +bool PluginSession::Stop() +{ + std::unique_lock lock(mutex_); + HILOG_INFO(LOG_CORE, "StopPluginSession for %s...", pluginConfig_.name().c_str()); + CHECK_TRUE(state_ == STARTED, false, "plugin state %d invalid!", state_); + + auto pluginService = pluginService_.lock(); + CHECK_NOTNULL(pluginService, false, "PluginSession::Create pluginService null!"); + + bool retval = pluginService->StopPluginSession(pluginConfig_.name()); + HILOG_INFO(LOG_CORE, "StopPluginSession for %s %s!", pluginConfig_.name().c_str(), retval ? "OK" : "FAIL"); + CHECK_TRUE(retval, false, "call PluginService::StopPluginSession failed!"); + + state_ = CREATED; + return retval; +} \ No newline at end of file diff --git a/device/services/profiler_service/src/plugin_session.h b/device/services/profiler_service/src/plugin_session.h new file mode 100755 index 000000000..3291f775b --- /dev/null +++ b/device/services/profiler_service/src/plugin_session.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PLUGIN_SESSION_H +#define PLUGIN_SESSION_H + +#include +#include "logging.h" +#include "nocopyable.h" +#include "plugin_service_types.pb.h" +#include "profiler_service_types.pb.h" + +class PluginService; +class ProfilerDataRepeater; + +using PluginServicePtr = STD_PTR(shared, PluginService); +using ProfilerDataRepeaterPtr = STD_PTR(shared, ProfilerDataRepeater); + +class PluginSession { +public: + PluginSession(const ProfilerPluginConfig& pluginConfig, + const PluginServicePtr& pluginService, + const ProfilerDataRepeaterPtr& dataRepeater); + PluginSession(const ProfilerPluginConfig& pluginConfig, + const ProfilerSessionConfig::BufferConfig& bufferConfig, + const PluginServicePtr& pluginService, + const ProfilerDataRepeaterPtr& dataRepeater); + ~PluginSession(); + + bool Start(); + bool Stop(); + bool Destroy(); + + bool IsAvailable() const; + + enum State { + INITIAL = 0, + CREATED = 1, + STARTED = 2, + }; + State GetState() const; + +private: + bool Create(); + +private: + mutable std::mutex mutex_; + State state_; + bool withBufferConfig_; + ProfilerPluginConfig pluginConfig_; + ProfilerSessionConfig::BufferConfig bufferConfig_; + std::weak_ptr pluginService_; + ProfilerDataRepeaterPtr dataRepeater_; + + DISALLOW_COPY_AND_MOVE(PluginSession); +}; + +#endif // !PLUGIN_SESSION_H diff --git a/device/services/profiler_service/src/profiler_capability_manager.cpp b/device/services/profiler_service/src/profiler_capability_manager.cpp new file mode 100755 index 000000000..e2b780686 --- /dev/null +++ b/device/services/profiler_service/src/profiler_capability_manager.cpp @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "profiler_capability_manager.h" + +#include +#include "logging.h" + +ProfilerCapabilityManager& ProfilerCapabilityManager::GetInstance() +{ + static ProfilerCapabilityManager instance; + return instance; +} + +ProfilerCapabilityManager::~ProfilerCapabilityManager() +{ + pluginCapabilities_.clear(); +} + +bool ProfilerCapabilityManager::AddCapability(const ProfilerPluginCapability& capability) +{ + std::lock_guard guard(mutex_); + for (auto it = pluginCapabilities_.begin(); it != pluginCapabilities_.end(); it++) { + if (it->name() == capability.name()) { + HILOG_WARN(LOG_CORE, "capability.name conflict with %zu", (it - pluginCapabilities_.begin())); + return false; + } + } + pluginCapabilities_.push_back(capability); + HILOG_INFO(LOG_CORE, "AddCapability({%s, %s}) SUCCESS!", capability.name().c_str(), capability.path().c_str()); + return true; +} + +const ProfilerPluginCapability* ProfilerCapabilityManager::GetCapability(const std::string& name) const +{ + std::lock_guard guard(mutex_); + for (size_t i = 0; i < pluginCapabilities_.size(); i++) { + if (pluginCapabilities_[i].name() == name) { + return &pluginCapabilities_[i]; + } + } + return nullptr; +} + +std::vector ProfilerCapabilityManager::GetCapabilities() const +{ + std::lock_guard guard(mutex_); + return pluginCapabilities_; +} + +bool ProfilerCapabilityManager::UpdateCapability(const std::string& name, const ProfilerPluginCapability& capability) +{ + std::lock_guard guard(mutex_); + for (auto it = pluginCapabilities_.begin(); it != pluginCapabilities_.end(); it++) { + if (it->name() == capability.name()) { + *it = capability; + HILOG_WARN(LOG_CORE, "UpdateCapability(%s, %s) SUCCESS!", it->name().c_str(), it->path().c_str()); + return true; + } + } + return false; +} + +bool ProfilerCapabilityManager::RemoveCapability(const std::string& name) +{ + std::lock_guard guard(mutex_); + for (auto it = pluginCapabilities_.begin(); it != pluginCapabilities_.end(); it++) { + if (it->name() == name) { + HILOG_INFO(LOG_CORE, "RemoveCapability({%s, %s}) SUCCESS!", it->name().c_str(), it->path().c_str()); + pluginCapabilities_.erase(it); + return true; + } + } + return false; +} diff --git a/device/services/profiler_service/src/profiler_data_repeater.cpp b/device/services/profiler_service/src/profiler_data_repeater.cpp new file mode 100755 index 000000000..c3cb76620 --- /dev/null +++ b/device/services/profiler_service/src/profiler_data_repeater.cpp @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "profiler_data_repeater.h" + +ProfilerDataRepeater::ProfilerDataRepeater(size_t maxSize) +{ + maxSize_ = maxSize; + closed_ = false; +} + +ProfilerDataRepeater::~ProfilerDataRepeater() +{ + Close(); +} + +size_t ProfilerDataRepeater::Size() +{ + std::unique_lock lock(mutex_); + return dataQueue_.size(); +} + +void ProfilerDataRepeater::Reset() +{ + std::unique_lock lock(mutex_); + closed_ = false; +} + +void ProfilerDataRepeater::Close() +{ + { + std::unique_lock lock(mutex_); + dataQueue_.clear(); + closed_ = true; + } + slotCondVar_.notify_all(); + itemCondVar_.notify_all(); +} + +bool ProfilerDataRepeater::PutPluginData(const ProfilerPluginDataPtr& pluginData) +{ + std::unique_lock lock(mutex_); + while (dataQueue_.size() >= maxSize_ && !closed_) { + slotCondVar_.wait(lock); + } + if (closed_) { + return false; + } + + dataQueue_.push_back(pluginData); + lock.unlock(); + + itemCondVar_.notify_one(); + return true; +} + +ProfilerPluginDataPtr ProfilerDataRepeater::TakePluginData() +{ + std::unique_lock lock(mutex_); + while (dataQueue_.empty() && !closed_) { + itemCondVar_.wait(lock); + } + if (closed_) { + return nullptr; + } + + auto result = dataQueue_.front(); + dataQueue_.pop_front(); + lock.unlock(); + + slotCondVar_.notify_one(); + return result; +} + +int ProfilerDataRepeater::TakePluginData(std::vector& pluginDataVec) +{ + std::unique_lock lock(mutex_); + while (dataQueue_.empty() && !closed_) { + itemCondVar_.wait(lock); + } + if (closed_) { + return -1; + } + + int count = 0; + while (dataQueue_.size() > 0) { + auto result = dataQueue_.front(); + pluginDataVec.push_back(result); + dataQueue_.pop_front(); + count++; + } + lock.unlock(); + + slotCondVar_.notify_one(); + return count; +} diff --git a/device/services/profiler_service/src/profiler_service.cpp b/device/services/profiler_service/src/profiler_service.cpp new file mode 100755 index 000000000..04d72cb34 --- /dev/null +++ b/device/services/profiler_service/src/profiler_service.cpp @@ -0,0 +1,485 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#define LOG_TAG "ProfilerService" +#include "profiler_service.h" +#include "logging.h" +#include "plugin_service.h" +#include "plugin_session.h" +#include "profiler_capability_manager.h" +#include "profiler_data_repeater.h" +#include "result_demuxer.h" +#include "trace_file_writer.h" + +#include + +using namespace ::grpc; + +#define CHECK_REQUEST_RESPONSE(arg, response) \ + if (request == nullptr || response == nullptr) { \ + HILOG_WARN(LOG_CORE, "%s: FAILED, %s", __func__, "request or response invalid!"); \ + return {StatusCode::INVALID_ARGUMENT, "request or response invalid!"}; \ + } + +#define CHECK_POINTER_NOTNULL(ptr, errorMessage) \ + if (ptr == nullptr) { \ + HILOG_WARN(LOG_CORE, "%s: FAILED, %s is null!", __func__, #ptr); \ + return {StatusCode::INTERNAL, errorMessage}; \ + } + +#define CHECK_EXPRESSION_TRUE(expr, errorMessage) \ + if (!(expr)) { \ + HILOG_WARN(LOG_CORE, "%s: FAILED, %s", __func__, errorMessage); \ + return {StatusCode::INTERNAL, (errorMessage)}; \ + } + +ProfilerService::ProfilerService(const PluginServicePtr& pluginService) : pluginService_(pluginService) {} + +ProfilerService::~ProfilerService() {} + +ProfilerService::SessionContext::~SessionContext() +{ + HILOG_INFO(LOG_CORE, "~SessionContext id = %d", id); +} + +Status ProfilerService::GetCapabilities(ServerContext* context, + const ::GetCapabilitiesRequest* request, + ::GetCapabilitiesResponse* response) +{ + HILOG_INFO(LOG_CORE, "GetCapabilities from '%s'", context->peer().c_str()); + CHECK_REQUEST_RESPONSE(request, response); + + HILOG_INFO(LOG_CORE, "GetCapabilities %d start", request->request_id()); + std::vector capabilities = ProfilerCapabilityManager::GetInstance().GetCapabilities(); + + response->set_status(StatusCode::OK); + for (size_t i = 0; i < capabilities.size(); i++) { + *response->add_capabilities() = capabilities[i]; + } + HILOG_INFO(LOG_CORE, "GetCapabilities %d done!", request->request_id()); + return Status::OK; +} + +PluginSessionPtr ProfilerService::SessionContext::CreatePluginSession( + const PluginServicePtr& pluginService, const ProfilerPluginConfig& pluginConfig) +{ + auto name = pluginConfig.name(); + CHECK_TRUE(pluginSessions.count(name) == 0, nullptr, "plugin name %s exists!", name.c_str()); + + auto session = std::make_shared(pluginConfig, pluginService, dataRepeater); + CHECK_NOTNULL(session, nullptr, "allocate plugin session for %s failed!", name.c_str()); + CHECK_TRUE(session->IsAvailable(), nullptr, "config plugin for %s failed!", name.c_str()); + return session; +} + +namespace { +constexpr uint32_t MAX_BUFFER_PAGES = 512 * 1024 * 1024 / 4096; +} + +bool ProfilerService::SessionContext::CheckBufferConfig(const ProfilerSessionConfig::BufferConfig& bufferConfig) +{ + const uint32_t pages = bufferConfig.pages(); + const auto policy = bufferConfig.policy(); + return (pages > 0 && pages <= MAX_BUFFER_PAGES) && (policy == ProfilerSessionConfig::BufferConfig::RECYCLE || + policy == ProfilerSessionConfig::BufferConfig::FLATTEN); +} + +PluginSessionPtr ProfilerService::SessionContext::CreatePluginSession( + const PluginServicePtr& pluginService, + const ProfilerPluginConfig& pluginConfig, + const ProfilerSessionConfig::BufferConfig& bufferConfig) +{ + auto name = pluginConfig.name(); + CHECK_TRUE(pluginSessions.count(name) == 0, nullptr, "plugin name %s exists!", name.c_str()); + CHECK_TRUE(CheckBufferConfig(bufferConfig), nullptr, "buffer config invalid!"); + + auto session = std::make_shared(pluginConfig, bufferConfig, pluginService, dataRepeater); + CHECK_NOTNULL(session, nullptr, "allocate plugin session for %s failed!", name.c_str()); + CHECK_TRUE(session->IsAvailable(), nullptr, "config plugin for %s failed!", name.c_str()); + return session; +} + +bool ProfilerService::SessionContext::CreatePluginSessions(const PluginServicePtr& pluginService) +{ + for (size_t i = 0; i < pluginConfigs.size(); i++) { + PluginSessionPtr session; + if (bufferConfigs.size() > 0) { + session = CreatePluginSession(pluginService, pluginConfigs[i], bufferConfigs[i]); + } else { + session = CreatePluginSession(pluginService, pluginConfigs[i]); + } + CHECK_NOTNULL(session, false, "create plugin-%zu session failed!", i); + pluginSessions[pluginConfigs[i].name()] = session; + } + return true; +} + +bool ProfilerService::SessionContext::UpdatePluginSessions(const PluginServicePtr& pluginService, + const std::vector& configIndexes) +{ + for (auto index : configIndexes) { + auto config = pluginConfigs[index]; + auto session = CreatePluginSession(pluginService, config); + CHECK_NOTNULL(session, false, "create plugin session failed!"); + pluginSessions[config.name()] = session; + } + return true; +} + +bool ProfilerService::SessionContext::RemovePluginSessions(const std::vector& nameList) +{ + if (nameList.empty()) { + return false; + } + + for (auto& name : nameList) { + auto it = pluginSessions.find(name); + if (it != pluginSessions.end()) { + pluginSessions.erase(it); + } + } + return true; +} + +std::vector ProfilerService::SessionContext::UpdatePluginConfigs( + const std::vector& profilerPluginConfigList) +{ + std::map targetIndex; + for (size_t i = 0; i < pluginConfigs.size(); i++) { + targetIndex[pluginConfigs[i].name()] = i; + } + + std::vector updates; + for (auto& cfg : profilerPluginConfigList) { + auto it = targetIndex.find(cfg.name()); + if (it != targetIndex.end()) { + pluginConfigs[it->second] = cfg; + updates.push_back(it->second); + } + } + return updates; +} + +Status ProfilerService::CreateSession(ServerContext* context, + const ::CreateSessionRequest* request, + ::CreateSessionResponse* response) +{ + HILOG_INFO(LOG_CORE, "CreateSession from '%s'", context->peer().c_str()); + CHECK_REQUEST_RESPONSE(request, response); + CHECK_POINTER_NOTNULL(pluginService_, "plugin service not ready!"); + + HILOG_INFO(LOG_CORE, "CreateSession %d start", request->request_id()); + const int nConfigs = request->plugin_configs_size(); + CHECK_EXPRESSION_TRUE(nConfigs > 0, "no plugin configs!"); + + ProfilerSessionConfig sessionConfig = request->session_config(); + const int nBuffers = sessionConfig.buffers_size(); + CHECK_EXPRESSION_TRUE(nBuffers == 0 || nBuffers == 1 || nBuffers == nConfigs, "buffers config invalid!"); + + std::vector bufferConfigs; + if (nBuffers == 1) { + bufferConfigs.resize(nConfigs, sessionConfig.buffers(0)); + } else if (nBuffers > 0) { + bufferConfigs.assign(sessionConfig.buffers().begin(), sessionConfig.buffers().end()); + } + HILOG_INFO(LOG_CORE, "bufferConfigs: %zu", bufferConfigs.size()); + + // copy plugin configs from request + std::vector pluginConfigsList; + pluginConfigsList.reserve(nConfigs); + for (int i = 0; i < nConfigs; i++) { + pluginConfigsList.push_back(request->plugin_configs(i)); + } + + // create ProfilerDataRepeater + auto dataRepeater = std::make_shared(DEFAULT_REPEATER_BUFFER_SIZE); + CHECK_POINTER_NOTNULL(dataRepeater, "alloc ProfilerDataRepeater failed!"); + + // create ResultDemuxer + auto resultDemuxer = std::make_shared(dataRepeater); + CHECK_POINTER_NOTNULL(resultDemuxer, "alloc ResultDemuxer failed!"); + + // create TraceFileWriter for offline mode + TraceFileWriterPtr traceWriter; + if (sessionConfig.session_mode() == ProfilerSessionConfig::OFFLINE) { + auto resultFile = sessionConfig.result_file(); + CHECK_EXPRESSION_TRUE(resultFile.size() > 0, "result_file empty!"); + traceWriter = std::make_shared(resultFile); + CHECK_POINTER_NOTNULL(traceWriter, "alloc TraceFileWriter failed!"); + resultDemuxer->SetTraceWriter(traceWriter); + } + + // start prepare session context + auto ctx = std::make_shared(); + CHECK_POINTER_NOTNULL(ctx, "alloc SessionContext failed!"); + + // fill fields of SessionContext + ctx->dataRepeater = dataRepeater; + ctx->resultDemuxer = resultDemuxer; + ctx->traceFileWriter = traceWriter; + ctx->sessionConfig = sessionConfig; + ctx->pluginConfigs = std::move(pluginConfigsList); + ctx->bufferConfigs = std::move(bufferConfigs); + CHECK_EXPRESSION_TRUE(ctx->CreatePluginSessions(pluginService_), "create sessions failed!"); + + // alloc new session id + uint32_t sessionId = ++sessionIdCounter_; + ctx->id = sessionId; + + // add {sessionId, ctx} to map + CHECK_EXPRESSION_TRUE(AddSessionContext(sessionId, ctx), "sessionId conflict!"); + + // prepare response data fields + response->set_status(0); + response->set_session_id(sessionId); + + HILOG_INFO(LOG_CORE, "CreateSession %d done!", request->request_id()); + return Status::OK; +} + +bool ProfilerService::AddSessionContext(uint32_t sessionId, const SessionContextPtr& sessionCtx) +{ + std::unique_lock lock(sessionContextMutex_); + if (sessionContext_.count(sessionId) > 0) { + HILOG_WARN(LOG_CORE, "sessionId already exists!"); + return false; + } + sessionContext_[sessionId] = sessionCtx; + return true; +} + +ProfilerService::SessionContextPtr ProfilerService::GetSessionContext(uint32_t sessionId) const +{ + std::unique_lock lock(sessionContextMutex_); + auto it = sessionContext_.find(sessionId); + if (it != sessionContext_.end()) { + HILOG_INFO(LOG_CORE, "use_count: %ld", it->second.use_count()); + return it->second; + } + return nullptr; +} + +bool ProfilerService::RemoveSessionContext(uint32_t sessionId) +{ + std::unique_lock lock(sessionContextMutex_); + auto it = sessionContext_.find(sessionId); + if (it != sessionContext_.end()) { + HILOG_INFO(LOG_CORE, "use_count: %ld", it->second.use_count()); + sessionContext_.erase(it); + return true; + } + return false; +} + +Status ProfilerService::StartSession(ServerContext* context, + const ::StartSessionRequest* request, + ::StartSessionResponse* response) +{ + HILOG_INFO(LOG_CORE, "StartSession from '%s'", context->peer().c_str()); + CHECK_REQUEST_RESPONSE(request, response); + + uint32_t sessionId = request->session_id(); + HILOG_INFO(LOG_CORE, "StartSession %d start", request->request_id()); + + // copy plugin configs from request + std::vector pluginConfigsList; + pluginConfigsList.reserve(request->update_configs_size()); + for (int i = 0; i < request->update_configs_size(); i++) { + HILOG_INFO(LOG_CORE, "update_configs %d, name = %s", i, request->update_configs(i).name().c_str()); + pluginConfigsList.push_back(request->update_configs(i)); + } + + std::vector nameList; + for (auto& config : pluginConfigsList) { + nameList.push_back(config.name()); + } + + auto ctx = GetSessionContext(sessionId); + CHECK_POINTER_NOTNULL(ctx, "session_id invalid!"); + + // remove old plugin sessions + ctx->RemovePluginSessions(nameList); + + // update plugin configs + auto updates = ctx->UpdatePluginConfigs(pluginConfigsList); + + // update plugin sessions + CHECK_EXPRESSION_TRUE(ctx->UpdatePluginSessions(pluginService_, updates), "update sessions failed!"); + + // if dataRepeater exists, reset it to usable state. + if (ctx->dataRepeater) { + ctx->dataRepeater->Reset(); + } + + // start demuxer take result thread + if (ctx->resultDemuxer) { + if (ctx->sessionConfig.session_mode() == ProfilerSessionConfig::OFFLINE) { + ctx->resultDemuxer->StartTakeResults(); + } + } + + // start each plugin sessions + for (auto sessionEntry : ctx->pluginSessions) { + if (sessionEntry.second) { + sessionEntry.second->Start(); + } + } + + HILOG_INFO(LOG_CORE, "StartSession %d done!", request->request_id()); + return Status::OK; +} + +Status ProfilerService::FetchData(ServerContext* context, + const ::FetchDataRequest* request, + ServerWriter<::FetchDataResponse>* writer) +{ + HILOG_INFO(LOG_CORE, "FetchData from '%s'", context->peer().c_str()); + CHECK_POINTER_NOTNULL(request, "request invalid!"); + CHECK_POINTER_NOTNULL(writer, "writer invalid!"); + + uint32_t sessionId = request->session_id(); + HILOG_INFO(LOG_CORE, "FetchData %d start", request->request_id()); + + auto ctx = GetSessionContext(sessionId); + CHECK_POINTER_NOTNULL(ctx, "session_id invalid!"); + + // check each plugin session states + for (auto sessionEntry : ctx->pluginSessions) { + if (sessionEntry.second) { + CHECK_EXPRESSION_TRUE(sessionEntry.second->GetState() == PluginSession::STARTED, + "plugin session state invalid"); + HILOG_INFO(LOG_CORE, "check plugin session %s OK!", sessionEntry.first.c_str()); + } + } + + if (ctx->sessionConfig.session_mode() == ProfilerSessionConfig::ONLINE) { + auto dataRepeater = ctx->dataRepeater; + CHECK_POINTER_NOTNULL(dataRepeater, "repeater invalid!"); + + bool sendSuccess = false; + while (1) { + FetchDataResponse response; + response.set_status(StatusCode::OK); + response.set_response_id(++responseIdCounter_); + + std::vector pluginDataVec; + int count = dataRepeater->TakePluginData(pluginDataVec); + if (count > 0) { + response.set_has_more(true); + for (int i = 0; i < count; i++) { + auto data = response.add_plugin_data(); + CHECK_POINTER_NOTNULL(data, "new plugin data invalid"); + CHECK_POINTER_NOTNULL(pluginDataVec[i], "plugin data invalid"); + *data = *pluginDataVec[i]; + HILOG_INFO(LOG_CORE, "add plugin %s data to response", pluginDataVec[i]->name().c_str()); + } + HILOG_INFO(LOG_CORE, "fill %d data to response-%d", count, response.response_id()); + } else { + response.set_has_more(false); + HILOG_INFO(LOG_CORE, "no more data need to fill to response!"); + } + + sendSuccess = writer->Write(response); + if (count <= 0 || !sendSuccess) { + HILOG_INFO(LOG_CORE, "count = %d, sendSuccess = %d", count, sendSuccess); + break; + } + } + } + + HILOG_INFO(LOG_CORE, "FetchData %d done!", request->request_id()); + return Status::OK; +} + +Status ProfilerService::StopSession(ServerContext* context, + const ::StopSessionRequest* request, + ::StopSessionResponse* response) +{ + HILOG_INFO(LOG_CORE, "StopSession from '%s'", context->peer().c_str()); + CHECK_REQUEST_RESPONSE(request, response); + + uint32_t sessionId = request->session_id(); + HILOG_INFO(LOG_CORE, "StopSession %d start", request->request_id()); + + auto ctx = GetSessionContext(sessionId); + CHECK_POINTER_NOTNULL(ctx, "session_id invalid!"); + + // stop each plugin sessions + for (auto sessionEntry : ctx->pluginSessions) { + if (sessionEntry.second) { + sessionEntry.second->Stop(); + } + } + + // stop demuxer take result thread + if (ctx->resultDemuxer) { + if (ctx->sessionConfig.session_mode() == ProfilerSessionConfig::OFFLINE) { + ctx->resultDemuxer->StopTakeResults(); + } + } + + // make sure FetchData thread exit + if (ctx->dataRepeater) { + ctx->dataRepeater->Close(); + } + + HILOG_INFO(LOG_CORE, "StopSession %d done!", request->request_id()); + return Status::OK; +} + +Status ProfilerService::DestroySession(ServerContext* context, + const ::DestroySessionRequest* request, + ::DestroySessionResponse* response) +{ + HILOG_INFO(LOG_CORE, "DestroySession from '%s'", context->peer().c_str()); + CHECK_REQUEST_RESPONSE(request, response); + + uint32_t sessionId = request->session_id(); + HILOG_INFO(LOG_CORE, "DestroySession %d start", request->request_id()); + + CHECK_EXPRESSION_TRUE(RemoveSessionContext(sessionId), "session_id invalid!"); + HILOG_INFO(LOG_CORE, "DestroySession %d done!", request->request_id()); + return Status::OK; +} + +bool ProfilerService::StartService(const std::string& listenUri) +{ + if (listenUri == "") { + return false; + } + + ServerBuilder builder; + builder.AddListeningPort(listenUri, grpc::InsecureServerCredentials()); + builder.RegisterService(this); + + server_ = builder.BuildAndStart(); + CHECK_NOTNULL(server_, false, "start service on %s failed!", listenUri.c_str()); + HILOG_INFO(LOG_CORE, "Server listening on %s", listenUri.c_str()); + + return true; +} + +void ProfilerService::WaitServiceDone() +{ + if (server_) { + server_->Wait(); + } +} + +void ProfilerService::StopService() +{ + if (server_) { + server_->Shutdown(); + } +} diff --git a/device/services/profiler_service/src/result_demuxer.cpp b/device/services/profiler_service/src/result_demuxer.cpp new file mode 100644 index 000000000..9cb734d7d --- /dev/null +++ b/device/services/profiler_service/src/result_demuxer.cpp @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "result_demuxer.h" + +#include +#include "logging.h" + +#define CHECK_POINTER_NOTNULL(ptr) \ + if (ptr == nullptr) { \ + HILOG_WARN(LOG_CORE, "%s: FAILED, %s is null!", __func__, #ptr); \ + return false; \ + } + +#define CHECK_THREAD_ID_VALID(t) \ + if (t.get_id() == std::thread::id()) { \ + HILOG_WARN(LOG_CORE, "%s: FAILED, %s id invalid!", __func__, #t); \ + return false; \ + } + +ResultDemuxer::ResultDemuxer(const ProfilerDataRepeaterPtr& dataRepeater) +{ + dataRepeater_ = dataRepeater; +} + +ResultDemuxer::~ResultDemuxer() +{ + if (dataRepeater_) { + dataRepeater_->Close(); + } + if (demuxerThread_.joinable()) { + demuxerThread_.join(); + } +} + +void ResultDemuxer::SetTraceWriter(const TraceFileWriterPtr& traceWriter) +{ + traceWriter_ = traceWriter; +} + +bool ResultDemuxer::StartTakeResults() +{ + CHECK_POINTER_NOTNULL(dataRepeater_); + + std::thread demuxer(&ResultDemuxer::TakeResults, this); + CHECK_THREAD_ID_VALID(demuxer); + + demuxerThread_ = std::move(demuxer); + return true; +} + +bool ResultDemuxer::StopTakeResults() +{ + CHECK_POINTER_NOTNULL(dataRepeater_); + CHECK_THREAD_ID_VALID(demuxerThread_); + + dataRepeater_->PutPluginData(nullptr); + if (demuxerThread_.joinable()) { + demuxerThread_.join(); + } + return true; +} + +void ResultDemuxer::TakeResults() +{ + if (!dataRepeater_) { + return; + } + + HILOG_INFO(LOG_CORE, "TakeResults thread %d, start!", gettid()); + while (1) { + auto pluginData = dataRepeater_->TakePluginData(); + if (!pluginData) { + break; + } + + if (traceWriter_) { + traceWriter_->Write(*pluginData); + } else { + HILOG_WARN(LOG_CORE, "no writer, drop data!"); + } + } + HILOG_INFO(LOG_CORE, "TakeResults thread %d, exit!", gettid()); +} diff --git a/device/services/profiler_service/src/result_demuxer.h b/device/services/profiler_service/src/result_demuxer.h new file mode 100755 index 000000000..5e22e3151 --- /dev/null +++ b/device/services/profiler_service/src/result_demuxer.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef RESULT_DEMUXER_H +#define RESULT_DEMUXER_H + +#include + +#include "logging.h" +#include "nocopyable.h" +#include "profiler_data_repeater.h" +#include "profiler_service.grpc.pb.h" +#include "trace_file_writer.h" + +class ResultDemuxer { +public: + explicit ResultDemuxer(const ProfilerDataRepeaterPtr& dataRepeater); + + ~ResultDemuxer(); + + void SetTraceWriter(const TraceFileWriterPtr& traceWriter); + + bool StartTakeResults(); + + bool StopTakeResults(); + +private: + void TakeResults(); + +private: + TraceFileWriterPtr traceWriter_ = nullptr; + ProfilerDataRepeaterPtr dataRepeater_ = nullptr; + std::thread demuxerThread_; + + DISALLOW_COPY_AND_MOVE(ResultDemuxer); +}; + +#endif // RESULT_DEMUXER_H \ No newline at end of file diff --git a/device/services/profiler_service/src/trace_file_reader.cpp b/device/services/profiler_service/src/trace_file_reader.cpp new file mode 100644 index 000000000..e5440dd51 --- /dev/null +++ b/device/services/profiler_service/src/trace_file_reader.cpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +#include "trace_file_reader.h" + +#include "logging.h" + +using CharPtr = std::unique_ptr::pointer; + +TraceFileReader::~TraceFileReader() +{ + if (stream_.is_open()) { + stream_.close(); + } +} + +bool TraceFileReader::Open(const std::string& path) +{ + stream_.open(path, std::ios_base::in | std::ios_base::binary); + CHECK_TRUE(stream_.is_open(), false, "open %s failed, %s!", path.c_str(), strerror(errno)); + path_ = path; + return true; +} + +long TraceFileReader::Read(MessageLite& message) +{ + CHECK_TRUE(stream_.is_open(), 0, "binary file %s not open or open failed!", path_.c_str()); + CHECK_TRUE(!stream_.eof(), 0, "no more data in file %s stream", path_.c_str()); + + uint32_t msgLen = 0; + stream_.read(reinterpret_cast(&msgLen), sizeof(msgLen)); + CHECK_TRUE(stream_, 0, "read msg head failed!"); + + std::vector msgData(msgLen); + stream_.read(msgData.data(), msgData.size()); + CHECK_TRUE(stream_, 0, "read msg body failed!"); + + CHECK_TRUE(message.ParseFromArray(msgData.data(), msgData.size()), 0, "ParseFromArray failed!"); + return sizeof(msgLen) + msgData.size(); +} + +long TraceFileReader::Read(BytePtr data, long size) +{ + CHECK_TRUE(stream_.is_open(), 0, "binary file %s not open or open failed!", path_.c_str()); + CHECK_TRUE(!stream_.eof(), 0, "no more data in file %s stream", path_.c_str()); + CHECK_TRUE(stream_.read(reinterpret_cast(data), size), 0, "binary file %s write raw buffer data failed!", + path_.c_str()); + return size; +} diff --git a/device/services/profiler_service/src/trace_file_reader.h b/device/services/profiler_service/src/trace_file_reader.h new file mode 100644 index 000000000..9247cd1f4 --- /dev/null +++ b/device/services/profiler_service/src/trace_file_reader.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef TRACE_FILE_READER_H +#define TRACE_FILE_READER_H + +#include "logging.h" +#include "nocopyable.h" +#include "writer.h" + +#include +#include +#include +#include + +using google::protobuf::MessageLite; + +class TraceFileReader { +public: + TraceFileReader() = default; + + ~TraceFileReader(); + + bool Open(const std::string& path); + + long Read(MessageLite& message); + + using BytePtr = int8_t *; + + long Read(BytePtr data, long size); + +private: + std::string path_; + std::ifstream stream_; + + DISALLOW_COPY_AND_MOVE(TraceFileReader); +}; + +using TraceFileReaderPtr = STD_PTR(shared, TraceFileReader); + +#endif // !TRACE_FILE_READER_H \ No newline at end of file diff --git a/device/services/profiler_service/src/trace_file_writer.cpp b/device/services/profiler_service/src/trace_file_writer.cpp new file mode 100644 index 000000000..590895ae8 --- /dev/null +++ b/device/services/profiler_service/src/trace_file_writer.cpp @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "trace_file_writer.h" +#include + +#include "logging.h" + +using CharPtr = std::unique_ptr::pointer; +using ConstCharPtr = std::unique_ptr::pointer; + +TraceFileWriter::TraceFileWriter(const std::string& path) : path_(path) +{ + Open(path); +} + +TraceFileWriter::~TraceFileWriter() +{ + Flush(); + if (stream_.is_open()) { + stream_.close(); + } +} + +bool TraceFileWriter::Open(const std::string& path) +{ + stream_.open(path, std::ios_base::out | std::ios_base::binary); + CHECK_TRUE(stream_.is_open(), false, "open %s failed, %s!", path.c_str(), strerror(errno)); + path_ = path; + return true; +} + +long TraceFileWriter::Write(const void* data, size_t size) +{ + CHECK_TRUE(stream_.is_open(), 0, "binary file %s not open or open failed!", path_.c_str()); + + uint32_t dataLen = size; + stream_.write(reinterpret_cast(&dataLen), sizeof(dataLen)); + CHECK_TRUE(stream_, 0, "binary file %s write raw buffer size failed!", path_.c_str()); + + stream_.write(reinterpret_cast(data), size); + CHECK_TRUE(stream_, 0, "binary file %s write raw buffer data failed!", path_.c_str()); + return sizeof(dataLen) + size; +} + +long TraceFileWriter::Write(const MessageLite& message) +{ + CHECK_TRUE(stream_.is_open(), 0, "binary file %s not open or open failed!", path_.c_str()); + uint32_t msgLen = message.ByteSizeLong(); + stream_.write(reinterpret_cast(&msgLen), sizeof(msgLen)); + CHECK_TRUE(stream_, 0, "write msg head failed!"); + + std::vector msgData(message.ByteSizeLong()); + CHECK_TRUE(message.SerializeToArray(msgData.data(), msgData.size()), 0, "SerializeToArray failed!"); + + stream_.write(msgData.data(), msgData.size()); + CHECK_TRUE(stream_, 0, "write msg body failed!"); + HILOG_DEBUG(LOG_CORE, "write %zu bytes to file %s", sizeof(msgLen) + msgLen, path_.c_str()); + return sizeof(msgLen) + message.ByteSizeLong(); +} + +bool TraceFileWriter::Flush() +{ + CHECK_TRUE(stream_.is_open(), false, "binary file %s not open or open failed!", path_.c_str()); + CHECK_TRUE(stream_.flush(), false, "binary file %s flush failed!", path_.c_str()); + return true; +} diff --git a/device/services/profiler_service/src/trace_file_writer.h b/device/services/profiler_service/src/trace_file_writer.h new file mode 100755 index 000000000..732874ad4 --- /dev/null +++ b/device/services/profiler_service/src/trace_file_writer.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef TRANCE_FILE_WRITER_H +#define TRANCE_FILE_WRITER_H + +#include "logging.h" +#include "nocopyable.h" +#include "writer.h" + +#include +#include +#include + +using google::protobuf::MessageLite; + +class TraceFileWriter : public Writer { +public: + explicit TraceFileWriter(const std::string& path); + + ~TraceFileWriter(); + + bool Open(const std::string& path); + + long Write(const MessageLite& message); + + long Write(const void* data, size_t size) override; + + bool Flush() override; + +private: + std::string path_; + std::ofstream stream_; + + DISALLOW_COPY_AND_MOVE(TraceFileWriter); +}; + +using TraceFileWriterPtr = STD_PTR(shared, TraceFileWriter); + +#endif // !TRANCE_FILER_WRITER_H \ No newline at end of file diff --git a/device/services/profiler_service/test/BUILD.gn b/device/services/profiler_service/test/BUILD.gn new file mode 100755 index 000000000..5166fd3dc --- /dev/null +++ b/device/services/profiler_service/test/BUILD.gn @@ -0,0 +1,64 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/test.gni") +import("../../../base/config.gni") + +module_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/device" +config("module_private_config") { + visibility = [":*"] +} + +config("cflags_config") { + cflags = [ + "-Wno-sign-compare", + "-Wno-inconsistent-missing-override", + "-Dprivate=public", #allow test code access private members + ] +} + +ohos_unittest("profiler_service_ut") { + module_out_path = module_output_path + sources = [ + "unittest/plugin_service_stubs.cpp", + "unittest/plugin_session_test.cpp", + "unittest/profiler_capability_manager_test.cpp", + "unittest/profiler_data_repeater_test.cpp", + "unittest/profiler_service_test.cpp", + "unittest/result_demuxer_test.cpp", + "unittest/trace_file_reader_test.cpp", + "unittest/trace_file_writer_test.cpp", + ] + deps = [ + "../:profiler_service", + "//third_party/googletest:gtest", + ] + include_dirs = [ "//third_party/googletest/googletest/include/gtest" ] + configs = [ ":cflags_config" ] + #cflags = [ + # "-Wno-sign-compare", + # "-Wno-inconsistent-missing-override", + # "-Dprivate=public", #allow test code access private members + #] + external_deps = [ + "hiviewdfx_hilog_native:libhilog", + ] + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} + +group("unittest") { + testonly = true + deps = [ + ":profiler_service_ut", + ] +} diff --git a/device/services/profiler_service/test/moduletest/profiler_service_test.cpp b/device/services/profiler_service/test/moduletest/profiler_service_test.cpp new file mode 100755 index 000000000..1e394e2a7 --- /dev/null +++ b/device/services/profiler_service/test/moduletest/profiler_service_test.cpp @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "logging.h" diff --git a/device/services/profiler_service/test/unittest/plugin_service_stubs.cpp b/device/services/profiler_service/test/unittest/plugin_service_stubs.cpp new file mode 100755 index 000000000..534856aeb --- /dev/null +++ b/device/services/profiler_service/test/unittest/plugin_service_stubs.cpp @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#define LOG_TAG "PluginServiceStub" +#include "plugin_service_stubs.h" + +#include +#include +#include "logging.h" +#include "profiler_capability_manager.h" +#include "profiler_data_repeater.h" + +#ifdef USE_PLUGIN_SERVICE_STUB +using PluginServiceStubPtr = STD_PTR(shared, PluginServiceStub); +PluginServiceStubPtr PluginServiceStub::GetInstance() +{ + static std::weak_ptr instance; + auto stub = instance.lock(); + if (stub) { + return stub; + } + stub = std::make_shared(); + instance = stub; + return stub; +} + +void PluginServiceStub::SetCreateResult(bool value) +{ + HILOG_DEBUG(LOG_CORE, "%s(%d)", __FUNCTION__, value); + createResult_ = value; +} + +bool PluginServiceStub::GetCreateResult() const +{ + HILOG_DEBUG(LOG_CORE, "%s(%d)", __FUNCTION__, createResult_); + return createResult_; +} + +void PluginServiceStub::SetStartResult(bool value) +{ + HILOG_DEBUG(LOG_CORE, "%s(%d)", __FUNCTION__, value); + startResult_ = value; +} + +bool PluginServiceStub::GetStartResult() const +{ + HILOG_DEBUG(LOG_CORE, "%s(%d)", __FUNCTION__, startResult_); + return startResult_; +} + +void PluginServiceStub::SetStopResult(bool value) +{ + HILOG_DEBUG(LOG_CORE, "%s(%d)", __FUNCTION__, value); + stopResult_ = value; +} + +bool PluginServiceStub::GetStopResult() const +{ + HILOG_DEBUG(LOG_CORE, "%s(%d)", __FUNCTION__, stopResult_); + return stopResult_; +} + +void PluginServiceStub::SetDestroyResult(bool value) +{ + HILOG_DEBUG(LOG_CORE, "%s(%d)", __FUNCTION__, value); + destroyResult_ = value; +} + +bool PluginServiceStub::GetDestroyResult() const +{ + HILOG_DEBUG(LOG_CORE, "%s(%d)", __FUNCTION__, destroyResult_); + return destroyResult_; +} + +void PluginServiceStub::SetAddResult(bool value) +{ + HILOG_DEBUG(LOG_CORE, "%s(%d)", __FUNCTION__, value); + addResult_ = value; +} + +bool PluginServiceStub::GetAddResult() +{ + HILOG_DEBUG(LOG_CORE, "%s(%d)", __FUNCTION__, addResult_); + return addResult_; +} + +void PluginServiceStub::SetRemoveResult(bool value) +{ + HILOG_DEBUG(LOG_CORE, "%s(%d)", __FUNCTION__, value); + removeResult_ = value; +} + +bool PluginServiceStub::GetRemoveResult() +{ + HILOG_DEBUG(LOG_CORE, "%s(%d)", __FUNCTION__, removeResult_); + return removeResult_; +} +#endif + +PluginService::PluginService() +{ + pluginIdAutoIncrease_ = 0; + serviceEntry_ = NULL; + pluginServiceImpl_ = NULL; + pluginCommandBuilder_ = NULL; + readShareMemoryThreadStatus_ = READ_SHARE_MEMORY_UNSPECIFIED; + waitForCommandId_ = 0; +} + +PluginService::~PluginService() {} + +bool PluginService::CreatePluginSession(const ProfilerPluginConfig& pluginConfig, + const ProfilerDataRepeaterPtr& dataRepeater) +{ + if (nameIndex_.find(pluginConfig.name()) == nameIndex_.end()) { + HILOG_WARN(LOG_CORE, "CreatePluginSession for %s FAILED, plugin not found!", pluginConfig.name().c_str()); + return false; + } + uint32_t idx = nameIndex_[pluginConfig.name()]; + pluginContext_[idx].profilerDataRepeater = dataRepeater; + pluginContext_[idx].shareMemoryBlock = NULL; + pluginContext_[idx].profilerPluginState->set_state(ProfilerPluginState::LOADED); + HILOG_DEBUG(LOG_CORE, "CreatePluginSession for %s SUCCESS!", pluginConfig.name().c_str()); + return true; +} + +bool PluginService::CreatePluginSession(const ProfilerPluginConfig& pluginConfig, + const ProfilerSessionConfig::BufferConfig& bufferConfig, + const ProfilerDataRepeaterPtr& dataRepeater) +{ + return CreatePluginSession(pluginConfig, dataRepeater); +} + +bool PluginService::StartPluginSession(const ProfilerPluginConfig& pluginConfig) +{ + if (nameIndex_.find(pluginConfig.name()) == nameIndex_.end()) { + HILOG_WARN(LOG_CORE, "StartPluginSession for %s FAILED, plugin not found!", pluginConfig.name().c_str()); + return false; + } + uint32_t idx = nameIndex_[pluginConfig.name()]; + pluginContext_[idx].profilerPluginState->set_state(ProfilerPluginState::IN_SESSION); + HILOG_DEBUG(LOG_CORE, "StartPluginSession for %s SUCCESS!", pluginConfig.name().c_str()); + return true; +} + +bool PluginService::StopPluginSession(const std::string& pluginName) +{ + if (nameIndex_.find(pluginName) == nameIndex_.end()) { + HILOG_WARN(LOG_CORE, "StopPluginSession for %s FAILED, plugin not found!", pluginName.c_str()); + return false; + } + uint32_t idx = nameIndex_[pluginName]; + pluginContext_[idx].profilerPluginState->set_state(ProfilerPluginState::LOADED); + HILOG_DEBUG(LOG_CORE, "StopPluginSession for %s SUCCESS!", pluginName.c_str()); + return true; +} + +bool PluginService::DestroyPluginSession(const std::string& pluginName) +{ + if (nameIndex_.find(pluginName) == nameIndex_.end()) { + HILOG_WARN(LOG_CORE, "DestroyPluginSession for %s FAILED, plugin not found!", pluginName.c_str()); + return false; + } + uint32_t idx = nameIndex_[pluginName]; + pluginContext_[idx].profilerPluginState->set_state(ProfilerPluginState::REGISTERED); + HILOG_DEBUG(LOG_CORE, "DestroyPluginSession for %s SUCCESS!", pluginName.c_str()); + return true; +} + +bool PluginService::AddPluginInfo(const PluginInfo& pluginInfo) +{ + if (nameIndex_.find(pluginInfo.name) == nameIndex_.end()) { // add new plugin + while (pluginContext_.find(pluginIdAutoIncrease_) != pluginContext_.end()) { + pluginIdAutoIncrease_++; + } + + ProfilerPluginCapability capability; + capability.set_path(pluginInfo.path); + capability.set_name(pluginInfo.name); + if (!ProfilerCapabilityManager::GetInstance().AddCapability(capability)) { + HILOG_WARN(LOG_CORE, "AddPluginInfo for %s FAILED, AddCapability failed!", pluginInfo.name.c_str()); + return false; + } + + pluginContext_[pluginIdAutoIncrease_].path = pluginInfo.path; + pluginContext_[pluginIdAutoIncrease_].context = pluginInfo.context; + pluginContext_[pluginIdAutoIncrease_].config.set_name(pluginInfo.name); + pluginContext_[pluginIdAutoIncrease_].config.set_plugin_sha256(pluginInfo.sha256); + pluginContext_[pluginIdAutoIncrease_].profilerPluginState = std::make_shared(); + pluginContext_[pluginIdAutoIncrease_].profilerPluginState->set_name(pluginInfo.name); + pluginContext_[pluginIdAutoIncrease_].profilerPluginState->set_state(ProfilerPluginState::REGISTERED); + + pluginContext_[pluginIdAutoIncrease_].sha256 = pluginInfo.sha256; + pluginContext_[pluginIdAutoIncrease_].bufferSizeHint = pluginInfo.bufferSizeHint; + + nameIndex_[pluginInfo.name] = pluginIdAutoIncrease_; + pluginIdAutoIncrease_++; + } else { // update sha256 or bufferSizeHint + uint32_t idx = nameIndex_[pluginInfo.name]; + + if (pluginInfo.sha256 != "") { + pluginContext_[idx].sha256 = pluginInfo.sha256; + } + if (pluginInfo.bufferSizeHint != 0) { + pluginContext_[idx].bufferSizeHint = pluginInfo.bufferSizeHint; + } + } + + HILOG_DEBUG(LOG_CORE, "AddPluginInfo for %s SUCCESS!", pluginInfo.name.c_str()); + return true; +} + +bool PluginService::RemovePluginInfo(const PluginInfo& pluginInfo) +{ + if (pluginContext_.find(pluginInfo.id) == pluginContext_.end()) { + HILOG_WARN(LOG_CORE, "RemovePluginInfo for %s FAILED, plugin not found!", pluginInfo.name.c_str()); + return false; + } + if (!ProfilerCapabilityManager::GetInstance().RemoveCapability(pluginContext_[pluginInfo.id].config.name())) { + HILOG_WARN(LOG_CORE, "RemovePluginInfo for %s FAILED, remove capability FAIL.", pluginInfo.name.c_str()); + return false; + } + + nameIndex_.erase(pluginContext_[pluginInfo.id].config.name()); + pluginContext_.erase(pluginInfo.id); + HILOG_DEBUG(LOG_CORE, "RemovePluginInfo for %s SUCCESS!", pluginInfo.name.c_str()); + return true; +} diff --git a/device/services/profiler_service/test/unittest/plugin_service_stubs.h b/device/services/profiler_service/test/unittest/plugin_service_stubs.h new file mode 100755 index 000000000..fa5d83c42 --- /dev/null +++ b/device/services/profiler_service/test/unittest/plugin_service_stubs.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PLUGIN_SERVICE_STUB_H +#define PLUGIN_SERVICE_STUB_H + +#include "plugin_service.h" + +#ifdef USE_PLUGIN_SERVICE_STUB +class PluginServiceStub { +public: + static std::shared_ptr GetInstance(); + + void SetCreateResult(bool value); + bool GetCreateResult() const; + + void SetStartResult(bool value); + bool GetStartResult() const; + + void SetStopResult(bool value); + bool GetStopResult() const; + + void SetDestroyResult(bool value); + bool GetDestroyResult() const; + + void SetAddResult(bool value); + bool GetAddResult(); + + void SetRemoveResult(bool value); + bool GetRemoveResult(); + + PluginServiceStub() = default; + ~PluginServiceStub() = default; + +private: + bool createResult_ = true; + bool destroyResult_ = true; + bool startResult_ = true; + bool stopResult_ = true; + bool addResult_ = true; + bool removeResult_ = true; +}; +#endif + +#endif // !PLUGIN_SERVICE_STUB_H \ No newline at end of file diff --git a/device/services/profiler_service/test/unittest/plugin_session_test.cpp b/device/services/profiler_service/test/unittest/plugin_session_test.cpp new file mode 100755 index 000000000..cba6b18b3 --- /dev/null +++ b/device/services/profiler_service/test/unittest/plugin_session_test.cpp @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include + +#include "plugin_service.h" +#include "plugin_service_stubs.h" +#include "plugin_session.h" +#include "profiler_data_repeater.h" + +using namespace testing::ext; + +namespace { +constexpr int DATA_MAX_SIZE = 10; // set max size 10; + +using PluginServicePtr = STD_PTR(shared, PluginService); + +class PluginSessionTest : public ::testing::Test { +protected: + ProfilerPluginConfig config; + PluginInfo pluginInfo; + PluginServicePtr service; + ProfilerDataRepeaterPtr repeater; + + static void SetUpTestCase() {} + static void TearDownTestCase() {} + + void SetUp() override + { + config.set_name("test_session"); + pluginInfo.name = config.name(); + service = std::make_shared(); + repeater = std::make_shared(DATA_MAX_SIZE); // set max size 10; + if (service) { + service->AddPluginInfo(pluginInfo); + } + } + void TearDown() override + { + if (service) { + service->RemovePluginInfo(pluginInfo); + } + } +}; + +/** + * @tc.name: server + * @tc.desc: Session instantiation. + * @tc.type: FUNC + */ +HWTEST_F(PluginSessionTest, CtorDtor, TestSize.Level1) +{ + auto session = std::make_shared(config, service, repeater); + EXPECT_NE(session, nullptr); +} + +/** + * @tc.name: server + * @tc.desc: Create session. + * @tc.type: FUNC + */ +HWTEST_F(PluginSessionTest, Create, TestSize.Level1) +{ + auto session = std::make_shared(config, service, repeater); + + ASSERT_NE(session, nullptr); + EXPECT_TRUE(session->IsAvailable()); + + // create again must be failed + EXPECT_FALSE(session->Create()); + + config.set_name("test_session2"); + session = std::make_shared(config, service, repeater); + ASSERT_NE(session, nullptr); + EXPECT_FALSE(session->IsAvailable()); +} + +/** + * @tc.name: server + * @tc.desc: Destroy session. + * @tc.type: FUNC + */ +HWTEST_F(PluginSessionTest, Destroy, TestSize.Level1) +{ + auto session = std::make_shared(config, service, repeater); + + ASSERT_NE(session, nullptr); + EXPECT_TRUE(session->IsAvailable()); + + EXPECT_TRUE(session->Destroy()); + EXPECT_FALSE(session->IsAvailable()); + + // destroy again must be failed + EXPECT_FALSE(session->Destroy()); + + // recreate is OK + EXPECT_TRUE(session->Create()); + EXPECT_TRUE(session->Destroy()); +} + +/** + * @tc.name: server + * @tc.desc: get session state. + * @tc.type: FUNC + */ +HWTEST_F(PluginSessionTest, GetState, TestSize.Level1) +{ + auto session = std::make_shared(config, service, repeater); + + ASSERT_NE(session, nullptr); + EXPECT_EQ(session->GetState(), PluginSession::CREATED); + + EXPECT_TRUE(session->Start()); + EXPECT_EQ(session->GetState(), PluginSession::STARTED); + + EXPECT_TRUE(session->Stop()); + EXPECT_EQ(session->GetState(), PluginSession::CREATED); + + EXPECT_TRUE(session->Destroy()); + EXPECT_EQ(session->GetState(), PluginSession::INITIAL); +} + +/** + * @tc.name: server + * @tc.desc: Is available session. + * @tc.type: FUNC + */ +HWTEST_F(PluginSessionTest, IsAvailable, TestSize.Level1) +{ + auto session = std::make_shared(config, service, repeater); + + ASSERT_NE(session, nullptr); + EXPECT_TRUE(session->IsAvailable()); + + session.reset(); + config.set_name("test_session2"); + session = std::make_shared(config, service, repeater); + ASSERT_NE(session, nullptr); + EXPECT_FALSE(session->IsAvailable()); +} + +/** + * @tc.name: server + * @tc.desc: start session. + * @tc.type: FUNC + */ +HWTEST_F(PluginSessionTest, Start, TestSize.Level1) +{ + auto session = std::make_shared(config, service, repeater); + + ASSERT_NE(session, nullptr); + EXPECT_TRUE(session->Start()); + + session.reset(); + config.set_name("test_session2"); + session = std::make_shared(config, service, repeater); + ASSERT_NE(session, nullptr); + + EXPECT_FALSE(session->Start()); +} + +/** + * @tc.name: server + * @tc.desc: stop session. + * @tc.type: FUNC + */ +HWTEST_F(PluginSessionTest, Stop, TestSize.Level1) +{ + auto session = std::make_shared(config, service, repeater); + + ASSERT_NE(session, nullptr); + EXPECT_FALSE(session->Stop()); // stop without start must be failed + + EXPECT_TRUE(session->Start()); + EXPECT_TRUE(session->Stop()); + + session.reset(); + config.set_name("test_session2"); + session = std::make_shared(config, service, repeater); + ASSERT_NE(session, nullptr); + + EXPECT_FALSE(session->Stop()); +} +} // namespace \ No newline at end of file diff --git a/device/services/profiler_service/test/unittest/profiler_capability_manager_test.cpp b/device/services/profiler_service/test/unittest/profiler_capability_manager_test.cpp new file mode 100755 index 000000000..ee821b92d --- /dev/null +++ b/device/services/profiler_service/test/unittest/profiler_capability_manager_test.cpp @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include + +#include "profiler_capability_manager.h" + +using namespace testing::ext; + +namespace { +class ProfilerCapabilityManagerTest : public ::testing::Test { +protected: + static void SetUpTestCase() {} + static void TearDownTestCase() {} + + void SetUp() override {} + void TearDown() override + { + ProfilerCapabilityManager::GetInstance().pluginCapabilities_.clear(); + } +}; + +/** + * @tc.name: memory plugin + * @tc.desc: Add plugin capability. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerCapabilityManagerTest, AddCapability, TestSize.Level1) +{ + ProfilerPluginCapability cap1; + cap1.set_path("/system/lib/libcap1.so"); + cap1.set_name("cap1"); + + EXPECT_TRUE(ProfilerCapabilityManager::GetInstance().AddCapability(cap1)); +} + +/** + * @tc.name: memory plugin + * @tc.desc: get plugin capability. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerCapabilityManagerTest, GetCapabilities, TestSize.Level1) +{ + EXPECT_EQ(ProfilerCapabilityManager::GetInstance().GetCapabilities().size(), 0); + + std::vector caps = ProfilerCapabilityManager::GetInstance().GetCapabilities(); + EXPECT_EQ(caps.size(), 0); + + const int cnt = 10; + for (int i = 0; i < cnt; i++) { + ProfilerPluginCapability cap; + cap.set_path("/system/lib/libcap_" + std::to_string(i) + ".so"); + cap.set_name("cap_" + std::to_string(i)); + EXPECT_TRUE(ProfilerCapabilityManager::GetInstance().AddCapability(cap)); + caps = ProfilerCapabilityManager::GetInstance().GetCapabilities(); + EXPECT_EQ(caps.size(), i + 1); + } +} + +/** + * @tc.name: memory plugin + * @tc.desc: get plugin capability. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerCapabilityManagerTest, GetCapability, TestSize.Level1) +{ + EXPECT_EQ(ProfilerCapabilityManager::GetInstance().GetCapability("xxx"), nullptr); + + const int cnt = 10; + for (int i = 0; i < cnt; i++) { + ProfilerPluginCapability cap; + cap.set_path("/system/lib/libcap_" + std::to_string(i) + ".so"); + cap.set_name("cap_" + std::to_string(i)); + EXPECT_TRUE(ProfilerCapabilityManager::GetInstance().AddCapability(cap)); + } + + for (int i = 0; i < cnt; i++) { + ProfilerPluginCapability cap; + cap.set_name("cap_" + std::to_string(i)); + auto capPtr = ProfilerCapabilityManager::GetInstance().GetCapability(cap.name()); + ASSERT_NE(capPtr, nullptr); + EXPECT_EQ(capPtr->name(), cap.name()); + } +} + +/** + * @tc.name: memory plugin + * @tc.desc: update plugin capability. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerCapabilityManagerTest, UpdateCapability, TestSize.Level1) +{ + ProfilerPluginCapability cap1; + cap1.set_path("/system/lib/libcap1.so"); + cap1.set_name("cap1"); + EXPECT_TRUE(ProfilerCapabilityManager::GetInstance().AddCapability(cap1)); + + ProfilerPluginCapability cap2(cap1); + cap2.set_path("/system/lib/libcap2.so"); + EXPECT_TRUE(ProfilerCapabilityManager::GetInstance().UpdateCapability("cap1", cap2)); + + std::vector caps = ProfilerCapabilityManager::GetInstance().GetCapabilities(); + ASSERT_EQ(caps.size(), 1); + EXPECT_EQ(caps[0].path(), cap2.path()); +} + +/** + * @tc.name: server + * @tc.desc: remove plugin capability. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerCapabilityManagerTest, RemoveCapability, TestSize.Level1) +{ + const int cnt = 10; + std::vector caps; + for (int i = 0; i < cnt; i++) { + ProfilerPluginCapability cap; + cap.set_path("/system/lib/libcap_" + std::to_string(i) + ".so"); + cap.set_name("cap_" + std::to_string(i)); + EXPECT_TRUE(ProfilerCapabilityManager::GetInstance().AddCapability(cap)); + caps = ProfilerCapabilityManager::GetInstance().GetCapabilities(); + EXPECT_EQ(caps.size(), i + 1); + } + + for (int i = 0; i < cnt; i++) { + auto cap = caps[i]; + EXPECT_TRUE(ProfilerCapabilityManager::GetInstance().RemoveCapability(cap.name())); + + std::vector tmpCaps; + tmpCaps = ProfilerCapabilityManager::GetInstance().GetCapabilities(); + EXPECT_EQ(tmpCaps.size(), cnt - (i + 1)); + } +} +} // namespace \ No newline at end of file diff --git a/device/services/profiler_service/test/unittest/profiler_data_repeater_test.cpp b/device/services/profiler_service/test/unittest/profiler_data_repeater_test.cpp new file mode 100755 index 000000000..666509e11 --- /dev/null +++ b/device/services/profiler_service/test/unittest/profiler_data_repeater_test.cpp @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include +#include +#include "logging.h" +#include "profiler_data_repeater.h" + +using namespace testing::ext; + +namespace { +class ProfilerDataRepeaterTest : public ::testing::Test { +protected: + static void SetUpTestCase() {} + static void TearDownTestCase() {} + + void SetUp() override {} + void TearDown() override {} +}; + +/** + * @tc.name: server + * @tc.desc: put plugin data. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerDataRepeaterTest, PutPluginData, TestSize.Level1) +{ + const int bufferSize = 10; + auto dataRepeater = std::make_shared(bufferSize); + ASSERT_NE(dataRepeater, nullptr); + + for (int i = 0; i < bufferSize; i++) { + auto data = std::make_shared(); + dataRepeater->PutPluginData(data); + EXPECT_EQ(dataRepeater->Size(), i + 1); + } +} + +/** + * @tc.name: server + * @tc.desc: take plugin data. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerDataRepeaterTest, TakePluginData, TestSize.Level1) +{ + const int bufferSize = 10; + const int itemCounts = 10000; + auto inDataRepeater = std::make_shared(bufferSize); + ASSERT_NE(inDataRepeater, nullptr); + + auto outDataRepeater = std::make_shared(bufferSize); + ASSERT_NE(outDataRepeater, nullptr); + + auto f = [](int x) { return 2 * x + 1; }; + + std::thread worker([&]() { + for (int i = 0; i < itemCounts; i++) { + auto itemX = inDataRepeater->TakePluginData(); + + // compute in worker thread + int x = itemX ? std::stoi(itemX->data()) : 0; + int y = f(x); + + auto itemY = std::make_shared(); + itemY->set_data(std::to_string(y)); + outDataRepeater->PutPluginData(itemY); + } + }); + + for (int i = 0; i < itemCounts; i++) { + int x0 = i; + auto itemX = std::make_shared(); + itemX->set_data(std::to_string(x0)); + inDataRepeater->PutPluginData(itemX); + + auto itemY = outDataRepeater->TakePluginData(); + int y = itemY ? std::stoi(itemY->data()) : 0; + + // redo compute in main thread + int y0 = f(x0); + + // check results + EXPECT_EQ(y, y0); + } + worker.join(); +} + +/** + * @tc.name: server + * @tc.desc: take plugin profiler data. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerDataRepeaterTest, TakePluginDataVec, TestSize.Level1) +{ + const int itemCounts = 10000; + const int bufferSize = itemCounts; + auto inDataRepeater = std::make_shared(bufferSize); + ASSERT_NE(inDataRepeater, nullptr); + + auto outDataRepeater = std::make_shared(bufferSize); + ASSERT_NE(outDataRepeater, nullptr); + + auto f = [](int x) { return 2 * x + 1; }; + std::thread worker([&]() { + for (int i = 0; i < itemCounts; i++) { + auto xData = inDataRepeater->TakePluginData(); + + // compute in worker thread + int x = xData ? std::stoi(xData->data()) : 0; + int y = f(x); + + auto yData = std::make_shared(); + yData->set_data(std::to_string(y)); + outDataRepeater->PutPluginData(yData); + } + }); + + std::vector yVec; + for (int i = 0; i < itemCounts; i++) { + int x0 = i; + auto xData = std::make_shared(); + xData->set_data(std::to_string(x0)); + inDataRepeater->PutPluginData(xData); + + int y0 = f(x0); + yVec.push_back(y0); + } + worker.join(); + + std::vector pluginDataVec; + auto count = outDataRepeater->TakePluginData(pluginDataVec); + EXPECT_EQ(count, yVec.size()); + + for (size_t i = 0; i < pluginDataVec.size(); i++) { + auto yData = pluginDataVec[i]; + int y = yData ? std::stoi(yData->data()) : 0; + EXPECT_EQ(y, yVec[i]); + } +} + +/** + * @tc.name: server + * @tc.desc: close plugin profiler data. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerDataRepeaterTest, Close, TestSize.Level1) +{ + const int bufferSize = 10; + auto dataRepeater = std::make_shared(bufferSize); + ASSERT_NE(dataRepeater, nullptr); + + dataRepeater->Close(); +} + +/** + * @tc.name: server + * @tc.desc: reset plugin profiler data. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerDataRepeaterTest, Reset, TestSize.Level1) +{ + const int bufferSize = 10; + auto dataRepeater = std::make_shared(bufferSize); + ASSERT_NE(dataRepeater, nullptr); + + dataRepeater->Reset(); +} + +/** + * @tc.name: server + * @tc.desc: close plugin profiler data. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerDataRepeaterTest, CloseWithFastProducer, TestSize.Level1) +{ + const int bufferSize = 10; + const int numProducts = 20; + auto dataRepeater = std::make_shared(bufferSize); + ASSERT_NE(dataRepeater, nullptr); + + std::thread producer([=]() { + for (int i = 0; i < numProducts; i++) { + auto data = std::make_shared(); + if (!dataRepeater->PutPluginData(data)) { + HILOG_DEBUG(LOG_CORE, "put data %d FAILED!", i); + break; + } + } + }); + + const int consumeDelayUs = 50 * 1000; + std::thread consumer([=]() { + for (int i = 0; i < numProducts; i++) { + auto data = dataRepeater->TakePluginData(); + if (!data) { + HILOG_DEBUG(LOG_CORE, "get data %d FAILED!", i); + break; + } + usleep(consumeDelayUs); + } + }); + + usleep(consumeDelayUs * 3); + dataRepeater->Close(); + producer.join(); + consumer.join(); +} +} // namespace \ No newline at end of file diff --git a/device/services/profiler_service/test/unittest/profiler_service_test.cpp b/device/services/profiler_service/test/unittest/profiler_service_test.cpp new file mode 100644 index 000000000..8ac2d8196 --- /dev/null +++ b/device/services/profiler_service/test/unittest/profiler_service_test.cpp @@ -0,0 +1,523 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define final // disable final keyword +#define LOG_TAG "ProfilerServiceTest" + +#include +#include +#include + +#include "logging.h" +#include "plugin_service.h" +#include "profiler_capability_manager.h" +#include "profiler_data_repeater.h" +#include "profiler_service.h" + +using namespace testing::ext; + +using ProfilerServicePtr = STD_PTR(shared, ProfilerService); +class ProfilerServiceTest : public ::testing::Test { +protected: + PluginServicePtr pluginService_; + ProfilerServicePtr service_; + + PluginInfo pluginInfo; + std::unique_ptr context_; + std::atomic requestCounter{0}; + + static void SetUpTestCase() {} + static void TearDownTestCase() {} + + void SetUp() override + { + pluginInfo.name = "test_plugin"; + pluginService_ = std::make_shared(); + if (pluginService_) { + pluginService_->AddPluginInfo(pluginInfo); + } + service_ = std::make_shared(pluginService_); + context_ = std::make_unique(); + } + + void TearDown() override + { + context_.reset(); + service_.reset(); + if (pluginService_) { + pluginService_->RemovePluginInfo(pluginInfo); + } + pluginService_.reset(); + ProfilerCapabilityManager::GetInstance().pluginCapabilities_.clear(); + } + + grpc::Status StartSession(uint32_t sessionId) + { + StartSessionRequest request; + StartSessionResponse response; + + request.set_session_id(sessionId); + request.set_request_id(++requestCounter); + return service_->StartSession(context_.get(), &request, &response); + } + + grpc::Status StopSession(uint32_t sessionId) + { + StopSessionRequest request; + StopSessionResponse response; + + request.set_session_id(sessionId); + request.set_request_id(++requestCounter); + return service_->StopSession(context_.get(), &request, &response); + } + + grpc::Status DestroySession(uint32_t sessionId) + { + DestroySessionRequest request; + DestroySessionResponse response; + + request.set_session_id(sessionId); + request.set_request_id(++requestCounter); + return service_->DestroySession(context_.get(), &request, &response); + } + + void FetchDataOnlineSet(uint32_t& sessionId); +}; + +/** + * @tc.name: server + * @tc.desc: Abnormal test. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerServiceTest, CtorDtor, TestSize.Level1) +{ + ASSERT_NE(service_, nullptr); +} + +/** + * @tc.name: server + * @tc.desc: get plugin capabilities. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerServiceTest, GetCapabilities, TestSize.Level1) +{ + ASSERT_NE(service_, nullptr); + ASSERT_NE(context_, nullptr); + + GetCapabilitiesRequest request; + GetCapabilitiesResponse response; + + ProfilerPluginCapability cap; + cap.set_name("cap1"); + ProfilerCapabilityManager::GetInstance().AddCapability(cap); + + request.set_request_id(++requestCounter); + auto status = service_->GetCapabilities(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); + EXPECT_GT(response.capabilities_size(), 0); + HILOG_DEBUG(LOG_CORE, "GetCapabilities, capabilities_size = %d", response.capabilities_size()); +} + +/** + * @tc.name: server + * @tc.desc: create session. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerServiceTest, CreateSession, TestSize.Level1) +{ + ASSERT_NE(service_, nullptr); + ASSERT_NE(context_, nullptr); + + CreateSessionRequest request; + CreateSessionResponse response; + + auto status = service_->CreateSession(context_.get(), &request, &response); + EXPECT_NE(status.error_code(), grpc::StatusCode::OK); + + auto sessionConfig = request.mutable_session_config(); + ASSERT_NE(sessionConfig, nullptr); + sessionConfig->set_session_mode(ProfilerSessionConfig::OFFLINE); + sessionConfig->set_result_file("trace.bin"); + + auto pluginConfig = request.add_plugin_configs(); + ASSERT_NE(pluginConfig, nullptr); + pluginConfig->set_name(pluginInfo.name); + + request.set_request_id(++requestCounter); + status = service_->CreateSession(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); +} + +/** + * @tc.name: server + * @tc.desc: create session online. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerServiceTest, CreateSessionOnline, TestSize.Level1) +{ + ASSERT_NE(service_, nullptr); + ASSERT_NE(context_, nullptr); + + CreateSessionRequest request; + CreateSessionResponse response; + + auto sessionConfig = request.mutable_session_config(); + ASSERT_NE(sessionConfig, nullptr); + sessionConfig->set_session_mode(ProfilerSessionConfig::ONLINE); + sessionConfig->clear_result_file(); + + auto pluginConfig = request.add_plugin_configs(); + ASSERT_NE(pluginConfig, nullptr); + pluginConfig->set_name(pluginInfo.name); + + request.set_request_id(++requestCounter); + auto status = service_->CreateSession(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); +} + +/** + * @tc.name: server + * @tc.desc: destroy session. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerServiceTest, DestroySession, TestSize.Level1) +{ + ASSERT_NE(service_, nullptr); + + EXPECT_NE(DestroySession(0).error_code(), grpc::StatusCode::OK); + + uint32_t sessionId = 0; + { + CreateSessionRequest request; + CreateSessionResponse response; + + auto sessionConfig = request.mutable_session_config(); + ASSERT_NE(sessionConfig, nullptr); + sessionConfig->set_session_mode(ProfilerSessionConfig::OFFLINE); + sessionConfig->set_result_file("trace.bin"); + + auto pluginConfig = request.add_plugin_configs(); + ASSERT_NE(pluginConfig, nullptr); + pluginConfig->set_name(pluginInfo.name); + + request.set_request_id(++requestCounter); + auto status = service_->CreateSession(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); + sessionId = response.session_id(); + } + + EXPECT_EQ(DestroySession(sessionId).error_code(), grpc::StatusCode::OK); +} + +/** + * @tc.name: server + * @tc.desc: start session. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerServiceTest, StartSession, TestSize.Level1) +{ + ASSERT_NE(service_, nullptr); + ASSERT_NE(context_, nullptr); + + auto status = StartSession(0); + EXPECT_NE(status.error_code(), grpc::StatusCode::OK); + + uint32_t sessionId = 0; + { + CreateSessionRequest request; + CreateSessionResponse response; + + auto sessionConfig = request.mutable_session_config(); + ASSERT_NE(sessionConfig, nullptr); + sessionConfig->set_session_mode(ProfilerSessionConfig::OFFLINE); + sessionConfig->set_result_file("trace.bin"); + + auto pluginConfig = request.add_plugin_configs(); + ASSERT_NE(pluginConfig, nullptr); + pluginConfig->set_name(pluginInfo.name); + + request.set_request_id(++requestCounter); + auto status = service_->CreateSession(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); + sessionId = response.session_id(); + } + + status = StartSession(sessionId); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); +} + +/** + * @tc.name: server + * @tc.desc: start session by update config. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerServiceTest, StartSessionUpdateConfigs, TestSize.Level1) +{ + ASSERT_NE(service_, nullptr); + ASSERT_NE(context_, nullptr); + + uint32_t sessionId = 0; + { + CreateSessionRequest request; + CreateSessionResponse response; + + auto sessionConfig = request.mutable_session_config(); + ASSERT_NE(sessionConfig, nullptr); + sessionConfig->set_session_mode(ProfilerSessionConfig::OFFLINE); + sessionConfig->set_result_file("trace.bin"); + + auto pluginConfig = request.add_plugin_configs(); + ASSERT_NE(pluginConfig, nullptr); + pluginConfig->set_name(pluginInfo.name); + + request.set_request_id(++requestCounter); + auto status = service_->CreateSession(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); + sessionId = response.session_id(); + } + + StartSessionRequest request; + StartSessionResponse response; + + request.set_session_id(sessionId); + request.set_request_id(++requestCounter); + auto pluginConfig = request.add_update_configs(); + ASSERT_NE(pluginConfig, nullptr); + + pluginConfig->set_name(pluginInfo.name); + pluginConfig->set_sample_interval(1000); + auto status = service_->StartSession(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); +} + + +/** + * @tc.name: server + * @tc.desc: stop session. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerServiceTest, StopSession, TestSize.Level1) +{ + ASSERT_NE(service_, nullptr); + ASSERT_NE(context_, nullptr); + + auto status = StopSession(0); + EXPECT_NE(status.error_code(), grpc::StatusCode::OK); + + uint32_t sessionId = 0; + { + CreateSessionRequest request; + CreateSessionResponse response; + + auto sessionConfig = request.mutable_session_config(); + ASSERT_NE(sessionConfig, nullptr); + sessionConfig->set_session_mode(ProfilerSessionConfig::OFFLINE); + sessionConfig->set_result_file("trace.bin"); + + auto pluginConfig = request.add_plugin_configs(); + ASSERT_NE(pluginConfig, nullptr); + pluginConfig->set_name(pluginInfo.name); + + request.set_request_id(++requestCounter); + auto status = service_->CreateSession(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); + + sessionId = response.session_id(); + { + StartSessionRequest request; + StartSessionResponse response; + + request.set_session_id(sessionId); + request.set_request_id(++requestCounter); + auto status = service_->StartSession(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); + } + } + + status = StopSession(sessionId); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); +} + +class FakeServerWriter : public ::grpc::ServerWriter<::FetchDataResponse> { +public: + FakeServerWriter(::grpc::internal::Call* call, grpc::ServerContext* ctx) + : ::grpc::ServerWriter<::FetchDataResponse>(call, ctx) + { + } + ~FakeServerWriter() = default; + using grpc::internal::WriterInterface<::FetchDataResponse>::Write; + bool Write(const ::FetchDataResponse& msg, ::grpc::WriteOptions options) override + { + HILOG_DEBUG(LOG_CORE, "FakeServerWriter::Write %zu bytes!", msg.ByteSizeLong()); + return true; + } +}; + +/** + * @tc.name: server + * @tc.desc: fetch data. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerServiceTest, FetchData, TestSize.Level1) +{ + ASSERT_NE(service_, nullptr); + ASSERT_NE(context_, nullptr); + + FetchDataRequest request; + + auto writer = std::make_unique(nullptr, context_.get()); + + request.set_request_id(++requestCounter); + auto status = service_->FetchData(context_.get(), &request, writer.get()); + EXPECT_NE(status.error_code(), grpc::StatusCode::OK); + + uint32_t sessionId = 0; + { + CreateSessionRequest request; + CreateSessionResponse response; + + auto sessionConfig = request.mutable_session_config(); + ASSERT_NE(sessionConfig, nullptr); + sessionConfig->set_session_mode(ProfilerSessionConfig::OFFLINE); + sessionConfig->set_result_file("trace.bin"); + + auto pluginConfig = request.add_plugin_configs(); + ASSERT_NE(pluginConfig, nullptr); + pluginConfig->set_name(pluginInfo.name); + + request.set_request_id(++requestCounter); + auto status = service_->CreateSession(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); + + sessionId = response.session_id(); + { + StartSessionRequest request; + StartSessionResponse response; + + request.set_session_id(sessionId); + request.set_request_id(++requestCounter); + auto status = service_->StartSession(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); + } + } + + request.set_session_id(sessionId); + request.set_request_id(++requestCounter); + status = service_->FetchData(context_.get(), &request, writer.get()); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); + + EXPECT_EQ(StopSession(sessionId).error_code(), grpc::StatusCode::OK); + EXPECT_EQ(DestroySession(sessionId).error_code(), grpc::StatusCode::OK); +} + +void ProfilerServiceTest::FetchDataOnlineSet(uint32_t& sessionId) +{ + CreateSessionRequest request; + CreateSessionResponse response; + + auto sessionConfig = request.mutable_session_config(); + ASSERT_NE(sessionConfig, nullptr); + sessionConfig->set_session_mode(ProfilerSessionConfig::ONLINE); + + auto pluginConfig = request.add_plugin_configs(); + ASSERT_NE(pluginConfig, nullptr); + pluginConfig->set_name(pluginInfo.name); + + request.set_request_id(++requestCounter); + auto status = service_->CreateSession(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); + + sessionId = response.session_id(); + { + StartSessionRequest request; + StartSessionResponse response; + + request.set_session_id(sessionId); + request.set_request_id(++requestCounter); + auto status = service_->StartSession(context_.get(), &request, &response); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); + } +} + +/** + * @tc.name: server + * @tc.desc: fetch data online. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerServiceTest, FetchDataOnline, TestSize.Level1) +{ + ASSERT_NE(service_, nullptr); + ASSERT_NE(context_, nullptr); + + FetchDataRequest request; + + auto writer = std::make_unique(nullptr, context_.get()); + + request.set_request_id(++requestCounter); + auto status = service_->FetchData(context_.get(), &request, writer.get()); + EXPECT_NE(status.error_code(), grpc::StatusCode::OK); + + uint32_t sessionId = 0; + FetchDataOnlineSet(sessionId); + + auto sessionCtx = service_->GetSessionContext(sessionId); + ASSERT_NE(sessionCtx->dataRepeater, nullptr); + + const int pluginDataCount = 10; + std::thread dataProducer([&]() { + for (int i = 0; i < pluginDataCount; i++) { + auto data = std::make_shared(); + ASSERT_NE(data, nullptr); + data->set_name(pluginInfo.name); + data->set_status(i); + sessionCtx->dataRepeater->PutPluginData(data); + } + }); + + request.set_session_id(sessionId); + request.set_request_id(++requestCounter); + + std::thread dataConsumer([&]() { + status = service_->FetchData(context_.get(), &request, writer.get()); + EXPECT_EQ(status.error_code(), grpc::StatusCode::OK); + }); + + dataProducer.join(); + + usleep(100 * 1000); // wait for reader take done! + sessionCtx->dataRepeater->Close(); + dataConsumer.join(); + + EXPECT_EQ(StopSession(sessionId).error_code(), grpc::StatusCode::OK); + EXPECT_EQ(DestroySession(sessionId).error_code(), grpc::StatusCode::OK); +} + +/** + * @tc.name: server + * @tc.desc: start service. + * @tc.type: FUNC + */ +HWTEST_F(ProfilerServiceTest, StartService, TestSize.Level1) +{ + auto service = std::make_unique(); + EXPECT_NE(service, nullptr); + EXPECT_FALSE(service->StartService("")); + + std::thread waiterThread(&ProfilerService::WaitServiceDone, service.get()); + sleep(1); + + service->StopService(); + waiterThread.join(); +} diff --git a/device/services/profiler_service/test/unittest/result_demuxer_test.cpp b/device/services/profiler_service/test/unittest/result_demuxer_test.cpp new file mode 100644 index 000000000..2583fd4de --- /dev/null +++ b/device/services/profiler_service/test/unittest/result_demuxer_test.cpp @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include + +#include "logging.h" +#include "result_demuxer.h" + +using namespace testing::ext; + +namespace { +constexpr int DATA_MAX_SIZE = 10; // set max size 10; + +class ResultDemuxerTest : public ::testing::Test { +protected: + std::string path = "demux.bin"; + ProfilerDataRepeaterPtr repeater; + + static void SetUpTestCase() {} + static void TearDownTestCase() {} + + void SetUp() override + { + repeater = std::make_shared(DATA_MAX_SIZE); + } + + void TearDown() override {} +}; + +/** + * @tc.name: server + * @tc.desc: Class-strengthening. + * @tc.type: FUNC + */ +HWTEST_F(ResultDemuxerTest, CtorDtor, TestSize.Level1) +{ + auto demuxer = std::make_shared(repeater); + EXPECT_NE(demuxer, nullptr); +} + +/** + * @tc.name: server + * @tc.desc: set trace writer. + * @tc.type: FUNC + */ +HWTEST_F(ResultDemuxerTest, SetTraceWriter, TestSize.Level1) +{ + auto demuxer = std::make_shared(repeater); + ASSERT_NE(demuxer, nullptr); + + demuxer->SetTraceWriter(nullptr); + + auto writer = std::make_shared(path); + EXPECT_NE(writer, nullptr); + demuxer->SetTraceWriter(writer); +} + +/** + * @tc.name: server + * @tc.desc: set server writer. + * @tc.type: FUNC + */ +HWTEST_F(ResultDemuxerTest, SetServerWriter, TestSize.Level1) +{ + auto demuxer = std::make_shared(repeater); + ASSERT_NE(demuxer, nullptr); +} + +/** + * @tc.name: server + * @tc.desc: set take results. + * @tc.type: FUNC + */ +HWTEST_F(ResultDemuxerTest, StartTakeResults, TestSize.Level1) +{ + auto demuxer = std::make_shared(repeater); + ASSERT_NE(demuxer, nullptr); + + auto writer = std::make_shared(path); + EXPECT_NE(writer, nullptr); + demuxer->SetTraceWriter(writer); + + const int putCount = 20; + const int putDelayUs = 20 * 1000; + demuxer->StartTakeResults(); + std::thread dataProducer([=] { + for (int i = 0; i < putCount; i++) { + auto pluginData = std::make_shared(); + ASSERT_NE(pluginData, nullptr); + pluginData->set_name("test-" + std::to_string(i)); + pluginData->set_status(i); + repeater->PutPluginData(pluginData); + HILOG_DEBUG(LOG_CORE, "put test data %d...", i); + usleep(putDelayUs); + } + repeater->PutPluginData(nullptr); + }); + + HILOG_DEBUG(LOG_CORE, "waiting producer thread done..."); + dataProducer.join(); +} + +/** + * @tc.name: server + * @tc.desc: stop take results. + * @tc.type: FUNC + */ +HWTEST_F(ResultDemuxerTest, StopTakeResults, TestSize.Level1) +{ + auto demuxer = std::make_shared(repeater); + ASSERT_NE(demuxer, nullptr); + + auto writer = std::make_shared(path); + EXPECT_NE(writer, nullptr); + demuxer->SetTraceWriter(writer); + + const int putCount = 30; + const int putDelayUs = 20 * 1000; + demuxer->StartTakeResults(); + std::thread dataProducer([=] { + for (int i = 0; i < putCount; i++) { + auto pluginData = std::make_shared(); + ASSERT_NE(pluginData, nullptr); + pluginData->set_name("AB-" + std::to_string(i)); + pluginData->set_status(i); + + HILOG_DEBUG(LOG_CORE, "put test data %d...", i); + if (!repeater->PutPluginData(pluginData)) { + HILOG_WARN(LOG_CORE, "put test data %d FAILED!", i); + break; + } + usleep(putDelayUs); + } + }); + + usleep((putCount / 2) * putDelayUs); + demuxer->StopTakeResults(); + + repeater->Close(); + HILOG_DEBUG(LOG_CORE, "waiting producer thread done..."); + dataProducer.join(); +} +} // namespace \ No newline at end of file diff --git a/device/services/profiler_service/test/unittest/trace_file_reader_test.cpp b/device/services/profiler_service/test/unittest/trace_file_reader_test.cpp new file mode 100644 index 000000000..56b617377 --- /dev/null +++ b/device/services/profiler_service/test/unittest/trace_file_reader_test.cpp @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "TraceFileReaderTest" +#include +#include +#include +#include +#include +#include + +#include "common_types.pb.h" +#include "logging.h" +#include "trace_file_reader.h" +#include "trace_file_writer.h" + +using namespace testing::ext; + +namespace { +#if defined(__i386__) || defined(__x86_64__) +const std::string DEFAULT_TEST_PATH("./"); +#else +const std::string DEFAULT_TEST_PATH("/data/local/tmp/"); +#endif + +class TraceFileReaderTest : public ::testing::Test { +protected: + std::string path = "trace.bin"; + + static void SetUpTestCase() {} + static void TearDownTestCase() {} + + void SetUp() override {} + + void TearDown() override {} +}; + +/** + * @tc.name: server + * @tc.desc: write read. + * @tc.type: FUNC + */ +HWTEST_F(TraceFileReaderTest, WriteRead, TestSize.Level1) +{ + std::string path = "trace-write-msg.bin"; + auto writer = std::make_shared(path); + ASSERT_NE(writer, nullptr); + + constexpr int n = 100; + for (int i = 1; i <= n; i++) { + ProfilerPluginData pluginData{}; + pluginData.set_name("test_name"); + pluginData.set_status(i); + pluginData.set_data("Hello, World!"); + long bytes = writer->Write(pluginData); + EXPECT_EQ(bytes, sizeof(uint32_t) + pluginData.ByteSizeLong()); + HILOG_INFO(LOG_CORE, "[%d/%d] write %ld bytes to %s.", i, n, bytes, path.c_str()); + } + writer.reset(); // make sure write done! + + auto reader = std::make_shared(); + ASSERT_NE(reader, nullptr); + ASSERT_TRUE(reader->Open(path)); + + for (int i = 1; i <= n; i++) { + ProfilerPluginData data{}; + long bytes = reader->Read(data); + HILOG_INFO(LOG_CORE, "data = {%s, %d, %s}", data.name().c_str(), data.status(), data.data().c_str()); + HILOG_INFO(LOG_CORE, "read %ld bytes from %s", bytes, path.c_str()); + } +} + +/** + * @tc.name: server + * @tc.desc: write read break. + * @tc.type: FUNC + */ +HWTEST_F(TraceFileReaderTest, WriteReadBreak, TestSize.Level1) +{ + std::string path = "trace-write-msg.bin"; + auto writer = std::make_shared(path); + ASSERT_NE(writer, nullptr); + + constexpr int n = 100; + for (int i = 1; i <= n; i++) { + ProfilerPluginData pluginData{}; + pluginData.set_name("test_name"); + pluginData.set_status(i); + pluginData.set_data("Hello, World!"); + long bytes = writer->Write(pluginData); + EXPECT_EQ(bytes, sizeof(uint32_t) + pluginData.ByteSizeLong()); + HILOG_INFO(LOG_CORE, "[%d/%d] write %ld bytes to %s.", i, n, bytes, path.c_str()); + } + writer.reset(); // make sure write done! + + auto reader = std::make_shared(); + ASSERT_NE(reader, nullptr); + ASSERT_TRUE(reader->Open(path)); + + long bytes = 0; + do { + ProfilerPluginData data{}; + bytes = reader->Read(data); + HILOG_INFO(LOG_CORE, "data = {%s, %d, %s}", data.name().c_str(), data.status(), data.data().c_str()); + HILOG_INFO(LOG_CORE, "read %ld bytes from %s", bytes, path.c_str()); + } while (bytes > 0); +} + +/** + * @tc.name: server + * @tc.desc: read. + * @tc.type: FUNC + */ +HWTEST_F(TraceFileReaderTest, Read, TestSize.Level1) +{ + std::string name = "325.ht"; + std::string path = DEFAULT_TEST_PATH + name; + + if (access(path.c_str(), F_OK) != 0) { + system(std::string("touch " + path).c_str()); + } + auto reader = std::make_shared(); + ASSERT_NE(reader, nullptr); + ASSERT_TRUE(reader->Open(path)); + + long bytes = 0; + do { + ProfilerPluginData data{}; + bytes = reader->Read(data); + fprintf(stderr, "data = [%s, %d, ...%zu], len = %zu, bytes = %ld\n", data.name().c_str(), data.status(), + data.data().size(), data.ByteSizeLong(), bytes); + } while (bytes > 0); + if (access(path.c_str(), F_OK) == 0) { + system(std::string("rm " + path).c_str()); + } +} +} // namespace diff --git a/device/services/profiler_service/test/unittest/trace_file_writer_test.cpp b/device/services/profiler_service/test/unittest/trace_file_writer_test.cpp new file mode 100755 index 000000000..486ec6ade --- /dev/null +++ b/device/services/profiler_service/test/unittest/trace_file_writer_test.cpp @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "TraceFileWriterTest" +#include +#include +#include +#include +#include + +#include "common_types.pb.h" +#include "logging.h" +#include "trace_file_writer.h" + +using namespace testing::ext; + +namespace { +class TraceFileWriterTest : public ::testing::Test { +protected: + std::string path = "trace.bin"; + + static void SetUpTestCase() {} + static void TearDownTestCase() {} + + void SetUp() override {} + + void TearDown() override + { + int retval = unlink(path.c_str()); + HILOG_DEBUG(LOG_CORE, "unlink(%s): %d", path.c_str(), retval); + } +}; + +/** + * @tc.name: server + * @tc.desc: Class-strengthening. + * @tc.type: FUNC + */ +HWTEST_F(TraceFileWriterTest, CtorDtor, TestSize.Level1) +{ + auto writer = std::make_shared(path); + EXPECT_NE(writer, nullptr); +} + +/** + * @tc.name: server + * @tc.desc: write. + * @tc.type: FUNC + */ +HWTEST_F(TraceFileWriterTest, Write, TestSize.Level1) +{ + path = "trace-write.bin"; + auto writer = std::make_shared(path); + ASSERT_NE(writer, nullptr); + + std::string testData = "Hello, Wrold!"; + EXPECT_EQ(writer->Write(testData.data(), testData.size()), sizeof(uint32_t) + testData.size()); +} + +/** + * @tc.name: server + * @tc.desc: flush. + * @tc.type: FUNC + */ +HWTEST_F(TraceFileWriterTest, Flush, TestSize.Level1) +{ + std::string testData = "Hello, Wrold!"; + path = "trace-flush.bin"; + { + auto writer = std::make_shared(path); + ASSERT_NE(writer, nullptr); + EXPECT_EQ(writer->Write(testData.data(), testData.size()), sizeof(uint32_t) + testData.size()); + EXPECT_EQ(writer->Flush(), true); + } + + uint32_t msgLen = 0; + std::ifstream fin(path, std::ios_base::in | std::ios_base::binary); + ASSERT_TRUE(fin.is_open()); + + // check file length + fin.seekg(0, std::ios_base::end); + EXPECT_EQ(fin.tellg(), sizeof(msgLen) + testData.size()); + + // check msg length + fin.seekg(0, std::ios_base::beg); + fin.read(reinterpret_cast(&msgLen), sizeof(msgLen)); + EXPECT_EQ(msgLen, testData.size()); + + // check msg data + std::vector outData(testData.size()); + fin.read(outData.data(), outData.size()); // read into outData + EXPECT_EQ(memcmp(outData.data(), testData.data(), outData.size()), 0); +} + +/** + * @tc.name: server + * @tc.desc: write message. + * @tc.type: FUNC + */ +HWTEST_F(TraceFileWriterTest, WriteMessage, TestSize.Level1) +{ + path = "trace-write-message.bin"; + auto writer = std::make_shared(path); + ASSERT_NE(writer, nullptr); + + ProfilerPluginData pluginData; + pluginData.set_name("ABC"); + pluginData.set_status(0); + pluginData.set_data("DEF"); + EXPECT_GT(writer->Write(pluginData), 0); +} +} // namespace diff --git a/device/services/shared_memory/BUILD.gn b/device/services/shared_memory/BUILD.gn new file mode 100755 index 000000000..d86e175c3 --- /dev/null +++ b/device/services/shared_memory/BUILD.gn @@ -0,0 +1,81 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("../../base/config.gni") + +config("shared_memory_config") { + include_dirs = [ + "include", + "../../base/include", + "${OHOS_PROFILER_DIR}/interfaces/innerkits", + "//utils/native/base/include", + ] + if (current_toolchain == host_toolchain) { + cflags += [ "-DHAVE_PTHREAD" ] + } else { + } +} + +ohos_shared_library("shared_memory") { + sources = [ + "src/share_memory_allocator.cpp", + "src/share_memory_block.cpp", + ] + public_configs = [ + ":shared_memory_config", + "../../base:hiprofiler_test_config", + ] + + public_deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + "//utils/native/base:utilsbase", + ] + install_enable = true + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + + if (current_toolchain != host_toolchain) { + defines = [ "HAVE_HILOG" ] + if (build_l2) { + external_deps = [ "shared_library:libhilog" ] + } else { + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + } + } +} + +ohos_static_library("shared_memory_static") { + sources = [ + "src/share_memory_allocator.cpp", + "src/share_memory_block.cpp", + ] + public_configs = [ + ":shared_memory_config", + "../../base:hiprofiler_test_config", + ] + + public_deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + ] + + if (current_toolchain != host_toolchain) { + defines = [ "HAVE_HILOG" ] + if (build_l2) { + external_deps = [ "shared_library::libhilog" ] + } else { + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + } + } +} diff --git a/device/services/shared_memory/include/share_memory_allocator.h b/device/services/shared_memory/include/share_memory_allocator.h new file mode 100644 index 000000000..e374a961b --- /dev/null +++ b/device/services/shared_memory/include/share_memory_allocator.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SHARE_MEMORY_ALLOCATOR_H +#define SHARE_MEMORY_ALLOCATOR_H + +#include "share_memory_block.h" +#include "logging.h" + +using ShareMemoryBlockPtr = STD_PTR(shared, ShareMemoryBlock); + +class ShareMemoryAllocator { +public: + static ShareMemoryAllocator& GetInstance(); + + ShareMemoryBlockPtr CreateMemoryBlockLocal(std::string name, uint32_t size); + ShareMemoryBlockPtr CreateMemoryBlockRemote(std::string name, uint32_t size, int fd); + + bool ReleaseMemoryBlockLocal(std::string name); + bool ReleaseMemoryBlockRemote(std::string name); + + ShareMemoryBlockPtr FindMBByName(std::string name); + +private: + ShareMemoryAllocator(); + ~ShareMemoryAllocator(); + + std::map memoryBlocks; +}; + +#endif \ No newline at end of file diff --git a/device/services/shared_memory/include/share_memory_block.h b/device/services/shared_memory/include/share_memory_block.h new file mode 100755 index 000000000..c6ca15df9 --- /dev/null +++ b/device/services/shared_memory/include/share_memory_block.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SHARE_MEMORY_BLOCK_H +#define SHARE_MEMORY_BLOCK_H + +#include "google/protobuf/message.h" +#include + +#define SHARE_MEMORY_HEAD_SIZE 64 + +struct ShareMemoryStruct { + struct alignas(SHARE_MEMORY_HEAD_SIZE) { + uint32_t writeOffset; + uint32_t readOffset; + uint32_t memorySize_; + } head; + int8_t data[0]; +}; + +class ShareMemoryBlock { +public: + ShareMemoryBlock(); + ~ShareMemoryBlock() {} + + bool CreateBlock(std::string name, uint32_t size); + bool ReleaseBlock(); + bool CreateBlockByFd(std::string name, uint32_t size, int fd); + bool ReleaseBlockRemote(); + + int8_t* GetFreeMemory(uint32_t size); + bool UseFreeMemory(int8_t* pmem, uint32_t size); + bool PutRaw(const int8_t* data, uint32_t size); + bool PutProtobuf(google::protobuf::Message& pmsg); + + uint32_t GetDataSize(); + const int8_t* GetDataPoint(); + bool Next(); + + std::string GetName(); + uint32_t GetSize(); + int GetfileDescriptor(); + + enum DropType { + DROP_OLD, // buffer满时,丢弃最老的数据 + DROP_NONE, // buffer满时,不丢弃老数据,不放入新数据 + }; + void SetDropType(enum DropType dt) + { + dropType_ = dt; + } + +private: + int8_t* GetCurrentFreeMemory(uint32_t size); + + std::string memoryName_; + uint32_t memorySize_; + int fileDescriptor_; + + void* memoryPoint_; + struct ShareMemoryStruct* pMemory_; + + DropType dropType_; +}; + +#endif \ No newline at end of file diff --git a/device/services/shared_memory/src/share_memory_allocator.cpp b/device/services/shared_memory/src/share_memory_allocator.cpp new file mode 100644 index 000000000..16e9be992 --- /dev/null +++ b/device/services/shared_memory/src/share_memory_allocator.cpp @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "share_memory_allocator.h" +#include +#include +#include +#include +#include +#include "logging.h" +#include "share_memory_block.h" + +namespace { +const int MIN_SHARE_MEMORY_SIZE = 1024; +} +ShareMemoryAllocator& ShareMemoryAllocator::GetInstance() +{ + static ShareMemoryAllocator shareMemoryAllocator; + + return shareMemoryAllocator; +} + +ShareMemoryAllocator::ShareMemoryAllocator() {} +ShareMemoryAllocator::~ShareMemoryAllocator() {} + +bool ShareMemoryAllocator::ReleaseMemoryBlockLocal(std::string name) +{ + auto pmb = FindMBByName(name); + + CHECK_NOTNULL(pmb, false, "FAIL %s", name.c_str()); + + pmb->ReleaseBlock(); + memoryBlocks.erase(name); + return true; +} + +bool ShareMemoryAllocator::ReleaseMemoryBlockRemote(std::string name) +{ + auto pmb = FindMBByName(name); + + CHECK_NOTNULL(pmb, false, "FAIL %s", name.c_str()); + + pmb->ReleaseBlockRemote(); + memoryBlocks.erase(name); + return true; +} + +ShareMemoryBlockPtr ShareMemoryAllocator::CreateMemoryBlockLocal(std::string name, uint32_t size) +{ + CHECK_TRUE(memoryBlocks.find(name) == memoryBlocks.end(), nullptr, "%s already used", name.c_str()); + + CHECK_TRUE(size >= MIN_SHARE_MEMORY_SIZE, NULL, "%s %d size less than %d", name.c_str(), size, + MIN_SHARE_MEMORY_SIZE); + + memoryBlocks[name] = std::make_shared(); + memoryBlocks[name]->CreateBlock(name, size); + return memoryBlocks[name]; +} + +ShareMemoryBlockPtr ShareMemoryAllocator::CreateMemoryBlockRemote(std::string name, uint32_t size, int fd) +{ + memoryBlocks[name] = std::make_shared(); + if (memoryBlocks[name]->CreateBlockByFd(name, size, fd)) { + return memoryBlocks[name]; + } + memoryBlocks.erase(name); + HILOG_INFO(LOG_CORE, "CreateMemoryBlockRemote FAIL"); + return nullptr; +} + +ShareMemoryBlockPtr ShareMemoryAllocator::FindMBByName(std::string name) +{ + CHECK_TRUE(memoryBlocks.find(name) != memoryBlocks.end(), nullptr, "FAIL"); + return memoryBlocks[name]; +} diff --git a/device/services/shared_memory/src/share_memory_block.cpp b/device/services/shared_memory/src/share_memory_block.cpp new file mode 100755 index 000000000..f7f0f2d4a --- /dev/null +++ b/device/services/shared_memory/src/share_memory_block.cpp @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "share_memory_block.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "logging.h" +#include "securec.h" + +namespace { +const int HEAD_OFFSET_LEN = 4; +} + +ShareMemoryBlock::ShareMemoryBlock() +{ + memoryPoint_ = nullptr; + memorySize_ = 0; + fileDescriptor_ = -1; + dropType_ = DropType::DROP_NONE; + pMemory_ = nullptr; + memoryName_ = ""; +} + +std::string ReplaceStr(std::string base, std::string _from, std::string _to) +{ + while (true) { + size_t pos = base.find(_from, 0); + if (pos == std::string::npos) { + break; + } + base.replace(pos, _from.length(), _to); + } + return base; +} + +bool ShareMemoryBlock::CreateBlockByFd(std::string name, uint32_t size, int fd) +{ + CHECK_TRUE(memorySize_ == 0, false, "%s already allocated memory", name.c_str()); + + fileDescriptor_ = fd; + + CHECK_TRUE(fileDescriptor_ >= 0, false, "CreateBlock FAIL SYS_memfd_create"); + + memoryPoint_ = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileDescriptor_, 0); + if (memoryPoint_ == MAP_FAILED) { + ReleaseBlockRemote(); + + HILOG_ERROR(LOG_CORE, "CreateBlockByFd mmap ERR : %s", strerror(errno)); + return false; + } + + memorySize_ = size; + + memoryName_ = name; + pMemory_ = (struct ShareMemoryStruct*)memoryPoint_; + return true; +} + +bool ShareMemoryBlock::CreateBlock(std::string name, uint32_t size) +{ + HILOG_INFO(LOG_CORE, "CreateBlock %s %d", name.c_str(), size); + + CHECK_TRUE(memorySize_ == 0, false, "%s already allocated memory", name.c_str()); + + fileDescriptor_ = syscall(SYS_memfd_create, name.c_str(), 0); + + CHECK_TRUE(fileDescriptor_ >= 0, false, "CreateBlock FAIL SYS_memfd_create"); + + int check = ftruncate(fileDescriptor_, size); + if (check < 0) { + ReleaseBlock(); + + HILOG_ERROR(LOG_CORE, "CreateBlock ftruncate ERR : %s", strerror(errno)); + return false; + } + + memoryPoint_ = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileDescriptor_, 0); + if (memoryPoint_ == MAP_FAILED) { + ReleaseBlock(); + HILOG_ERROR(LOG_CORE, "CreateBlock mmap ERR : %s", strerror(errno)); + + return false; + } + memorySize_ = size; + + memoryName_ = name; + pMemory_ = (struct ShareMemoryStruct*)memoryPoint_; + pMemory_->head.readOffset = 0; + pMemory_->head.writeOffset = 0; + pMemory_->head.memorySize_ = size - SHARE_MEMORY_HEAD_SIZE; + return true; +} + +bool ShareMemoryBlock::ReleaseBlock() +{ + if (memorySize_ > 0) { + munmap(memoryPoint_, memorySize_); + memoryPoint_ = nullptr; + memorySize_ = 0; + } + + if (fileDescriptor_ >= 0) { + close(fileDescriptor_); + fileDescriptor_ = -1; + } + return true; +} +bool ShareMemoryBlock::ReleaseBlockRemote() +{ + return ReleaseBlock(); +} + +int8_t* ShareMemoryBlock::GetCurrentFreeMemory(uint32_t size) +{ + uint32_t realSize = size + sizeof(uint32_t) + HEAD_OFFSET_LEN; + uint32_t wp = pMemory_->head.writeOffset; + if (wp + realSize > pMemory_->head.memorySize_) { // 后面部分放不下,从头开始放 + if (pMemory_->head.readOffset == 0) { + return nullptr; + } + *((uint32_t*)(&pMemory_->data[wp])) = 0xffffffff; + wp = 0; + } + if (wp < pMemory_->head.readOffset && pMemory_->head.readOffset < wp + realSize) { // + return nullptr; + } + + return &pMemory_->data[wp + sizeof(uint32_t)]; +} + +int8_t* ShareMemoryBlock::GetFreeMemory(uint32_t size) +{ + if (dropType_ == DropType::DROP_NONE) { + return GetCurrentFreeMemory(size); + } + int8_t* ret = nullptr; + while (true) { + ret = GetCurrentFreeMemory(size); + if (ret != nullptr) { + break; + } + if (!Next()) { + return nullptr; + } + } + return ret; +} + +bool ShareMemoryBlock::UseFreeMemory(int8_t* pmem, uint32_t size) +{ + uint32_t wp = pmem - sizeof(uint32_t) - pMemory_->data; + *((int*)(&pMemory_->data[wp])) = size; + pMemory_->head.writeOffset = wp + sizeof(uint32_t) + size; + return true; +} + +bool ShareMemoryBlock::PutRaw(const int8_t* data, uint32_t size) +{ + int8_t* rawMemory = GetFreeMemory(size); + if (rawMemory == nullptr) { + HILOG_INFO(LOG_CORE, "_PutRaw not enough space [%d]", size); + return false; + } + if (memcpy_s(rawMemory, size, data, size) != EOK) { + HILOG_ERROR(LOG_CORE, "memcpy_s error"); + } + + UseFreeMemory(rawMemory, size); + return true; +} + +bool ShareMemoryBlock::PutProtobuf(google::protobuf::Message& pmsg) +{ + size_t size = pmsg.ByteSizeLong(); + + int8_t* rawMemory = GetFreeMemory(size); + if (rawMemory == nullptr) { + HILOG_INFO(LOG_CORE, "PutProtobuf not enough space [%zu]", size); + return false; + } + + pmsg.SerializeToArray(rawMemory, size); + UseFreeMemory(rawMemory, size); + return true; +} + +uint32_t ShareMemoryBlock::GetDataSize() +{ + if (pMemory_->head.readOffset == pMemory_->head.writeOffset) { + return 0; + } + uint32_t ret = *((uint32_t*)(&pMemory_->data[pMemory_->head.readOffset])); + if (ret == 0xffffffff) { + ret = *((uint32_t*)(&pMemory_->data[0])); + } + return ret; +} + +const int8_t* ShareMemoryBlock::GetDataPoint() +{ + if (*((uint32_t*)(&pMemory_->data[pMemory_->head.readOffset])) == 0xffffffff) { + return &pMemory_->data[HEAD_OFFSET_LEN]; + } + return &pMemory_->data[pMemory_->head.readOffset + HEAD_OFFSET_LEN]; +} +bool ShareMemoryBlock::Next() +{ + if (pMemory_->head.readOffset == pMemory_->head.writeOffset) { + return false; + } + uint32_t size = *((uint32_t*)(&pMemory_->data[pMemory_->head.readOffset])); + if (size == 0xffffffff) { + size = *((uint32_t*)(&pMemory_->data[0])); + pMemory_->head.readOffset = size + sizeof(uint32_t); + } else { + pMemory_->head.readOffset += size + sizeof(uint32_t); + } + return true; +} + +std::string ShareMemoryBlock::GetName() +{ + return memoryName_; +} + +uint32_t ShareMemoryBlock::GetSize() +{ + return memorySize_; +} + +int ShareMemoryBlock::GetfileDescriptor() +{ + return fileDescriptor_; +} diff --git a/device/services/shared_memory/test/BUILD.gn b/device/services/shared_memory/test/BUILD.gn new file mode 100755 index 000000000..37e00da8b --- /dev/null +++ b/device/services/shared_memory/test/BUILD.gn @@ -0,0 +1,59 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/test.gni") +import("../../../base/config.gni") + +module_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/device" +config("module_private_config") { + visibility = [":*"] + if (current_toolchain != host_toolchain) { + defines = [ "HAVE_HILOG" ] + } +} + +ohos_unittest("shared_memory_ut") { + module_out_path = module_output_path + sources = [ + "unittest/shared_memory_allocator_test.cpp", + "unittest/shared_memory_block_test.cpp", + ] + include_dirs = [ + "${OHOS_PROFILER_DIR}/device/services/ipc/include", + "//third_party/googletest/googletest/include/gtest", + ] + configs = [ ":module_private_config" ] + deps = [ + "../:shared_memory", + "${OHOS_PROFILER_DIR}/device/services/ipc:ipc", + "${OHOS_PROFILER_DIR}/protos/services:plugin_services_proto", + "${OHOS_PROFILER_DIR}/protos/services:service_types_proto", + "//third_party/googletest:gtest", + ] + cflags = [ + "-Wno-inconsistent-missing-override", + "-Dprivate=public", #allow test code access private members + "-Dprotected=public", #allow test code access private members + ] + external_deps = [ + "hiviewdfx_hilog_native:libhilog", + ] + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" +} + +group("unittest") { + testonly = true + deps = [ + ":shared_memory_ut", + ] +} diff --git a/device/services/shared_memory/test/unittest/shared_memory_allocator_test.cpp b/device/services/shared_memory/test/unittest/shared_memory_allocator_test.cpp new file mode 100644 index 000000000..6beb1371f --- /dev/null +++ b/device/services/shared_memory/test/unittest/shared_memory_allocator_test.cpp @@ -0,0 +1,284 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include + +#include "client_map.h" +#include "plugin_service.ipc.h" +#include "service_entry.h" +#include "share_memory_allocator.h" +#include "socket_context.h" +#include "unix_socket_client.h" +#include "unix_socket_server.h" + +using namespace testing::ext; + +namespace { +class PluginServiceTest final : public IPluginServiceServer { +public: + int fileDescriptor_; + bool GetCommand(SocketContext& context, ::GetCommandRequest& request, ::GetCommandResponse& response) override + { + SendResponseGetCommandResponse(context, response); + context.SendFileDescriptor(fileDescriptor_); + return false; + } +}; + +class PluginClientTest final : public IPluginServiceClient { +public: + int fileDescriptor_; + bool OnGetCommandResponse(SocketContext& context, ::GetCommandResponse& response) override + { + fileDescriptor_ = context.ReceiveFileDiscriptor(); + return true; + } +}; + +class SharedMemoryAllocatorTest : public testing::Test { +public: + static void SetUpTestCase() {} + static void TearDownTestCase() {} + + void SetUp() {} + void TearDown() {} +}; + +/** + * @tc.name: Service + * @tc.desc: Creates a memory block of the specified size. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryAllocatorTest, CreateMemoryBlockLocal, TestSize.Level1) +{ + pid_t pid1 = fork(); + ASSERT_TRUE(pid1 >= 0); + if (pid1 > 0) { + waitpid(pid1, nullptr, 0); + return; + } + + ASSERT_TRUE(ShareMemoryAllocator::GetInstance().CreateMemoryBlockLocal("testname", 1) == + nullptr); // 创建内存块大小<1024,返回空 + ASSERT_TRUE(ShareMemoryAllocator::GetInstance().CreateMemoryBlockLocal("testname", 1024) != nullptr); // 成功创建 + ASSERT_TRUE(ShareMemoryAllocator::GetInstance().CreateMemoryBlockLocal("testname", 1024) == + nullptr); // 创建同名内存块返回空 + exit(0); +} + +/** + * @tc.name: Service + * @tc.desc: Find memory block by name. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryAllocatorTest, FindMBByName, TestSize.Level1) +{ + pid_t pid1 = fork(); + ASSERT_TRUE(pid1 >= 0); + if (pid1 > 0) { + waitpid(pid1, nullptr, 0); + return; + } + + ASSERT_TRUE(ShareMemoryAllocator::GetInstance().FindMBByName("err") == nullptr); // 查找不存在的内存块返回空 + + exit(0); +} + +/** + * @tc.name: Service + * @tc.desc: Create a memory block with a nonexistent file descriptor. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryAllocatorTest, CreateMemoryBlockRemote, TestSize.Level1) +{ + pid_t pid1 = fork(); + ASSERT_TRUE(pid1 >= 0); + if (pid1 > 0) { + waitpid(pid1, nullptr, 0); + return; + } + + ASSERT_TRUE(ShareMemoryAllocator::GetInstance().CreateMemoryBlockRemote("err", 1024, 99) == + nullptr); // 使用不存在的文件描述符映射内存块返回空 + exit(0); +} + +/** + * @tc.name: Service + * @tc.desc: Gets the size of the memory block with the specified name. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryAllocatorTest, GetDataSize, TestSize.Level1) +{ + pid_t pid1 = fork(); + ASSERT_TRUE(pid1 >= 0); + if (pid1 > 0) { + waitpid(pid1, nullptr, 0); + return; + } + + ASSERT_TRUE(ShareMemoryAllocator::GetInstance().CreateMemoryBlockLocal("testname", 1024) != nullptr); // 成功创建 + ASSERT_TRUE(ShareMemoryAllocator::GetInstance().FindMBByName("testname")->GetDataSize() == 0); + + exit(0); +} + +/** + * @tc.name: Service + * @tc.desc: Free a nonexistent memory block. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryAllocatorTest, ReleaseMemoryBlockLocal, TestSize.Level1) +{ + pid_t pid1 = fork(); + ASSERT_TRUE(pid1 >= 0); + if (pid1 > 0) { + waitpid(pid1, nullptr, 0); + return; + } + + ASSERT_FALSE(ShareMemoryAllocator::GetInstance().ReleaseMemoryBlockLocal("or")); // 释放不存在的内存块返回-1 + exit(0); +} + +/** + * @tc.name: Service + * @tc.desc: Free a nonexistent remote memory block. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryAllocatorTest, ReleaseMemoryBlockRemote, TestSize.Level1) +{ + pid_t pid1 = fork(); + ASSERT_TRUE(pid1 >= 0); + if (pid1 > 0) { + waitpid(pid1, nullptr, 0); + return; + } + + ASSERT_FALSE(ShareMemoryAllocator::GetInstance().ReleaseMemoryBlockRemote("or")); // 释放不存在的内存块返回-1 + exit(0); +} + +/** + * @tc.name: Service + * @tc.desc: Get command. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryAllocatorTest, GetCommand, TestSize.Level1) +{ + SocketContext socketContext; + GetCommandRequest request; + GetCommandResponse commandResponse; + PluginServiceTest pluginServiceTest; + ASSERT_FALSE(pluginServiceTest.GetCommand(socketContext, request, commandResponse)); +} + +/** + * @tc.name: Service + * @tc.desc: Socket send/recv interface. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryAllocatorTest, ProtocolProc, TestSize.Level1) +{ + ServiceBase serviceBase; + SocketContext socketContext; + ASSERT_FALSE(serviceBase.ProtocolProc(socketContext, 0, nullptr, 0)); +} + +/** + * @tc.name: Service + * @tc.desc: Abnormal socket detection. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryAllocatorTest, RawProtocolProc, TestSize.Level1) +{ + ServiceEntry serviceEntry; + ClientConnection* clientConnection = new ClientConnection(0, serviceEntry); + ASSERT_EQ(clientConnection->RawProtocolProc(-1, nullptr, 0), -1); + + SocketContext socketContext; + ASSERT_EQ(socketContext.RawProtocolProc(-1, nullptr, -1), -1); + ASSERT_TRUE(!socketContext.SendRaw(-1, nullptr, 0, 0)); +} + +/** + * @tc.name: Service + * @tc.desc: Client link. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryAllocatorTest, ClientSocket, TestSize.Level1) +{ + ServiceEntry serviceEntry; + ClientMap::GetInstance(); + ClientMap::GetInstance().PutClientSocket(0, serviceEntry); + ASSERT_EQ(ClientMap::GetInstance().AutoRelease(), 1); +} + +/** + * @tc.name: Service + * @tc.desc: Abnormal client link. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryAllocatorTest, unixSocketClient, TestSize.Level1) +{ + UnixSocketClient unixSocketClient; + ServiceBase serviceBase; + ASSERT_TRUE(!unixSocketClient.Connect("asdf", serviceBase)); +} + +/** + * @tc.name: Service + * @tc.desc: Start unixSocket Server. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryAllocatorTest, UnixSocketServer, TestSize.Level1) +{ + UnixSocketServer unixSocketServer; + + unixSocketServer.UnixSocketAccept(nullptr); + + ServiceEntry serviceEntry; + ASSERT_TRUE(unixSocketServer.StartServer("", serviceEntry)); +} + +/** + * @tc.name: Service + * @tc.desc: Server process monitoring. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryAllocatorTest, ServiceEntry, TestSize.Level1) +{ + ServiceEntry serviceEntry; + IPluginServiceServer pluginService; + serviceEntry.StartServer("test_unix_socket_service_entry"); + serviceEntry.RegisterService(pluginService); + serviceEntry.FindServiceByName(pluginService.serviceName_); + + usleep(30000); + + GetTimeMS(); + GetTimeUS(); + GetTimeNS(); + + IPluginServiceClient pluginClient; + ASSERT_FALSE(pluginClient.Connect("")); + usleep(30000); +} +} // namespace diff --git a/device/services/shared_memory/test/unittest/shared_memory_block_test.cpp b/device/services/shared_memory/test/unittest/shared_memory_block_test.cpp new file mode 100755 index 000000000..f87327e90 --- /dev/null +++ b/device/services/shared_memory/test/unittest/shared_memory_block_test.cpp @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "plugin_service_types.pb.h" +#include "share_memory_block.h" + +using namespace testing::ext; + +namespace { +constexpr size_t ARRAYSIZE = 100; + +class SharedMemoryBlockTest : public testing::Test { +public: + static void SetUpTestCase() {} + static void TearDownTestCase() {} + + void SetUp() {} + void TearDown() {} +}; + +/** + * @tc.name: share memory + * @tc.desc: read lock. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryBlockTest, ReadLock, TestSize.Level1) +{ + ShareMemoryBlock shareMemoryBlock; + ASSERT_TRUE(shareMemoryBlock.CreateBlock("testname", 1024)); + + ASSERT_TRUE(shareMemoryBlock.ReleaseBlock()); +} + +/** + * @tc.name: share memory + * @tc.desc: get name. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryBlockTest, GetName, TestSize.Level1) +{ + ShareMemoryBlock shareMemoryBlock; + ASSERT_TRUE(shareMemoryBlock.CreateBlock("testname", 1024)); + + shareMemoryBlock.GetName(); + + ASSERT_TRUE(shareMemoryBlock.ReleaseBlock()); +} + +/** + * @tc.name: share memory + * @tc.desc: get size. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryBlockTest, GetSize, TestSize.Level1) +{ + ShareMemoryBlock shareMemoryBlock; + ASSERT_TRUE(shareMemoryBlock.CreateBlock("testname", 1024)); + + shareMemoryBlock.GetSize(); + + ASSERT_TRUE(shareMemoryBlock.ReleaseBlock()); +} + +/** + * @tc.name: share memory + * @tc.desc: get file descriptor. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryBlockTest, GetfileDescriptor, TestSize.Level1) +{ + ShareMemoryBlock shareMemoryBlock; + ASSERT_TRUE(shareMemoryBlock.CreateBlock("testname", 1024)); + + shareMemoryBlock.GetfileDescriptor(); + + ASSERT_TRUE(shareMemoryBlock.ReleaseBlock()); +} + +/** + * @tc.name: share memory + * @tc.desc: Shared memory type test. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryBlockTest, DROP_NONE, TestSize.Level1) +{ + ShareMemoryBlock shareMemoryBlock; + ASSERT_TRUE(shareMemoryBlock.CreateBlock("testname", 1024)); + + shareMemoryBlock.SetDropType(ShareMemoryBlock::DropType::DROP_NONE); + + int8_t data[ARRAYSIZE]; + for (int i = 0; i < 20; i++) { + *((uint32_t*)data) = i; + shareMemoryBlock.PutRaw(data, ARRAYSIZE); + } + int8_t* p = shareMemoryBlock.GetFreeMemory(ARRAYSIZE); + ASSERT_TRUE(p == nullptr); + + do { + p = const_cast(shareMemoryBlock.GetDataPoint()); + } while (shareMemoryBlock.Next() && shareMemoryBlock.GetDataSize() > 0); + + ASSERT_TRUE(shareMemoryBlock.ReleaseBlock()); +} + +/** + * @tc.name: share memory + * @tc.desc: Shared memory type test. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryBlockTest, DROP_OLD, TestSize.Level1) +{ + ShareMemoryBlock shareMemoryBlock; + ASSERT_TRUE(shareMemoryBlock.CreateBlock("testname", 1024)); + + shareMemoryBlock.SetDropType(ShareMemoryBlock::DropType::DROP_OLD); + + int8_t data[ARRAYSIZE]; + for (int i = 0; i < 20; i++) { + *((uint32_t*)data) = i; + shareMemoryBlock.PutRaw(data, ARRAYSIZE); + } + int8_t* p = shareMemoryBlock.GetFreeMemory(ARRAYSIZE); + ASSERT_TRUE(p != nullptr); + + do { + p = const_cast(shareMemoryBlock.GetDataPoint()); + } while (shareMemoryBlock.Next() && shareMemoryBlock.GetDataSize() > 0); + + ASSERT_TRUE(shareMemoryBlock.ReleaseBlock()); +} + +/** + * @tc.name: share memory + * @tc.desc: put protobuf. + * @tc.type: FUNC + */ +HWTEST_F(SharedMemoryBlockTest, PutProtobuf, TestSize.Level1) +{ + ShareMemoryBlock shareMemoryBlock; + ASSERT_TRUE(shareMemoryBlock.CreateBlock("testname", 1024)); + + NotifyResultResponse response; + response.set_status(123); + ASSERT_TRUE(shareMemoryBlock.PutProtobuf(response)); + ASSERT_TRUE(shareMemoryBlock.GetDataSize() > 0); + response.ParseFromArray(shareMemoryBlock.GetDataPoint(), shareMemoryBlock.GetDataSize()); + ASSERT_TRUE(response.status() == 123); + + ASSERT_TRUE(shareMemoryBlock.ReleaseBlock()); +} +} // namespace diff --git a/figures/zh-cn_image_0000001162598155.png b/figures/zh-cn_image_0000001162598155.png new file mode 100755 index 000000000..8e960babb Binary files /dev/null and b/figures/zh-cn_image_0000001162598155.png differ diff --git a/host/ohosprofiler/LICENSE b/host/ohosprofiler/LICENSE new file mode 100644 index 000000000..e454a5258 --- /dev/null +++ b/host/ohosprofiler/LICENSE @@ -0,0 +1,178 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + diff --git a/host/ohosprofiler/README.md b/host/ohosprofiler/README.md new file mode 100644 index 000000000..c0d94acc3 --- /dev/null +++ b/host/ohosprofiler/README.md @@ -0,0 +1,66 @@ +# Host Subsystem + +## Brief Introduction + +The tool chain consistency platform is divided into two parts: Host subsystem and equipment terminal system. +The final component of host subsystem is ide tool software,It is divided into UI drawing, device management, +process management, plug-in management, data import, data storage, data analysis, session management, configuration management and other modules. + + +## 目录 + +``` +ohos.devtools/ +├── views #GUI module +│   ├── layout #Layout module +│   ├── charts #Chart module +│   ├── common #Common module +│   └── resource #Resource module +├── services #Services module +│   ├── memory #Memory module +│   ├── diskio #diskio module +│   ├── network #network module +│   ├── ftrace #ftrace module +│   ├── bytrace #bytrace module +│   ├── hiperf #hiperf module +│   └── power #power module +├── database #database module +│   ├── transport #transport module +│   └── utils #utils module +├── +``` + +## USE + +1.To prepare development tools, you can use IntelliJ idea Community Edition or IntelliJ idea Ultimate Edition + +2.Using the development tool to import a project, if you are using it for the first time, you need to load ideaic. +In fact, this file is IntelliJ idea community version, when debugging plug-ins, idea will synchronously start a +community version of idea with plug-ins installed, which is relatively large and time-consuming + +3.Local packaging: after entering the main interface, select gradle in the right column and click build plug under IntelliJ. +If the execution is successful, the build file will be created in the root directory of the project by default, +and the packaged plug-ins will be in the directory of build / distributions.The plug-in without dependency is jar package, +and the plug-in with dependency is ZIP format. Either one can be installed directly in idea plug. +Open file ➡ Settings ➡ Plugins, select the gear button, and select Install plug from disk + +For issues related to idea platform, see +https://plugins.jetbrains.com/docs/intellij/welcome.html?from=jetbrains.org + + +## License + +``` +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +``` diff --git a/host/ohosprofiler/README_zh.md b/host/ohosprofiler/README_zh.md new file mode 100644 index 000000000..6eb87fe9e --- /dev/null +++ b/host/ohosprofiler/README_zh.md @@ -0,0 +1,64 @@ +# HOST子系统 + +## 简介 + +工具链一致性平台整体分为HOST子系统和设备端子系统两部分。HOST子系统最终组件为IDE工具软件, +内部又分为UI绘制、设备管理、进程管理、插件管理、数据导入、数据存储、 数据分析、Session管理、配置管理等模块。 + + + +## 目录 + +``` +ohos.devtools/ +├── views #GUI视图管理模块 +│   ├── layout #UI布局框架 +│   ├── charts #Chart绘制模块 +│   ├── common #UI公共模块 +│   └── resource #UI资源模块 +├── services #业务管理模块 +│   ├── memory #Memory业务模块 +│   ├── diskio #diskio业务模块 +│   ├── network #network业务模块 +│   ├── ftrace #ftrace业务模块 +│   ├── bytrace #bytrace业务模块 +│   ├── hiperf #hiperf业务模块 +│   └── power #power业务模块 +├── database #数据管理模块 +│   ├── transport #数据通信模块 +│   └── utils #工具类模块 +├── +``` + +## 使用 + +1.准备开发工具,可以使用【IntelliJ IDEA社区版】或者【IntelliJ IDEA旗舰版】 + +2.使用开发工具导入项目,如果你是第一次使用是需要加载ideaIC的,这个文件其实就是 +IntelliJ Idea社区版,在插件调试时Idea会同步启动一个安装了插件的社区版Idea,由于比较大,会比较耗时 + +3.本地打包:进入主界面后,选择右边栏Gradle,在intellij下点击buildPlugin。 +执行成功默认会在项目根目录创建build文件,打包后的插件就在\build\distributions目录下。 +无依赖的插件是JAR包,带有依赖的插件是ZIP格式。无论哪种都可以直接在IDEA Plugin中安装。 +打开File➡Settings➡Plugins,选择齿轮按钮,选择Install Plugin from Disk(从本地磁盘中安装) + +IDEA Platform相关问题请参见: +https://plugins.jetbrains.com/docs/intellij/welcome.html?from=jetbrains.org + + +## 版权声明 + +``` +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +``` diff --git a/host/ohosprofiler/build.gradle b/host/ohosprofiler/build.gradle new file mode 100644 index 000000000..9369a7602 --- /dev/null +++ b/host/ohosprofiler/build.gradle @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.jetbrains.intellij.tasks.PrepareSandboxTask + + +plugins { + id 'java' + id 'org.jetbrains.intellij' version '0.7.2' + id 'com.google.protobuf' version '0.8.15' +} + +group 'ohos.devtools' +version '1.06.210428_Ia06bb6beaf4128368ddb697bde7dd59de608ae9a' + +project.sourceCompatibility=1.11 +project.targetCompatibility=1.11 + +repositories { + mavenCentral() +} + +dependencies { + compile "org.xerial:sqlite-jdbc:3.34.0" + implementation 'io.grpc:grpc-netty-shaded:1.36.0' + implementation 'io.grpc:grpc-protobuf:1.36.0' + implementation 'io.grpc:grpc-stub:1.36.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.11' + implementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.7.2' + implementation group: 'com.alibaba', name: 'fastjson', version: '1.2.75' + implementation group: 'com.alibaba', name: 'druid', version: '1.1.6' + implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.14.0' + implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.14.0' + implementation group: 'org.easytesting', name: 'fest-swing', version: '1.2' + testImplementation group: 'io.grpc', name: 'grpc-testing', version: '1.36.0' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' + testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version: '2.0.9' + testImplementation group: 'org.powermock', name: 'powermock-api-mockito2', version: '2.0.9' +} + +// See https://github.com/JetBrains/gradle-intellij-plugin/ +intellij { + version '2020.3.2' + pluginName 'ohosprofiler' +} + +patchPluginXml { + changeNotes """ + Add change notes here.
+ most HTML tags may be used""" +} +test { + useJUnitPlatform() +} +tasks.withType(JavaCompile) { + options.encoding = "UTF-8" +} + + +tasks.withType(PrepareSandboxTask) { + from("src/main/resources/ohos") { + into("ohosprofiler/ohos") + include("**") + } +} + +protobuf { + protoc { + artifact = "com.google.protobuf:protoc:3.12.0" + } + plugins { + grpc { + artifact = 'io.grpc:protoc-gen-grpc-java:1.36.0' + } + } + generateProtoTasks { + all()*.plugins { + grpc {} + } + } +} + +buildSearchableOptions { + enabled = false +} + +patchPluginXml { + changeNotes """ + Add change notes here.
+ most HTML tags may be used""" + version = project.version + sinceBuild = '202' + untilBuild = '203.*' +} \ No newline at end of file diff --git a/host/ohosprofiler/gradlew b/host/ohosprofiler/gradlew new file mode 100644 index 000000000..c72947139 --- /dev/null +++ b/host/ohosprofiler/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright (c) 2021 Huawei Device Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/host/ohosprofiler/gradlew.bat b/host/ohosprofiler/gradlew.bat new file mode 100644 index 000000000..93118596d --- /dev/null +++ b/host/ohosprofiler/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright (c) 2021 Huawei Device Co., Ltd. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/host/ohosprofiler/settings.gradle b/host/ohosprofiler/settings.gradle new file mode 100644 index 000000000..0fdaf31d2 --- /dev/null +++ b/host/ohosprofiler/settings.gradle @@ -0,0 +1,2 @@ +rootProject.name = 'ohosprofilerplugin' + diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/ProfilerApplication.java b/host/ohosprofiler/src/main/java/ohos/devtools/ProfilerApplication.java new file mode 100644 index 000000000..063e7ba14 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/ProfilerApplication.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.device.service.MultiDeviceManager; +import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; +import ohos.devtools.datasources.utils.quartzmanager.QuartzManager; +import ohos.devtools.views.layout.swing.LayoutView; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * @Description IDE Application startup class + * @Date 2021/2/9 14:35 + **/ +public class ProfilerApplication { + private ProfilerApplication() { + } + + private static final Logger LOGGER = LogManager.getLogger(ProfilerApplication.class); + + /** + * main + * + * @param args args + */ + public static void main(String[] args) { + // print ohos Profiler Start the system used + LOGGER.error("ohos Profiler Start OS is {}", System.getProperty("os.name")); + // Application initialization Step1 Initialize the data center + ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + LOGGER.info("start init {}", "init"); + DataBaseApi apo = DataBaseApi.getInstance(); + LOGGER.info("end init {}", "init"); + apo.initDataSourceManager(); + // Start the device discovery service + QuartzManager instance = QuartzManager.getInstance(); + String name = MultiDeviceManager.class.getName(); + MultiDeviceManager manager = MultiDeviceManager.getInstance(); + instance.addExecutor(name, manager); + instance.startExecutor(name, QuartzManager.DELAY, QuartzManager.PERIOD); + // Launch the main page + LayoutView.init(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/ProfilerToolWindowFactory.java b/host/ohosprofiler/src/main/java/ohos/devtools/ProfilerToolWindowFactory.java new file mode 100644 index 000000000..c76b980c8 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/ProfilerToolWindowFactory.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools; + +import com.intellij.openapi.project.Project; +import com.intellij.openapi.wm.ToolWindow; +import com.intellij.openapi.wm.ToolWindowFactory; +import com.intellij.ui.content.ContentFactory; +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.device.service.MultiDeviceManager; +import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; +import ohos.devtools.datasources.utils.quartzmanager.QuartzManager; +import ohos.devtools.views.layout.swing.HomeWindow; +import ohos.devtools.views.layout.swing.LayoutView; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; + +/** + * Profiler Tool Window Factory + * + * @version 1.0 + * @Date 2021/3/31 14:38 + **/ +public class ProfilerToolWindowFactory implements ToolWindowFactory { + private static final Logger LOGGER = LogManager.getLogger(ProfilerToolWindowFactory.class); + + /** + * createToolWindowContent + * + * @param project project + * @param toolWindow toolWindow + */ + @Override + public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) { + LOGGER.error("ohos Profiler Start OS is {}", System.getProperty("os.name")); + ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + QuartzManager instance = QuartzManager.getInstance(); + String name = MultiDeviceManager.class.getName(); + MultiDeviceManager manager = MultiDeviceManager.getInstance(); + instance.addExecutor(name, manager); + instance.startExecutor(name, QuartzManager.DELAY, QuartzManager.PERIOD); + HomeWindow homeWindow = LayoutView.init(); + toolWindow.getContentManager() + .addContent(ContentFactory.SERVICE.getInstance().createContent(homeWindow, "", false)); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databaseapi/DataBaseApi.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databaseapi/DataBaseApi.java new file mode 100644 index 000000000..48e073c51 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databaseapi/DataBaseApi.java @@ -0,0 +1,402 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.databaseapi; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import ohos.devtools.datasources.databases.databasemanager.DataBaseManager; +import ohos.devtools.datasources.databases.databasepool.DataBase; +import ohos.devtools.datasources.databases.databasepool.DataBaseHelper; +import ohos.devtools.datasources.utils.common.util.CloseResourceUtil; +import ohos.devtools.datasources.utils.common.util.CommonUtil; + +import static ohos.devtools.datasources.databases.databasepool.DataBaseHelper.getUrlByDataBaseName; + +/** + * @Description Provides database related operations + * @Date 2021/1/25 13:15 + **/ +public class DataBaseApi { + private static final Logger LOGGER = LogManager.getLogger(DataBaseApi.class); + + /** + * System main library name + */ + public static final String DEFAULT_DATABASE_DBNAME = "defaultDB"; + + /** + * Correspondence between storage database name and database connection pool + */ + private static Map dataSourcePooleMap = new ConcurrentHashMap(CommonUtil.collectionSize(0)); + + /** + * Correspondence between storage database name and database connection pool + */ + private static List tableIndex = new ArrayList<>(CommonUtil.collectionSize(0)); + + /** + * Correspondence between storage table name and database name + */ + private static Map groupTables = new ConcurrentHashMap(CommonUtil.collectionSize(0)); + + private static class SingletonClassInstance { + private static final DataBaseApi INSTANCE = new DataBaseApi(); + } + + /** + * getInstance + * + * @return DataBaseApi + */ + public static DataBaseApi getInstance() { + return DataBaseApi.SingletonClassInstance.INSTANCE; + } + + private DataBaseApi() { + } + + /** + * Initialize the data source manager, which is called when the system is started, and only called once. + * + * @return boolean + */ + public boolean initDataSourceManager() { + return createDataBase(null, true); + } + + /** + * Create a database. If it is a system main library, create a data table in the main library. + * + * @param dbName data storage name + * @param appStart Whether the application just started + * @return boolean + */ + private boolean createDataBase(String dbName, boolean appStart) { + if (appStart) { + if (StringUtils.isBlank(dbName) || DEFAULT_DATABASE_DBNAME.equals(dbName)) { + DataBaseManager dataBaseManager = DataBaseManager.getInstance(); + DataBase dataBase = DataBaseHelper.createDefaultDataBase(); + dataBase.setUrl(getUrlByDataBaseName(DEFAULT_DATABASE_DBNAME)); + boolean result = dataBaseManager.initDefaultDataBase(dataBase); + if (result) { + return dataBaseManager.initDefaultSql(dataBase); + } + } else { + if (StringUtils.isBlank(dbName) || appStart) { + return false; + } + if (dataSourcePooleMap.get(dbName) != null) { + return true; + } + return DataBaseManager.getInstance().createDataBase(dbName); + } + } else { + if (StringUtils.isBlank(dbName)) { + return false; + } + if (dataSourcePooleMap.get(dbName) != null) { + return true; + } + return DataBaseManager.getInstance().createDataBase(dbName); + } + return false; + } + + /** + * Get the database connection of the main library of the system + * + * @return Optional + */ + public Optional getDefaultDataBaseConnect() { + try { + return Optional.of(getPoolByDataBaseName(DEFAULT_DATABASE_DBNAME).getConnection()); + } catch (SQLException sqlException) { + LOGGER.info("getConnectByTable Exception {}", sqlException.getMessage()); + return Optional.empty(); + } + } + + /** + * Get database connection based on table name + * + * @param tableName tableName + * @return Optional + */ + public Optional getConnectByTable(String tableName) { + if (StringUtils.isBlank(tableName)) { + return Optional.empty(); + } + String dbName = groupTables.get(tableName.toUpperCase(Locale.ENGLISH)); + if (StringUtils.isNotBlank(dbName)) { + try { + Connection conn = getPoolByDataBaseName(dbName).getConnection(); + return Optional.of(conn); + } catch (SQLException throwAbles) { + LOGGER.info("getConnectByTable Exception {}", throwAbles.getMessage()); + } + } + return Optional.empty(); + } + + /** + * Get database connection based on database name + * + * @param dataBaseName dataBaseName + * @return Optional + */ + public Optional getConnectBydbname(String dataBaseName) { + Connection connection; + try { + connection = getPoolByDataBaseName(dataBaseName).getConnection(); + return Optional.of(connection); + } catch (SQLException throwAbles) { + LOGGER.info("getConnectByTable Exception {}", throwAbles.getMessage()); + } + return Optional.empty(); + } + + /** + * Get the database connection pool object according to the database name + * + * @param dataBaseName dataBaseName + * @return DataSource + */ + public DataSource getPoolByDataBaseName(String dataBaseName) { + DataSource dataSource; + if (StringUtils.isBlank(dataBaseName)) { + dataSource = dataSourcePooleMap.get(DEFAULT_DATABASE_DBNAME); + if (dataSource == null) { + DataBase dataBase = DataBaseHelper.createDataBase(); + dataBase.setUrl(getUrlByDataBaseName(dataBaseName)); + DataSource dataPool = DataBaseManager.getInstance().createDruidConnectionPool(dataBase); + registerDataSource(DEFAULT_DATABASE_DBNAME, dataPool); + return dataSourcePooleMap.get(DEFAULT_DATABASE_DBNAME); + } + return dataSourcePooleMap.get(DEFAULT_DATABASE_DBNAME); + } else { + dataSource = dataSourcePooleMap.get(dataBaseName); + if (dataSource == null) { + DataBase dataBase = DataBaseHelper.createDataBase(); + dataBase.setUrl(getUrlByDataBaseName(dataBaseName)); + DataSource dataPool = DataBaseManager.getInstance().createDruidConnectionPool(dataBase); + registerDataSource(dataBaseName, dataPool); + return dataSourcePooleMap.get(dataBaseName); + } + return dataSourcePooleMap.get(dataBaseName); + } + } + + /** + * Correspondence between registered data table and database + * + * @param tableName tableName + * @param dbName dbName + */ + public void registerTable(String tableName, String dbName) { + if (StringUtils.isNotBlank(tableName) && StringUtils.isNotBlank(dbName)) { + groupTables.put(tableName.toUpperCase(Locale.ENGLISH), dbName); + } + } + + /** + * Correspondence between registered data table and database + * + * @param tableName tableName + * @return String + */ + public String checkTableRegister(String tableName) { + if (StringUtils.isNotBlank(tableName)) { + return groupTables.get(tableName.toUpperCase(Locale.ENGLISH)); + } + return ""; + } + + /** + * Correspondence between registered data table and database + * + * @param tableName tableName + * @return String + */ + public boolean checkIndexRegister(String tableName) { + if (StringUtils.isNotBlank(tableName)) { + return tableIndex.contains(tableName); + } + return false; + } + + /** + * Correspondence between registered database name and database connection pool + * + * @param dataBaseName dataBaseName + * @param dataSource dataSource + */ + public void registerDataSource(String dataBaseName, DataSource dataSource) { + if (StringUtils.isNotBlank(dataBaseName) && dataSource != null) { + dataSourcePooleMap.put(dataBaseName, dataSource); + } + } + + /** + * Index of the registry. + * + * @param tableName tableName + */ + public void registerCreateIndex(String tableName) { + if (StringUtils.isNotBlank(tableName)) { + tableIndex.add(tableName); + } + } + + /** + * Create a database, which is used to dynamically create a database during system operation + * + * @param dbName dbName + * @return boolean + */ + public boolean createDataBase(String dbName) { + return createDataBase(dbName, false); + } + + /** + * Create table + * + * @param dbName dbName + * @param tableName tableName + * @param params params + * @return boolean + */ + public boolean createTable(String dbName, String tableName, List params) { + if (StringUtils.isBlank(tableName) || StringUtils.isBlank(dbName)) { + return false; + } + if (params == null && params.isEmpty()) { + return false; + } + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(String.format(Locale.ENGLISH, "CREATE TABLE if not exists %s", tableName)); + Optional optionalConnection = getConnectBydbname(dbName); + if (optionalConnection.isPresent()) { + Connection conn = optionalConnection.get(); + String value = params.stream().collect(Collectors.joining(",")); + Statement statement = null; + try { + String db = DataBaseApi.getInstance().checkTableRegister(tableName); + if (tableName.equals(db)) { + return true; + } + statement = conn.createStatement(); + statement.execute(String.format(Locale.ENGLISH, "%s ( %s )", stringBuffer, value)); + registerTable(tableName, dbName); + return true; + } catch (SQLException throwAbles) { + LOGGER.info("SQLException Error {}: ", throwAbles.getMessage()); + return false; + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, null, statement); + } + } + return false; + } + + /** + * createTable + * + * @param dbName dbName + * @param tableName tableName + * @param sql sql + * @return boolean + */ + public boolean createTable(String dbName, String tableName, String sql) { + if (StringUtils.isBlank(tableName) || StringUtils.isBlank(dbName) || StringUtils.isBlank(sql)) { + return false; + } + Optional connect = getConnectBydbname(dbName); + if (connect.isPresent()) { + Connection conn = connect.get(); + Statement statm = null; + try { + String db = DataBaseApi.getInstance().checkTableRegister(tableName); + if (dbName.equals(db)) { + return true; + } + statm = conn.createStatement(); + statm.execute(sql); + registerTable(tableName, dbName); + return true; + } catch (SQLException throwAbles) { + LOGGER.info("create Table Error {}", throwAbles.getMessage()); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, null, statm); + } + } + return false; + } + + /** + * Create table index + * + * @param tableName tableName + * @param indexName indexName + * @param columnName columnName + * @return boolean + */ + public boolean createIndex(String tableName, String indexName, List columnName) { + if (StringUtils.isBlank(tableName) || StringUtils.isBlank(indexName)) { + return false; + } + if (columnName == null || columnName.isEmpty()) { + return false; + } + if (checkIndexRegister(tableName)) { + return true; + } + StringBuffer stringBuffer = new StringBuffer("CREATE INDEX IF NOT EXISTS ").append(indexName).append(" ON "); + stringBuffer.append(tableName).append("("); + String value = columnName.stream().collect(Collectors.joining(",")); + stringBuffer.append(value).append(")"); + Optional optionalConnection = getConnectByTable(tableName); + if (optionalConnection.isPresent()) { + Connection conn = optionalConnection.get(); + Statement statement = null; + try { + statement = conn.createStatement(); + statement.execute(stringBuffer.toString()); + registerCreateIndex(tableName); + return true; + } catch (SQLException throwAbles) { + LOGGER.info("SQLException Error {}: ", throwAbles.getMessage()); + return false; + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, null, statement); + } + } + return false; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasemanager/DataBaseManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasemanager/DataBaseManager.java new file mode 100644 index 000000000..145542899 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasemanager/DataBaseManager.java @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.databasemanager; + +import com.alibaba.druid.pool.DruidDataSource; +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.databases.databasepool.DataBase; +import ohos.devtools.datasources.databases.databasepool.DataBaseHelper; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.sql.DataSource; +import java.io.File; +import java.io.IOException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.HashSet; +import java.util.List; +import java.util.Properties; +import java.util.Set; + +import static ohos.devtools.datasources.databases.databaseapi.DataBaseApi.DEFAULT_DATABASE_DBNAME; +import static ohos.devtools.datasources.databases.databasepool.DataBaseHelper.getFilePath; +import static ohos.devtools.datasources.databases.databasepool.DataBaseHelper.getUrlByDataBaseName; +import static ohos.devtools.datasources.databases.databasepool.DataBaseHelper.loadSqlFileToList; +import static ohos.devtools.datasources.databases.databasepool.DataTableHelper.getTableNameBySql; + +/** + * @Description Database creation class + * @Date 2021/2/2 11:28 + **/ +public class DataBaseManager { + private static final Logger LOGGER = LogManager.getLogger(DataBaseManager.class); + + private static Set dbLists = new HashSet<>(); + + private static class SingletonClassInstance { + private static final DataBaseManager INSTANCE = new DataBaseManager(); + } + + /** + * getInstance + * + * @return DataBaseApi + */ + public static DataBaseManager getInstance() { + return DataBaseManager.SingletonClassInstance.INSTANCE; + } + + private DataBaseManager() { + } + + /** + * Initialize the main database of the project + * + * @param dataBase DataBase + * @return boolean + */ + public boolean initDefaultDataBase(DataBase dataBase) { + return createDataBase(dataBase); + } + + /** + * Create a data table in the main database of the database, + * and the table creation statement is stored in the path configured by default Sql + * + * @param dataBase DataBase + * @return boolean + */ + public boolean initDefaultSql(DataBase dataBase) { + Properties properties = new Properties(); + Statement statement = null; + Connection connection = null; + try { + properties.load(DataBaseManager.class.getClassLoader().getResourceAsStream("db.properties")); + String initPath = properties.getProperty("defaultSql"); + if (StringUtils.isNotBlank(initPath)) { + String sqlConfigPath = SessionManager.getInstance().getPluginPath() + initPath; + List sqlList = loadSqlFileToList(sqlConfigPath); + DataSource dataSource = createDruidConnectionPool(dataBase); + DataBaseApi.getInstance().registerDataSource(DEFAULT_DATABASE_DBNAME, dataSource); + connection = dataSource.getConnection(); + statement = connection.createStatement(); + for (String sql : sqlList) { + String tableName = getTableNameBySql(sql); + String dbName = DataBaseApi.getInstance().checkTableRegister(tableName); + if (DEFAULT_DATABASE_DBNAME.equals(dbName)) { + continue; + } + statement.execute(sql); + DataBaseApi.getInstance().registerTable(tableName, DEFAULT_DATABASE_DBNAME); + } + return true; + } + } catch (IOException | SQLException exception) { + LOGGER.error("create Table Exception {}", exception.getMessage()); + return false; + } finally { + if (statement != null) { + try { + statement.close(); + } catch (SQLException exception) { + LOGGER.error(exception.getMessage()); + } + } + if (connection != null) { + try { + connection.close(); + } catch (SQLException exception) { + LOGGER.error(exception.getMessage()); + } + } + } + return false; + } + + /** + * Create database + * + * @param dbName dbName + * @return boolean + */ + public boolean createDataBase(String dbName) { + DataBase dataBase = DataBaseHelper.createDataBase(); + dataBase.setUrl(getUrlByDataBaseName(dbName)); + return createDataBase(dataBase); + } + + /** + * Create database + * + * @param dataBase dataBase + * @return boolean + */ + private boolean createDataBase(DataBase dataBase) { + if (dataBase.getUrl() == null || StringUtils.isBlank(dataBase.getUrl())) { + return false; + } + String dbPath = getFilePath(dataBase.getUrl()); + if (dbLists.contains(dataBase.getUrl())) { + return true; + } + File dbFile = new File(dbPath); + if (dbFile.exists()) { + boolean deletResult = dbFile.delete(); + if (!deletResult) { + LOGGER.error("delete Error"); + } + } else { + LOGGER.error("File Error"); + } + File parent = dbFile.getParentFile(); + if (parent == null) { + parent.mkdirs(); + } + try { + Class.forName("org.sqlite.JDBC"); + DriverManager.getConnection(dataBase.getUrl()); + dbLists.add(dataBase.getUrl()); + return true; + } catch (SQLException | ClassNotFoundException throwAbles) { + LOGGER.error("create DataBase failed {}", throwAbles.getMessage()); + return false; + } + } + + /** + * Create a database connection pool + * + * @param dataBase dataBase + * @return DataSource + */ + public DataSource createDruidConnectionPool(DataBase dataBase) { + boolean base = createDataBase(dataBase); + if (!base) { + return null; + } + DruidDataSource dataSource = new DruidDataSource(); + dataSource.setUrl(dataBase.getUrl()); + dataSource.setInitialSize(dataBase.getInitialSize()); + dataSource.setMaxActive(dataBase.getMaxActive()); + dataSource.setMinIdle(dataBase.getMinIdle()); + try { + dataSource.setFilters(dataBase.getFilters()); + dataSource.setMaxWait(dataBase.getMaxWait()); + dataSource.setTimeBetweenEvictionRunsMillis(dataBase.getTimeBetweenEvictionRunsMillis()); + dataSource.setValidationQuery(dataBase.getValidationQuery()); + dataSource.setTestWhileIdle(dataBase.isTestWhileIdle()); + dataSource.setTestOnBorrow(dataBase.isTestOnBorrow()); + dataSource.setTestOnReturn(dataBase.isTestOnReturn()); + } catch (SQLException throwAbles) { + LOGGER.error("create ConnectPoll {}", throwAbles.getMessage()); + } + return dataSource; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/AbstractDataStore.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/AbstractDataStore.java new file mode 100644 index 000000000..57317055f --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/AbstractDataStore.java @@ -0,0 +1,283 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.databasepool; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.common.util.BeanUtil; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +import static ohos.devtools.datasources.databases.databasepool.DataTableHelper.getDeleteCondition; +import static ohos.devtools.datasources.databases.databasepool.DataTableHelper.mapToString; +import static ohos.devtools.datasources.databases.databasepool.DataTableHelper.sqlPlaceholder; + +/** + * @param + * @Description Provides common data table operations + * @Date 2021/1/26 13:15 + **/ +public abstract class AbstractDataStore extends SqlRunnable { + private static final Logger LOGGER = LogManager.getLogger(AbstractDataStore.class); + private static final String TYPE = "type"; + private static final String STRING = "String"; + + /** + * Data insertion + * + * @param dataObject dataObject + * @param + * @return boolean + */ + @SuppressWarnings("checkstyle:JavadocMethod") + public boolean insert(T dataObject) { + if (dataObject instanceof List) { + return insertInDateBaseBatch((List) dataObject); + } + return insertInDataBase(dataObject); + } + + /** + * Get database connection + * + * @param tableName tableName + * @return Optional + */ + protected Optional getConnectByTable(String tableName) { + Optional connection = DataBaseApi.getInstance().getConnectByTable(tableName); + return connection; + } + + /** + * Get database connection + * + * @param dbName dbName + * @return Optional + */ + protected Optional getConnectBydbName(String dbName) { + Optional connection = DataBaseApi.getInstance().getConnectBydbname(dbName); + return connection; + } + + /** + * Insert data in bulk + * + * @param dataObject dataObject + * @return boolean + */ + private boolean insertInDateBaseBatch(List dataObject) { + Object obj = dataObject.get(0); + String tableName = BeanUtil.getObjectName(obj); + Connection connection = DataBaseApi.getInstance().getConnectByTable(tableName).get(); + StringBuffer insertSql = new StringBuffer("INSERT OR IGNORE INTO "); + List attrs = BeanUtil.getObjectAttributeNames(obj); + String value = attrs.stream().collect(Collectors.joining(",")); + insertSql.append(tableName).append("(").append(value).append(") VALUES (").append(sqlPlaceholder(attrs.size())) + .append(")"); + try { + PreparedStatement psmt = connection.prepareStatement(insertSql.toString()); + for (Object data : dataObject) { + applyParams(psmt, data); + psmt.addBatch(); + } + return executeBatch(connection, psmt); + } catch (SQLException throwAbles) { + LOGGER.error(throwAbles.getMessage()); + } + return false; + } + + private void applyParams(PreparedStatement statement, T data) { + List list = BeanUtil.getFieldsInfo(data); + try { + for (int index = 0; index < list.size(); index++) { + Map objMap = list.get(index); + Object objValue = objMap.get("value"); + if (String.valueOf(objMap.get(TYPE)).contains(STRING)) { + if (objValue instanceof String) { + statement.setString(index + 1, (String) objValue); + } + } else if (String.valueOf(objMap.get(TYPE)).contains("Integer")) { + if (objValue instanceof Integer) { + statement.setLong(index + 1, (int) objValue); + } + } else if (String.valueOf(objMap.get(TYPE)).contains("Long")) { + if (objValue instanceof Long) { + statement.setLong(index + 1, (long) objValue); + } + } else if (String.valueOf(objMap.get(TYPE)).contains("byte")) { + if (objValue instanceof byte[]) { + statement.setBytes(index + 1, (byte[]) objValue); + } + } else if (String.valueOf(objMap.get(TYPE)).contains("Boolean")) { + if (objValue instanceof Boolean) { + statement.setBoolean(index + 1, (boolean) objValue); + } + } else { + continue; + } + } + } catch (SQLException exception) { + LOGGER.error(exception.getMessage()); + } + } + + private boolean insertInDataBase(T dataObject) { + String tableName = BeanUtil.getObjectName(dataObject); + StringBuffer insertSql = new StringBuffer("INSERT OR IGNORE INTO "); + List> objectInfos = BeanUtil.getFields(dataObject); + StringBuffer attrs = new StringBuffer(); + StringBuffer values = new StringBuffer(); + objectInfos.forEach(objectMap -> { + attrs.append(objectMap.get("name")).append(","); + if (String.valueOf(objectMap.get(TYPE)).contains(STRING)) { + values.append("'").append(objectMap.get("value")).append("',"); + } else { + values.append(objectMap.get("value")).append(","); + } + }); + insertSql.append(tableName).append("(").append(attrs.deleteCharAt(attrs.length() - 1).toString()) + .append(") VALUES (").append(values.deleteCharAt(values.length() - 1).toString()).append(")"); + Connection connection = DataBaseApi.getInstance().getConnectByTable(tableName).get(); + return execute(connection, insertSql.toString()); + } + + /** + * Delete database + * + * @param dataObject dataObject + * @return boolean + */ + public boolean delete(T dataObject) { + return deleteInDataBase(dataObject); + } + + private boolean deleteInDataBase(T dataObject) { + String tableName = BeanUtil.getObjectName(dataObject); + StringBuffer deleteSql = new StringBuffer("DELETE FROM "); + Map beanMap = BeanUtil.getFiledsInfos(dataObject); + deleteSql.append(tableName).append("WHERE ").append(getDeleteCondition(beanMap)).append("1 = 1"); + Connection connection = DataBaseApi.getInstance().getConnectByTable(tableName).get(); + return execute(connection, deleteSql.toString()); + } + + /** + * update + * + * @param clazz clazz + * @param condition condition + * @param setValue setValue + * @param + * @return boolean + */ + public boolean update(Class clazz, Map condition, Map setValue) { + StringBuffer updateSql = new StringBuffer("UPDATE "); + String tableName = clazz.getSimpleName(); + updateSql.append(tableName).append("SET").append(mapToString(setValue)).append("WHERE ").append(condition); + Connection connection = DataBaseApi.getInstance().getConnectByTable(tableName).get(); + return execute(connection, updateSql.toString()); + } + + /** + * Inquire + * + * @param clazz clazz + * @param value value + * @param condition condition + * @param + * @return List + */ + public List select(Class clazz, Map value, Map condition) { + StringBuffer selectSql = new StringBuffer("SELECT "); + if (value == null || value.isEmpty()) { + selectSql.append("*"); + } + String tableName = clazz.getSimpleName(); + if (condition == null || condition.isEmpty()) { + selectSql.append(" FROM ").append(tableName); + } else { + selectSql.append(" FROM ").append(tableName).append(" WHERE ").append(getDeleteCondition(condition)); + } + Connection connection = DataBaseApi.getInstance().getConnectByTable(tableName).get(); + Statement stmt = null; + ResultSet rs = null; + try { + stmt = connection.createStatement(); + rs = executeQuery(stmt, selectSql.toString()); + return new DataBaseRsHelp().util(clazz.newInstance(), rs); + } catch (SQLException exe) { + LOGGER.error("SQLException: " + exe.getMessage()); + } catch (IllegalAccessException exception) { + LOGGER.error("IllegalAccessException: " + exception.getMessage()); + } catch (InstantiationException exception) { + LOGGER.error("InstantiationException: " + exception.getMessage()); + } catch (NoSuchFieldException exception) { + LOGGER.error("NoSuchFieldException: " + exception.getMessage()); + } finally { + close(rs, connection); + } + return new ArrayList<>(); + } + + /** + * Create a table in the specified database + * + * @param dbName db Name + * @param tableName table Name + * @param params params + * @return boolean + */ + public boolean createTable(String dbName, String tableName, List params) { + DataBaseApi dataSource = DataBaseApi.getInstance(); + return dataSource.createTable(dbName, tableName, params); + } + + /** + * Create a table in the specified database + * + * @param dbName db Name + * @param tableName table Name + * @param sql sql + * @return boolean + */ + public boolean createTable(String dbName, String tableName, String sql) { + DataBaseApi dataSource = DataBaseApi.getInstance(); + return dataSource.createTable(dbName, tableName, sql); + } + + /** + * Create an index on the specified data table + * + * @param tableName table Name + * @param indexName index Name + * @param params params + * @return boolean + */ + public boolean createIndex(String tableName, String indexName, List params) { + DataBaseApi dataSource = DataBaseApi.getInstance(); + return dataSource.createIndex(tableName, indexName, params); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/DataBase.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/DataBase.java new file mode 100644 index 000000000..3296bfc5f --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/DataBase.java @@ -0,0 +1,366 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.databasepool; + +/** + * database objects + * + * @version 1.0 + * @date 2021/1/23 16:31 + **/ +public class DataBase { + private String driver; + private String url; + private Integer initialSize; + private Integer maxActive; + private Integer minIdle; + private Integer maxWait; + private String filters; + private Integer timeBetweenEvictionRunsMillis; + private Integer minEvictableIdleTimeMillis; + private String validationQuery; + private boolean testWhileIdle; + private boolean testOnBorrow; + private boolean testOnReturn; + + private DataBase(Builder builder) { + driver = builder.driver; + url = builder.url; + initialSize = builder.initialSize; + maxActive = builder.maxActive; + minIdle = builder.minIdle; + maxWait = builder.maxWait; + filters = builder.filters; + timeBetweenEvictionRunsMillis = builder.timeBetweenEvictionRunsMillis; + minEvictableIdleTimeMillis = builder.minEvictableIdleTimeMillis; + validationQuery = builder.validationQuery; + testWhileIdle = builder.testWhileIdle; + testOnBorrow = builder.testOnBorrow; + testOnReturn = builder.testOnReturn; + } + + /** + * set Url + * + * @param url url + */ + public void setUrl(String url) { + this.url = url; + } + + /** + * builder + * + * @return Builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * get Driver + * + * @return String + */ + public String getDriver() { + return driver; + } + + /** + * get Url + * + * @return String + */ + public String getUrl() { + return url; + } + + /** + * get Initial Size + * + * @return Integer + */ + public Integer getInitialSize() { + return initialSize; + } + + /** + * get Max Active + * + * @return Integer + */ + public Integer getMaxActive() { + return maxActive; + } + + /** + * getMinIdle + * + * @return Integer + */ + public Integer getMinIdle() { + return minIdle; + } + + /** + * getMaxWait + * + * @return Integer + */ + public Integer getMaxWait() { + return maxWait; + } + + /** + * getFilters + * + * @return String + */ + public String getFilters() { + return filters; + } + + /** + * getTimeBetweenEvictionRunsMillis + * + * @return Integer + */ + public Integer getTimeBetweenEvictionRunsMillis() { + return timeBetweenEvictionRunsMillis; + } + + /** + * getMinEvictableIdleTimeMillis + * + * @return Integer + */ + public Integer getMinEvictableIdleTimeMillis() { + return minEvictableIdleTimeMillis; + } + + /** + * getValidationQuery + * + * @return String + */ + public String getValidationQuery() { + return validationQuery; + } + + /** + * isTestWhileIdle + * + * @return boolean + */ + public boolean isTestWhileIdle() { + return testWhileIdle; + } + + /** + * isTestOnBorrow + * + * @return boolean + */ + public boolean isTestOnBorrow() { + return testOnBorrow; + } + + /** + * isTestOnReturn + * + * @return boolean + */ + public boolean isTestOnReturn() { + return testOnReturn; + } + + /** + * Builder + * + * @version 1.0 + * @date 2021/1/23 16:31 + **/ + public static class Builder { + private String driver; + private String url; + private Integer initialSize; + private Integer maxActive; + private Integer minIdle; + private String filters; + private Integer timeBetweenEvictionRunsMillis; + private Integer minEvictableIdleTimeMillis; + private String validationQuery; + private boolean testWhileIdle; + private boolean testOnBorrow; + private boolean testOnReturn; + private Integer maxWait; + + private Builder() { + } + + /** + * drive + * + * @param driver driver + * @return Builder + */ + public Builder driver(String driver) { + this.driver = driver; + return this; + } + + /** + * URL path + * + * @param url url + * @return Builder + */ + public Builder url(String url) { + this.url = url; + return this; + } + + /** + * initialSize + * + * @param initialSize initialSize + * @return Builder + */ + public Builder initialSize(Integer initialSize) { + this.initialSize = initialSize; + return this; + } + + /** + * Biggest activity + * + * @param maxActive maxActive + * @return Builder + */ + public Builder maxActive(Integer maxActive) { + this.maxActive = maxActive; + return this; + } + + /** + * minIdle + * + * @param minIdle minIdle + * @return Builder + */ + public Builder minIdle(Integer minIdle) { + this.minIdle = minIdle; + return this; + } + + /** + * maxWait + * + * @param maxWait maxWait + * @return Builder + */ + public Builder maxWait(Integer maxWait) { + this.maxWait = maxWait; + return this; + } + + /** + * filters + * + * @param filters filters + * @return Builder + */ + public Builder filters(String filters) { + this.filters = filters; + return this; + } + + /** + * timeBetweenEvictionRunsMillis + * + * @param timeBetweenEvictionRunsMillis timeBetweenEvictionRunsMillis + * @return Builder + */ + public Builder timeBetweenEvictionRunsMillis(Integer timeBetweenEvictionRunsMillis) { + this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; + return this; + } + + /** + * time + * + * @param minEvictableIdleTimeMillis minEvictableIdleTimeMillis + * @return Builder + */ + public Builder minEvictableIdleTimeMillis(Integer minEvictableIdleTimeMillis) { + this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis; + return this; + } + + /** + * validationQuery + * + * @param validationQuery validationQuery + * @return Builder + */ + public Builder validationQuery(String validationQuery) { + this.validationQuery = validationQuery; + return this; + } + + /** + * testWhileIdle + * + * @param testWhileIdle testWhileIdle + * @return Builder + */ + public Builder testWhileIdle(boolean testWhileIdle) { + this.testWhileIdle = testWhileIdle; + return this; + } + + /** + * test + * + * @param testOnBorrow testOnBorrow + * @return Builder + */ + public Builder testOnBorrow(boolean testOnBorrow) { + this.testOnBorrow = testOnBorrow; + return this; + } + + /** + * testOnReturn + * + * @param testOnReturn testOnReturn + * @return Builder + */ + public Builder testOnReturn(boolean testOnReturn) { + this.testOnReturn = testOnReturn; + return this; + } + + /** + * build + * + * @return DataBase + */ + public DataBase build() { + return new DataBase(this); + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/DataBaseHelper.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/DataBaseHelper.java new file mode 100644 index 000000000..b0e96bf91 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/DataBaseHelper.java @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.databasepool; + +import ohos.devtools.datasources.utils.session.service.SessionManager; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Properties; + +import static ohos.devtools.views.common.LayoutConstants.NEGATIVE_ONE; +import static ohos.devtools.views.common.LayoutConstants.THOUSAND_TWENTY_FOUR; + +/** + * Used for database creation in the project, default table creation + * + * @version 1.0 + * @date 2021/1/25 9:45 + **/ +public class DataBaseHelper { + private DataBaseHelper() { + } + + private static final Logger LOGGER = LogManager.getLogger(DataBaseHelper.class); + private static final String SQL_START_FLAG = "##"; + + /** + * Check whether the specified database exists. + * + * @param dataBaseUrl dataBaseUrl + * @return Returns true if the database exists; returns false otherwise. + */ + public static boolean checkDataBaseExists(String dataBaseUrl) { + String dbPath = getFilePath(dataBaseUrl); + File dbFile = new File(dbPath); + return dbFile.exists(); + } + + /** + * Enter a specific path + * + * @param sqlPath sqlPath + * @return List + * @throws IOException IOException + */ + public static List loadSqlFileToList(String sqlPath) throws IOException { + File file = new File(sqlPath); + if (!file.exists() || file.isDirectory()) { + return new ArrayList<>(); + } + InputStream sqlFileIn = new FileInputStream(sqlPath); + StringBuffer sqlSb = new StringBuffer(); + byte[] buff = new byte[THOUSAND_TWENTY_FOUR]; + int byteRead = 0; + while (true) { + byteRead = sqlFileIn.read(buff); + if (byteRead == NEGATIVE_ONE) { + break; + } + sqlSb.append(new String(buff, 0, byteRead, Charset.defaultCharset())); + } + sqlFileIn.close(); + String[] sqlArr = sqlSb.toString().split("(\\r\\n)|(\\n)"); + List sqlList = new ArrayList(); + List sqlLists = Arrays.asList(sqlArr); + StringBuilder createTableSql = new StringBuilder(); + for (String sql : sqlLists) { + if (StringUtils.isNotBlank(sql) && sql.startsWith(SQL_START_FLAG)) { + continue; + } + if ((!sql.contains("*"))) { + createTableSql.append(sql); + if (sql.endsWith(");")) { + sqlList.add(createTableSql.toString()); + createTableSql = new StringBuilder(); + } + } + } + return sqlList; + } + + /** + * Get database file path through JDBC URL + * + * @param url url + * @return String + */ + public static String getFilePath(String url) { + String filePath = url.replace("jdbc:sqlite:", ""); + return filePath; + } + + /** + * getUrlByDataBaseName + * + * @param dbName dbName + * @return String String + */ + public static String getUrlByDataBaseName(String dbName) { + String dbPath = SessionManager.getInstance().getPluginPath(); + if (StringUtils.isBlank(dbName)) { + return "jdbc:sqlite:" + dbPath + "defaultDB"; + } + return "jdbc:sqlite:" + dbPath + dbName; + } + + /** + * createDataBase + * + * @return DataBase + */ + public static DataBase createDataBase() { + Properties pop = new Properties(); + try { + pop.load(DataBaseHelper.class.getClassLoader().getResourceAsStream("db.properties")); + return DataBase.builder().driver(pop.getProperty("driver")) + .initialSize(Integer.parseInt(pop.getProperty("initialSize"))) + .maxActive(Integer.parseInt(pop.getProperty("maxActive"))) + .minIdle(Integer.parseInt(pop.getProperty("minIdle"))).filters(pop.getProperty("filters")) + .maxWait(Integer.parseInt(pop.getProperty("maxWait"))) + .timeBetweenEvictionRunsMillis(Integer.parseInt(pop.getProperty("timeBetweenEvictionRunsMillis"))) + .minEvictableIdleTimeMillis(Integer.parseInt(pop.getProperty("minEvictableIdleTimeMillis"))) + .validationQuery(pop.getProperty("validationQuery")) + .testWhileIdle(Boolean.parseBoolean(pop.getProperty("testWhileIdle"))) + .testOnBorrow(Boolean.parseBoolean(pop.getProperty("testOnBorrow"))) + .testOnReturn(Boolean.parseBoolean(pop.getProperty("testOnReturn"))).build(); + } catch (IOException exception) { + LOGGER.error("createDataBase" + exception.getMessage()); + } + return DataBase.builder().build(); + } + + /** + * Create default database + * + * @return DataBase + */ + public static DataBase createDefaultDataBase() { + Properties pop = new Properties(); + try { + pop.load(DataBaseHelper.class.getClassLoader().getResourceAsStream("db.properties")); + return DataBase.builder().driver(pop.getProperty("driver")) + .initialSize(Integer.parseInt(pop.getProperty("initialSize"))) + .maxActive(Integer.parseInt(pop.getProperty("maxActive"))) + .minIdle(Integer.parseInt(pop.getProperty("minIdle"))).filters(pop.getProperty("filters")) + .maxWait(Integer.parseInt(pop.getProperty("maxWait"))) + .timeBetweenEvictionRunsMillis(Integer.parseInt(pop.getProperty("timeBetweenEvictionRunsMillis"))) + .minEvictableIdleTimeMillis(Integer.parseInt(pop.getProperty("minEvictableIdleTimeMillis"))) + .validationQuery(pop.getProperty("validationQuery")) + .testWhileIdle(Boolean.parseBoolean(pop.getProperty("testWhileIdle"))) + .testOnBorrow(Boolean.parseBoolean(pop.getProperty("testOnBorrow"))) + .testOnReturn(Boolean.parseBoolean(pop.getProperty("testOnReturn"))).build(); + } catch (IOException exception) { + LOGGER.error("createDefaultDataBase" + exception.getMessage()); + } + return DataBase.builder().build(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/DataBaseRsHelp.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/DataBaseRsHelp.java new file mode 100644 index 000000000..e5246b200 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/DataBaseRsHelp.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.databasepool; + +import java.lang.reflect.Field; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * Data results help + * + * @version 1.0 + * @date 2021/1/23 16:31 + **/ +public class DataBaseRsHelp { + private static final Logger LOGGER = LogManager.getLogger(DataBaseRsHelp.class); + + /** + * Get the database table name by SQL. + * + * @param instanceClass generic paradigm + * @param rs result set + * @return List + * @throws IllegalAccessException IllegalAccessException + * @throws InstantiationException InstantiationException + * @throws NoSuchFieldException NoSuchFieldException + */ + public List util(T instanceClass, ResultSet rs) + throws IllegalAccessException, InstantiationException, NoSuchFieldException { + List list = new ArrayList(); + Class aClass = instanceClass.getClass(); + Field[] fs = aClass.getDeclaredFields(); + if (rs != null) { + while (true) { + try { + if (!rs.next()) { + break; + } + T instance = (T) aClass.newInstance(); + for (int index = 0; index < fs.length; index++) { + Field declaredField = instance.getClass().getDeclaredField(fs[index].getName()); + declaredField.setAccessible(true); + if (declaredField.getType().getName().equals(String.class.getName())) { + declaredField.set(instance, rs.getString(fs[index].getName())); + } else if (declaredField.getType().getName().equals(int.class.getName())) { + declaredField.set(instance, rs.getInt(fs[index].getName())); + } else { + continue; + } + } + list.add(instance); + } catch (SQLException throwAbles) { + LOGGER.error(throwAbles.getMessage()); + } + } + } + // Return results + return list; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/DataTableHelper.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/DataTableHelper.java new file mode 100644 index 000000000..cd20638d4 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/DataTableHelper.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.databasepool; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.Arrays; +import java.util.Map; +import java.util.Set; + +import static ohos.devtools.views.common.LayoutConstants.INDEX_FIVE; +import static ohos.devtools.views.common.LayoutConstants.NEGATIVE_ONE; + +/** + * Database table structure maintenance + * + * @version 1.0 + * @date 2021/01/27 17:11 + **/ +public class DataTableHelper { + private DataTableHelper() { + } + + private static final Logger LOGGER = LogManager.getLogger(DataTableHelper.class); + + /** + * Get the database table name by SQL. + * + * @param sql sql + * @return String + */ + public static String getTableNameBySql(String sql) { + int tableIndex = sql.indexOf("TABLE"); + if (tableIndex != NEGATIVE_ONE) { + String tableName = sql.substring(tableIndex + INDEX_FIVE, sql.indexOf("(")); + return tableName.trim(); + } + return ""; + } + + /** + * sql Placeholder + * + * @param size size + * @return String + */ + public static String sqlPlaceholder(int size) { + StringBuffer stringBuffer = new StringBuffer(); + for (int i = 0; i < size; i++) { + if (i == (size - 1)) { + stringBuffer.append("?"); + } else { + stringBuffer.append("?,"); + } + } + return stringBuffer.toString(); + } + + /** + * Map to String + * + * @param map map + * @return String + */ + public static String getDeleteCondition(Map map) { + Set keySet = map.keySet(); + // Convert set collection to array + String[] keyArray = keySet.toArray(new String[keySet.size()]); + // Sort the array (ascending order) + Arrays.sort(keyArray); + // Because String splicing efficiency will be very low, so switch to String Builder + StringBuilder stringBuffer = new StringBuilder(); + for (int i = 0; i < keyArray.length; i++) { + // If the parameter value is empty, it does not participate in the signature. + // This method trim() removes spaces + if ((String.valueOf(map.get(keyArray[i]))).trim().length() > 0) { + stringBuffer.append(keyArray[i]); + if (map.get(keyArray[i]) instanceof String) { + stringBuffer.append(" = '").append(String.valueOf(map.get(keyArray[i])).trim()).append("'"); + } else { + stringBuffer.append(" = `").append(String.valueOf(map.get(keyArray[i])).trim()).append("`"); + } + } + if (i != keyArray.length - 1) { + stringBuffer.append(" and "); + } + } + return stringBuffer.toString(); + } + + /** + * Map to String + * + * @param map map + * @return String + */ + public static String mapToString(Map map) { + Set keySet = map.keySet(); + // Convert set collection to array + String[] keyArray = keySet.toArray(new String[keySet.size()]); + // Sort the array (ascending order) + Arrays.sort(keyArray); + StringBuilder stringBuffer = new StringBuilder(); + for (int i = 0; i < keyArray.length; i++) { + // If the parameter value is empty, it does not participate in the signature. + // This method trim() removes spaces + if ((String.valueOf(map.get(keyArray[i]))).trim().length() > 0) { + stringBuffer.append(keyArray[i]).append(" = '").append(String.valueOf(map.get(keyArray[i])).trim()) + .append("'"); + } + if (i != keyArray.length - 1) { + stringBuffer.append("="); + } + } + return stringBuffer.toString(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/SqlRunnable.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/SqlRunnable.java new file mode 100644 index 000000000..901a3c665 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/databasepool/SqlRunnable.java @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.databasepool; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +/** + * sql carried out + * + * @version 1.0 + * @date 2021/02/05 14:10 + **/ +public class SqlRunnable { + private static final Logger LOGGER = LogManager.getLogger(SqlRunnable.class); + + /** + * method + * + * @param conn Connection + * @param sql sql + * @return boolean + */ + public boolean execute(Connection conn, String sql) { + boolean result = false; + Statement stmt = null; + try { + stmt = conn.createStatement(); + result = stmt.executeUpdate(sql) > 0 ? true : false; + } catch (SQLException throwAbles) { + LOGGER.error(throwAbles.getMessage()); + } finally { + close(stmt, conn); + } + return result; + } + + /** + * executeBatch + * + * @param conn Connection + * @param ste Prepared Statement + * @return boolean + */ + public boolean executeBatch(Connection conn, PreparedStatement ste) { + try { + conn.setAutoCommit(false); + int[] result = ste.executeBatch(); + conn.commit(); + return true; + } catch (SQLException throwAbles) { + try { + conn.rollback(); + } catch (SQLException exception) { + return false; + } + } finally { + close(ste, conn); + } + return false; + } + + /** + * executeQuery + * + * @param stmt Statement + * @param sql sql + * @return ResultSet + */ + public ResultSet executeQuery(Statement stmt, String sql) { + ResultSet rs = null; + try { + rs = stmt.executeQuery(sql); + } catch (SQLException throwAbles) { + LOGGER.error(throwAbles.getMessage()); + } + return rs; + } + + /** + * close + * + * @param st Statement + */ + public void close(Statement st) { + close(st, null, null); + } + + /** + * close + * + * @param rs Result set + */ + public void close(ResultSet rs) { + close(null, rs, null); + } + + /** + * close + * + * @param con Connection + */ + public void close(Connection con) { + close(null, null, con); + } + + /** + * close + * + * @param st Statement + * @param con Connection + */ + public void close(Statement st, Connection con) { + close(st, null, con); + } + + /** + * close + * + * @param rs Result set + * @param con Connection + */ + public void close(ResultSet rs, Connection con) { + close(null, rs, con); + } + + /** + * close + * + * @param st Statement + * @param rs Result set + * @param con Connection + */ + public void close(Statement st, ResultSet rs, Connection con) { + if (st != null) { + try { + st.close(); + } catch (SQLException exception) { + LOGGER.error(exception.getMessage()); + } + } + if (rs != null) { + try { + rs.close(); + } catch (SQLException exception) { + LOGGER.error(exception.getMessage()); + } + } + if (con != null) { + try { + con.close(); + } catch (SQLException exception) { + LOGGER.error(exception.getMessage()); + } + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/MemoryTable.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/MemoryTable.java new file mode 100644 index 000000000..cb8f3c9eb --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/MemoryTable.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.datatable; + +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.databases.datatable.enties.ProcessMemInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.Optional; + +import static ohos.devtools.views.common.LayoutConstants.INDEX_FOUR; +import static ohos.devtools.views.common.LayoutConstants.INDEX_ONE; +import static ohos.devtools.views.common.LayoutConstants.INDEX_THREE; +import static ohos.devtools.views.common.LayoutConstants.TWO; + +/** + * memory数据 + * + * @version 1.0 + * @date 2021/02/20 16:51 + **/ +public class MemoryTable extends AbstractDataStore { + private static final Logger LOGGER = LogManager.getLogger(MemoryTable.class); + private static final String MEMORY_DB_NAME = "memory"; + + public MemoryTable() { + initialize(); + } + + /** + * initialization + **/ + private void initialize() { + // processMemInfo + List processMemInfo = new ArrayList() { + { + add("id INTEGER primary key autoincrement not null"); + add("session LONG NOT NULL"); + add("sessionId INTEGER NOT NULL"); + add("timeStamp Long NOT NULL"); + add("Data BLOB NOT NULL"); + } + }; + List processMemInfoIndex = new ArrayList() { + { + add("id"); + add("sessionId"); + add("timeStamp"); + } + }; + createTable(MEMORY_DB_NAME, "processMemInfo", processMemInfo); + createIndex("processMemInfo", "processMemInfoIndex", processMemInfoIndex); + } + + /** + * insertProcessMemInfo + * + * @param processMemInfo processMemInfo + * @return boolean + */ + public boolean insertProcessMemInfo(List processMemInfo) { + return insertAppInfoBatch(processMemInfo); + } + + private boolean insertAppInfoBatch(List processMemInfos) { + Optional option = getConnectByTable("processMemInfo"); + if (option.isPresent()) { + Connection conn = option.get(); + try { + PreparedStatement pst = conn.prepareStatement( + "INSERT OR IGNORE INTO processMemInfo(session, sessionId, timeStamp, Data) VALUES (?, ?, ?, ?)"); + conn.setAutoCommit(false); + processMemInfos.forEach(processMemoryInfo -> { + try { + pst.setLong(INDEX_ONE, processMemoryInfo.getLocalSessionId()); + pst.setInt(TWO, processMemoryInfo.getSessionId()); + pst.setLong(INDEX_THREE, processMemoryInfo.getTimeStamp()); + pst.setBytes(INDEX_FOUR, processMemoryInfo.getData().toByteArray()); + pst.addBatch(); + } catch (SQLException sqlException) { + LOGGER.info("insert AppInfo {}", sqlException.getMessage()); + } + }); + try { + int[] results = pst.executeBatch(); + conn.commit(); + return true; + } catch (SQLException throwAbles) { + LOGGER.info("insert AppInfo {}", throwAbles.getMessage()); + } finally { + if (pst != null) { + pst.close(); + } + if (conn != null) { + conn.close(); + } + } + } catch (SQLException exception) { + LOGGER.error("insert AppInfo {}", exception.getMessage()); + } + } + return false; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/enties/MemoryData.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/enties/MemoryData.java new file mode 100644 index 000000000..bf9eaa0f1 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/enties/MemoryData.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.datatable.enties; + +import java.io.Serializable; + +/** + * @param + * @version 1.0 + * @date 2021/02/22 15:35 + **/ +public class MemoryData implements Serializable { + private static final long serialVersionUID = -8106428244173195592L; + long localSessionId; + int sessionId; + long timeStamp; + T data; + + /** + * Get session + * + * @return long + */ + public long getSession() { + return localSessionId; + } + + /** + * Get sessionId + * + * @return int + */ + public int getSessionId() { + return sessionId; + } + + /** + * Save session + * + * @param localSessionId Local sessionId + */ + public void setSession(long localSessionId) { + this.localSessionId = localSessionId; + } + + /** + * Set sessionId + * + * @param sessionId sessionId + */ + public void setSessionId(int sessionId) { + this.sessionId = sessionId; + } + + /** + * Get data + * + * @return T + */ + public T getData() { + return data; + } + + /** + * Set data + * + * @param data data + */ + public void setData(T data) { + this.data = data; + } + + /** + * get local sessionId + * + * @return long + */ + public long getLocalSessionId() { + return localSessionId; + } + + /** + * Set local sessionId + * + * @param localSessionId Local sessionId + */ + public void setLocalSessionId(long localSessionId) { + this.localSessionId = localSessionId; + } + + /** + * Get time stamp + * + * @return long + */ + public long getTimeStamp() { + return timeStamp; + } + + /** + * Set time stamp + * + * @param timeStamp Time stamp + */ + public void setTimeStamp(long timeStamp) { + this.timeStamp = timeStamp; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/enties/ProcessMemInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/enties/ProcessMemInfo.java new file mode 100644 index 000000000..e393f0de8 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/enties/ProcessMemInfo.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.datatable.enties; + +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; + +/** + * ProcessMemInfo + * + * @version 1.0 + * @date 2021/02/22 10:40 + **/ +public class ProcessMemInfo extends MemoryData { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/enties/SysMemInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/enties/SysMemInfo.java new file mode 100644 index 000000000..ac99aabbc --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/enties/SysMemInfo.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.datatable.enties; + +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; + +/** + * SysMemInfo + * + * @version 1.0 + * @date 2021/02/22 10:35 + **/ +public class SysMemInfo extends MemoryData { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/enties/SysVmemInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/enties/SysVmemInfo.java new file mode 100644 index 000000000..2205e999d --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/databases/datatable/enties/SysVmemInfo.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.datatable.enties; + +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; + +/** + * SysVMemInfo + * + * @version 1.0 + * @date 2021/02/22 10:47 + **/ +public class SysVmemInfo extends MemoryData { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/grpc/HiProfilerClient.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/grpc/HiProfilerClient.java new file mode 100644 index 000000000..9e1da0cae --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/grpc/HiProfilerClient.java @@ -0,0 +1,434 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.transport.grpc; + +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.ManagedChannel; +import io.grpc.StatusRuntimeException; +import ohos.devtools.datasources.transport.grpc.service.CommonTypes; +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginConfig; +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; +import ohos.devtools.datasources.transport.grpc.service.ProfilerServiceTypes; +import ohos.devtools.datasources.utils.common.util.CommonUtil; +import ohos.devtools.datasources.utils.common.util.DateTimeUtil; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import ohos.devtools.views.common.LayoutConstants; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.net.InetAddress; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; + +import static ohos.devtools.datasources.utils.common.Constant.DEVICE_FULL_TYPE; +import static ohos.devtools.datasources.utils.common.Constant.MEMORY_PLUG; +import static ohos.devtools.datasources.utils.common.Constant.MEMORY_PLUGS_NAME; +import static ohos.devtools.views.common.ViewConstants.NUM_2; +import static ohos.devtools.views.common.ViewConstants.NUM_5; + +/** + * Provide device-side grpc interface encapsulation for each module in the application + * + * @version 1.0 + * @date 2021/02/01 19:23 + **/ +public final class HiProfilerClient { + private static final Logger LOGGER = LogManager.getLogger(HiProfilerClient.class); + + private static final String IP = InetAddress.getLoopbackAddress().getHostAddress(); + + /** + * Used to store the created Profiler + */ + private static ConcurrentHashMap profilerClientMap = + new ConcurrentHashMap<>(CommonUtil.collectionSize(0)); + + /** + * Singleton Class Instance + * + * @version 1.0 + * @date 2021/02/01 19:23 + **/ + private static class SingletonClassInstance { + private static final HiProfilerClient INSTANCE = new HiProfilerClient(); + } + + /** + * Get instance + * + * @return HiProfilerClient + */ + public static HiProfilerClient getInstance() { + return SingletonClassInstance.INSTANCE; + } + + private HiProfilerClient() { + } + + /** + * Get profilerclient + * + * @param ip ip address + * @param port port number + * @param channel channel + * @return ProfilerClient + */ + public ProfilerClient getProfilerClient(String ip, int port, ManagedChannel channel) { + String mapKey = IP + port; + if (port <= 0 || port > LayoutConstants.PORT) { + return null; + } + if (Objects.isNull(profilerClientMap.get(mapKey))) { + ProfilerClient profilerClient = new ProfilerClient(IP, port, channel); + profilerClientMap.put(mapKey, profilerClient); + return profilerClient; + } + return profilerClientMap.get(mapKey); + } + + /** + * get profilerClient. + * + * @param ip ip address + * @param port port number + * @return ProfilerClient + */ + public ProfilerClient getProfilerClient(String ip, int port) { + if (port <= 0 || port > LayoutConstants.PORT) { + return null; + } + String mapKey = IP + port; + if (profilerClientMap.get(mapKey) == null) { + ProfilerClient profilerClient = new ProfilerClient(IP, port); + profilerClientMap.put(mapKey, profilerClient); + return profilerClient; + } + return profilerClientMap.get(mapKey); + } + + /** + * Destroy profilerClient + * + * @param ip ip address + * @param port port number + * @return boolean + */ + public boolean destroyProfiler(String ip, int port) { + if (port <= 0 || port > LayoutConstants.PORT) { + return false; + } + String mapKey = IP + port; + if (Objects.isNull(profilerClientMap.get(mapKey))) { + return true; + } + ProfilerClient client = profilerClientMap.get(mapKey); + client.shutdown(); + return profilerClientMap.remove(mapKey, client); + } + + /** + * requestCreateSession + * + * @param port port number + * @param name name + * @param pid pid + * @param reportProcessTree report process tree + * @param deviceType device Type + * @return int + */ + public int requestCreateSession(int port, String name, int pid, boolean reportProcessTree, String deviceType) { + if (port <= 0 || port > LayoutConstants.PORT) { + return -1; + } + ProfilerClient client = getProfilerClient("", port); + LOGGER.info("process Session start222", DateTimeUtil.getNowTimeLong()); + if (client.isUsed()) { + LOGGER.info("process Session is Used", DateTimeUtil.getNowTimeLong()); + return -1; + } + client.setUsed(true); + LOGGER.info("process Session start3333", DateTimeUtil.getNowTimeLong()); + MemoryPluginConfig.MemoryConfig plug; + int pages = 2; + if (DEVICE_FULL_TYPE.equals(deviceType)) { + pages = 10; + plug = MemoryPlugHelper.createMemRequest(pid, reportProcessTree, false, false, true); + } else { + plug = MemoryPlugHelper.createMemRequest(pid, reportProcessTree, false, false, false); + } + ProfilerServiceTypes.ProfilerSessionConfig sessionConfig = ProfilerServiceHelper + .profilerSessionConfig(true, null, pages, + ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.Policy.RECYCLE); + CommonTypes.ProfilerPluginConfig plugConfig = + ProfilerServiceHelper.profilerPluginConfig(name, "ABDSSFDFG", 0, plug.toByteString()); + List plugs = new ArrayList(); + plugs.add(plugConfig); + ProfilerServiceTypes.CreateSessionRequest request = + ProfilerServiceHelper.createSessionRequest(CommonUtil.getRequestId(), sessionConfig, plugs); + ProfilerServiceTypes.CreateSessionResponse response = null; + try { + response = client.createSession(request); + LOGGER.info("process Session start444 {} ", DateTimeUtil.getNowTimeLong()); + } catch (StatusRuntimeException exception) { + destroyProfiler("", port); + return -1; + } + client.setUsed(false); + return response.getSessionId(); + } + + /** + * Request to start session + * + * @param deviceIp deviceIp + * @param port port number + * @param sessionId sessionId + * @return boolean + */ + public boolean requestStartSession(String deviceIp, int port, int sessionId) { + if (port <= 0 || port > LayoutConstants.PORT) { + return false; + } + return requestStartSession(deviceIp, port, sessionId, 0); + } + + private boolean requestStartSession(String deviceIp, int port, int sessionId, int retryCount) { + int retryCounts = retryCount + 1; + ProfilerServiceTypes.StartSessionRequest requestStartSession = + ProfilerServiceHelper.startSessionRequest(CommonUtil.getRequestId(), sessionId, new ArrayList<>()); + ProfilerServiceTypes.StartSessionResponse response = null; + ProfilerClient client = getProfilerClient(deviceIp, port); + if (client.isUsed()) { + return false; + } + client.setUsed(true); + try { + response = client.startSession(requestStartSession); + } catch (StatusRuntimeException exception) { + destroyProfiler("", port); + if (retryCounts > NUM_5) { + return true; + } + return requestStartSession(deviceIp, port, sessionId, retryCounts); + } + client.setUsed(false); + return response.getStatus() == 0 ? true : false; + } + + /** + * requestStopSession + * + * @param deviceIp deviceIp + * @param port port number + * @param sessionId sessionId + * @param isForce isForce + * @return boolean + */ + public boolean requestStopSession(String deviceIp, int port, int sessionId, boolean isForce) { + if (port <= 0 || port > LayoutConstants.PORT) { + return false; + } + return requestStopSession(deviceIp, port, sessionId, isForce, 0); + } + + private boolean requestStopSession(String deviceIp, int port, int sessionId, boolean isForce, int retryCount) { + ProfilerClient client = getProfilerClient(deviceIp, port); + if (isForce) { + client.setUsed(false); + } + if (client.isUsed()) { + return false; + } + client.setUsed(true); + ProfilerServiceTypes.StopSessionRequest stopSession = + ProfilerServiceHelper.stopSessionRequest(CommonUtil.getRequestId(), sessionId); + ProfilerServiceTypes.StopSessionResponse response = null; + int retryCounts = retryCount; + try { + retryCounts = retryCount + 1; + Long stopTime = DateTimeUtil.getNowTimeLong(); + LOGGER.info("startStopSession {}", stopTime); + response = client.stopSession(stopSession); + LOGGER.info("startStopEndSession {}", DateTimeUtil.getNowTimeLong() - stopTime); + } catch (StatusRuntimeException exception) { + LOGGER.info("stopSession has Exception {}", exception.getMessage()); + destroyProfiler(deviceIp, port); + if (retryCounts > NUM_2) { + return true; + } + return requestStopSession(deviceIp, port, sessionId, false, retryCounts); + } + client.setUsed(false); + return response.getStatus() == 0 ? true : false; + } + + /** + * request destory Session + * + * @param deviceIp deviceIp + * @param port port number + * @param sessionId sessionId + * @return boolean + */ + public boolean requestDestroySession(String deviceIp, int port, int sessionId) { + if (port <= 0 || port > LayoutConstants.PORT) { + return false; + } + return requestDestroySession(deviceIp, port, sessionId, 0); + } + + private boolean requestDestroySession(String deviceIp, int port, int sessionId, int retryCount) { + int retryCounts = retryCount + 1; + ProfilerClient client = getProfilerClient(deviceIp, port); + if (client.isUsed()) { + return false; + } + client.setUsed(true); + ProfilerServiceTypes.DestroySessionRequest req = + ProfilerServiceHelper.destroySessionRequest(CommonUtil.getRequestId(), sessionId); + ProfilerServiceTypes.DestroySessionResponse response = null; + try { + response = client.destroySession(req); + } catch (StatusRuntimeException exception) { + destroyProfiler(deviceIp, port); + if (retryCounts > NUM_2) { + return true; + } + return requestDestroySession(deviceIp, port, sessionId, retryCounts); + } + client.setUsed(false); + return response.getStatus() == 0 ? true : false; + } + + /** + * Fetch process data + * + * @param deviceIp deviceIp + * @param port port number + * @param sessionId sessionId + * @return List + */ + public List fetchProcessData(String deviceIp, int port, int sessionId) { + ProfilerClient client = getProfilerClient(deviceIp, port); + if (client.isUsed()) { + return new ArrayList<>(); + } + client.setUsed(true); + List processInfos = new ArrayList<>(); + ProfilerServiceTypes.FetchDataRequest fetchData = + ProfilerServiceHelper.fetchDataRequest(CommonUtil.getRequestId(), sessionId, null); + Iterator res = null; + try { + res = client.fetchData(fetchData); + } catch (StatusRuntimeException exception) { + destroyProfiler(deviceIp, port); + LOGGER.info("GrpcException {}", exception.getMessage()); + return new ArrayList<>(); + } + try { + if (res.hasNext()) { + ProfilerServiceTypes.FetchDataResponse fetchDataResponse = res.next(); + int pluginStatus = fetchDataResponse.getStatus(); + if (pluginStatus != 0) { + client.setUsed(false); + return new ArrayList<>(); + } + List lists = fetchDataResponse.getPluginDataList(); + processInfos = extractedData(lists); + } + } catch (StatusRuntimeException statusRuntimeException) { + destroyProfiler(deviceIp, port); + LOGGER.error(" get ProcessInfo failed {}", statusRuntimeException.getMessage()); + } + client.setUsed(false); + return processInfos; + } + + private List extractedData(List lists) { + List process = new ArrayList<>(); + + for (CommonTypes.ProfilerPluginData profilerPluginData : lists) { + if (MEMORY_PLUGS_NAME.equals(profilerPluginData.getName()) || MEMORY_PLUG + .equals(profilerPluginData.getName())) { + if (profilerPluginData.getStatus() != 0) { + continue; + } + ByteString data = profilerPluginData.getData(); + MemoryPluginResult.MemoryData.Builder builder = MemoryPluginResult.MemoryData.newBuilder(); + MemoryPluginResult.MemoryData memorydata = null; + try { + memorydata = builder.mergeFrom(data).build(); + } catch (InvalidProtocolBufferException exception) { + LOGGER.info("mergeFrom failed {}", exception.getMessage()); + } + List processMemoryInfos = memorydata.getProcessesinfoList(); + for (MemoryPluginResult.ProcessMemoryInfo processMemoryInfo : processMemoryInfos) { + ProcessInfo processInfo = new ProcessInfo(); + processInfo.setProcessId(processMemoryInfo.getPid()); + processInfo.setProcessName(processMemoryInfo.getName()); + process.add(processInfo); + } + } + } + return process; + } + + /** + * Get capabilities + * + * @param deviceIp deviceIp + * @param port port number + * @return ProfilerServiceTypes.GetCapabilitiesResponse + */ + public ProfilerServiceTypes.GetCapabilitiesResponse getCapabilities(String deviceIp, int port) { + if (port <= 0 || port > LayoutConstants.PORT) { + return null; + } + return getCapabilities(deviceIp, port, 0); + } + + /** + * Get capabilities + * + * @param deviceIp deviceIp + * @param port port number + * @param retryCount retry Count + * @return ProfilerServiceTypes.GetCapabilitiesResponse + */ + private ProfilerServiceTypes.GetCapabilitiesResponse getCapabilities(String deviceIp, int port, int retryCount) { + int counts = retryCount + 1; + ProfilerServiceTypes.GetCapabilitiesResponse response; + ProfilerClient client = getProfilerClient(deviceIp, port); + try { + response = client.getCapabilities( + ProfilerServiceTypes.GetCapabilitiesRequest.newBuilder().setRequestId(CommonUtil.getRequestId()) + .build()); + } catch (StatusRuntimeException exception) { + LOGGER.info("exception Error {}", exception.getMessage()); + destroyProfiler(deviceIp, port); + if (counts > NUM_2) { + return ProfilerServiceTypes.GetCapabilitiesResponse.newBuilder().build(); + } + return getCapabilities(deviceIp, port, counts); + } + return response; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/grpc/MemoryPlugHelper.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/grpc/MemoryPlugHelper.java new file mode 100644 index 000000000..2cc32c5cd --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/grpc/MemoryPlugHelper.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.transport.grpc; + +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginConfig; + +import java.util.List; + +/** + * Construct the configuration information help class of the memory plugin. + * + * @version 1.0 + * @date 2021/03/09 18:59 + **/ +public final class MemoryPlugHelper { + private MemoryPlugHelper() { + } + + /** + * Grpc request when requesting process information. + * + * @return MemoryPluginConfig.MemoryConfig + */ + public static MemoryPluginConfig.MemoryConfig createProcessRequest() { + MemoryPluginConfig.MemoryConfig.Builder builder = MemoryPluginConfig.MemoryConfig.newBuilder(); + builder.setReportProcessTree(true); + return builder.build(); + } + + /** + * The configuration object when requesting single-process memory data needs to be + * converted into binary and passed into createSessionRequest or startSessionRequest + * + * @param pid pid + * @param reportProcessTree reportProcessTree + * @param reportProcessMemInfo reportProcessMemInfo + * @param reportAppMemInfo reportAppMemInfo + * @param reportAppMemByDumpsys reportAppMemByDumpsys + * @return MemoryPluginConfig.MemoryConfig + */ + public static MemoryPluginConfig.MemoryConfig createMemRequest(int pid, boolean reportProcessTree, + boolean reportProcessMemInfo, boolean reportAppMemInfo, boolean reportAppMemByDumpsys) { + MemoryPluginConfig.MemoryConfig.Builder builder = MemoryPluginConfig.MemoryConfig.newBuilder(); + if (pid > 0) { + builder.addPid(pid); + } + builder.setReportProcessTree(reportProcessTree); + builder.setReportProcessMemInfo(reportProcessMemInfo); + builder.setReportAppMemInfo(reportAppMemInfo); + builder.setReportAppMemByDumpsys(reportAppMemByDumpsys); + return builder.build(); + } + + /** + * The configuration object when requesting multi-process memory data needs to be converted + * into binary and passed into createSessionRequest or startSessionRequest + * + * @param pids pids + * @return MemoryPluginConfig.MemoryConfig + */ + public static MemoryPluginConfig.MemoryConfig createMemRequest(List pids) { + MemoryPluginConfig.MemoryConfig.Builder builder = MemoryPluginConfig.MemoryConfig.newBuilder(); + builder.addAllPid(pids); + return builder.build(); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/grpc/ProfilerClient.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/grpc/ProfilerClient.java new file mode 100644 index 000000000..467fcc0b5 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/grpc/ProfilerClient.java @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.transport.grpc; + +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.grpc.StatusRuntimeException; +import ohos.devtools.datasources.transport.grpc.service.IProfilerServiceGrpc; +import ohos.devtools.datasources.transport.grpc.service.ProfilerServiceTypes; +import ohos.devtools.views.common.LayoutConstants; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.Iterator; +import java.util.concurrent.TimeUnit; + +/** + * 提供设备侧grpc接口封装 + * + * @version 1.0 + * @date 2021/02/01 19:23 + **/ +public class ProfilerClient { + private static final Logger LOGGER = LogManager.getLogger(ProfilerClient.class); + + private ManagedChannel channel; + + private boolean isUsed; + + private String host; + + private int port; + + private IProfilerServiceGrpc.IProfilerServiceBlockingStub profilerBlockInClient; + + /** + * ProfilerClient + * + * @param host localhost + * @param port port number + */ + public ProfilerClient(String host, int port) { + this(host, port, null); + } + + /** + * ProfilerClient + * + * @param host localhost + * @param port port number + * @param channel channel + */ + public ProfilerClient(String host, int port, ManagedChannel channel) { + this.host = host; + this.port = port; + if (channel == null) { + this.channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext().build(); + } else { + this.channel = channel; + } + profilerBlockInClient = IProfilerServiceGrpc.newBlockingStub(this.channel); + } + + /** + * get profiler client + * + * @return IProfilerServiceGrpc.IProfilerServiceBlockingStub + */ + public IProfilerServiceGrpc.IProfilerServiceBlockingStub getProfilerClient() { + return profilerBlockInClient; + } + + /** + * 获取支持的插件列表 + * + * @param getCapabilitiesRequest getCapabilitiesRequest + * @return ProfilerServiceTypes.GetCapabilitiesResponse + * @throws StatusRuntimeException StatusRuntimeException + */ + public ProfilerServiceTypes.GetCapabilitiesResponse getCapabilities( + ProfilerServiceTypes.GetCapabilitiesRequest getCapabilitiesRequest) throws StatusRuntimeException { + ProfilerServiceTypes.GetCapabilitiesResponse res = + profilerBlockInClient.withDeadlineAfter(LayoutConstants.FIVE, TimeUnit.SECONDS) + .getCapabilities(getCapabilitiesRequest); + return res; + } + + /** + * createSession + * + * @param createSessionRequest createSessionRequest + * @return ProfilerServiceTypes.CreateSessionResponse + * @throws StatusRuntimeException GrpcException + */ + public ProfilerServiceTypes.CreateSessionResponse createSession( + ProfilerServiceTypes.CreateSessionRequest createSessionRequest) throws StatusRuntimeException { + ProfilerServiceTypes.CreateSessionResponse response = + profilerBlockInClient.withDeadlineAfter(LayoutConstants.FIVE, TimeUnit.SECONDS) + .createSession(createSessionRequest); + return response; + } + + /** + * startSession + * + * @param startSessionRequest startSessionRequest + * @return ProfilerServiceTypes.StartSessionResponse + * @throws StatusRuntimeException StatusRuntimeException + */ + public ProfilerServiceTypes.StartSessionResponse startSession( + ProfilerServiceTypes.StartSessionRequest startSessionRequest) throws StatusRuntimeException { + ProfilerServiceTypes.StartSessionResponse response = + profilerBlockInClient.withDeadlineAfter(LayoutConstants.THREE, TimeUnit.SECONDS) + .startSession(startSessionRequest); + return response; + } + + /** + * 抓取数据 + * + * @param fetchDataRequest fetchDataRequest + * @return Iterator + * @throws StatusRuntimeException StatusRuntimeException + */ + public Iterator fetchData( + ProfilerServiceTypes.FetchDataRequest fetchDataRequest) throws StatusRuntimeException { + Iterator response = profilerBlockInClient.fetchData(fetchDataRequest); + return response; + } + + /** + * stop Session + * + * @param stopSessionRequest stopSessionRequest + * @return ProfilerServiceTypes.StopSessionResponse + * @throws StatusRuntimeException StatusRuntimeException + */ + public ProfilerServiceTypes.StopSessionResponse stopSession( + ProfilerServiceTypes.StopSessionRequest stopSessionRequest) throws StatusRuntimeException { + ProfilerServiceTypes.StopSessionResponse response = + profilerBlockInClient.withDeadlineAfter(1, TimeUnit.SECONDS).stopSession(stopSessionRequest); + return response; + } + + /** + * destroy Session + * + * @param destroyRequest destroyRequest + * @return ProfilerServiceTypes.DestroySessionResponse + * @throws StatusRuntimeException StatusRuntimeException + */ + public ProfilerServiceTypes.DestroySessionResponse destroySession( + ProfilerServiceTypes.DestroySessionRequest destroyRequest) throws StatusRuntimeException { + ProfilerServiceTypes.DestroySessionResponse res = + profilerBlockInClient.withDeadlineAfter(LayoutConstants.THREE_HUNDRED, TimeUnit.MILLISECONDS) + .destroySession(destroyRequest); + return res; + } + + /** + * 关闭方法 + */ + public void shutdown() { + try { + channel.shutdown().awaitTermination(1, TimeUnit.SECONDS); + } catch (InterruptedException exception) { + LOGGER.error(exception.getMessage()); + } + } + + public void setUsed(boolean used) { + isUsed = used; + } + + public boolean isUsed() { + return isUsed; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/grpc/ProfilerServiceHelper.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/grpc/ProfilerServiceHelper.java new file mode 100644 index 000000000..6ba3d7fbc --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/grpc/ProfilerServiceHelper.java @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.transport.grpc; + +import com.google.protobuf.ByteString; +import ohos.devtools.datasources.transport.grpc.service.CommonTypes; +import ohos.devtools.datasources.transport.grpc.service.ProfilerServiceTypes; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.List; + +/** + * Create the request object of the profiler Client + * + * @version 1.0 + * @date 2021/02/25 17:25 + **/ +public final class ProfilerServiceHelper { + private static final Logger LOGGER = LogManager.getLogger(ProfilerServiceHelper.class); + + private ProfilerServiceHelper() { + } + + /** + * Create a Create Session Request object for grpc request. + * + * @param requestId requestId + * @param sessionConfig Session config + * @param pluginConfigs Plugin configs + * @return ProfilerServiceTypes.CreateSessionRequest + */ + public static ProfilerServiceTypes.CreateSessionRequest createSessionRequest(int requestId, + ProfilerServiceTypes.ProfilerSessionConfig sessionConfig, + List pluginConfigs) { + ProfilerServiceTypes.CreateSessionRequest.Builder createBuilder = + ProfilerServiceTypes.CreateSessionRequest.newBuilder(); + createBuilder.setRequestId(requestId); + if (sessionConfig != null) { + createBuilder.setSessionConfig(sessionConfig); + } + if (pluginConfigs != null) { + for (CommonTypes.ProfilerPluginConfig profilerPluginConfig : pluginConfigs) { + createBuilder.addPluginConfigs(profilerPluginConfig); + } + } + return createBuilder.build(); + } + + /** + * Create a start Session Request object for grpc request. + * + * @param requestId requestId + * @param sessionId sessionId + * @param pluginConfigs Plugin configs + * @return ProfilerServiceTypes.StartSessionRequest + */ + public static ProfilerServiceTypes.StartSessionRequest startSessionRequest(int requestId, int sessionId, + List pluginConfigs) { + ProfilerServiceTypes.StartSessionRequest.Builder startBuilder = + ProfilerServiceTypes.StartSessionRequest.newBuilder(); + startBuilder.setRequestId(requestId); + startBuilder.setSessionId(sessionId); + if (pluginConfigs != null) { + pluginConfigs.forEach(profilerPluginConfig -> { + startBuilder.addUpdateConfigs(profilerPluginConfig); + }); + } + return startBuilder.build(); + } + + /** + * Create a fetch Data Request object for grpc request + * + * @param requestId requestId + * @param sessionId sessionId + * @param addtionData addtionData not used temporarily, you can pass null + * @return ProfilerServiceTypes.FetchDataRequest + */ + public static ProfilerServiceTypes.FetchDataRequest fetchDataRequest(int requestId, int sessionId, + ByteString addtionData) { + ProfilerServiceTypes.FetchDataRequest.Builder builder = ProfilerServiceTypes.FetchDataRequest.newBuilder(); + builder.setRequestId(requestId); + builder.setSessionId(sessionId); + if (addtionData != null) { + builder.setAddtionData(addtionData); + } + return builder.build(); + } + + /** + * Create a stop Session Request object for grpc request. + * + * @param requestId requestId + * @param sessionId sessionId + * @return ProfilerServiceTypes.StopSessionRequest + */ + public static ProfilerServiceTypes.StopSessionRequest stopSessionRequest(int requestId, int sessionId) { + ProfilerServiceTypes.StopSessionRequest.Builder builder = ProfilerServiceTypes.StopSessionRequest.newBuilder(); + builder.setRequestId(requestId); + builder.setSessionId(sessionId); + return builder.build(); + } + + /** + * Create a destroy Session Request object for grpc request + * + * @param requestId requestId + * @param sessionId sessionId + * @return ProfilerServiceTypes.DestroySessionRequest + */ + public static ProfilerServiceTypes.DestroySessionRequest destroySessionRequest(int requestId, int sessionId) { + ProfilerServiceTypes.DestroySessionRequest.Builder builder = + ProfilerServiceTypes.DestroySessionRequest.newBuilder(); + builder.setRequestId(requestId); + builder.setSessionId(sessionId); + return builder.build(); + } + + /** + * Construct Session Config object + * + * @param online online Whether it is online mode, true online false offline + * @param resultFile resultFile + * @param pages pages + * @param value value + * @return ProfilerServiceTypes.ProfilerSessionConfig + */ + public static ProfilerServiceTypes.ProfilerSessionConfig profilerSessionConfig(boolean online, String resultFile, + int pages, ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.Policy value) { + ProfilerServiceTypes.ProfilerSessionConfig.Builder builder = + ProfilerServiceTypes.ProfilerSessionConfig.newBuilder(); + if (online) { + builder.setSessionMode(ProfilerServiceTypes.ProfilerSessionConfig.Mode.ONLINE); + } else { + builder.setSessionMode(ProfilerServiceTypes.ProfilerSessionConfig.Mode.OFFLINE); + builder.setResultFile(resultFile); + } + ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.Builder build = + ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.newBuilder(); + if (value != null && value.getNumber() > 0) { + build.setPolicy(value); + } + if (pages > 0) { + build.setPages(pages); + } + return builder.addBuffers(build.build()).build(); + } + + /** + * Construct profiler Plugin Config object + * + * @param name name + * @param pluginSha256 pluginSha256 + * @param sampleInterval sampleInterval + * @param confData confData Objects serialized by each plug-in + * @return CommonTypes.ProfilerPluginConfig + */ + public static CommonTypes.ProfilerPluginConfig profilerPluginConfig(String name, String pluginSha256, + int sampleInterval, ByteString confData) { + CommonTypes.ProfilerPluginConfig.Builder builder = CommonTypes.ProfilerPluginConfig.newBuilder(); + if (StringUtils.isNotBlank(name)) { + builder.setName(name); + } + if (StringUtils.isNotBlank(pluginSha256)) { + builder.setPluginSha256(pluginSha256); + } + if (sampleInterval > 0) { + builder.setSampleInterval(sampleInterval); + } + if (confData != null) { + builder.setConfigData(confData); + } + return builder.build(); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/hdc/HdcCommandEnum.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/hdc/HdcCommandEnum.java new file mode 100644 index 000000000..41e20f3d3 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/hdc/HdcCommandEnum.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.transport.hdc; + +/** + * hdc command type + * + * @version 1.0 + * @date 2021/02/01 10:47 + **/ +public enum HdcCommandEnum { + /** + * hdc push command + */ + HDC_FILE_SEND_STR("file send"), + + /** + * Get device serial number command + */ + HDC_FPORT_STR("fport"), + + /** + * Get device serial number command + */ + HDC_LIST_TARGETS_STR("hdc list targets -v"), + + /** + * Get device device version + */ + HDC_GET_TYPE("hdc -t %s shell getprop ro.product.cpu.abi"), + + /** + * hdc shell command + */ + HDC_SHELL_STR("shell"), + + /** + * hdc command + */ + HDC_STR("hdc"), + + /** + * hdc command + */ + HDC_RUN_OHOS("hdc -t %s shell cd /data/local/tmp && chmod +x ohosprofiler &&sh ohosprofiler unzipStart"), + + /** + * hdc command + */ + HDC_RUN_V7_OHOS("hdc -t %s shell cd /data/local/tmp && chmod +x ohosprofiler &&sh ohosprofiler unzipStartV7"), + + /** + * hdc command + */ + HDC_START_PROFILERD("hdc -t %s shell cd /data/local/tmp && chmod +x ohosprofiler && sh ohosprofiler restart"), + + /** + * hdc command + */ + HDC_STARTV7_PROFILERD("hdc -t %s shell cd /data/local/tmp && chmod +x ohosprofiler && sh ohosprofiler restart"), + + /** + * hdc command + */ + HDC_START_JAVAHEAP("hdc -t %s shell cd /data/local/tmp && chmod +x ohosprofiler && sh ohosprofiler startHeap %s"), + + /** + * hdc command + */ + HDC_CHECK_SERVER("hdc -t %s shell cd /data/local/tmp && chmod +x ohosprofiler && sh ohosprofiler check_server"), + + /** + * hdc command + */ + HDC_PUSH_OHOS_SHELL("hdc -t %s file send %s /data/local/tmp/ohosprofiler"), + + /** + * hdc command + */ + HDC_PUSH_OHOS_ARMV7("hdc -t %s file send %s /data/local/tmp/%s"), + + /** + * hdc command + */ + HDC_FOR_PORT("hdc -t %s fport tcp:%s tcp:50051"), + /** + * hdc push + */ + HDC_PUSH_CMD("hdc -t %s file send %s /data/local/tmp/devtool"); + + private String hdcCommand; + + HdcCommandEnum(String hdcCommand) { + this.hdcCommand = hdcCommand; + } + + public String getHdcCommand() { + return hdcCommand; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/hdc/HdcWrapper.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/hdc/HdcWrapper.java new file mode 100644 index 000000000..a2a99c873 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/transport/hdc/HdcWrapper.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.transport.hdc; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.concurrent.TimeUnit; + +/** + * Interact with commands on the device side + * + * @version 1.0 + * @date 2021/02/01 10:47 + **/ +public class HdcWrapper { + // Log + private static final Logger LOGGER = LogManager.getLogger(HdcWrapper.class); + + /** + * Singleton Hdc command parsing object + */ + private static volatile HdcWrapper hdcWrapper; + + /** + * Get an instance + * + * @return HdcWrapper + */ + public static HdcWrapper getInstance() { + if (hdcWrapper == null) { + synchronized (HdcWrapper.class) { + if (hdcWrapper == null) { + hdcWrapper = new HdcWrapper(); + } + } + } + return hdcWrapper; + } + + private HdcWrapper() { + } + + /** + * Get hdc string result + * + * @param hdcCmd hdc command + * @return String + */ + public String getHdcStringResult(String hdcCmd) { + String line = ""; + StringBuilder cmdStrResult = new StringBuilder(); + try { + // Excuting an order + Process process = Runtime.getRuntime().exec(hdcCmd); + // Error command result output stream + // Get command result output stream + try (InputStream inputStream = process.getInputStream(); + InputStream errorStream = process.getErrorStream(); + BufferedReader brInputStream = new BufferedReader( + new InputStreamReader(inputStream, Charset.forName("gbk"))); + BufferedReader brErrorStream = new BufferedReader(new InputStreamReader(errorStream))) { + while ((line = brInputStream.readLine()) != null || (line = brErrorStream.readLine()) != null) { + cmdStrResult.append(line).append(System.getProperty("line.separator")); + } + } catch (IOException ioException) { + LOGGER.error("ioException error: " + ioException.getMessage()); + } + } catch (IOException ioException) { + LOGGER.error("ioException error: " + ioException.getMessage()); + } + return cmdStrResult.toString(); + } + + /** + * getHdcStringArrayResult + * + * @param hdcCmd hdc command + * @return String + */ + public String getHdcStringArrayResult(String[] hdcCmd) { + String line = ""; + StringBuilder cmdStrResult = new StringBuilder(); + try { + // 执行命令 + Process process = Runtime.getRuntime().exec(hdcCmd); + // 错误命令结果输出流 + // 获取命令结果输出流 + try (InputStream inputStream = process.getInputStream(); + InputStream errorStream = process.getErrorStream(); + BufferedReader brInputStream = new BufferedReader( + new InputStreamReader(inputStream, Charset.forName("gbk"))); + BufferedReader brErrorStream = new BufferedReader(new InputStreamReader(errorStream))) { + while ((line = brInputStream.readLine()) != null || (line = brErrorStream.readLine()) != null) { + cmdStrResult.append(line).append(System.getProperty("line.separator")); + } + } catch (IOException ioException) { + LOGGER.error("ioException error: " + ioException.getMessage()); + } + } catch (IOException ioException) { + LOGGER.error("ioException error: " + ioException.getMessage()); + } + return cmdStrResult.toString(); + } + + /** + * execCmdBy + * + * @param hdcCmd hdc command + * @return String + */ + public String execCmdBy(String hdcCmd) { + // Excuting an order + Process process = null; + String line = ""; + StringBuilder cmdStrResult = new StringBuilder(); + try { + process = Runtime.getRuntime().exec(hdcCmd); + // Get command and error command result output stream + try (InputStream inputStream = process.getInputStream(); + InputStream errorStream = process.getErrorStream(); + BufferedReader brInputStream = new BufferedReader( + new InputStreamReader(inputStream, Charset.forName("gbk"))); + BufferedReader brErrorStream = new BufferedReader(new InputStreamReader(errorStream))) { + while ((line = brInputStream.readLine()) != null || (line = brErrorStream.readLine()) != null) { + if ("StartDaemonSuccess".equals(line)) { + break; + } + } + LOGGER.info("cmd result ok{}", cmdStrResult); + } catch (IOException ioException) { + LOGGER.error("ioException error: " + ioException.getMessage()); + } + } catch (IOException ioException) { + LOGGER.error("ioException error: " + ioException.getMessage()); + } + return cmdStrResult.toString(); + } + + /** + * execCmdBy + * + * @param hdcCmd hdc command + * @param timeout timeout + * @return String + */ + public String execCmdBy(String hdcCmd, long timeout) { + // Excuting an order + Process process = null; + String line = ""; + StringBuilder cmdStrResult = new StringBuilder(); + try { + process = Runtime.getRuntime().exec(hdcCmd); + process.waitFor(timeout, TimeUnit.MILLISECONDS); + // Get command and error command result output stream + try (InputStream inputStream = process.getInputStream(); + InputStream errorStream = process.getErrorStream(); + BufferedReader brInputStream = new BufferedReader( + new InputStreamReader(inputStream, Charset.forName("gbk"))); + BufferedReader brErrorStream = new BufferedReader(new InputStreamReader(errorStream))) { + LOGGER.info("cmd result ok {}", cmdStrResult); + } catch (IOException ioException) { + LOGGER.error("ioException error: " + ioException.getMessage()); + } + } catch (IOException | InterruptedException ioException) { + LOGGER.error("ioException error: " + ioException.getMessage()); + } + return cmdStrResult.toString(); + } + + /** + * getCliResult + * + * @param hdcStr hdc String + * @return ArrayList> + */ + public ArrayList> getCliResult(String hdcStr) { + // Each line of string read + String temp = ""; + ArrayList> result = new ArrayList<>(); + try { + Process process = Runtime.getRuntime().exec(hdcStr); + // Obtain the input stream through the process object to obtain the successful execution of the command + // Get the error flow through the process object to get the command error situation + try (InputStream inputStream = process.getInputStream(); + InputStream errorStream = process.getErrorStream(); + BufferedReader brInput = new BufferedReader(new InputStreamReader(inputStream)); + BufferedReader brError = new BufferedReader(new InputStreamReader(errorStream))) { + while ((temp = brInput.readLine()) != null || (temp = brError.readLine()) != null) { + temp = temp.trim(); + if (!"".equals(temp)) { + ArrayList list = new ArrayList<>(); + String[] newLine = temp.split(":"); + for (String str : newLine) { + String s = str.trim(); + if (!"".equals(s)) { + list.add(s); + } + } + result.add(list); + } + } + } catch (IOException ioException) { + LOGGER.error("ioException error: " + ioException.getMessage()); + } + } catch (IOException ioException) { + LOGGER.error("ioException error: " + ioException.getMessage()); + } + return result; + } + + /** + * Get result list + * + * @param hdcStr hdc String + * @return ArrayList> + */ + public ArrayList> getListResult(String hdcStr) { + // Each line of string read + String temp = ""; + ArrayList> devices = new ArrayList<>(); + // Number of rows read to return value + int lines = 0; + try { + Process process = Runtime.getRuntime().exec(hdcStr); + try (InputStream inputStream = process.getInputStream(); + BufferedReader brInput = new BufferedReader(new InputStreamReader(inputStream)); + InputStream errorStream = process.getErrorStream(); + BufferedReader brError = new BufferedReader(new InputStreamReader(errorStream))) { + while ((temp = brInput.readLine()) != null || (temp = brError.readLine()) != null) { + temp = temp.trim(); + if (lines > 0 && !"".equals(temp)) { + ArrayList list = new ArrayList<>(); + String[] newLine = temp.split(" "); + for (String str : newLine) { + String s = str.trim(); + if (!"".equals(s)) { + list.add(s); + } + } + devices.add(list); + } + lines++; + } + } catch (IOException ioException) { + LOGGER.error("ioException error: " + ioException.getMessage()); + } + } catch (IOException ioException) { + LOGGER.error("ioException error: " + ioException.getMessage()); + } + return devices; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/Constant.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/Constant.java new file mode 100644 index 000000000..7ee89c027 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/Constant.java @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common; + +/** + * @Description constant + * @Date 2021/3/4 15:58 + **/ +public class Constant { + /** + * Destination path + */ + public static final String DEST_PATH = "/data/local/tmp"; + + /** + * Devtools plug-in (V8) path + */ + public static final String DEVTOOLS_PLUGINS_V8_PATH = "devtools.tar"; + + /** + * Devtools plug-in (V7) path + */ + public static final String DEVTOOLS_PLUGINS_V7_PATH = "devtools.tar"; + + /** + * Unzip shell plug-in path + */ + public static final String UNZIP_SHELL_PLUGINS_PATH = "ohosprofiler"; + + /** + * File name + */ + public static final String FILE_NAME = "hiprofilerd"; + + /** + * Plug-in name + */ + public static final String HIPRO_FILER_NAME = "hiprofiler_cmd"; + + /** + * Plug-in name + */ + public static final String PLUGINS_NAME = "hiprofiler_plugins"; + + /** + * HIPRO filer command name + */ + public static final String HIPRO_FILER_CMDNAME = "hiprofiler_cmd -q"; + + /** + * HIPRO filer result: OK + */ + public static final String HIPRO_FILER_RESULT_OK = "OK"; + + /** + * Installation result: success + */ + public static final String INSTALL_SUCCESS = "Success"; + + /** + * Device state: online + */ + public static final String DEVICE_STAT_ONLINE = "device"; + + /** + * Device SATA state: pushed + */ + public static final String DEVICE_SATA_STAT_PUSHED = "pushed"; + + /** + * Device state: error + */ + public static final String DEVICE_STAT_ERROR = "error"; + + /** + * Device state: closed + */ + public static final String DEVICE_STAT_CLOSED = "closed"; + + /** + * Device state: not found + */ + public static final String DEVICE_STAT_NOT_FOUND = "not found"; + + /** + * Device state: FAIL + */ + public static final String DEVICE_STAT_FAIL = "FAIL"; + + /** + * Device state: offline + */ + public static final String DEVICE_STAT_OFFLINE = "offline"; + + /** + * Device state: unauthorized + */ + public static final String DEVICE_STST_UNAUTHORIZED = "unauthorized"; + + /** + * Device full type + */ + public static final String DEVICE_FULL_TYPE = "arm64-v8a"; + + /** + * Device lean type + */ + public static final String DEVICE_LEAN_TYPE = "arm64-v7a"; + + /** + * Memory plug-in file name source file path of plug-in push + */ + public static final String SOURCE_FILEPATH = "src/main/resources/plugins/"; + + /** + * Cpu plug-in file name + */ + public static final String CPU_PLUG_NAME = "Cpu"; + + /** + * Gpu plug-in file name + */ + public static final String GPU_PLUG_NAME = "Gpu"; + + /** + * Process plug in file name + */ + public static final String PROCESS_PLUG_NAME = "Process"; + + /** + * Target file path of plug-in push + */ + public static final String TARGET_PLUG_PATH = "/data/local/tmp/"; + + /** + * File suffix pushed by plug-in + */ + public static final String FILE_SUFFIX = ".so"; + + /** + * default sampling interval + */ + public static final int SAMPLE_INTERVAL_DEFAULT = 1000; + + /** + * Radix for conversion from BigInteger to string + */ + public static final int RADIX = 16; + + /** + * End side return to normal flag + */ + public static final int NORMAL_STATUS = 0; + + /** + * File importing scene (1: real-time) + */ + public static final int REALTIME_SCENE = 1; + + /** + * File importing scene (2: real-time) + */ + public static final int FILE_IMPORT_SCENE = 2; + + /** + * size + */ + public static final int MB = 1024; + + /** + * Abnormal state + */ + public static final Long ABNORMAL = -1L; + + /** + * Memomy plug-in + */ + public static final String MEMORY_PLUG = "memory-plugin"; + + /** + * JVMTI agent plug-in + */ + public static final String JVMTI_AGENT_PLUG = "jvmtiagent"; + + /** + * memory plug + */ + public static final String MEMORY_PLUGS_NAME = "/data/local/tmp/libmemdataplugin.z.so"; + + /** + * memory plug name + */ + public static final String MEMORY_PLUGS = "libmemdataplugin"; + + private Constant() { + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/GrpcException.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/GrpcException.java new file mode 100644 index 000000000..783a67d8d --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/GrpcException.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common; + +/** + * grpc Custom exception class + * + * @version 1.0 + * @date 2021/03/15 19:41 + **/ +public class GrpcException extends Exception { + /** + * GrpcException + */ + public GrpcException() { + super(); + } + + /** + * GrpcException + * + * @param message Grpc message + */ + public GrpcException(String message) { + super(message); + } + + /** + * GrpcException + * + * @param message Grpc message + * @param cause Throwable cause + */ + public GrpcException(String message, Throwable cause) { + super(message, cause); + } + + /** + * GrpcException + * + * @param cause Throwable cause + */ + public GrpcException(Throwable cause) { + super(cause); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/BeanUtil.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/BeanUtil.java new file mode 100644 index 000000000..edf40beda --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/BeanUtil.java @@ -0,0 +1,294 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common.util; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.google.protobuf.CodedOutputStream; + +import ohos.devtools.datasources.transport.grpc.service.BytracePluginConfigOuterClass; +import ohos.devtools.datasources.transport.grpc.service.TracePluginConfigOuterClass; +import ohos.devtools.views.common.LayoutConstants; + +/** + * Bean object utilities class. + * + * @version 1.0 + * @date 2021/02/03 14:59 + **/ +public class BeanUtil { + private static final Logger LOGGER = LogManager.getLogger(BeanUtil.class); + + /** + * Serializes object data. + * + * @param + * @param data Indicates the data to be deserialized. + * @return byte[] + */ + public static byte[] serialize(T data) { + byte[] dataArray = null; + // 1. Create an OutputStream object. + // 2. Create an OutputStream wrapper object named ObjectOutputStream, + // with the object wwritten to the OutputStream. + try (ByteArrayOutputStream outPutStream = new ByteArrayOutputStream(); + ObjectOutputStream objectOutputStream = new ObjectOutputStream(outPutStream)) { + // 3. Write the object to OutputStream. + objectOutputStream.writeObject(data); + // 4. Convert OutputStream to a byte array. + dataArray = outPutStream.toByteArray(); + } catch (IOException exception) { + LOGGER.error("exception error {}", exception.getMessage()); + } + return dataArray; + } + + /** + * Serialize data by code output stream. + * + * @param config Indicates the configuration data. + * @return Returns a byte array. + */ + public static byte[] serializeByCodedOutPutStream(TracePluginConfigOuterClass.TracePluginConfig config) { + byte[] dataArray = null; + try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { + CodedOutputStream codedOutputStream = CodedOutputStream.newInstance(outputStream); + config.writeTo(codedOutputStream); + codedOutputStream.flush(); + dataArray = outputStream.toByteArray(); + } catch (IOException exception) { + LOGGER.error("exception error {}", exception.getMessage()); + } + return dataArray; + } + + /** + * Serialize by code output stream. + * + * @param config Indicates the configuration data. + * @return Returns a byte array. + */ + public static byte[] serializeByCodedOutPutStream(BytracePluginConfigOuterClass.BytracePluginConfig config) { + byte[] dataArray = null; + com.google.protobuf.CodedOutputStream codedOutputStream = null; + try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { + codedOutputStream = CodedOutputStream.newInstance(outputStream, config.getSerializedSize()); + config.writeTo(codedOutputStream); + codedOutputStream.flush(); + dataArray = outputStream.toByteArray(); + } catch (IOException exception) { + LOGGER.error("exception error {}", exception.getMessage()); + } + return dataArray; + } + + /** + * Deserializes object data. + * + * @param data Indicates the data to be deserialized. + * @return Object Returns the object value. + */ + public static Object deserialize(byte[] data) { + Object object = null; + try (ByteArrayInputStream inputStream = new ByteArrayInputStream(data); + ObjectInputStream objectInputStream = new ObjectInputStream(inputStream)) { + object = objectInputStream.readObject(); + } catch (IOException | ClassNotFoundException exception) { + LOGGER.error("exception error {}", exception.getMessage()); + } + return object; + } + + /** + * Get Fields information. + * + * @param + * @param obj Indicates the object. + * @return List Map + */ + public static List getFieldsInfo(T obj) { + Field[] fields = obj.getClass().getDeclaredFields(); + List list = new ArrayList(); + Map infoMap = null; + for (int index = 0; index < fields.length; index++) { + infoMap = new HashMap(CommonUtil.collectionSize(LayoutConstants.SIXTEEN)); + infoMap.put("type", fields[index].getType().toString()); + Optional fieldName = getFieldValueByName(fields[index].getName(), obj); + if (fieldName.isPresent()) { + infoMap.put(fields[index].getName(), fieldName.get()); + } + list.add(infoMap); + } + return list; + } + + /** + * Returns a list of filed values. + * + * @param + * @param obj Indicates the object. + * @return List Map + */ + public static List> getFields(T obj) { + Field[] fields = obj.getClass().getDeclaredFields(); + List list = new ArrayList(); + Map infoMap = null; + for (int index = 0; index < fields.length; index++) { + infoMap = new HashMap(CommonUtil.collectionSize(LayoutConstants.SIXTEEN)); + infoMap.put("type", fields[index].getType().toString()); + infoMap.put("name", fields[index].getName()); + Optional fieldName = getFieldValueByName(fields[index].getName(), obj); + if (fieldName.isPresent()) { + infoMap.put("value", fieldName.get()); + } + list.add(infoMap); + } + return list; + } + + /** + * Gets Fields information. + * + * @param obj Indicates the object. + * @param + * @return Returns a list of fields. + */ + public static Map getFiledsInfos(T obj) { + Field[] fields = obj.getClass().getDeclaredFields(); + Map infoMap = new HashMap(CommonUtil.collectionSize(LayoutConstants.SIXTEEN)); + for (int index = 0; index < fields.length; index++) { + Optional fieldName = getFieldValueByName(fields[index].getName(), obj); + if (fieldName.isPresent()) { + infoMap.put(fields[index].getName(), fieldName.get()); + } + } + return infoMap; + } + + /** + * Gets attribute values by attribute name. + * + * @param obj Indicates the object. + * @param + * @return Returns a list of attribute names. + */ + public static List getObjectAttributeNames(T obj) { + Field[] fields = obj.getClass().getDeclaredFields(); + List list = new ArrayList(); + for (int index = 0; index < fields.length; index++) { + list.add(fields[index].getName()); + } + return list; + } + + /** + * Get the attribute value by attribute name. + * + * @param + * @param fieldName fieldName + * @param object Indicates the object. + * @return Object Returns the object value. + */ + private static Optional getFieldValueByName(String fieldName, T object) { + String firstLetter = fieldName.substring(0, 1).toUpperCase(Locale.ENGLISH); + String getter = "get" + firstLetter + fieldName.substring(1); + if ("getSerialVersionUID".equals(getter)) { + return Optional.empty(); + } + Method method = null; + Object value = null; + try { + method = object.getClass().getMethod(getter, new Class[] {}); + value = method.invoke(object, new Object[] {}); + } catch (InvocationTargetException | IllegalAccessException | NoSuchMethodException exception) { + LOGGER.error(exception.getMessage()); + } + + return Optional.of(value); + } + + /** + * Gets the value of a given object. + * + * @param object object + * @param + * @return List + */ + public static List getObjectValue(T object) { + if (object != null && object instanceof Serializable) { + Class objectClass = object.getClass(); + Field[] declaredFields = objectClass.getDeclaredFields(); + ArrayList list = new ArrayList<>(); + for (Field field : declaredFields) { + Type type = field.getGenericType(); + String colName = field.getName(); + if ("class java.lang.String".equals(type.toString())) { + list.add(colName + " varchar(100)"); + } + if ("class java.lang.Integer".equals(type.toString()) || "int".equals(type.toString())) { + list.add(colName + " int"); + } + if ("class java.lang.Long".equals(type.toString()) || "long".equals(type.toString())) { + list.add(colName + " long"); + } + if ("class java.lang.Double".equals(type.toString()) || "double".equals(type.toString())) { + list.add(colName + " double"); + } + if ("class java.lang.Boolean".equals(type.toString()) || "boolean".equals(type.toString())) { + list.add(colName + " boolean"); + } + if ("class java.util.Date".equals(type.toString())) { + list.add(colName + " date"); + } + } + return list; + } + return new ArrayList<>(); + } + + /** + * Get the object name. + * + * @param object Indicates the object. + * @param + * @return String + */ + public static String getObjectName(T object) { + if (object != null) { + return object.getClass().getSimpleName(); + } + return ""; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/CharsetUtil.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/CharsetUtil.java new file mode 100644 index 000000000..07d4081a5 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/CharsetUtil.java @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common.util; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.charset.UnsupportedCharsetException; + +import static org.apache.commons.lang3.StringUtils.isBlank; + +/** + * @Description String utilities class + * @Date 2021/2/7 15:01 + **/ +public class CharsetUtil { + private static final Logger LOGGER = LogManager.getLogger(CharsetUtil.class); + + private CharsetUtil() { + } + + /** + * GBK + */ + public static final String GBK = "GBK"; + + /** + * UTF-8 + */ + public static final String UTF_8 = "UTF-8"; + + /** + * ISO-8859-1 + */ + public static final String ISO_8859_1 = "ISO-8859-1"; + + /** + * ISO-8859-1 + */ + public static final Charset CHARSET_ISO_8859_1 = StandardCharsets.ISO_8859_1; + + /** + * UTF-8 + */ + public static final Charset CHARSET_UTF_8 = StandardCharsets.UTF_8; + + /** + * GBK + */ + public static final Charset CHARSET_GBK; + + static { + Charset gbkCharset = null; + try { + gbkCharset = Charset.forName(GBK); + } catch (UnsupportedCharsetException throwAbles) { + LOGGER.info("Get GBKCharset Error {}", throwAbles.getMessage()); + } + CHARSET_GBK = gbkCharset; + } + + /** + * Parses a Charset object. + * + * @param charsetName Charset to be parsed. The default Charset will be returned if it is left empty. + * @return Parsed Charset if parsing is successful; default Charset if parsing fails. + */ + public static Charset parse(String charsetName) { + return parse(charsetName, Charset.defaultCharset()); + } + + /** + * Parses a Charset object. + * + * @param charsetName Indicates the Charset to be used if the parsing fails. + * @param defaultCharset 解析失败使用的默认编码 + * @return Returns the parsed Charset if the parsing is successful; returns the default Charset otherwise. + */ + public static Charset parse(String charsetName, Charset defaultCharset) { + if (isBlank(charsetName)) { + return defaultCharset; + } + + Charset result; + try { + result = Charset.forName(charsetName); + } catch (UnsupportedCharsetException exception) { + result = defaultCharset; + } + + return result; + } + + /** + * Convert Charset of a given string. + * + * @param source Sting to be converted. + * @param srcCharset Source Charset, which is GBK by default. + * @param destCharset Target Charset, which is UTF-8 by default. + * @return New Charset after the conversion. + */ + public static String convert(String source, String srcCharset, String destCharset) { + return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); + } + + /** + * Convert Charset of a given string. + * + * @param source Sting to be converted. + * @param srcCharset Source Charset, which is GBK by default. + * @param destCharset Target Charset, which is UTF-8 by default. + * @return New Charset after the conversion. + */ + public static String convert(String source, Charset srcCharset, Charset destCharset) { + Charset srcSet = srcCharset; + if (srcSet == null) { + srcSet = CHARSET_GBK; + } + Charset desSet = destCharset; + if (desSet == null) { + desSet = StandardCharsets.UTF_8; + } + + if (isBlank(source) || srcSet.equals(desSet)) { + return source; + } + return new String(source.getBytes(srcSet), desSet); + } + + /** + * Default Charset name + * + * @return String + */ + public static String defaultCharsetName() { + return defaultCharset().name(); + } + + /** + * Default Charset + * + * @return Charset + */ + public static Charset defaultCharset() { + return Charset.defaultCharset(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/CloseResourceUtil.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/CloseResourceUtil.java new file mode 100644 index 000000000..5a84edea1 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/CloseResourceUtil.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common.util; + +import org.apache.logging.log4j.Logger; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; + +/** + * Close Resource Util + * + * @version 1.0 + * @date 2021/04/26 17:21 + **/ +public class CloseResourceUtil { + /** + * Close Resource + * + * @param logger Logger + * @param conn Connection + * @param ps PreparedStatement + * @param statement Statement + */ + public static void closeResource(Logger logger, Connection conn, PreparedStatement ps, Statement statement) { + if (ps != null) { + try { + ps.close(); + } catch (SQLException exception) { + logger.error("SQLException error: " + exception.getMessage()); + } + } + + if (conn != null) { + try { + conn.close(); + } catch (SQLException exception) { + logger.error("SQLException error: " + exception.getMessage()); + } + } + + if (statement != null) { + try { + statement.close(); + } catch (SQLException exception) { + logger.error("SQLException error: " + exception.getMessage()); + } + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/CommonUtil.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/CommonUtil.java new file mode 100644 index 000000000..829c27410 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/CommonUtil.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common.util; + +import ohos.devtools.views.common.LayoutConstants; + +/** + * 用于单个功能工具方法的提取保存。 + * + * @version 1.0 + * @date 2021/1/23 11:13 + **/ +public class CommonUtil { + private CommonUtil() { + } + + private static volatile Integer requestId = 1; + + /** + * Sets the intial collection size. + * + * @param size size + * @return Returns the initial collection size. + */ + public static int collectionSize(int size) { + return (size <= 0) ? LayoutConstants.SIXTEEN : (int) (size / LayoutConstants.LOAD_FACTOR + 1.0F); + } + + /** + * Gets the request ID. + * + * @return Returns the initial collection size. + */ + public static int getRequestId() { + if (requestId == Integer.MAX_VALUE) { + requestId = 1; + } + return requestId++; + } + + /** + * Generates a session name. + * + * @param deviceName Indicates the device name. + * @param pid Indicates the process ID. + * @return String + */ + public static String generateSessionName(String deviceName, int pid) { + return deviceName + pid; + } + + /** + * Gets the ID of a local session. + * + * @return Long + */ + public static Long getLocalSessionId() { + return System.currentTimeMillis(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/DateTimeUtil.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/DateTimeUtil.java new file mode 100644 index 000000000..f3d88119a --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/DateTimeUtil.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common.util; + +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; + +/** + * @Description Date and time utilities + * @Date 2021/2/7 15:00 + **/ +public final class DateTimeUtil { + private DateTimeUtil() { + } + + /** + * Format: yyyy-MM-dd HH:mm:ss + */ + public static final String COMMON_PATTERN = "yyyy-MM-dd HH:mm:ss"; + + /** + * Format: HH:mm + */ + public static final String HOUR_MINUTES_PATTERN = "HH:mm"; + + /** + * Format: HH:mm:ss + */ + public static final String HOUR_MINUTES_SECONDS_PATTERN = "HH:mm:ss"; + + private static final DateTimeFormatter COMMON_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + + private static final ZoneOffset DEFAULT_ZONE_OFFSET = ZoneOffset.of("+8"); + + /** + * Convert the date to a string. + * + * @param dateTime Indicates the date and time to be converted. + * @return Returns a string converted from the date and time. + */ + public static String dateToString(LocalDateTime dateTime) { + assert dateTime != null; + return COMMON_FORMATTER.format(dateTime); + } + + /** + * Converts a string to date and time. + * + * @param dateStr Indicates the string to be converted to date and time. + * @return Returns the date and time converted from the given string. + */ + public static LocalDateTime stringToDate(String dateStr) { + assert dateStr != null; + return LocalDateTime.parse(dateStr, COMMON_FORMATTER); + } + + /** + * Gets the current date and time. + * + * @return Returns the curernt date and time. + */ + public static LocalDateTime getNowTime() { + return LocalDateTime.now(); + } + + /** + * Converts the date and time to a string. + * + * @param dateTime Indicates the date and time to be converted. + * @param formatter Indicates the formatter used for formatting. + * @return Returns the date and time converted from the given string. + */ + public static String dateToString(LocalDateTime dateTime, DateTimeFormatter formatter) { + assert dateTime != null; + return formatter.format(dateTime); + } + + /** + * Converts a string to date and time. + * + * @param dateStr Indicates the string to be converted to date and time. + * @param formatter Indicates the formatter used for formatting. + * @return Returns the date and time converted from the given string. + */ + public static LocalDateTime stringToDate(String dateStr, DateTimeFormatter formatter) { + assert dateStr != null; + return LocalDateTime.parse(dateStr, formatter); + } + + /** + * Converts the date and time to Epoch time (in ms). + * + * @param dateTime Indicates the date and time to be converted. + * @return Returns a long string representing the Epoch time. + */ + public static long dateToTimeMillis(LocalDateTime dateTime) { + assert dateTime != null; + return dateTime.toInstant(DEFAULT_ZONE_OFFSET).toEpochMilli(); + } + + /** + * Converts an Epoch time (in ms) to the date and time. + * + * @param timeMills Indicates the Epoch time (in ms) to be converted. + * @return Returns the date and time converted from the given Epoch time. + */ + public static LocalDateTime timeMillisToDate(long timeMills) { + Instant instant = Instant.ofEpochMilli(timeMills); + return LocalDateTime.ofInstant(instant, DEFAULT_ZONE_OFFSET); + } + + /** + * Gets the date and time in the given pattern. + * + * @param pattern Indicates the pattern of the date and time. + * @return Returns a string representing the date and time in the specified pattern. + */ + public static String getNowTimeString(String pattern) { + LocalDateTime now = LocalDateTime.now(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern); + return now.format(formatter); + } + + /** + * Gets the timestamp (in ms). + * + * @return Returns a long string representing the timestamp. + */ + public static Long getNowTimeLong() { + LocalDateTime now = LocalDateTime.now(); + return now.toInstant(DEFAULT_ZONE_OFFSET).toEpochMilli(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/FileSafeUtils.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/FileSafeUtils.java new file mode 100644 index 000000000..15866ff7f --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/FileSafeUtils.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common.util; + +import ohos.devtools.datasources.utils.common.Constant; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.math.BigInteger; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.HashMap; +import java.util.Map; + +/** + * file SHA-256 + * + * @version 1.0 + * @date 2021/2/5 15:36 + **/ +public final class FileSafeUtils { + /** + * Gets a logger instance. + */ + private static final Logger LOGGER = LogManager.getLogger(FileSafeUtils.class); + + private FileSafeUtils() { + } + + /** + * Gets the MD5 code of the file. Available algorithmType options include MD5, SHA1, SHA-256, SHA-384, and SHA-512. + * + * @param file Indicates the file to obtain the MD5 code. + * @param algorithmType Indicates the algorithm type. + * @return Returns a string of the MD5 code. + */ + public static String getFileSha(File file, String algorithmType) { + if (file == null) { + return "Sha File is null"; + } + + // Check whether the file exists. + if (!file.isFile() || algorithmType == null) { + LOGGER.error("Sha File is not exists : " + file.getName()); + return "Sha File is not exists or algorithmType is null"; + } + + // Define the MessageDigest and FileInputStream for encryption. + MessageDigest messageDigest = null; + FileInputStream fileInputStream = null; + byte[] buffer = new byte[Constant.MB]; + int len; + try { + // Perform SHA algorithm encryption using file input streams. + messageDigest = MessageDigest.getInstance(algorithmType); + fileInputStream = new FileInputStream(file); + while (true) { + len = fileInputStream.read(buffer, 0, Constant.MB); + if (len == Constant.ABNORMAL) { + break; + } + messageDigest.update(buffer, 0, len); + } + } catch (NoSuchAlgorithmException exception) { + LOGGER.error("getFileMD5 fail: " + exception.getMessage()); + } catch (IOException exception) { + LOGGER.error("getFileMD5 fail: " + exception.getMessage()); + return ""; + } finally { + try { + if (fileInputStream != null) { + // Close the file input stream. + fileInputStream.close(); + } + } catch (IOException exception) { + LOGGER.error("fileInputStream: " + exception.getMessage()); + } + } + + // Use BigInteger. + BigInteger bigInteger = new BigInteger(1, messageDigest.digest()); + return bigInteger.toString(Constant.RADIX); + } + + /** + * Sets whether to recursively search files in the sub-directories for the MD code of files. + * + * @param dirFile Indicates the files in the sub-directories. + * @param algorithm Indicates the algorithm. + * @param listChild Indicates whether to recursively search files in the sub-directories. + * @return Returns Map + */ + private static Map getDirMD5(File dirFile, String algorithm, boolean listChild) { + if (!dirFile.isDirectory()) { + return new HashMap<>(); + } + Map pathAlgMap = new HashMap(); + String algCode; + File[] files = dirFile.listFiles(); + for (int index = 0; index < files.length; index++) { + File file = files[index]; + if (file.isDirectory() && listChild) { + pathAlgMap.putAll(getDirMD5(file, algorithm, listChild)); + } else { + algCode = getFileSha(file, algorithm); + if (algCode != null) { + pathAlgMap.put(file.getPath(), algCode); + } + } + } + return pathAlgMap; + } + + /** + * Compares the Hash values in two files. + * + * @param foreFileMD5 Indicates the MD5 code of the source file. + * @param laterFileMD5 Indicates the MD5 code of the target file. + * @return Returns true if the MD5 codes are the same; returns false otherwise. + */ + private static boolean checkHash(String foreFileMD5, String laterFileMD5) { + return foreFileMD5.equals(laterFileMD5); + } + + /** + * Checks for file changes. + * + * @param foreFile Indicates the original file. + * @param laterFile Indicates the new file. + * @param algorithmType Indicates the algorithm type. + * @return Returns true if there is no change in the file; returns false otherwise. + */ + private static boolean checkChange(File foreFile, File laterFile, String algorithmType) { + // Get the Hash value of the original and new files. + String foreHash = getFileSha(foreFile, algorithmType); + String laterHash = getFileSha(laterFile, algorithmType); + + // Call checkHash to compare whether there are changes in the file. + boolean checkHash = checkHash(foreHash, laterHash); + if (checkHash) { + LOGGER.debug("file : {}and file: {}name and content all the same", foreFile.getName(), laterFile.getName()); + } else { + LOGGER.debug("file: {} and file: {}name or content different", foreFile.getName(), laterFile.getName()); + } + return checkHash; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/PrintUtil.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/PrintUtil.java new file mode 100644 index 000000000..e49a73fb6 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/common/util/PrintUtil.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common.util; + +import org.apache.logging.log4j.Logger; + +/** + * logger print + * + * @version 1.0 + * @date 2021/04/26 17:21 + **/ +public class PrintUtil { + /** + * print logging + * + * @param logger logging + * @param str logging message + * @param state logging state + */ + public static void print(Logger logger, String str, int state) { + if (state == 0) { + if (logger.isInfoEnabled()) { + logger.info(str); + } + } else { + if (logger.isDebugEnabled()) { + logger.debug(str); + } + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/datahandler/datapoller/DataPoller.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/datahandler/datapoller/DataPoller.java new file mode 100644 index 000000000..fd23e57ff --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/datahandler/datapoller/DataPoller.java @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.datahandler.datapoller; + +import io.grpc.StatusRuntimeException; +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.databases.datatable.MemoryTable; +import ohos.devtools.datasources.transport.grpc.ProfilerClient; +import ohos.devtools.datasources.transport.grpc.ProfilerServiceHelper; +import ohos.devtools.datasources.transport.grpc.service.CommonTypes; +import ohos.devtools.datasources.transport.grpc.service.ProfilerServiceTypes; +import ohos.devtools.datasources.utils.common.util.CommonUtil; +import ohos.devtools.datasources.utils.common.util.DateTimeUtil; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import ohos.devtools.services.memory.ClassInfoDao; +import ohos.devtools.services.memory.MemoryHeapDao; +import ohos.devtools.services.memory.MemoryInstanceDao; +import ohos.devtools.services.memory.MemoryInstanceDetailsDao; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Queue; +import java.util.concurrent.LinkedBlockingQueue; + +import static ohos.devtools.datasources.utils.common.Constant.JVMTI_AGENT_PLUG; +import static ohos.devtools.datasources.utils.common.Constant.MEMORY_PLUG; +import static ohos.devtools.datasources.utils.common.Constant.MEMORY_PLUGS_NAME; + +/** + * DataPoller utilities class + * + * @version 1.0 + * @date 2021/02/22 15:59 + **/ +public class DataPoller extends Thread { + private static final Logger DATA = LogManager.getLogger("Data"); + private static final Logger LOGGER = LogManager.getLogger(DataPoller.class); + private long localSessionId; + private int sessionId; + private ProfilerClient client; + private Map tableService; + private MemoryTable memoryTable; + private ClassInfoDao classInfoDao; + private MemoryInstanceDetailsDao memoryInstanceDetailsDao; + private MemoryInstanceDao memoryInstanceDao; + private MemoryHeapDao memoryHeapDao; + + private MemoryHeapDataConsumer memoryHeapDataConsumer; + private MemoryDataConsumer memoryDataConsumer; + + private Queue memoryDataQueue = new LinkedBlockingQueue(); + private Queue memoryHeapDataQueue = new LinkedBlockingQueue(); + private boolean stopFlag = false; + private boolean startRefresh = false; + + /** + * Data Poller + * + * @param localSessionId local SessionId + * @param sessionId session Id + * @param client client + * @param tableService tableService + */ + public DataPoller(Long localSessionId, int sessionId, ProfilerClient client, + Map tableService) { + this.localSessionId = localSessionId; + this.sessionId = sessionId; + this.client = client; + this.tableService = tableService; + } + + /** + * Starts polling. + */ + private void startPoll() { + LOGGER.info("start Poller DeviceInfo, {}", DateTimeUtil.getNowTimeLong()); + ProfilerServiceTypes.FetchDataRequest request = + ProfilerServiceHelper.fetchDataRequest(CommonUtil.getRequestId(), sessionId, null); + Iterator response = null; + try { + LOGGER.info("start Poller fetchData01, {}", DateTimeUtil.getNowTimeLong()); + response = client.fetchData(request); + long startTime = DateTimeUtil.getNowTimeLong(); + LOGGER.info("start Poller fetchData02, {}", startTime); + while (response.hasNext()) { + if (stopFlag) { + return; + } + ProfilerServiceTypes.FetchDataResponse fetchDataResponse = response.next(); + List lists = fetchDataResponse.getPluginDataList(); + for (CommonTypes.ProfilerPluginData pluginData : lists) { + handleData(pluginData); + } + } + } catch (StatusRuntimeException exception) { + SessionManager.getInstance().deleteLocalSession(localSessionId); + LOGGER.error("start Poll has Exception {}", exception.getMessage()); + return; + } finally { + dataPollerEnd(); + } + } + + private void handleData(CommonTypes.ProfilerPluginData pluginData) { + if (pluginData.getStatus() != 0) { + return; + } + + if (MEMORY_PLUGS_NAME.equals(pluginData.getName()) || MEMORY_PLUG.equals(pluginData.getName())) { + handleMemoryData(pluginData); + } + if (JVMTI_AGENT_PLUG.equals(pluginData.getName())) { + handleAgentData(pluginData); + } + } + + private void handleMemoryData(CommonTypes.ProfilerPluginData pluginData) { + if (tableService.get(MEMORY_PLUG) != null && memoryTable == null) { + AbstractDataStore abstractDataStore = tableService.get(MEMORY_PLUG); + if (abstractDataStore instanceof MemoryTable) { + memoryTable = (MemoryTable) abstractDataStore; + } + memoryDataConsumer = new MemoryDataConsumer(memoryDataQueue, memoryTable, sessionId, localSessionId); + memoryDataConsumer.start(); + offerPluginData(pluginData); + } else if (tableService.get(MEMORY_PLUG) == null && memoryTable == null) { + return; + } else { + offerPluginData(pluginData); + } + } + + private void offerPluginData(CommonTypes.ProfilerPluginData pluginData) { + if (pluginData != null) { + memoryDataQueue.offer(pluginData); + if (!startRefresh) { + long timeStamp = (pluginData.getTvSec() * 1000000000L + pluginData.getTvNsec()) / 1000000; + SessionManager.getInstance().stopLoadingView(localSessionId, timeStamp); + startRefresh = true; + } + } + } + + private void handleAgentData(CommonTypes.ProfilerPluginData pluginData) { + if (tableService.get(JVMTI_AGENT_PLUG) != null && classInfoDao == null) { + LOGGER.info("get Dao info"); + if (tableService.get(JVMTI_AGENT_PLUG) instanceof ClassInfoDao) { + classInfoDao = (ClassInfoDao) tableService.get(JVMTI_AGENT_PLUG); + } + + if (tableService.get("jvmtiagentDetails") instanceof MemoryInstanceDetailsDao) { + memoryInstanceDetailsDao = (MemoryInstanceDetailsDao) tableService.get("jvmtiagentDetails"); + } + if (tableService.get("jvmtiagentInstance") instanceof MemoryInstanceDao) { + memoryInstanceDao = (MemoryInstanceDao) tableService.get("jvmtiagentInstance"); + } + if (tableService.get("jvmtiagentMemoryHeap") instanceof MemoryHeapDao) { + memoryHeapDao = (MemoryHeapDao) tableService.get("jvmtiagentMemoryHeap"); + } + memoryHeapDataConsumer = + new MemoryHeapDataConsumer(memoryHeapDataQueue, localSessionId, classInfoDao, memoryInstanceDetailsDao, + memoryInstanceDao, memoryHeapDao); + memoryHeapDataConsumer.start(); + offerHeapInfo(pluginData); + } else if (tableService.get(JVMTI_AGENT_PLUG) == null && classInfoDao == null) { + return; + } else { + offerHeapInfo(pluginData); + } + } + + private void offerHeapInfo(CommonTypes.ProfilerPluginData pluginData) { + if (pluginData != null) { + memoryHeapDataQueue.offer(pluginData); + } + } + + private void dataPollerEnd() { + if (memoryDataConsumer != null) { + memoryDataConsumer.shutDown(); + } + if (memoryHeapDataConsumer != null) { + memoryHeapDataConsumer.shutDown(); + } + client.setUsed(false); + } + + /** + * shutDown + */ + public void shutDown() { + if (memoryDataConsumer != null) { + memoryDataConsumer.shutDown(); + } + if (memoryHeapDataConsumer != null) { + memoryHeapDataConsumer.shutDown(); + } + stopFlag = true; + } + + /** + * run + */ + @Override + public void run() { + try { + startPoll(); + } catch (StatusRuntimeException exception) { + LOGGER.error("exception error{}", exception.getMessage()); + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/datahandler/datapoller/MemoryDataConsumer.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/datahandler/datapoller/MemoryDataConsumer.java new file mode 100644 index 000000000..138e06fd1 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/datahandler/datapoller/MemoryDataConsumer.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.datahandler.datapoller; + +import com.google.protobuf.InvalidProtocolBufferException; +import ohos.devtools.datasources.databases.datatable.MemoryTable; +import ohos.devtools.datasources.databases.datatable.enties.ProcessMemInfo; +import ohos.devtools.datasources.transport.grpc.service.CommonTypes; +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; +import ohos.devtools.datasources.utils.common.util.DateTimeUtil; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.ArrayList; +import java.util.List; +import java.util.Queue; +import java.util.concurrent.TimeUnit; + +/** + * @Description MemoryDataConsumer + * @Date 2021/4/9 13:56 + **/ +public class MemoryDataConsumer extends Thread { + private static final Logger DATA = LogManager.getLogger("Data"); + private static final Logger LOGGER = LogManager.getLogger(MemoryDataConsumer.class); + + /** + * Interval for saving data to the database, in ms. + */ + private static final long SAVE_FREQ = 1000; + private List processMemInfoList = new ArrayList<>(); + private Queue queue; + private MemoryTable memoryTable; + private Integer sessionId; + private Long localSessionId; + private int logIndex = 0; + private boolean stopFlag = false; + private boolean isInsert = false; + + /** + * Time reference variable for saving data to the in-memory database at the interval specified by SAVE_FREQ. + */ + private long flagTime = DateTimeUtil.getNowTimeLong(); + + /** + * MemoryDataConsumer + * + * @param queue Indicates the memory queue. + * @param memoryTable Indicates the memory table. + * @param sessionId Indicates the session ID. + * @param localSessionId Indicates the local session ID. + */ + public MemoryDataConsumer(Queue queue, MemoryTable memoryTable, Integer sessionId, Long localSessionId) { + this.queue = queue; + this.memoryTable = memoryTable; + this.sessionId = sessionId; + this.localSessionId = localSessionId; + } + + /** + * Run MemoryDataConsumer. + */ + @Override + public void run() { + while (true) { + try { + if (logIndex == Integer.MAX_VALUE) { + logIndex = 0; + } + if (stopFlag) { + return; + } + long now = DateTimeUtil.getNowTimeLong(); + if (now - flagTime > SAVE_FREQ) { + try { + TimeUnit.MILLISECONDS.sleep(1); + } catch (InterruptedException exception) { + LOGGER.info("InterruptedException"); + } + } + if (queue.size() > 0) { + handleMemoryData(queue.poll()); + } + insertMemoryData(); + } catch (Exception exception) { + LOGGER.info(exception); + } + } + } + + /** + * shutDown + */ + public void shutDown() { + stopFlag = true; + } + + private void handleMemoryData(CommonTypes.ProfilerPluginData memoryData) { + MemoryPluginResult.MemoryData.Builder builder = MemoryPluginResult.MemoryData.newBuilder(); + MemoryPluginResult.MemoryData memorydata = null; + try { + memorydata = builder.mergeFrom(memoryData.getData()).build(); + } catch (InvalidProtocolBufferException exe) { + return; + } + List processMemoryInfoList = memorydata.getProcessesinfoList(); + if (stopFlag) { + return; + } + processMemoryInfoList.forEach(processMemoryInfo -> { + MemoryPluginResult.AppSummary app = processMemoryInfo.getMemsummary(); + ProcessMemInfo procMemInfo = new ProcessMemInfo(); + procMemInfo.setData(app); + procMemInfo.setSession(localSessionId); + procMemInfo.setSessionId(sessionId); + long timeStamp = (memoryData.getTvSec() * 1000000000L + memoryData.getTvNsec()) / 1000000; + procMemInfo.setTimeStamp(timeStamp); + LOGGER.debug("TimeStamp {}, AppSummary {}", timeStamp, app); + processMemInfoList.add(procMemInfo); + isInsert = false; + insertMemoryData(); + }); + } + + private void insertMemoryData() { + if (!isInsert) { + long now = DateTimeUtil.getNowTimeLong(); + if (now - flagTime > SAVE_FREQ) { + memoryTable.insertProcessMemInfo(processMemInfoList); + processMemInfoList.clear(); + // Update flagTime. + flagTime = now; + } + isInsert = true; + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/datahandler/datapoller/MemoryHeapDataConsumer.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/datahandler/datapoller/MemoryHeapDataConsumer.java new file mode 100644 index 000000000..0fe7e251f --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/datahandler/datapoller/MemoryHeapDataConsumer.java @@ -0,0 +1,288 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.datahandler.datapoller; + +import com.google.protobuf.InvalidProtocolBufferException; +import ohos.devtools.datasources.transport.grpc.service.AgentPluginResult; +import ohos.devtools.datasources.transport.grpc.service.CommonTypes; +import ohos.devtools.datasources.utils.common.util.DateTimeUtil; +import ohos.devtools.services.memory.ClassInfo; +import ohos.devtools.services.memory.ClassInfoDao; +import ohos.devtools.services.memory.MemoryHeapDao; +import ohos.devtools.services.memory.MemoryHeapInfo; +import ohos.devtools.services.memory.MemoryInstanceDao; +import ohos.devtools.services.memory.MemoryInstanceDetailsDao; +import ohos.devtools.services.memory.MemoryInstanceDetailsInfo; +import ohos.devtools.services.memory.MemoryInstanceInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.ArrayList; +import java.util.List; +import java.util.Queue; +import java.util.concurrent.TimeUnit; + +/** + * @Description MemoryHeapDataConsumer + * @Date 2021/4/9 13:56 + **/ +public class MemoryHeapDataConsumer extends Thread { + private static final Logger HEAPDATA = LogManager.getLogger("HEAPDATA"); + private static final Logger LOGGER = LogManager.getLogger(MemoryHeapDataConsumer.class); + + /** + * 每隔多少毫秒保存一次数据入库 + */ + private static final long SAVE_FREQ = 500; + + private Queue queue; + private Long localSessionId; + private ClassInfoDao classInfoDao; + private MemoryInstanceDetailsDao memoryInstanceDetailsDao; + private MemoryInstanceDao memoryInstanceDao; + private MemoryHeapDao memoryHeapDao; + private Integer LogIndex = 0; + private boolean stopFlag = false; + private long firstTime = 0L; + private int firstDataCount = 0; + private boolean isInsert = false; + + /** + * Memory入库时的时间参照变量,每隔SAVE_FREQ保存一次数据入库 + */ + private long flagTime = DateTimeUtil.getNowTimeLong(); + + private List classInfoList = new ArrayList<>(); + + private List memoryInstanceDetailsInfos = new ArrayList<>(); + + private List memoryHeapInfos = new ArrayList<>(); + + private List memoryInstanceInfos = new ArrayList<>(); + + /** + * MemoryHeapDataConsumer + * + * @param queue queue + * @param localSessionId localSessionId + * @param classInfoDao classInfoDao + * @param memoryInstanceDetailsDao memoryInstanceDetailsDao + * @param memoryInstanceDao memoryInstanceDao + * @param memoryHeapDao memoryHeapDao + */ + public MemoryHeapDataConsumer(Queue queue, Long localSessionId, + ClassInfoDao classInfoDao, MemoryInstanceDetailsDao memoryInstanceDetailsDao, + MemoryInstanceDao memoryInstanceDao, MemoryHeapDao memoryHeapDao) { + this.queue = queue; + this.localSessionId = localSessionId; + this.classInfoDao = classInfoDao; + this.memoryInstanceDetailsDao = memoryInstanceDetailsDao; + this.memoryInstanceDao = memoryInstanceDao; + this.memoryHeapDao = memoryHeapDao; + } + + /** + * run + */ + @Override + public void run() { + while (true) { + try { + if (LogIndex == Integer.MAX_VALUE) { + LogIndex = 0; + } + if (stopFlag) { + return; + } + long now = DateTimeUtil.getNowTimeLong(); + if (now - flagTime > SAVE_FREQ) { + try { + TimeUnit.MILLISECONDS.sleep(10); + } catch (InterruptedException exception) { + HEAPDATA.info("InterruptedException"); + } + } + if (queue.size() > 0) { + CommonTypes.ProfilerPluginData dataObject = queue.poll(); + if (dataObject != null) { + handleMemoryHeapHandle(dataObject); + } + } + insertData(); + } catch (Exception exception) { + LOGGER.error(" exception {} ", exception.getMessage()); + } + } + } + + private void insertData() { + long now = DateTimeUtil.getNowTimeLong(); + if (now - flagTime > SAVE_FREQ) { + if (!isInsert) { + boolean insertRes = classInfoDao.insertClassInfos(classInfoList); + if (insertRes) { + classInfoList.clear(); + } + boolean instanceRes = + memoryInstanceDetailsDao.insertMemoryInstanceDetailsInfo(memoryInstanceDetailsInfos); + if (instanceRes) { + memoryInstanceDetailsInfos.clear(); + } + boolean memHeapInfoRes = memoryHeapDao.insertMemoryHeapInfos(memoryHeapInfos); + if (memHeapInfoRes) { + memoryHeapInfos.clear(); + } + boolean memInstanceRes = memoryInstanceDao.insertMemoryInstanceInfos(memoryInstanceInfos); + if (memInstanceRes) { + memoryInstanceInfos.clear(); + } + isInsert = true; + flagTime = now; + } + } + } + + /** + * shutDown + */ + public void shutDown() { + stopFlag = true; + } + + private void handleMemoryHeapHandle(CommonTypes.ProfilerPluginData memoryData) { + if (firstTime == 0L) { + // utc 毫秒值 + firstTime = (memoryData.getTvSec() * 1000000000L + memoryData.getTvNsec()) / 1000000; + } + AgentPluginResult.BatchAgentMemoryEvent.Builder batchBuilder = + AgentPluginResult.BatchAgentMemoryEvent.newBuilder(); + AgentPluginResult.BatchAgentMemoryEvent bath = null; + try { + bath = batchBuilder.mergeFrom(memoryData.getData()).build(); + } catch (InvalidProtocolBufferException exception) { + LOGGER.info("mergeFrom failed {}", exception.getMessage()); + } + List agentMemoryEvents = bath.getEventsList(); + for (AgentPluginResult.AgentMemoryEvent agentMemoryEvent : agentMemoryEvents) { + if (stopFlag) { + return; + } + // 时间戳 + long timeStamp = agentMemoryEvent.getTimestamp(); + setPluginClassInfo(agentMemoryEvent); + // memoryHeapInfo信息 + AgentPluginResult.AllocationInfo alloc = agentMemoryEvent.getAllocData(); + int instanceId = alloc.getObjectId(); + int classId = alloc.getClassId(); + String threadName = alloc.getThreadName(); + List stackFram = alloc.getFrameInfoList(); + if (instanceId > 0) { + MemoryHeapInfo memoryHeapInfo = new MemoryHeapInfo(); + // 根据调用栈信息计算 + if (!stackFram.isEmpty()) { + memoryHeapInfo.setAllocations(1); + } else { + memoryHeapInfo.setAllocations(0); + } + // 调用栈信息 + callStackInfo(instanceId, stackFram); + memoryHeapInfo.setcId(classId); + memoryHeapInfo.setInstanceId(instanceId); + memoryHeapInfo.setSessionId(localSessionId); + long createTime = setMemoryHeapInfo(memoryData, timeStamp, alloc, memoryHeapInfo); + setMemoryInstanceInfo(instanceId, classId, createTime); + } + isInsert = false; + insertData(); + AgentPluginResult.DeallocationInfo deallocationInfo = agentMemoryEvent.getFreeData(); + int objectId = deallocationInfo.getObjectId(); + if (objectId != 0) { + long dellocTime = timeStamp; + memoryInstanceDao.updateInstanceInfos(dellocTime, objectId); + memoryHeapDao.updateMemoryHeapInfo(objectId); + } + } + } + + private void setPluginClassInfo(AgentPluginResult.AgentMemoryEvent agentMemoryEvent) { + AgentPluginResult.ClassInfo classData = agentMemoryEvent.getClassData(); + int clazzId = classData.getClassId(); + String clzName = classData.getClassName(); + if (clazzId > 0) { + ClassInfo classInfo = new ClassInfo(); + classInfo.setcId(clazzId); + classInfo.setClassName(clzName); + LOGGER.debug("classInfo is {}", classInfo); + classInfoList.add(classInfo); + } + } + + private void setMemoryInstanceInfo(int instanceId, int classId, long createTime) { + MemoryInstanceInfo memoryInstanceInfo = new MemoryInstanceInfo(); + memoryInstanceInfo.setInstanceId(instanceId); + memoryInstanceInfo.setCreateTime(createTime); + memoryInstanceInfo.setAllocTime(createTime); + memoryInstanceInfo.setcId(classId); + memoryInstanceInfo.setDeallocTime(0L); + HEAPDATA.debug("memoryInstanceInfo is {}", memoryInstanceInfo); + memoryInstanceInfos.add(memoryInstanceInfo); + } + + private long setMemoryHeapInfo(CommonTypes.ProfilerPluginData memoryData, long timeStamp, + AgentPluginResult.AllocationInfo alloc, MemoryHeapInfo memoryHeapInfo) { + int heapId = alloc.getHeapId(); + memoryHeapInfo.setHeapId(heapId); + memoryHeapInfo.setDeallocations(0); + long objSize = alloc.getObjectSize(); + int arrayLength = alloc.getArrayLength(); + if (arrayLength < 0) { + memoryHeapInfo.setTotalCount(1); + memoryHeapInfo.setShallowSize(objSize); + } else { + memoryHeapInfo.setTotalCount(1); + memoryHeapInfo.setShallowSize(arrayLength * objSize); + } + long createTime; + if (timeStamp == 0L) { + createTime = firstTime; + } else { + createTime = (memoryData.getTvSec() * 1000000000L + memoryData.getTvNsec()) / 1000000; + } + memoryHeapInfo.setCreateTime(createTime); + LOGGER.debug("memoryHeapInfo data is {}", memoryHeapInfo); + memoryHeapInfos.add(memoryHeapInfo); + return createTime; + } + + private void callStackInfo(int instanceId, List stackFram) { + for (AgentPluginResult.AllocationInfo.StackFrameInfo stackFrameInfo : stackFram) { + MemoryInstanceDetailsInfo memoryInstanceDetailsInfo = new MemoryInstanceDetailsInfo(); + int frameID = stackFrameInfo.getFrameId(); + String className = stackFrameInfo.getClassName(); + String methodName = stackFrameInfo.getMethodName(); + String fileName = stackFrameInfo.getFileName(); + int lineNumber = stackFrameInfo.getLineNumber(); + memoryInstanceDetailsInfo.setClassName(className); + memoryInstanceDetailsInfo.setFrameId(frameID); + memoryInstanceDetailsInfo.setMethodName(methodName); + memoryInstanceDetailsInfo.setLineNumber(lineNumber); + memoryInstanceDetailsInfo.setInstanceId(instanceId); + memoryInstanceDetailsInfo.setFieldName(fileName); + LOGGER.debug("memoryInstanceDetailsInfo is {}", memoryInstanceDetailsInfo); + memoryInstanceDetailsInfos.add(memoryInstanceDetailsInfo); + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/datahandler/pretreatment/Pretreatment.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/datahandler/pretreatment/Pretreatment.java new file mode 100644 index 000000000..1969c1fec --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/datahandler/pretreatment/Pretreatment.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.datahandler.pretreatment; + +/** + * @Description 预处理核心类 + * @Date 2021/2/7 13:29 + **/ +public class Pretreatment { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/dao/DeviceUtil.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/dao/DeviceUtil.java new file mode 100644 index 000000000..97ac52746 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/dao/DeviceUtil.java @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.dao; + +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.databases.databasepool.SqlRunnable; +import ohos.devtools.datasources.utils.common.util.PrintUtil; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.device.entity.DeviceInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +/** + * Device-related execution sql class + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class DeviceUtil extends AbstractDataStore { + private static final Logger LOGGER = LogManager.getLogger(DeviceUtil.class); + private SqlRunnable sqlRunnable = new SqlRunnable(); + + /** + * Add device information + * + * @param info info + */ + public void insertDeviceInfo(DeviceInfo info) { + boolean bool = insert(info); + if (bool) { + PrintUtil.print(LOGGER, "Successfully added data to device table DeviceInfo", 1); + } else { + PrintUtil.print(LOGGER, "Failed added data to device table DeviceInfo", 1); + } + } + + /** + * insertDeviceIPPortInfo + * + * @param info info + */ + public void insertDeviceIPPortInfo(DeviceIPPortInfo info) { + boolean bool = insert(info); + if (bool) { + PrintUtil.print(LOGGER, "Successfully added data to device table DeviceIPPortInfo", 1); + } else { + PrintUtil.print(LOGGER, "Failed added data to device table DeviceIPPortInfo", 1); + } + } + + /** + * deleteExceptDeviceIPPort + * + * @param list list + */ + public void deleteExceptDeviceIPPort(ArrayList list) { + Connection conn = null; + String str = ""; + Optional deviceIPPort = getConnectByTable("DeviceIPPortInfo"); + if (deviceIPPort.isPresent()) { + conn = deviceIPPort.get(); + } + for (DeviceIPPortInfo info : list) { + str = str + " '" + info.getDeviceID() + "',"; + } + str = str.substring(0, str.length() - 1); + String delSql = "delete from DeviceIPPortInfo where deviceID not in (" + str + ");"; + LOGGER.debug("deleteExceptDeviceIPPort = {}", delSql); + execute(conn, delSql); + } + + /** + * Delete all device IP and port number information + */ + public void deleteAllDeviceIPPortInfo() { + Connection conn = null; + Optional deviceIPPort = getConnectByTable("DeviceIPPortInfo"); + if (deviceIPPort.isPresent()) { + conn = deviceIPPort.get(); + } + String sql = "delete from DeviceIPPortInfo"; + execute(conn, sql); + } + + /** + * hasDevice + * + * @param serialNumber serialNumber + * @return boolean + */ + public boolean hasDevice(String serialNumber) { + Connection conn = null; + Optional deviceIPPort = getConnectByTable("DeviceInfo"); + if (deviceIPPort.isPresent()) { + conn = deviceIPPort.get(); + } + boolean flag = false; + try { + Statement pstmt = conn.createStatement(); + String sql = "select count(1) hasDevice from DeviceInfo where deviceID = " + "'" + serialNumber + "';"; + LOGGER.debug("hasDevice = {}", sql); + ResultSet resultSet = pstmt.executeQuery(sql); + String hasDevice = ""; + while (resultSet.next()) { + hasDevice = resultSet.getString("hasDevice"); + } + if (!"".equals(hasDevice) && Integer.parseInt(hasDevice) > 0) { + flag = true; + } + sqlRunnable.close(pstmt, resultSet, conn); + } catch (SQLException exception) { + LOGGER.error("SQLException error: {}", exception.getMessage()); + } + + return flag; + } + + /** + * Is there a device IP and port number + * + * @param serialNumber serialNumber + * @return boolean + */ + public boolean hasDeviceIPPort(String serialNumber) { + Connection conn = null; + Optional deviceIPPort = getConnectByTable("DeviceIPPortInfo"); + if (deviceIPPort.isPresent()) { + conn = deviceIPPort.get(); + } + Statement pstmt = null; + ResultSet resultSet = null; + boolean flag = false; + try { + pstmt = conn.createStatement(); + String sql = + "select count(1) hasDevice from DeviceIPPortInfo where deviceID = " + "'" + serialNumber + "';"; + LOGGER.debug("hasDevice = {}", sql); + resultSet = pstmt.executeQuery(sql); + String hasDevice = ""; + while (resultSet.next()) { + hasDevice = resultSet.getString("hasDevice"); + } + if (!"".equals(hasDevice) && Integer.parseInt(hasDevice) > 0) { + flag = true; + } + } catch (SQLException sqlException) { + LOGGER.error("sqlException error: {}", sqlException.getMessage()); + } finally { + sqlRunnable.close(pstmt, resultSet, conn); + } + return flag; + } + + /** + * Get all device information + * + * @return List + */ + public List getAllDeviceInfo() { + List list = select(DeviceInfo.class, null, null); + return list; + } + + /** + * get All Device IP Port Info + * + * @return getAllDeviceIPPortInfo + */ + public List getAllDeviceIPPortInfos() { + List list = select(DeviceIPPortInfo.class, null, null); + return list; + } + + /** + * getDeviceIPPortInfo + * + * @param deviceID deviceID + * @return DeviceIPPortInfo + */ + public DeviceIPPortInfo getDeviceIPPortInfo(String deviceID) { + Map hashMap = new HashMap<>(); + hashMap.put("deviceID", deviceID); + List list = select(DeviceIPPortInfo.class, null, hashMap); + return list.get(0); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/entity/DeviceIPPortInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/entity/DeviceIPPortInfo.java new file mode 100644 index 000000000..180bfc68b --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/entity/DeviceIPPortInfo.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.entity; + +import java.io.Serializable; + +/** + * Device IP and port number information + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class DeviceIPPortInfo implements Serializable { + private String deviceID; + private String deviceName; + private String ip; + private int port; + private String deviceType; + private int forwardPort; + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDeviceID() { + return deviceID; + } + + public void setDeviceID(String deviceID) { + this.deviceID = deviceID; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } + + public int getForwardPort() { + return forwardPort; + } + + public void setForwardPort(int forwardPort) { + this.forwardPort = forwardPort; + } + + @Override + public String toString() { + return "DeviceIPPortInfo{" + "deviceID='" + deviceID + '\'' + ", deviceName='" + deviceName + '\'' + ", ip='" + + ip + '\'' + ", port=" + port + ", deviceType=" + deviceType + ", forwardPort=" + forwardPort + '}'; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/entity/DeviceInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/entity/DeviceInfo.java new file mode 100644 index 000000000..3b1fcdc6f --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/entity/DeviceInfo.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.entity; + +/** + * Device Info + * + * @version 1.0 + * @date 2021/03/4 10:55 + **/ +public class DeviceInfo { + private String deviceID; + private String deviceName; + private String ramInfo; + private String romInfo; + + /** + * set Device ID + * + * @param deviceID deviceID + */ + public void setDeviceID(String deviceID) { + this.deviceID = deviceID; + } + + /** + * set Device Name + * + * @param deviceName deviceName + */ + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + /** + * set RamInfo + * + * @param ramInfo ramInfo + */ + public void setRamInfo(String ramInfo) { + this.ramInfo = ramInfo; + } + + /** + * set RomInfo + * + * @param romInfo romInfo + */ + public void setRomInfo(String romInfo) { + this.romInfo = romInfo; + } + + /** + * get DeviceID + * + * @return String + */ + public String getDeviceID() { + return deviceID; + } + + /** + * get DeviceName + * + * @return String + */ + public String getDeviceName() { + return deviceName; + } + + /** + * String + * + * @return getRamInfo + */ + public String getRamInfo() { + return ramInfo; + } + + /** + * String + * + * @return getRomInfo + */ + public String getRomInfo() { + return romInfo; + } + + @Override + public String toString() { + return "DeviceInfo{" + "deviceID='" + deviceID + '\'' + ", deviceName='" + deviceName + '\'' + ", RAMInfo='" + + ramInfo + '\'' + ", ROMInfo='" + romInfo + '\'' + '}'; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/entity/DeviceProcessInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/entity/DeviceProcessInfo.java new file mode 100644 index 000000000..c6d8c6d9d --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/entity/DeviceProcessInfo.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.entity; + +import java.io.Serializable; + +/** + * Equipment process + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class DeviceProcessInfo implements Serializable { + private static final long serialVersionUID = -3815785606619485252L; + private String deviceName; + private String processName; + private long localSessionId; + private String deviceType; + private long startTime; + private long endTime; + + /** + * get DeviceName + * + * @return String + */ + public String getDeviceName() { + return deviceName; + } + + /** + * set DeviceName + * + * @param deviceName deviceName + */ + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + /** + * get ProcessName + * + * @return String + */ + public String getProcessName() { + return processName; + } + + /** + * set ProcessName + * + * @param processName processName + */ + public void setProcessName(String processName) { + this.processName = processName; + } + + /** + * get Device Type + * + * @return String + */ + public String getDeviceType() { + return deviceType; + } + + /** + * set Device Type + * + * @param deviceType deviceType + */ + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + /** + * get LocalSession Id + * + * @return long + */ + public long getLocalSessionId() { + return localSessionId; + } + + /** + * set LocalSession Id + * + * @param localSessionId localSessionId + */ + public void setLocalSessionId(long localSessionId) { + this.localSessionId = localSessionId; + } + + /** + * get Start Time + * + * @return long + */ + public long getStartTime() { + return startTime; + } + + /** + * set Start Time + * + * @param startTime startTime + */ + public void setStartTime(long startTime) { + this.startTime = startTime; + } + + /** + * long + * + * @return getEndTime + */ + public long getEndTime() { + return endTime; + } + + /** + * set End Time + * + * @param endTime endTime + */ + public void setEndTime(long endTime) { + this.endTime = endTime; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/entity/TraceFileInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/entity/TraceFileInfo.java new file mode 100644 index 000000000..8a41f81f1 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/entity/TraceFileInfo.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.entity; + +import java.io.Serializable; + +/** + * TraceFileInfo + * + * @version 1.0 + * @date 2021/3/26 11:31 + **/ +public class TraceFileInfo implements Serializable { + private static final long serialVersionUID = 6310938366918639648L; + private String version; + private long recordNum; + private long createTime; + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public long getRecordNum() { + return recordNum; + } + + public void setRecordNum(long recordNum) { + this.recordNum = recordNum; + } + + public long getCreateTime() { + return createTime; + } + + public void setCreateTime(long createTime) { + this.createTime = createTime; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/service/DeviceForwardPort.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/service/DeviceForwardPort.java new file mode 100644 index 000000000..3532c9daa --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/service/DeviceForwardPort.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.service; + +import ohos.devtools.datasources.transport.hdc.HdcCommandEnum; +import ohos.devtools.datasources.transport.hdc.HdcWrapper; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.util.Locale; + +/** + * 设备转发端口类 + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class DeviceForwardPort { + private static final Logger LOGGER = LogManager.getLogger(DeviceForwardPort.class); + private static volatile DeviceForwardPort instance; + + /** + * getInstance + * + * @return DeviceForwardPort + */ + public static DeviceForwardPort getInstance() { + if (instance == null) { + synchronized (MultiDeviceManager.class) { + if (instance == null) { + instance = new DeviceForwardPort(); + } + } + } + return instance; + } + + private DeviceForwardPort() { + } + + /** + * 设置设备的IP和端口号信息 + * + * @param info info + * @return DeviceIPPortInfo + */ + public DeviceIPPortInfo setDeviceIPPortInfo(DeviceIPPortInfo info) { + String serialNumber = info.getDeviceID(); + while (true) { + int forward = getForwardPort(); + String cmdStr = + String.format(Locale.ENGLISH, HdcCommandEnum.HDC_FOR_PORT.getHdcCommand(), serialNumber, forward); + String res = HdcWrapper.getInstance().getHdcStringResult(cmdStr); + if (!res.contains("cannot bind")) { + info.setForwardPort(forward); + LOGGER.info("prot is {}", res); + break; + } + } + return info; + } + + /** + * getForwardPort + * + * @return int + */ + public int getForwardPort() { + int length = 55535; + int off = 10000; + SecureRandom secureRandom = null; + try { + secureRandom = SecureRandom.getInstanceStrong(); + } catch (NoSuchAlgorithmException noSuchAlgorithmException) { + LOGGER.info("create Random has Execption {}", noSuchAlgorithmException.getMessage()); + return getForwardPort(); + } + int anInt = secureRandom.nextInt(length) + off; + return anInt; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/service/DeviceGrpcThread.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/service/DeviceGrpcThread.java new file mode 100644 index 000000000..6fb85b644 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/service/DeviceGrpcThread.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.service; + +import ohos.devtools.datasources.transport.hdc.HdcCommandEnum; +import ohos.devtools.datasources.transport.hdc.HdcWrapper; +import ohos.devtools.datasources.utils.device.dao.DeviceUtil; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.device.entity.DeviceInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * DeviceGrpcThread + * + * @version 1.0 + * @date 2021/3/4 19:02 + **/ +public class DeviceGrpcThread implements Runnable { + private static final Logger LOGGER = LogManager.getLogger(DeviceGrpcThread.class); + private final DeviceUtil sqlUtil = new DeviceUtil(); + private final HdcWrapper hdcHelper = HdcWrapper.getInstance(); + private DeviceIPPortInfo info; + + public DeviceGrpcThread(DeviceIPPortInfo info) { + this.info = info; + } + + /** + * run + */ + @Override + public void run() { + doGrpcRequest(info); + } + + /** + * doGrpcRequest + * + * @param info info + */ + public void doGrpcRequest(DeviceIPPortInfo info) { + String serialNumber = info.getDeviceID(); + String ip = info.getIp(); + int port = info.getPort(); + int forwardPort = info.getForwardPort(); + + // 进行端口转发 + hdcForward(serialNumber, ip, forwardPort, port); + + // 1.根据serialNumber发送grpc请求 + LOGGER.debug("Device {} sent a grpc request", serialNumber); + + // 2.test: 自己造数据 + DeviceInfo deviceInfo = getDeviceInfo(info); + + // 返回数据后,先清空表数据,再插入。 + sqlUtil.insertDeviceInfo(deviceInfo); + } + + private DeviceInfo getDeviceInfo(DeviceIPPortInfo info) { + DeviceInfo deviceInfo = new DeviceInfo(); + deviceInfo.setDeviceID(info.getDeviceID()); + deviceInfo.setDeviceName(info.getDeviceName()); + deviceInfo.setRamInfo("8GB"); + deviceInfo.setRomInfo("128GB"); + return deviceInfo; + } + + private void hdcForward(String serialNumber, String ip, int forwardPort, int port) { + String cmdStr = + HdcCommandEnum.HDC_STR.getHdcCommand() + " " + " -t " + serialNumber + " " + HdcCommandEnum.HDC_FPORT_STR + .getHdcCommand() + " " + ip + ":" + forwardPort + " " + ip + ":" + port; + LOGGER.debug("pushFile cmdStr = {}", cmdStr); + hdcHelper.getHdcStringResult(cmdStr); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/service/DeviceManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/service/DeviceManager.java new file mode 100644 index 000000000..4b6050ba1 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/service/DeviceManager.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.service; + +import ohos.devtools.datasources.utils.common.util.PrintUtil; +import ohos.devtools.datasources.utils.device.dao.DeviceUtil; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +/** + * 设备管理类 + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public final class DeviceManager { + private static final Logger LOGGER = LogManager.getLogger(DeviceManager.class); + private DeviceIPPortInfo info; + private final DeviceUtil sqlUtil = new DeviceUtil(); + private final ThreadPoolExecutor executor = + new ThreadPoolExecutor(1, 10, 10, TimeUnit.SECONDS, new ArrayBlockingQueue(3), + new ThreadPoolExecutor.DiscardOldestPolicy()); + + /** + * DeviceManager + * + * @param info info + */ + public DeviceManager(DeviceIPPortInfo info) { + this.info = info; + } + + /** + * init + */ + public void init() { + String deviceID = info.getDeviceID(); + if (!sqlUtil.hasDevice(deviceID)) { + executor.execute(new DeviceGrpcThread(info)); + } else { + PrintUtil.print(LOGGER, "The data is already in the device details table", 1); + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/service/MultiDeviceManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/service/MultiDeviceManager.java new file mode 100644 index 000000000..6d113d3ea --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/device/service/MultiDeviceManager.java @@ -0,0 +1,367 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.service; + +import ohos.devtools.datasources.transport.hdc.HdcCommandEnum; +import ohos.devtools.datasources.transport.hdc.HdcWrapper; +import ohos.devtools.datasources.utils.common.Constant; +import ohos.devtools.datasources.utils.device.dao.DeviceUtil; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.device.entity.DeviceInfo; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import static ohos.devtools.datasources.transport.hdc.HdcCommandEnum.HDC_CHECK_SERVER; +import static ohos.devtools.datasources.transport.hdc.HdcCommandEnum.HDC_GET_TYPE; +import static ohos.devtools.datasources.utils.common.Constant.DEVICE_FULL_TYPE; +import static ohos.devtools.datasources.utils.common.Constant.DEVICE_LEAN_TYPE; +import static ohos.devtools.datasources.utils.common.Constant.DEVTOOLS_PLUGINS_V7_PATH; +import static ohos.devtools.datasources.utils.common.Constant.DEVTOOLS_PLUGINS_V8_PATH; +import static ohos.devtools.datasources.utils.common.Constant.UNZIP_SHELL_PLUGINS_PATH; + +/** + * Profiler的监控项 + * + * @since 2021/3/4 10:55 + */ +public final class MultiDeviceManager implements Runnable { + private static final Logger LOGGER = LogManager.getLogger(MultiDeviceManager.class); + + private static volatile MultiDeviceManager instance; + + private final HdcWrapper hdcHelper = HdcWrapper.getInstance(); + + private final DeviceUtil sqlUtil = new DeviceUtil(); + + private ArrayList serialNumberList = new ArrayList<>(); + + private ArrayList> listCliResult; + + private final ThreadPoolExecutor executor = + new ThreadPoolExecutor(1, 10, 10, TimeUnit.SECONDS, new ArrayBlockingQueue(3), + new ThreadPoolExecutor.DiscardOldestPolicy()); + + /** + * getInstance + * + * @return MultiDeviceManager + */ + public static MultiDeviceManager getInstance() { + if (instance == null) { + synchronized (MultiDeviceManager.class) { + if (instance == null) { + instance = new MultiDeviceManager(); + } + } + } + return instance; + } + + private MultiDeviceManager() { + } + + /** + * run + */ + @Override + public synchronized void run() { + init(); + } + + private void init() { + ArrayList> devices = hdcDevices(); + if (devices != null && devices.size() != 0) { + LOGGER.debug("There are currently {} devices connected to the system", devices.size()); + initSerialNumberList(devices); + // 根据serialNumber做相关业务 + doService(); + } else { + LOGGER.debug("No device is currently connected to the system {}", devices); + if (serialNumberList != null && serialNumberList.size() != 0) { + for (DeviceIPPortInfo offinleDevice : serialNumberList) { + SessionManager.getInstance().deleteSessionByOffLineDivece(offinleDevice); + } + serialNumberList.clear(); + } + sqlUtil.deleteAllDeviceIPPortInfo(); + } + } + + private String isServiceCapability(DeviceIPPortInfo deviceIPPortInfo) { + String serialNumber = deviceIPPortInfo.getDeviceID(); + String cmdStr = String.format(Locale.ENGLISH, HDC_CHECK_SERVER.getHdcCommand(), serialNumber); + LOGGER.debug("hiprofilerCliGetport cmdStr = {}", cmdStr); + listCliResult = hdcHelper.getCliResult(cmdStr); + LOGGER.debug("hiprofilerCliGetport getCliResult = {}", listCliResult); + if (listCliResult.isEmpty()) { + return Constant.DEVICE_STAT_NOT_FOUND; + } + ArrayList list = listCliResult.get(0); + if (list.contains(Constant.HIPRO_FILER_RESULT_OK)) { + return Constant.HIPRO_FILER_RESULT_OK; + } else if (list.contains(Constant.DEVICE_STAT_FAIL)) { + return Constant.DEVICE_STAT_FAIL; + } else { + return Constant.DEVICE_STAT_NOT_FOUND; + } + } + + /** + * 获取设备IP和端口号 + * + * @param serialNumber serialNumber + * @return ArrayList> + */ + public ArrayList> getDeviceIPPort(String serialNumber) { + String cmdStr = + HdcCommandEnum.HDC_STR.getHdcCommand() + " " + " -t " + serialNumber + " " + HdcCommandEnum.HDC_SHELL_STR + .getHdcCommand() + " " + " \"chmod +x /data/local/tmp/hiprofiler_cmd &&" + " " + Constant.DEST_PATH + + "/" + Constant.HIPRO_FILER_CMDNAME; + + LOGGER.debug("hiprofilerCliGetport cmdStr = {}", cmdStr); + ArrayList> cliResult = hdcHelper.getCliResult(cmdStr); + LOGGER.debug("hiprofilerCliGetport getCliResult = {}", cliResult); + return cliResult; + } + + private ArrayList> hdcDevices() { + String hdcStr = HdcCommandEnum.HDC_LIST_TARGETS_STR.getHdcCommand(); + LOGGER.debug("init hdcStr = {}", hdcStr); + ArrayList> device = hdcHelper.getListResult(hdcStr); + LOGGER.debug("init devices = {}", device); + return device; + } + + private void initSerialNumberList(ArrayList> devices) { + ArrayList serialNumbers = new ArrayList<>(); + for (ArrayList deviceInfo : devices) { + if (deviceInfo.contains(Constant.DEVICE_STAT_ONLINE)) { + DeviceIPPortInfo info = new DeviceIPPortInfo(); + String deviceId = deviceInfo.get(0); + info.setDeviceID(deviceInfo.get(0)); + String getProtocmd = String.format(Locale.ENGLISH, HDC_GET_TYPE.getHdcCommand(), deviceId); + String result = hdcHelper.getHdcStringResult(getProtocmd); + if (result.contains(DEVICE_FULL_TYPE)) { + info.setDeviceType(DEVICE_FULL_TYPE); + } else { + info.setDeviceType(DEVICE_LEAN_TYPE); + } + String deviceName = ""; + for (String str : deviceInfo) { + deviceName = getString(deviceName, str); + } + info.setDeviceName(deviceName); + serialNumbers.add(info); + } + } + ArrayList offlineDevice = new ArrayList<>(); + for (DeviceIPPortInfo preInfo : serialNumberList) { + String deviceID = preInfo.getDeviceID(); + boolean flag = false; + for (DeviceIPPortInfo info : serialNumbers) { + if (deviceID.equals(info.getDeviceID())) { + flag = true; + break; + } + } + if (!flag) { + offlineDevice.add(preInfo); + } + } + if (offlineDevice != null && offlineDevice.size() != 0) { + LOGGER.debug("offlineDeviceList = {}", offlineDevice); + for (DeviceIPPortInfo device : offlineDevice) { + SessionManager.getInstance().deleteSessionByOffLineDivece(device); + } + } + serialNumberList.clear(); + serialNumberList = serialNumbers; + if (serialNumberList != null && serialNumberList.size() != 0) { + sqlUtil.deleteExceptDeviceIPPort(serialNumberList); + } else { + sqlUtil.deleteAllDeviceIPPortInfo(); + } + } + + private String getString(String deviceName, String str) { + String devName = deviceName; + if (str.contains("product:")) { + String[] split = str.split(":"); + devName = devName + "-" + split[1]; + } + if (str.contains("model:")) { + String[] split = str.split(":"); + devName = split[1] + devName; + } + if (str.contains("transport_id:")) { + String[] split = str.split(":"); + devName = devName + split[1]; + } + return devName; + } + + private void doService() { + for (DeviceIPPortInfo info : serialNumberList) { + String serialNumber = info.getDeviceID(); + String capability = isServiceCapability(info); + if (Constant.HIPRO_FILER_RESULT_OK.equals(capability)) { + // ok 表示具备服务能力 + if (!sqlUtil.hasDeviceIPPort(serialNumber)) { + insertDeviceIPPort(info); + } else { + LOGGER.debug("The data already exists in the data table: {}", serialNumber); + } + } else if (Constant.DEVICE_STAT_NOT_FOUND.equals(capability)) { + // not found 表示还没有端侧的程序 + if (pushHiprofilerTools(info)) { + // 推送成功后,调用脚本解压,并且拉起程序 + boolean pushShellResult = pushDevToolsShell(serialNumber); + if (pushShellResult) { + uzipDevTools(info); + } + String cap = isServiceCapability(info); + if (Constant.HIPRO_FILER_RESULT_OK.equals(cap)) { + if (!sqlUtil.hasDeviceIPPort(serialNumber)) { + insertDeviceIPPort(info); + } else { + LOGGER.debug("The data already exists in the data table: {}", serialNumber); + } + } + } else { + // 推送失败 + LOGGER.debug("Device: {} push hiprofiler_cli failed", serialNumber); + } + } else { + String cmdStr = ""; + if (DEVICE_FULL_TYPE.equals(info.getDeviceType())) { + cmdStr = String + .format(Locale.ENGLISH, HdcCommandEnum.HDC_START_PROFILERD.getHdcCommand(), info.getDeviceID()); + } else if (DEVICE_LEAN_TYPE.equals(info.getDeviceType())) { + cmdStr = String.format(Locale.ENGLISH, HdcCommandEnum.HDC_STARTV7_PROFILERD.getHdcCommand(), + info.getDeviceID()); + } else { + continue; + } + LOGGER.debug("cmdStr = {}", cmdStr); + String result = hdcHelper.execCmdBy(cmdStr); + LOGGER.debug("getStringResult = {}", result); + doService(); + } + } + } + + private void insertDeviceIPPort(DeviceIPPortInfo info) { + int first = 1; + int second = 2; + String ip = listCliResult.get(first).get(first); + int port = Integer.parseInt(listCliResult.get(second).get(first)); + // IP + info.setIp(ip); + // Port + info.setPort(port); + DeviceForwardPort ins = DeviceForwardPort.getInstance(); + DeviceIPPortInfo portInfo = ins.setDeviceIPPortInfo(info); + sqlUtil.insertDeviceIPPortInfo(portInfo); + } + + /** + * pushHiprofilerTools + * + * @param info info + * @return boolean + */ + public boolean pushHiprofilerTools(DeviceIPPortInfo info) { + String cmdStr = ""; + String devToolsPath = SessionManager.getInstance().getPluginPath(); + if (DEVICE_FULL_TYPE.equals(info.getDeviceType())) { + devToolsPath = devToolsPath + DEVTOOLS_PLUGINS_V8_PATH; + cmdStr = String + .format(Locale.ENGLISH, HdcCommandEnum.HDC_PUSH_CMD.getHdcCommand(), info.getDeviceID(), devToolsPath); + } else if (DEVICE_LEAN_TYPE.equals(info.getDeviceType())) { + devToolsPath = devToolsPath + DEVTOOLS_PLUGINS_V7_PATH; + cmdStr = String + .format(Locale.ENGLISH, HdcCommandEnum.HDC_PUSH_CMD.getHdcCommand(), info.getDeviceID(), devToolsPath); + } else { + LOGGER.error("DeviceType error {}", info.getDeviceType()); + } + LOGGER.debug("pushHiprofilerCli cmdStr = {}", cmdStr); + String result = hdcHelper.getHdcStringResult(cmdStr); + LOGGER.debug("pushHiprofilerCli getStringResult = {}", result); + return result.contains(Constant.DEVICE_SATA_STAT_PUSHED); + } + + /** + * pushDevToolsShell + * + * @param serialNumber serialNumber + * @return boolean + */ + public boolean pushDevToolsShell(String serialNumber) { + String uzipPath = SessionManager.getInstance().getPluginPath() + UNZIP_SHELL_PLUGINS_PATH; + String cmdStr = + String.format(Locale.ENGLISH, HdcCommandEnum.HDC_PUSH_OHOS_SHELL.getHdcCommand(), serialNumber, uzipPath); + LOGGER.debug("cmdStr = {}", cmdStr); + String result = hdcHelper.getHdcStringResult(cmdStr); + LOGGER.debug("getStringResult = {}", result); + return result.contains(Constant.DEVICE_SATA_STAT_PUSHED); + } + + /** + * uzipDevTools + * + * @param info info + */ + public void uzipDevTools(DeviceIPPortInfo info) { + String cmdStr = ""; + if (DEVICE_FULL_TYPE.equals(info.getDeviceType())) { + cmdStr = String.format(Locale.ENGLISH, HdcCommandEnum.HDC_RUN_OHOS.getHdcCommand(), info.getDeviceID()); + } else if (DEVICE_LEAN_TYPE.equals(info.getDeviceType())) { + cmdStr = String.format(Locale.ENGLISH, HdcCommandEnum.HDC_RUN_V7_OHOS.getHdcCommand(), info.getDeviceID()); + } else { + LOGGER.error("DeviceType error {}", info.getDeviceType()); + } + LOGGER.debug("cmdStr = {}", cmdStr); + String result = hdcHelper.execCmdBy(cmdStr); + LOGGER.debug("getStringResult = {}", result); + } + + /** + * 获取设备信息 + * + * @return List + */ + public List getDevicesInfo() { + return sqlUtil.getAllDeviceInfo(); + } + + /** + * getAllDeviceIPPortInfos + * + * @return List + */ + public List getAllDeviceIPPortInfos() { + return sqlUtil.getAllDeviceIPPortInfos(); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/monitorconfig/dao/MonitorConfigDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/monitorconfig/dao/MonitorConfigDao.java new file mode 100644 index 000000000..ef94a4b8c --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/monitorconfig/dao/MonitorConfigDao.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.monitorconfig.dao; + +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.utils.common.util.PrintUtil; +import ohos.devtools.datasources.utils.monitorconfig.entity.MonitorInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.List; + +/** + * 监控项配置数据的dao层 + * + * @version 1.0 + * @date 2021/2/25 14:58 + **/ +public class MonitorConfigDao extends AbstractDataStore { + // 日志 + private static final Logger LOGGER = LogManager.getLogger(MonitorConfigDao.class); + private static volatile MonitorConfigDao singleton; + + /** + * Get an instance + * + * @return MonitorConfigDao + */ + public static MonitorConfigDao getInstance() { + if (singleton == null) { + synchronized (MonitorConfigDao.class) { + if (singleton == null) { + singleton = new MonitorConfigDao(); + } + } + } + return singleton; + } + + private MonitorConfigDao() { + } + + /** + * 插入界面返回的监控项采集项数据 + * + * @param monitorInfo monitorInfo + * @return boolean + */ + public boolean insertMonitorInfo(MonitorInfo monitorInfo) { + boolean result = false; + result = insert(monitorInfo); + if (result) { + PrintUtil.print(LOGGER, "local session Data written to the table successfully", 1); + } else { + PrintUtil.print(LOGGER, "local session Failed to write data to table", 1); + } + return true; + } + + /** + * 插入界面返回的监控项采集项数据 + * + * @param monitorInfo monitorInfo + * @return boolean + */ + public boolean insertMonitorInfos(List monitorInfo) { + return insert(monitorInfo); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/monitorconfig/entity/MonitorInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/monitorconfig/entity/MonitorInfo.java new file mode 100644 index 000000000..b82e129b2 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/monitorconfig/entity/MonitorInfo.java @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.monitorconfig.entity; + +import java.util.Objects; + +/** + * MonitorInfo + * + * @version 1.0 + * @date 2021/2/19 14:53 + **/ +public final class MonitorInfo { + private long localSessionId; + private String monitorType; + private String parameter; + private String value; + + /** + * builder + * + * @return Builder + */ + public static Builder builder() { + return new Builder(); + } + + private MonitorInfo(Builder builder) { + localSessionId = builder.localSessionId; + monitorType = builder.monitorType; + parameter = builder.parameter; + value = builder.value; + } + + public long getLocalSessionId() { + return localSessionId; + } + + public void setLocalSessionId(long id) { + this.localSessionId = id; + } + + public String getMonitorType() { + return monitorType; + } + + public void setMonitorType(String type) { + this.monitorType = type; + } + + public String getParameter() { + return parameter; + } + + public void setParameter(String param) { + this.parameter = param; + } + + public String getValue() { + return value; + } + + public void setValue(String worth) { + this.value = worth; + } + + @Override + public String toString() { + return "MonitorInfo{" + "localSessionId=" + localSessionId + ", monitorType='" + monitorType + '\'' + + ", parameter='" + parameter + '\'' + ", value='" + value + '\'' + '}'; + } + + @Override + public boolean equals(Object object) { + if (this == object) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + MonitorInfo that = null; + if (object instanceof MonitorInfo) { + that = (MonitorInfo) object; + } + if (that == null) { + return true; + } + return localSessionId == that.localSessionId && monitorType.equals(that.monitorType) && parameter + .equals(that.parameter) && value.equals(that.value); + } + + @Override + public int hashCode() { + return Objects.hash(localSessionId, monitorType, parameter, value); + } + + /** + * Builder + */ + public static final class Builder { + private long localSessionId; + private String monitorType; + private String parameter; + private String value; + + private Builder() { + } + + /** + * localSessionId + * + * @param id id + * @return Builder + */ + public Builder localSessionId(long id) { + this.localSessionId = id; + return this; + } + + /** + * monitorType + * + * @param type type + * @return Builder + */ + public Builder monitorType(String type) { + this.monitorType = type; + return this; + } + + /** + * 参数 + * + * @param param param + * @return Builder + */ + public Builder parameter(String param) { + this.parameter = param; + return this; + } + + /** + * value + * + * @param worth worth + * @return Builder + */ + public Builder value(String worth) { + this.value = worth; + return this; + } + + /** + * MonitorInfo + * + * @return build + */ + public MonitorInfo build() { + return new MonitorInfo(this); + } + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/monitorconfig/service/MonitorConfigManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/monitorconfig/service/MonitorConfigManager.java new file mode 100644 index 000000000..5bbe766e1 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/monitorconfig/service/MonitorConfigManager.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.monitorconfig.service; + +import com.alibaba.fastjson.JSONObject; +import ohos.devtools.datasources.utils.common.util.PrintUtil; +import ohos.devtools.datasources.utils.monitorconfig.dao.MonitorConfigDao; +import ohos.devtools.datasources.utils.monitorconfig.entity.MonitorInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 监控项配置管理类 + * + * @version 1.0 + * @date 2021/2/2 19:04 + **/ +public class MonitorConfigManager { + /** + * 日志 + */ + private static final Logger LOGGER = LogManager.getLogger(MonitorConfigManager.class); + + /** + * 单例 + */ + private static volatile MonitorConfigManager singleton; + + /** + * dataMap + */ + public static ConcurrentHashMap>> dataMap = new ConcurrentHashMap<>(); + + /** + * getInstance + * + * @return MonitorConfigManager + */ + public static MonitorConfigManager getInstance() { + if (singleton == null) { + synchronized (MonitorConfigManager.class) { + if (singleton == null) { + singleton = new MonitorConfigManager(); + } + } + } + return singleton; + } + + private MonitorConfigManager() { + } + + /** + * analyzeCharTarget + * + * @param localSessionId localSessionId + * @param jsonMonitor jsonMonitor + * @return Map> + */ + public Map> analyzeCharTarget(long localSessionId, JSONObject jsonMonitor) { + // 写表的实体对象传递 + MonitorInfo monitorInfo = null; + LinkedList monitorInfos = new LinkedList<>(); + + // 传递给界面的具体指标项配置(True),通过Dao获取则丢弃这个集合对象 + LinkedList monitor = null; + Map> monitors = new HashMap<>(); + + // 迭代传递的JSON对象解析,并写表 + Iterator> rtn = jsonMonitor.entrySet().iterator(); + while (rtn.hasNext()) { + Map.Entry unit = rtn.next(); + monitor = new LinkedList<>(); + + JSONObject jsonObject = jsonMonitor.getJSONObject(unit.getKey()); + Iterator> iterator = jsonObject.entrySet().iterator(); + + while (iterator.hasNext()) { + Map.Entry next = iterator.next(); + monitorInfo = MonitorInfo.builder().localSessionId(localSessionId).monitorType(unit.getKey()) + .parameter(next.getKey()).value(next.getValue().toString()).build(); + + if ("true".equals(next.getValue().toString())) { + monitor.add(next.getKey()); + } + monitorInfos.add(monitorInfo); + } + + if (monitor.size() > 0) { + // 传递给二级界面的数据monitors + monitors.put(unit.getKey(), monitor); + } + } + + dataMap.put(localSessionId, monitors); + // 解析后的数据先写表 + MonitorConfigDao.getInstance().insertMonitorInfos(monitorInfos); + PrintUtil.print(LOGGER, "analyze Chart Target success", 1); + // 返回界面所有配置(true)的指标项 + return monitors; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/plugin/dao/PlugDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/plugin/dao/PlugDao.java new file mode 100644 index 000000000..bf494a0e9 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/plugin/dao/PlugDao.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.plugin.dao; + +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.utils.plugin.entity.HiProfilerPlugin; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.ArrayList; +import java.util.List; + +/** + * 插件dao层(与sqlite交互) + * + * @version 1.0 + * @date 2021/2/2 15:10 + **/ +public class PlugDao extends AbstractDataStore { + // 日志 + private static final Logger LOGGER = LogManager.getLogger(PlugDao.class); + + private static volatile PlugDao singleton; + + /** + * getInstance + * + * @return PlugDao + */ + public static PlugDao getInstance() { + if (singleton == null) { + synchronized (PlugDao.class) { + if (singleton == null) { + singleton = new PlugDao(); + } + } + } + return singleton; + } + + private PlugDao() { + } + + /** + * 插入自研插件Info信息 + * + * @param hiProfilerPlugin hiProfilerPlugin + * @return boolean + */ + public boolean insertPlugInfo(HiProfilerPlugin hiProfilerPlugin) { + boolean insert = false; + insert = insert(hiProfilerPlugin); + + return insert; + } + + /** + * 保存插件Info信息 + * + * @param deviceId deviceId + * @return List + */ + public List selectPlugConfig(String deviceId) { + return new ArrayList<>(); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/plugin/entity/HiProfilerPlugin.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/plugin/entity/HiProfilerPlugin.java new file mode 100644 index 000000000..5d895123d --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/plugin/entity/HiProfilerPlugin.java @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.plugin.entity; + +import java.util.Arrays; + +/** + * 自研插件的实体类 + * + * @version 1.0 + * @date 2021/2/2 19:03 + **/ +public final class HiProfilerPlugin { + // 设备id + private String deviceId; + + // 插件的基本属性 + private int plugId; + + // 插件的名称 + private String name; + + // 插件的路径 + private String path; + + // 插件的状态 + private int status; + + // 插件的版本 + private String version; + + // 插件的签名 + private String plugSha256; + + // 插件的采集频率 + private int sampleInterval; + + // 插件的采集项配置 + private byte[] configData; + + /** + * 构建方法 + * + * @return Builder + */ + public static Builder builder() { + return new Builder(); + } + + public String getDeviceId() { + return deviceId; + } + + public int getPlugId() { + return plugId; + } + + public String getName() { + return name; + } + + public String getVersion() { + return version; + } + + public int getStatus() { + return status; + } + + public String getPlugSha256() { + return plugSha256; + } + + public int getSampleInterval() { + return sampleInterval; + } + + public byte[] getConfigData() { + if (configData != null) { + return Arrays.copyOf(configData, configData.length); + } else { + return new byte[0]; + } + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + private HiProfilerPlugin(Builder builder) { + deviceId = builder.deviceId; + plugId = builder.plugId; + name = builder.name; + path = builder.path; + status = builder.status; + version = builder.version; + plugSha256 = builder.plugSha256; + sampleInterval = builder.sampleInterval; + configData = builder.configData; + } + + @Override + public String toString() { + return "HiProfilerPlugin{" + "deviceId='" + deviceId + '\'' + ", plugId=" + plugId + ", name='" + name + '\'' + + ", path='" + path + '\'' + ", status=" + status + ", version='" + version + '\'' + ", plugSha256='" + + plugSha256 + '\'' + ", sampleInterval=" + sampleInterval + ", configData=" + Arrays.toString(configData) + + '}'; + } + + /** + * @ClassName: Builder + * @Description: HiProfilerPlugin自研插件的build类 + * @Date: 2021/2/2 19:11 + */ + public static final class Builder { + // 设备id + private String deviceId; + + // 插件的id + private int plugId; + + // 插件的名称 + private String name; + + // 插件的路径 + private String path; + + // 插件的状态 + private int status; + + // 插件的版本 + private String version; + + // 插件的签名 + private String plugSha256; + + // 插件的采集频率 + private int sampleInterval; + + // 插件的采集项配置 + private byte[] configData; + + private Builder() { + } + + /** + * deviceId + * + * @param id id + * @return Builder + */ + public Builder deviceId(String id) { + this.deviceId = id; + return this; + } + + /** + * id方法 + * + * @param pluginId pluginId + * @return Builder + */ + public Builder id(int pluginId) { + this.plugId = pluginId; + return this; + } + + /** + * name + * + * @param plugName plugName + * @return Builder + */ + public Builder name(String plugName) { + this.name = plugName; + return this; + } + + /** + * 路径 + * + * @param path path + * @return Builder + */ + public Builder path(String path) { + this.path = path; + return this; + } + + /** + * version + * + * @param plugVersion plugVersion + * @return Builder + */ + public Builder version(String plugVersion) { + this.version = plugVersion; + return this; + } + + /** + * 插件的状态 + * + * @param plugStatus plugStatus + * @return Builder + */ + public Builder status(int plugStatus) { + this.status = plugStatus; + return this; + } + + /** + * plugSha256 + * + * @param pluginSha256 pluginSha256 + * @return Builder + */ + public Builder plugSha256(String pluginSha256) { + this.plugSha256 = pluginSha256; + return this; + } + + /** + * sampleInterval + * + * @param pluginSampleInterval pluginSampleInterval + * @return Builder + */ + public Builder sampleInterval(int pluginSampleInterval) { + this.sampleInterval = pluginSampleInterval; + return this; + } + + /** + * 配置数据 + * + * @param data data + * @return Builder + */ + public Builder configData(byte[] data) { + if (data != null) { + this.configData = Arrays.copyOf(data, data.length); + } else { + this.configData = new byte[0]; + } + return this; + } + + /** + * build + * + * @return HiProfilerPlugin + */ + public HiProfilerPlugin build() { + return new HiProfilerPlugin(this); + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/plugin/service/PlugManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/plugin/service/PlugManager.java new file mode 100644 index 000000000..57c50dd70 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/plugin/service/PlugManager.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.plugin.service; + +import ohos.devtools.datasources.utils.plugin.dao.PlugDao; +import ohos.devtools.datasources.utils.plugin.entity.HiProfilerPlugin; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.ArrayList; +import java.util.List; + +/** + * 对插件和其配置的管理 + * + * @version 1.0 + * @Date 2021/2/2 15:17 + **/ +public class PlugManager { + // 日志 + private static final Logger LOGGER = LogManager.getLogger(PlugManager.class); + + // 单例 + private static volatile PlugManager singleton; + + /** + * 获取实例 + * + * @return PlugManager + */ + public static PlugManager getInstance() { + if (singleton == null) { + synchronized (PlugManager.class) { + if (singleton == null) { + singleton = new PlugManager(); + } + } + } + return singleton; + } + + private PlugManager() { + } + + /** + * 自研插件配置信息写表 + * + * @param plugin plugin + * @return boolean + */ + public boolean insertPlugInfo(HiProfilerPlugin plugin) { + boolean insert = false; + insert = PlugDao.getInstance().insertPlugInfo(plugin); + return insert; + } + + /** + * 对外提供插件配置信息查询的接口 + * + * @param deviceId deviceId + * @return List HiProfilerPlugin + */ + public List selectPlugConfig(String deviceId) { + List hiProfilerPlugins = new ArrayList<>(); + hiProfilerPlugins = PlugDao.getInstance().selectPlugConfig(deviceId); + return hiProfilerPlugins; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/process/entity/ProcessInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/process/entity/ProcessInfo.java new file mode 100644 index 000000000..7309251b6 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/process/entity/ProcessInfo.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.process.entity; + +/** + * 进程实体 + * + * @version 1.0 + * @date 2021/02/07 11:00 + **/ +public class ProcessInfo { + private String deviceId; + private Integer processId; + private String processName; + private Integer state; + private Integer startTime; + private String arch; + private String agentStatus; + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public Integer getProcessId() { + return processId; + } + + public void setProcessId(Integer processId) { + this.processId = processId; + } + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + + public Integer getState() { + return state; + } + + public void setState(Integer state) { + this.state = state; + } + + public Integer getStartTime() { + return startTime; + } + + public void setStartTime(Integer startTime) { + this.startTime = startTime; + } + + public String getArch() { + return arch; + } + + public void setArch(String arch) { + this.arch = arch; + } + + public String getAgentStatus() { + return agentStatus; + } + + public void setAgentStatus(String agentStatus) { + this.agentStatus = agentStatus; + } + + @Override + public String toString() { + return "ProcessInfo{" + "deviceId='" + deviceId + '\'' + ", processId=" + processId + ", processName='" + + processName + '\'' + ", state=" + state + ", startTime=" + startTime + ", arch='" + arch + '\'' + + ", agentStatus='" + agentStatus + '\'' + '}'; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/process/service/ProcessManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/process/service/ProcessManager.java new file mode 100644 index 000000000..4f9402813 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/process/service/ProcessManager.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.process.service; + +import ohos.devtools.datasources.transport.grpc.HiProfilerClient; +import ohos.devtools.datasources.transport.grpc.service.ProfilerServiceTypes; +import ohos.devtools.datasources.utils.common.util.DateTimeUtil; +import ohos.devtools.datasources.utils.device.dao.DeviceUtil; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.ArrayList; +import java.util.List; + +/** + * 进程数据处理对象 + * + * @version 1.0 + * @date 2021/02/07 11:06 + **/ +public class ProcessManager { + private static final Logger LOGGER = LogManager.getLogger(ProcessManager.class); + + /** + * 单例进程对象 + */ + private static class SingletonClassInstance { + private static final ProcessManager INSTANCE = new ProcessManager(); + } + + /** + * getInstance + * + * @return ProcessManager + */ + public static ProcessManager getInstance() { + return ProcessManager.SingletonClassInstance.INSTANCE; + } + + private ProcessManager() { + } + + /** + * 调用接口,获取进程列表详情数据 + * + * @param deviceInfo 设备对象 + * @return List + * @date 2021/02/07 11:06 + */ + public List getProcessList(DeviceIPPortInfo deviceInfo) { + LOGGER.info("start to GetProcessList {}", DateTimeUtil.getNowTimeLong()); + if (deviceInfo == null || StringUtils.isBlank(deviceInfo.getIp())) { + return new ArrayList(); + } + String deviceId = deviceInfo.getDeviceID(); + DeviceIPPortInfo deviceIPPortInfo = new DeviceUtil().getDeviceIPPortInfo(deviceId); + ProfilerServiceTypes.GetCapabilitiesResponse response = + HiProfilerClient.getInstance().getCapabilities(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort()); + List capabilities = response.getCapabilitiesList(); + List processInfos = new ArrayList<>(); + for (ProfilerServiceTypes.ProfilerPluginCapability profilerPluginCapability : capabilities) { + LOGGER.info("get Device capabilities {}", profilerPluginCapability.getName()); + if (profilerPluginCapability.getName().contains("libmemdataplugin")) { + LOGGER.info("process Session start", DateTimeUtil.getNowTimeLong()); + int sessionId = HiProfilerClient.getInstance() + .requestCreateSession(deviceIPPortInfo.getForwardPort(), profilerPluginCapability.getName(), 0, + true, deviceInfo.getDeviceType()); + if (sessionId == -1) { + LOGGER.info("createSession failed"); + return processInfos; + } + boolean startResult = HiProfilerClient.getInstance() + .requestStartSession(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort(), sessionId); + if (startResult) { + processInfos = HiProfilerClient.getInstance() + .fetchProcessData(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort(), sessionId); + } + Long stopTime = DateTimeUtil.getNowTimeLong(); + LOGGER.info("startStopSession {}", stopTime); + boolean stopRes = HiProfilerClient.getInstance() + .requestStopSession(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort(), sessionId, false); + + LOGGER.info("startStopEndSession {}", DateTimeUtil.getNowTimeLong()); + boolean request = HiProfilerClient.getInstance() + .requestDestroySession(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort(), sessionId); + boolean res = HiProfilerClient.getInstance() + .destroyProfiler(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort()); + LOGGER.info("get ProcessList is {}", processInfos); + return processInfos; + } + } + LOGGER.info("end to GetProcessList {}", DateTimeUtil.getNowTimeLong()); + return processInfos; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/profilerlog/ProfilerLogManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/profilerlog/ProfilerLogManager.java new file mode 100644 index 000000000..9138eb0b8 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/profilerlog/ProfilerLogManager.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.profilerlog; + +import ohos.devtools.datasources.utils.process.service.ProcessManager; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.core.LoggerContext; +import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.config.LoggerConfig; + +/** + * @version 1.0 + * @date 2021/03/12 12:31 + **/ +public class ProfilerLogManager { + private static final Logger LOGGER = LogManager.getLogger(ProcessManager.class); + + /** + * 单例进程对象 + */ + private static ProfilerLogManager singleton = null; + + public static ProfilerLogManager getSingleton() { + if (singleton == null) { + synchronized (ProfilerLogManager.class) { + if (singleton == null) { + singleton = new ProfilerLogManager(); + } + } + } + return singleton; + } + + private Level nowLogLevel = Level.ERROR; + + /** + * 修改日志等级 + * + * @param logLevel loglevel + * @return boolean + */ + public boolean updateLogLevel(Level logLevel) { + if (logLevel == null) { + return false; + } + org.apache.logging.log4j.spi.LoggerContext context = LogManager.getContext(false); + LoggerContext loggerContext = null; + if (context instanceof LoggerContext) { + loggerContext = (LoggerContext) context; + } else { + return false; + } + Configuration config = loggerContext.getConfiguration(); + LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME); + loggerConfig.setLevel(logLevel); + loggerContext.updateLoggers(); + nowLogLevel = logLevel; + return true; + } + + /** + * getNowLogLevel + * + * @return Level + */ + public Level getNowLogLevel() { + return nowLogLevel; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/quartzmanager/QuartzManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/quartzmanager/QuartzManager.java new file mode 100644 index 000000000..90c213f3c --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/quartzmanager/QuartzManager.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.quartzmanager; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +/** + * timed task management + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class QuartzManager { + /** + * DELAY + */ + public static final int DELAY = 0; + + /** + * PERIOD + */ + public static final int PERIOD = 500; + private static final Logger LOGGER = LogManager.getLogger(QuartzManager.class); + private static final long DEFAULT_KEEPALIVE_MILLIS = 10L; + private static volatile QuartzManager instance; + + /** + * getInstance + * + * @return QuartzManager + */ + public static QuartzManager getInstance() { + if (instance == null) { + synchronized (QuartzManager.class) { + if (instance == null) { + instance = new QuartzManager(); + } + } + } + return instance; + } + + private Map runnableHashMap = new ConcurrentHashMap(); + + private Map executorHashMap = + new ConcurrentHashMap(); + + /** + * execution + * + * @param runName runName + * @param runnable runnable + */ + public void addExecutor(String runName, Runnable runnable) { + LOGGER.debug("add scheduleWithFixedDelay{}", runName); + ScheduledExecutorService scheduled = new ScheduledThreadPoolExecutor(1); + executorHashMap.put(runName, scheduled); + runnableHashMap.put(runName, runnable); + } + + /** + * begin Execution + * + * @param runName runName + * @param delay delay + * @param period period + */ + public void startExecutor(String runName, long delay, long period) { + ScheduledExecutorService scheduled = executorHashMap.get(runName); + Runnable runnable = runnableHashMap.get(runName); + if (delay > 0) { + LOGGER.debug("scheduleWithFixedDelay start {}", delay); + scheduled.scheduleWithFixedDelay(runnable, delay, period, TimeUnit.MILLISECONDS); + } else { + LOGGER.debug("scheduleAtFixedRate start {}", delay); + scheduled.scheduleAtFixedRate(runnable, 0, period, TimeUnit.MILLISECONDS); + } + } + + /** + * deleteExecutor + * + * @param runName runName + */ + public void deleteExecutor(String runName) { + executorHashMap.get(runName).shutdown(); + if (runnableHashMap != null && runnableHashMap.size() != 0) { + runnableHashMap.remove(runName); + } + if (executorHashMap != null && executorHashMap.size() != 0) { + executorHashMap.remove(runName); + } + } + + /** + * endExecutor + * + * @param runName runName + */ + public void endExecutor(String runName) { + LOGGER.debug("endScheduledExecutor{}", runName); + executorHashMap.get(runName).shutdown(); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/session/entity/SessionInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/session/entity/SessionInfo.java new file mode 100644 index 000000000..527413318 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/session/entity/SessionInfo.java @@ -0,0 +1,299 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.session.entity; + +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.views.common.LayoutConstants; + +/** + * SessionInfo实体 + * + * @version 1.0 + * @date 2021/2/25 10:50 + **/ +public class SessionInfo { + private static SessionInfo defaultSession; + + /** + * builder + * + * @return Builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * getDefaultInstance + * + * @return SessionInfo + */ + public static SessionInfo getDefaultInstance() { + if (defaultSession == null) { + defaultSession = SessionInfo.builder().build(); + } + return defaultSession; + } + + /** + * Builder + */ + public static class Builder { + private String sessionName; + private int sessionId; + private long startTimestamp; + private long endTimestamp; + private long streamId; + private long pid; + private DeviceIPPortInfo deviceIPPortInfo; + + private Builder() { + } + + /** + * sessionName + * + * @param sessionName sessionName + * @return Builder + */ + public Builder sessionName(String sessionName) { + this.sessionName = sessionName; + return this; + } + + /** + * sessionId + * + * @param sessionId sessionId + * @return Builder + */ + public Builder sessionId(int sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * startTimestamp + * + * @param startTimestamp startTimestamp + * @return Builder + */ + public Builder startTimestamp(long startTimestamp) { + this.startTimestamp = startTimestamp; + return this; + } + + /** + * endTimestamp + * + * @param endTimestamp endTimestamp + * @return Builder + */ + public Builder endTimestamp(long endTimestamp) { + this.endTimestamp = endTimestamp; + return this; + } + + /** + * streamId + * + * @param streamId streamId + * @return Builder + */ + public Builder streamId(long streamId) { + this.streamId = streamId; + return this; + } + + /** + * 获取pid信息方法 + * + * @param pid pid + * @return Builder + */ + public Builder pid(long pid) { + this.pid = pid; + return this; + } + + /** + * 设备IP和端口号信息 + * + * @param deviceIPPortInfo deviceIPPortInfo + * @return Builder + */ + public Builder deviceIPPortInfo(DeviceIPPortInfo deviceIPPortInfo) { + this.deviceIPPortInfo = deviceIPPortInfo; + return this; + } + + /** + * build方法 + * + * @return SessionInfo + */ + public SessionInfo build() { + return new SessionInfo(this); + } + } + + private String sessionName; + private int sessionId; + private long startTimestamp; + private long endTimestamp; + private long streamId; + private long pid; + private boolean startRefsh; + private boolean offlineMode; + + private DeviceIPPortInfo deviceIPPortInfo; + + private SessionInfo(Builder builder) { + sessionName = builder.sessionName; + sessionId = builder.sessionId; + startTimestamp = builder.startTimestamp; + endTimestamp = builder.endTimestamp; + streamId = builder.streamId; + pid = builder.pid; + deviceIPPortInfo = builder.deviceIPPortInfo; + } + + public DeviceIPPortInfo getDeviceIPPortInfo() { + return deviceIPPortInfo; + } + + public String getSessionName() { + return sessionName; + } + + public void setSessionName(String sessionName) { + this.sessionName = sessionName; + } + + public int getSessionId() { + return sessionId; + } + + public void setSessionId(int sessionId) { + this.sessionId = sessionId; + } + + public long getStartTimestamp() { + return startTimestamp; + } + + public void setStartTimestamp(long startTimestamp) { + this.startTimestamp = startTimestamp; + } + + public long getEndTimestamp() { + return endTimestamp == 0 ? Long.MAX_VALUE : endTimestamp; + } + + public void setEndTimestamp(long endTimestamp) { + this.endTimestamp = endTimestamp; + } + + public long getStreamId() { + return streamId; + } + + public void setStreamId(long streamId) { + this.streamId = streamId; + } + + public long getPid() { + return pid; + } + + public void setPid(long pid) { + this.pid = pid; + } + + public boolean isOfflineMode() { + return offlineMode; + } + + public void setOfflineMode(boolean offlineMode) { + this.offlineMode = offlineMode; + } + + /** + * equals + * + * @param object object + * @return boolean + */ + @Override + public boolean equals(Object object) { + if (this == object) { + return true; + } + if (!(object instanceof SessionInfo)) { + return false; + } + SessionInfo session = (SessionInfo) object; + + if (getSessionId() != session.getSessionId()) { + return false; + } + if (getStartTimestamp() != session.getStartTimestamp()) { + return false; + } + if (getEndTimestamp() != session.getEndTimestamp()) { + return false; + } + if (getStreamId() != session.getStreamId()) { + return false; + } + + if (getPid() != session.getPid()) { + return false; + } + + return getSessionName() != null ? getSessionName().equals(session.getSessionName()) : + session.getSessionName() == null; + } + + /** + * hashCode + * + * @return int + */ + @Override + public int hashCode() { + int result = getSessionName() != null ? getSessionName().hashCode() : 0; + result = LayoutConstants.THIRTY_ONE * result + (int) (getSessionId() ^ (getSessionId() + >>> LayoutConstants.THIRTY_TWO)); + result = LayoutConstants.THIRTY_ONE * result + (int) (getStartTimestamp() ^ (getStartTimestamp() + >>> LayoutConstants.THIRTY_TWO)); + result = LayoutConstants.THIRTY_ONE * result + (int) (getEndTimestamp() ^ (getEndTimestamp() + >>> LayoutConstants.THIRTY_TWO)); + result = LayoutConstants.THIRTY_ONE * result + (int) (getStreamId() ^ (getStreamId() + >>> LayoutConstants.THIRTY_TWO)); + result = LayoutConstants.THIRTY_ONE * result + (int) (getPid() ^ (getPid() >>> LayoutConstants.THIRTY_TWO)); + return result; + } + + public boolean isStartRefsh() { + return startRefsh; + } + + public void setStartRefsh(boolean startRefsh) { + this.startRefsh = startRefsh; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/session/service/SessionManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/session/service/SessionManager.java new file mode 100644 index 000000000..91d54689c --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/session/service/SessionManager.java @@ -0,0 +1,840 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.session.service; + +import com.alibaba.fastjson.JSONObject; +import com.intellij.ide.plugins.PluginManager; +import com.intellij.openapi.extensions.PluginId; +import io.grpc.StatusRuntimeException; +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.databases.datatable.MemoryTable; +import ohos.devtools.datasources.databases.datatable.enties.ProcessMemInfo; +import ohos.devtools.datasources.transport.grpc.HiProfilerClient; +import ohos.devtools.datasources.transport.grpc.MemoryPlugHelper; +import ohos.devtools.datasources.transport.grpc.ProfilerClient; +import ohos.devtools.datasources.transport.grpc.ProfilerServiceHelper; +import ohos.devtools.datasources.transport.grpc.service.AgentPluginConfig; +import ohos.devtools.datasources.transport.grpc.service.CommonTypes; +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginConfig; +import ohos.devtools.datasources.transport.grpc.service.ProfilerServiceTypes; +import ohos.devtools.datasources.transport.hdc.HdcWrapper; +import ohos.devtools.datasources.utils.common.Constant; +import ohos.devtools.datasources.utils.common.util.CommonUtil; +import ohos.devtools.datasources.utils.common.util.DateTimeUtil; +import ohos.devtools.datasources.utils.common.util.PrintUtil; +import ohos.devtools.datasources.utils.datahandler.datapoller.DataPoller; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.device.entity.DeviceProcessInfo; +import ohos.devtools.datasources.utils.device.entity.TraceFileInfo; +import ohos.devtools.datasources.utils.monitorconfig.service.MonitorConfigManager; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import ohos.devtools.datasources.utils.session.entity.SessionInfo; +import ohos.devtools.services.memory.ClassInfo; +import ohos.devtools.services.memory.ClassInfoDao; +import ohos.devtools.services.memory.ClassInfoManager; +import ohos.devtools.services.memory.MemoryHeapDao; +import ohos.devtools.services.memory.MemoryHeapInfo; +import ohos.devtools.services.memory.MemoryHeapManager; +import ohos.devtools.services.memory.MemoryInstanceDao; +import ohos.devtools.services.memory.MemoryInstanceDetailsDao; +import ohos.devtools.services.memory.MemoryInstanceDetailsInfo; +import ohos.devtools.services.memory.MemoryInstanceDetailsManager; +import ohos.devtools.services.memory.MemoryInstanceInfo; +import ohos.devtools.services.memory.MemoryInstanceManager; +import ohos.devtools.services.memory.MemoryService; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.JProgressBar; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +import static java.util.Locale.ENGLISH; +import static ohos.devtools.datasources.transport.hdc.HdcCommandEnum.HDC_START_JAVAHEAP; +import static ohos.devtools.datasources.utils.common.Constant.DEVICE_FULL_TYPE; +import static ohos.devtools.datasources.utils.common.Constant.JVMTI_AGENT_PLUG; +import static ohos.devtools.datasources.utils.common.Constant.MEMORY_PLUG; +import static ohos.devtools.datasources.utils.common.Constant.MEMORY_PLUGS; +import static ohos.devtools.views.common.LayoutConstants.TWO_THOUSAND; + +/** + * @Description session Management core class + * @Date 2021/2/7 13:30 + **/ +public class SessionManager { + /** + * Global log + */ + private static final Logger LOGGER = LogManager.getLogger(SessionManager.class); + + /** + * Singleton session. + */ + private static final SessionManager SINGLETON = new SessionManager(); + + /** + * getInstance + * + * @return SessionManager + */ + public static SessionManager getInstance() { + return SessionManager.SINGLETON; + } + + /** + * developMode + */ + private boolean developMode = false; + + /** + * Analyzed Sessions + */ + private HashMap profilingSessions; + + private HashMap dataPollerHashMap = new HashMap<>(); + + private MemoryTable memoTable; + + private ClassInfoDao classInfoDao; + + private MemoryHeapDao memoryHeapDao; + + private MemoryInstanceDao memoryInstanceDao; + + private MemoryInstanceDetailsDao memoryInstanceDetailsDao; + + private List plugs; + + private ProfilerServiceTypes.ProfilerSessionConfig.Builder sessionConfigBuilder; + + private SessionManager() { + profilingSessions = new HashMap<>(); + } + + /** + * Clear session Id directly, use with caution + * + * @param localSessionId localSessionId + */ + public void deleteLocalSession(Long localSessionId) { + if (profilingSessions != null) { + ProfilerChartsView profilerChartsView = ProfilerChartsView.sessionMap.get(localSessionId); + if (profilerChartsView != null) { + profilerChartsView.getObserver().stopRefresh(true); + } + profilingSessions.remove(localSessionId); + } + } + + /** + * Create Session based on device information, process information, and specific scenarios + * + * @param device device + * @param process process + * @param model model + * @param configJson configJson + * @return boolean + * @date 2021/2/7 16:22 + */ + public Long createSession(DeviceIPPortInfo device, ProcessInfo process, int model, JSONObject configJson) { + if (device == null || process == null || configJson == null || device.getForwardPort() == 0) { + return -1L; + } + int sessionId = 0; + // Real-time scene + Long localSessionID = Constant.ABNORMAL; + if (model == Constant.REALTIME_SCENE) { + localSessionID = handleAgentConfig(configJson, device, process); + if (localSessionID == Constant.ABNORMAL) { + return Constant.ABNORMAL; + } + ProfilerServiceTypes.CreateSessionRequest request = ProfilerServiceHelper + .createSessionRequest(CommonUtil.getRequestId(), sessionConfigBuilder.build(), plugs); + ProfilerClient createSessionClient = + HiProfilerClient.getInstance().getProfilerClient(device.getIp(), device.getForwardPort()); + if (createSessionClient.isUsed()) { + LOGGER.error("create Session failed"); + return Constant.ABNORMAL; + } + ProfilerServiceTypes.CreateSessionResponse respon = null; + try { + createSessionClient.setUsed(true); + respon = createSessionClient.createSession(request); + } catch (StatusRuntimeException statusRuntimeException) { + if ("UNAVAILABLE".equals(statusRuntimeException.getStatus().getCode())) { + HiProfilerClient.getInstance().destroyProfiler(device.getIp(), device.getForwardPort()); + } + LOGGER.error("status RuntimeException getStatus:{}", statusRuntimeException.getStatus()); + return Constant.ABNORMAL; + } + sessionId = respon.getSessionId(); + createSessionClient.setUsed(false); + } + int pid = process.getProcessId(); + String deviceId = device.getDeviceID(); + String sessionName = CommonUtil.generateSessionName(deviceId, pid); + SessionInfo session = + SessionInfo.builder().sessionId(sessionId).sessionName(sessionName).deviceIPPortInfo(device).build(); + // 建立LocalSessionId和端侧session的关系 + profilingSessions.put(localSessionID, session); + if (sessionId != 0) { + PrintUtil.print(LOGGER, "Task with Session created successfully.", 0); + return localSessionID; + } else { + LOGGER.error("Failed to create task with Session!"); + return Constant.ABNORMAL; + } + } + + private long handleAgentConfig(JSONObject configJson, DeviceIPPortInfo device, ProcessInfo process) { + long localSessionID = CommonUtil.getLocalSessionId(); + String agentPlug = "jvmtiagent_" + process.getProcessName(); + boolean startJavaHeap = isStartJavaHeap(device, agentPlug); + String proc = process.getProcessName(); + MonitorConfigManager.getInstance().analyzeCharTarget(localSessionID, configJson); + if (StringUtils.isNotBlank(proc) && (!startJavaHeap)) { + String hdcCommand = String.format(ENGLISH, HDC_START_JAVAHEAP.getHdcCommand(), device.getDeviceID(), proc); + String res = HdcWrapper.getInstance().getHdcStringResult(hdcCommand); + if (res.contains("javaHeapSuccess")) { + startJavaHeap = true; + } + } + LOGGER.info("Start agent status is {} ", startJavaHeap); + ProfilerServiceTypes.GetCapabilitiesResponse capabilitiesRes = + HiProfilerClient.getInstance().getCapabilities(device.getIp(), device.getForwardPort()); + List capability = capabilitiesRes.getCapabilitiesList(); + sessionConfigBuilder = ProfilerServiceTypes.ProfilerSessionConfig.newBuilder() + .setSessionMode(ProfilerServiceTypes.ProfilerSessionConfig.Mode.ONLINE); + if (capability == null || capability.size() == 0) { + localSessionID = Constant.ABNORMAL; + } + List memPlug = getLibmemdataplugin(capability, MEMORY_PLUGS); + List list = getLibmemdataplugin(capability, agentPlug); + plugs = new ArrayList<>(); + MemoryPluginConfig.MemoryConfig plug = getConfig(device, process); + if (!memPlug.isEmpty()) { + ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.Builder memoryBuffer = getBuilder(); + CommonTypes.ProfilerPluginConfig plugConfig = + ProfilerServiceHelper.profilerPluginConfig(memPlug.get(0).getName(), "", 40, plug.toByteString()); + sessionConfigBuilder.addBuffers(memoryBuffer); + plugs.add(plugConfig); + } + if (startJavaHeap && (!list.isEmpty())) { + AgentPluginConfig.AgentConfig agent = + AgentPluginConfig.AgentConfig.newBuilder().setPid(process.getProcessId()).build(); + CommonTypes.ProfilerPluginConfig jvmTiAgent = + ProfilerServiceHelper.profilerPluginConfig(list.get(0).getName(), "", 100, agent.toByteString()); + ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.Builder javaHeapBuffer = + ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.newBuilder().setPages(TWO_THOUSAND) + .setPolicy(ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.Policy.RECYCLE); + sessionConfigBuilder.addBuffers(javaHeapBuffer); + plugs.add(jvmTiAgent); + } + if (plugs.isEmpty()) { + localSessionID = Constant.ABNORMAL; + } + return localSessionID; + } + + private List getLibmemdataplugin( + List capabilities, String libmemdataplugin) { + return capabilities.stream() + .filter(profilerPluginCapability -> profilerPluginCapability.getName().contains(libmemdataplugin)) + .collect(Collectors.toList()); + } + + private boolean isStartJavaHeap(DeviceIPPortInfo device, String agentPlugName) { + boolean startJavaHeap = false; + ProfilerServiceTypes.GetCapabilitiesResponse response = + HiProfilerClient.getInstance().getCapabilities(device.getIp(), device.getForwardPort()); + List capabilitiesResponse = response.getCapabilitiesList(); + List agentStatus = + getLibmemdataplugin(capabilitiesResponse, agentPlugName); + if (!agentStatus.isEmpty()) { + startJavaHeap = true; + } + return startJavaHeap; + } + + private ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.Builder getBuilder() { + return ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.newBuilder().setPages(LayoutConstants.TEN) + .setPolicy(ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.Policy.RECYCLE); + } + + private MemoryPluginConfig.MemoryConfig getConfig(DeviceIPPortInfo device, ProcessInfo process) { + MemoryPluginConfig.MemoryConfig plug; + if (DEVICE_FULL_TYPE.equals(device.getDeviceType())) { + plug = MemoryPlugHelper.createMemRequest(process.getProcessId(), false, true, true, true); + } else { + plug = MemoryPlugHelper.createMemRequest(process.getProcessId(), false, true, true, false); + } + return plug; + } + + /** + * Establish a session with the end side and start the session. + * + * @param localSessionId Local Session Id + * @param restartFlag Whether to start again + * @return boolean + * @date 2021/2/4 17:37 + */ + public boolean startSession(Long localSessionId, boolean restartFlag) { + if (localSessionId == null) { + return false; + } + SessionInfo session = profilingSessions.get(localSessionId); + if (session == null) { + return true; + } + if (restartFlag) { + // Click start, delete the previous data first + MemoryService.getInstance().deleteSessionData(localSessionId); + deleteAllAgentData(localSessionId, false); + } + int sessionId = session.getSessionId(); + DeviceIPPortInfo device = session.getDeviceIPPortInfo(); + return HiProfilerClient.getInstance().requestStartSession(device.getIp(), device.getForwardPort(), sessionId); + } + + /** + * Turn on polling to get data + * + * @param localSessionId localSessionId + * @return boolean Turn on polling + * @date 2021/2/22 14:57 + */ + public boolean fetchData(Long localSessionId) { + try { + if (localSessionId == null || localSessionId <= 0) { + return false; + } + SessionInfo session = profilingSessions.get(localSessionId); + if (session == null) { + return true; + } + DeviceIPPortInfo device = session.getDeviceIPPortInfo(); + ProfilerClient client = + HiProfilerClient.getInstance().getProfilerClient(device.getIp(), device.getForwardPort()); + if (client.isUsed()) { + return false; + } + client.setUsed(true); + HashMap map = new HashMap(); + map.put(MEMORY_PLUG, new MemoryTable()); + map.put(JVMTI_AGENT_PLUG, new ClassInfoDao()); + map.put("jvmtiagentDetails", new MemoryInstanceDetailsDao()); + map.put("jvmtiagentInstance", new MemoryInstanceDao()); + map.put("jvmtiagentMemoryHeap", new MemoryHeapDao()); + LOGGER.info("start new DataPoller {}", DateTimeUtil.getNowTimeLong()); + int sessionId = session.getSessionId(); + DataPoller dataPoller = new DataPoller(localSessionId, sessionId, client, map); + dataPoller.start(); + dataPollerHashMap.put(localSessionId, dataPoller); + return true; + } catch (Exception exception) { + LOGGER.error(exception.getMessage()); + return false; + } + } + + /** + * isRefsh + * + * @param localSessionId localSessionId + * @return boolean + */ + public SessionInfo isRefsh(Long localSessionId) { + return profilingSessions.get(localSessionId); + } + + /** + * View stop Loading + * + * @param localSession local Session + * @param firstTimeStamp first Time Stamp + */ + public void stopLoadingView(Long localSession, long firstTimeStamp) { + SessionInfo sessionInfo = profilingSessions.get(localSession); + if (sessionInfo != null) { + sessionInfo.setStartTimestamp(firstTimeStamp); + sessionInfo.setStartRefsh(true); + profilingSessions.put(localSession, sessionInfo); + } + } + + /** + * stop Session + * + * @param localSessionId localSessionId + * @return boolean Stop success indicator + * @date 2021/2/20 16:20 + */ + public boolean endSession(Long localSessionId) { + if (localSessionId == null || localSessionId <= 0) { + return false; + } + SessionInfo session = profilingSessions.get(localSessionId); + if (session == null) { + return true; + } + session.setStartRefsh(false); + int sessionId = session.getSessionId(); + DeviceIPPortInfo device = session.getDeviceIPPortInfo(); + boolean stopSessionRes = + HiProfilerClient.getInstance().requestStopSession(device.getIp(), device.getForwardPort(), sessionId, true); + if (stopSessionRes) { + DataPoller dataPoller = dataPollerHashMap.get(localSessionId); + if (dataPoller != null) { + dataPoller.shutDown(); + } + + PrintUtil.print(LOGGER, "Task with Session stopped successfully.", 0); + } else { + LOGGER.error("Failed to stop task with Session!"); + } + return stopSessionRes; + } + + /** + * Delete the Session session interface + * + * @param localSessionId localSessionId + * @return boolean Is the deletion successful + */ + public boolean deleteSession(Long localSessionId) { + try { + if (localSessionId == null || localSessionId <= 0) { + return false; + } + SessionInfo session = profilingSessions.get(localSessionId); + if (session == null) { + return false; + } + // Delete session information in local memory + profilingSessions.remove(localSessionId); + // Delete the data information related to the session of the database + MemoryService.getInstance().deleteSessionData(localSessionId); + deleteAllAgentData(localSessionId, true); + if (session.isOfflineMode()) { + return true; + } + int sessionId = session.getSessionId(); + DeviceIPPortInfo device = session.getDeviceIPPortInfo(); + boolean stopSessionRes = HiProfilerClient.getInstance() + .requestStopSession(device.getIp(), device.getForwardPort(), sessionId, true); + // Delete collection item + if (stopSessionRes) { + boolean destroySessionRes = false; + try { + destroySessionRes = HiProfilerClient.getInstance() + .requestDestroySession(device.getIp(), device.getForwardPort(), sessionId); + if (destroySessionRes) { + DataPoller dataPooler = dataPollerHashMap.get(localSessionId); + if (dataPooler != null) { + dataPooler.shutDown(); + } + HiProfilerClient.getInstance().destroyProfiler(device.getIp(), device.getForwardPort()); + } + } catch (StatusRuntimeException exception) { + LOGGER.error(exception.getMessage()); + } + PrintUtil.print(LOGGER, "Task with Session deleted successfully.", 0); + return destroySessionRes; + } else { + LOGGER.error("Failed to delete task with Session "); + return false; + } + } finally { + if (localSessionId != null && localSessionId > 0) { + MemoryService.getInstance().deleteSessionData(localSessionId); + deleteAllAgentData(localSessionId, true); + } + } + } + + private void deleteAllAgentData(Long localSessionId, boolean deleteClassInfo) { + if (memoTable == null) { + memoTable = new MemoryTable(); + } + if (memoryHeapDao == null) { + memoryHeapDao = new MemoryHeapDao(); + } + if (memoryInstanceDao == null) { + memoryInstanceDao = new MemoryInstanceDao(); + } + if (classInfoDao == null) { + classInfoDao = new ClassInfoDao(); + } + if (memoryInstanceDetailsDao == null) { + memoryInstanceDetailsDao = new MemoryInstanceDetailsDao(); + } + if (deleteClassInfo) { + classInfoDao.deleteSessionData(localSessionId); + } + memoryHeapDao.deleteSessionData(localSessionId); + memoryInstanceDao.deleteSessionData(localSessionId); + memoryInstanceDetailsDao.deleteSessionData(localSessionId); + } + + /** + * Used to notify the end side to close all session connections after the IDE is closed. + */ + public void stopAllSession() { + if (profilingSessions.isEmpty()) { + return; + } + profilingSessions.values().forEach(sessionInfo -> { + HiProfilerClient hiprofiler = HiProfilerClient.getInstance(); + DeviceIPPortInfo device = sessionInfo.getDeviceIPPortInfo(); + if (device != null) { + hiprofiler + .requestStopSession(device.getIp(), device.getForwardPort(), sessionInfo.getSessionId(), true); + hiprofiler.requestDestroySession(device.getIp(), device.getForwardPort(), sessionInfo.getSessionId()); + hiprofiler.destroyProfiler(device.getIp(), device.getForwardPort()); + } + }); + } + + /** + * Save the collected data to a file. + * + * @param sessionId sessionId + * @param deviceProcessInfo deviceProcessInfo + * @param pathname pathname + * @return boolean + */ + public boolean saveSessionDataToFile(long sessionId, DeviceProcessInfo deviceProcessInfo, String pathname) { + if (sessionId <= 0 || deviceProcessInfo == null || StringUtils.isEmpty(pathname)) { + return false; + } + List memInfoList = MemoryService.getInstance().getAllData(sessionId); + List classInfos = new ClassInfoManager().getAllClassInfoData(sessionId); + List memoryHeapInfos = new MemoryHeapManager().getAllMemoryHeapInfos(sessionId); + List detailsInfos = new MemoryInstanceDetailsManager().getAllMemoryInstanceDetails(); + ArrayList memoryInstanceInfos = new MemoryInstanceManager().getAllMemoryInstanceInfos(); + FileOutputStream fileOutputStream = null; + ObjectOutputStream objectOutputStream = null; + try { + File file = new File(pathname); + fileOutputStream = new FileOutputStream(file); + objectOutputStream = new ObjectOutputStream(fileOutputStream); + // Start importing the number of meminfo in an object record file + TraceFileInfo startObj = new TraceFileInfo(); + int recordNum = memInfoList.size() + classInfos.size() + memoryHeapInfos.size() + detailsInfos.size() + + memoryInstanceInfos.size(); + startObj.setRecordNum(recordNum); + startObj.setCreateTime(new Date().getTime()); + // Set the trace file version, the subsequent file save content format changes and is not compatible with + // the previous file, you need to modify the version number, and you need to modify the version number + // in the local Session Data From File method. + startObj.setVersion("V1.0"); + objectOutputStream.writeObject(startObj); + + for (int index = 0; index < memInfoList.size(); index++) { + ProcessMemInfo memObject = memInfoList.get(index); + objectOutputStream.writeObject(memObject); + if (index == 0) { + deviceProcessInfo.setStartTime(memObject.getTimeStamp()); + } + if (index == (memInfoList.size() - 1)) { + deviceProcessInfo.setEndTime(memObject.getTimeStamp()); + } + } + writeCollectionData(objectOutputStream, classInfos, memoryHeapInfos, detailsInfos, memoryInstanceInfos); + objectOutputStream.writeObject(deviceProcessInfo); + PrintUtil.print(LOGGER, "Task with Session ID {} Save To File successfully.", 0); + } catch (IOException exception) { + return false; + } finally { + closeIoStream(null, null, fileOutputStream, objectOutputStream); + } + return true; + } + + private void writeCollectionData(ObjectOutputStream objectOutputStream, List classInfos, + List memoryHeapInfos, List detailsInfos, + ArrayList memoryInstanceInfos) throws IOException { + for (ClassInfo classInfo : classInfos) { + objectOutputStream.writeObject(classInfo); + } + for (MemoryHeapInfo memoryHeapInfo : memoryHeapInfos) { + objectOutputStream.writeObject(memoryHeapInfo); + } + for (MemoryInstanceDetailsInfo instanceDetailsInfo : detailsInfos) { + objectOutputStream.writeObject(instanceDetailsInfo); + } + for (int index = 0; index < memoryInstanceInfos.size(); index++) { + MemoryInstanceInfo instanceInfo = memoryInstanceInfos.get(index); + objectOutputStream.writeObject(instanceInfo); + } + } + + /** + * local Session Data From File + * + * @param jProgressBar jProgressBar + * @param file file + * @return Optional + */ + public Optional localSessionDataFromFile(JProgressBar jProgressBar, File file) { + if (jProgressBar == null || file == null) { + return Optional.ofNullable(null); + } + FileInputStream fileInputStream = null; + ObjectInputStream objectInputStream = null; + DeviceProcessInfo deviceProcessInfo = null; + try { + fileInputStream = new FileInputStream(file); + objectInputStream = new ObjectInputStream(fileInputStream); + Object firstObj = objectInputStream.readObject(); + TraceFileInfo traceFileInfo = null; + if (firstObj instanceof TraceFileInfo) { + traceFileInfo = (TraceFileInfo) firstObj; + if (!"V1.0".equals(traceFileInfo.getVersion())) { + // The trace file is not the latest version + return Optional.empty(); + } + } else { + // The trace file is not the latest version + return Optional.empty(); + } + deviceProcessInfo = loadFileInDataBase(jProgressBar, traceFileInfo, objectInputStream); + } catch (IOException | ClassNotFoundException exception) { + if (exception.getMessage().indexOf("invalid stream header") >= 0) { + if (file.getName().indexOf(".bin") >= 0) { + return Optional.empty(); + } + return Optional.empty(); + } + LOGGER.error("load Data Error {}", exception.getMessage()); + return Optional.empty(); + } finally { + closeIoStream(fileInputStream, objectInputStream, null, null); + } + long localSessionId = deviceProcessInfo.getLocalSessionId(); + SessionInfo session = SessionInfo.builder().sessionName(String.valueOf(localSessionId)).build(); + session.setOfflineMode(true); + profilingSessions.put(localSessionId, session); + jProgressBar.setValue(LayoutConstants.HUNDRED); + return Optional.of(deviceProcessInfo); + } + + private DeviceProcessInfo loadFileInDataBase(JProgressBar jProgressBar, TraceFileInfo traceFileInfo, + ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { + List processMemInfoList = new ArrayList(); + List classInfos = new ArrayList<>(); + List memoryHeapInfos = new ArrayList<>(); + List instanceInfos = new ArrayList<>(); + List detailsInfos = new ArrayList<>(); + long objNum = traceFileInfo.getRecordNum() + 1; + long currentNum = 0; + while (true) { + Object object = objectInputStream.readObject(); + if (object instanceof DeviceProcessInfo) { + // Finally, if there is still data in the datalist, import the database + if ((!processMemInfoList.isEmpty()) || (!classInfos.isEmpty()) || (!memoryHeapInfos.isEmpty()) + || (!instanceInfos.isEmpty()) || (!detailsInfos.isEmpty())) { + extracted(processMemInfoList, classInfos, memoryHeapInfos, instanceInfos, detailsInfos); + currentNum = currentNum + processMemInfoList.size(); + int progress = (int) (currentNum * LayoutConstants.HUNDRED / objNum); + jProgressBar.setValue(progress); + } + DeviceProcessInfo deviceProcessInfo = (DeviceProcessInfo) object; + return deviceProcessInfo; + } else if (object instanceof ClassInfo) { + ClassInfo classInfo = (ClassInfo) object; + classInfos.add(classInfo); + insertDataToDataBase(classInfos, false); + } else if (object instanceof MemoryHeapInfo) { + MemoryHeapInfo memoryHeapInfo = (MemoryHeapInfo) object; + memoryHeapInfos.add(memoryHeapInfo); + insertDataToDataBase(memoryHeapInfos, false); + } else if (object instanceof MemoryInstanceDetailsInfo) { + MemoryInstanceDetailsInfo detailsInfo = (MemoryInstanceDetailsInfo) object; + detailsInfos.add(detailsInfo); + insertDataToDataBase(detailsInfos, false); + } else if (object instanceof MemoryInstanceInfo) { + MemoryInstanceInfo memoryInstanceInfo = (MemoryInstanceInfo) object; + instanceInfos.add(memoryInstanceInfo); + insertDataToDataBase(instanceInfos, false); + } else if (object instanceof ProcessMemInfo) { + ProcessMemInfo processMem = (ProcessMemInfo) object; + processMemInfoList.add(processMem); + insertDataToDataBase(processMemInfoList, false); + } else { + continue; + } + currentNum = currentNum + 1; + loadPercentage(jProgressBar, objNum, currentNum); + } + } + + private void loadPercentage(JProgressBar jProgressBar, long objNum, long currentNum) { + int progress = (int) (currentNum * LayoutConstants.HUNDRED / objNum); + double result = progress % 25; + if (result == 0) { + jProgressBar.setValue(progress); + } + } + + private void extracted(List processMemInfoList, List classInfos, + List memoryHeapInfos, List instanceInfos, + List detailsInfos) { + insertDataToDataBase(processMemInfoList, true); + insertDataToDataBase(classInfos, true); + insertDataToDataBase(memoryHeapInfos, true); + insertDataToDataBase(instanceInfos, true); + insertDataToDataBase(detailsInfos, true); + } + + private void closeIoStream(FileInputStream fileInputStream, ObjectInputStream objectInputStream, + FileOutputStream fileOutputStream, ObjectOutputStream objectOutputStream) { + if (fileInputStream != null) { + try { + fileInputStream.close(); + } catch (IOException exception) { + LOGGER.error("exception:{}", exception.getMessage()); + } + } + if (objectInputStream != null) { + try { + objectInputStream.close(); + } catch (IOException exception) { + LOGGER.error("exception:{}", exception.getMessage()); + } + } + if (fileOutputStream != null) { + try { + fileOutputStream.close(); + } catch (IOException exception) { + LOGGER.error("exception:{}", exception.getMessage()); + } + } + if (objectOutputStream != null) { + try { + objectOutputStream.close(); + } catch (IOException exception) { + LOGGER.error("exception:{}", exception.getMessage()); + } + } + } + + private void insertDataToDataBase(List dataList, boolean endData) { + if (dataList.size() < LayoutConstants.THREE_HUNDRED) { + if (!endData) { + return; + } + } + if (dataList.size() == 0) { + return; + } + if (memoTable == null) { + memoTable = new MemoryTable(); + } + if (memoryHeapDao == null) { + memoryHeapDao = new MemoryHeapDao(); + } + if (memoryInstanceDao == null) { + memoryInstanceDao = new MemoryInstanceDao(); + } + if (classInfoDao == null) { + classInfoDao = new ClassInfoDao(); + } + if (memoryInstanceDetailsDao == null) { + memoryInstanceDetailsDao = new MemoryInstanceDetailsDao(); + } + Object object = dataList.get(0); + if (object instanceof ClassInfo) { + classInfoDao.insertClassInfos(dataList); + } else if (object instanceof MemoryHeapInfo) { + memoryHeapDao.insertMemoryHeapInfos(dataList); + } else if (object instanceof MemoryInstanceDetailsInfo) { + memoryInstanceDetailsDao.insertMemoryInstanceDetailsInfo(dataList); + } else if (object instanceof MemoryInstanceInfo) { + memoryInstanceDao.insertMemoryInstanceInfos(dataList); + } else if (object instanceof ProcessMemInfo) { + memoTable.insertProcessMemInfo(dataList); + } else { + return; + } + dataList.clear(); + } + + /** + * delete Session By OffLine Divece + * + * @param device device + */ + public void deleteSessionByOffLineDivece(DeviceIPPortInfo device) { + if (profilingSessions.isEmpty() || device == null) { + return; + } + Set sessionIds = profilingSessions.keySet(); + for (Long session : sessionIds) { + SessionInfo sessionInfo = profilingSessions.get(session); + HiProfilerClient hiprofiler = HiProfilerClient.getInstance(); + DeviceIPPortInfo deviceSource = sessionInfo.getDeviceIPPortInfo(); + if (device.getDeviceID().equals(deviceSource.getDeviceID())) { + // 停止chart刷新 + ProfilerChartsView.sessionMap.get(session).getObserver().stopRefresh(true); + profilingSessions.remove(session); + } + } + } + + /** + * get Plugin Path + * + * @return String plugin Path + */ + public String getPluginPath() { + String pluginPath = ""; + if (developMode) { + pluginPath = "C:\\ohos\\"; + } else { + PluginId plugin = PluginManager.getPluginByClassName(this.getClass().getName()); + if (plugin != null) { + File path = PluginManager.getPlugin(plugin).getPath(); + try { + pluginPath = path.getCanonicalPath() + "\\ohos\\"; + } catch (IOException ioException) { + LOGGER.error("ioException {}", ioException.getMessage()); + } + } + } + LOGGER.debug("path is {}", pluginPath); + return pluginPath; + } + + public void setDevelopMode(boolean developMode) { + this.developMode = developMode; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/trace/service/TraceManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/trace/service/TraceManager.java new file mode 100644 index 000000000..b323bc84d --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/datasources/utils/trace/service/TraceManager.java @@ -0,0 +1,321 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.trace.service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import io.grpc.StatusRuntimeException; + +import com.google.protobuf.ByteString; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import ohos.devtools.datasources.transport.grpc.HiProfilerClient; +import ohos.devtools.datasources.transport.grpc.ProfilerClient; +import ohos.devtools.datasources.transport.grpc.ProfilerServiceHelper; +import ohos.devtools.datasources.transport.grpc.service.BytracePluginConfigOuterClass; +import ohos.devtools.datasources.transport.grpc.service.CommonTypes; +import ohos.devtools.datasources.transport.grpc.service.ProfilerServiceTypes; +import ohos.devtools.datasources.transport.grpc.service.PtracePluginConfigOuterClass; +import ohos.devtools.datasources.transport.grpc.service.TracePluginConfigOuterClass; +import ohos.devtools.datasources.utils.common.GrpcException; +import ohos.devtools.datasources.utils.common.util.BeanUtil; +import ohos.devtools.datasources.utils.common.util.CommonUtil; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.process.service.ProcessManager; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.SystemTunningProbesCheckbox; + +/** + * get trace data + * + * @version 1.0 + * @date 2021/04/12 17:07 + **/ +public class TraceManager { + private static final Logger LOGGER = LogManager.getLogger(ProcessManager.class); + + /** + * 单例进程对象 + */ + private static TraceManager singleton; + + /** + * 获取实例 + * + * @return TraceManager + */ + public static TraceManager getSingleton() { + if (singleton == null) { + synchronized (ProcessManager.class) { + if (singleton == null) { + singleton = new TraceManager(); + } + } + } + return singleton; + } + + /** + * 请求通过ptrace获取数据 + * + * @param deviceIPPortInfo deviceIPPortInfo + * @param getUserCheckBoxForPerfettoStr getUserCheckBoxForPerfettoStr + * @param isReturn isReturn + * @param maxDurationParam maxDurationParam + * @return String + * @throws GrpcException GrpcException + */ + public String createSessionRequestPerfetto(DeviceIPPortInfo deviceIPPortInfo, String getUserCheckBoxForPerfettoStr, + int maxDurationParam, Boolean isReturn) throws GrpcException { + HiProfilerClient hiprofiler = HiProfilerClient.getInstance(); + ProfilerClient client = + hiprofiler.getProfilerClient(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort()); + // 获取插件名称 + ProfilerServiceTypes.GetCapabilitiesResponse response = + HiProfilerClient.getInstance().getCapabilities(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort()); + List capabilitiesList = response.getCapabilitiesList(); + ProfilerServiceTypes.ProfilerPluginCapability profilerPluginCapability = + capabilitiesList.stream().filter(item -> item.getName().contains("libptrace")).findFirst().get(); + String pluginName = profilerPluginCapability.getName(); + PtracePluginConfigOuterClass.PtracePluginConfig.Builder build = + PtracePluginConfigOuterClass.PtracePluginConfig.newBuilder(); + build.setConfigText(getUserCheckBoxForPerfettoStr); + build.setResultPath("/data/local/tmp/hiprofiler_data.ptrace"); + PtracePluginConfigOuterClass.PtracePluginConfig config = build.build(); + ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig bf = + ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.newBuilder().setPages(LayoutConstants.NUMBER_THREAD) + .setPolicy(ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.Policy.RECYCLE).build(); + ProfilerServiceTypes.ProfilerSessionConfig sessionConfig = + ProfilerServiceTypes.ProfilerSessionConfig.newBuilder() + .setSessionMode(ProfilerServiceTypes.ProfilerSessionConfig.Mode.OFFLINE).addBuffers(bf) + .setResultFile("/data/local/tmp/hiprofiler_data.ptrace").build(); + CommonTypes.ProfilerPluginConfig plugConfig = + CommonTypes.ProfilerPluginConfig.newBuilder().setName(pluginName).setPluginSha256("111") + .setSampleInterval(1).setConfigData(config.toByteString()).build(); + ProfilerServiceTypes.CreateSessionRequest request = + ProfilerServiceTypes.CreateSessionRequest.newBuilder().setRequestId(1).setSessionConfig(sessionConfig) + .addPluginConfigs(plugConfig).build(); + if (isReturn) { + return getUserCheckBoxForPerfettoStr; + } else { + // 通知端侧要用那些插件(分配资源) + ProfilerServiceTypes.CreateSessionResponse response1 = client.createSession(request); + ProfilerServiceTypes.StartSessionRequest requestStartSession = ProfilerServiceHelper + .startSessionRequest(CommonUtil.getRequestId(), response1.getSessionId(), new ArrayList<>()); + // 调用哪些进程(采集数据) + ProfilerServiceTypes.StartSessionResponse startSessionResponse = client.startSession(requestStartSession); + return String.valueOf(response1.getSessionId()); + } + } + + /** + * stopSession、destroySessionRequest + * + * @param deviceIPPortInfo deviceIPPortInfo + * @param sessionIdParam sessionIdParam + */ + public void stopAndDestroySession(DeviceIPPortInfo deviceIPPortInfo, String sessionIdParam) { + // 停止和销毁session + int sessionId = Integer.valueOf(sessionIdParam); + HiProfilerClient hiprofiler = HiProfilerClient.getInstance(); + ProfilerClient client = + hiprofiler.getProfilerClient(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort()); + ProfilerServiceTypes.StopSessionRequest stopSession = + ProfilerServiceHelper.stopSessionRequest(CommonUtil.getRequestId(), sessionId); + HiProfilerClient.getInstance() + .requestStopSession(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort(), sessionId, true); + ProfilerServiceTypes.DestroySessionRequest req = + ProfilerServiceHelper.destroySessionRequest(CommonUtil.getRequestId(), sessionId); + try { + client.destroySession(req); + } catch (StatusRuntimeException exception) { + HiProfilerClient.getInstance() + .requestDestroySession(deviceIPPortInfo.getIp(), deviceIPPortInfo.getPort(), sessionId); + } + client.setUsed(false); + } + + /** + * request start session + * + * @param deviceIPPortInfo device IP Port Info + * @param getUserCheckBoxForPerfettoStr getUserCheckBoxForPerfettoStr + * @param maxDurationParam maxDurationParam + * @param inMemoryValue inMemoryValue + * @param isReturn isReturn + * @return String + * @throws GrpcException GrpcException + */ + public String createSessionByTraceRequest(DeviceIPPortInfo deviceIPPortInfo, String getUserCheckBoxForPerfettoStr, + int maxDurationParam, int inMemoryValue, Boolean isReturn) throws GrpcException { + BytracePluginConfigOuterClass.BytracePluginConfig.Builder build = + BytracePluginConfigOuterClass.BytracePluginConfig.newBuilder(); + build.setBuffeSize(inMemoryValue * SystemTunningProbesCheckbox.MEMORY_MB_TO_KB); + build.setClock("boot"); + if (getUserCheckBoxForPerfettoStr != null && getUserCheckBoxForPerfettoStr.length() > 0) { + Arrays.stream(getUserCheckBoxForPerfettoStr.split(";")).filter(param -> param.trim().length() > 0) + .forEach(param -> build.addCategories(param)); + } else { + // catch All + build.addCategories(""); + } + build.setTime(maxDurationParam); + build.setOutfileName("/data/local/tmp/hiprofiler_data.bytrace"); + BytracePluginConfigOuterClass.BytracePluginConfig config = build.build(); + byte[] ccByte = BeanUtil.serializeByCodedOutPutStream(config); + ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig bf = + ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.newBuilder().setPages(LayoutConstants.NUMBER_THREAD) + .setPolicy(ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.Policy.RECYCLE).build(); + ProfilerServiceTypes.ProfilerSessionConfig sessionConfig = + ProfilerServiceTypes.ProfilerSessionConfig.newBuilder() + .setSessionMode(ProfilerServiceTypes.ProfilerSessionConfig.Mode.OFFLINE).addBuffers(bf) + .setResultFile("/data/local/tmp/hiprofiler_data.bytrace").build(); + // 获取插件名称 + ProfilerServiceTypes.GetCapabilitiesResponse response = + HiProfilerClient.getInstance().getCapabilities(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort()); + List capabilitiesList = response.getCapabilitiesList(); + ProfilerServiceTypes.ProfilerPluginCapability profilerPluginCapability = + capabilitiesList.stream().filter(item -> item.getName().contains("libbytrace")).findFirst().get(); + String pluginName = profilerPluginCapability.getName(); + CommonTypes.ProfilerPluginConfig plugConfig = + CommonTypes.ProfilerPluginConfig.newBuilder().setName(pluginName).setPluginSha256("111") + .setSampleInterval(1).setConfigData(ByteString.copyFrom(ccByte)).build(); + ProfilerServiceTypes.CreateSessionRequest request = + ProfilerServiceTypes.CreateSessionRequest.newBuilder().setRequestId(1).setSessionConfig(sessionConfig) + .addPluginConfigs(plugConfig).build(); + HiProfilerClient hiprofiler = HiProfilerClient.getInstance(); + ProfilerClient client = + hiprofiler.getProfilerClient(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort()); + ProfilerServiceTypes.CreateSessionResponse createSessionResponse = client.createSession(request); + ProfilerServiceTypes.StartSessionRequest requestStartSession = ProfilerServiceHelper + .startSessionRequest(CommonUtil.getRequestId(), createSessionResponse.getSessionId(), new ArrayList<>()); + // 调用哪些进程(采集数据) + client.startSession(requestStartSession); + return String.valueOf(createSessionResponse.getSessionId()); + } + + /** + * 请求启动session + * + * @param deviceIPPortInfo deviceIPPortInfo + * @param param param + * @param paramRecordSetting paramRecordSetting + * @param isReturn isReturn + * @return String + * @throws GrpcException GrpcException + */ + public String createSessionRequest(DeviceIPPortInfo deviceIPPortInfo, HashMap> param, + HashMap paramRecordSetting, Boolean isReturn) throws GrpcException { + int sampleDuration = 0; + int resultMaxSize = 0; + HiProfilerClient hiprofiler = HiProfilerClient.getInstance(); + ProfilerClient client = + hiprofiler.getProfilerClient(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort()); + // 获取插件名称 + ProfilerServiceTypes.GetCapabilitiesResponse response = + HiProfilerClient.getInstance().getCapabilities(deviceIPPortInfo.getIp(), deviceIPPortInfo.getForwardPort()); + List capabilitiesList = response.getCapabilitiesList(); + if (capabilitiesList.size() == 0) { + return ""; + } + ProfilerServiceTypes.ProfilerPluginCapability profilerPluginCapability = + capabilitiesList.stream().filter(item -> item.getName().contains("libtrace")).findFirst().get(); + String pluginName = null; + TracePluginConfigOuterClass.TracePluginConfig.Builder build = + TracePluginConfigOuterClass.TracePluginConfig.newBuilder(); + pluginName = profilerPluginCapability.getName(); + String configDataStr = ""; + if (param != null && !param.isEmpty()) { + for (String key : param.keySet()) { + configDataStr = getConfigDataStr(param, build, configDataStr, key); + } + } + if (paramRecordSetting != null && paramRecordSetting.size() > 0) { + for (String key : paramRecordSetting.keySet()) { + switch (key) { + case SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_KIND_IN_MEMORY: + build + .setBufferSizeKb(paramRecordSetting.get(key) * SystemTunningProbesCheckbox.MEMORY_MB_TO_KB); + // 将MB 转换为KB + resultMaxSize = paramRecordSetting.get(key) * SystemTunningProbesCheckbox.MEMORY_MB_TO_KB; + break; + case SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_KIND_MAX_DURATION: + build.setTracePeriodMs(paramRecordSetting.get(key) * SystemTunningProbesCheckbox.SECOND_TO_MS); + // 将MB 转换为KB + sampleDuration = paramRecordSetting.get(key) * SystemTunningProbesCheckbox.SECOND_TO_MS; + break; + default: + } + } + } + build.setClock("local"); + TracePluginConfigOuterClass.TracePluginConfig config = build.build(); + byte[] ccByte = BeanUtil.serializeByCodedOutPutStream(config); + ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig bf = + ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.newBuilder().setPages(LayoutConstants.NUMBER_THREAD) + .setPolicy(ProfilerServiceTypes.ProfilerSessionConfig.BufferConfig.Policy.RECYCLE).build(); + ProfilerServiceTypes.ProfilerSessionConfig sessionConfig = + ProfilerServiceTypes.ProfilerSessionConfig.newBuilder().setSampleDuration(sampleDuration) + .setResultMaxSize(resultMaxSize).setSessionMode(ProfilerServiceTypes.ProfilerSessionConfig.Mode.OFFLINE) + .addBuffers(bf).setResultFile("/data/local/tmp/hiprofiler_data.htrace").build(); + CommonTypes.ProfilerPluginConfig plugConfig = + CommonTypes.ProfilerPluginConfig.newBuilder().setName(pluginName).setPluginSha256("111") + .setSampleInterval(1).setConfigData(ByteString.copyFrom(ccByte)).build(); + ProfilerServiceTypes.CreateSessionRequest request = + ProfilerServiceTypes.CreateSessionRequest.newBuilder().setRequestId(1).setSessionConfig(sessionConfig) + .addPluginConfigs(plugConfig).build(); + if (isReturn) { + String[] strCommand = request.toString().split("config_data"); + return strCommand[0].concat("config_data:").concat("\"").concat(configDataStr).concat("\"") + .concat(System.lineSeparator() + "}"); + } else { + // 通知端侧要用那些插件(分配资源) + ProfilerServiceTypes.CreateSessionResponse response1 = client.createSession(request); + ProfilerServiceTypes.StartSessionRequest requestStartSession = ProfilerServiceHelper + .startSessionRequest(CommonUtil.getRequestId(), response1.getSessionId(), new ArrayList<>()); + // 调用哪些进程(采集数据) + ProfilerServiceTypes.StartSessionResponse startSessionResponse = client.startSession(requestStartSession); + return ""; + } + } + + private String getConfigDataStr(HashMap> param, + TracePluginConfigOuterClass.TracePluginConfig.Builder build, String configDataStr, String key) { + String configStr = configDataStr; + switch (key) { + case SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_KIND_FTRACE_EVENT: + for (int index = 0; index < param.get(key).size(); index++) { + build.addFtraceEvents(param.get(key).get(index)); + configStr = + configStr.concat(System.lineSeparator()).concat(param.get(key).get(index)); + } + break; + case SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_KIND_ATRACE_APPS: + for (int index = 0; index < param.get(key).size(); index++) { + build.addBytraceApps(param.get(key).get(index)); + configStr.concat(param.get(key).get(index)); + } + break; + default: + } + return configStr; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/bytrace/BytraceDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/bytrace/BytraceDao.java new file mode 100644 index 000000000..c253879fa --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/bytrace/BytraceDao.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.bytrace; + +/** + * @Description Bytrace与数据库交互类 + * @Date 2021/2/7 13:58 + **/ +public class BytraceDao { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/bytrace/BytraceService.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/bytrace/BytraceService.java new file mode 100644 index 000000000..324484cd8 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/bytrace/BytraceService.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.bytrace; + +/** + * @Description Bytrace业务处理类 + * @Date 2021/2/7 13:43 + **/ +public class BytraceService { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/cpu/CpuDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/cpu/CpuDao.java new file mode 100644 index 000000000..829cd62b0 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/cpu/CpuDao.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.cpu; + +/** + * @Description Cpu与数据库的交互类 + * @Date 2021/2/7 13:58 + **/ +public class CpuDao { +} + diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/cpu/CpuService.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/cpu/CpuService.java new file mode 100644 index 000000000..7a737ce13 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/cpu/CpuService.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.cpu; + +/** + * @Description Cpu业务处理类 + * @Date 2021/2/7 13:43 + **/ +public class CpuService { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/diskio/DiskioDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/diskio/DiskioDao.java new file mode 100644 index 000000000..11f6089cd --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/diskio/DiskioDao.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.diskio; + +/** + * @Description Diskio与数据库交互的类 + * @Date 2021/2/7 13:59 + **/ +public class DiskioDao { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/diskio/DiskioService.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/diskio/DiskioService.java new file mode 100644 index 000000000..985d4c925 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/diskio/DiskioService.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.diskio; + +/** + * @Description Diskio业务处理类 + * @Date 2021/2/7 13:44 + **/ +public class DiskioService { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/ftrace/FtraceDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/ftrace/FtraceDao.java new file mode 100644 index 000000000..80cc2cf7d --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/ftrace/FtraceDao.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.ftrace; + +/** + * @Description Ftrace与数据库交互的类 + * @Date 2021/2/7 13:59 + **/ +public class FtraceDao { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/ftrace/FtraceService.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/ftrace/FtraceService.java new file mode 100644 index 000000000..2230dfddd --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/ftrace/FtraceService.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.ftrace; + +/** + * @Description Ftrace业务处理类 + * @Date 2021/2/7 13:44 + **/ +public class FtraceService { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/hiperf/HiperfDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/hiperf/HiperfDao.java new file mode 100644 index 000000000..04351e997 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/hiperf/HiperfDao.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.hiperf; + +/** + * @Description Hiperf与数据库交互类 + * @Date 2021/2/7 14:00 + **/ +public class HiperfDao { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/hiperf/HiperfService.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/hiperf/HiperfService.java new file mode 100644 index 000000000..7ee9b97c9 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/hiperf/HiperfService.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.hiperf; + +/** + * @Description Hiperf业务处理类 + * @Date 2021/2/7 13:45 + **/ +public class HiperfService { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/ChartDataCache.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/ChartDataCache.java new file mode 100644 index 000000000..09c29b0a7 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/ChartDataCache.java @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import ohos.devtools.views.common.LayoutConstants; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +import static ohos.devtools.views.common.ViewConstants.INITIAL_VALUE; + +/** + * 多设备+多模式缓存区域 + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public final class ChartDataCache { + private static final Logger LOGGER = LogManager.getLogger(ChartDataCache.class); + + /** + * 总内存的数据量,chart面板可以绘制20s时长额度数据,则缓存保存30s的数据 + */ + private static final int MINT = 30; + + /** + * 单例实体 + */ + private static volatile ChartDataCache instance; + + /** + * 存放各种类型缓存的map + */ + private final Map> dataCacheMap = new ConcurrentHashMap<>(); + /** + * 单个chart的缓存 + */ + private LinkedHashMap cacheBox = null; + + /** + * 0参私有化 + */ + private ChartDataCache() { + } + + /** + * 实体方法 + * + * @return ChartDataCache对象 + */ + public static ChartDataCache getInstance() { + if (instance == null) { + synchronized (ChartDataCache.class) { + if (instance == null) { + instance = new ChartDataCache(); + } + } + } + return instance; + } + + /** + * 构造方法 + * + * @param cacheName 缓存名称(设备名+模块) + * @param blockSize chart面板1s平均可获得的数据数量 + */ + public void initCache(String cacheName, int blockSize) { + int cacheMaxSize = MINT * blockSize; + cacheBox = new LinkedHashMap<>(cacheMaxSize, LayoutConstants.LOAD_FACTOR, true) { + @Override + protected boolean removeEldestEntry(Map.Entry eldest) { + if (cacheBox.size() > cacheMaxSize) { + cacheBox.remove(eldest.getKey()); + return true; + } else { + return false; + } + } + }; + dataCacheMap.put(cacheName, cacheBox); + } + + public Map> getDataCacheMap() { + return dataCacheMap; + } + + /** + * 数据块添加到cache缓存中 + * + * @param cacheName 缓存名称 + * @param cacheBlock 待从数据库获取的数据 + */ + public void addCacheBlock(String cacheName, LinkedHashMap cacheBlock) { + synchronized (dataCacheMap.get(cacheName)) { + LinkedHashMap cacheBoxAdd = dataCacheMap.get(cacheName); + for (Map.Entry entry : cacheBlock.entrySet()) { + cacheBoxAdd.put(entry.getKey(), entry.getValue()); + } + + // 这里需要给Map中的集合排序,否则会出现Map的key时间戳乱序现象 + LinkedHashMap sorted = + dataCacheMap.get(cacheName).entrySet().stream().sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (x, y) -> { + throw new AssertionError(); + }, LinkedHashMap::new)); + dataCacheMap.put(cacheName, sorted); + } + } + + /** + * chart调用的接口,获取cache内存中的数据 + * + * @param cacheName 缓存名称 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param firstTimestamp 本次Chart首次创建并启动刷新时的时间戳 + * @return LinkedHashMap + */ + public LinkedHashMap getDataCache(String cacheName, int startTime, int endTime, long firstTimestamp) { + LinkedHashMap result = new LinkedHashMap<>(); + long startTs = startTime + firstTimestamp; + long endTs = endTime + firstTimestamp; + // 当startTime > 0时(Chart铺满界面时),需要取第一个点的前一个点用于Chart绘制,填充空白,解决边界闪烁 + if (startTime > 0) { + long beforeStart = getTargetTime(cacheName, startTs, true); + if (beforeStart != 0) { + result.put(beforeStart, dataCacheMap.get(cacheName).get(beforeStart)); + } + } + synchronized (dataCacheMap.get(cacheName)) { + Set> entrySet = dataCacheMap.get(cacheName).entrySet(); + for (Map.Entry entry : entrySet) { + long key = entry.getKey(); + if (key >= startTs && key <= endTs) { + result.put(key, entry.getValue()); + } + } + + // 取最后一个点的后一个点用于Chart绘制,填充空白,解决边界闪烁 + long afterEnd = getTargetTime(cacheName, endTs, false); + if (afterEnd != 0) { + result.put(afterEnd, dataCacheMap.get(cacheName).get(afterEnd)); + } + } + return result; + } + + /** + * 清理数据缓存 + * + * @param cacheName cacheName + */ + public void clearDataCache(String cacheName) { + LinkedHashMap cacheBoxClear = dataCacheMap.get(cacheName); + cacheBoxClear.clear(); + } + + /** + * 在dataMap中找到给定时间的前一个时间或者后一个时间 + * + * @param cacheName String + * @param time 给定时间 + * @param isBefore true:前一个时间,false:后一个时间 + * @return 结果 + */ + private long getTargetTime(String cacheName, long time, boolean isBefore) { + synchronized (dataCacheMap.get(cacheName)) { + LinkedHashMap cacheBoxGet = dataCacheMap.get(cacheName); + if (cacheBoxGet == null || cacheBoxGet.size() == 0) { + return 0; + } + + Set keySet = cacheBoxGet.keySet(); + Long[] timeArray = keySet.toArray(new Long[0]); + // 先判断下是不是大于最大值或者小于最小值,是的话直接返回 + if (time == timeArray[0] || time == timeArray[timeArray.length - 1]) { + return 0; + } + + return timeArray[searchIndex(timeArray, time, isBefore)]; + } + } + + /** + * 在有序数组中找到目标值的前一个或后一个值的index + * + * @param arr 有序数组 + * @param value 目标值 + * @param flag true:取前一个值,false:取后一个值 + * @return 目标值的前一个或后一个值的index + */ + private static int searchIndex(Long[] arr, long value, boolean flag) { + // 开始位置 + int low = 0; + // 结束位置 + int high = arr.length - 1; + // 先判断下是不是大于最大值或者小于最小值,是的话直接返回 + if (value <= arr[low]) { + return low; + } + if (value >= arr[high]) { + return high; + } + + int halfValue = 2; + int index = INITIAL_VALUE; + while (low <= high) { + int middle = (low + high) / halfValue; + // 如果值正好相等,则直接返回查询到的索引 + if (value == arr[middle]) { + index = flag ? middle - 1 : middle + 1; + break; + } + + // 大于当前index的值,小于下一个index的值,根据flag取前一个或后一个 + if (value > arr[middle] && value < arr[middle + 1]) { + // 返回查询到的索引 + index = flag ? middle : middle + 1; + break; + } + + if (value > arr[middle]) { + low = middle + 1; + } + + if (value < arr[middle]) { + high = middle - 1; + } + } + return index; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/ClassInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/ClassInfo.java new file mode 100644 index 000000000..68fc8754a --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/ClassInfo.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import java.io.Serializable; + +/** + * 类对象实体 + * + * @version 1.0 + * @date 2021/04/03 10:58 + **/ +public class ClassInfo implements Serializable { + private static final long serialVersionUID = -3958115376721507302L; + /** + * 当前对象Id + */ + private Integer id; + /** + * 端侧获取的classId + */ + private Integer cId; + /** + * 类名 + */ + private String className; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getcId() { + return cId; + } + + public void setcId(Integer cId) { + this.cId = cId; + } + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + @Override + public String toString() { + return "ClassInfo{" + "id=" + id + ", cId=" + cId + ", className='" + className + '\'' + '}'; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/ClassInfoDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/ClassInfoDao.java new file mode 100644 index 000000000..52d564bbe --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/ClassInfoDao.java @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.utils.common.util.CloseResourceUtil; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import static ohos.devtools.datasources.utils.common.Constant.JVMTI_AGENT_PLUG; + +/** + * 处理端侧获取的类数据 + * + * @version 1.0 + * @date 2021/04/03 11:03 + **/ +public class ClassInfoDao extends AbstractDataStore { + private static final Logger LOGGER = LogManager.getLogger(ClassInfoDao.class); + private static final int SQL_INDEX_TWO = 2; + private static final int SQL_INDEX_THREE = 3; + private static volatile ClassInfoDao singleton; + + /** + * ClassInfoDao + * + * @return ClassInfoDao + */ + public static ClassInfoDao getInstance() { + if (singleton == null) { + synchronized (ClassInfoDao.class) { + if (singleton == null) { + singleton = new ClassInfoDao(); + } + } + } + return singleton; + } + + public ClassInfoDao() { + createClassInfo(); + } + + /** + * 获取数据库连接 + * + * @param tableName 表名 + * @return Connection + * @date 2021/4/3 11:44 + */ + private Connection getConnection(String tableName) { + Optional optionalConnection = getConnectByTable(tableName); + Connection conn = null; + if (optionalConnection.isPresent()) { + conn = optionalConnection.get(); + } + return conn; + } + + /** + * createClassInfo + * + * @return boolean + */ + public boolean createClassInfo() { + boolean createResult = false; + String dbName = JVMTI_AGENT_PLUG; + String classInfoTable = "ClassInfo"; + String sql = "CREATE TABLE ClassInfo " + "( id Integer primary key autoincrement not null, " + + " cId int not null, " + " className varchar not null " + ");"; + createResult = createTable(dbName, classInfoTable, sql); + return createResult; + } + + /** + * insertClassInfo + * + * @param classInfo classInfo + */ + public void insertClassInfo(ClassInfo classInfo) { + Connection conn = null; + PreparedStatement ps = null; + try { + conn = getConnection("ClassInfo"); + String sql = "insert into ClassInfo (id,cId,className) values (null,?,?)"; + ps = conn.prepareStatement(sql); + ps.setInt(1, classInfo.getcId()); + ps.setString(Option.SQL_INDEX_TWO, classInfo.getClassName()); + ps.executeUpdate(); + } catch (SQLException throwables) { + throwables.printStackTrace(); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + } + + /** + * insertClassInfos + * + * @param classInfos classInfos + * @return boolean + */ + public boolean insertClassInfos(List classInfos) { + Connection conn = null; + PreparedStatement ps = null; + try { + conn = getConnection("ClassInfo"); + conn.setAutoCommit(false); + String sql = "insert into ClassInfo (id,cId,className) values (null,?,?)"; + ps = conn.prepareStatement(sql); + for (ClassInfo classInfo : classInfos) { + ps.setInt(1, classInfo.getcId()); + ps.setString(SQL_INDEX_TWO, classInfo.getClassName()); + ps.addBatch(); + } + int[] results = ps.executeBatch(); + conn.commit(); + return true; + } catch (SQLException throwables) { + LOGGER.error("SQLException error: " + throwables.getMessage()); + return false; + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + } + + /** + * 获取所有的ClassInfo数据. + * + * @param sessionId sessionId + * @return List + */ + public List getAllClassInfoData(Long sessionId) { + Connection conn = getConnection("ClassInfo"); + PreparedStatement ps = null; + ArrayList classInfos = new ArrayList<>(); + try { + String sql = "select id,cId,className from ClassInfo"; + ps = conn.prepareStatement(sql); + ResultSet rs = ps.executeQuery(); + ClassInfo classInfo = null; + while (rs.next()) { + classInfo = new ClassInfo(); + Integer id = rs.getInt("id"); + Integer cId = rs.getInt("cId"); + String className = rs.getString("className"); + classInfo.setId(id); + classInfo.setcId(cId); + classInfo.setClassName(className); + classInfos.add(classInfo); + } + return classInfos; + } catch (SQLException throwables) { + LOGGER.info("memoryHeapInfo Exception {}", throwables.getMessage()); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + return classInfos; + } + + /** + * 获取所有的ClassInfo数据. + * + * @param className className + * @return int cid + */ + public int getClassIdByClassName(String className) { + Connection conn = getConnection("ClassInfo"); + PreparedStatement ps = null; + int cId = 0; + try { + String sql = "select cId from ClassInfo where className = '" + className + "'"; + Statement statement = conn.createStatement(); + ResultSet rs = statement.executeQuery(sql); + if (rs.next()) { + cId = rs.getInt("cId"); + } + return cId; + } catch (SQLException throwables) { + LOGGER.info("memoryHeapInfo Exception {}", throwables.getMessage()); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + return cId; + } + + /** + * 删除一次场景下的堆信息数据 + * + * @param sessionId sessionId + * @return boolean + */ + public boolean deleteSessionData(long sessionId) { + StringBuffer deleteSql = new StringBuffer("DELETE FROM ClassInfo"); + Connection connection = DataBaseApi.getInstance().getConnectByTable("ClassInfo").get(); + return execute(connection, deleteSql.toString()); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/ClassInfoManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/ClassInfoManager.java new file mode 100644 index 000000000..83ccd373b --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/ClassInfoManager.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import java.util.List; + +/** + * 类信息业务处理对象 + * + * @version 1.0 + * @date 2021/04/05 11:00 + **/ +public class ClassInfoManager { + private final ClassInfoDao classInfoDao = ClassInfoDao.getInstance(); + + /** + * insertClassInfo + * + * @param classInfo classInfo + */ + public void insertClassInfo(ClassInfo classInfo) { + classInfoDao.insertClassInfo(classInfo); + } + + /** + * 获取所有的数据至文件 + * + * @param sessionId sessionId + * @return List + */ + public List getAllClassInfoData(Long sessionId) { + return classInfoDao.getAllClassInfoData(sessionId); + } + + /** + * 获取所有的数据至文件 + * + * @param sessionId sessionId + * @return List + */ + public int getClassIdByClassName(String className) { + return classInfoDao.getClassIdByClassName(className); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryDao.java new file mode 100644 index 000000000..d2513b141 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryDao.java @@ -0,0 +1,326 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import com.google.protobuf.InvalidProtocolBufferException; +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.databases.datatable.enties.ProcessMemInfo; +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; +import ohos.devtools.views.common.LayoutConstants; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import static ohos.devtools.services.memory.MemoryDao.MemorySelectStatements.SELECT_AFTER_TAIL; +import static ohos.devtools.services.memory.MemoryDao.MemorySelectStatements.SELECT_ALL_APP_MEM_INFO; +import static ohos.devtools.services.memory.MemoryDao.MemorySelectStatements.SELECT_APP_MEM_INFO; +import static ohos.devtools.services.memory.MemoryDao.MemorySelectStatements.SELECT_BEFORE_HEAD; + +/** + * @Description Memory与数据库交互的类 + * @Date 2021/2/7 14:01 + **/ +public class MemoryDao extends AbstractDataStore { + private static final Logger LOGGER = LogManager.getLogger(MemoryDao.class); + + private static volatile MemoryDao singleton; + + /** + * 获取实例 + * + * @return MemoryDao + */ + public static MemoryDao getInstance() { + if (singleton == null) { + synchronized (MemoryDao.class) { + if (singleton == null) { + singleton = new MemoryDao(); + } + } + } + return singleton; + } + + private Map memorySelectMap = new HashMap<>(); + + /** + * MemorySelectStatements + **/ + public enum MemorySelectStatements { + SELECT_APP_MEM_INFO( + "SELECT timeStamp, Data from processMemInfo where session = ? and timeStamp > ? and timeStamp < ?"), + + SELECT_ALL_APP_MEM_INFO("SELECT timeStamp, Data from processMemInfo where session = ?"), + + DELETE_APP_MEM_INFO("delete from processMemInfo where session = ?"), + + SELECT_BEFORE_HEAD("SELECT timeStamp, Data from processMemInfo where session =" + + " ? and timeStamp < ? order by timeStamp desc limit 1"), + + SELECT_AFTER_TAIL("SELECT timeStamp, Data from processMemInfo where session =" + + " ? and timeStamp > ? order by timeStamp asc limit 1"); + + private final String sqlStatement; + + MemorySelectStatements(String sqlStatement) { + this.sqlStatement = sqlStatement; + } + + /** + * 获取sql语句 + * + * @return String + */ + public String getStatement() { + return sqlStatement; + } + } + + private Connection conn; + + private MemoryDao() { + if (conn == null) { + Optional connection = getConnectBydbName("memory"); + if (connection.isPresent()) { + conn = connection.get(); + } + createPrePareStatements(); + } + } + + private void createPrePareStatements() { + MemorySelectStatements[] values = MemorySelectStatements.values(); + for (MemorySelectStatements sta : values) { + PreparedStatement psmt = null; + try { + psmt = conn.prepareStatement(sta.getStatement()); + memorySelectMap.put(sta, psmt); + } catch (SQLException throwAbles) { + LOGGER.error(" SQLException {}", throwAbles.getMessage()); + } + } + } + + /** + * getAllData + * + * @param sessionId sessionId + * @return List + */ + public List getAllData(long sessionId) { + PreparedStatement pst = memorySelectMap.get(SELECT_ALL_APP_MEM_INFO); + List result = new ArrayList<>(); + try { + if (pst != null) { + pst.setLong(1, sessionId); + ResultSet rs = pst.executeQuery(); + while (rs.next()) { + long timeStamp = rs.getLong("timeStamp"); + byte[] data = rs.getBytes("Data"); + if (data == null) { + continue; + } + ProcessMemInfo processMem = new ProcessMemInfo(); + MemoryPluginResult.AppSummary.Builder builders = MemoryPluginResult.AppSummary.newBuilder(); + MemoryPluginResult.AppSummary appSummary = builders.mergeFrom(data).build(); + processMem.setTimeStamp(timeStamp); + processMem.setData(appSummary); + processMem.setSession(sessionId); + result.add(processMem); + } + } + } catch (SQLException | InvalidProtocolBufferException throwables) { + LOGGER.error(" SQLException {}", throwables.getMessage()); + } + return result; + } + + /** + * getData + * + * @param sessionId sessionId + * @param min min + * @param max max + * @param startTimeStamp startTimeStamp + * @param isNeedHeadTail isNeedHeadTail + * @return LinkedHashMap + */ + public LinkedHashMap getData(long sessionId, int min, int max, + long startTimeStamp, boolean isNeedHeadTail) { + PreparedStatement pst = memorySelectMap.get(SELECT_APP_MEM_INFO); + LinkedHashMap result = new LinkedHashMap(); + // 当startTime > 0时(Chart铺满界面时),需要取第一个点的前一个点用于Chart绘制,填充空白,解决边界闪烁 + if (isNeedHeadTail && min > 0) { + LinkedHashMap head = getBeforeHead(sessionId, startTimeStamp + min); + if (head.size() > 0) { + Map.Entry headEntry = head.entrySet().iterator().next(); + Long key = -1L; + MemoryPluginResult.AppSummary value = null; + if ((headEntry.getKey()) instanceof Long) { + key = (Long) headEntry.getKey(); + } + if ((headEntry.getValue()) instanceof MemoryPluginResult.AppSummary) { + value = (MemoryPluginResult.AppSummary) headEntry.getValue(); + } + if (value != null) { + result.put(key, value); + } + } + } + if (pst != null) { + try { + long startTime = startTimeStamp + min; + long endTime = startTimeStamp + max; + pst.setLong(1, sessionId); + pst.setLong(LayoutConstants.TWO, startTime); + pst.setLong(LayoutConstants.THREE, endTime); + ResultSet rs = pst.executeQuery(); + if (rs != null) { + while (rs.next()) { + long timeStamp = rs.getLong("timeStamp"); + byte[] data = rs.getBytes("Data"); + if (data == null) { + continue; + } + MemoryPluginResult.AppSummary.Builder builders = MemoryPluginResult.AppSummary.newBuilder(); + MemoryPluginResult.AppSummary appSummary = builders.mergeFrom(data).build(); + result.put(timeStamp, appSummary); + } + } + } catch (SQLException | InvalidProtocolBufferException throwAbles) { + throwAbles.printStackTrace(); + } + } + // 取最后一个点的后一个点用于Chart绘制,填充空白,解决边界闪烁 + result = getOutsideDataLinkedHashMap(sessionId, max, startTimeStamp, isNeedHeadTail, result); + return result; + } + + private LinkedHashMap getOutsideDataLinkedHashMap(long sessionId, int max, + long startTimeStamp, boolean isNeedHeadTail, LinkedHashMap result) { + LinkedHashMap resultData = result; + if (isNeedHeadTail) { + LinkedHashMap tail = getAfterTail(sessionId, startTimeStamp + max); + if (tail.size() > 0) { + Map.Entry tailEntry = tail.entrySet().iterator().next(); + MemoryPluginResult.AppSummary value = null; + Long key = -1L; + if ((tailEntry.getKey()) instanceof Long) { + key = (Long) tailEntry.getKey(); + } + if ((tailEntry.getValue()) instanceof MemoryPluginResult.AppSummary) { + value = (MemoryPluginResult.AppSummary) tailEntry.getValue(); + } + if (value != null) { + resultData.put(key, value); + } + } + } + return resultData; + } + + /** + * 获取目标时间的前一个时间的数据 + * + * @param sessionId 缓存名称 + * @param targetTimeStamp 开始时间 + * @return LinkedHashMap + */ + public LinkedHashMap getBeforeHead(long sessionId, long targetTimeStamp) { + PreparedStatement pst = memorySelectMap.get(SELECT_BEFORE_HEAD); + LinkedHashMap result = new LinkedHashMap(); + if (pst != null) { + try { + pst.setLong(1, sessionId); + pst.setLong(LayoutConstants.TWO, targetTimeStamp); + ResultSet rs = pst.executeQuery(); + if (rs != null) { + while (rs.next()) { + long timeStamp = rs.getLong("timeStamp"); + byte[] data = rs.getBytes("Data"); + if (data == null) { + continue; + } + MemoryPluginResult.AppSummary.Builder builders = MemoryPluginResult.AppSummary.newBuilder(); + MemoryPluginResult.AppSummary appSummary = builders.mergeFrom(data).build(); + result.put(timeStamp, appSummary); + } + } + } catch (SQLException | InvalidProtocolBufferException throwAbles) { + LOGGER.error(" SQLException {}", throwAbles.getMessage()); + } + } + return result; + } + + /** + * 获取目标时间的后一个时间的数据 + * + * @param sessionId 缓存名称 + * @param targetTimeStamp 开始时间 + * @return LinkedHashMap + */ + public LinkedHashMap getAfterTail(long sessionId, long targetTimeStamp) { + PreparedStatement pst = memorySelectMap.get(SELECT_AFTER_TAIL); + LinkedHashMap result = new LinkedHashMap(); + if (pst != null) { + try { + pst.setLong(1, sessionId); + pst.setLong(LayoutConstants.TWO, targetTimeStamp); + ResultSet rs = pst.executeQuery(); + if (rs != null) { + while (rs.next()) { + long timeStamp = rs.getLong("timeStamp"); + byte[] data = rs.getBytes("Data"); + if (data == null) { + continue; + } + MemoryPluginResult.AppSummary.Builder builders = MemoryPluginResult.AppSummary.newBuilder(); + MemoryPluginResult.AppSummary appSummary = builders.mergeFrom(data).build(); + result.put(timeStamp, appSummary); + } + } + } catch (SQLException | InvalidProtocolBufferException throwAbles) { + LOGGER.error(" SQLException {}", throwAbles.getMessage()); + } + } + return result; + } + + /** + * deleteSessionData + * + * @param sessionId sessionId + * @return boolean + */ + public boolean deleteSessionData(long sessionId) { + StringBuffer deleteSql = new StringBuffer("DELETE FROM "); + deleteSql.append("processMemInfo").append(" WHERE session = ").append(sessionId); + Connection connection = DataBaseApi.getInstance().getConnectByTable("processMemInfo").get(); + return execute(connection, deleteSql.toString()); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryHeapDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryHeapDao.java new file mode 100644 index 000000000..a199c3394 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryHeapDao.java @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.utils.common.util.CloseResourceUtil; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import static ohos.devtools.datasources.utils.common.Constant.JVMTI_AGENT_PLUG; + +/** + * heap数据处理对象 + * + * @version 1.0 + * @date 2021/03/30 10:52 + **/ +public class MemoryHeapDao extends AbstractDataStore { + private static final Logger LOGGER = LogManager.getLogger(MemoryHeapDao.class); + private static volatile MemoryHeapDao singleton; + + /** + * getInstance + * + * @return MemoryHeapDao + */ + public static MemoryHeapDao getInstance() { + if (singleton == null) { + synchronized (MemoryHeapDao.class) { + if (singleton == null) { + singleton = new MemoryHeapDao(); + } + } + } + return singleton; + } + + /** + * MemoryHeapDao + */ + public MemoryHeapDao() { + createMemoryHeapInfo(); + } + + /** + * 获取数据库连接 + * + * @param tableName 表名 + * @return Connection + * @date 2021/03/30 11:00 + */ + private Connection getConnection(String tableName) { + Optional optionalConnection = getConnectByTable(tableName); + Connection conn = null; + if (optionalConnection.isPresent()) { + conn = optionalConnection.get(); + } + return conn; + } + + /** + * 堆信息数据表创建 + * + * @return boolean + */ + public boolean createMemoryHeapInfo() { + boolean createResult = false; + String dbName = JVMTI_AGENT_PLUG; + String memoryHeapInfoTable = "MemoryHeapInfo"; + String sql = + "CREATE TABLE MemoryHeapInfo " + "( " + " id Integer primary key autoincrement not null, " + + " cId int(100) not null, " + " heapId int(100) not null, " + + " instanceId int(100) not null, " + " sessionId Long(100) not null, " + + " arrangeStyle varchar(200), " + " allocations int(100) not null, " + + " deallocations int(100) not null, " + " totalCount int(100) not null, " + + " shallowSize int(100) not null, " + " createTime int(200) not null " + ");"; + + createResult = createTable(dbName, memoryHeapInfoTable, sql); + return createResult; + } + + /** + * 将端侧获取的堆信息保存在数据库 + * + * @param memoryHeapInfos 堆实例 + * @return boolean + */ + public boolean insertMemoryHeapInfos(List memoryHeapInfos) { + if (memoryHeapInfos.isEmpty()) { + return false; + } + Connection conn = null; + PreparedStatement ps = null; + try { + conn = getConnection("MemoryHeapInfo"); + conn.setAutoCommit(false); + String sql = "insert into MemoryHeapInfo(id,cId,heapId,sessionId,arrangeStyle,allocations," + + "deallocations,totalCount,shallowSize,createTime,instanceId)values(null,?,?,?,?,?,?,?,?,?,?)"; + ps = conn.prepareStatement(sql); + for (MemoryHeapInfo memoryHeapInfo : memoryHeapInfos) { + try { + ps.setInt(1, memoryHeapInfo.getcId()); + ps.setInt(Option.SQL_INDEX_TWO, memoryHeapInfo.getHeapId()); + ps.setLong(Option.SQL_INDEX_THREE, memoryHeapInfo.getSessionId()); + ps.setString(Option.SQL_INDEX_FOUR, memoryHeapInfo.getArrangeStyle()); + ps.setLong(Option.SQL_INDEX_FIVE, memoryHeapInfo.getAllocations()); + ps.setLong(Option.SQL_INDEX_SIX, memoryHeapInfo.getDeallocations()); + ps.setInt(Option.SQL_INDEX_SEVEN, memoryHeapInfo.getTotalCount()); + ps.setLong(Option.SQL_INDEX_EIGHT, memoryHeapInfo.getShallowSize()); + ps.setLong(Option.SQL_INDEX_NINE, memoryHeapInfo.getCreateTime()); + ps.setLong(Option.SQL_INDEX_TEN, memoryHeapInfo.getInstanceId()); + ps.addBatch(); + } catch (SQLException sqlException) { + LOGGER.info("insert AppInfo {}", sqlException.getMessage()); + } + } + int[] results = ps.executeBatch(); + conn.commit(); + return true; + } catch (SQLException throwables) { + LOGGER.info("insert MemoryHeap {}", throwables.getMessage()); + return false; + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + } + + /** + * 获取所有的SessionId数据 + * + * @param sessionId sessionId + * @return ArrayList + */ + public ArrayList getAllMemoryHeapInfos(Long sessionId) { + Connection conn = getConnection("MemoryHeapInfo"); + PreparedStatement ps = null; + ArrayList memoryHeapInfos = new ArrayList<>(); + try { + String sql = "select id,cId,heapId,sessionId,arrangeStyle,allocations,deallocations,totalCount," + + "shallowSize,createTime,instanceId from MemoryHeapInfo where sessionId = ?"; + ps = conn.prepareStatement(sql); + ps.setLong(1, sessionId); + ResultSet rs = ps.executeQuery(); + MemoryHeapInfo memoryHeapInfo = null; + while (rs.next()) { + memoryHeapInfo = new MemoryHeapInfo(); + Integer id = rs.getInt("id"); + Integer cId = rs.getInt("cId"); + Integer heapId = rs.getInt("heapId"); + Long msessionId = rs.getLong("sessionId"); + Integer allocations = rs.getInt("allocations"); + Integer deallocations = rs.getInt("deallocations"); + Integer totalCount = rs.getInt("totalCount"); + Long shallowSize = rs.getLong("shallowSize"); + Long createTime = rs.getLong("createTime"); + Integer instanceId = rs.getInt("instanceId"); + memoryHeapInfo.setId(id); + memoryHeapInfo.setHeapId(heapId); + memoryHeapInfo.setcId(cId); + memoryHeapInfo.setSessionId(msessionId); + memoryHeapInfo.setSessionId(sessionId); + memoryHeapInfo.setAllocations(allocations); + memoryHeapInfo.setDeallocations(deallocations); + memoryHeapInfo.setTotalCount(totalCount); + memoryHeapInfo.setShallowSize(shallowSize); + memoryHeapInfo.setCreateTime(createTime); + memoryHeapInfo.setInstanceId(instanceId); + memoryHeapInfos.add(memoryHeapInfo); + } + return memoryHeapInfos; + } catch (SQLException throwables) { + LOGGER.info("memoryHeapInfo Exception {}", throwables.getMessage()); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + return memoryHeapInfos; + } + + /** + * 从数据库获取堆信息数据 + * + * @param sessionId sessionId + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return ArrayList + * @date 2021/3/31 16:04 + */ + public ArrayList getMemoryHeapInfos(Long sessionId, Long startTime, Long endTime) { + Connection conn = getConnection("MemoryHeapInfo"); + PreparedStatement ps = null; + ArrayList memoryHeapInfos = new ArrayList<>(); + try { + String sql = getSqlStr(); + ps = conn.prepareStatement(sql); + ps.setLong(1, sessionId); + ps.setLong(Option.SQL_INDEX_TWO, startTime); + ps.setLong(Option.SQL_INDEX_THREE, endTime); + ps.setLong(Option.SQL_INDEX_FOUR, sessionId); + ps.setLong(Option.SQL_INDEX_FIVE, startTime); + ps.setLong(Option.SQL_INDEX_SIX, endTime); + ps.setLong(Option.SQL_INDEX_SEVEN, sessionId); + ps.setLong(Option.SQL_INDEX_EIGHT, endTime); + + ResultSet rs = ps.executeQuery(); + MemoryHeapInfo memoryHeapInfo = null; + while (rs.next()) { + memoryHeapInfo = new MemoryHeapInfo(); + Integer id = rs.getInt("id"); + Integer cId = rs.getInt("cId"); + String className = rs.getString("className"); + Integer allocations = rs.getInt("allocations"); + Integer deallocations = rs.getInt("deallocations"); + Integer totalCount = rs.getInt("totalCount"); + Long shallowSize = rs.getLong("shallowSize"); + memoryHeapInfo.setId(id); + memoryHeapInfo.setcId(cId); + memoryHeapInfo.setHeapId(0); + memoryHeapInfo.setSessionId(sessionId); + memoryHeapInfo.setClassName(className); + memoryHeapInfo.setAllocations(allocations); + memoryHeapInfo.setDeallocations(deallocations); + memoryHeapInfo.setTotalCount(totalCount); + memoryHeapInfo.setShallowSize(shallowSize); + memoryHeapInfos.add(memoryHeapInfo); + } + return memoryHeapInfos; + } catch (SQLException throwAbles) { + LOGGER.info("memoryHeapInfo Exception {}", throwAbles.getMessage()); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + return memoryHeapInfos; + } + + /** + * 删除一次场景下的堆信息数据 + * + * @param sessionId sessionId + * @return boolean + */ + public boolean deleteSessionData(long sessionId) { + StringBuffer deleteSql = new StringBuffer("DELETE FROM "); + deleteSql.append("MemoryHeapInfo").append(" WHERE sessionId = ").append(sessionId); + Connection connection = DataBaseApi.getInstance().getConnectByTable("MemoryHeapInfo").get(); + return execute(connection, deleteSql.toString()); + } + + /** + * updateMemoryHeapInfo + * + * @param instanceId instanceId + * @return boolean + */ + public boolean updateMemoryHeapInfo(int instanceId) { + Connection conn = getConnection("MemoryHeapInfo"); + String updateSql = "UPDATE MemoryHeapInfo SET deallocations = 1 where instanceId = ?"; + PreparedStatement preparedStatement = null; + try { + preparedStatement = conn.prepareStatement(updateSql); + preparedStatement.setLong(1, instanceId); + return preparedStatement.executeUpdate() == 1 ? true : false; + } catch (SQLException throwables) { + LOGGER.error("SQLException {}", throwables.getMessage()); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, preparedStatement, null); + } + return false; + } + + private String getSqlStr() { + String sql = "SELECT d.id,d.cid,d.className,IFNULL(d.allocations, 0) as allocations, " + + "IFNULL(d.deallocations, 0) as deallocations ,IFNULL(f.totalCount, 0) as totalCount , " + + "IFNULL(f.shallowSize, 0) as shallowSize FROM((" + + "SELECT c.id, c.cId, c.className,sum( IFNULL( m.allocations, 0 ) ) AS allocations," + + "sum( IFNULL( m.deallocations, 0 ) ) AS deallocations FROM ClassInfo c " + + "LEFT JOIN MemoryHeapInfo m ON m.cId = c.cId WHERE m.sessionId = ? " + + "AND m.createTime >= ? AND m.createTime <= ? GROUP BY c.cId" + + " UNION SELECT c.id,c.cId,c.className,0 AS allocations,0 AS deallocations FROM ClassInfo c " + + "WHERE c.cId NOT IN ( SELECT b.cId FROM MemoryHeapInfo b WHERE b.sessionId = ? " + + "AND b.createTime >= ? AND b.createTime <= ? ) ) AS d LEFT JOIN(" + + "SELECT e.cId as cId,sum( IFNULL( e.totalCount, 0 ) ) AS totalCount," + + "sum( IFNULL( e.shallowSize, 0 )) AS shallowSize FROM ClassInfo l LEFT JOIN MemoryHeapInfo e" + + " ON e.cId = l.cId WHERE e.sessionId = ? AND e.createTime <= ? " + + "GROUP BY l.cId ) AS f on d.cId = f.cId) ORDER BY shallowSize DESC"; + + return sql; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryHeapInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryHeapInfo.java new file mode 100644 index 000000000..28c759315 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryHeapInfo.java @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import java.io.Serializable; + +/** + * 堆信息 + * + * @version 1.0 + * @date 2021/03/29 21:20 + **/ +public class MemoryHeapInfo implements Serializable { + private static final long serialVersionUID = -4742624779850639424L; + /** + * 当前对象Id + */ + private Integer id; + /** + * 端侧获取的classId + */ + private Integer cId; + /** + * heapId: app、zygote、image、JNI + */ + private Integer heapId; + /** + * 当前会话Id + */ + private Long sessionId; + private String arrangeStyle; + private String className; + /** + * 有调用栈信息的创建的实例个数 + */ + private Integer allocations; + /** + * 销毁的实例个数 + */ + private Integer deallocations; + /** + * 堆内存中所有的实例的个数(对应端的array_length) + */ + private Integer totalCount; + /** + * 堆内存中所有的实例的总大小(对应端的array_length*object_size) + */ + private Long shallowSize; + /** + * createTime + */ + private Long createTime; + /** + * 端侧获取的instanceId + */ + private Integer instanceId; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getcId() { + return cId; + } + + public void setcId(Integer cId) { + this.cId = cId; + } + + public Integer getHeapId() { + return heapId; + } + + public Long getSessionId() { + return sessionId; + } + + public void setSessionId(Long sessionId) { + this.sessionId = sessionId; + } + + public void setHeapId(Integer heapId) { + this.heapId = heapId; + } + + public String getArrangeStyle() { + return arrangeStyle; + } + + public void setArrangeStyle(String arrangeStyle) { + this.arrangeStyle = arrangeStyle; + } + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public Integer getAllocations() { + return allocations; + } + + public void setAllocations(Integer allocations) { + this.allocations = allocations; + } + + public Integer getDeallocations() { + return deallocations; + } + + public void setDeallocations(Integer deallocations) { + this.deallocations = deallocations; + } + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public Long getShallowSize() { + return shallowSize; + } + + public void setShallowSize(Long shallowSize) { + this.shallowSize = shallowSize; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public Integer getInstanceId() { + return instanceId; + } + + public void setInstanceId(Integer instanceId) { + this.instanceId = instanceId; + } + + @Override + public String toString() { + return "MemoryHeapInfo{" + "id=" + id + ", cId=" + cId + ", heapId=" + heapId + ", sessionId=" + sessionId + + ", arrangeStyle='" + arrangeStyle + '\'' + ", className='" + className + '\'' + ", allocations=" + + allocations + ", deallocations=" + deallocations + ", totalCount=" + totalCount + ", shallowSize=" + + shallowSize + ", createTime=" + createTime + '}'; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryHeapManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryHeapManager.java new file mode 100644 index 000000000..3788d409e --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryHeapManager.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import java.util.ArrayList; + +/** + * agent数据处理对象 + * + * @version 1.0 + * @date 2021/03/30 10:11 + **/ +public class MemoryHeapManager { + private final MemoryHeapDao memoryHeapDao = MemoryHeapDao.getInstance(); + + /** + * 获取框选时间段内的数据,提供给UI的堆信息查询接口 + * + * @param sessionId sessionId + * @param startTime 起始时间 + * @param endTime 结束时间 + * @return ArrayList + * @date 2021/03/30 20:25 + */ + public ArrayList getMemoryHeapInfos(Long sessionId, Long startTime, Long endTime) { + return memoryHeapDao.getMemoryHeapInfos(sessionId, startTime, endTime); + } + + /** + * 获取MemoryHeapInfos的数据 + * + * @param sessionId sessionId + * @return ArrayList + */ + public ArrayList getAllMemoryHeapInfos(Long sessionId) { + return memoryHeapDao.getAllMemoryHeapInfos(sessionId); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceDao.java new file mode 100644 index 000000000..f39b960a8 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceDao.java @@ -0,0 +1,294 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.utils.common.util.CloseResourceUtil; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import static ohos.devtools.datasources.utils.common.Constant.JVMTI_AGENT_PLUG; +import static ohos.devtools.services.memory.Option.SQL_INDEX_TWO; + +/** + * 实例数据处理对象 + * + * @version 1.0 + * @date 2021/03/30 18:47 + **/ +public class MemoryInstanceDao extends AbstractDataStore { + private static final Logger LOGGER = LogManager.getLogger(MemoryInstanceDao.class); + private static volatile MemoryInstanceDao singleton; + + /** + * 获取单例对象 + * + * @return MemoryInstanceDao + */ + public static MemoryInstanceDao getInstance() { + if (singleton == null) { + synchronized (MemoryInstanceDao.class) { + if (singleton == null) { + singleton = new MemoryInstanceDao(); + } + } + } + return singleton; + } + + /** + * MemoryInstanceDao + */ + public MemoryInstanceDao() { + createMemoryInstance(); + } + + /** + * 获取数据库连接 + * + * @param tableName 表名 + * @return Connection + */ + private Connection getConnection(String tableName) { + Optional optionalConnection = getConnectByTable(tableName); + Connection conn = null; + if (optionalConnection.isPresent()) { + conn = optionalConnection.get(); + } + return conn; + } + + /** + * 实例对象表创建 + * + * @return boolean + */ + public boolean createMemoryInstance() { + String dbName = JVMTI_AGENT_PLUG; + String memoryInstanceInfoTable = "MemoryInstanceInfo"; + String sql = "CREATE TABLE MemoryInstanceInfo " + "( " + + " id Integer primary key autoincrement not null, " + + " instanceId int(100) not null, " + " cId int(100) not null, " + + " instance varchar(200), " + " createTime Long(200), " + " allocTime int(100), " + + " deallocTime int(100) " + ");"; + return createTable(dbName, memoryInstanceInfoTable, sql); + } + + /** + * 将端侧获取的实例信息保存在数据库 + * + * @param memoryInstanceInfo memoryInstanceInfo + */ + public void insertMemoryInstanceInfo(MemoryInstanceInfo memoryInstanceInfo) { + Connection conn = null; + PreparedStatement ps = null; + try { + conn = getConnection("MemoryInstanceInfo"); + String sql = + "insert into MemoryInstanceInfo(id,instanceId,cId,instance,createTime,allocTime,deallocTime) values" + + "(null,?,?,?,?,?,?)"; + ps = conn.prepareStatement(sql); + ps.setInt(1, memoryInstanceInfo.getInstanceId()); + ps.setInt(SQL_INDEX_TWO, memoryInstanceInfo.getcId()); + ps.setString(Option.SQL_INDEX_THREE, memoryInstanceInfo.getInstance()); + ps.setLong(Option.SQL_INDEX_FOUR, memoryInstanceInfo.getCreateTime()); + ps.setLong(Option.SQL_INDEX_FIVE, memoryInstanceInfo.getAllocTime()); + ps.setLong(Option.SQL_INDEX_SIX, memoryInstanceInfo.getDeallocTime()); + ps.executeUpdate(); + } catch (SQLException throwAbles) { + LOGGER.error("SQLException error: " + throwAbles.getMessage()); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + } + + /** + * insertMemoryInstanceInfos + * + * @param memoryInstanceInfos memoryInstanceInfos + * @return boolean + */ + public boolean insertMemoryInstanceInfos(List memoryInstanceInfos) { + if (memoryInstanceInfos.isEmpty()) { + return false; + } + Connection conn = null; + PreparedStatement ps = null; + try { + conn = getConnection("MemoryInstanceInfo"); + conn.setAutoCommit(false); + String sql = + "insert into MemoryInstanceInfo(id,instanceId,cId,instance,createTime,allocTime,deallocTime) values" + + "(null,?,?,?,?,?,?)"; + ps = conn.prepareStatement(sql); + for (MemoryInstanceInfo memoryInstanceInfo : memoryInstanceInfos) { + try { + ps.setInt(1, memoryInstanceInfo.getInstanceId()); + ps.setInt(SQL_INDEX_TWO, memoryInstanceInfo.getcId()); + ps.setString(Option.SQL_INDEX_THREE, memoryInstanceInfo.getInstance()); + ps.setLong(Option.SQL_INDEX_FOUR, memoryInstanceInfo.getCreateTime()); + ps.setLong(Option.SQL_INDEX_FIVE, memoryInstanceInfo.getAllocTime()); + ps.setLong(Option.SQL_INDEX_SIX, memoryInstanceInfo.getDeallocTime()); + ps.addBatch(); + } catch (SQLException sqlException) { + LOGGER.info("insert AppInfo {}", sqlException.getMessage()); + } + } + int[] results = ps.executeBatch(); + conn.commit(); + return true; + } catch (SQLException throwables) { + LOGGER.error("SQLException error: " + throwables.getMessage()); + return false; + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + } + + /** + * 根据该实例的父Id(对应的类对象hId),从数据库获取具体的实例信息 + * + * @param cId 父cd + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return ArrayList + */ + public ArrayList getMemoryInstanceInfos(Integer cId, Long startTime, Long endTime) { + Connection conn = getConnection("MemoryInstanceInfo"); + PreparedStatement ps = null; + ArrayList memoryInstanceInfos = new ArrayList<>(); + try { + String sql = "select * from MemoryInstanceInfo where cId = ? and createTime >= ? and createTime <= ?"; + ps = conn.prepareStatement(sql); + ps.setInt(1, cId); + ps.setLong(SQL_INDEX_TWO, startTime); + ps.setLong(Option.SQL_INDEX_THREE, endTime); + + ResultSet rs = ps.executeQuery(); + MemoryInstanceInfo memoryInstanceInfo = null; + while (rs.next()) { + memoryInstanceInfo = new MemoryInstanceInfo(); + Integer id = rs.getInt("id"); + Integer instanceId = rs.getInt("instanceId"); + String instance = rs.getString("instance"); + Long allocTime = rs.getLong("allocTime"); + Long deallocTime = rs.getLong("deallocTime"); + Long createTime = rs.getLong("createTime"); + memoryInstanceInfo.setId(id); + memoryInstanceInfo.setInstanceId(instanceId); + memoryInstanceInfo.setcId(cId); + memoryInstanceInfo.setInstance(instance); + memoryInstanceInfo.setAllocTime(allocTime); + memoryInstanceInfo.setDeallocTime(deallocTime); + memoryInstanceInfo.setCreateTime(createTime); + memoryInstanceInfos.add(memoryInstanceInfo); + } + return memoryInstanceInfos; + } catch (SQLException throwAbles) { + LOGGER.error(throwAbles.getMessage()); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + return memoryInstanceInfos; + } + + /** + * 从数据库获取全部的实例信息 + * + * @return ArrayList + */ + public ArrayList getAllMemoryInstanceInfos() { + Connection conn = getConnection("MemoryInstanceInfo"); + PreparedStatement ps = null; + ArrayList memoryInstanceInfos = new ArrayList<>(); + try { + String sql = "select id,instanceId,cId,instance,createTime,allocTime,deallocTime from MemoryInstanceInfo"; + ps = conn.prepareStatement(sql); + ResultSet rs = ps.executeQuery(); + MemoryInstanceInfo memoryInstanceInfo = null; + while (rs.next()) { + memoryInstanceInfo = new MemoryInstanceInfo(); + Integer id = rs.getInt("id"); + Integer instanceId = rs.getInt("instanceId"); + Integer cId = rs.getInt("cId"); + String instance = rs.getString("instance"); + Long allocTime = rs.getLong("allocTime"); + Long deallocTime = rs.getLong("deallocTime"); + Long createTime = rs.getLong("createTime"); + memoryInstanceInfo.setId(id); + memoryInstanceInfo.setInstanceId(instanceId); + memoryInstanceInfo.setcId(cId); + memoryInstanceInfo.setInstance(instance); + memoryInstanceInfo.setAllocTime(allocTime); + memoryInstanceInfo.setDeallocTime(deallocTime); + memoryInstanceInfo.setCreateTime(createTime); + memoryInstanceInfos.add(memoryInstanceInfo); + } + return memoryInstanceInfos; + } catch (SQLException throwAbles) { + LOGGER.error(throwAbles.getMessage()); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + return memoryInstanceInfos; + } + + /** + * updateInstanceInfos + * + * @param timeStamp timeStamp + * @param instanceId instanceId + * @return boolean + */ + public boolean updateInstanceInfos(Long timeStamp, int instanceId) { + Connection conn = getConnection("MemoryInstanceInfo"); + String updateSql = "UPDATE MemoryInstanceInfo SET deallocTime = ? where instanceId = ?"; + PreparedStatement preparedStatement = null; + try { + preparedStatement = conn.prepareStatement(updateSql); + preparedStatement.setLong(1, timeStamp); + preparedStatement.setInt(SQL_INDEX_TWO, instanceId); + return preparedStatement.executeUpdate() == 1 ? true : false; + } catch (SQLException throwables) { + LOGGER.error("SQLException {}", throwables.getMessage()); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, preparedStatement, null); + } + return false; + } + + /** + * 删除一次场景下的堆信息数据 + * + * @param sessionId sessionId + * @return boolean + */ + public boolean deleteSessionData(long sessionId) { + StringBuffer deleteSql = new StringBuffer("DELETE FROM MemoryInstanceInfo"); + Connection connection = DataBaseApi.getInstance().getConnectByTable("MemoryInstanceInfo").get(); + return execute(connection, deleteSql.toString()); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceDetailsDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceDetailsDao.java new file mode 100644 index 000000000..08b0d196b --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceDetailsDao.java @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.utils.common.util.CloseResourceUtil; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import static ohos.devtools.datasources.utils.common.Constant.JVMTI_AGENT_PLUG; + +/** + * 实例详情数据处理对象 + * + * @version 1.0 + * @date 2021/03/30 18:50 + **/ +public class MemoryInstanceDetailsDao extends AbstractDataStore { + private static final Logger LOGGER = LogManager.getLogger(MemoryInstanceDetailsDao.class); + + private static volatile MemoryInstanceDetailsDao singleton; + + /** + * getInstance + * + * @return MemoryInstanceDetailsDao + */ + public static MemoryInstanceDetailsDao getInstance() { + if (singleton == null) { + synchronized (MemoryInstanceDetailsDao.class) { + if (singleton == null) { + singleton = new MemoryInstanceDetailsDao(); + } + } + } + return singleton; + } + + /** + * MemoryInstanceDetailsDao + */ + public MemoryInstanceDetailsDao() { + createMemoryInstanceDetails(); + } + + /** + * 获取数据库连接 + * + * @param tableName 表名 + * @return Connection + * @date 2021/03/30 18:49 + */ + private Connection getConnection(String tableName) { + Optional optionalConnection = getConnectByTable(tableName); + Connection conn = null; + if (optionalConnection.isPresent()) { + conn = optionalConnection.get(); + } + return conn; + } + + /** + * 具体实例对象信息详情表的创建 + * + * @return boolean + */ + public boolean createMemoryInstanceDetails() { + String dbName = JVMTI_AGENT_PLUG; + String memoryInstanceDetailsInfoTable = "MemoryInstanceDetailsInfo"; + String sql = "CREATE TABLE MemoryInstanceDetailsInfo " + "( " + + " id Integer primary key autoincrement not null, " + + " instanceId int(100) not null, " + " frameId int(100) not null, " + + " className varchar(200) not null, " + " methodName varchar(200) not null, " + + " fieldName varchar(200) not null, " + " lineNumber int(100) " + ");"; + return createTable(dbName, memoryInstanceDetailsInfoTable, sql); + } + + /** + * 将端侧获取的实例对象对应的调用栈信息保存在数据库 + * + * @param memoryInstanceDetailsInfo memoryInstanceDetailsInfo + */ + public void insertMemoryInstanceDetailsInfo(MemoryInstanceDetailsInfo memoryInstanceDetailsInfo) { + Connection conn = null; + PreparedStatement ps = null; + try { + conn = getConnection("MemoryInstanceDetailsInfo"); + String sql = "insert into MemoryInstanceDetailsInfo(id,instanceId,frameId,className,methodName,fieldName," + + "lineNumber) values(null,?,?,?,?,?,?)"; + ps = conn.prepareStatement(sql); + ps.setInt(1, memoryInstanceDetailsInfo.getInstanceId()); + ps.setInt(Option.SQL_INDEX_TWO, memoryInstanceDetailsInfo.getFrameId()); + ps.setString(Option.SQL_INDEX_THREE, memoryInstanceDetailsInfo.getClassName()); + ps.setString(Option.SQL_INDEX_FOUR, memoryInstanceDetailsInfo.getMethodName()); + ps.setString(Option.SQL_INDEX_FIVE, memoryInstanceDetailsInfo.getFieldName()); + ps.setInt(Option.SQL_INDEX_SIX, memoryInstanceDetailsInfo.getLineNumber()); + ps.executeUpdate(); + } catch (SQLException throwAbles) { + LOGGER.error("insert Exception {}", throwAbles.getMessage()); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + } + + /** + * insertMemoryInstanceDetailsInfo + * + * @param memoryInstanceDetailsInfos memoryInstanceDetailsInfos + * @return boolean + */ + public boolean insertMemoryInstanceDetailsInfo(List memoryInstanceDetailsInfos) { + if (memoryInstanceDetailsInfos.isEmpty()) { + return false; + } + Connection conn = null; + PreparedStatement ps = null; + try { + conn = getConnection("MemoryInstanceDetailsInfo"); + conn.setAutoCommit(false); + String sql = "insert into MemoryInstanceDetailsInfo(id,instanceId,frameId,className,methodName,fieldName," + + "lineNumber) values(null,?,?,?,?,?,?)"; + ps = conn.prepareStatement(sql); + for (MemoryInstanceDetailsInfo memoryInstanceDetailsInfo : memoryInstanceDetailsInfos) { + try { + ps.setInt(1, memoryInstanceDetailsInfo.getInstanceId()); + ps.setInt(Option.SQL_INDEX_TWO, memoryInstanceDetailsInfo.getFrameId()); + ps.setString(Option.SQL_INDEX_THREE, memoryInstanceDetailsInfo.getClassName()); + ps.setString(Option.SQL_INDEX_FOUR, memoryInstanceDetailsInfo.getMethodName()); + ps.setString(Option.SQL_INDEX_FIVE, memoryInstanceDetailsInfo.getFieldName()); + ps.setInt(Option.SQL_INDEX_SIX, memoryInstanceDetailsInfo.getLineNumber()); + ps.addBatch(); + } catch (SQLException sqlException) { + LOGGER.info("insert AppInfo {}", sqlException.getMessage()); + } + } + int[] results = ps.executeBatch(); + conn.commit(); + return true; + } catch (SQLException throwables) { + LOGGER.error("insert Exception {}", throwables.getMessage()); + return false; + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + } + + /** + * getMemoryInstanceDetails + * + * @param instanceId instanceId + * @return ArrayList + */ + public ArrayList getMemoryInstanceDetails(Integer instanceId) { + Connection conn = getConnection("MemoryInstanceDetailsInfo"); + PreparedStatement ps = null; + ArrayList memoryInstanceDetailsInfos = new ArrayList<>(); + try { + String sql = "select * from MemoryInstanceDetailsInfo where instanceId = ?"; + ps = conn.prepareStatement(sql); + ps.setInt(1, instanceId); + ResultSet rs = ps.executeQuery(); + MemoryInstanceDetailsInfo memoryInstanceDetailsInfo = null; + while (rs.next()) { + memoryInstanceDetailsInfo = new MemoryInstanceDetailsInfo(); + Integer id = rs.getInt("id"); + Integer frameId = rs.getInt("frameId"); + String className = rs.getString("className"); + String methodName = rs.getString("methodName"); + String fieldName = rs.getString("fieldName"); + Integer lineNumber = rs.getInt("lineNumber"); + memoryInstanceDetailsInfo.setId(id); + memoryInstanceDetailsInfo.setInstanceId(instanceId); + memoryInstanceDetailsInfo.setFrameId(frameId); + memoryInstanceDetailsInfo.setClassName(className); + memoryInstanceDetailsInfo.setMethodName(methodName); + memoryInstanceDetailsInfo.setFieldName(fieldName); + memoryInstanceDetailsInfo.setLineNumber(lineNumber); + memoryInstanceDetailsInfos.add(memoryInstanceDetailsInfo); + } + return memoryInstanceDetailsInfos; + } catch (SQLException throwables) { + throwables.printStackTrace(); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + return memoryInstanceDetailsInfos; + } + + /** + * getAllMemoryInstanceDetails + * + * @return ArrayList + */ + public List getAllMemoryInstanceDetails() { + Connection conn = getConnection("MemoryInstanceDetailsInfo"); + PreparedStatement ps = null; + ArrayList memoryInstanceDetailsInfos = new ArrayList<>(); + try { + String sql = "select id,instanceId,frameId,className,methodName,fieldName," + + "lineNumber from MemoryInstanceDetailsInfo"; + ps = conn.prepareStatement(sql); + ResultSet rs = ps.executeQuery(); + MemoryInstanceDetailsInfo memoryInstanceDetailsInfo = null; + while (rs.next()) { + memoryInstanceDetailsInfo = new MemoryInstanceDetailsInfo(); + + Integer id = rs.getInt("id"); + Integer instanceId = rs.getInt("instanceId"); + Integer frameId = rs.getInt("frameId"); + String className = rs.getString("className"); + String methodName = rs.getString("methodName"); + String fieldName = rs.getString("fieldName"); + Integer lineNumber = rs.getInt("lineNumber"); + + memoryInstanceDetailsInfo.setId(id); + memoryInstanceDetailsInfo.setInstanceId(instanceId); + memoryInstanceDetailsInfo.setFrameId(frameId); + memoryInstanceDetailsInfo.setClassName(className); + memoryInstanceDetailsInfo.setMethodName(methodName); + memoryInstanceDetailsInfo.setFieldName(fieldName); + memoryInstanceDetailsInfo.setLineNumber(lineNumber); + memoryInstanceDetailsInfos.add(memoryInstanceDetailsInfo); + } + return memoryInstanceDetailsInfos; + } catch (SQLException throwables) { + throwables.printStackTrace(); + } finally { + CloseResourceUtil.closeResource(LOGGER, conn, ps, null); + } + return memoryInstanceDetailsInfos; + } + + /** + * 删除一次场景下的堆信息数据 + * + * @param sessionId sessionId + * @return boolean + */ + public boolean deleteSessionData(long sessionId) { + StringBuffer deleteSql = new StringBuffer("DELETE FROM MemoryInstanceDetailsInfo"); + Connection connection = DataBaseApi.getInstance().getConnectByTable("MemoryInstanceDetailsInfo").get(); + return execute(connection, deleteSql.toString()); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceDetailsInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceDetailsInfo.java new file mode 100644 index 000000000..a5327cb6b --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceDetailsInfo.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import java.io.Serializable; + +/** + * 调用栈信息 + * + * @version 1.0 + * @date 2021/03/29 21:25 + **/ +public class MemoryInstanceDetailsInfo implements Serializable { + private static final long serialVersionUID = -7886031529563053311L; + /** + * 当前对象Id + */ + private Integer id; + /** + * 调用栈对应的instanceId + */ + private Integer instanceId; + /** + * 端侧获取的frameId + */ + private Integer frameId; + /** + * 端侧获取的类名 + */ + private String className; + /** + * 端侧获取的方法名 + */ + private String methodName; + /** + * 端侧获取的属性名 + */ + private String fieldName; + private Integer lineNumber; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getInstanceId() { + return instanceId; + } + + public void setInstanceId(Integer instanceId) { + this.instanceId = instanceId; + } + + public Integer getFrameId() { + return frameId; + } + + public void setFrameId(Integer frameId) { + this.frameId = frameId; + } + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public String getMethodName() { + return methodName; + } + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public Integer getLineNumber() { + return lineNumber; + } + + public void setLineNumber(Integer lineNumber) { + this.lineNumber = lineNumber; + } + + @Override + public String toString() { + return "MemoryInstanceDetailsInfo{" + "frameId=" + frameId + ", className='" + className + '\'' + + ", methodName='" + methodName + '\'' + ", fieldName='" + fieldName + '\'' + ", lineNumber=" + lineNumber + + '}'; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceDetailsManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceDetailsManager.java new file mode 100644 index 000000000..448f6d73f --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceDetailsManager.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import java.util.ArrayList; +import java.util.List; + +/** + * Instance对应的调用栈信息处理对象 + * + * @version 1.0 + * @date 2021/03/31 21:07 + **/ +public class MemoryInstanceDetailsManager { + private final MemoryInstanceDetailsDao memoryInstanceDetailsDao = MemoryInstanceDetailsDao.getInstance(); + + /** + * 根据instanceId在数据库中查到instance对应的调用信息,提供给UI的查询接口 + * + * @param instanceId 实例Id + * @return ArrayList + */ + public ArrayList getMemoryInstanceDetailsInfos(Integer instanceId) { + return memoryInstanceDetailsDao.getMemoryInstanceDetails(instanceId); + } + + /** + * insertMemoryInstanceDetailsInfo + * + * @param memoryInstanceDetailsInfo memoryInstanceDetailsInfo + */ + public void insertMemoryInstanceDetailsInfo(MemoryInstanceDetailsInfo memoryInstanceDetailsInfo) { + memoryInstanceDetailsDao.insertMemoryInstanceDetailsInfo(memoryInstanceDetailsInfo); + } + + /** + * 根据instanceId在数据库中查到instance对应的调用信息 + * + * @return ArrayList + */ + public List getAllMemoryInstanceDetails() { + return memoryInstanceDetailsDao.getAllMemoryInstanceDetails(); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceInfo.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceInfo.java new file mode 100644 index 000000000..9413eb40c --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceInfo.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import java.io.Serializable; + +/** + * 具体实例信息 + * + * @version 1.0 + * @date 2021/03/29 21:22 + **/ +public class MemoryInstanceInfo implements Serializable { + private static final long serialVersionUID = -2702142952950557386L; + /** + * 当前实例对象Id + */ + private Integer id; + /** + * 端侧获取的instanceId + */ + private Integer instanceId; + /** + * 当前实例Instance对应的类Id + */ + private Integer cId; + /** + * 实例名称 + */ + private String instance; + /** + * 当前Instance的创建时间 + */ + private Long allocTime; + /** + * 当前Instance的销毁时间 + */ + private Long deallocTime; + /** + * 当前Instance的入库时间 + */ + private Long createTime; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getInstanceId() { + return instanceId; + } + + public void setInstanceId(Integer instanceId) { + this.instanceId = instanceId; + } + + public Integer getcId() { + return cId; + } + + public void setcId(Integer cId) { + this.cId = cId; + } + + public String getInstance() { + return instance; + } + + public void setInstance(String instance) { + this.instance = instance; + } + + public Long getAllocTime() { + return allocTime; + } + + public void setAllocTime(Long allocTime) { + this.allocTime = allocTime; + } + + public Long getDeallocTime() { + return deallocTime; + } + + public void setDeallocTime(Long deallocTime) { + this.deallocTime = deallocTime; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + @Override + public String toString() { + return "MemoryInstanceInfo{" + "id=" + id + ", instanceId=" + instanceId + ", cId=" + cId + ", instance='" + + instance + '\'' + ", allocTime=" + allocTime + ", deallocTime=" + deallocTime + ", createTime=" + + createTime + '}'; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceManager.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceManager.java new file mode 100644 index 000000000..582800174 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryInstanceManager.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import java.util.ArrayList; + +/** + * 实例对象业务处理类 + * + * @version 1.0 + * @date 2021/03/31 19:44 + **/ +public class MemoryInstanceManager { + /** + * 根据类的Id在数据库中查到相应的instance信息,提供给UI的查询接口 + * + * @param cId 父Id + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return ArrayList + */ + public ArrayList getMemoryInstanceInfos(Integer cId, Long startTime, Long endTime) { + MemoryInstanceDao memoryInstanceDao = MemoryInstanceDao.getInstance(); + return memoryInstanceDao.getMemoryInstanceInfos(cId, startTime, endTime); + } + + /** + * insertMemoryInstanceInfo + * + * @param memoryInstanceInfo memoryInstanceInfo + */ + public void insertMemoryInstanceInfo(MemoryInstanceInfo memoryInstanceInfo) { + MemoryInstanceDao memoryInstanceDao = MemoryInstanceDao.getInstance(); + memoryInstanceDao.insertMemoryInstanceInfo(memoryInstanceInfo); + } + + /** + * 根据类的查instance信息 + * + * @return ArrayList + */ + public ArrayList getAllMemoryInstanceInfos() { + MemoryInstanceDao memoryInstanceDao = MemoryInstanceDao.getInstance(); + return memoryInstanceDao.getAllMemoryInstanceInfos(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryService.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryService.java new file mode 100644 index 000000000..1c52307df --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/MemoryService.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import ohos.devtools.datasources.databases.datatable.enties.ProcessMemInfo; +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.LinkedHashMap; +import java.util.List; + +/** + * @Description Memory业务处理类 + * @Date 2021/2/7 13:47 + **/ +public class MemoryService { + private static final Logger LOGGER = LogManager.getLogger(MemoryService.class); + + private static MemoryService instance; + + /** + * MemoryService + * + * @return MemoryService + */ + public static MemoryService getInstance() { + if (instance == null) { + synchronized (MemoryService.class) { + if (instance == null) { + instance = new MemoryService(); + } + } + } + return instance; + } + + private LinkedHashMap memordata; + + private MemoryService() { + } + + /** + * 添加数据 + * + * @param sessionId sessionId + * @param min min + * @param max max + * @param firstTimestamp 本次Chart首次创建并启动刷新时的时间戳 + */ + public void addData(long sessionId, int min, int max, long firstTimestamp) { + memordata = MemoryDao.getInstance().getData(sessionId, min, max, firstTimestamp, false); + ChartDataCache.getInstance().addCacheBlock(String.valueOf(sessionId), memordata); + } + + /** + * 获取数据 + * + * @param sessionId sessionId + * @param min min + * @param max max + * @param firstTimestamp 本次Chart首次创建并启动刷新时的时间戳 + * @return LinkedHashMap + */ + public LinkedHashMap getData(long sessionId, int min, int max, + long firstTimestamp) { + return MemoryDao.getInstance().getData(sessionId, min, max, firstTimestamp, false); + } + + /** + * 获取所有数据 + * + * @param sessionId sessionId + * @return List + */ + public List getAllData(long sessionId) { + List listData = MemoryDao.getInstance().getAllData(sessionId); + return listData; + } + + /** + * deleteSessionData + * + * @param sessionId sessionId + * @return boolean + */ + public boolean deleteSessionData(long sessionId) { + return MemoryDao.getInstance().deleteSessionData(sessionId); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/Option.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/Option.java new file mode 100644 index 000000000..d75499a5e --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/memory/Option.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +/** + * memory常量对象 + * + * @version 1.0 + * @date 2021/04/07 10:00 + **/ +public class Option { + /** + * 数据库字段下标值2 + */ + public static final int SQL_INDEX_TWO = 2; + + /** + * 数据库字段下标值3 + */ + public static final int SQL_INDEX_THREE = 3; + + /** + * 数据库字段下标值4 + */ + public static final int SQL_INDEX_FOUR = 4; + + /** + * 数据库字段下标值5 + */ + public static final int SQL_INDEX_FIVE = 5; + + /** + * 数据库字段下标值6 + */ + public static final int SQL_INDEX_SIX = 6; + + /** + * 数据库字段下标值7 + */ + public static final int SQL_INDEX_SEVEN = 7; + + /** + * 数据库字段下标值8 + */ + public static final int SQL_INDEX_EIGHT = 8; + + /** + * 数据库字段下标值9 + */ + public static final int SQL_INDEX_NINE = 9; + + /** + * 数据库字段下标值10 + */ + public static final int SQL_INDEX_TEN = 10; + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/network/NetworkDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/network/NetworkDao.java new file mode 100644 index 000000000..0570d0eff --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/network/NetworkDao.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.network; + +/** + * @Description Network与数据库交互类 + * @Date 2021/2/7 14:10 + **/ +public class NetworkDao { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/network/NetworkService.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/network/NetworkService.java new file mode 100644 index 000000000..e81904e92 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/network/NetworkService.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.network; + +/** + * @Description Network业务处理类 + * @Date 2021/2/7 13:48 + **/ +public class NetworkService { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/power/PowerDao.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/power/PowerDao.java new file mode 100644 index 000000000..58e4d69a4 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/power/PowerDao.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.power; + +/** + * @Description Power与数据库交互类 + * @Date 2021/2/7 14:11 + **/ +public class PowerDao { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/services/power/PowerService.java b/host/ohosprofiler/src/main/java/ohos/devtools/services/power/PowerService.java new file mode 100644 index 000000000..9b8593685 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/services/power/PowerService.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.power; + +/** + * @Description Power业务处理类 + * @Date 2021/2/7 13:49 + **/ +public class PowerService { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/FilledLineChart.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/FilledLineChart.java new file mode 100644 index 000000000..8745653a3 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/FilledLineChart.java @@ -0,0 +1,432 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts; + +import ohos.devtools.views.charts.model.ChartDataModel; +import ohos.devtools.views.charts.model.ChartLegendColorRect; +import ohos.devtools.views.common.MonitorItemDetail; +import ohos.devtools.views.charts.tooltip.LegendTooltip; +import ohos.devtools.views.charts.tooltip.TooltipItem; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; + +import javax.swing.JComponent; +import javax.swing.JLabel; +import java.awt.Graphics; +import java.awt.Polygon; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import static ohos.devtools.views.charts.model.ChartType.FILLED_LINE; +import static ohos.devtools.views.charts.utils.ChartConstants.INITIAL_VALUE; +import static ohos.devtools.views.charts.utils.ChartConstants.NUM_1024; +import static ohos.devtools.views.charts.utils.ChartConstants.NUM_2; +import static ohos.devtools.views.charts.utils.ChartConstants.NUM_3; +import static ohos.devtools.views.charts.utils.ChartUtils.divide; +import static ohos.devtools.views.charts.utils.ChartUtils.divideInt; +import static ohos.devtools.views.charts.utils.ChartUtils.multiply; +import static ohos.devtools.views.common.MonitorItemDetail.MEM_CODE; +import static ohos.devtools.views.common.MonitorItemDetail.MEM_GRAPHICS; +import static ohos.devtools.views.common.MonitorItemDetail.MEM_JAVA; +import static ohos.devtools.views.common.MonitorItemDetail.MEM_NATIVE; +import static ohos.devtools.views.common.MonitorItemDetail.MEM_OTHERS; +import static ohos.devtools.views.common.MonitorItemDetail.MEM_STACK; + +/** + * 已填充的折线图 + * + * @since 2021/1/27 16:05 + */ +public class FilledLineChart extends ProfilerChart { + private final JLabel total = new JLabel(); + + private final JLabel javaLabel = new JLabel(); + + private final JLabel nativeLabel = new JLabel(); + + private final JLabel graphicsLabel = new JLabel(); + + private final JLabel stackLabel = new JLabel(); + + private final JLabel codeLabel = new JLabel(); + + private final JLabel othersLabel = new JLabel(); + + private final JLabel allocated = new JLabel("-- Allocated:N/A"); + + private final ChartLegendColorRect javaColorRect = new ChartLegendColorRect(); + + private final ChartLegendColorRect nativeColorRect = new ChartLegendColorRect(); + + private final ChartLegendColorRect graphicsColorRect = new ChartLegendColorRect(); + + private final ChartLegendColorRect stackColorRect = new ChartLegendColorRect(); + + private final ChartLegendColorRect codeColorRect = new ChartLegendColorRect(); + + private final ChartLegendColorRect othersColorRect = new ChartLegendColorRect(); + + /** + * 构造函数 + * + * @param bottomPanel 最底层父级面板 + */ + public FilledLineChart(ProfilerChartsView bottomPanel) { + super(bottomPanel); + chartType = FILLED_LINE; + initLegendComponents(); + } + + /** + * 初始化图例 + */ + private void initLegendComponents() { + total.setOpaque(false); + allocated.setOpaque(false); + javaColorRect.setOpaque(false); + javaLabel.setOpaque(false); + nativeColorRect.setOpaque(false); + nativeLabel.setOpaque(false); + graphicsColorRect.setOpaque(false); + graphicsLabel.setOpaque(false); + stackColorRect.setOpaque(false); + stackLabel.setOpaque(false); + codeColorRect.setOpaque(false); + codeLabel.setOpaque(false); + othersColorRect.setOpaque(false); + othersLabel.setOpaque(false); + } + + /** + * 构建图例 + * + * @param lastModels 面板上最右侧的数据 + * @see "图例展示的是面板上最右侧X轴对应的Y值,而非鼠标悬停处" + */ + @Override + protected void buildLegends(List lastModels) { + if (lastModels.size() == 1 && ("Total").equals(lastModels.get(0).getName())) { + buildMonitorViewLegend(lastModels); + } else { + // 否则为二级界面 + buildStageViewLegend(lastModels); + } + } + + /** + * 构造一级界面的图例 + * + * @param models 数据集合 + */ + private void buildMonitorViewLegend(List models) { + if (legends.getComponents().length == 0) { + legends.add(total); + } + BigDecimal totalValue = divide(models.get(0).getValue(), NUM_1024); + total.setText(totalValue + axisLabelY); + } + + /** + * 构造二级界面的图例 + * + * @param models 数据集合 + */ + private void buildStageViewLegend(List models) { + if (legends.getComponents().length == 0) { + addLegendComponents(); + } + // 文本标签 + BigDecimal totalMB = divide(new BigDecimal(getListSum(models, 0)), new BigDecimal(NUM_1024)); + total.setText(String.format(Locale.ENGLISH, "Total:%s%s", totalMB, axisLabelY)); + + Map> allItemLegendMap = initItemLegends(); + models.forEach(model -> parseModelToLegend(model, allItemLegendMap)); + // Map中只剩下没有选择的监控项,需要隐藏 + allItemLegendMap.forEach((item, components) -> components.forEach(component -> component.setVisible(false))); + } + + /** + * 添加Legend组件 + */ + private void addLegendComponents() { + legends.add(total); + legends.add(javaColorRect); + legends.add(javaLabel); + legends.add(nativeColorRect); + legends.add(nativeLabel); + legends.add(graphicsColorRect); + legends.add(graphicsLabel); + legends.add(stackColorRect); + legends.add(stackLabel); + legends.add(codeColorRect); + legends.add(codeLabel); + legends.add(othersColorRect); + legends.add(othersLabel); + legends.add(allocated); + } + + /** + * 初始化一个全量的内存图例的Map + * + * @return Map<监控项, 对应的图例组件> + */ + private Map> initItemLegends() { + Map> map = new HashMap<>(); + map.put(MEM_JAVA, Arrays.asList(javaColorRect, javaLabel)); + map.put(MEM_NATIVE, Arrays.asList(nativeColorRect, nativeLabel)); + map.put(MEM_GRAPHICS, Arrays.asList(graphicsColorRect, graphicsLabel)); + map.put(MEM_STACK, Arrays.asList(stackColorRect, stackLabel)); + map.put(MEM_CODE, Arrays.asList(codeColorRect, codeLabel)); + map.put(MEM_OTHERS, Arrays.asList(othersColorRect, othersLabel)); + return map; + } + + /** + * 处理数据,转化为图例 + * + * @param model 数据 + * @param allItemLegendMap 内存图例的Map + */ + private void parseModelToLegend(ChartDataModel model, Map> allItemLegendMap) { + MonitorItemDetail item = MonitorItemDetail.getItemByName(model.getName()); + switch (item) { + case MEM_JAVA: + refreshColorText(javaColorRect, javaLabel, model); + // 如果model保存的为当前监控项,则显示其组件 + allItemLegendMap.get(MEM_JAVA).forEach(component -> component.setVisible(true)); + // 组件设置为显示后,从Map中移除,循环完成后,Map中就只剩下没有选择的监控项,需要隐藏 + allItemLegendMap.remove(MEM_JAVA); + break; + case MEM_NATIVE: + refreshColorText(nativeColorRect, nativeLabel, model); + allItemLegendMap.get(MEM_NATIVE).forEach(component -> component.setVisible(true)); + allItemLegendMap.remove(MEM_NATIVE); + break; + case MEM_GRAPHICS: + refreshColorText(graphicsColorRect, graphicsLabel, model); + allItemLegendMap.get(MEM_GRAPHICS).forEach(component -> component.setVisible(true)); + allItemLegendMap.remove(MEM_GRAPHICS); + break; + case MEM_STACK: + refreshColorText(stackColorRect, stackLabel, model); + allItemLegendMap.get(MEM_STACK).forEach(component -> component.setVisible(true)); + allItemLegendMap.remove(MEM_STACK); + break; + case MEM_CODE: + refreshColorText(codeColorRect, codeLabel, model); + allItemLegendMap.get(MEM_CODE).forEach(component -> component.setVisible(true)); + allItemLegendMap.remove(MEM_CODE); + break; + case MEM_OTHERS: + refreshColorText(othersColorRect, othersLabel, model); + allItemLegendMap.get(MEM_OTHERS).forEach(component -> component.setVisible(true)); + allItemLegendMap.remove(MEM_OTHERS); + break; + default: + break; + } + } + + /** + * 更新图例的颜色和文本 + * + * @param colorRect 图例色块 + * @param label 图例文本标签 + * @param model 数据 + */ + private void refreshColorText(ChartLegendColorRect colorRect, JLabel label, ChartDataModel model) { + // 文本标签 + String showValue = divide(model.getValue(), NUM_1024).toString(); + String text = String.format(Locale.ENGLISH, "%s:%s%s", model.getName(), showValue, axisLabelY); + colorRect.setColor(model.getColor()); + if (!label.getText().equals(text)) { + label.setText(text); + } + } + + /** + * 绘制图表 + * + * @param graphics Graphics + */ + @Override + protected void paintChart(Graphics graphics) { + if (dataMap == null || dataMap.size() == 0) { + return; + } + // 循环绘制多条折线 + List lines = dataMap.entrySet().iterator().next().getValue(); + lines.forEach((line) -> paintFilledLine(line.getIndex(), graphics)); + } + + /** + * 绘制填充的折线 + * + * @param index 折线的index + * @param graphics Graphics + * @see "堆叠方式:当前折线的点的y值是所有在当前折线之下的y值之和,y点添加完成后,还要从右向左添加他下面一条线的y点,构成闭合图形" + */ + private void paintFilledLine(int index, Graphics graphics) { + Polygon polygon = new Polygon(); + int[] timeArray = dataMap.keySet().stream().mapToInt(Integer::valueOf).toArray(); + // 每条线的颜色是一样的,所以这里只需要获取一次,不需要在下面的Map循环中每次都获取 + graphics.setColor(getCurrentLineColor(index, dataMap.get(timeArray[0]))); + // 堆叠方案:从左向后添加当前index折线的点,然后再从右向左添加next index折线的点 + // 从左向后添加当前index折线的点 + for (int time : timeArray) { + int x = startXCoordinate + multiply(pixelPerX, time - startTime); + // 折线是堆叠方式,y值应该为当前折线的值加上他下面所有折线的值之和 + int sum = getListSum(dataMap.get(time), index); + // 更新Y轴最大值 + if (sum > maxUnitY) { + // 更新y最大值的占用比例 + maxUnitY = divideInt(sum * NUM_3, NUM_2); + } + int y = y0 + multiply(pixelPerY, sum); + polygon.addPoint(x, y); + } + // 绘制辅线 + paintAssistLine(index, polygon, timeArray); + // 使用画笔填充多边形,形成折线 + graphics.fillPolygon(polygon); + } + + private void paintAssistLine(int index, Polygon polygon, int[] timeArray) { + // 如果nextLine不存在,表明index是最后一条线,这直接添加首尾的y0点即可,不需要循环计算所有点 + int nextLineIndex = getNextLineIndex(index, dataMap.get(timeArray[0])); + if (nextLineIndex == INITIAL_VALUE) { + int endX = startXCoordinate + multiply(pixelPerX, timeArray[timeArray.length - 1] - startTime); + int startX = startXCoordinate + multiply(pixelPerX, timeArray[0] - startTime); + polygon.addPoint(endX, y0); + polygon.addPoint(startX, y0); + } else { + // 从右向左添加next index折线的点 + for (int i = timeArray.length - 1; i >= 0; i--) { + // 计算数据在折线图上的X和Y点 + int x = startXCoordinate + multiply(pixelPerX, timeArray[i] - startTime); + // 如果是堆叠方式,y值应该为当前折线的值加上他下面所有折线的值之和 + int sum = getListSum(dataMap.get(timeArray[i]), nextLineIndex); + // 更新Y轴最大值 + if (sum > maxUnitY) { + // 更新y最大值的占用比例 + maxUnitY = divideInt(sum * NUM_3, NUM_2); + } + int y = y0 + multiply(pixelPerY, sum); + polygon.addPoint(x, y); + } + } + } + + /** + * 获取下一条折线的index + * + * @param current 当前折线的index + * @param lineModels 所有折线的数据模型 + * @return 下一条折线的index + */ + private int getNextLineIndex(int current, List lineModels) { + int next = INITIAL_VALUE; + if (lineModels == null || lineModels.isEmpty()) { + return next; + } + int size = lineModels.size(); + for (int index = 0; index < size; index++) { + ChartDataModel lineModel = lineModels.get(index); + int newIndex = index + 1; + if (lineModel.getIndex() == current && newIndex < size) { + next = lineModels.get(index + 1).getIndex(); + break; + } + } + return next; + } + + /** + * 构造悬浮提示框的内容 + * + * @param showKey 要展示的Key + * @param actualKey 实际在数据集合中取值的Key + * @param isNewChart 是否为新Chart + */ + @Override + protected void buildTooltip(int showKey, int actualKey, boolean isNewChart) { + String totalValue = calcTotal(actualKey); + List tooltipItems = buildTooltipItems(actualKey); + LegendTooltip.getInstance().showTip(this, showKey + "", totalValue, tooltipItems, isNewChart); + } + + /** + * 计算某一时间的Total值 + * + * @param time 时间 + * @return Total值 + */ + private String calcTotal(int time) { + List models = dataMap.get(time); + if (models == null || models.size() == 0) { + return ""; + } + // 这里拿到是KB,要转为MB + int value = getListSum(models, 0); + return divide(value, NUM_1024).toString(); + } + + /** + * 构造Tooltip + * + * @param time 当前时间 + * @return List + */ + private List buildTooltipItems(int time) { + List tooltipItems = new ArrayList<>(); + if (dataMap == null || dataMap.size() == 0 || dataMap.get(time) == null) { + return tooltipItems; + } + for (ChartDataModel model : dataMap.get(time)) { + BigDecimal showValue = divide(model.getValue(), NUM_1024); + String text = String.format(Locale.ENGLISH, "%s:%s%s", model.getName(), showValue, axisLabelY); + TooltipItem tooltipItem = new TooltipItem(model.getColor(), text); + tooltipItems.add(tooltipItem); + } + return tooltipItems; + } + + /** + * 求集合中指定index之后的所有元素的Value的和 + * + * @param models 数据集合 + * @param index 指定index + * @return int + */ + private int getListSum(List models, int index) { + int sum = 0; + if (index == INITIAL_VALUE || models == null) { + return sum; + } + for (ChartDataModel model : models) { + if (model.getIndex() < index) { + continue; + } + sum += model.getValue(); + } + return sum; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/LineChart.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/LineChart.java new file mode 100644 index 000000000..26e452b94 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/LineChart.java @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts; + +import ohos.devtools.views.charts.model.ChartDataModel; +import ohos.devtools.views.charts.model.ChartLegendColorRect; +import ohos.devtools.views.charts.tooltip.LegendTooltip; +import ohos.devtools.views.charts.tooltip.TooltipItem; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.MonitorItemDetail; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; + +import javax.swing.JComponent; +import javax.swing.JLabel; +import java.awt.BasicStroke; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Stroke; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import static ohos.devtools.views.charts.model.ChartType.LINE; +import static ohos.devtools.views.charts.utils.ChartConstants.DEFAULT_LINE_WIDTH; +import static ohos.devtools.views.charts.utils.ChartConstants.NUM_2; +import static ohos.devtools.views.charts.utils.ChartConstants.NUM_3; +import static ohos.devtools.views.charts.utils.ChartUtils.divideInt; +import static ohos.devtools.views.charts.utils.ChartUtils.multiply; +import static ohos.devtools.views.common.MonitorItemDetail.NETWORK_CONN; +import static ohos.devtools.views.common.MonitorItemDetail.NETWORK_RCV; +import static ohos.devtools.views.common.MonitorItemDetail.NETWORK_SENT; + +/** + * @Description 折线图 + * @Date 2021/4/20 16:37 + **/ +public class LineChart extends ProfilerChart { + private final ChartLegendColorRect receivedColor = new ChartLegendColorRect(); + + private final JLabel receivedLabel = new JLabel(); + + private final ChartLegendColorRect sentColor = new ChartLegendColorRect(); + + private final JLabel sentLabel = new JLabel(); + + private final ChartLegendColorRect connectionsColor = new ChartLegendColorRect(); + + private final JLabel connectionsLabel = new JLabel(); + + /** + * 构造函数 + * + * @param bottomPanel 最底层父级面板 + */ + public LineChart(ProfilerChartsView bottomPanel) { + super(bottomPanel); + chartType = LINE; + initLegends(); + } + + /** + * 初始化图例 + */ + private void initLegends() { + receivedColor.setOpaque(false); + receivedLabel.setOpaque(false); + sentColor.setOpaque(false); + sentLabel.setOpaque(false); + connectionsColor.setOpaque(false); + connectionsLabel.setOpaque(false); + } + + /** + * 构建图例 + * + * @param lastModels 面板上最右侧的数据 + * @see "图例展示的是面板上最右侧X轴对应的Y值,而非鼠标悬停处" + */ + @Override + protected void buildLegends(List lastModels) { + if (legends.getComponents().length == 0) { + addLegendComponents(); + } + Map> allItemLegendMap = initItemLegends(); + lastModels.forEach(model -> parseModelToLegend(model, allItemLegendMap)); + // Map中只剩下没有选择的监控项,需要隐藏 + allItemLegendMap.forEach((item, components) -> components.forEach(component -> component.setVisible(false))); + } + + /** + * 添加Legend组件 + */ + private void addLegendComponents() { + legends.add(receivedColor); + legends.add(receivedLabel); + legends.add(sentColor); + legends.add(sentLabel); + legends.add(connectionsColor); + legends.add(connectionsLabel); + } + + /** + * 初始化一个全量的Network图例的Map + * + * @return Map<监控项, 对应的图例组件> + */ + private Map> initItemLegends() { + Map> map = new HashMap<>(); + map.put(NETWORK_RCV, Arrays.asList(receivedColor, receivedLabel)); + map.put(NETWORK_SENT, Arrays.asList(sentColor, sentLabel)); + map.put(NETWORK_CONN, Arrays.asList(connectionsColor, connectionsLabel)); + return map; + } + + /** + * 处理数据,转化为图例 + * + * @param model 数据 + * @param allItemLegendMap 内存图例的Map + */ + private void parseModelToLegend(ChartDataModel model, Map> allItemLegendMap) { + MonitorItemDetail item = MonitorItemDetail.getItemByName(model.getName()); + switch (item) { + case NETWORK_RCV: + refreshColorText(receivedColor, receivedLabel, model); + // 如果model保存的为当前监控项,则显示其组件 + allItemLegendMap.get(NETWORK_RCV).forEach(component -> component.setVisible(true)); + // 组件设置为显示后,从Map中移除,循环完成后,Map中就只剩下没有选择的监控项,需要隐藏 + allItemLegendMap.remove(NETWORK_RCV); + break; + case NETWORK_SENT: + refreshColorText(sentColor, sentLabel, model); + allItemLegendMap.get(NETWORK_SENT).forEach(component -> component.setVisible(true)); + allItemLegendMap.remove(NETWORK_SENT); + break; + case NETWORK_CONN: + refreshColorText(connectionsColor, connectionsLabel, model); + allItemLegendMap.get(NETWORK_CONN).forEach(component -> component.setVisible(true)); + allItemLegendMap.remove(NETWORK_CONN); + break; + default: + break; + } + } + + /** + * 更新图例的颜色和文本 + * + * @param colorRect 图例色块 + * @param label 图例文本标签 + * @param model 数据 + */ + private void refreshColorText(ChartLegendColorRect colorRect, JLabel label, ChartDataModel model) { + // 文本标签 + String showValue = String.valueOf(model.getValue()); + String text = String.format(Locale.ENGLISH, "%s:%s%s", model.getName(), showValue, axisLabelY); + colorRect.setColor(model.getColor()); + colorRect.setOpaque(false); + legends.add(colorRect); + if (!label.getText().equals(text)) { + label.setText(text); + } + // 重要!设置透明,否则标尺会被盖住 + label.setOpaque(false); + legends.add(label); + } + + /** + * 绘制图表 + * + * @param graphics Graphics + */ + @Override + protected void paintChart(Graphics graphics) { + if (dataMap == null || dataMap.size() == 0) { + return; + } + Graphics graphic = graphics.create(); + Graphics2D graphicD = null; + if (graphic instanceof Graphics2D) { + graphicD = (Graphics2D) graphic; + } + // 获取原始线条特征 + Stroke stroke = graphicD.getStroke(); + BasicStroke defaultStroke = null; + if (stroke instanceof BasicStroke) { + defaultStroke = (BasicStroke) stroke; + } + // 定义虚线条特征 + BasicStroke bs = new BasicStroke(DEFAULT_LINE_WIDTH); + graphicD.setColor(ColorConstants.RULER); + graphicD.setStroke(bs); + // 循环绘制多条折线 + List lines = dataMap.entrySet().iterator().next().getValue(); + lines.forEach((line) -> paintLine(line.getIndex(), graphics)); + // 绘制完成后,要把默认格式还原 + graphicD.setStroke(defaultStroke); + } + + /** + * 绘制折线 + * + * @param index 折线的index + * @param graphics Graphics + */ + private void paintLine(int index, Graphics graphics) { + int[] timeArray = dataMap.keySet().stream().mapToInt(Integer::valueOf).toArray(); + int length = timeArray.length; + int[] pointX = new int[length]; + int[] pointY = new int[length]; + for (int i = 0; i < length; i++) { + int time = timeArray[i]; + pointX[i] = startXCoordinate + multiply(pixelPerX, time - startTime); + int value = dataMap.get(time).get(index).getValue(); // 更新Y轴最大值 + if (value > maxUnitY) { + // 更新y最大值的占用比例 + maxUnitY = divideInt(value * NUM_3, NUM_2); + } + int y = y0 + multiply(pixelPerY, value); + pointY[i] = y; + } + // 每条线的颜色是一样的,所以这里只需要获取一次,不需要在下面的Map循环中每次都获取 + graphics.setColor(getCurrentLineColor(index, dataMap.get(timeArray[0]))); + graphics.drawPolyline(pointX, pointY, length); + } + + /** + * 构造悬浮提示框的内容 + * + * @param showKey 要展示的Key + * @param actualKey 实际在数据集合中取值的Key + * @param isNewChart 是否为新Chart + */ + @Override + protected void buildTooltip(int showKey, int actualKey, boolean isNewChart) { + List tooltipItems = buildTooltipItems(actualKey); + LegendTooltip.getInstance().showTip(this, showKey + "", "", tooltipItems, isNewChart); + } + + /** + * 构造Tooltip + * + * @param time 当前时间 + * @return List + */ + private List buildTooltipItems(int time) { + List tooltipItems = new ArrayList<>(); + if (dataMap == null || dataMap.size() == 0 || dataMap.get(time) == null) { + return tooltipItems; + } + for (ChartDataModel model : dataMap.get(time)) { + String showValue = String.valueOf(model.getValue()); + String text = String.format(Locale.ENGLISH, "%s:%s%s", model.getName(), showValue, axisLabelY); + TooltipItem tooltipItem = new TooltipItem(model.getColor(), text); + tooltipItems.add(tooltipItem); + } + return tooltipItems; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/ProfilerChart.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/ProfilerChart.java new file mode 100644 index 000000000..03ffe553a --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/ProfilerChart.java @@ -0,0 +1,602 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts; + +import com.intellij.ui.JBColor; +import ohos.devtools.views.charts.model.ChartDataModel; +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartType; +import ohos.devtools.views.charts.tooltip.LegendTooltip; +import ohos.devtools.views.charts.utils.ChartUtils; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; + +import javax.swing.JPanel; +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.math.BigDecimal; +import java.util.LinkedHashMap; +import java.util.List; + +import static java.awt.AlphaComposite.SRC_OVER; +import static java.awt.BasicStroke.CAP_BUTT; +import static java.awt.BasicStroke.JOIN_ROUND; +import static ohos.devtools.views.charts.utils.ChartConstants.CHART_HEADER_HEIGHT; +import static ohos.devtools.views.charts.utils.ChartConstants.DEFAULT_CHART_COLOR; +import static ohos.devtools.views.charts.utils.ChartConstants.INITIAL_VALUE; +import static ohos.devtools.views.charts.utils.ChartConstants.OPAQUE_VALUE; +import static ohos.devtools.views.charts.utils.ChartConstants.SCALE_LINE_LEN; +import static ohos.devtools.views.charts.utils.ChartConstants.TRANSLUCENT_VALUE; +import static ohos.devtools.views.charts.utils.ChartConstants.UNIT; +import static ohos.devtools.views.charts.utils.ChartConstants.Y_AXIS_STR_OFFSET_X; +import static ohos.devtools.views.charts.utils.ChartConstants.Y_AXIS_STR_OFFSET_Y; +import static ohos.devtools.views.charts.utils.ChartUtils.divide; +import static ohos.devtools.views.charts.utils.ChartUtils.divideInt; +import static ohos.devtools.views.charts.utils.ChartUtils.multiply; +import static ohos.devtools.views.common.LayoutConstants.FLOAT_VALUE; +import static ohos.devtools.views.common.ViewConstants.CHART_MAX_Y; +import static ohos.devtools.views.common.ViewConstants.CHART_SECTION_NUM_Y; + +/** + * Chart的抽象父类 + * + * @since 2021/2/1 9:30 + */ +public abstract class ProfilerChart extends JPanel implements MouseListener, MouseMotionListener { + /** + * 构建图例 + * + * @param lastModels 面板上最右侧的数据 + * @see "图例展示的是面板上最右侧X轴对应的Y值,而非鼠标悬停处" + */ + protected abstract void buildLegends(List lastModels); + + /** + * 绘制图表 + * + * @param graphics Graphics + */ + protected abstract void paintChart(Graphics graphics); + + /** + * 构造悬浮提示框的内容 + * + * @param showKey 要展示的Key + * @param actualKey 实际在数据集合中取值的Key + * @param isNewChart 是否为新Chart + */ + protected abstract void buildTooltip(int showKey, int actualKey, boolean isNewChart); + + /** + * 最底层父级面板 + */ + protected final ProfilerChartsView bottomPanel; + + /** + * 图表类型 + */ + protected ChartType chartType; + + /** + * 数据集合 + * + * @see "Key:时间, Value:所有Chart的值>" + */ + protected volatile LinkedHashMap> dataMap; + + /** + * 图例 + */ + protected JPanel legends; + + /** + * X轴上可以展示的最大数量 + */ + protected int maxDisplayX = 1; + + /** + * X轴刻度线上的最小刻度间隔 + */ + protected int minMarkIntervalX = 1; + + /** + * X轴标签 + */ + protected String axisLabelX = ""; + + /** + * Y轴标签 + */ + protected String axisLabelY = ""; + + /** + * Y轴最大单位 + */ + protected int maxUnitY = CHART_MAX_Y; + + /** + * Y轴坐标刻度分段数量 + */ + protected int sectionNumY = CHART_SECTION_NUM_Y; + + /** + * 绘图时X轴的开始点 + */ + protected int startTime; + + /** + * 绘图时X轴的结束点 + */ + protected int endTime; + + /** + * 当前Chart的顶部 + */ + protected int top = 0; + + /** + * 当前Chart的右侧 + */ + protected int right = 0; + + /** + * 绘制Chart时的坐标轴X0点 + * + * @see "是日常中绘图习惯的坐标轴X0点,非Swing绘图的坐标轴原点" + */ + protected int x0 = 0; + + /** + * 绘制Chart时的坐标轴Y0点 + * + * @see "是日常中绘图习惯的坐标轴Y0点,非Swing绘图的坐标轴原点" + */ + protected int y0 = 0; + + /** + * X轴起始绘图的坐标,因为动态Chart从右往左出现 + */ + protected int startXCoordinate = 0; + + /** + * 每个X轴单位占用的像素数 + */ + protected BigDecimal pixelPerX; + + /** + * 每个Y轴单位占用的像素数z + */ + protected BigDecimal pixelPerY; + + /** + * 鼠标是否进入Chart + * + * @see "这里是指进入绘制出来的Chart,而非Chart组件" + */ + protected boolean isEnterChart; + + /** + * 构造函数 + * + * @param bottomPanel 最底层父级面板 + */ + public ProfilerChart(ProfilerChartsView bottomPanel) { + this.bottomPanel = bottomPanel; + // 设置可透明显示 + this.setOpaque(false); + this.setLayout(new BorderLayout()); + // 添加图例组件的布局 + legends = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + legends.setOpaque(false); + this.add(legends, BorderLayout.NORTH); + this.addMouseListener(this); + this.addMouseMotionListener(this); + } + + /** + * 更新Chart的起始、结束时间以及数据集合,实现刷新Chart的功能 + * + * @param startTime 起始时间 + * @param endTime 结束时间 + * @param dataMap 数据集合 + */ + public void refreshChart(int startTime, int endTime, LinkedHashMap> dataMap) { + // 保存数据,并重绘界面 + this.startTime = startTime; + this.endTime = endTime; + this.dataMap = dataMap; + refreshLegends(); + this.repaint(); + this.revalidate(); + } + + /** + * 刷新图例 + */ + protected void refreshLegends() { + // 在时间的数组中,找到最接近的值 + int lastTime = getLastTime(); + List models = dataMap.get(lastTime); + if (models != null && !models.isEmpty()) { + buildLegends(models); + } + } + + @Override + protected void paintComponent(Graphics graphics) { + super.paintComponent(graphics); + // 设置画笔颜色 + graphics.setColor(JBColor.GRAY); + Graphics2D graph = null; + if (graphics instanceof Graphics2D) { + graph = (Graphics2D) graphics; + } + // 设置两个目标重叠时的混合类型和透明度 + graph.setComposite(AlphaComposite.getInstance(SRC_OVER, OPAQUE_VALUE)); + // 初始化坐标和比例尺等信息 + initPoint(); + // 绘制Y轴 + drawYAxis(graphics); + // 记录当前Y轴最大值 + int crtMaxY = this.maxUnitY; + // 绘制图表 + paintChart(graphics); + // 如果在画线过程中maxUnitY刷新,这时需要重绘一次,否则当前仍然以旧值绘制,会导致最大值超过面板大小 + if (crtMaxY != this.maxUnitY) { + repaint(); + return; + } + // 绘制框选区域 + paintSelectedArea(graphics); + // 还原透明度 + graph.setComposite(AlphaComposite.getInstance(SRC_OVER, OPAQUE_VALUE)); + // 绘制跟随鼠标的标尺 + drawMouseRuler(graphics); + // 绘制框选时的标尺 + drawSelectedRuler(graphics); + if (isEnterChart) { + // 展示Tooltip提示框 + showTooltip(false); + } + } + + /** + * 初始化坐标和比例尺等信息 + */ + protected void initPoint() { + // 计算Panel内绘图区的上下左右边距 + int left = this.getX(); + top = this.getY() + CHART_HEADER_HEIGHT; + // 整体稍微往下移动一点 + right = left + this.getWidth(); + int bottom = this.getHeight(); + // 确定绘制出的坐标轴的原点 + // 绘制出的坐标轴的X0点 + x0 = left; + // 绘制出的坐标轴的Y0点 + y0 = bottom; + // 计算出X轴1个单位占用多少像素 + pixelPerX = divide(right - left, maxDisplayX); + // 计算出Y轴1个单位占用多少像素 + pixelPerY = divide(top - y0, maxUnitY); + // 如果时间铺满了面板并继续往前走,绘制图形的时候应该需要从x0开始绘制,不需要像画坐标轴刻度那样存在偏移 + if (endTime < maxDisplayX) { + startXCoordinate = right - multiply(pixelPerX, endTime); + } else { + startXCoordinate = x0; + } + } + + /** + * 绘制Y轴 + * + * @param graphics Graphics + */ + protected void drawYAxis(Graphics graphics) { + // 前2个参数为线段起点左边,后2个参数为线段结束坐标,从上向下。 + graphics.drawLine(x0, this.getY(), x0, y0); + // 计算每段刻度的长度,同时也是循环绘制时的像素增量 + int interval = divideInt(maxUnitY, sectionNumY); + for (int i = interval; i <= maxUnitY; i += interval) { + int y = y0 + multiply(pixelPerY, i); + // 绘制Y轴刻度,其实就是绘制一条短横线 + graphics.drawLine(x0, y, x0 + SCALE_LINE_LEN, y); + // 绘制Y轴刻度值 + String str = i == maxUnitY ? divide(i, UNIT) + " " + axisLabelY : divide(i, UNIT) + ""; + graphics.drawString(str, x0 + Y_AXIS_STR_OFFSET_X, y + Y_AXIS_STR_OFFSET_Y); + } + } + + /** + * 绘制框选区域,这里实际是绘制了两块半透明的矩形,盖在Chart上,随着鼠标拖动改变矩形大小实现框选 + * + * @param graphics Graphics + */ + protected void paintSelectedArea(Graphics graphics) { + if (this.bottomPanel.getObserver().getStandard().getSelectedRange() == null) { + return; + } + ChartDataRange selectedRange = this.bottomPanel.getObserver().getStandard().getSelectedRange(); + int endTimeX = selectedRange.getEndTime(); + int startTimeX = selectedRange.getStartTime(); + int startX = multiply(pixelPerX, startTimeX - this.startTime) + startXCoordinate; + int endX = multiply(pixelPerX, endTimeX - this.startTime) + startXCoordinate; + int height = this.bottomPanel.getHeight(); + // 这里把画笔透明降低绘制遮盖的矩形 + ((Graphics2D) graphics).setComposite(AlphaComposite.getInstance(SRC_OVER, TRANSLUCENT_VALUE)); + graphics.setColor(ColorConstants.CHART_BG); + graphics.fillRect(0, 0, startX, height); + graphics.fillRect(endX, 0, endTime, height); + } + + /** + * 绘制跟随鼠标的标尺 + * + * @param graphics Graphics + */ + protected void drawMouseRuler(Graphics graphics) { + int mouseX; + Point mousePoint = getMousePosition(); + if (mousePoint == null) { + // 没有鼠标位置时,绘制标尺的X坐标为0,或鼠标当前进入的组件为空,则不需要绘制 + if (this.bottomPanel.getRulerXCoordinate() == 0 || this.bottomPanel.getCurrentEntered() == null) { + return; + } + mouseX = this.bottomPanel.getRulerXCoordinate(); + } else { + mouseX = (int) mousePoint.getX(); + this.bottomPanel.setRulerXCoordinate(mouseX); + } + Graphics2D g2d = null; + if (graphics instanceof Graphics2D) { + g2d = (Graphics2D) graphics; + } + // 保存原始线条特征 + BasicStroke defaultStroke = null; + + Stroke stroke = g2d.getStroke(); + if (stroke instanceof BasicStroke) { + defaultStroke = (BasicStroke) stroke; + } + float[] dash = {FLOAT_VALUE, 0f, FLOAT_VALUE}; + // 定义虚线条特征 + BasicStroke bs = new BasicStroke(1, CAP_BUTT, JOIN_ROUND, 1.0f, dash, FLOAT_VALUE); + g2d.setColor(ColorConstants.RULER); + g2d.setStroke(bs); + g2d.drawLine(mouseX, this.getY(), mouseX, this.getHeight()); + // 绘制完成后,要把默认格式还原,否则后面绘制的图形都是虚线 + g2d.setStroke(defaultStroke); + // 把当前组件标记为已绘制,刷新其他组件的标尺 + this.bottomPanel.compRulerDrawn(this); + this.bottomPanel.refreshCompRuler(); + } + + /** + * 绘制框选时的标尺 + * + * @param graphics Graphics + */ + protected void drawSelectedRuler(Graphics graphics) { + ChartDataRange selectedRange = this.bottomPanel.getObserver().getStandard().getSelectedRange(); + if (selectedRange != null) { + graphics.setColor(ColorConstants.RULER); + int startX = startXCoordinate + multiply(pixelPerX, selectedRange.getStartTime() - startTime); + graphics.drawLine(startX, this.getY(), startX, this.getHeight()); + int endX = startXCoordinate + multiply(pixelPerX, selectedRange.getEndTime() - startTime); + graphics.drawLine(endX, this.getY(), endX, this.getHeight()); + } + } + + /** + * 检查鼠标位置,判断是否需要显示Tooltip + * + * @param mouseEvent MouseEvent + */ + protected void checkMouseForTooltip(MouseEvent mouseEvent) { + // 如果鼠标X坐标小于Chart的X起始坐标,则不需要Tooltip + if (mouseEvent.getX() < startXCoordinate) { + isEnterChart = false; + LegendTooltip.getInstance().hideTip(); + } else { + // 鼠标移动,Tooltip位置需要刷新 + LegendTooltip.getInstance().followWithMouse(mouseEvent); + if (!isEnterChart) { + isEnterChart = true; + showTooltip(true); + } + } + } + + /** + * 显示悬浮提示框 + * + * @param isNewChart 是否为新Chart + */ + protected void showTooltip(boolean isNewChart) { + Point mousePoint = getMousePosition(); + // 如果鼠标X坐标小于Chart的X起始坐标,则不需要Tooltip + if (mousePoint == null || mousePoint.getX() < startXCoordinate) { + LegendTooltip.getInstance().hideTip(); + return; + } + if (dataMap == null || dataMap.size() == 0) { + LegendTooltip.getInstance().hideTip(); + return; + } + int[] timeArray = dataMap.keySet().stream().mapToInt(Integer::valueOf).toArray(); + if (timeArray.length == 0) { + return; + } + // 要展示的时间,也就是鼠标上对应的时间 = (鼠标X坐标 - 绘制Chart的X起始坐标) / X轴1个单位对应的像素数 + 起始时间 + int showKey = divide(mousePoint.getX() - startXCoordinate, pixelPerX) + startTime; + // 展示时间不一定就在dataMap的时间数组中,需要找到最接近的时间,然后通过这个时间拿到value + int actualKey = timeArray[ChartUtils.searchClosestIndex(timeArray, showKey)]; + buildTooltip(showKey, actualKey, isNewChart); + } + + /** + * 获取当前数据的颜色 + * + * @param index int + * @param models 数据集合 + * @return Color + */ + protected Color getCurrentLineColor(int index, List models) { + Color color = DEFAULT_CHART_COLOR; + if (models == null || models.size() == 0) { + LegendTooltip.getInstance().hideTip(); + return color; + } + for (ChartDataModel model : models) { + if (model.getIndex() == index && model.getColor() != null) { + color = model.getColor(); + } + } + return color; + } + + /** + * 获取当前Chart上的最后一个时间,因为Standard中的endTime,不一定有数据 + * + * @return int + */ + protected int getLastTime() { + // 获取endTime时刻的数值的集合 + int[] timeArray = dataMap.keySet().stream().mapToInt(Integer::valueOf).toArray(); + if (timeArray.length == 0) { + return INITIAL_VALUE; + } + + // 在时间的数组中,找到最接近的值 + ChartDataRange range = bottomPanel.getObserver().getStandard().getDisplayRange(); + return timeArray[ChartUtils.searchClosestIndex(timeArray, range.getEndTime())]; + } + + /** + * 初始化Y轴最大单位 + */ + public void initMaxUnitY() { + this.maxUnitY = CHART_MAX_Y; + } + + @Override + public void mouseClicked(MouseEvent mouseEvent) { + } + + @Override + public void mousePressed(MouseEvent mouseEvent) { + } + + @Override + public void mouseReleased(MouseEvent mouseEvent) { + } + + @Override + public void mouseEntered(MouseEvent mouseEvent) { + // 当前组件需要绘制标尺,鼠标进入,则更新底层父级panel的currentEntered + this.bottomPanel.setCurrentEntered(this); + // 如果鼠标X坐标小于Chart的X起始坐标,则不需要Tooltip + if (mouseEvent.getX() < startXCoordinate) { + isEnterChart = false; + LegendTooltip.getInstance().hideTip(); + } else { + isEnterChart = true; + // 鼠标移动,Tooltip位置需要刷新 + LegendTooltip.getInstance().followWithMouse(mouseEvent); + showTooltip(true); + } + } + + @Override + public void mouseExited(MouseEvent mouseEvent) { + // 当前组件需要绘制标尺,鼠标退出,则更新底层父级panel的currentEntered为null + this.bottomPanel.setCurrentEntered(null); + // 这里需要重绘一下当前界面,否则会残留有之前的ruler + this.bottomPanel.resetRulerDrawStatus(); + this.bottomPanel.refreshCompRuler(); + isEnterChart = false; + LegendTooltip.getInstance().hideTip(); + } + + @Override + public void mouseDragged(MouseEvent mouseEvent) { + } + + @Override + public void mouseMoved(MouseEvent mouseEvent) { + // 这为了防止鼠标从Row底部移上来时,仍然是双箭头resize状态引起用户误解,这里把鼠标置为默认状态 + this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + // 鼠标移动,则所有组件的标尺需要重新绘制 + this.bottomPanel.resetRulerDrawStatus(); + checkMouseForTooltip(mouseEvent); + this.repaint(); + } + + public ChartType getChartType() { + return chartType; + } + + public void setMaxDisplayX(int maxDisplayX) { + this.maxDisplayX = maxDisplayX; + } + + public void setMinMarkIntervalX(int minMarkIntervalX) { + this.minMarkIntervalX = minMarkIntervalX; + } + + public void setAxisLabelX(String axisLabelX) { + this.axisLabelX = axisLabelX; + } + + public void setAxisLabelY(String axisLabelY) { + this.axisLabelY = axisLabelY; + } + + public void setSectionNumY(int sectionNumY) { + this.sectionNumY = sectionNumY; + } + + public int getStartTime() { + return startTime; + } + + public void setStartTime(int startTime) { + this.startTime = startTime; + } + + public int getEndTime() { + return endTime; + } + + public void setEndTime(int endTime) { + this.endTime = endTime; + } + + public ProfilerChartsView getBottomPanel() { + return bottomPanel; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartDataModel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartDataModel.java new file mode 100644 index 000000000..d40ab1dde --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartDataModel.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.model; + +import java.awt.Color; + +/** + * Chart数据的模型 + * + * @since 2021/3/2 11:26 + */ +public class ChartDataModel { + private int index; + + private String name; + + private Color color; + + private int value; + + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Color getColor() { + return color; + } + + public void setColor(Color color) { + this.color = color; + } + + public int getValue() { + return value; + } + + public void setValue(int value) { + this.value = value; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartDataRange.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartDataRange.java new file mode 100644 index 000000000..e68143463 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartDataRange.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.model; + +/** + * Timeline和Chart数据的时间范围 + * + * @since 2021/1/29 9:26 + */ +public class ChartDataRange { + /** + * 起始时间 + */ + private int startTime = Integer.MIN_VALUE; + + /** + * 结束时间 + */ + private int endTime = Integer.MAX_VALUE; + + public int getStartTime() { + return startTime; + } + + public void setStartTime(int startTime) { + this.startTime = startTime; + } + + public int getEndTime() { + return endTime; + } + + public void setEndTime(int endTime) { + this.endTime = endTime; + } + + @Override + public String toString() { + return "ChartDataRange{" + "startTime=" + startTime + ", endTime=" + endTime + '}'; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartLegendColorRect.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartLegendColorRect.java new file mode 100644 index 000000000..4e04e96ca --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartLegendColorRect.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.model; + +import javax.swing.JComponent; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; + +/** + * legend Color Block In Chart + * + * @since 2021/3/1 9:48 + */ +public class ChartLegendColorRect extends JComponent { + /** + * legend Color Block Size + */ + private static final int SIZE = 10; + + /** + * color + */ + private Color color; + + /** + * Chart Legend Color Rect + */ + public ChartLegendColorRect() { + fillColor(); + } + + /** + * fillColor + */ + private void fillColor() { + this.setPreferredSize(new Dimension(SIZE, SIZE)); + super.repaint(); + super.validate(); + } + + /** + * paintComponent + * + * @param graphics graphics + */ + @Override + protected void paintComponent(Graphics graphics) { + super.paintComponent(graphics); + if (color == null) { + color = Color.GRAY; + } + graphics.setColor(color); + graphics.fillRect(0, 0, SIZE, SIZE); + } + + public void setColor(Color color) { + this.color = color; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartStandard.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartStandard.java new file mode 100644 index 000000000..b6808c621 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartStandard.java @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.model; + +import static ohos.devtools.views.common.ViewConstants.DEFAULT_MAX_MILLIS; +import static ohos.devtools.views.common.ViewConstants.DEFAULT_TIME_UNIT; + +/** + * Chart绘制标准,用于统一Timeline和Chart + * + * @since 2021/1/26 15:10 + */ +public class ChartStandard { + /** + * sizeTime + */ + public static int sizeTime; + + /** + * sessionId + */ + private final long sessionId; + + /** + * 窗体上可以展示的最大毫秒数,单位为毫秒 + */ + private int maxDisplayMillis; + + /** + * Timeline和Chart刻度线上的最小刻度间隔,单位为毫秒 + */ + private int minMarkInterval; + + /** + * 本次Chart首次创建并启动刷新时的时间戳 + */ + private long firstTimestamp; + + /** + * 本次Chart最后一个数据的时间戳 + */ + private long lastTimestamp; + + /** + * Chart展示的时间范围 + */ + private ChartDataRange displayRange; + + /** + * 用户框选的时间范围 + */ + private ChartDataRange selectedRange; + + /** + * 构造函数 + * + * @param sessionId sessionId + */ + public ChartStandard(long sessionId) { + this.sessionId = sessionId; + maxDisplayMillis = DEFAULT_MAX_MILLIS; + minMarkInterval = DEFAULT_TIME_UNIT; + } + + /** + * 修改Chart展示的时间刻度间隔长度 + * + * @param sizeTimed 时间刻度间隔 + */ + public void updateSizeTime(int sizeTimed) { + sizeTime = sizeTimed; + } + + /** + * 修改Chart展示的时间范围 + * + * @param start 开始时间 + * @param end 结束时间 + */ + public void updateDisplayTimeRange(int start, int end) { + if (displayRange == null) { + displayRange = new ChartDataRange(); + } + displayRange.setStartTime(start); + displayRange.setEndTime(end); + } + + /** + * 更新用户框选的起始时间和坐标点 + * + * @param startTime 用户新框选的时间范围 + */ + public void updateSelectedStart(int startTime) { + if (selectedRange == null) { + selectedRange = new ChartDataRange(); + } + selectedRange.setStartTime(startTime); + } + + /** + * 更新用户框选的起始时间和坐标点 + * + * @param endTime 用户新框选的时间范围 + */ + public void updateSelectedEnd(int endTime) { + if (selectedRange == null) { + selectedRange = new ChartDataRange(); + } + selectedRange.setEndTime(endTime); + } + + /** + * 清空框选的时间范围 + */ + public void clearSelectedRange() { + selectedRange = null; + } + + public long getSessionId() { + return sessionId; + } + + public int getMaxDisplayMillis() { + return maxDisplayMillis; + } + + public void setMaxDisplayMillis(int maxDisplayMillis) { + this.maxDisplayMillis = maxDisplayMillis; + } + + public int getMinMarkInterval() { + return minMarkInterval; + } + + public void setMinMarkInterval(int minMarkInterval) { + this.minMarkInterval = minMarkInterval; + } + + public long getFirstTimestamp() { + return firstTimestamp; + } + + public void setFirstTimestamp(long firstTimestamp) { + this.firstTimestamp = firstTimestamp; + } + + public long getLastTimestamp() { + return lastTimestamp; + } + + public void setLastTimestamp(long lastTimestamp) { + this.lastTimestamp = lastTimestamp; + } + + public ChartDataRange getDisplayRange() { + return displayRange; + } + + public ChartDataRange getSelectedRange() { + return selectedRange; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartType.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartType.java new file mode 100644 index 000000000..5ed9752d3 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/model/ChartType.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.model; + +/** + * Chart类型的枚举类 + * + * @since 2021/2/1 9:31 + */ +public enum ChartType { + /** + * 已填充的折线图 + */ + FILLED_LINE, + + /** + * 折线图 + */ + LINE, + + /** + * 柱状图/条形图 + */ + BAR, + + /** + * 未知类型 + */ + UNRECOGNIZED +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/tooltip/LegendTooltip.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/tooltip/LegendTooltip.java new file mode 100644 index 000000000..2fb766623 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/tooltip/LegendTooltip.java @@ -0,0 +1,282 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.tooltip; + +import com.intellij.ui.components.JBLabel; + +import ohos.devtools.views.charts.utils.ChartUtils; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.JComponent; +import javax.swing.JLayeredPane; +import javax.swing.JPanel; +import javax.swing.JRootPane; +import javax.swing.SwingUtilities; +import javax.swing.border.LineBorder; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.awt.Point; +import java.awt.event.MouseEvent; +import java.util.List; +import java.util.regex.Pattern; + +import static ohos.devtools.views.common.ColorConstants.TOOLTIP; +import static ohos.devtools.views.common.ViewConstants.NUM_2; + +/** + * @Description 自定义可以跟随鼠标移动Tooltip作为图例 + * @Date 2021/1/19 21:35 + **/ +public final class LegendTooltip extends JComponent { + private static final Logger LOGGER = LogManager.getLogger(LegendTooltip.class); + + /** + * 常量1,距离鼠标常量,防止鼠标遮挡 + */ + private static final Point CONST_POINT = new Point(12, 5); + + /** + * 常量2,防止离鼠标太近,触发mouse exit事件 + */ + private static final Point CONST_POINT2 = new Point(30, 75); + + /** + * Grid布局的默认行数 + */ + private static final int DEFAULT_ROWS = 2; + + /** + * Grid布局的行高 + */ + private static final int ROW_HEIGHT = 36; + + /** + * Tooltip默认宽度 + */ + private static final int DEFAULT_WIDTH = 170; + + /** + * 单例 + */ + private static volatile LegendTooltip singleton; + + /** + * 当前Tooltip的主面板 + */ + private JPanel mainPanel; + + /** + * 当前Tooltip的父组件的根面板 + */ + private JRootPane parentRootPane; + + /** + * 窗口的遮罩层,不能随便修改,只作父对象应用 + */ + private JLayeredPane mask; + + /** + * 当前Tooltip中Grid布局的行数 + */ + private int rows = DEFAULT_ROWS; + + /** + * 单例,外部不允许初始化 + */ + private LegendTooltip() { + super(); + initTip(); + } + + /** + * 获取单例 + * + * @return 单例 + */ + public static LegendTooltip getInstance() { + if (singleton == null) { + synchronized (LegendTooltip.class) { + if (singleton == null) { + singleton = new LegendTooltip(); + } + } + } + return singleton; + } + + /** + * 初始化Tooltip + */ + private void initTip() { + this.setLayout(new FlowLayout()); + // false为控件透明,true为不透明 + this.setOpaque(false); + this.setVisible(false); + mainPanel = new JPanel(new GridLayout(rows, 1)); + mainPanel.setBackground(TOOLTIP); + } + + /** + * 隐藏组件 + */ + public void hideTip() { + this.setVisible(false); + } + + /** + * 为某个组件设置tip + * + * @param parent 显示tooltip的对象 + * @param timeline 显示的时间Tip + * @param totalValue Total值 + * @param tooltipItems 要显示的图例 + * @param isCharting boolean + */ + public void showTip(JComponent parent, String timeline, String totalValue, List tooltipItems, + boolean isCharting) { + if (parent != null && parent.getRootPane() != null) { + this.rows = tooltipItems.size() + NUM_2; + // 重新组建Tooltip + if (isCharting) { + rebuild(parent); + resize(); + return; + } + + // 动态添加和绘制图例 + addLegends(timeline, totalValue, tooltipItems); + this.validate(); + this.setVisible(true); + } + } + + /** + * 重新组建Tooltip + * + * @param parent 显示tooltip的对象 + */ + private void rebuild(JComponent parent) { + parentRootPane = parent.getRootPane(); + JLayeredPane layerPane = parentRootPane.getLayeredPane(); + + // 先从旧面板中移除tip + if (mask != null && mask != layerPane) { + mask.remove(this); + } + mask = layerPane; + + // 防止还有没有移除监听的组件 + layerPane.remove(this); + + // 由于每次要重绘mainPanel,所以也要先移除mainPanel + this.remove(mainPanel); + + // 放置tip在遮罩窗口顶层 + layerPane.add(this, JLayeredPane.POPUP_LAYER); + // 窗口遮罩层添加监听 + + // 根据传入的TooltipItem集合大小,重新创建mainPanel + mainPanel = new JPanel(new GridLayout(rows, 1)); + mainPanel.setBorder(new LineBorder(Color.BLACK)); + mainPanel.setBackground(TOOLTIP); + this.add(mainPanel); + } + + /** + * Tooltip中添加图例 + * + * @param timeline 时间 + * @param totalValue Total值 + * @param tooltipItems 图例集合 + */ + private void addLegends(String timeline, String totalValue, List tooltipItems) { + mainPanel.removeAll(); + // 添加时间 + JBLabel timeLabel = new JBLabel(); + long ms = 0; + String pattern = "^\\d{0,20}$"; + boolean isMatch = Pattern.matches(pattern, timeline); + if (isMatch) { + ms = Long.parseLong(timeline); + } else { + LOGGER.error("Time format error:{}", timeline); + } + timeLabel.setText(ChartUtils.formatTime(ms)); + timeLabel.setOpaque(false); + mainPanel.add(timeLabel); + + // 添加悬浮框的total值 + JBLabel totalLabel = new JBLabel(); + totalLabel.setOpaque(false); + totalLabel.setText("Total:" + totalValue + "MB"); + mainPanel.add(totalLabel); + + // 添加图例 + for (TooltipItem tooltipItem : tooltipItems) { + JPanel single = new JPanel(new FlowLayout(FlowLayout.LEFT)); + single.setOpaque(false); + + Color color = tooltipItem.getColor(); + if (color != null) { + single.add(new TooltipColorRect(tooltipItem.getColor())); + } + JBLabel nameLabel = new JBLabel(); + nameLabel.setOpaque(false); + nameLabel.setText(tooltipItem.getText()); + single.add(nameLabel); + mainPanel.add(single); + } + } + + /** + * 坐标转换,标签跟随鼠标移动 + * + * @param mouseEvent MouseEvent + */ + public void followWithMouse(MouseEvent mouseEvent) { + if (mask == null) { + return; + } + + this.setVisible(true); + Point screenPoint = mouseEvent.getLocationOnScreen(); + SwingUtilities.convertPointFromScreen(screenPoint, mask); + + int newLocationX = (int) (screenPoint.getX() + CONST_POINT.getX()); + int newLocationY = (int) (screenPoint.getY() + CONST_POINT.getY()); + + Dimension tipSize = mainPanel.getPreferredSize(); + if (newLocationX + tipSize.width > parentRootPane.getWidth()) { + newLocationX = (int) (screenPoint.getX() - tipSize.width - CONST_POINT2.getX()); + } + if (newLocationY + tipSize.height > parentRootPane.getHeight()) { + newLocationY = (int) (screenPoint.getY() - tipSize.height - CONST_POINT2.getY()); + } + + this.setLocation(newLocationX, newLocationY); + } + + /** + * 重新调整大小 + */ + private void resize() { + this.setSize(DEFAULT_WIDTH, this.rows * ROW_HEIGHT); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/tooltip/TooltipColorRect.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/tooltip/TooltipColorRect.java new file mode 100644 index 000000000..050a6a4fd --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/tooltip/TooltipColorRect.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.tooltip; + +import javax.swing.JComponent; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; + +/** + * Tooltip中的图例色块 + * + * @since 2021/1/19 21:35 + */ +public class TooltipColorRect extends JComponent { + /** + * 图例色块大小 + */ + private static final int SIZE = 15; + + /** + * 颜色 + */ + private final Color color; + + /** + * 构造函数 + * + * @param color 图例色块的颜色 + */ + public TooltipColorRect(Color color) { + this.color = color; + this.setOpaque(false); + fillColor(); + } + + /** + * 填充颜色 + */ + private void fillColor() { + this.setPreferredSize(new Dimension(SIZE, SIZE)); + super.repaint(); + super.validate(); + } + + /** + * paintComponent + * + * @param graphics graphics + */ + @Override + protected void paintComponent(Graphics graphics) { + super.paintComponent(graphics); + graphics.setColor(color); + graphics.fillRect(0, 0, SIZE, SIZE); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/tooltip/TooltipItem.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/tooltip/TooltipItem.java new file mode 100644 index 000000000..bc0f5aa6c --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/tooltip/TooltipItem.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.tooltip; + +import java.awt.Color; + +/** + * Tooltip中的要显示的图例 + * + * @since 2021/1/19 21:35 + */ +public class TooltipItem { + /** + * Tooltip中图例色块的颜色 + */ + private Color color; + + /** + * 文本 + */ + private final String text; + + /** + * 构造函数 + * + * @param color Tooltip中图例色块的颜色 + * @param text tips文本 + */ + public TooltipItem(Color color, String text) { + this.color = color; + this.text = text; + } + + /** + * Getter + * + * @return Color + */ + public Color getColor() { + return color; + } + + /** + * Getter + * + * @return String + */ + public String getText() { + return text; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/utils/ChartConstants.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/utils/ChartConstants.java new file mode 100644 index 000000000..8a9afde2b --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/utils/ChartConstants.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.utils; + +import java.awt.Color; + +/** + * Chart相关的常量类 + * + * @since 2021/1/21 11:33 + */ +public final class ChartConstants { + /** + * 初始值 + */ + public static final int INITIAL_VALUE = -1; + + /** + * 默认半透明度的值 + */ + public static final float TRANSLUCENT_VALUE = 0.8F; + + /** + * 不透明时的值 + */ + public static final float OPAQUE_VALUE = 1.0F; + + /** + * Chart绘制区域离顶部的偏移量(页眉高度) + */ + public static final int CHART_HEADER_HEIGHT = 20; + + /** + * 默认刻度线长度 + */ + public static final int SCALE_LINE_LEN = 4; + + /** + * 绘制Y轴刻度值时,str在X轴上的偏移量 + */ + public static final int Y_AXIS_STR_OFFSET_X = 15; + + /** + * 绘制Y轴刻度值时,str在Y轴上的偏移量 + */ + public static final int Y_AXIS_STR_OFFSET_Y = 5; + + /** + * KB,MB转换时的单位 + */ + public static final int UNIT = 1024; + + /** + * 默认Chart绘制颜色 + */ + public static final Color DEFAULT_CHART_COLOR = Color.GRAY; + + /** + * 折线图线条默认宽度 + */ + public static final int DEFAULT_LINE_WIDTH = 3; + + /** + * 数字 + */ + public static final int NUM_2 = 2; + + /** + * 数字 + */ + public static final int NUM_3 = 3; + + /** + * 数字 + */ + public static final int NUM_24 = 24; + + /** + * 数字 + */ + public static final int NUM_60 = 60; + + /** + * 数字 + */ + public static final int NUM_1000 = 1000; + + /** + * 数字 + */ + public static final int NUM_1024 = 1024; + + /** + * 计算时默认保留的小数位数 + */ + public static final int DECIMAL_COUNTS = 5; + + /** + * 构造函数 + */ + private ChartConstants() { + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/utils/ChartUtils.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/utils/ChartUtils.java new file mode 100644 index 000000000..772369b7a --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/charts/utils/ChartUtils.java @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.utils; + +import java.math.BigDecimal; + +import static java.math.BigDecimal.ROUND_HALF_UP; +import static ohos.devtools.views.charts.utils.ChartConstants.NUM_1000; +import static ohos.devtools.views.charts.utils.ChartConstants.NUM_60; +import static ohos.devtools.views.charts.utils.ChartConstants.NUM_24; +import static ohos.devtools.views.charts.utils.ChartConstants.DECIMAL_COUNTS; +import static ohos.devtools.views.common.ViewConstants.INITIAL_VALUE; + +/** + * Chart相关的工具类 + * + * @since 2021/3/3 10:41 + */ +public final class ChartUtils { + /** + * 二分法计算时除以2的常量 + */ + private static final int HALF_VALUE = 2; + + /** + * init number + */ + private static final long INIT_NUMBER = -1L; + + /** + * 构造函数 + */ + private ChartUtils() { + } + + /** + * 在有序数组中找到与目标值最接近的值的index + * + * @param arr 有序数组 + * @param value 目标值 + * @return 数组中与目标值最接近的值的index + */ + public static int searchClosestIndex(int[] arr, int value) { + // 开始位置 + int low = 0; + // 结束位置 + int high = arr.length - 1; + // 先判断下是不是大于最大值或者小于最小值,是的话直接返回 + if (value <= arr[low]) { + return low; + } + if (value >= arr[high]) { + return high; + } + int index = INITIAL_VALUE; + while (low <= high) { + int middle = (low + high) / HALF_VALUE; + + // 如果值正好相等,则直接返回查询到的索引 + if (value == arr[middle]) { + index = middle; + break; + } + // 如果已经是最后一个数据,则返回其索引 + if (middle == arr.length - 1) { + index = middle; + break; + } + // 大于当前index的值,小于下一个index的值,表明落在该区间内,取最接近的索引 + if (value > arr[middle] && value < arr[middle + 1]) { + int dif1 = value - arr[middle]; + int dif2 = arr[middle + 1] - value; + // 返回查询到的索引 + index = dif1 < dif2 ? middle : middle + 1; + break; + } + if (value > arr[middle]) { + low = middle + 1; + } + if (value < arr[middle]) { + high = middle - 1; + } + } + return index; + } + + /** + * 乘法运算 + * + * @param num1 数字1 + * @param num2 数字2 + * @return int结果 + */ + public static int multiply(BigDecimal num1, int num2) { + return num1.multiply(new BigDecimal(num2)).intValue(); + } + + /** + * 除法运算,返回BigDecimal + * + * @param num1 数字1 + * @param num2 数字2 + * @return BigDecimal结果 + */ + public static BigDecimal divide(double num1, double num2) { + return new BigDecimal(num1).divide(new BigDecimal(num2), DECIMAL_COUNTS, ROUND_HALF_UP); + } + + /** + * 除法运算,返回BigDecimal + * + * @param num1 数字1 + * @param num2 数字2 + * @return BigDecimal结果 + */ + public static BigDecimal divide(BigDecimal num1, BigDecimal num2) { + return num1.divide(num2, DECIMAL_COUNTS, ROUND_HALF_UP); + } + + /** + * 除法运算,返回int + * + * @param num1 数字1 + * @param num2 数字2 + * @return int结果 + */ + public static int divideInt(double num1, double num2) { + return new BigDecimal(num1).divide(new BigDecimal(num2), DECIMAL_COUNTS, ROUND_HALF_UP).intValue(); + } + + /** + * 除法运算,返回int + * + * @param num1 数字1 + * @param num2 数字2 + * @return int结果 + */ + public static int divide(double num1, BigDecimal num2) { + return new BigDecimal(num1).divide(num2, DECIMAL_COUNTS, ROUND_HALF_UP).intValue(); + } + + /** + * 将毫秒转换为分:秒:毫秒的格式 + * + * @param ms 处理的毫秒数 + * @return java.lang.String 转换为 分:秒:毫秒的格式 + * @date 2021/3/17 15:24 + */ + public static String formatTime(Long ms) { + int ss = NUM_1000; + int mi = ss * NUM_60; + int hh = mi * NUM_60; + int dd = hh * NUM_24; + + long day = INIT_NUMBER; + if (dd != 0) { + day = ms / dd; + } + long hour = INIT_NUMBER; + if (hh != 0) { + hour = (ms - day * dd) / hh; + } + long minute = INIT_NUMBER; + if (mi != 0) { + minute = (ms - day * dd - hour * hh) / mi; + } + long second = INIT_NUMBER; + if (ss != 0) { + second = (ms - day * dd - hour * hh - minute * mi) / ss; + } + long milliSecond = ms - day * dd - hour * hh - minute * mi - second * ss; + + StringBuilder sb = new StringBuilder(); + if (day > 0) { + sb.append(day).append(":"); + } + if (hour > 0) { + sb.append(hour).append(":"); + } + if (minute > 0) { + sb.append(minute).append(":"); + } else { + sb.append("00:"); + } + if (second > 0) { + sb.append(second).append(":"); + } else { + sb.append("00:"); + } + if (milliSecond > 0) { + sb.append(milliSecond).append(" "); + } else { + sb.append("00:"); + } + return sb.toString(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/ColorConstants.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/ColorConstants.java new file mode 100644 index 000000000..459e7bdde --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/ColorConstants.java @@ -0,0 +1,291 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common; + +import java.awt.Color; + +/** + * 颜色常量类 + * + * @since 2021/2/27 14:26 + */ +public final class ColorConstants { + /** + * color RGB 12 14 18 + */ + public static final Color BLACK_COLOR = new Color(13, 14, 19); + + /** + * color RGB 37 37 45 + */ + public static final Color BLACK_COLOR_JBUTTON = new Color(37, 37, 45); + + /** + * 文本组件的背景色 + */ + public static final Color BG_GRAY = new Color(0xEEEEEE); + + /** + * The color white. In the default sRGB space. + */ + public static final Color WHITE = new Color(255, 255, 255); + + /** + * The color lightGray. In the default sRGB space. + */ + public static final Color LIGHTGRAY = new Color(192, 192, 192); + + /** + * The color gray. In the default sRGB space. + */ + public static final Color GRAY = new Color(128, 128, 128); + + /** + * The color dark gray. In the default sRGB space. + */ + public static final Color DARKGRAY = new Color(64, 64, 64); + + /** + * The color black. In the default sRGB space. + */ + public static final Color BLACK = new Color(0, 0, 0); + + /** + * The color red. In the default sRGB space. + */ + public static final Color RED = new Color(255, 0, 0); + + /** + * The color pink. In the default sRGB space. + */ + public static final Color PINK = new Color(255, 175, 175); + + /** + * The color orange. In the default sRGB space. + */ + public static final Color ORANGE = new Color(255, 200, 0); + + /** + * The color yellow. In the default sRGB space. + */ + public static final Color YELLOW = new Color(255, 255, 0); + + /** + * The color green. In the default sRGB space. + */ + public static final Color GREEN = new Color(0, 255, 0); + + /** + * The color magenta. In the default sRGB space. + */ + public static final Color MAGENTA = new Color(255, 0, 255); + + /** + * The color cyan. In the default sRGB space. + */ + public static final Color CYAN = new Color(0, 255, 255); + + /** + * The color blue. In the default sRGB space. + */ + public static final Color BLUE = new Color(0, 0, 255); + + /** + * CHOOSE_BUTTON的颜色 + */ + public static final Color CHOOSE_BUTTON = new Color(91, 190, 212); + + /** + * DEVICE_PROCESS_PANEL颜色 + */ + public static final Color DEVICE_PROCESS_PANEL = new Color(40, 40, 48); + + /** + * SCROLL_PANE颜色 + */ + public static final Color SCROLL_PANE = new Color(13, 14, 19); + + /** + * HOME_PANE颜色 + */ + public static final Color HOME_PANE = new Color(48, 50, 52); + + /** + * SCENE_BUT颜色 + */ + public static final Color SCENE_BUT = new Color(37, 37, 45); + + /** + * SELECT_PANEL颜色 + */ + public static final Color SELECT_PANEL = new Color(69, 73, 74); + + /** + * ADD_DEVICE_BUN的颜色 + */ + public static final Color ADD_DEVICE_BUN = new Color(91, 190, 212); + + /** + * TOP_PANEL的颜色 + */ + public static final Color TOP_PANEL = new Color(13, 14, 19); + + /** + * TOP_PANEL_APPLICATION的颜色 + */ + public static final Color TOP_PANEL_APPLICATION = new Color(177, 177, 177); + + /** + * Chart背景色 + */ + public static final Color CHART_BG = new Color(0x0D0E13); + + /** + * 竖线标尺颜色 + */ + public static final Color RULER = new Color(0x757784); + + /** + * 时间线刻度颜色 + */ + public static final Color TIMELINE_SCALE = new Color(0x35353E); + + /** + * 时间线背景色 + */ + public static final Color TIMELINE_BG = new Color(0X18181D); + + /** + * Tooltip背景色 + */ + public static final Color TOOLTIP = new Color(0X18181D); + + /** + * 时间线背景色 + */ + public static final Color SCROLLBAR = new Color(0x66FFFFFF, true); + + /** + * Chart上方的指标项标题背景色 + */ + public static final Color ITEM_PANEL = new Color(0X18181D); + + /** + * 一级界面内存指标项颜色 + */ + public static final Color MEMORY = new Color(0x805BBED4, true); + + /** + * 内存:Java颜色 + */ + public static final Color MEM_JAVA = new Color(0x805BBED4, true); + + /** + * 内存:Native颜色 + */ + public static final Color MEM_NATIVE = new Color(0x80C3FFCA, true); + + /** + * 内存:Graphics颜色 + */ + public static final Color MEM_GRAPHICS = new Color(0x80FFA9A9, true); + + /** + * 内存:Stack颜色 + */ + public static final Color MEM_STACK = new Color(0x809E6EDA, true); + + /** + * 内存:Code颜色 + */ + public static final Color MEM_CODE = new Color(0x80FF9167, true); + + /** + * 内存:OTHERS颜色 + */ + public static final Color MEM_OTHERS = new Color(0x8050B4F3, true); + + /** + * 内存:OTHERS颜色 + */ + public static final Color NETWORK_RCV = new Color(0x80557EBE, true); + + /** + * 内存:OTHERS颜色 + */ + public static final Color NETWORK_SENT = new Color(0x80FEC08C, true); + + /** + * 内存:OTHERS颜色 + */ + public static final Color NETWORK_CONN = new Color(0x807D6B65, true); + + /** + * SYSTEM_TUNNING_SETTING_BACK颜色 + */ + public static final Color SYSTEM_TUNNING_SETTING_BACK = new Color(12, 14, 18); + + /** + * SYSTEM_TUNNING_SETTING_CENTER颜色 + */ + public static final Color SYSTEM_TUNNING_SETTING_CENTER = new Color(60, 63, 65); + + /** + * SYSTEM_TUNNING_WEST_LABEL颜色 + */ + public static final Color SYSTEM_TUNNING_WEST_LABEL = new Color(41, 41, 42); + + /** + * 构造函数 + */ + private ColorConstants() { + } + + /** + * 首页背景 + */ + public static final Color TOP_COLOR = new Color(41, 41, 48); + + /** + * 首页背景 + */ + public static final Color CENTER_COLOR = new Color(13, 14, 19); + + /** + * BORDER背景 + */ + public static final Color BORDER_COLOR = new Color(117, 119, 132); + + /** + * APPLYTUN_COLOR背景 + */ + public static final Color APPLYTUN_COLOR = new Color(53, 53, 62); + + /** + * SYSTEM_COLOR背景 + */ + public static final Color SYSTEM_COLOR = new Color(38, 38, 45); + + /** + * trace table COlOR + */ + public static final Color TRACE_TABLE_COLOR = new Color(20, 21, 25); + + /** + * table selected background + */ + public static final Color SELECTED_TABLE_COLOR = new Color(67, 67, 79); +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/Common.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/Common.java new file mode 100644 index 000000000..a7f836d17 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/Common.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common; + +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTabbedPane; +import java.awt.Component; + +/** + * 公共方法类 + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class Common { + public Common() { + } + + /** + * updateNum + * + * @param jTabbedPane jTabbedPane + */ + public void updateNum(JTabbedPane jTabbedPane) { + // 更新所有的run -- of -- + for (int index = 0; index < jTabbedPane.getTabCount(); index++) { + Component component = jTabbedPane.getComponentAt(index); + JPanel jScrollPanelCom = (JPanel) component; + JPanel jScrollPanelComChart = null; + Object componentsObj = jScrollPanelCom.getComponents()[0]; + if (componentsObj instanceof JPanel) { + jScrollPanelComChart = (JPanel) componentsObj; + // 定位到chart监测页面 + if (jScrollPanelComChart.getComponentCount() == LayoutConstants.DEVICES_Y) { + JPanel componentComAll = null; + Object compObj = jScrollPanelComChart.getComponents()[0]; + if (compObj instanceof JPanel) { + componentComAll = (JPanel) compObj; + if (componentComAll.getComponents()[0] instanceof JLabel) { + continue; + } else { + JPanel componentComAllJpanelJlabel = (JPanel) componentComAll.getComponents()[0]; + for (Component componentAll : componentComAllJpanelJlabel.getComponents()) { + if (componentAll instanceof JLabel) { + JLabel jcb = (JLabel) componentAll; + jcb.setText("Run " + (index + 1) + " of " + jTabbedPane.getTabCount()); + } + } + } + } + } + } + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/Constant.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/Constant.java new file mode 100644 index 000000000..94ee723b0 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/Constant.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common; + +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; + +import javax.swing.JTabbedPane; +import java.util.HashMap; +import java.util.Map; + +/** + * @Description Constants + * @version 1.0 + * @date 2021/3/4 10:55 + **/ +public class Constant { + /** + * Default polling frequency. + */ + public static final String POLLING_FREQUEBCY_DEFAULT = "0/1 * * * * ?"; + + /** + * The source file path pushed by the plugin + */ + public static final String SOURCE_FILEPATH = "src/main/resources/"; + + /** + * Cpu plugin file name + */ + public static final String CPU_PLUG_NAME = "Cpu"; + + /** + * Gpu plugin file name + */ + public static final String GPU_PLUG_NAME = "Gpu"; + + /** + * Memory plugin file name + */ + public static final String MEMORY_PLUG_NAME = "Memory"; + + /** + * Process plugin file name + */ + public static final String PROCESS_PLUG_NAME = "Process"; + + /** + * The target file path of the plug-in push + */ + public static final String TARGET_PLUG_PATH = "/data/local/tmp/hiprofiler/bin/"; + + /** + * File suffix pushed by the plugin + */ + public static final String FILE_SUFFIX = ".so"; + + /** + * The default value of SAMPLE INTERVAL + */ + public static final int SAMPLE_INTERVAL_DEFAULT = 1000; + + /** + * STATUS + */ + public static final int NORMAL_STATUS = 0; + + /** + * Real-time scene + */ + public static final int REALTIME_SCENE = 1; + + /** + * File import scene + */ + public static final int FILE_IMPORT_SCENE = 2; + + /** + * MB + */ + public static final int MB = 1024; + + /** + * Abnormal state + */ + public static final Long ABNORMAL = -1L; + + /** + * Common tab + */ + public static JTabbedPane jtasksTab = null; + + /** + * Real-time refresh task name in the device selection box + */ + public static final String DEVICEREFRESH = "deviceRefresh"; + + /** + * Maps stored in all process devices + */ + public static Map> map = new HashMap<>(); + + /** + * File suffix pushed by the plugin + */ + public static final String TRACE_SUFFIX = ".trace"; + + /** + * trace file path + */ + public static String path = ""; + + /** + * trace文件保存路径 + */ + public static String tracePath = ""; +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/LayoutConstants.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/LayoutConstants.java new file mode 100644 index 000000000..5e084deba --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/LayoutConstants.java @@ -0,0 +1,1933 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common; + +/** + * 主界面相关的常量值 + * + * @version 1.0 + * @date 2021/03/02 16:33 + **/ +public final class LayoutConstants { + /** + * 构造函数 + */ + private LayoutConstants() { + } + + /** + * Chart延迟启动的时长,单位为毫秒 + */ + public static final int CHART_START_DELAY = 2000; + + /** + * Chart loading图的大小 + */ + public static final int LOADING_SIZE = 60; + + /** + * 界面布局宽度 + */ + public static final int WINDOW_WIDTH = 1200; + + /** + * 界面布局高度 + */ + public static final int WINDOW_HEIGHT = 800; + + /** + * 字体大小 + */ + public static final int FONT_SIZE = 14; + + /** + * 二级欢迎界面按钮宽度 + */ + public static final int BUTTON_WIDTH = 125; + + /** + * 进程框大小 + */ + public static final int PRECCE_WIDTH = 560; + + /** + * 二级欢迎界面按钮高度 + */ + public static final int BUTTON_HEIGHT = 25; + + /** + * 多配置界面选项卡窗体宽度 + */ + public static final int OPT_WIDTH = 1200; + + /** + * 多配置界面选项卡窗体高度 + */ + public static final int OPT_HEIGHT = 800; + + /** + * 多配置界面选项卡标签宽度 + */ + public static final int JPA_LABEL_WIDTH = 135; + + /** + * 多配置界面选项卡标签高度 + */ + public static final int JP_LABEL_HEIGHT = 20; + + /** + * 多配置界面选项卡标签左侧宽 + */ + public static final int JP_LEFT_WIDTH = 118; + + /** + * 多配置界面选项卡标签左侧宽 + */ + public static final int JP_LEFT_HEIGHT = 20; + + /** + * 多配置界面选项卡标签右侧宽 + */ + public static final int JP_RIGHT_WIDTH = 10; + + /** + * 多配置界面选项卡标签右侧宽 + */ + public static final int JP_RIGHT_HEIGHT = 20; + + /** + * 配置界面选项卡标签宽度 + */ + public static final int JP_SET_WIDTH = 118; + + /** + * 配置界面选项卡标签宽度 + */ + public static final int JP_SET_HEIGHT = 20; + + /** + * 应用场景标签X值 + */ + public static final int APP_LABEL_X = 30; + + /** + * 应用场景标签Y1值 + */ + public static final int APP_LABEL_Y1 = 550; + + /** + * 高度 + */ + public static final int APP_LABEL_HIGHT = 55; + + /** + * 应用场景标签Y1值 + */ + public static final int APP_LABEL_Y2 = 580; + + /** + * 应用场景标签宽度 + */ + public static final int APP_LABEL_WIDTH = 2500; + + /** + * 应用场景标签高度 + */ + public static final int APP_LABEL_HEIGHT = 20; + + /** + * 应用场景标签字体大小 + */ + public static final int APP_LABEL_FONT = 15; + + /** + * 应用场景描述字体大小 + */ + public static final int TUN_LABEL_FONT = 12; + + /** + * 选择按钮X值 + */ + public static final int CHOOSE_X = 900; + + /** + * 选择按钮Y值 + */ + public static final int CHOOSE_Y = 670; + + /** + * 选择按钮宽度 + */ + public static final int CHOOSE_WIDTH = 150; + + /** + * 选择按钮高度 + */ + public static final int CHOOSE_HEIGHT = 40; + + /** + * 场景类型标签X值 + */ + public static final int TASK_SCENE_X = 30; + + /** + * 场景类型标签Y值 + */ + public static final int TASK_SCENE_Y = 30; + + /** + * 设备框大小 + */ + public static final int HEIGHT_PRESSE = 451; + + /** + * 场景类型标签宽度 + */ + public static final int TASK_WIDTH = 300; + + /** + * 场景类型标签高度 + */ + public static final int TASK_HEIGHT = 20; + + /** + * 场景类型标签字体 + */ + public static final int TASK_FONT = 25; + + /** + * 选择场景类型标签X值 + */ + public static final int CH_TASK_X = 190; + + /** + * 选择场景类型标签Y值 + */ + public static final int CH_TASK_Y = 33; + /** + * 选择场景类型标签宽度 + */ + public static final int CH_TASK_WIDTH = 250; + + /** + * 选择场景类型标签高度 + */ + public static final int CH_TASK_HEIGHT = 20; + + /** + * 选择场景类型字体 + */ + public static final int CH_TASK_FONT = 15; + + /** + * 应用场景按钮X值 + */ + public static final int APP_BUT_X = 50; + + /** + * 应用场景按钮Y值 + */ + public static final int APP_BUT_Y = 80; + + /** + * 应用场景按钮宽度 + */ + public static final int APP_BUT_WIDTH = 157; + + /** + * 应用场景按钮高度 + */ + public static final int APP_BUT_HEIGHT = 95; + + /** + * 应用场景按钮字体大小 + */ + public static final int APP_BUT_FONT = 12; + + /** + * 系统场景按钮X值 + */ + public static final int SYS_BUT_X = 247; + + /** + * 系统场景按钮Y值 + */ + public static final int SYS_BUT_Y = 80; + + /** + * 系统场景按钮宽度 + */ + public static final int SYS_BUT_WIDTH = 157; + + /** + * 系统场景按钮高度 + */ + public static final int SYS_BUT_HEIGHT = 95; + + /** + * 系统场景按钮字体大小 + */ + public static final int SYS_BUT_FONT = 12; + + /** + * 分布式场景按钮X值 + */ + public static final int EMB_BUT_X = 444; + + /** + * 分布式场景按钮Y值 + */ + public static final int EMB_BUT_Y = 80; + + /** + * 分布式场景按钮宽度 + */ + public static final int EMB_BUT_WIDTH = 157; + + /** + * 分布式场景按钮高度 + */ + public static final int EMB_BUT_HEIGHT = 95; + + /** + * 设备进程面板X值 + */ + public static final int DEVICE_PRO_X = 35; + + /** + * 设备进程面板Y值--num + */ + public static final int DEVICE_PRO_Y = 0; + + /** + * 设备进程面板宽度 + */ + public static final int DEVICE_PRO_WIDTH = 700; + + /** + * 设备进程面板高度 + */ + public static final int DEVICE_PRO_HEIGHT = 150; + + /** + * 每一台设备对应X值 + */ + public static final int DEVICES_X = 40; + + /** + * 每一台设备对应Y值 + */ + public static final int DEVICES_Y = 2; + + /** + * 每一台设备对标签宽度 + */ + public static final int DEVICES_WIDTH = 100; + + /** + * 每一台设备对标签高度 + */ + public static final int DEVICES_HEIGHT = 20; + + /** + * 每一台设备对标签字体大小 + */ + public static final int DEVICES_FONT = 13; + + /** + * 设备信息标签对应X值 + */ + public static final int DEVICE_X = 40; + + /** + * 每设备信息标签对应Y值 + */ + public static final int DEVICE_Y = 30; + + /** + * 每设备信息标签宽度 + */ + public static final int DEVICE_WIDTH = 50; + + /** + * 每设备信息标签高度 + */ + public static final int DEVICE_HEIGHT = 20; + + /** + * 设备连接方式下拉框对应X值 + */ + public static final int CON_BOX_X = 85; + + /** + * 设备连接方式下拉框对应Y值 + */ + public static final int CON_BOX_Y = 30; + + /** + * 设备连接方式下拉框宽度 + */ + public static final int CON_BOX_WIDTH = 100; + + /** + * 设备连接方式下拉框高度 + */ + public static final int CON_BOX_HEIGHT = 20; + + /** + * 设备名称下拉框对应X值 + */ + public static final int DEVICE_NAME_X = 200; + + /** + * 设备名称下拉框对应Y值 + */ + public static final int DEVICE_NAME_Y = 30; + + /** + * 设备名称下拉框宽度 + */ + public static final int DEVICE_NAME_WIDTH = 300; + + /** + * 设备名称下拉框高度 + */ + public static final int DEVICE_NAME_HEIGHT = 20; + + /** + * 进程名称下拉框对应X值 + */ + public static final int APP_NAME_X = 40; + + /** + * 进程名称下拉框对应Y值 + */ + public static final int APP_NAME_Y = 90; + + /** + * 进程名称下拉框宽度 + */ + public static final int APP_NAME_WIDTH = 80; + + /** + * 进程名称下拉框高度 + */ + public static final int APP_NAME_HEIGHT = 20; + + /** + * 选择面板对应X值 + */ + public static final int SE_PANEL_X = 115; + + /** + * Y轴高度 + */ + public static final int SE_PANEL_Y_TWO = 110; + + /** + * 选择面板对应Y值 + */ + public static final int SE_PANEL_Y = 90; + + /** + * 选择面板宽度 + */ + public static final int SE_PANEL_WIDTH = 300; + + /** + * 选择面板高度 + */ + public static final int SE_PANEL_HEIGHT = 20; + + /** + * 进程框y轴距离 + */ + public static final int PRECCE_HEIGHT_Y = 155; + + /** + * 标签名称文本框宽度 + */ + public static final int LABEL_NAME_WIDTH = 280; + + /** + * 标签名称文本框高度 + */ + public static final int LABEL_NAME_HEIGHT = 20; + + /** + * 标签名称文本框宽度 + */ + public static final int LABEL_SVG_WIDTH = 20; + + /** + * 标签名称文本框高度 + */ + public static final int LABEL_SVG_HEIGHT = 20; + + /** + * 设备添加按钮对应X值 + */ + public static final int DEVICE_ADD_X = 5; + + /** + * 设备添加按钮对应Y值 + */ + public static final int DEVICE_ADD_Y = 5; + + /** + * 设备添加按钮宽度 + */ + public static final int DEVICE_ADD_WIDTH = 100; + + /** + * 设备添加按钮高度 + */ + public static final int DEVICE_ADD_HEIGHT = 30; + + /** + * Center容器左边部分top面板宽度 + */ + public static final int LEFT_TOP_WIDTH = 700; + + /** + * Center容器左边部分top面板高度 + */ + public static final int LEFT_TOP_HEIGHT = 540; + + /** + * Center容器左边部分center面板宽度 + */ + public static final int LEFT_CENTER_WIDTH = 700; + + /** + * Center容器左边部分center面板高度 + */ + public static final int LEFT_CENTER_HEIGHT = 100; + + /** + * Center容器左边部分按钮面板高度 + */ + public static final int LEFT_BUN_WIDTH = 550; + + /** + * Center容器左边部分按钮面板高度 + */ + public static final int LEFT_BUN_HEIGHT = 100; + + /** + * Center容器右边部分按钮面板高度 + */ + public static final int RIGHT_BUN_WIDTH = 150; + + /** + * Center容器右边部分按钮面板高度 + */ + public static final int RIGHT_BUN_HEIGHT = 100; + + /** + * 监控按钮面板对应X值 + */ + public static final int MONITOR_PANEL_X = 20; + + /** + * 设备添加按钮对应Y值 + */ + public static final int MONITOR_PANEL_Y = 0; + + /** + * 设备添加按钮宽度 + */ + public static final int MONITOR_PANEL_WIDTH = 450; + + /** + * 设备添加按钮高度 + */ + public static final int MONITOR_PANEL_HEIGHT = 50; + + /** + * 监控按钮标签对应X值 + */ + public static final int MONITOR_BUN_X = 20; + + /** + * 监控按钮标签对应Y值 + */ + public static final int MONITOR_BUN_Y = 15; + + /** + * 监控按钮标签宽度 + */ + public static final int MONITOR_BUN_WIDTH = 450; + + /** + * 监控按钮标签高度 + */ + public static final int MONITOR_BUN_HEIGHT = 20; + + /** + * 监控按钮标签字体大小 + */ + public static final int MONITOR_BUN_FONT = 15; + + /** + * 监控项复选框对应X值 + */ + public static final int MONITOR_OPT_X = 20; + + /** + * 监控项复选框对应Y值 + */ + public static final int MONITOR_OPT_Y = 50; + + /** + * 监控项复选框宽度 + */ + public static final int MONITOR_OPT_WIDTH = 450; + + /** + * 监控项复选框高度 + */ + public static final int MONITOR_OPT_HEIGHT = 200; + + /** + * Center容器左边面板宽度 + */ + public static final int WEST_LABEL_WIDTH = 700; + + /** + * Center容器左边面板高度 + */ + public static final int WEST_LABEL_HEIGHT = 80; + + /** + * Center容器右边面板宽度 + */ + public static final int EAST_LABEL_WIDTH = 500; + + /** + * 多场景页面y轴距离 + */ + public static final int EAST_LABEL_Y = 520; + + /** + * Center容器右边面板高度 + */ + public static final int EAST_LABEL_HEIGHT = 80; + + /** + * top、south容器面板宽度 + */ + public static final int TOP_SOUTH_WIDTH = 100; + + /** + * top、south容器面板高度 + */ + public static final int TOP_SOUTH_HEIGHT = 80; + + /** + * 应用场景标签对应X值 + */ + public static final int TASK_LABEL_X = 30; + + /** + * 应用场景标签对应Y值 + */ + public static final int TASK_LABEL_Y = 30; + + /** + * 应用场景标签宽度 + */ + public static final int TASK_LABEL_WIDTH = 250; + + /** + * 应用场景标签高度 + */ + public static final int TASK_LABEL_HEIGHT = 20; + + /** + * 应用场景标签字体大小 + */ + public static final int TASK_LABEL_FONT = 20; + + /** + * 应用场景标签字体大小 + */ + public static final int SYSTEM_TUNNING_LABEL_FONT = 14; + + /** + * 应用场景描述对应X值 + */ + public static final int TASK_DEC_X = 270; + + /** + * number计算 + */ + public static final int TASK_DEC_NUM = 27; + + /** + * 应用场景描述对应Y值 + */ + public static final int TASK_DEC_Y = 33; + + /** + * 应用场景描述宽度 + */ + public static final int TASK_DEC_WIDTH = 200; + + /** + * 应用场景描述高度 + */ + public static final int TASK_DEC_HEIGHT = 20; + + /** + * 应用场景描述字体大小 + */ + public static final int TASK_DEC_FONT = 12; + + /** + * SYSTEM TUNNING JCheckBox 字体大小 + */ + public static final int SYSTEM_TUNNING_JCHECKBOX_FONT = 14; + + /** + * 监控项内存标签对应X值 + */ + public static final int MEMORY_X = 20; + + /** + * 监控项内存标签对应Y值 + */ + public static final int MEMORY_Y = 10; + + /** + * 内存添加标签对应MemoryX值 + */ + public static final int MEMORY_X_TESTING = 32; + + /** + * 内存添加标签对应MemoryY值 + */ + public static final int MEMORY_Y_TESTING = 32; + + /** + * 监控项内存标签宽度 + */ + public static final int MEMORY_WIDTH = 50; + + /** + * 监控项内存标签高度 + */ + public static final int MEMORY_HEIGHT = 20; + + /** + * 全部选择复选框对应X值 + */ + public static final int SELECT_ALL_X = 20; + + /** + * 全部选择复选框对应Y值 + */ + public static final int SELECT_ALL_Y = 40; + + /** + * 监测页面内存添加全部选择复选框对应X值 + */ + public static final int SELECT_ALL_X_TESTING = 34; + + /** + * 监测页面内存添加全部选择复选框对应Y值 + */ + public static final int SELECT_ALL_Y_TESTING = 90; + + /** + * 全部选择复选框宽度 + */ + public static final int SELECT_ALL_WIDTH = 100; + + /** + * 全部选择复选框高度 + */ + public static final int SELECT_ALL_HEIGHT = 20; + + /** + * java选择框对应X值 + */ + public static final int JAVA_X = 250; + + /** + * java选择框对应Y值 + */ + public static final int JAVA_Y = 40; + + /** + * 监测页面内存添加java选择框对应X值 + */ + public static final int JAVA_X_TESTING = 240; + + /** + * 监测页面内存添加java选择框对应Y值 + */ + public static final int JAVA_Y_TESTING = 90; + + /** + * java选择框宽度 + */ + public static final int JAVA_WIDTH = 120; + + /** + * java选择框高度 + */ + public static final int JAVA_HEIGHT = 20; + + /** + * native选择框对应X值 + */ + public static final int NATIVE_X = 20; + + /** + * native选择框对应Y值 + */ + public static final int NATIVE_Y = 70; + + /** + * 检测页面内存添加native选择框对应X值 + */ + public static final int NATIVE_X_TESTING = 34; + + /** + * 检测页面内存添加native选择框对应Y值 + */ + public static final int NATIVE_Y_TESTING = 128; + + /** + * native选择框宽度 + */ + public static final int NATIVE_WIDTH = 100; + + /** + * native选择框高度 + */ + public static final int NATIVE_HEIGHT = 20; + + /** + * graphics选择框对应X值 + */ + public static final int GRAPHICS_X = 250; + + /** + * graphics选择框对应Y值 + */ + public static final int GRAPHICS_Y = 70; + + /** + * 检测页面内存添加graphics选择框对应X值 + */ + public static final int GRAPHICS_X_TESTING = 240; + + /** + * 检测页面内存添加graphics选择框对应Y值 + */ + public static final int GRAPHICS_Y_TESTING = 128; + + /** + * graphics选择框宽度 + */ + public static final int GRAPHICS_WIDTH = 100; + + /** + * graphics选择框高度 + */ + public static final int GRAPHICS_HEIGHT = 20; + + /** + * stack选择框对应X值 + */ + public static final int STACK_X = 20; + + /** + * stack选择框对应Y值 + */ + public static final int STACK_Y = 100; + + /** + * 检测页面内存添加stack选择框对应X值 + */ + public static final int STACK_X_TESTING = 34; + + /** + * 检测页面内存添加stack选择框对应Y值 + */ + public static final int STACK_Y_TESTING = 166; + + /** + * stack选择框宽度 + */ + public static final int STACK_WIDTH = 120; + + /** + * stack选择框高度 + */ + public static final int STACK_HEIGHT = 20; + + /** + * code选择框对应X值 + */ + public static final int CODE_X = 250; + + /** + * code选择框对应Y值 + */ + public static final int CODE_Y = 100; + + /** + * 检测页面内存添加code选择框对应X值 + */ + public static final int CODE_X_TESTING = 240; + + /** + * 检测页面内存添加code选择框对应Y值 + */ + public static final int CODE_Y_TESTING = 166; + + /** + * code选择框宽度 + */ + public static final int CODE_WIDTH = 100; + + /** + * code选择框高度 + */ + public static final int CODE_HEIGHT = 20; + + /** + * others选择框对应X值 + */ + public static final int OTHERS_X = 20; + + /** + * others选择框对应Y值 + */ + public static final int OTHERS_Y = 130; + + /** + * 检测页面内存添加others选择框对应X值 + */ + public static final int OTHERS_X_TESTING = 34; + + /** + * 检测页面内存添加others选择框对应Y值 + */ + public static final int OTHERS_Y_TESTING = 204; + + /** + * others选择框宽度 + */ + public static final int OTHERS_WIDTH = 100; + + /** + * others选择框高度 + */ + public static final int OTHERS_HEIGHT = 20; + + /** + * 滚轮滚动速度 + */ + public static final int SCROLL_UNIT_INCREMENT = 10; + + /** + * 数组索引 + */ + public static final int INDEX_ZERO = 0; + + /** + * 数组索引 + */ + public static final int INDEX_ONE = 1; + + /** + * 数组索引 + */ + public static final int INDEX_TWO = 2; + + /** + * 数组索引 + */ + public static final int INDEX_THREE = 3; + + /** + * 数组索引 + */ + public static final int INDEX_FOUR = 4; + + /** + * 数组索引 + */ + public static final int INDEX_FIVE = 5; + + /** + * 数组索引 + */ + public static final int INDEX_SIX = 6; + + /** + * 数组索引 + */ + public static final int INDEX_SEVEN = 7; + + /** + * X轴距离 + */ + public static final int NUMBER_X = 160; + + /** + * X轴距离 + */ + public static final int NUMBER_X_ADD = 165; + + /** + * 多场景按钮宽度 + */ + public static final int WIDTHS = 250; + + /** + * Y轴距离 + */ + public static final int NUMBER_Y = 4; + + /** + * 高度 + */ + public static final int HEIGHT = 45; + + /** + * 用于Y轴位置计算 + */ + public static final int HEIGHT_Y = 150; + + /** + * X轴位置 + */ + public static final int POSITION_X = 150; + + /** + * X轴位置 + */ + public static final int POSITION_TASK_X = 1070; + + /** + * 计数/y轴高度 + */ + public static final int NUMBER_TWO = 2; + + /** + * X轴位置 + */ + public static final int NUMBER_STEP = 950; + + /** + * 秒数计数 + */ + public static final int NUMBER_SECONDS = 59; + + /** + * 秒数计数 + */ + public static final int NUMBER_SLEEEP = 50; + + /** + * 循环计数 + */ + public static final int NUMBER_FOR = 220; + + /** + * Thread interval time + */ + public static final int NUMBER_THREAD = 1000; + + /** + * CHOOSE按钮X轴距离 + */ + public static final int CHOSSE_X = 1070; + + /** + * 滚东条计数 + */ + public static final int SCROPNUM = 360; + + /** + * 多场景描述面板大小 + */ + public static final int JLABEL_SIZE = 60; + + /** + * 宽度 + */ + public static final int WIDTH = 145; + + /** + * 分割线宽度 + */ + public static final int SPLITWIDTH = 9; + + /** + * 图片宽度 + */ + public static final int SVGWIDTH_ONE = 16; + + /** + * 图片宽度 + */ + public static final int SVGWIDTH_TWO = 24; + + /** + * 图片宽度 + */ + public static final int SVGWIDTH_THREE = 32; + + /** + * 图片宽度 + */ + public static final int SVGWIDTH_FOUR = 48; + + /** + * 图片宽度 + */ + public static final int SVGWIDTH_FIVE = 64; + + /** + * SVG宽度 + */ + public static final int SVGWIDTHONE = -1; + + /** + * SVG高度 + */ + public static final int SVGWIDTHTWO = 1; + + /** + * SVG计数 + */ + public static final int SVGNUMBER = 16; + + /** + * SVG计数 + */ + public static final int SVGNUMBERXXONE = 0xffffff; + + /** + * SVG计数 + */ + public static final int SVGNUMBERXTWO = 0x00ffffff; + + /** + * SVG计数 + */ + public static final int SVGNUMBERXTHREE = 0xff000000; + + /** + * 定位chart页面 + */ + public static final int INTNUMBER = 3; + + /** + * 宽度 + */ + public static final int WIDTHSUPEN = 400; + + /** + * 场景描述框大小 + */ + public static final int HIGTHSCEECS = 65; + + /** + * 字体大小 + */ + public static final int FONT = 11; + + /** + * 二级界面的按钮大小 + */ + public static final int BUTTON_SIZE = 28; + + /** + * 二级界面的run和stop按钮宽度 + */ + public static final int BUTTON_WIDTHS = 45; + + /** + * memory对话框宽度 + */ + public static final int MEMORY_WIDTH_SIZE = 484; + + /** + * memory对话框高度 + */ + public static final int MEMORY_HEIGHT_SIZE = 339; + + /** + * memory配置项按钮宽度 + */ + public static final int ITERM_BUT_WIDTH_SIZE = 78; + + /** + * memory配置项按钮高度 + */ + public static final int ITERM_BUT_HEIGHT_SIZE = 32; + + /** + * memory配置项取消按钮X轴 + */ + public static final int CANCEL_BUT_X = 296; + + /** + * memory配置项取消/确定按钮Y轴 + */ + public static final int CANCEL_BUT_Y = 275; + + /** + * memory配置项取消按钮X轴 + */ + public static final int OK_BUT_X = 390; + + /** + * 检测页面内存添加关闭按钮 + */ + public static final int CLOSE_BUT_WIDTH = 16; + + /** + * 检测页面内存添加关闭按钮X轴 + */ + public static final int CLOSE_BUT_X = 452; + + /** + * 检测页面内存添加关闭按钮Y轴 + */ + public static final int CLOSE_BUT_Y = 16; + + /** + * 检测页面内存添加选项字体 + */ + public static final int OPTION_FONT = 14; + + /** + * 数字1000 + */ + public static final int THOUSAND = 1000; + + /** + * 数字500 + */ + public static final int FIVE_HUNDRED = 500; + + /** + * 数字2 + */ + public static final int TWO = 2; + + /** + * 数字25 + */ + public static final int TWENTY_FIVE = 25; + + /** + * 数字1100 + */ + public static final int THOUSAND_ONE = 1100; + + /** + * 数字69 + */ + public static final int SIXTY_NINE = 69; + + /** + * 数字73 + */ + public static final int SEVENTY_THREE = 73; + + /** + * 数字74 + */ + public static final int SEVENTY_FOUR = 74; + + /** + * 数字300 + */ + public static final int THREE_HUNDRED = 300; + + /** + * 数字122 + */ + public static final int HUNDRED_TWENTY_TWO = 122; + + /** + * 数字133 + */ + public static final int HUNDRED_THIRTY_THREE = 133; + + /** + * 数字144 + */ + public static final int HUNDRED_FORTY_FOUR = 144; + + /** + * 数字145 + */ + public static final int HUNDRED_FORTY_FIVE = 145; + + /** + * 数字146 + */ + public static final int HUNDRED_FORTY_SIX = 146; + + /** + * 数字155 + */ + public static final int HUNDRED_FIFTY_FIVE = 155; + + /** + * 数字100 + */ + public static final int HUNDRED = 100; + + /** + * 数字40 + */ + public static final int FORTY = 40; + + /** + * 数字20 + */ + public static final int TWENTY = 20; + + /** + * 数字-1 + */ + public static final int NEGATIVE_ONE = -1; + + /** + * 数字400 + */ + public static final int FOUR_HUNDRED = 400; + + /** + * 数字260 + */ + public static final int TWO_HUNDRED_SIXTY = 260; + + /** + * 数字10 + */ + public static final int TEN = 10; + + /** + * 数字30 + */ + public static final int THIRTY = 30; + + /** + * 数字70 + */ + public static final int SEVENTY = 70; + + /** + * 数字90 + */ + public static final int NINETY = 90; + + /** + * 数字220 + */ + public static final int TWO_HUNDRED_TWENTY = 220; + + /** + * 数字91 + */ + public static final int NINETY_ONE = 91; + + /** + * 数字218 + */ + public static final int TWO_HUNDRED_EIGHTEEN = 213; + + /** + * 数字60 + */ + public static final int SIXTY = 60; + + /** + * 数字320 + */ + public static final int THREE_HUNDRED_TWENTY = 320; + + /** + * 数字180 + */ + public static final int HUNDRED_EIGHTY = 180; + + /** + * 数字80 + */ + public static final int EIGHTY = 80; + + /** + * 数字160 + */ + public static final int HUNDRED_SIXTY = 160; + + /** + * 数字150 + */ + public static final int HUNDRED_FIFTY = 150; + + /** + * 数字800 + */ + public static final int EIGHT_HUNDRED = 800; + + /** + * 数字210 + */ + public static final int TWO_HUNDRED_TEN = 210; + + /** + * 数字1024 + */ + public static final int THOUSAND_TWENTY_FOUR = 1024; + + /** + * 数字0.75f + */ + public static final float LOAD_FACTOR = 0.75F; + + /** + * 数字2f + */ + public static final float FLOAT_VALUE = 2F; + + /** + * 数字3 + */ + public static final int THREE = 3; + + /** + * 数字16 + */ + public static final int SIXTEEN = 16; + + /** + * 数字1500 + */ + public static final int THOUSAND_FIVE_HUNDRED = 1500; + + /** + * 数字31 + */ + public static final int THIRTY_ONE = 31; + + /** + * 数字32 + */ + public static final int THIRTY_TWO = 32; + + /** + * 数字5 + */ + public static final int FIVE = 5; + + /** + * 端口号 + */ + public static final int PORT = 65535; + + /** + * 数字50 + */ + public static final int FIFTY = 50; + + /** + * 数字32947L + */ + public static final long NUM_L = 32947L; + + /** + * 数字32947 + */ + public static final int NUM_BER = 32947; + + /** + * SYSTEM tun center左右宽度 + */ + public static final int SYSTEM_TUNNING_CENTER_LEFT_AND_RIGHT_X = 40; + + /** + * 默认值 + */ + public static final int DEFAULT_NUMBER = 0; + + /** + * 默认值 + */ + public static final int SYSTEM_TUNNING_RECORD_SETTING_DEFAULT_NUMBER = 10; + + /** + * 默认值 + */ + public static final int SYSTEM_TUNNING_RECORD_SETTING_MAXDURATION_DEFAULT_NUMBER = 1; + + /** + * SYSTEM TUNNING 自定义布局label的默认初始化Y值 + */ + public static final int SYSTEM_TUNNING_LABEL_INTT_X = 50; + + /** + * SYSTEM TUNNING 单选按钮的初始化x轴 + */ + public static final int SYSTEM_TUNNING_LABLE_RADIO_INTT_X = 50; + + /** + * SYSTEM TUNNING 单选按钮的初始化x轴 + */ + public static final int SYSTEM_TUNNING_LABLE_RADIO_DECOND_INTT_X = 210; + + /** + * SYSTEM TUNNING 单选按钮的初始化x轴 + */ + public static final int SYSTEM_TUNNING_LABLE_RADIO_THREE_INTT_X = 370; + + /** + * SYSTEM TUNNING 自定义布局label的默认初始化Y值 + */ + public static final int SYSTEM_TUNNING_LABLE_DESCRIBE_INTT_RIGHT_X = 521; + + /** + * SYSTEM TUNNING 自定义布局label的默认初始化Y值 + */ + public static final int SYSTEM_TUNNING_LABLE_INTT_RIGHT_X = 500; + + /** + * SYSTEM TUNNING 自定义布局label的默认初始化Y值 + */ + public static final int SYSTEM_TUNNING_RECORD_MODEL_LABLE_INTT_Y = 13; + + /** + * SYSTEM TUNNING 自定义布局label的默认初始化Y值 + */ + public static final int SYSTEM_TUNNING_LABLE_INTT_Y = 50; + + /** + * SYSTEM TUNNING 自定义布局label的默认Y值 - 之间间距 + */ + public static final int SYSTEM_TUNNING_LABLE_SPACING_Y = 50; + + /** + * SYSTEM TUNNING SLIDE自定义布局label的默认Y值 - 之间间距 + */ + public static final int SYSTEM_TUNNING_SLIDE_LABLE_SPACING_Y = 70; + + /** + * SYSTEM TUNNING 自定义布局label的默认Y值 - 之间间距 + */ + public static final int SYSTEM_TUNNING_PROBES_SPACING_Y = 90; + + /** + * SYSTEM TUNNING 自定义布局label的默认Y值 - 之间间距 + */ + public static final int SYSTEM_TUNNING_PROBES_SCHEDULING_SPACING_Y = 80; + + /** + * SYSTEM TUNNING 自定义布局label的默认Y值 - 之间间距 + */ + public static final int SYSTEM_TUNNING_PROBES_CPU_SPACING_Y = 170; + + /** + * SYSTEM TUNNING 自定义布局label的默认Y值 - 之间间距 + */ + public static final int SYSTEM_TUNNING_PROBES_SYSCALLS_SPACING_Y = 260; + + /** + * SYSTEM TUNNING 自定义布局label的默认Y值 - 之间间距 + */ + public static final int SYSTEM_TUNNING_PROBES_BOARD_SPACING_Y = 350; + + /** + * SYSTEM TUNNING 自定义布局label的默认Y值 - 之间间距 + */ + public static final int SYSTEM_TUNNING_PROBES_DOUBLE_SPACING_Y = 180; + + /** + * SYSTEM TUNNING 自定义布局label的默认Y值 - 之间间距 + */ + public static final int SYSTEM_TUNNING_PROBES_THREE_SPACING_Y = 270; + + /** + * SYSTEM TUNNING 自定义布局label的默认Y值 - 之间间距 + */ + public static final int SYSTEM_TUNNING_PROBES_FOUR_SPACING_Y = 360; + + /** + * SYSTEM TUNNING 复选框High frequency memory label的Y轴 + */ + public static final int SYSTEM_TUNNING_PROBES_HIGH_FREQUENCY_MEMORY_LABEL_INIT_Y = 95; + + /** + * SYSTEM TUNNING 复选框LOW MEMORY KILLER label的Y轴 + */ + public static final int SYSTEM_TUNNING_PROBES_LOW_MEMORY_KILLER_LABEL_INIT_Y = 185; + + /** + * SYSTEM TUNNING 复选框ATRACE USERSPACE ANNOTATIONS label的Y轴 + */ + public static final int SYSTEM_TUNNING_PROBES_ATRACE_USERSPACE_ANNOTATIONS_LABEL_INIT_Y = 360; + + /** + * SYSTEM TUNNING 自定义布局label的默认Y值 - 之间间距 * 2 + */ + public static final int SYSTEM_TUNNING_LABLE_SPACING_TWO_TIMES_Y = 2 * 50; + + /** + * SYSTEM TUNNING 自定义布局label的默认Y值 - 之间间距 * 3 + */ + public static final int SYSTEM_TUNNING_LABLE_SPACING_THREE_TIMES_Y = 3 * 50; + + /** + * SYSTEM TUNNING 自定义布局label的默认宽度 + */ + public static final int SYSTEM_TUNNING_LABLE_WIDTH = 200; + + /** + * SYSTEM TUNNING JCHECKBOX自定义布局label的默认宽度 + */ + public static final int SYSTEM_TUNNING_JCHECKBOX_LABLE_WIDTH = 250; + + /** + * SYSTEM TUNNING 自定义布局label的默认高度 + */ + public static final int SYSTEM_TUNNING_LABLE_HEIGHT = 50; + + /** + * SYSTEM TUNNING CHECKBOX自定义布局label的默认高度 + */ + public static final int SYSTEM_TUNNING_CHECKBOX_LABLE_HEIGHT = 60; + + /** + * SYSTEM TUNNING SLIDE HEIGHT 自定义布局label的默认高度 + */ + public static final int SYSTEM_TUNNING_SLIDE_LABLE_HEIGHT = 70; + + /** + * SYSTEM TUNNING ,label 的描述 + */ + public static final int SYSTEM_TUNNING_LABLE_DESCRIBE = 350; + + /** + * SYSTEM TUNNING 自定义布局label的默认初始化Y值 + */ + public static final int SYSTEM_TUNNING_LABLE_DESCRIBE_INTT_X = 71; + + /** + * SYSTEM TUNNING TRACE COMMAND TEXTAREA 初始化X位置 + */ + public static final int SYSTEM_TUNNING_TRACE_COMMAND_TEXT_AREA_INTT_X = 40; + + /** + * SYSTEM TUNNING TRACE COMMAND TEXTAREA 初始化Y位置 + */ + public static final int SYSTEM_TUNNING_TRACE_COMMAND_TEXT_AREA_INTT_Y = 40; + + /** + * SYSTEM TUNNING SETTING RECORD RADIO 初始化Y位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SPACEING_Y = 130; + + /** + * SYSTEM TUNNING SETTING RECORD RADIO 初始化Y位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_DURATION_INTI_Y = 200; + + /** + * SYSTEM TUNNING SETTING RECORD RADIO 初始化X位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SHOW_NUMBER_INTI_X = 700; + + /** + * SYSTEM TUNNING SETTING RECORD IN MEMORY 滚动条触发的label框的显示 初始化Y位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_IN_MEMORY_INTI_Y = 150; + + /** + * SYSTEM TUNNING SETTING RECORD 滚动条触发的label框的显示 初始化Y位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SHOW_NUMBER_INTI_Y = 250; + + /** + * SYSTEM TUNNING SETTING RECORD 滚动条触发的label框的长度 初始化width位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SHOW_NUMBER_INTI_WIDTH = 110; + + /** + * SYSTEM TUNNING SETTING SLIDE 初始化X位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_X = 45; + + /** + * SYSTEM TUNNING SETTING SLIDE 初始化Y位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_Y = 140; + + /** + * SYSTEM TUNNING SETTING SLIDE RIGHT LABEL初始化Y位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_RIGHT_LABEL_INT_Y = 135; + + /** + * SYSTEM TUNNING SETTING SLIDE SPCING 初始化SLIDE 的垂直间距位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_DURATION_LABEL = 190; + + /** + * SYSTEM TUNNING SETTING SLIDE SPCING 初始化SLIDE 的垂直间距位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_DURATION_LABEL_INIT_Y = 225; + + /** + * SYSTEM TUNNING SETTING MAX FILE SIZE SLIDE LABEL初始化Y位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_FILE_SIZE_SLIDE_INT_LABEL_Y = 280; + + /** + * SYSTEM TUNNING SETTING MAX FILE SIZE SLIDE LABEL初始化Y位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_FILE_SIZE_SLIDE_LABEL_INT_LABEL_Y = 315; + + /** + * SYSTEM TUNNING SETTING MAX FILE SIZE SLIDE 初始化Y位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_FLUSH_ON_DISK_SLIDE_INT_Y = 370; + + /** + * SYSTEM TUNNING SETTING MAX FILE SIZE SLIDE LABEL 初始化Y位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_FLUSH_ON_DISK_SLIDE_LABEL_INT_Y = 405; + + /** + * SYSTEM TUNNING SETTING SLIDE SPCING 初始化SLIDE and label的垂直间距位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_AND_LABEL_SPACING_Y = 40; + + /** + * SYSTEM TUNNING TABBEDPANE TRACE CONFIG WIDETH 初始化tabbedPane 的宽度 + */ + public static final int SYSTEM_TUNNING_TABBEDPANE_TRACE_CONFIG_WIDTH_INIT = 100; + + /** + * SYSTEM TUNNING TABBEDPANE TRACE CONFIG HEIGHT 初始化tabbedPane 的高度 + */ + public static final int SYSTEM_TUNNING_TABBEDPANE_TRACE_CONFIG_HEIGHT_INIT = 50; + + /** + * SYSTEM TUNNING TABBEDPANE TRACE CONFIG 字体大小 + */ + public static final int SYSTEM_TUNNING_TABBEDPANE_TRACE_CONFIG_FONT = 16; + /** + * SYSTEM TUNNING SETTING SLIDE 初始化WIDTH位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_WIDTH = 600; + + /** + * SYSTEM TUNNING SETTING SLIDE 初始化HIGHT位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_HIGHT = 30; + + /** + * SYSTEM TUNNING SETTING RECORD 滚动条触发的label框的长度 初始化width位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_MAX_IN_MEMORY_NUMBER = 100; + + /** + * SYSTEM TUNNING SETTING RECORD 滚动条触发的label框的长度 初始化width位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_MIN_DURATION_NUMBER = 10; + + /** + * SYSTEM TUNNING SETTING RECORD 滚动条触发的label框的长度 初始化width位置 + */ + public static final int SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_MAX_DURATION_NUMBER = 600; + + /** + * SYSTEM TUNNING DEVICE COMBOX 初始化Y位置 + */ + public static final int SYSTEM_TUNNING_DEVICE_COMBOX_EQUIPMENT_INIT_Y = 40; + + /** + * SYSTEM TUNNING LABEL 默认高度HEIGTH + */ + public static final int SYSTEM_TUNNING_ALL_LABEL_INIT_HEIGHT = 28; + + /** + * SYSTEM TUNNING LABEL TRACE CONFIG & PROBES INIT Y 默认Y + */ + public static final int SYSTEM_TUNNING_TRACE_CONFIG_AND_PROBES_INIT_Y = 90; + + /** + * SYSTEM TUNNING LABEL TASK SECEN:SYSTEM TUNNING INIT Y 默认Y + */ + public static final int SYSTEM_TUNNING_SAMLL_TASH_SCENEINIT_Y = 98; + + /** + * SYSTEM TUNNING TRACE COMMAND COPY FUNCTION CURSOR NUMBER 复制功能小手图标 + */ + public static final int SYSTEM_TUNNING_TRACE_COMMAND_COPY_FUNCTION_CURSOR = 12; + + /** + * SYSTEM TUNNING TRACE COMMAND COPY FUNCTION INIT X 初始化复制图片的X位置 + */ + public static final int SYSTEM_TUNNING_TRACE_COMMAND_COPY_FUNCTION_INIT_X = 900; + + /** + * SYSTEM TUNNING TRACE COMMAND COPY FUNCTION WIDTH OR HEIGHT 初始化复制图片的HEIGHT || HEIGHT位置 + */ + public static final int SYSTEM_TUNNING_TRACE_COMMAND_COPY_FUNCTION_INIT_WIDTH = 64; + + /** + * SYSTEM TUNNING TRACE COMMAND TextArea WIDTH + */ + public static final int SYSTEM_TUNNING_TRACE_COMMAND_TEXTAREA_WIDTH = 600; + + /** + * SYSTEM TUNNING TRACE COMMAND TextArea HEIGHT + */ + public static final int SYSTEM_TUNNING_TRACE_COMMAND_TEXTAREA_HEIGHT = 400; + + /** + * SYSTEM TUNNING RECORD SETTING SLIDE LABEL 初始化滚动条右侧label的高度 + */ + public static final int SYSTEM_TUNNING_RECORD_SETTING_SLIDE_LABEL = 45; + + /** + * SYSTEM TUNNING RECORD SETTING radio width 单选按钮的宽度 + */ + public static final int SYSTEM_TUNNING_RECORD_SETTING_RADIO_WIDTH = 160; + + /** + * SYSTEM TUNNING RECORD SETTING radio width 单选按钮的宽度 + */ + public static final int SYSTEM_TUNNING_DURATION_MINUTE = 9; + + /** + * serialVersionUID + */ + public static final long SERIALVERSIONUID = -5172589582171358319L; + + /** + * SYSTEM TUNNING GET TRACE DATA LOADING LOAD框 + */ + public static final int SYSTEM_TUNNING_LOADING_WIDTH = 300; + + /** + * SYSTEM TUNNING GET TRACE DATA LOADING LOAD框 + */ + public static final int SYSTEM_TUNNING_LOADING_HEIGHT = 150; + + /** + * SYSTEM TUNNING GET TRACE DATA LOADING LOAD框 + */ + public static final int SYSTEM_TUNNING_LOADING_INITLINE_ONE_X = 120; + + /** + * SYSTEM TUNNING GET TRACE DATA LOADING LOAD框 + */ + public static final int SYSTEM_TUNNING_LOADING_INIT_LINE_TWO_X = 190; + + /** + * SYSTEM TUNNING GET TRACE DATA LOADING LOAD框 + */ + public static final int SYSTEM_TUNNING_LOADING_INIT_INITLINE_ONE_Y = 30; + + /** + * SYSTEM TUNNING GET TRACE DATA LOADING LOAD框 + */ + public static final int SYSTEM_TUNNING_LOADING_INIT_INITLINE_TWO_Y = 60; + + /** + * SYSTEM TUNNING GET TRACE DATA LOADING WIDTH LOAD框 + */ + public static final int SYSTEM_TUNNING_LOADING_INITLINE_ONE_WIDTH = 70; + + /** + * SYSTEM TUNNING GET TRACE DATA LOADING HEIGHT LOAD框 + */ + public static final int SYSTEM_TUNNING_LOADING_INITLINE_ONE_HEIGHT = 20; + + /** + * SYSTEM TUNNING GET TRACE DATA LOADING HEIGHT LOAD框 + */ + public static final int SYSTEM_TUNNING_LOADING_BUTTON_Y = 110; + + /** + * 数字2000 + */ + public static final int TWO_THOUSAND = 2000; + + /** + * 数字2000 + */ + public static final int EIGHT_NUM = 8; + + /** + * ASC + */ + public static final String ASC = "ASCENDING"; + + /** + * 数字980 + */ + public static final int SEARCH_NUM = 980; + + /** + * 数字0 + */ + public static final int NUM_0 = 0; + + /** + * 数字1 + */ + public static final int NUM_1 = 1; + + /** + * 数字2 + */ + public static final int NUM_2 = 2; + + /** + * 数字3 + */ + public static final int NUM_3 = 3; + + /** + * 数字4 + */ + public static final int NUM_4 = 4; + + /** + * device number + */ + public static final int DEVICE_NUMBER = 1085; + + /** + * description number + */ + public static final int DESCRIPTION_NUMBER = 430; +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/MonitorItemDetail.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/MonitorItemDetail.java new file mode 100644 index 000000000..c28116c1f --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/MonitorItemDetail.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common; + +import java.awt.Color; + +/** + * 监控项详情,各个二级界面监控项的监控项 + * + * @since 2021/3/1 16:50 + */ +public enum MonitorItemDetail { + /** + * 内存监控项:Java + */ + MEM_JAVA(0, "Java", ColorConstants.MEM_JAVA), + + /** + * 内存监控项:Native + */ + MEM_NATIVE(1, "Native", ColorConstants.MEM_NATIVE), + + /** + * 内存监控项:Graphics + */ + MEM_GRAPHICS(2, "Graphics", ColorConstants.MEM_GRAPHICS), + + /** + * 内存监控项:Stack + */ + MEM_STACK(3, "Stack", ColorConstants.MEM_STACK), + + /** + * 内存监控项:Code + */ + MEM_CODE(4, "Code", ColorConstants.MEM_CODE), + + /** + * 内存监控项:Others + */ + MEM_OTHERS(5, "Others", ColorConstants.MEM_OTHERS), + + /** + * Network监控项:received + */ + NETWORK_RCV(1, "received", ColorConstants.NETWORK_RCV), + + /** + * Network监控项:Sent + */ + NETWORK_SENT(1, "Sent", ColorConstants.NETWORK_SENT), + + /** + * Network监控项:connections + */ + NETWORK_CONN(1, "connections", ColorConstants.NETWORK_CONN), + + /** + * 未知项 + */ + UNRECOGNIZED(-1, "Unrecognized", null); + + private final int index; + private final String name; + private final Color color; + + MonitorItemDetail(int index, String name, Color color) { + this.index = index; + this.name = name; + this.color = color; + } + + /** + * 通过名称获取监控项详情 + * + * @param name 名称 + * @return 监控项详情 + */ + public static MonitorItemDetail getItemByName(String name) { + MonitorItemDetail result = UNRECOGNIZED; + for (MonitorItemDetail item : MonitorItemDetail.values()) { + if (item.getName().equals(name)) { + result = item; + } + } + return result; + } + + public int getIndex() { + return index; + } + + public String getName() { + return name; + } + + public Color getColor() { + return color; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/OperationUtils.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/OperationUtils.java new file mode 100644 index 000000000..dc31b1179 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/OperationUtils.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common; + +import java.math.BigDecimal; + +import static java.math.BigDecimal.ROUND_HALF_UP; +import static ohos.devtools.views.common.ViewConstants.DECIMAL_COUNTS; + +/** + * View related tool classes + * + * @since 2021/2/2 10:25 + */ +public final class OperationUtils { + /** + * 构造函数 + */ + private OperationUtils() { + } + + /** + * 乘法运算 + * + * @param num1 数字1 + * @param num2 数字2 + * @return int结果 + */ + public static int multiply(BigDecimal num1, int num2) { + return num1.multiply(new BigDecimal(num2)).intValue(); + } + + /** + * 除法运算,返回BigDecimal + * + * @param num1 数字1 + * @param num2 数字2 + * @return BigDecimal结果 + */ + public static BigDecimal divide(double num1, double num2) { + return new BigDecimal(num1).divide(new BigDecimal(num2), DECIMAL_COUNTS, ROUND_HALF_UP); + } + + /** + * 除法运算,返回int + * + * @param num1 数字1 + * @param num2 数字2 + * @return int结果 + */ + public static int divideInt(double num1, double num2) { + return new BigDecimal(num1).divide(new BigDecimal(num2), DECIMAL_COUNTS, ROUND_HALF_UP).intValue(); + } + + /** + * 除法运算,返回int + * + * @param num1 数字1 + * @param num2 数字2 + * @return int结果 + */ + public static int divide(double num1, BigDecimal num2) { + return new BigDecimal(num1).divide(num2, DECIMAL_COUNTS, ROUND_HALF_UP).intValue(); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/ProfilerMonitorItem.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/ProfilerMonitorItem.java new file mode 100644 index 000000000..d66173d9e --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/ProfilerMonitorItem.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common; + +/** + * Profiler的监控项 + * + * @since 2021/2/26 9:41 + */ +public enum ProfilerMonitorItem { + CPU("Cpu"), MEMORY("Memory"), NETWORK("Network"), ENERGY("Energy"), DISK_IO("DiskIO"), UNRECOGNIZED("Unrecognized"); + + private final String name; + + ProfilerMonitorItem(String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/SystemTunningProbesCheckbox.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/SystemTunningProbesCheckbox.java new file mode 100644 index 000000000..8e4beb715 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/SystemTunningProbesCheckbox.java @@ -0,0 +1,346 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common; + +/** + * SystemTunningProbesCheckbox + * + * @version 1.0 + * @date 2021/04/14 20:13 + **/ +public final class SystemTunningProbesCheckbox { + private static final String TRACE_EVENT = " ftrace_events:"; + + /** + * SYSTEM_TUNNING_PROBES_NO_SELECT_HEAD + */ + public static final String SYSTEM_TUNNING_PROBES_NO_SELECT_HEAD = + "hdc shell hiprofiler_cmd \\\n" + " -c - \\\n" + "<= parent.getWidth()) { + newLocationX = parent.getWidth() - bar.getWidth(); + } + return newLocationX; + } + + /** + * 计算并调整滚动条调整后的宽度和位置 + */ + public void resizeAndReposition() { + ChartStandard standard = parent.getObserver().getStandard(); + int lastTime = (int) (standard.getLastTimestamp() - standard.getFirstTimestamp()); + // 最后的时间小于最大展示时间,则不需要滚动条 + int maxDisplay = parent.getObserver().getStandard().getMaxDisplayMillis(); + if (lastTime <= maxDisplay) { + return; + } + // 每次调整位置和长度时,需要更新moveScopeWidth,因为界面可能缩放 + moveScopeWidth = parent.getWidth(); + /* ------- 用户可能把滚动条拖动值中间,然后触发当前方法,所以要计算进度条前面的空白长度来确定滚动条位置 ------- */ + // 计算进度条前面的空白长度 + int startTime = standard.getDisplayRange().getStartTime(); + BigDecimal leftEmptyRatio = divide(startTime, lastTime); + int leftEmptyWidth = multiply(leftEmptyRatio, moveScopeWidth); + // 计算进度条的比例:当前展示时间/本次任务最后的时间 + BigDecimal barRatio = divide(maxDisplay, lastTime); + int barNewWidth = multiply(barRatio, moveScopeWidth); + // 保证宽度不能超过最小值,否则会滚动条会缩小到看不清 + if (barNewWidth < MIN_WIDTH) { + barNewWidth = MIN_WIDTH; + // 保证宽度不能超过最小值后,滚动条的比例和空白的比例已经不一样了,需要重新计算,比例和宽度均减去maxDisplay(barNewWidth) + leftEmptyRatio = divide(startTime, lastTime - maxDisplay); + leftEmptyWidth = multiply(leftEmptyRatio, moveScopeWidth - barNewWidth); + } + bar.setPreferredSize(new Dimension(barNewWidth, BAR_HEIGHT)); + // Chart再刷新时,滚动条一定在最右边,由于上面的运算会丢失精度,会导致滚动条在闪烁,这里做个运算保证滚动条一直在右侧 + if (parent.getObserver().isRefreshing()) { + leftEmptyWidth = moveScopeWidth - barNewWidth; + } + // 更新进度条位置 + bar.setBounds(leftEmptyWidth, 0, barNewWidth, BAR_HEIGHT); + this.repaint(); + this.revalidate(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/ProfilerTimeline.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/ProfilerTimeline.java new file mode 100644 index 000000000..8959faa64 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/ProfilerTimeline.java @@ -0,0 +1,918 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.chart; + +import ohos.devtools.datasources.utils.datahandler.datapoller.MemoryDataConsumer; +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; +import ohos.devtools.views.charts.utils.ChartUtils; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.OperationUtils; +import ohos.devtools.views.common.chart.treetable.AgentDataModel; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.swing.LevelTablePanel; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.ImageIcon; +import javax.swing.JPanel; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Point; +import java.awt.Polygon; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; +import java.math.BigDecimal; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; + +import static ohos.devtools.views.common.ColorConstants.RULER; +import static ohos.devtools.views.common.ColorConstants.TIMELINE_BG; +import static ohos.devtools.views.common.ColorConstants.TIMELINE_SCALE; +import static ohos.devtools.views.common.LayoutConstants.DEVICES_WIDTH; +import static ohos.devtools.views.common.LayoutConstants.LABEL_NAME_WIDTH; +import static ohos.devtools.views.common.ViewConstants.INITIAL_VALUE; +import static ohos.devtools.views.common.ViewConstants.NUM_10; +import static ohos.devtools.views.common.ViewConstants.NUM_1000; +import static ohos.devtools.views.common.ViewConstants.NUM_2; +import static ohos.devtools.views.common.ViewConstants.NUM_5; +import static ohos.devtools.views.common.ViewConstants.NUM_6; +import static ohos.devtools.views.common.ViewConstants.NUM_8; +import static ohos.devtools.views.common.ViewConstants.TIMELINE_FONT_SIZE; +import static ohos.devtools.views.common.ViewConstants.TIMELINE_MARK_COUNTS; +import static ohos.devtools.views.common.ViewConstants.ZOOM_IN_MIN; +import static ohos.devtools.views.common.ViewConstants.ZOOM_OUT_MAX; +import static ohos.devtools.views.common.ViewConstants.ZOOM_TIME; + +/** + * Profiler的时间线组件 + * + * @since 2021/2/1 10:34 + */ +public class ProfilerTimeline extends JPanel implements MouseListener, MouseMotionListener, MouseWheelListener { + private static final Logger LOGGER = LogManager.getLogger(MemoryDataConsumer.class); + + /** + * 最底层面板 + */ + private final ProfilerChartsView bottomPanel; + + /** + * taskScenePanel界面 + */ + private final TaskScenePanelChart taskScenePanelChart; + + private final JPanel jpanelSupen; + + /** + * 时间线上可以展示的最大时间 + */ + private int maxDisplayTime; + + /** + * 时间线刻度线上的最小刻度间隔 + */ + private int minMarkInterval; + + /** + * Timeline的右侧 + */ + private int right; + + /** + * Timeline的顶部 + */ + private int top; + + /** + * 绘图时时间线的起始时间 + */ + private int startTime; + + /** + * 绘图时时间线的结束时间 + */ + private int endTime; + + /** + * 绘制Timeline时的坐标轴X0点 + * + * @see "是日常中绘图习惯的坐标轴X0点,非Swing绘图的坐标轴原点" + */ + private int x0; + + /** + * 绘制Timeline时的坐标轴Y0点 + * + * @see "是日常中绘图习惯的坐标轴Y0点,非Swing绘图的坐标轴原点" + */ + private int y0; + + /** + * 当时间线铺满面板后,绘制刻度时的起始时间偏移量 + */ + private int offsetTime = 0; + + /** + * X轴起始绘图的坐标,因为动态Timeline和Chart从右往左出现 + */ + private int startCoordinate; + + /** + * 每个X轴的时间单位占用的像素数 + */ + private BigDecimal pixelPerTime; + + /** + * 拖拽框选时的锚点,即不动的点 + */ + private int dragAnchorPoint = INITIAL_VALUE; + + /** + * 拖拽框选时的起点 + */ + private int dragStartPoint = INITIAL_VALUE; + + /** + * 拖拽框选时的终点 + */ + private int dragEndPoint = INITIAL_VALUE; + + /** + * 层级Table的Jpanel + */ + private LevelTablePanel levelTablePanel = null; + + private boolean canDragged = true; + + /** + * 是否正在拖拽 + */ + private boolean isDragging = false; + + /** + * 构造函数 + * + * @param bottomPanel 最底层面板 + * @param width 宽 + * @param height 高 + * @param taskScenePanelChart taskScenePanelChart + */ + public ProfilerTimeline(ProfilerChartsView bottomPanel, int width, int height, + TaskScenePanelChart taskScenePanelChart) { + this.taskScenePanelChart = taskScenePanelChart; + this.jpanelSupen = taskScenePanelChart.getJpanelSupen(); + this.bottomPanel = bottomPanel; + this.setPreferredSize(new Dimension(width, height)); + this.addMouseListener(this); + this.addMouseMotionListener(this); + this.addMouseWheelListener(this); + this.setBackground(TIMELINE_BG); + jpanelSupen.setBackground(ColorConstants.TRACE_TABLE_COLOR); + jpanelSupen.setOpaque(true); + } + + /** + * paintComponent + * + * @param graphics graphics + */ + @Override + protected void paintComponent(Graphics graphics) { + super.paintComponent(graphics); + // 初始化坐标和比例尺等信息 + initPoint(); + // 绘制时间线坐标轴 + drawAxis(graphics); + // 绘制框选时的时间线上的倒三角 + drawSelectedMark(graphics); + // 更新标尺的坐标点 + updateRulerPoint(); + // 把当前组件标记为已绘制,刷新其他组件的标尺(Timeline上默认不显示标尺,只是标尺会跟随Timeline上的鼠标移动) + this.bottomPanel.compRulerDrawn(this); + this.bottomPanel.refreshCompRuler(); + } + + /** + * 初始化坐标和比例尺等信息 + */ + private void initPoint() { + // 确定绘制出的坐标轴的原点 + x0 = this.getX(); + right = x0 + this.getWidth(); + top = this.getY(); + y0 = top + this.getHeight() - 1; + if (right == 0 || maxDisplayTime == 0) { + return; + } + // 计算出1个时间单位多少像素 + pixelPerTime = OperationUtils.divide(right, maxDisplayTime); + // 如果当前时间大于最大时间,要计算偏移量 + if (endTime > maxDisplayTime && minMarkInterval != 0) { + startCoordinate = x0; + // 判断是否有偏移时间 + if (endTime % minMarkInterval == 0) { + offsetTime = 0; + } else { + // 如果当前时间和minMarkInterval取余不为0,则计算偏移量:最小间隔 - 当前时间 % 最小间隔 + offsetTime = minMarkInterval - endTime % minMarkInterval; + } + } else { + // 如果当前时间小于最大时间,则需要从中间绘制时间轴,偏移量为0 + offsetTime = 0; + startCoordinate = x0 + right - OperationUtils.multiply(pixelPerTime, endTime); + } + } + + /** + * 绘制时间线的坐标轴 + * + * @param graphics Graphics + */ + private void drawAxis(Graphics graphics) { + graphics.setColor(TIMELINE_SCALE); + // 绘制Timeline左侧的竖线 + graphics.drawLine(x0, top, x0, y0); + // 绘制Timeline的横线 + graphics.drawLine(x0, y0, right, y0); + // 时间轴是否绘满界面 + boolean flag = endTime > maxDisplayTime; + // 从offsetTime开始绘制时间线(其实是画刻度),绘制时间范围其实也是从0到max + for (int drawTime = offsetTime; drawTime <= maxDisplayTime; drawTime += this.minMarkInterval) { + int x = startCoordinate + ChartUtils.multiply(pixelPerTime, drawTime); + // 计算出实际要展示的时间 + int showTime; + if (flag) { + showTime = startTime + drawTime; + } else { + showTime = drawTime; + } + double result = (showTime / this.minMarkInterval) % TIMELINE_MARK_COUNTS; + // 每隔N个minMarkInterval绘制坐标轴数字和大刻度 + if (result == 0) { + // 绘制长刻度 + graphics.setColor(TIMELINE_SCALE); + graphics.drawLine(x, y0, x, top); + graphics.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, TIMELINE_FONT_SIZE)); + // 转换后的时间 + String str = millisecondToTime(showTime); + graphics.setColor(RULER); + graphics.drawString(str, x + NUM_5, y0 - NUM_10); + } else { + graphics.setColor(TIMELINE_SCALE); + graphics.drawLine(x, top, x, top + NUM_6); + } + } + } + + /** + * 绘制时间线的坐标数字 + * + * @param time time + * @return String + */ + private String millisecondToTime(int time) { + String timeStr; + int hour; + int minute; + int second; + int millisecond; + int num60 = NUM_6 * NUM_10; + if (time <= 0) { + return "0s"; + } else { + second = time / NUM_1000; + minute = second / num60; + millisecond = time % NUM_1000; + if (second < num60) { + timeStr = secondFormat(second) + "." + millisecondFormat(millisecond) + "s"; + } else if (minute < num60) { + second = second % num60; + timeStr = + secondFormat(minute) + ":" + secondFormat(second) + "." + millisecondFormat(millisecond) + "s"; + } else { + hour = minute / num60; + minute = minute % num60; + int num3600 = num60 * num60; + second = second - hour * num3600 - minute * num60; + timeStr = secondFormat(hour) + ":" + secondFormat(minute) + ":" + secondFormat(second) + "." + + millisecondFormat(millisecond) + "s"; + } + } + return timeStr; + } + + /** + * 时分秒的格式转换 + * + * @param secondTime secondTime + * @return String + */ + private String secondFormat(int secondTime) { + String retStr; + if (secondTime == 0) { + retStr = "00"; + } else if (secondTime > 0 && secondTime < NUM_10) { + retStr = Integer.toString(secondTime); + } else { + retStr = "" + secondTime; + } + return retStr; + } + + /** + * 毫秒的格式转换 + * + * @param millisecondTime millisecondTime + * @return String + */ + private String millisecondFormat(int millisecondTime) { + String retStr; + if (millisecondTime == 0) { + retStr = "000"; + } else if (millisecondTime > 0 && millisecondTime < NUM_10) { + retStr = Integer.toString(millisecondTime); + } else if (millisecondTime >= NUM_10 && millisecondTime < NUM_10 * NUM_10) { + retStr = Integer.toString(millisecondTime); + } else { + retStr = "" + millisecondTime; + } + return retStr; + } + + /** + * 绘制Timeline框选的标记 + * + * @param graphics Graphics + */ + private void drawSelectedMark(Graphics graphics) { + ChartDataRange selectedRange = this.bottomPanel.getObserver().getStandard().getSelectedRange(); + if (selectedRange == null) { + return; + } + if (selectedRange.getStartTime() != Integer.MIN_VALUE) { + int selectStartX = + startCoordinate + OperationUtils.multiply(pixelPerTime, selectedRange.getStartTime() - startTime); + drawInvertedTriangle(selectStartX, graphics); + } + if (selectedRange.getEndTime() != Integer.MAX_VALUE) { + int selectEndX = + startCoordinate + OperationUtils.multiply(pixelPerTime, selectedRange.getEndTime() - startTime); + drawInvertedTriangle(selectEndX, graphics); + } + } + + /** + * 画一个倒三角形 + * + * @param bottomVertexX 倒三角形下方的顶点 + * @param graphics Graphics + */ + private void drawInvertedTriangle(int bottomVertexX, Graphics graphics) { + // 创建一个多边形对象 + Polygon polygon = new Polygon(); + polygon.addPoint(bottomVertexX, y0); + polygon.addPoint(bottomVertexX - NUM_5, y0 - NUM_5); + polygon.addPoint(bottomVertexX + NUM_5, y0 - NUM_5); + polygon.addPoint(bottomVertexX, y0); + graphics.fillPolygon(polygon); + } + + /** + * 更新标尺的坐标点 + */ + private void updateRulerPoint() { + // Timeline上不画标尺,但是鼠标移动时,要更新坐标点,通知其他组件绘制标尺 + Point mousePoint = getMousePosition(); + if (mousePoint != null) { + this.bottomPanel.setRulerXCoordinate((int) mousePoint.getX()); + } + } + + /** + * mouseClicked + * + * @param mouseEvent mouseEvent + */ + @Override + public void mouseClicked(MouseEvent mouseEvent) { + // 鼠标点击事件,单击后停止刷新数据,等待用户框选数据 + int button = mouseEvent.getButton(); + int mouseX = mouseEvent.getX(); + // 如果左键点击的点小于起始点,则不更新 + if (button == MouseEvent.BUTTON1 && mouseX < startCoordinate) { + return; + } + // 目前仅左键单击触发框选场景 + if (button == MouseEvent.BUTTON1) { + this.setCursor(new Cursor(Cursor.E_RESIZE_CURSOR)); + // start和end同时更新 + mouseLeftClick(mouseX); + } else { + // 右键取消选择,清空框选范围 + this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + mouseRightClick(); + } + // 鼠标点击后,也需要组件的标尺需要重新绘制(主要是将Chart绘制为半透明状态) + this.bottomPanel.resetRulerDrawStatus(); + } + + private void mouseLeftClick(int mouseX) { + dragStartPoint = mouseX; + dragEndPoint = mouseX; + this.bottomPanel.getObserver().getStandard().updateSelectedStart(getTimeByMouseX(mouseX)); + this.bottomPanel.getObserver().getStandard().updateSelectedEnd(getTimeByMouseX(mouseX)); + checkLevelTablePanel(); + // 停止刷新数据,手动刷新界面,否则界面不会变暗 + doNotifyRefresh(bottomPanel.isChartLevel()); + bottomPanel.setAbleUnfoldTable(true); + // 增加chart点击和暂停开始按钮的事件联动 + // 修改OhosProfiler应用任务停止后连续左击和右击时间线时“暂停/恢复”按钮会相应变化 + if (!bottomPanel.isStopFlag()) { + taskScenePanelChart.getjButtonStop() + .setIcon(new ImageIcon(ProfilerTimeline.class.getClassLoader().getResource("images/suspended.png"))); + } + if (!bottomPanel.isFlagDown() && bottomPanel.isChartLevel()) { + taskScenePanelChart.getjButtonBottom().setIcon( + new ImageIcon(ProfilerTimeline.class.getClassLoader().getResource("images/button_bottom_bar.png"))); + } + } + + private void checkLevelTablePanel() { + if (levelTablePanel == null) { + long sessionId = this.bottomPanel.getSessionId(); + levelTablePanel = new LevelTablePanel(jpanelSupen, sessionId); + levelTablePanel.setPreferredSize(new Dimension(DEVICES_WIDTH, LABEL_NAME_WIDTH)); + } + } + + void mouseRightClick() { + dragStartPoint = INITIAL_VALUE; + dragEndPoint = INITIAL_VALUE; + this.bottomPanel.getObserver().getStandard().clearSelectedRange(); + removeTablePanel(); + // 恢复刷新数据 + this.bottomPanel.getObserver().restartRefresh(); + bottomPanel.setAbleUnfoldTable(false); + // 修改OhosProfiler应用任务停止后连续左击和右击时间线时“暂停/恢复”按钮会相应变化 + if (!bottomPanel.isStopFlag()) { + taskScenePanelChart.getjButtonStop() + .setIcon(new ImageIcon(ProfilerTimeline.class.getClassLoader().getResource("images/button_stop.png"))); + } + taskScenePanelChart.getjButtonBottom().setIcon( + new ImageIcon(ProfilerTimeline.class.getClassLoader().getResource("images/button_bottom_bar_grey.png"))); + bottomPanel.setFlagDown(false); + // 手动刷新界面,否则界面不会变亮 + ChartDataRange range = bottomPanel.getObserver().getStandard().getDisplayRange(); + bottomPanel.getObserver().notifyRefresh(range.getStartTime(), range.getEndTime()); + } + + /** + * 鼠标左键点击事件 + */ + public void addTablePanel() { + checkLevelTablePanel(); + this.bottomPanel.add(levelTablePanel, BorderLayout.SOUTH); + this.bottomPanel.setFlagDown(false); + } + + /** + * 鼠标右键点击事件 + */ + public void removeTablePanel() { + if (levelTablePanel != null) { + // 点击右键去除层级table + this.bottomPanel.remove(levelTablePanel); + levelTablePanel = null; + } + jpanelSupen.setVisible(false); + this.bottomPanel.setFlagDown(true); + } + + /** + * doNotifyRefresh 停止刷新数据,手动刷新界面,否则界面不会变暗 + * + * @param secondFlag secondFlag + */ + private void doNotifyRefresh(boolean secondFlag) { + if (secondFlag) { + this.bottomPanel.add(levelTablePanel, BorderLayout.SOUTH); + this.bottomPanel.setFlagDown(false); + } + // 停止刷新数据 + this.bottomPanel.getObserver().pauseRefresh(); + // 手动刷新界面,否则界面不会变暗 + ChartDataRange range = bottomPanel.getObserver().getStandard().getDisplayRange(); + bottomPanel.getObserver().notifyRefresh(range.getStartTime(), range.getEndTime()); + } + + /** + * 通过鼠标的X坐标,计算当前坐标对应的Timeline的X轴时间 + * + * @param mouseX 鼠标的X坐标 + * @return 对应的Timeline的X轴时间 + * @see "注意这里算出来的时间,Timeline的X轴上对应的时间,这个时间点不一定在绘制Chart的dataMap的keyset里, + *

+ * 有可能是出于某2个值中间,使用时需要找到与dataMap的keyset最接近的值" + */ + private int getTimeByMouseX(int mouseX) { + // 计算公式为:鼠标上对应的时间 = (鼠标X坐标 - 绘制Chart的X起始坐标) / X轴1个单位对应的像素数 + 起始时间 + return OperationUtils.divide(mouseX - startCoordinate, pixelPerTime) + startTime; + } + + /** + * 通过时间,计算当前时间对应的Timeline的X轴坐标 + * + * @param time 当前时间 + * @return 对应的Timeline的X轴坐标值 + */ + private int getPointXByTime(int time) { + // 计算公式为:鼠标上对应的坐标 = X轴1个单位对应的像素数 * (当前时间 - 绘制Chart的X起始时间) + 绘制Chart的X起始坐标 + return OperationUtils.multiply(pixelPerTime, time - startTime) + startCoordinate; + } + + /** + * 鼠标按下事件 + * + * @param mouseEvent MouseEvent + * @see "drag之前会先触发一次press,press时就可以确定拖拽时的锚点(即拖拽时不动的那一条竖线标尺)" + */ + @Override + public void mousePressed(MouseEvent mouseEvent) { + ChartDataRange selectedRange = this.bottomPanel.getObserver().getStandard().getSelectedRange(); + int mouseX = mouseEvent.getX(); + // dragStartPoint在滚动条拖动后 数值可能发生了变化 优化: 将最后框选的时间确定下来 不按照坐标去得到dragStartPoint,而是按照最后框选 + // 时刻的时间作为标准 只是在最终将标准时间又转为坐标去判断 + if (selectedRange != null) { + dragStartPoint = getPointXByTime(selectedRange.getStartTime()); + dragEndPoint = getPointXByTime(selectedRange.getEndTime()); + } + // selectedRange为null,说明是没有click,直接开始拖拽,暂时不考虑这种场景 + if (Math.abs(mouseX - dragStartPoint) > NUM_10 && Math.abs(mouseX - dragEndPoint) > NUM_10) { + canDragged = false; + } + if (selectedRange == null) { + return; + } + boolean isCloseToStart = Math.abs(mouseX - dragStartPoint) < NUM_10; + boolean isCloseToEnd = Math.abs(mouseX - dragEndPoint) < NUM_10; + + if (isCloseToStart) { + dragAnchorPoint = dragEndPoint; + canDragged = true; + } + if (isCloseToEnd) { + dragAnchorPoint = dragStartPoint; + canDragged = true; + } + } + + /** + * mouseReleased + * + * @param mouseEvent mouseEvent + */ + @Override + public void mouseReleased(MouseEvent mouseEvent) { + // 非左键的release事件不处理 + if (mouseEvent.getButton() != MouseEvent.BUTTON1) { + return; + } + /* + * 拖拽的触发顺序为:press -> drag -> release,而点击为:press -> release -> click + * 拖拽时SelectRange在drag步骤更新,所以release时拿到的range是更新后的 + * 点击时SelectRange在click步骤更新,release时还未更新,所以这里需要手动set一下 ↓↓↓ + */ + if (!isDragging) { + int mouseX = mouseEvent.getX(); + this.bottomPanel.getObserver().getStandard().updateSelectedStart(getTimeByMouseX(mouseX)); + this.bottomPanel.getObserver().getStandard().updateSelectedEnd(getTimeByMouseX(mouseX)); + } + if (bottomPanel.isChartLevel()) { + new SwingWorker() { + @Override + protected AgentDataModel doInBackground() { + // treeTable这时还未初始化完成,这里等待一下 + while (levelTablePanel == null || levelTablePanel.getTreeTable() == null) { + try { + TimeUnit.MILLISECONDS.sleep(10); + } catch (InterruptedException exception) { + LOGGER.error("Drag swing work done error."); + } + } + long sessionId = bottomPanel.getSessionId(); + return levelTablePanel.getTreeDataModel(sessionId); + } + + @Override + protected void done() { + try { + AgentDataModel model = get(); + if (model == null) { + return; + } + if (levelTablePanel == null || levelTablePanel.getTreeTable() == null) { + return; + } + levelTablePanel.getTreeTable().setTreeTableModel(model); + } catch (InterruptedException | ExecutionException | NullPointerException exception) { + LOGGER.error("Drag swing work done error.", exception); + } + } + }.execute(); + } + isDragging = false; + } + + /** + * mouseEntered + * + * @param mouseEvent mouseEvent + */ + @Override + public void mouseEntered(MouseEvent mouseEvent) { + // 当前组件需要绘制标尺,鼠标进入,则更新底层父级panel的currentEntered + this.bottomPanel.setCurrentEntered(this); + } + + /** + * mouseExited + * + * @param mouseEvent mouseEvent + */ + @Override + public void mouseExited(MouseEvent mouseEvent) { + // 当前组件需要绘制标尺,鼠标退出,则更新底层父级panel的currentEntered为null + this.bottomPanel.setCurrentEntered(null); + // 这里需要手动调用重绘一下所有Panel,否则会残留有之前的ruler + this.bottomPanel.resetRulerDrawStatus(); + this.bottomPanel.refreshCompRuler(); + } + + /** + * mouseDragged + * + * @param mouseEvent mouseEvent + */ + @Override + public void mouseDragged(MouseEvent mouseEvent) { + isDragging = true; + ChartDataRange selectedRange = this.bottomPanel.getObserver().getStandard().getSelectedRange(); + if (selectedRange == null || !canDragged) { + return; + } + int mouseX = mouseEvent.getX(); + if (mouseX > dragAnchorPoint) { + // 鼠标位置大于锚点位置,说明是在锚点右侧拖拽,更新end为鼠标的点即可 + dragEndPoint = mouseX; + if (dragAnchorPoint != INITIAL_VALUE) { + dragStartPoint = dragAnchorPoint; + this.bottomPanel.getObserver().getStandard().updateSelectedStart(getTimeByMouseX(dragAnchorPoint)); + } + this.bottomPanel.getObserver().getStandard().updateSelectedEnd(getTimeByMouseX(mouseX)); + } else { + // 鼠标位置小于锚点位置,说明是在锚点左侧拖拽,则更新end为锚点,start为鼠标的点 + dragStartPoint = mouseX; + if (dragAnchorPoint != INITIAL_VALUE) { + dragEndPoint = dragAnchorPoint; + this.bottomPanel.getObserver().getStandard().updateSelectedEnd(getTimeByMouseX(dragAnchorPoint)); + } + this.bottomPanel.getObserver().getStandard().updateSelectedStart(getTimeByMouseX(mouseX)); + } + // 鼠标移动,则所有组件的标尺需要重新绘制 + this.bottomPanel.resetRulerDrawStatus(); + // 如果鼠标在框选的标尺附近,样式要变为可拉伸 + checkCursorStyle(mouseEvent.getX(), mouseEvent.getY()); + this.repaint(); + this.revalidate(); + } + + /** + * mouseMoved + * + * @param mouseEvent mouseEvent + */ + @Override + public void mouseMoved(MouseEvent mouseEvent) { + // 鼠标移动,则所有组件的标尺需要重新绘制 + this.bottomPanel.resetRulerDrawStatus(); + // 如果鼠标在框选的标尺附近,样式要变为可拉伸 + checkCursorStyle(mouseEvent.getX(), mouseEvent.getY()); + this.repaint(); + this.revalidate(); + } + + /** + * mouseWheelMoved + * + * @param mouseWheelEvent mouseWheelEvent + */ + @Override + public void mouseWheelMoved(MouseWheelEvent mouseWheelEvent) { + if (true) { + return; + } + ChartDataRange zoomRange = this.bottomPanel.getObserver().getStandard().getDisplayRange(); + if (zoomRange == null || startTime == 0) { + return; + } + // 缩放的char动静判断 + boolean moveDecide = false; + // 缩放前的的开始和结束时间 + int startTimed = zoomRange.getStartTime(); + int endTimed = zoomRange.getEndTime(); + // 计算x轴缩放前显示的时间长度 + int lengthX = endTimed - startTimed; + // 计算比例尺 + BigDecimal divide = OperationUtils.divide(lengthX, maxDisplayTime); + // 是否允许缩放的判断 + boolean zoomAllow = true; + // 缩放的判断 + int zoomDecide = mouseWheelEvent.getWheelRotation(); + if (zoomDecide == 1) { + moveDecide = true; + if (maxDisplayTime < ZOOM_IN_MIN) { + zoomAllow = false; + } + if (zoomAllow) { + // zoomIn向后放大 放大增加判断:放大到一定程度玖不能放大了 + maxDisplayTime = maxDisplayTime - ZOOM_TIME; + } + } else if (-zoomDecide == 1) { + moveDecide = false; + if (maxDisplayTime > ZOOM_OUT_MAX) { + zoomAllow = false; + } + if (zoomAllow) { + // zoomOut 向前缩小 缩小增加判断:缩小到一定程度玖不能放大了 + maxDisplayTime = maxDisplayTime + ZOOM_TIME; + } + } else { + zoomAllow = false; + } + // x轴缩放后的总时间 之后计算鼠标落点的比例 + int multiply = OperationUtils.multiply(divide, maxDisplayTime); + // 缩放的增减时间长度 + int changeLength = OperationUtils.divideInt(multiply - lengthX, NUM_2); + // 调用界面刷新 + zoomRefresh(changeLength, startTimed, endTimed, moveDecide, zoomDecide); + } + + /** + * 根据鼠标的坐标,更新鼠标样式 + * + * @param changeLength 改变的刻度值 + * @param startTimed 新的开始时间 + * @param endTimed 新的结束时间 + * @param moveDecide 是否可以缩放判断 + * @param zoomDecide 滚轮缩放的程度值 + */ + private void zoomRefresh(int changeLength, int startTimed, int endTimed, boolean moveDecide, int zoomDecide) { + // 缩放后的起始和结束时间 + int newStartTime = 0; + int newEndTime = 0; + // 根据缩放选择获取开始结束时间 + if (zoomDecide == 1) { + // 放大后的起始和结束时间 + newStartTime = startTimed - changeLength; + newEndTime = endTimed + changeLength; + + } else if (-zoomDecide == 1) { + // 缩小后的起始和结束时间 + newStartTime = startTimed + changeLength; + newEndTime = endTimed - changeLength; + } else { + newStartTime = startTimed; + newEndTime = endTimed; + } + ChartStandard standard = this.bottomPanel.getObserver().getStandard(); + int currentTime = (int) (standard.getLastTimestamp() - standard.getFirstTimestamp()); + // 当前展示的时间大于最大展示时间,则不刷新 + int maxDisplay = this.bottomPanel.getObserver().getStandard().getMaxDisplayMillis(); + if (currentTime <= maxDisplay) { + return; + } + // 缩放变化放入观察者去刷新 + this.bottomPanel.getObserver().charZoom(newStartTime, newEndTime, maxDisplayTime); + if (moveDecide) { + // 调用观察者的停止刷新方法 + this.bottomPanel.getObserver().stopRefresh(false); + } else { + // 恢复刷新数据 + this.bottomPanel.getObserver().restartRefresh(); + } + // 调用重绘方法 + this.repaint(); + this.revalidate(); + } + + /** + * 根据鼠标的坐标,更新鼠标样式 + * + * @param crtMouseX 鼠标X轴坐标 + * @param crtMouseY 鼠标Y轴坐标 + */ + private void checkCursorStyle(int crtMouseX, int crtMouseY) { + ChartDataRange selectedRange = this.bottomPanel.getObserver().getStandard().getSelectedRange(); + if (selectedRange == null) { + return; + } + // Y轴是否也接近倒三角的标记点 + boolean isCloseToCoordinateY = Math.abs(this.getHeight() - crtMouseY) < NUM_8; + int selectStart = + startCoordinate + OperationUtils.multiply(pixelPerTime, selectedRange.getStartTime() - startTime); + int selectEnd = startCoordinate + OperationUtils.multiply(pixelPerTime, selectedRange.getEndTime() - startTime); + // X轴和Y轴坐标,都靠近倒三角的标记点时,鼠标变为resize状态 + if (Math.abs(selectStart - crtMouseX) < NUM_5 && isCloseToCoordinateY) { + this.setCursor(new Cursor(Cursor.W_RESIZE_CURSOR)); + } else if (Math.abs(selectEnd - crtMouseX) < NUM_5 && isCloseToCoordinateY) { + this.setCursor(new Cursor(Cursor.E_RESIZE_CURSOR)); + } else { + this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + } + } + + /** + * setMaxDisplayTime + * + * @param maxDisplayTime maxDisplayTime + */ + public void setMaxDisplayTime(int maxDisplayTime) { + this.maxDisplayTime = maxDisplayTime; + } + + /** + * setMinMarkInterval + * + * @param minMarkInterval minMarkInterval + */ + public void setMinMarkInterval(int minMarkInterval) { + this.minMarkInterval = minMarkInterval; + } + + /** + * getStartTime + * + * @return int + */ + public int getStartTime() { + return startTime; + } + + /** + * setStartTime + * + * @param startTime startTime + */ + public void setStartTime(int startTime) { + this.startTime = startTime; + } + + /** + * getEndTime + * + * @return int + */ + public int getEndTime() { + return endTime; + } + + /** + * setEndTime + * + * @param endTime endTime + */ + public void setEndTime(int endTime) { + this.endTime = endTime; + } + + /** + * getLevelTablePanel + * + * @return LevelTablePanel + */ + public LevelTablePanel getLevelTablePanel() { + return levelTablePanel; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/AgentDataModel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/AgentDataModel.java new file mode 100644 index 000000000..fc83f109c --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/AgentDataModel.java @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.chart.treetable; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.event.EventListenerList; +import javax.swing.event.TreeModelListener; +import javax.swing.tree.TreePath; + +import static ohos.devtools.views.common.LayoutConstants.NEGATIVE_ONE; +import static ohos.devtools.views.common.LayoutConstants.NUM_0; +import static ohos.devtools.views.common.LayoutConstants.NUM_1; +import static ohos.devtools.views.common.LayoutConstants.NUM_2; +import static ohos.devtools.views.common.LayoutConstants.NUM_3; +import static ohos.devtools.views.common.LayoutConstants.NUM_4; + +/** + * agentDataModel class. + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class AgentDataModel implements TreeTableModel { + private static final Logger LOGGER = LogManager.getLogger(AgentDataModel.class); + + /** + * Names of the columns. + */ + protected static String[] cNames = {"Class Name", "Allocations", "Deallocations", "Total Count", "Shallow Size"}; + + /** + * cTypes Types of the columns. + */ + protected static Class[] cTypes = {TreeTableModel.class, Integer.class, Integer.class, Integer.class, Long.class}; + + /** + * listenerList + */ + protected EventListenerList listenerList = new EventListenerList(); + + private DataNode dataNode; + + /** + * FileSystemModel + * + * @param dataNode dataNode + */ + public AgentDataModel(DataNode dataNode) { + this.dataNode = dataNode; + } + + /** + * getDataNode + * + * @return DataNode + */ + public DataNode getDataNode() { + return dataNode; + } + + /** + * getClassObject + * + * @param node node + * @return DataNode + */ + protected DataNode getClassObject(Object node) { + return (DataNode) node; + } + + /** + * getChildren + * + * @param node node + * @return Object[] + */ + protected Object[] getChildren(Object node) { + DataNode digitalNode = null; + if (node instanceof DataNode) { + digitalNode = (DataNode) node; + } + if (digitalNode == null) { + return new DataNode[0]; + } + if (digitalNode.getChildren() != null) { + return digitalNode.getChildren().toArray(); + } else { + return new DataNode[0]; + } + } + + /** + * 获取子节点数量 + * + * @param node node + * @return int + */ + public int getChildCount(Object node) { + Object[] children = getChildren(node); + return (children == null) ? 0 : children.length; + } + + /** + * getRootNode + * + * @return dataNode dataNode + */ + @Override + public Object getRoot() { + return dataNode; + } + + /** + * 获取子节点 + * + * @param node node + * @param number number + * @return Object + */ + public Object getChild(Object node, int number) { + return getChildren(node)[number]; + } + + /** + * isLeaf + * + * @param node node + * @return boolean + */ + public boolean isLeaf(Object node) { + return getChildCount(node) <= 0; + } + + /** + * valueForPathChanged Not implemented + * + * @param path path + * @param newValue newValue + */ + @Override + public void valueForPathChanged(TreePath path, Object newValue) { + } + + /** + * 获取子节点序列 + * + * @param parent parent + * @param child child + * @return int + */ + @Override + public int getIndexOfChild(Object parent, Object child) { + for (int index = 0; index < getChildCount(parent); index++) { + if (getChild(parent, index).equals(child)) { + return index; + } + } + return NEGATIVE_ONE; + } + + /** + * addTreeModelListener + * + * @param listener listener + */ + @Override + public void addTreeModelListener(TreeModelListener listener) { + listenerList.add(TreeModelListener.class, listener); + } + + /** + * removeTreeModelListener + * + * @param listener listener + */ + @Override + public void removeTreeModelListener(TreeModelListener listener) { + listenerList.remove(TreeModelListener.class, listener); + } + + /** + * getColumnCount + * + * @return int + */ + public int getColumnCount() { + return cNames.length; + } + + /** + * 获取列名 + * + * @param column column + * @return String + */ + public String getColumnName(int column) { + return cNames[column]; + } + + /** + * getColumnClass + * + * @param column column + * @return Class + */ + public Class getColumnClass(int column) { + return cTypes[column]; + } + + /** + * 获取数据 + * + * @param node node + * @param column column + * @return Object + */ + public Object getValueAt(Object node, int column) { + Object object = null; + DataNode digitalNode = getClassObject(node); + try { + switch (column) { + case NUM_0: + object = digitalNode.getClassName(); + break; + case NUM_1: + object = digitalNode.getAllocations(); + break; + case NUM_2: + object = digitalNode.getDeallocations(); + break; + case NUM_3: + object = digitalNode.getTotalCount(); + break; + case NUM_4: + object = digitalNode.getShallowSize(); + break; + default: + break; + } + } catch (SecurityException exception) { + LOGGER.error("SecurityException error: {}", exception.getMessage()); + } + return object; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/DataNode.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/DataNode.java new file mode 100644 index 000000000..c95887c16 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/DataNode.java @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.chart.treetable; + +import java.util.ArrayList; +import java.util.Objects; + +/** + * DataNode + * + * @version 1.0 + * @date 2021/03/15 10:07 + **/ +public class DataNode { + private Integer id; + private Integer cId; + private Integer heapId; + private Long sessionId; + private String className; + private Integer allocations; + private Integer deallocations; + private Integer totalCount; + private Long shallowSize; + ArrayList children; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getcId() { + return cId; + } + + public void setcId(Integer cId) { + this.cId = cId; + } + + public Integer getHeapId() { + return heapId; + } + + public void setHeapId(Integer heapId) { + this.heapId = heapId; + } + + public Long getSessionId() { + return sessionId; + } + + public void setSessionId(Long sessionId) { + this.sessionId = sessionId; + } + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public Integer getAllocations() { + return allocations; + } + + public void setAllocations(Integer allocations) { + this.allocations = allocations; + } + + public Integer getDeallocations() { + return deallocations; + } + + public void setDeallocations(Integer deallocations) { + this.deallocations = deallocations; + } + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public Long getShallowSize() { + return shallowSize; + } + + public void setShallowSize(Long shallowSize) { + this.shallowSize = shallowSize; + } + + public ArrayList getChildren() { + return children; + } + + public void setChildren(ArrayList children) { + this.children = children; + } + + /** + * addChildren + * + * @param children children + */ + public void addChildren(DataNode children) { + if (this.children == null) { + this.children = new ArrayList(); + } + this.children.add(children); + } + + @Override + public boolean equals(Object object) { + if (this == object) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + + DataNode dataNode = null; + if (object instanceof DataNode) { + dataNode = (DataNode) object; + } + return Objects.equals(id, dataNode.id) && Objects.equals(cId, dataNode.cId) && Objects + .equals(heapId, dataNode.heapId) && Objects.equals(sessionId, dataNode.sessionId) && Objects + .equals(className, dataNode.className) && Objects.equals(allocations, dataNode.allocations) && Objects + .equals(deallocations, dataNode.deallocations) && Objects.equals(totalCount, dataNode.totalCount) && Objects + .equals(shallowSize, dataNode.shallowSize) && Objects.equals(children, dataNode.children); + } + + @Override + public int hashCode() { + return Objects + .hash(id, cId, heapId, sessionId, className, allocations, deallocations, totalCount, shallowSize, children); + } + + /** + * toStr + * + * @return String + */ + public String toStr() { + return className + ',' + allocations + ',' + deallocations + ',' + totalCount + ',' + shallowSize; + } + + @Override + public String toString() { + return className; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/DataNodeCompares.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/DataNodeCompares.java new file mode 100644 index 000000000..ca5148941 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/DataNodeCompares.java @@ -0,0 +1,306 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.chart.treetable; + +import java.util.Comparator; + +import static ohos.devtools.views.common.LayoutConstants.ASC; + +/** + * @Description dataPoller回调类 + * @Date 2021/4/20 13:30 + **/ +public class DataNodeCompares { + /** + * classNameString + */ + public static Comparator classNameString = new Comparator() { + @Override + public int compare(String o1, String o2) { + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return -1; + } + if (o2 == null) { + return 1; + } + int res = o1.compareTo(o2); + if (res == 0) { + return 0; + } + return res > 0 ? 1 : -1; + } + }; + + private static Comparator classNameCompareDsc = new Comparator() { + @Override + public int compare(DataNode o1, DataNode o2) { + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return -1; + } + if (o2 == null) { + return 1; + } + int res = o1.getClassName().compareTo(o2.getClassName()); + if (res == 0) { + return 0; + } + return res < 0 ? 1 : -1; + } + }; + + private static Comparator shallowSizeCompareAsc = new Comparator() { + @Override + public int compare(DataNode o1, DataNode o2) { + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return -1; + } + if (o2 == null) { + return 1; + } + long res = o1.getShallowSize() - o2.getShallowSize(); + if (res == 0) { + return 0; + } + return res > 0 ? 1 : -1; + } + }; + + private static Comparator shallowSizeCompareDsc = new Comparator() { + @Override + public int compare(DataNode o1, DataNode o2) { + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return 1; + } + if (o2 == null) { + return -1; + } + long res = o1.getShallowSize() - o2.getShallowSize(); + if (res == 0) { + return 0; + } + return res < 0 ? 1 : -1; + } + }; + + private static Comparator totalCompareAsc = new Comparator() { + @Override + public int compare(DataNode o1, DataNode o2) { + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return -1; + } + if (o2 == null) { + return 1; + } + int res = o1.getTotalCount() - o2.getTotalCount(); + if (res == 0) { + return 0; + } + return res > 0 ? 1 : -1; + } + }; + + private static Comparator totalCompareDsc = new Comparator() { + @Override + public int compare(DataNode o1, DataNode o2) { + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return 1; + } + if (o2 == null) { + return -1; + } + int res = o1.getTotalCount() - o2.getTotalCount(); + if (res == 0) { + return 0; + } + return res < 0 ? 1 : -1; + } + }; + + private static Comparator allocationsCompareAsc = new Comparator() { + @Override + public int compare(DataNode o1, DataNode o2) { + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return -1; + } + if (o2 == null) { + return 1; + } + int res = o1.getAllocations() - o2.getAllocations(); + if (res == 0) { + return 0; + } + return res > 0 ? 1 : -1; + } + }; + + private static Comparator allocationsCompareDsc = new Comparator() { + @Override + public int compare(DataNode o1, DataNode o2) { + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return 1; + } + if (o2 == null) { + return -1; + } + int res = o1.getAllocations() - o2.getAllocations(); + if (res == 0) { + return 0; + } + return res < 0 ? 1 : -1; + } + }; + + private static Comparator deallocationsCompareAsc = new Comparator() { + @Override + public int compare(DataNode o1, DataNode o2) { + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return -1; + } + if (o2 == null) { + return 1; + } + int res = o1.getDeallocations() - o2.getDeallocations(); + if (res == 0) { + return 0; + } + return res > 0 ? 1 : -1; + } + }; + + private static Comparator deallocationsCompareDsc = new Comparator() { + @Override + public int compare(DataNode o1, DataNode o2) { + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return 1; + } + if (o2 == null) { + return -1; + } + int res = o1.getDeallocations() - o2.getDeallocations(); + if (res == 0) { + return 0; + } + return res < 0 ? 1 : -1; + } + }; + + /** + * classNameCompareAsc + */ + private Comparator classNameCompareAsc = new Comparator() { + @Override + public int compare(DataNode o1, DataNode o2) { + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return -1; + } + if (o2 == null) { + return 1; + } + int res = o1.getClassName().compareTo(o2.getClassName()); + if (res == 0) { + return 0; + } + return res > 0 ? 1 : -1; + } + }; + + /** + * 选择出比较器 + * + * @param keyColumn keyColumn + * @param sortOrder sortOrder + * @return Comparator + */ + public Comparator chooseCompare(int keyColumn, String sortOrder) { + Comparator comparator = null; + if (ASC.equals(sortOrder)) { + switch (keyColumn) { + case 0: + comparator = classNameCompareAsc; + break; + case 1: + comparator = allocationsCompareAsc; + break; + case 2: + comparator = deallocationsCompareAsc; + break; + case 3: + comparator = totalCompareAsc; + break; + case 4: + comparator = shallowSizeCompareAsc; + break; + default: + break; + } + } else { + switch (keyColumn) { + case 0: + comparator = classNameCompareDsc; + break; + case 1: + comparator = allocationsCompareDsc; + break; + case 2: + comparator = deallocationsCompareDsc; + break; + case 3: + comparator = totalCompareDsc; + break; + case 4: + comparator = shallowSizeCompareDsc; + break; + default: + break; + } + } + return comparator; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/JTreeTable.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/JTreeTable.java new file mode 100644 index 000000000..15613ef01 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/JTreeTable.java @@ -0,0 +1,377 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.chart.treetable; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.JTable; +import javax.swing.JTree; +import javax.swing.RowSorter; +import javax.swing.table.TableCellRenderer; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; +import javax.swing.text.Position; +import javax.swing.tree.DefaultTreeSelectionModel; +import javax.swing.tree.TreeModel; +import javax.swing.tree.TreePath; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Locale; + +import static ohos.devtools.views.common.LayoutConstants.NEGATIVE_ONE; + +/** + * JTreeTable + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class JTreeTable extends JTable { + private static final Logger LOGGER = LogManager.getLogger(JTreeTable.class); + + /** + * 数字220 + */ + public static final int NUM_220 = 220; + + /** + * TreeTableCellRenderer对象 + */ + public TreeTableCellRenderer treeTableCellRenderer; + + /** + * TreeTableModel类 + */ + public TreeTableModel treeTableModel; + + /** + * getTreeTableModel + * + * @return TreeTableModel + */ + public TreeTableModel getTreeTableModel() { + return treeTableModel; + } + + /** + * setTreeTableModel + * + * @param treeTableModel treeTableModel + */ + public void setTreeTableModel(TreeTableModel treeTableModel) { + this.treeTableModel = treeTableModel; + if (treeTableCellRenderer == null) { + treeTableCellRenderer = new TreeTableCellRenderer(treeTableModel); + } else { + treeTableCellRenderer.setModel(treeTableModel); + treeTableCellRenderer.setShowsRootHandles(true); + } + TreeTableModelAdapter model = new TreeTableModelAdapter(treeTableModel, treeTableCellRenderer); + super.setModel(model); + treeTableCellRenderer.setRowHeight(getRowHeight()); + setDefaultRenderer(TreeTableModel.class, treeTableCellRenderer); + TableRowSorter sorter = new TableRowSorter(this.getModel()); + sorter.setComparator(0, DataNodeCompares.classNameString); + sorter.addRowSorterListener(event -> { + try { + if (!sorter.getSortKeys().isEmpty()) { + List keys = sorter.getSortKeys(); + AgentDataModel treeTableModels = null; + TreeTableModel treeTModel = JTreeTable.this.treeTableModel; + if (treeTModel instanceof AgentDataModel) { + treeTableModels = (AgentDataModel) treeTModel; + } + DataNode rootNode = treeTableModels.getDataNode(); + ArrayList datNode = rootNode.getChildren(); + RowSorter.SortKey key = keys.get(0); + String sortOrder = key.getSortOrder().name(); + Comparator comparator = new DataNodeCompares().chooseCompare(key.getColumn(), sortOrder); + if (comparator != null) { + Collections.sort(datNode, comparator); + } + rootNode.setChildren(datNode); + AgentDataModel agentDataModel = new AgentDataModel(rootNode); + JTreeTable.this.treeTableModel = agentDataModel; + treeTableCellRenderer = new TreeTableCellRenderer(agentDataModel); + treeTableCellRenderer.setRowHeight(getRowHeight()); + setDefaultRenderer(TreeTableModel.class, treeTableCellRenderer); + } + } catch (IndexOutOfBoundsException | ClassCastException | UnsupportedOperationException + | IllegalArgumentException exception) { + LOGGER.error("reflush Exception {}", exception.getMessage()); + } + }); + this.setRowSorter(sorter); + } + + /** + * JTreeTable + * + * @param treeTableModel treeTableModel + */ + public JTreeTable(TreeTableModel treeTableModel) { + super(); + this.treeTableModel = treeTableModel; + treeTableCellRenderer = new TreeTableCellRenderer(treeTableModel); + super.setModel(new TreeTableModelAdapter(treeTableModel, treeTableCellRenderer)); + treeTableCellRenderer.setSelectionModel(new DefaultTreeSelectionModel() { + { + setSelectionModel(listSelectionModel); + } + }); + treeTableCellRenderer.setRowHeight(getRowHeight()); + setDefaultRenderer(TreeTableModel.class, treeTableCellRenderer); + setShowGrid(false); + getColumnModel().getColumn(0).setPreferredWidth(NUM_220); + setIntercellSpacing(new Dimension(0, 0)); + } + + /** + * TreeTableCellRenderer + */ + public class TreeTableCellRenderer extends JTree implements TableCellRenderer { + /** + * visibleRow + */ + protected int visibleRow; + + /** + * TreeTableCellRenderer + * + * @param model model + */ + public TreeTableCellRenderer(TreeModel model) { + super(model); + this.setShowsRootHandles(true); + } + + /** + * setBounds + * + * @param pointX pointX + * @param pointY pointY + * @param width width + * @param height height + */ + @Override + public void setBounds(int pointX, int pointY, int width, int height) { + super.setBounds(pointX, 0, width, JTreeTable.this.getHeight()); + } + + /** + * paint + * + * @param graphics graphics + */ + @Override + public void paint(Graphics graphics) { + graphics.translate(0, -visibleRow * getRowHeight()); + super.paint(graphics); + } + + /** + * 获取表单元格渲染器组件 + * + * @param table table + * @param value value + * @param isSelected isSelected + * @param hasFocus hasFocus + * @param row row + * @param column column + * @return Component + */ + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, + int row, int column) { + if (isSelected) { + setBackground(table.getSelectionBackground()); + } else { + setBackground(table.getBackground()); + } + visibleRow = row; + return this; + } + + /** + * getNextMatch + * + * @param prefix prefix + * @param startingRow startingRow + * @param bias bias + * @return TreePath + */ + @Override + public synchronized TreePath getNextMatch(String prefix, int startingRow, Position.Bias bias) { + String newPrefix = prefix; + int max = getRowCount(); + int row = 0; + if (newPrefix == null) { + return null; + } + if (startingRow < 0 || (startingRow + 1) == getRowCount()) { + row = 0; + } else { + row = startingRow + 1; + } + + if (startingRow >= max) { + return null; + } + newPrefix = newPrefix.toUpperCase(Locale.ENGLISH); + TreePath andExpand = null; + if (startingRow < 0) { + andExpand = findAndExpand(newPrefix, row, bias, NEGATIVE_ONE); + } else { + andExpand = findAndExpand(newPrefix, row, bias, getSelectedRow()); + } + if (andExpand == null && startingRow >= 0) { + TreePath path = getPathForRow(startingRow); + String text = + convertRowToText(path.getLastPathComponent(), isRowSelected(startingRow), isExpanded(startingRow), + true, startingRow, false); + if (text.toUpperCase(Locale.ENGLISH).indexOf(newPrefix) > NEGATIVE_ONE) { + return path; + } else { + return null; + } + } else { + return andExpand; + } + } + + /** + * 查找并扩展 + * + * @param prefix prefix + * @param row row + * @param bias bias + * @param currentSelectedRow currentSelectedRow + * @return TreePath + */ + public TreePath findAndExpand(String prefix, int row, Position.Bias bias, int currentSelectedRow) { + TreePath treePath = getPathForRow(row); + String text = + convertRowToText(treePath + .getLastPathComponent(), isRowSelected(row), isExpanded(row), true, row, false); + if (text.toUpperCase(Locale.ENGLISH).indexOf(prefix) > NEGATIVE_ONE) { + return treePath; + } else { + DataNode node = null; + Object objComponent = treePath.getLastPathComponent(); + if (objComponent instanceof DataNode) { + node = (DataNode) objComponent; + } + if (node != null && node.getChildren() != null && node.getChildren().size() > 0 && !isExpanded(row)) { + // expand current row + expandRow(row); + TreePath pathTem = findAndExpand(prefix, row + 1, bias, currentSelectedRow); + if (pathTem == null) { + collapseRow(row); + } else { + if (!isSubPath(treePath, pathTem)) { + collapseRow(row); + } + } + return pathTem; + } else { + if (getRowCount() == row + 1) { + if (currentSelectedRow <= 0) { + return null; + } else { + return findAndExpand(prefix, 0, bias, currentSelectedRow); + } + } + if (currentSelectedRow == row + 1) { + return null; + } + return findAndExpand(prefix, row + 1, bias, currentSelectedRow); + } + } + } + + /** + * isSubPath + * + * @param parentPath parentPath + * @param childPath childPath + * @return boolean + */ + public boolean isSubPath(TreePath parentPath, TreePath childPath) { + TreePath parent = childPath; + if (parentPath.getPathCount() >= childPath.getPathCount()) { + return false; + } + for (int index = 0; index < childPath.getPathCount() - parentPath.getPathCount(); index++) { + parent = childPath.getParentPath(); + } + if (parent == parentPath) { + return true; + } + return false; + } + + /** + * convertValueToText + * + * @param value value + * @param selected selected + * @param expanded expanded + * @param leaf leaf + * @param row row + * @param hasFocus hasFocus + * @return String + */ + @Override + public String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, + boolean hasFocus) { + if (value != null && value instanceof DataNode) { + String strValue = ((DataNode) value).toString(); + if (strValue != null) { + return strValue; + } + } + return ""; + } + + /** + * convertRowToText + * + * @param value value + * @param selected selected + * @param expanded expanded + * @param leaf leaf + * @param row row + * @param hasFocus hasFocus + * @return String + */ + public String convertRowToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, + boolean hasFocus) { + if (value != null && value instanceof DataNode) { + String strValue = ((DataNode) value).toStr(); + if (strValue != null) { + return strValue; + } + } + return ""; + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/TreeTableModel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/TreeTableModel.java new file mode 100644 index 000000000..1237db038 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/TreeTableModel.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.chart.treetable; + +import javax.swing.tree.TreeModel; + +/** + * TreeTableModel类 + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public interface TreeTableModel extends TreeModel { + /** + * Returns the number ofs available column. + * + * @return int + */ + int getColumnCount(); + + /** + * getColumnName Returns the name for column number column. + * + * @param column column + * @return String + */ + String getColumnName(int column); + + /** + * getColumnClass Returns the type for column number column. + * + * @param column column + * @return Class + */ + Class getColumnClass(int column); + + /** + * Returns the value to be displayed for node node, at column number column. + * + * @param node node + * @param column column + * @return Object + */ + Object getValueAt(Object node, int column); +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/TreeTableModelAdapter.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/TreeTableModelAdapter.java new file mode 100644 index 000000000..54eada37d --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/chart/treetable/TreeTableModelAdapter.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.chart.treetable; + +import javax.swing.JTree; +import javax.swing.event.TreeExpansionEvent; +import javax.swing.event.TreeExpansionListener; +import javax.swing.table.AbstractTableModel; +import javax.swing.tree.TreePath; + +/** + * 表模型适配器 + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class TreeTableModelAdapter extends AbstractTableModel { + private JTree jTree; + private TreeTableModel treeTableModel; + + public TreeTableModelAdapter(TreeTableModel treeTableModel, JTree jTree) { + this.jTree = jTree; + this.treeTableModel = treeTableModel; + jTree.addTreeExpansionListener(new TreeExpansionListener() { + /** + * 树展开 + * + * @param event event + */ + public void treeExpanded(TreeExpansionEvent event) { + fireTableDataChanged(); + } + + /** + * 表数据更改 + * + * @param event event + */ + public void treeCollapsed(TreeExpansionEvent event) { + fireTableDataChanged(); + } + }); + } + + /** + * getColumnCount + * + * @return int + */ + @Override + public int getColumnCount() { + return treeTableModel.getColumnCount(); + } + + /** + * getColumnName + * + * @param column column + * @return String + */ + @Override + public String getColumnName(int column) { + return treeTableModel.getColumnName(column); + } + + /** + * getColumnClass + * + * @param column column + * @return Class + */ + @Override + public Class getColumnClass(int column) { + return treeTableModel.getColumnClass(column); + } + + /** + * getRowCount + * + * @return int + */ + @Override + public int getRowCount() { + return jTree.getRowCount(); + } + + /** + * getValueAt + * + * @param row row + * @param column column + * @return Object + */ + @Override + public Object getValueAt(int row, int column) { + TreePath treePath = jTree.getPathForRow(row); + Object rowNode = treePath.getLastPathComponent(); + return treeTableModel.getValueAt(rowNode, column); + } + + /** + * 单元格可编辑 + * + * @param row row + * @param column column + * @return boolean + */ + @Override + public boolean isCellEditable(int row, int column) { + return false; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosDialog.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosDialog.java new file mode 100644 index 000000000..8c0c6ee78 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosDialog.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.hoscomp; + +import ohos.devtools.datasources.utils.monitorconfig.service.MonitorConfigManager; +import ohos.devtools.datasources.utils.session.entity.SessionInfo; +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.chartview.observer.ProfilerChartsViewObserver; +import ohos.devtools.views.layout.swing.SampleDialogWrapper; + +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JPanel; +import java.awt.Dimension; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +/** + * Memory指标项添加复选框 + * + * @version 1.0 + * @date 2021/03/24 09:33 + **/ +public class HosDialog { + /** + * sessionInfo信息 + */ + private SessionInfo sessionInfo; + private JPanel jPanel; + /** + * Items项复选框容器 + */ + private JPanel jCheckPanel = new JPanel(null); + /** + * 复选框存放集合 + */ + private ArrayList jCheckBoxes = new ArrayList<>(); + + private ProfilerChartsView profilerView; + + /** + * Items页面复选框内容 + */ + private JLabel jLabelMemory = new JLabel("Memory"); + private JCheckBox checkBoxSelectAll = new JCheckBox("Select All"); + private JCheckBox checkBoxMemoryJava = new JCheckBox("Java"); + private JCheckBox checkBoxGpuMemoryNative = new JCheckBox("Native"); + private JCheckBox checkBoxGraphics = new JCheckBox("Graphics"); + private JCheckBox checkBoxStack = new JCheckBox("Stack"); + private JCheckBox checkBoxCode = new JCheckBox("Code"); + private JCheckBox checkBoxOthers = new JCheckBox("Others"); + + /** + * HosDialog Constructor + * + * @param sessionId session Id + * @param profilerView profiler View + */ + public HosDialog(long sessionId, ProfilerChartsView profilerView) { + addItem(); + this.profilerView = profilerView; + jCheckBoxes.add(checkBoxSelectAll); + jCheckBoxes.add(checkBoxMemoryJava); + jCheckBoxes.add(checkBoxGpuMemoryNative); + jCheckBoxes.add(checkBoxGraphics); + jCheckBoxes.add(checkBoxStack); + jCheckBoxes.add(checkBoxCode); + jCheckBoxes.add(checkBoxOthers); + // 设置对话框的宽高 + jCheckPanel + .setPreferredSize(new Dimension(LayoutConstants.MEMORY_WIDTH_SIZE, LayoutConstants.MEMORY_HEIGHT_SIZE)); + ConcurrentHashMap>> configData = MonitorConfigManager.dataMap; + Map> configMap = configData.get(sessionId); + + LinkedList configList = null; + if (configMap != null) { + configList = configMap.get("Memory"); + } + // 让初始选中的Iterm默认选中 + for (String str : configList) { + for (int index = 0; index < jCheckBoxes.size(); index++) { + if (jCheckBoxes.get(index).getText().equals(str)) { + jCheckBoxes.get(index).setSelected(true); + continue; + } + } + } + // 弹框 + SampleDialogWrapper sampleDialog = new SampleDialogWrapper("Select Add Items", jCheckPanel); + boolean flag = sampleDialog.showAndGet(); + if (flag) { + // 获取选中的指标项 + List collect = HosDialog.this.jCheckBoxes.stream().filter(jCheckBox -> jCheckBox.isSelected()) + .collect(Collectors.toList()); + if (collect.size() == 0) { + new SampleDialogWrapper("Reminder Msg", "Please Select Items !").show(); + return; + } + // 便利选中项,构建Memory的value + LinkedList memoryFlushed = new LinkedList<>(); + for (JCheckBox jc : collect) { + memoryFlushed.add(jc.getText()); + } + configMap.remove("Memory"); + configMap.put("Memory", memoryFlushed); + MonitorConfigManager.dataMap.put(sessionId, configMap); + ProfilerChartsViewObserver bottomPanel = ProfilerChartsView.sessionMap.get(sessionId).getObserver(); + ChartDataRange range = bottomPanel.getStandard().getDisplayRange(); + bottomPanel.notifyRefresh(range.getStartTime(), range.getEndTime()); + profilerView.setAddItemFlag(false); + } else { + profilerView.setAddItemFlag(false); + } + } + + private void addItem() { + jLabelMemory.setBounds(LayoutConstants.MEMORY_X, LayoutConstants.MEMORY_Y, LayoutConstants.MEMORY_WIDTH, + LayoutConstants.MEMORY_HEIGHT); + checkBoxSelectAll + .setBounds(LayoutConstants.SELECT_ALL_X, LayoutConstants.SELECT_ALL_Y, LayoutConstants.SELECT_ALL_WIDTH, + LayoutConstants.SELECT_ALL_HEIGHT); + checkBoxMemoryJava.setBounds(LayoutConstants.JAVA_X, LayoutConstants.JAVA_Y, LayoutConstants.JAVA_WIDTH, + LayoutConstants.JAVA_HEIGHT); + checkBoxGpuMemoryNative + .setBounds(LayoutConstants.NATIVE_X, LayoutConstants.NATIVE_Y, LayoutConstants.NATIVE_WIDTH, + LayoutConstants.NATIVE_HEIGHT); + checkBoxGraphics + .setBounds(LayoutConstants.GRAPHICS_X, LayoutConstants.GRAPHICS_Y, LayoutConstants.GRAPHICS_WIDTH, + LayoutConstants.GRAPHICS_HEIGHT); + checkBoxStack.setBounds(LayoutConstants.STACK_X, LayoutConstants.STACK_Y, LayoutConstants.STACK_WIDTH, + LayoutConstants.STACK_HEIGHT); + checkBoxCode.setBounds(LayoutConstants.CODE_X, LayoutConstants.CODE_Y, LayoutConstants.CODE_WIDTH, + LayoutConstants.CODE_HEIGHT); + checkBoxOthers.setBounds(LayoutConstants.OTHERS_X, LayoutConstants.OTHERS_Y, LayoutConstants.OTHERS_WIDTH, + LayoutConstants.OTHERS_HEIGHT); + jCheckPanel.add(jLabelMemory); + jCheckPanel.add(checkBoxSelectAll); + jCheckPanel.add(checkBoxMemoryJava); + jCheckPanel.add(checkBoxGpuMemoryNative); + jCheckPanel.add(checkBoxGraphics); + jCheckPanel.add(checkBoxStack); + jCheckPanel.add(checkBoxCode); + jCheckPanel.add(checkBoxOthers); + checkBoxSelectAll.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent exception) { + if (HosDialog.this.checkBoxSelectAll.isSelected()) { + HosDialog.this.checkBoxMemoryJava.setSelected(true); + HosDialog.this.checkBoxGpuMemoryNative.setSelected(true); + HosDialog.this.checkBoxGraphics.setSelected(true); + HosDialog.this.checkBoxStack.setSelected(true); + HosDialog.this.checkBoxCode.setSelected(true); + HosDialog.this.checkBoxOthers.setSelected(true); + } else { + HosDialog.this.checkBoxMemoryJava.setSelected(false); + HosDialog.this.checkBoxGpuMemoryNative.setSelected(false); + HosDialog.this.checkBoxGraphics.setSelected(false); + HosDialog.this.checkBoxStack.setSelected(false); + HosDialog.this.checkBoxCode.setSelected(false); + HosDialog.this.checkBoxOthers.setSelected(false); + } + } + }); + } + + public SessionInfo getSessionInfo() { + return sessionInfo; + } + + public void setSessionInfo(SessionInfo sessionInfo) { + this.sessionInfo = sessionInfo; + } + + public JPanel getjPanel() { + return jPanel; + } + + public void setjPanel(JPanel jPanel) { + this.jPanel = jPanel; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosJButton.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosJButton.java new file mode 100644 index 000000000..47020aaaa --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosJButton.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.hoscomp; + +import ohos.devtools.datasources.utils.session.entity.SessionInfo; +import ohos.devtools.views.common.LayoutConstants; + +import javax.swing.Icon; +import javax.swing.JButton; +import java.awt.Dimension; + +/** + * @Description HosJButton + * @Date 2021/3/10 20:50 + **/ +public class HosJButton extends JButton { + private SessionInfo sessionInfo; + + private long sessionId; + + private String deviceName; + + private String processName; + + public HosJButton(Icon icon, String message) { + super(icon); + this.setPreferredSize(new Dimension(LayoutConstants.BUTTON_SIZE, LayoutConstants.BUTTON_SIZE)); + this.setToolTipText(message); + } + + public HosJButton(String text, String message) { + super(text); + this.setToolTipText(message); + } + + public SessionInfo getSessionInfo() { + return sessionInfo; + } + + public void setSessionInfo(SessionInfo sessionInfo) { + this.sessionInfo = sessionInfo; + } + + public long getSessionId() { + return sessionId; + } + + public void setSessionId(long sessionId) { + this.sessionId = sessionId; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosJComboBox.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosJComboBox.java new file mode 100644 index 000000000..f4a95e640 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosJComboBox.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.hoscomp; + +import ohos.devtools.datasources.utils.session.entity.SessionInfo; + +import javax.swing.JComboBox; + +/** + * HosJComboBox + * + * @since 2021/3/16 10:36 + */ +public class HosJComboBox extends JComboBox { + private SessionInfo sessionInfo; + + private long sessionId; + + public SessionInfo getSessionInfo() { + return sessionInfo; + } + + public void setSessionInfo(SessionInfo sessionInfo) { + this.sessionInfo = sessionInfo; + } + + public long getSessionId() { + return sessionId; + } + + public void setSessionId(long sessionId) { + this.sessionId = sessionId; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosJLabel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosJLabel.java new file mode 100644 index 000000000..a775db47b --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosJLabel.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.hoscomp; + +import ohos.devtools.datasources.utils.session.entity.SessionInfo; + +import javax.swing.JLabel; + +/** + * @Description HosJLabel + * @Date 2021/3/11 13:12 + **/ +public class HosJLabel extends JLabel { + private SessionInfo sessionInfo; + + private long sessionId; + + private String deviceName; + + private String processName; + + private String message; + + private Long firstStamp; + + private boolean deviceType = false; + private long startTime; + private long endTime; + + public boolean getDeviceType() { + return deviceType; + } + + public void setDeviceType(boolean deviceType) { + this.deviceType = deviceType; + } + + public long getStartTime() { + return startTime; + } + + public void setStartTime(long startTime) { + this.startTime = startTime; + } + + public long getEndTime() { + return endTime; + } + + public void setEndTime(long endTime) { + this.endTime = endTime; + } + + public HosJLabel(String text) { + super(text); + } + + public HosJLabel() { + super("", null, LEADING); + } + + public SessionInfo getSessionInfo() { + return sessionInfo; + } + + public void setSessionInfo(SessionInfo sessionInfo) { + this.sessionInfo = sessionInfo; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public long getSessionId() { + return sessionId; + } + + public void setSessionId(long sessionId) { + this.sessionId = sessionId; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + + public Long getFirstStamp() { + return firstStamp; + } + + public void setFirstStamp(Long firstStamp) { + this.firstStamp = firstStamp; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosJTabbedPane.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosJTabbedPane.java new file mode 100644 index 000000000..63fed7e9f --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/common/hoscomp/HosJTabbedPane.java @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.hoscomp; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description 自定义选项卡 + * @Date 2021/3/29 10:36 + **/ +public class HosJTabbedPane extends JPanel { + // tab选项卡容器 + private JPanel tabJPanel = new JPanel(null); + + // 当前选中的tab。 + private JPanel tab; + + // 所有tab的集合 + private List tabLists; + + // content选项卡对应内容的容器 + private JPanel tabContentJPanel; + + // 所有内容面板的集合 + private Map tabContentLists = new HashMap<>(); + private int count = 0; + + /** + * HosJTabbedPane + * + * @param tab tab + * @param tabContentJPanel tabContentJPanel + */ + public HosJTabbedPane(JPanel tab, JPanel tabContentJPanel) { + this.tab = tab; + this.tab.setPreferredSize(new Dimension(100, 20)); + this.tabJPanel.setBackground(Color.lightGray); + this.tabJPanel.add(tab); + this.tabJPanel.setBackground(new Color(41, 41, 48)); + this.tab.setBackground(new Color(13, 14, 19)); + this.tabContentJPanel = tabContentJPanel; + this.tabContentJPanel.setBackground(new Color(13, 14, 19)); + this.tabContentLists.put(count, tabContentJPanel); + this.setLayout(new BorderLayout()); + this.add(this.tabJPanel, BorderLayout.NORTH); + this.add(this.tabContentJPanel, BorderLayout.CENTER); + this.tab.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent event) { + super.mouseClicked(event); + } + }); + } + + /** + * hosAdd + * + * @param tab tab + * @param tabContentJPanel tabContentJPanel + */ + public void hosAdd(JPanel tab, JPanel tabContentJPanel) { + this.count++; + this.tab = tab; + this.tab.setBackground(new Color(13, 14, 19)); + this.tab.setPreferredSize(new Dimension(100, 20)); + this.tabJPanel.add(tab); + this.tabContentJPanel = tabContentJPanel; + this.tabContentJPanel.setBackground(new Color(13, 14, 19)); + this.tabContentLists.put(this.count, this.tabContentJPanel); + } + + public JPanel getTabJPanel() { + return tabJPanel; + } + + public void setTabJPanel(JPanel tabJPanel) { + this.tabJPanel = tabJPanel; + } + + public JPanel getTab() { + return tab; + } + + public void setTab(JPanel tab) { + this.tab = tab; + } + + public List getTabLists() { + return tabLists; + } + + public void setTabLists(List tabLists) { + this.tabLists = tabLists; + } + + public JPanel getTabContentJPanel() { + return tabContentJPanel; + } + + public void setTabContentJPanel(JPanel tabContentJPanel) { + this.tabContentJPanel = tabContentJPanel; + } + + public Map getTabContentLists() { + return tabContentLists; + } + + public void setTabContentLists(Map tabContentLists) { + this.tabContentLists = tabContentLists; + } + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } +} + +class HosTab { + private Integer id; + private JPanel tab; + + public HosTab(Integer id, JPanel tab) { + this.id = id; + this.tab = tab; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public JPanel getTab() { + return tab; + } + + public void setTab(JPanel tab) { + this.tab = tab; + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/HomeWindow.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/HomeWindow.java new file mode 100644 index 000000000..8f0131461 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/HomeWindow.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout; + +/** + * @Description 主要负责IDE主框架的绘制。 + * @Date 2021/2/7 13:51 + **/ +public class HomeWindow { +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/AbsItemTitleView.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/AbsItemTitleView.java new file mode 100644 index 000000000..c904ae36d --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/AbsItemTitleView.java @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview; + +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.OperationUtils; + +import javax.swing.JPanel; +import java.awt.BasicStroke; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.math.BigDecimal; + +import static ohos.devtools.views.common.ColorConstants.ITEM_PANEL; +import static ohos.devtools.views.common.ViewConstants.LABEL_DEFAULT_HEIGHT; +import static ohos.devtools.views.common.ViewConstants.LABEL_DEFAULT_WIDTH; + +/** + * Chart标题栏的抽象父类 + * + * @since 2021/4/22 15:42 + */ +public abstract class AbsItemTitleView extends JPanel implements MouseListener, MouseMotionListener { + /** + * 最底层面板 + */ + protected final ProfilerChartsView bottomPanel; + + /** + * 标题名称 + */ + private final String name; + + /** + * 构造函数 + * + * @param bottomPanel 最底层面板 + * @param name 指标项名称 + */ + public AbsItemTitleView(ProfilerChartsView bottomPanel, String name) { + this.bottomPanel = bottomPanel; + this.name = name; + this.setLayout(new FlowLayout(FlowLayout.LEFT)); + // 标题颜色 + this.setBackground(ITEM_PANEL); + // 这里宽度随意给一个值,渲染时Swing会自动把宽度铺满容器 + this.setPreferredSize(new Dimension(LABEL_DEFAULT_WIDTH, LABEL_DEFAULT_HEIGHT)); + this.addMouseListener(this); + this.addMouseMotionListener(this); + } + + @Override + public void paintComponent(Graphics graphics) { + super.paintComponent(graphics); + drawMouseRuler(graphics); + drawSelectedRuler(graphics); + } + + /** + * 绘制跟随鼠标的标尺 + * + * @param graphics Graphics + */ + private void drawMouseRuler(Graphics graphics) { + int mouseX; + Point mousePoint = getMousePosition(); + if (mousePoint == null) { + // 没有鼠标位置时,绘制标尺的X坐标为0,或鼠标当前进入的组件为空,则不需要绘制 + if (this.bottomPanel.getRulerXCoordinate() == 0 || this.bottomPanel.getCurrentEntered() == null) { + return; + } + + // 绘制标尺的X坐标,以Chart和Timeline起点为0点 + mouseX = this.bottomPanel.getRulerXCoordinate(); + } else { + mouseX = (int) mousePoint.getX(); + // 绘制标尺的X坐标,以Chart和Timeline起点为0点 + this.bottomPanel.setRulerXCoordinate(mouseX); + } + Graphics graphic = graphics.create(); + Graphics2D graphicD = null; + if (graphic instanceof Graphics2D) { + graphicD = (Graphics2D) graphic; + } + // 获取原始线条特征 + Stroke stroke = graphicD.getStroke(); + BasicStroke defaultStroke = null; + if (stroke instanceof BasicStroke) { + defaultStroke = (BasicStroke) stroke; + } + float[] dash = {LayoutConstants.FLOAT_VALUE, 0f, LayoutConstants.FLOAT_VALUE}; + // 定义虚线条特征 + BasicStroke bs = + new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 1.0f, dash, LayoutConstants.FLOAT_VALUE); + graphicD.setColor(ColorConstants.RULER); + graphicD.setStroke(bs); + graphicD.drawLine(mouseX, this.getY(), mouseX, this.getHeight()); + graphicD.setStroke(defaultStroke); + // 把当前组件标记为已绘制,刷新其他组件的标尺 + this.bottomPanel.compRulerDrawn(this); + this.bottomPanel.refreshCompRuler(); + } + + /** + * 绘制框选时的标尺 + * + * @param graphics Graphics + */ + private void drawSelectedRuler(Graphics graphics) { + ChartDataRange selectedRange = this.bottomPanel.getObserver().getStandard().getSelectedRange(); + if (selectedRange != null) { + graphics.setColor(ColorConstants.RULER); + int maxDisplay = this.bottomPanel.getObserver().getStandard().getMaxDisplayMillis(); + BigDecimal pixelPerTime = OperationUtils.divide(this.getWidth(), maxDisplay); + int startCoordinate = calcStartCoordinate(pixelPerTime); + + int startTime = this.bottomPanel.getObserver().getStandard().getDisplayRange().getStartTime(); + int offsetStartTime = selectedRange.getStartTime() - startTime; + int selectStartX = startCoordinate + OperationUtils.multiply(pixelPerTime, offsetStartTime); + // 绘制框选起始点的竖线 + graphics.drawLine(selectStartX, this.getY(), selectStartX, this.getHeight()); + + int offsetEndTime = selectedRange.getEndTime() - startTime; + int selectEndX = startCoordinate + OperationUtils.multiply(pixelPerTime, offsetEndTime); + // 绘制框选结束点的竖线 + graphics.drawLine(selectEndX, this.getY(), selectEndX, this.getHeight()); + } + } + + /** + * 出起始坐标startCoordinate,这一块和Timeline的一样 + * + * @param pixelPerTime 比例 + * @return int + */ + private int calcStartCoordinate(BigDecimal pixelPerTime) { + int maxDisplay = this.bottomPanel.getObserver().getStandard().getMaxDisplayMillis(); + int displayEndTime = this.bottomPanel.getObserver().getStandard().getDisplayRange().getEndTime(); + int startCoordinate; + if (displayEndTime > maxDisplay) { + startCoordinate = 0; + } else { + startCoordinate = this.getWidth() - OperationUtils.multiply(pixelPerTime, displayEndTime); + } + return startCoordinate; + } + + @Override + public void mouseClicked(MouseEvent mouseEvent) { + } + + @Override + public void mousePressed(MouseEvent mouseEvent) { + } + + @Override + public void mouseReleased(MouseEvent mouseEvent) { + } + + @Override + public void mouseEntered(MouseEvent mouseEvent) { + // 当前组件需要绘制标尺,鼠标进入,则更新底层父级panel的currentEntered + this.bottomPanel.setCurrentEntered(this); + } + + @Override + public void mouseExited(MouseEvent mouseEvent) { + // 当前组件需要绘制标尺,鼠标退出,则更新底层父级panel的currentEntered为null + this.bottomPanel.setCurrentEntered(null); + + // 这里需要重绘一下当前界面,否则会残留有之前的ruler + this.bottomPanel.resetRulerDrawStatus(); + this.bottomPanel.refreshCompRuler(); + } + + @Override + public void mouseDragged(MouseEvent mouseEvent) { + } + + @Override + public void mouseMoved(MouseEvent mouseEvent) { + // 鼠标移动,则所有组件的标尺需要重新绘制 + this.bottomPanel.resetRulerDrawStatus(); + this.repaint(); + this.revalidate(); + } + + public String getName() { + return name; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/AbsItemView.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/AbsItemView.java new file mode 100644 index 000000000..ebaa048b4 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/AbsItemView.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview; + +import ohos.devtools.views.charts.ProfilerChart; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Cursor; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import static ohos.devtools.views.common.ViewConstants.NUM_3; + +/** + * The abstract parent class of the view panel of each indicator analysis item + * + * @version 1.0 + * @date 2021/2/25 17:22 + */ +public abstract class AbsItemView extends JPanel { + /** + * Index item name + */ + protected String itemName; + + /** + * Chart + */ + protected ProfilerChart chart; + + /** + * Bottom panel + */ + protected ProfilerChartsView bottomPanel; + + /** + * The parent container of the current view + * + * @see "For custom zoom" + */ + protected ItemViewsPanel parent; + + /** + * The Y-axis coordinate of the current panel in the parent panel, that is, the Y-axis offset + */ + private int coordinateY; + + /** + * Constructor + * + * @param bottomPanel Bottom panel + * @param parent The parent container of the current view + * @param coordinateY The Y-axis coordinate of the current panel in the parent panel, that is, the Y-axis offset + */ + public AbsItemView(ProfilerChartsView bottomPanel, ItemViewsPanel parent, int coordinateY) { + super(true); + this.bottomPanel = bottomPanel; + this.parent = parent; + this.coordinateY = coordinateY; + this.setLayout(new BorderLayout()); + this.addMouseMotionListener(new MouseAdapter() { + @Override + public void mouseDragged(MouseEvent mouseEvent) { + dragEvent(mouseEvent); + } + + @Override + public void mouseMoved(MouseEvent mouseEvent) { + moveEvent(mouseEvent); + } + }); + } + + /** + * Initialize the title panel + * + * @param itemName Panel name + */ + protected void initTitlePanel(String itemName) { + this.itemName = itemName; + ItemTitleView itemTitleView = new ItemTitleView(this.bottomPanel, itemName); + this.add(itemTitleView, BorderLayout.NORTH); + // 标题面板需要绘制标尺,把他加入集合 + this.bottomPanel.addRulerComp(itemTitleView); + } + + /** + * Custom mouse drag events to achieve vertical zoom + * + * @param mouseEvent MouseEvent + */ + private void dragEvent(MouseEvent mouseEvent) { + // 鼠标在当前组件中的Y轴坐标,即为缩放时当前组件的高度 + int newHeight = mouseEvent.getY(); + // 目前只允许在Chart下方进行拖拽缩放,也就是mouseMoved中,鼠标变为resize之后 + if (this.getCursor().getType() == Cursor.S_RESIZE_CURSOR) { + this.setBounds(0, coordinateY, mouseEvent.getComponent().getWidth(), newHeight); + // 刷新父Panel,重新调整各个指标项面板的大小 + parent.resizeItemsByDrag(); + } + } + + /** + * Custom mouse movement events, change the mouse style + * + * @param mouseEvent MouseEvent + */ + private void moveEvent(MouseEvent mouseEvent) { + int mouseY = mouseEvent.getY(); + // 只监听鼠标靠近Panel底部时将样式修改为resize,顶部不允许resize + if (Math.abs(this.getHeight() - mouseY) < NUM_3) { + this.setCursor(new Cursor(Cursor.S_RESIZE_CURSOR)); + } else { + this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + } + + this.repaint(); + this.revalidate(); + } + + public ProfilerChart getChart() { + return chart; + } + + /** + * Setter + * + * @param coordinateY int + */ + public void setCoordinateY(int coordinateY) { + this.coordinateY = coordinateY; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/ItemTitleView.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/ItemTitleView.java new file mode 100644 index 000000000..3ef714500 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/ItemTitleView.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview; + +import javax.swing.JLabel; +import java.awt.Dimension; + +import static ohos.devtools.views.common.ViewConstants.LABEL_DEFAULT_HEIGHT; +import static ohos.devtools.views.common.ViewConstants.LABEL_DEFAULT_WIDTH; + +/** + * 指标项标题面板 + * + * @see "包含名称(Memory,CPU等)" + * @since 2021/2/8 9:39 + */ +public class ItemTitleView extends AbsItemTitleView { + /** + * 构造函数 + * + * @param bottomPanel 最底层面板 + * @param name 指标项名称 + */ + public ItemTitleView(ProfilerChartsView bottomPanel, String name) { + super(bottomPanel, name); + initTitle(); + } + + private void initTitle() { + JLabel title = new JLabel(this.getName()); + title.setPreferredSize(new Dimension(LABEL_DEFAULT_WIDTH, LABEL_DEFAULT_HEIGHT)); + this.add(title); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/ItemViewsPanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/ItemViewsPanel.java new file mode 100644 index 000000000..9c6aad839 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/ItemViewsPanel.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview; + +import ohos.devtools.views.common.ProfilerMonitorItem; + +import javax.swing.JPanel; +import java.awt.GridLayout; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.util.ArrayList; +import java.util.List; + +import static ohos.devtools.views.common.ColorConstants.CHART_BG; +import static ohos.devtools.views.common.ViewConstants.CHART_DEFAULT_HEIGHT; +import static ohos.devtools.views.common.ViewConstants.CHART_INIT_WIDTH; + +/** + * Save the custom layout panel of each indicator item View + * + * @since 2021/2/25 17:26 + */ +public class ItemViewsPanel extends JPanel { + /** + * Bottom panel + */ + private final ProfilerChartsView bottomPanel; + + /** + * Save the collection of each indicator item View + */ + private final List items; + + /** + * Constructor + * + * @param bottomPanel Bottom panel + */ + public ItemViewsPanel(ProfilerChartsView bottomPanel) { + super(true); + this.bottomPanel = bottomPanel; + this.items = new ArrayList<>(); + // Do not use the Swing preset layout, use a custom absolute layout, one observation item is paved. + // See the addMonitorItemView() method for the layout + this.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent exception) { + resizeItemsByComponent(exception); + } + }); + this.setBackground(CHART_BG); + } + + /** + * Add a monitored metric item view + * + * @param item Index item enumeration class + */ + void addMonitorItemView(ProfilerMonitorItem item) { + // Create a Chart panel for each row + int offsetY = this.items.size() * CHART_DEFAULT_HEIGHT; + AbsItemView itemView; + if (item != ProfilerMonitorItem.MEMORY) { + return; + } + + itemView = new MemoryItemView(bottomPanel, this, offsetY); + // The current Panel is an absolute layout, you must specify the position, and then add to the current Panel + itemView.setBounds(0, offsetY, CHART_INIT_WIDTH, CHART_DEFAULT_HEIGHT); + // Add to layout + this.add(itemView); + // Add to collection for zoom + this.items.add(itemView); + // Set the layout. When there is an observation item, + // it should cover the middle area. Do not use the Swing preset layout, use a custom absolute layout + if (this.items.size() == 1) { + this.setLayout(new GridLayout()); + } + if (this.items.size() > 1) { + this.setLayout(null); + } + this.repaint(); + this.revalidate(); + } + + /** + * Triggered by a drag event: resize all indicator items + */ + void resizeItemsByDrag() { + int refreshOffsetY = 0; + for (AbsItemView item : items) { + // Save offset + item.setCoordinateY(refreshOffsetY); + item.setBounds(0, refreshOffsetY, item.getWidth(), item.getHeight()); + refreshOffsetY += item.getHeight(); + } + + this.repaint(); + this.revalidate(); + } + + /** + * Triggered by the current component size change: re-adjust the size of all indicator items + * + * @param componentEvent Component Event + */ + void resizeItemsByComponent(ComponentEvent componentEvent) { + for (AbsItemView item : items) { + item.setSize(componentEvent.getComponent().getWidth(), item.getHeight()); + } + this.repaint(); + this.revalidate(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/MemoryItemView.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/MemoryItemView.java new file mode 100644 index 000000000..c396113a3 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/MemoryItemView.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview; + +import ohos.devtools.views.charts.FilledLineChart; +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.tooltip.LegendTooltip; +import ohos.devtools.views.layout.chartview.observer.MemoryChartObserver; + +import javax.swing.ImageIcon; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import static ohos.devtools.views.common.ColorConstants.CHART_BG; +import static ohos.devtools.views.common.ViewConstants.CHART_DEFAULT_HEIGHT; +import static ohos.devtools.views.common.ViewConstants.CHART_INIT_WIDTH; +import static ohos.devtools.views.common.ViewConstants.NUM_2; + +/** + * 内存指标分析项的视图面板 + * + * @since 2021/1/23 11:40 + */ +public class MemoryItemView extends AbsItemView { + /** + * 视图名称 + */ + private static final String NAME = "Memory"; + + /** + * 构造函数 + * + * @param bottomPanel 最底层面板 + * @param parent 当前视图的父级容器 + * @param coordinateY 当前面板在父级面板中的Y轴坐标,即Y轴偏移量 + */ + public MemoryItemView(ProfilerChartsView bottomPanel, ItemViewsPanel parent, int coordinateY) { + super(bottomPanel, parent, coordinateY); + // 初始化标题面板 + initTitlePanel(NAME); + // 添加Chart + addChart(); + } + + /** + * 添加Chart面板 + */ + private void addChart() { + chart = new FilledLineChart(this.bottomPanel); + chart.setMaxDisplayX(this.bottomPanel.getObserver().getStandard().getMaxDisplayMillis()); + chart.setMinMarkIntervalX(this.bottomPanel.getObserver().getStandard().getMinMarkInterval()); + chart.setSectionNumY(NUM_2); + chart.setAxisLabelY("MB"); + // 这里宽度给一个预设值,后面要根据chartPanel的宽度改变 + chart.setBounds(0, 0, CHART_INIT_WIDTH, CHART_DEFAULT_HEIGHT); + // Chart添加点击事件,点击后进入二级界面 + chart.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + MemoryStageView memoryStageView = bottomPanel.addMemoryStageView(); + memoryStageView.addChart(); + // 隐藏Tooltip,否则进入二级界面后,Tooltip仍然显示一级界面的数组 + LegendTooltip.getInstance().hideTip(); + // 手动刷新一次界面,否则暂停后进入二级界面Chart不会绘制 + ChartDataRange range = bottomPanel.getObserver().getStandard().getDisplayRange(); + bottomPanel.getObserver().notifyRefresh(range.getStartTime(), range.getEndTime()); + // 根据AbleUnfoldTable属性判断是否是选中状态 + if (bottomPanel.isAbleUnfoldTable()) { + bottomPanel.getTaskScenePanelChart().getjButtonBottom().setIcon(new ImageIcon( + MemoryItemView.class.getClassLoader().getResource("images/button_bottom_bar.png"))); + } else { + bottomPanel.getTaskScenePanelChart().getjButtonBottom().setIcon(new ImageIcon( + MemoryItemView.class.getClassLoader().getResource("images/button_bottom_bar_grey.png"))); + } + } + }); + + // 创建只存放Chart的面板,保证Chart可以正常添加至其他面板 + JPanel onlyChartPanel = new JPanel(null); + onlyChartPanel.add(chart); + // 添加chart面板背景颜色 + onlyChartPanel.setBackground(CHART_BG); + // 添加监听事件,面板宽高改变的时候要修改Chart的宽高 + onlyChartPanel.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent componentEvent) { + chart.setBounds(0, 0, componentEvent.getComponent().getWidth(), + componentEvent.getComponent().getHeight()); + onlyChartPanel.repaint(); + onlyChartPanel.revalidate(); + } + }); + + // Chart需要绘制标尺,把他加入集合 + this.bottomPanel.addRulerComp(chart); + // 把Chart观察者注册到主界面,监听主界面的刷新时事件 + MemoryChartObserver chartObserver = new MemoryChartObserver(chart, bottomPanel.getSessionId()); + this.bottomPanel.getObserver().attach(chartObserver); + + this.add(onlyChartPanel, BorderLayout.CENTER); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/MemoryStageTitleView.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/MemoryStageTitleView.java new file mode 100644 index 000000000..ae456de46 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/MemoryStageTitleView.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview; + +import com.intellij.openapi.ui.ComboBox; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.chart.ProfilerTimeline; +import ohos.devtools.views.layout.swing.LevelTablePanel; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JPanel; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import static ohos.devtools.views.common.ColorConstants.ITEM_PANEL; +import static ohos.devtools.views.common.ViewConstants.LABEL_DEFAULT_HEIGHT; +import static ohos.devtools.views.common.ViewConstants.LABEL_DEFAULT_WIDTH; + +/** + * @Description 二级界面标题面板 + * @Date 2021/2/2 19:02 + **/ +public class MemoryStageTitleView extends AbsItemTitleView { + private final MemoryStageView memoryStageView; + + /** + * @param bottomPanel 最底层面板 + * @param name 二级页面的标题名称 + * @param memoryStageView 二级页面 + */ + public MemoryStageTitleView(ProfilerChartsView bottomPanel, String name, MemoryStageView memoryStageView) { + super(bottomPanel, name); + this.memoryStageView = memoryStageView; + initBackTitle(); + initCheckBox(name); + } + + /** + * 初始化标题 + */ + private void initBackTitle() { + JButton jButtonRun = new JButton( + new ImageIcon(MemoryStageTitleView.class.getClassLoader().getResource("images/backtrack.png"))); + jButtonRun.setPreferredSize(new Dimension(LABEL_DEFAULT_HEIGHT, LABEL_DEFAULT_HEIGHT)); + jButtonRun.setBorder(null); + jButtonRun.setBackground(ITEM_PANEL); + jButtonRun.setOpaque(false); + this.add(jButtonRun); + jButtonRun.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + bottomPanel.getObserver().detach(memoryStageView.getChartObserver()); + bottomPanel.removeStageView(memoryStageView); + bottomPanel.resumeMonitorItemView(); + bottomPanel.getTaskScenePanelChart().getjButtonBottom().setIcon(new ImageIcon( + MemoryStageTitleView.class.getClassLoader().getResource("images/button_bottom_bar_grey.png"))); + bottomPanel.setFlagDown(false); + bottomPanel.getTimeline().removeTablePanel(); + hideLeftTable(); + } + }); + } + + private void initCheckBox(String name) { + ComboBox jComboBox = new ComboBox<>(); + jComboBox.setBorder(null); + jComboBox.addItem(name); + jComboBox.setBackground(ITEM_PANEL); + jComboBox.setBounds(LayoutConstants.CHOOSE_HEIGHT, LayoutConstants.JLABEL_SIZE, LABEL_DEFAULT_WIDTH, + LABEL_DEFAULT_HEIGHT); + this.add(jComboBox); + } + + /** + * 隐藏右边列表 + */ + private void hideLeftTable() { + ProfilerTimeline timeline = bottomPanel.getTimeline(); + if (timeline != null) { + LevelTablePanel levelTablePanel = timeline.getLevelTablePanel(); + if (levelTablePanel != null) { + JPanel suspensionTable = levelTablePanel.getSuspensionTable(); + if (suspensionTable != null) { + suspensionTable.setVisible(false); + } + } + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/MemoryStageView.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/MemoryStageView.java new file mode 100644 index 000000000..5995a791d --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/MemoryStageView.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview; + +import ohos.devtools.views.charts.FilledLineChart; +import ohos.devtools.views.charts.ProfilerChart; +import ohos.devtools.views.layout.chartview.observer.MemoryStageObserver; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; + +import static ohos.devtools.views.common.ColorConstants.CHART_BG; +import static ohos.devtools.views.common.ViewConstants.CHART_DEFAULT_HEIGHT; +import static ohos.devtools.views.common.ViewConstants.CHART_INIT_WIDTH; +import static ohos.devtools.views.common.ViewConstants.NUM_2; + +/** + * MemoryStageView类 + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class MemoryStageView extends JPanel { + /** + * 视图名称 + */ + private static final String NAME = "Memory"; + + /** + * 最底层面板 + */ + private final ProfilerChartsView bottomPanel; + + private MemoryStageTitleView memoryStageTitleView; + + private ProfilerChart chart; + + private MemoryStageObserver chartObserver; + + /** + * 构造函数 + * + * @param bottomPanel 最底层面板 + */ + public MemoryStageView(ProfilerChartsView bottomPanel) { + super(true); + this.setLayout(new BorderLayout()); + this.bottomPanel = bottomPanel; + initTitlePanel(); + } + + /** + * 初始化标题面板 + */ + private void initTitlePanel() { + memoryStageTitleView = new MemoryStageTitleView(this.bottomPanel, NAME, this); + this.add(memoryStageTitleView, BorderLayout.NORTH); + // 标题面板需要绘制标尺,把他加入集合 + this.bottomPanel.addRulerComp(memoryStageTitleView); + } + + /** + * 添加Chart面板 + */ + public void addChart() { + chart = new FilledLineChart(this.bottomPanel); + chart.setMaxDisplayX(this.bottomPanel.getObserver().getStandard().getMaxDisplayMillis()); + chart.setMinMarkIntervalX(this.bottomPanel.getObserver().getStandard().getMinMarkInterval()); + chart.setSectionNumY(NUM_2); + chart.setAxisLabelY("MB"); + // 这里宽度给一个预设值,后面要根据chartPanel的宽度改变 + chart.setBounds(0, 0, CHART_INIT_WIDTH, CHART_DEFAULT_HEIGHT); + + // 创建只存放Chart的面板,保证Chart可以正常添加至其他面板 + JPanel onlyChartPanel = new JPanel(null); + onlyChartPanel.add(chart); + // 添加chart面板背景颜色 + onlyChartPanel.setBackground(CHART_BG); + // 添加监听事件,面板宽高改变的时候要修改Chart的宽高 + onlyChartPanel.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent componentEvent) { + chart.setBounds(0, 0, componentEvent.getComponent().getWidth(), + componentEvent.getComponent().getHeight()); + onlyChartPanel.repaint(); + onlyChartPanel.revalidate(); + } + }); + + // Chart需要绘制标尺,把他加入集合 + this.bottomPanel.addRulerComp(chart); + // 把Chart观察者注册到主界面,监听主界面的刷新时事件 + chartObserver = new MemoryStageObserver(chart, bottomPanel.getSessionId()); + this.bottomPanel.getObserver().attach(chartObserver); + this.add(onlyChartPanel, BorderLayout.CENTER); + } + + ProfilerChart getChart() { + return chart; + } + + MemoryStageTitleView getItemTitleStagePanel() { + return memoryStageTitleView; + } + + /** + * getChartObserver + * + * @return MemoryStageObserver + */ + public MemoryStageObserver getChartObserver() { + return chartObserver; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/ProfilerChartsView.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/ProfilerChartsView.java new file mode 100644 index 000000000..3c99fbc2e --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/ProfilerChartsView.java @@ -0,0 +1,489 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview; + +import com.intellij.ui.components.JBLabel; +import ohos.devtools.views.common.ProfilerMonitorItem; +import ohos.devtools.views.common.chart.ProfilerScrollbar; +import ohos.devtools.views.common.chart.ProfilerTimeline; +import ohos.devtools.views.layout.chartview.observer.CacheObserver; +import ohos.devtools.views.layout.chartview.observer.ProfilerChartsViewObserver; +import ohos.devtools.views.layout.chartview.observer.TimelineObserver; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; + +import javax.swing.ImageIcon; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.Spring; +import javax.swing.SpringLayout; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; + +import static java.awt.Image.SCALE_DEFAULT; +import static javax.swing.SpringLayout.Constraints; +import static ohos.devtools.views.common.ColorConstants.CHART_BG; +import static ohos.devtools.views.common.LayoutConstants.LOADING_SIZE; +import static ohos.devtools.views.common.ViewConstants.NUM_2; +import static ohos.devtools.views.common.ViewConstants.TIMELINE_HEIGHT; +import static ohos.devtools.views.common.ViewConstants.TIMELINE_WIDTH; + +/** + * 监控界面Chart面板,包括顶部Timeline和Chart + * + * @since 2021/1/25 9:30 + */ +public class ProfilerChartsView extends JPanel { + /** + * sessionMap + */ + public static Map sessionMap = new HashMap<>(); + + /** + * sessionId + */ + private final long sessionId; + + /** + * Chart显示界面的Monitor + */ + private final ProfilerChartsViewObserver observer; + + /** + * 保存时间线和监控项的Pane + * + * @see "加这个Panel是由于Java heap的table之前会add到south,和滚动条位置冲突,造成两个组件闪烁" + */ + private final JPanel mainPanel; + + /** + * 保存各个指标项的面板 + */ + private final ItemViewsPanel itemsPanel; + + /** + * 需要绘制标尺的组件集合 + * + * @see "Map<组件,是否已经绘制了标尺>" + */ + private final Map rulerCompMap = new HashMap<>(); + + /** + * 绘制标尺的X坐标,以Chart和Timeline起点为0点 + */ + private int rulerXCoordinate = 0; + + /** + * 鼠标当前进入的组件 + */ + private JComponent currentEntered; + + /** + * 自定义水平滚动条 + */ + private ProfilerScrollbar horizontalBar; + + /** + * 暂停标志 + */ + private boolean flagEnd = false; + + /** + * 停止标志 + */ + private boolean stopFlag = false; + + /** + * 向下扩展标志 + */ + private boolean flagDown = false; + + /** + * 新增配置项标志 + */ + private boolean addItemFlag = false; + + private final TaskScenePanelChart taskScenePanelChart; + + private ProfilerTimeline timeline; + + private JPanel loadingPanel; + + /** + * chart界面的层级判断 + * + * @see "true:二级界面,false:一级界面" + */ + private boolean chartLevel = false; + + /** + * chart界面的是否展开 + * + * @see "true:二级界面,false:一级界面" + */ + private boolean ableUnfoldTable = false; + + /** + * Chart是否在加载(初始化时等待数据库处理数据) + */ + private boolean isLoading = false; + + /** + * 构造函数 + * + * @param sessionId JPanel + * @param isTraceFile 是否为Trace文件静态导入模式 + * @param taskScenePanelChart 用于chart滚动条拖动,获取对象,设置暂停或者开始按钮图标 + */ + public ProfilerChartsView(long sessionId, boolean isTraceFile, TaskScenePanelChart taskScenePanelChart) { + super(true); + this.setOpaque(true); + this.setLayout(new BorderLayout()); + this.setBackground(CHART_BG); + + // 初始化mainPanel并add至当前View + this.mainPanel = new JPanel(new BorderLayout()); + this.mainPanel.setOpaque(true); + this.add(mainPanel, BorderLayout.CENTER); + + this.sessionId = sessionId; + this.taskScenePanelChart = taskScenePanelChart; + this.observer = new ProfilerChartsViewObserver(this, isTraceFile); + // 初始化Timeline + initTimeline(taskScenePanelChart); + // 添加 + CacheObserver chartObserver = new CacheObserver(sessionId); + this.getObserver().attach(chartObserver); + + // 初始化并添加保存各个指标项的布局 + this.itemsPanel = new ItemViewsPanel(this); + this.mainPanel.add(itemsPanel, BorderLayout.CENTER); + sessionMap.put(this.sessionId, this); + // 添加组件大小变化的监听器 + addResizedListener(); + } + + /** + * 添加组件大小变化的监听器 + */ + private void addResizedListener() { + this.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent exception) { + // 组件大小变化时,要调整滚动条的大小和位置 + if (horizontalBar != null) { + horizontalBar.resizeAndReposition(); + } + } + }); + } + + /** + * 初始化Timeline + * + * @param taskScenePanelChart taskScenePanelChart + */ + private void initTimeline(TaskScenePanelChart taskScenePanelChart) { + // 初始化时间线,这里宽高给一个预设值 + timeline = new ProfilerTimeline(this, TIMELINE_WIDTH, TIMELINE_HEIGHT, taskScenePanelChart); + // 保存时间线的绘图标准 + timeline.setMaxDisplayTime(observer.getStandard().getMaxDisplayMillis()); + timeline.setMinMarkInterval(observer.getStandard().getMinMarkInterval()); + + // 创建Timeline的观察者,并注册至主界面 + TimelineObserver timelineObserver = new TimelineObserver(timeline); + observer.attach(timelineObserver); + // Timeline需要绘制标尺,把他加入集合 + this.addRulerComp(timeline); + + // 组件添加至mainPanel + this.mainPanel.add(timeline, BorderLayout.NORTH); + } + + /** + * 初始化水平滚动条 + */ + public void initScrollbar() { + this.horizontalBar = new ProfilerScrollbar(this); + this.mainPanel.add(horizontalBar, BorderLayout.SOUTH); + this.observer.setScrollbarShow(true); + } + + /** + * 移除水平滚动条 + */ + public void removeScrollbar() { + this.observer.setScrollbarShow(false); + if (horizontalBar != null) { + this.mainPanel.remove(horizontalBar); + this.horizontalBar = null; + } + } + + /** + * 显示Loading标识,并且禁用停止和暂停按钮事件 + */ + public void showLoading() { + SpringLayout spring = new SpringLayout(); + loadingPanel = new JPanel(spring); + loadingPanel.setBackground(CHART_BG); + JBLabel loadingLabel = new JBLabel(); + + new SwingWorker<>() { + @Override + protected Object doInBackground() { + URL url = ProfilerChartsView.class.getClassLoader().getResource("images/loading.gif"); + if (url != null) { + ImageIcon icon = new ImageIcon(url); + icon.setImage(icon.getImage().getScaledInstance(LOADING_SIZE, LOADING_SIZE, SCALE_DEFAULT)); + loadingLabel.setIcon(icon); + } + loadingPanel.add(loadingLabel); + + return loadingPanel; + } + + @Override + protected void done() { + // 增加约束,保持Loading图在组件中间 + Constraints loadingCons = spring.getConstraints(loadingLabel); + loadingCons.setX(Spring.constant((loadingPanel.getWidth() - LOADING_SIZE) / NUM_2)); + loadingCons.setY(Spring.constant((loadingPanel.getHeight() - LOADING_SIZE) / NUM_2)); + // 手动触发组件布局事件 + loadingPanel.revalidate(); + + loadingPanel.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent componentEvent) { + super.componentResized(componentEvent); + Constraints loadingCons = spring.getConstraints(loadingLabel); + loadingCons.setX(Spring.constant((loadingPanel.getWidth() - LOADING_SIZE) / NUM_2)); + loadingCons.setY(Spring.constant((loadingPanel.getHeight() - LOADING_SIZE) / NUM_2)); + loadingPanel.revalidate(); + } + }); + + // Loading界面加载完成,现在开始检查Loading结果:Loading完成后启动刷新 + observer.checkLoadingResult(); + } + }.execute(); + + isLoading = true; + this.remove(mainPanel); + this.add(loadingPanel, BorderLayout.CENTER); + } + + /** + * 隐藏Loading标识,并且禁用停止和暂停按钮事件 + */ + public void hideLoading() { + if (loadingPanel != null) { + this.remove(loadingPanel); + } + isLoading = false; + this.add(mainPanel, BorderLayout.CENTER); + } + + /** + * 添加一项监控的指标项视图 + * + * @param item 指标项枚举类 + */ + public void addMonitorItemView(ProfilerMonitorItem item) { + itemsPanel.addMonitorItemView(item); + } + + /** + * 添加内存信息二级视图 + * + * @return MemoryStageView + */ + public MemoryStageView addMemoryStageView() { + chartLevel = true; + removeMonitorItemView(); + MemoryStageView memoryStageItem = new MemoryStageView(this); + this.mainPanel.add(memoryStageItem, BorderLayout.CENTER); + return memoryStageItem; + } + + /** + * 创建二级界面时,移除一级界面的监控项视图 + * + * @see "不能通过visible来实现,这样从二级界面返回一级时,itemsPanel宽高无法自适应" + */ + private void removeMonitorItemView() { + this.mainPanel.remove(itemsPanel); + } + + /** + * 移除二级界面视图 + * + * @param stageView MemoryStageView + */ + void removeStageView(MemoryStageView stageView) { + this.mainPanel.remove(stageView); + // Chart和Title也从标尺Map中移除 + rulerCompMap.remove(stageView.getChart()); + rulerCompMap.remove(stageView.getItemTitleStagePanel()); + } + + /** + * 返回一级界面时,重新添加监控项视图 + */ + void resumeMonitorItemView() { + // 返回一级界面时增加关闭展开 + flagDown = false; + chartLevel = false; + for (Component comp : itemsPanel.getComponents()) { + if (comp instanceof AbsItemView) { + AbsItemView absItemView = (AbsItemView) comp; + absItemView.getChart().initMaxUnitY(); + } + } + this.mainPanel.add(itemsPanel); + } + + /** + * 添加需要绘制标尺的组件 + * + * @param comp JComponent + */ + void addRulerComp(JComponent comp) { + rulerCompMap.put(comp, Boolean.FALSE); + } + + /** + * 组件的标尺已绘制 + * + * @param comp JComponent + */ + public void compRulerDrawn(JComponent comp) { + rulerCompMap.put(comp, Boolean.TRUE); + } + + /** + * 重置组件标尺状态为未绘制 + */ + public void resetRulerDrawStatus() { + rulerCompMap.keySet().forEach((comp -> rulerCompMap.put(comp, Boolean.FALSE))); + } + + /** + * 刷新组件列表的标尺 + */ + public void refreshCompRuler() { + rulerCompMap.forEach((comp, isDrawn) -> { + // 如果已经绘制过,不需要再重复绘制,防止无限循环 + if (!isDrawn) { + comp.repaint(); + comp.revalidate(); + } + }); + } + + public ProfilerChartsViewObserver getObserver() { + return observer; + } + + public JPanel getMainPanel() { + return mainPanel; + } + + public int getRulerXCoordinate() { + return rulerXCoordinate; + } + + public void setRulerXCoordinate(int rulerXCoordinate) { + this.rulerXCoordinate = rulerXCoordinate; + } + + public JComponent getCurrentEntered() { + return currentEntered; + } + + public void setCurrentEntered(JComponent currentEntered) { + this.currentEntered = currentEntered; + } + + public ProfilerScrollbar getHorizontalBar() { + return horizontalBar; + } + + public long getSessionId() { + return sessionId; + } + + public boolean isFlagEnd() { + return flagEnd; + } + + public void setFlagEnd(boolean flagEnd) { + this.flagEnd = flagEnd; + } + + public boolean isStopFlag() { + return stopFlag; + } + + public void setStopFlag(boolean stopFlag) { + this.stopFlag = stopFlag; + } + + public boolean isFlagDown() { + return flagDown; + } + + public void setFlagDown(boolean flagDown) { + this.flagDown = flagDown; + } + + public boolean isAddItemFlag() { + return addItemFlag; + } + + public void setAddItemFlag(boolean addItemFlag) { + this.addItemFlag = addItemFlag; + } + + public ProfilerTimeline getTimeline() { + return timeline; + } + + public TaskScenePanelChart getTaskScenePanelChart() { + return taskScenePanelChart; + } + + public boolean isChartLevel() { + return chartLevel; + } + + public boolean isAbleUnfoldTable() { + return ableUnfoldTable; + } + + public void setAbleUnfoldTable(boolean ableUnfoldTable) { + this.ableUnfoldTable = ableUnfoldTable; + } + + public boolean isLoading() { + return isLoading; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/event/IChartEventObserver.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/event/IChartEventObserver.java new file mode 100644 index 000000000..4e8b4ab46 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/event/IChartEventObserver.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview.event; + +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; + +/** + * Chart刷新事件观察者 + * + * @since 2021/1/26 19:28 + */ +public interface IChartEventObserver { + /** + * 刷新绘图标准 + * + * @param standard 绘图标准 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param maxDisplayTime 最大显示时间 + */ + void refreshStandard(ChartStandard standard, int startTime, int endTime, int maxDisplayTime); + + /** + * 刷新视图 + * + * @param range 时间范围 + * @param firstTimestamp 本次Chart首次创建并启动刷新时的时间戳 + * @param isUseCache 是否使用缓存机制 + */ + void refreshView(ChartDataRange range, long firstTimestamp, boolean isUseCache); +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/event/IChartEventPublisher.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/event/IChartEventPublisher.java new file mode 100644 index 000000000..19155878a --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/event/IChartEventPublisher.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview.event; + +/** + * Chart事件发布者 + * + * @ClassName: IChartEventPublisher + * @since 2021/1/26 19:32 + */ +public interface IChartEventPublisher { + /** + * 添加监听者 + * + * @param listener IChartEventListener + */ + void attach(IChartEventObserver listener); + + /** + * 移除监听者 + * + * @param listener IChartEventListener + */ + void detach(IChartEventObserver listener); + + /** + * 通知刷新 + * + * @param start 开始时间 + * @param end 结束时间 + */ + void notifyRefresh(int start, int end); +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/CacheObserver.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/CacheObserver.java new file mode 100644 index 000000000..785cae699 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/CacheObserver.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview.observer; + +import ohos.devtools.services.memory.MemoryService; +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; +import ohos.devtools.views.layout.chartview.event.IChartEventObserver; + +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import static ohos.devtools.views.common.LayoutConstants.INDEX_FOUR; +import static ohos.devtools.views.common.LayoutConstants.TEN; +import static ohos.devtools.views.common.ViewConstants.INITIAL_VALUE; + +/** + * 缓存观察类 + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class CacheObserver implements IChartEventObserver { + /** + * 缓存去数据库获取新数据的间隔 + */ + private static final int CACHE_FREQ = 500; + + /** + * 线程池 + */ + private final ThreadPoolExecutor executor; + + /** + * Session Id + */ + private final long sessionId; + + /** + * 标识时间,缓存每隔CACHE_FREQ去数据库拿一次数据 + */ + private int flagTime = INITIAL_VALUE; + + /** + * 构造函数 + * + * @param sessionId Session Id + */ + public CacheObserver(long sessionId) { + this.sessionId = sessionId; + executor = new ThreadPoolExecutor(INDEX_FOUR, TEN, TEN, TimeUnit.SECONDS, new ArrayBlockingQueue<>(INDEX_FOUR), + new ThreadPoolExecutor.DiscardOldestPolicy()); + } + + /** + * refreshStandard + * + * @param standard 绘图标准 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param maxDisplayTime 最大显示时间 + */ + @Override + public void refreshStandard(ChartStandard standard, int startTime, int endTime, int maxDisplayTime) { + } + + /** + * refreshView + * + * @param range 时间范围 + * @param firstTimestamp 本次Chart首次创建并启动刷新时的时间戳 + * @param isUseCache 是否使用缓存机制 + */ + @Override + public void refreshView(ChartDataRange range, long firstTimestamp, boolean isUseCache) { + if (flagTime == INITIAL_VALUE) { + addCacheData(range.getEndTime(), firstTimestamp); + } + int endTime = range.getEndTime(); + if (endTime < CACHE_FREQ) { + return; + } + // endTime < flagTime,说明停止后重新启动了新任务,这里要初始化flagTime + if (endTime < flagTime) { + addCacheData(range.getEndTime(), firstTimestamp); + flagTime = INITIAL_VALUE; + return; + } + if (endTime - flagTime > CACHE_FREQ) { + // 调用数据库,获取数据 + addCacheData(endTime, firstTimestamp); + // 刷新标识时间 + flagTime = endTime; + } + } + + private void addCacheData(int lastTime, long firstTimestamp) { + executor.execute(new MemoryCacheThread(lastTime, firstTimestamp)); + } + + private final class MemoryCacheThread implements Runnable { + private final int endTime; + private final long firstTimestamp; + + private MemoryCacheThread(int endTime, long firstTimestamp) { + this.endTime = endTime; + this.firstTimestamp = firstTimestamp; + } + + /** + * run + */ + @Override + public void run() { + // 每CACHE_FREQ去数据库拿一次数据,但是要拿超过CACHE_FREQ的数据 + // 否则会因为Chart已经刷新到x秒,缓存中最后的数据也在x秒,导致Chart右侧抖动 + MemoryService.getInstance().addData(sessionId, endTime, endTime + CACHE_FREQ + CACHE_FREQ, firstTimestamp); + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/MemoryChartObserver.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/MemoryChartObserver.java new file mode 100644 index 000000000..40a1a5e00 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/MemoryChartObserver.java @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview.observer; + +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; +import ohos.devtools.datasources.utils.monitorconfig.service.MonitorConfigManager; +import ohos.devtools.services.memory.ChartDataCache; +import ohos.devtools.services.memory.MemoryDao; +import ohos.devtools.views.charts.ProfilerChart; +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; +import ohos.devtools.views.charts.model.ChartDataModel; +import ohos.devtools.views.layout.chartview.event.IChartEventObserver; +import org.apache.commons.collections.CollectionUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import static ohos.devtools.views.common.ColorConstants.MEMORY; + +/** + * 一级界面Memory Chart的观察者 + * + * @since 2021/3/1 14:58 + */ +public class MemoryChartObserver implements IChartEventObserver { + private static final Logger LOGGER = LogManager.getLogger(MemoryChartObserver.class); + + /** + * Profiler Chart + */ + private final ProfilerChart chart; + + private final Long sessionId; + + /** + * 构造函数 + * + * @param chart Profiler Chart + */ + public MemoryChartObserver(ProfilerChart chart, Long sessionId) { + this.sessionId = sessionId; + this.chart = chart; + } + + /** + * 刷新绘图标准 + * + * @param standard 绘图标准 + * @param startTime startTime + * @param endTime endTime + * @param maxDisplayTime maxDisplayTime + */ + @Override + public void refreshStandard(ChartStandard standard, int startTime, int endTime, int maxDisplayTime) { + // char绘制的跟随时间轴的放大缩小 + chart.setMaxDisplayX(standard.getMaxDisplayMillis()); + chart.setMinMarkIntervalX(standard.getMinMarkInterval()); + + // 跟随时间线同步 + chart.setStartTime(startTime); + chart.setEndTime(endTime); + + chart.repaint(); + chart.revalidate(); + } + + /** + * 刷新视图 + * + * @param range 时间范围 + * @param firstTimestamp 本次Chart首次创建并启动刷新时的时间戳 + * @param isUseCache 是否使用缓存 + */ + @Override + public void refreshView(ChartDataRange range, long firstTimestamp, boolean isUseCache) { + LinkedHashMap> dataMaps = new LinkedHashMap<>(); + LinkedHashMap dataMap; + + boolean isChartStop = chart.getBottomPanel().isFlagEnd() || chart.getBottomPanel().isStopFlag(); + if (isChartStop || !isUseCache) { + // 点击暂停后,读取数据库的时间 + dataMap = MemoryDao.getInstance() + .getData(sessionId, range.getStartTime(), range.getEndTime(), firstTimestamp, true); + } else { + dataMap = ChartDataCache.getInstance() + .getDataCache(String.valueOf(sessionId), range.getStartTime(), range.getEndTime(), firstTimestamp); + } + + Map> configMap = MonitorConfigManager.dataMap.get(sessionId); + if (configMap == null) { // 存放离线采集项数据 + LinkedList offLineIterm = new LinkedList<>(); + offLineIterm.add("Java"); + offLineIterm.add("Native"); + offLineIterm.add("Graphics"); + offLineIterm.add("Stack"); + offLineIterm.add("Code"); + offLineIterm.add("Others"); + // 存放memory离线采集项数据 + Map> offLineMap = new HashMap<>(); + offLineMap.put("Memory", offLineIterm); + // 构建离线memory采集项的dataMap对象 + MonitorConfigManager.dataMap.put(sessionId, offLineMap); + configMap = MonitorConfigManager.dataMap.get(sessionId); + } + + List configList = configMap.get("Memory"); + for (Long time : dataMap.keySet()) { + ChartDataModel total = new ChartDataModel(); + total.setName("Total"); + total.setColor(MEMORY); + MemoryPluginResult.AppSummary app = dataMap.get(time); + total.setValue(calcTotalValue(app, configList)); + long showTime = time - firstTimestamp; + dataMaps.put((int) showTime, Collections.singletonList(total)); + } + chart.refreshChart(range.getStartTime(), range.getEndTime(), dataMaps); + } + + /** + * 计算一节界面的Total值,要根据界面选择的指标项,而非所有指标项的Total值 + * + * @param app MemoryPluginResult.AppSummary + * @param configList List + * @return int + */ + private int calcTotalValue(MemoryPluginResult.AppSummary app, List configList) { + int total = 0; + if (CollectionUtils.isEmpty(configList)) { + total = (int) (app.getJavaHeap() + app.getNativeHeap() + app.getGraphics() + app.getStack() + app.getCode() + + app.getPrivateOther()); + return total; + } + + if (configList.contains("Java")) { + total += (int) (app.getJavaHeap()); + } + if (configList.contains("Native")) { + total += (int) (app.getNativeHeap()); + } + if (configList.contains("Graphics")) { + total += (int) (app.getGraphics()); + } + if (configList.contains("Stack")) { + total += (int) (app.getStack()); + } + if (configList.contains("Code")) { + total += (int) (app.getCode()); + } + if (configList.contains("Others")) { + total += (int) (app.getPrivateOther()); + } + return total; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/MemoryStageObserver.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/MemoryStageObserver.java new file mode 100644 index 000000000..e14769339 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/MemoryStageObserver.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview.observer; + +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; +import ohos.devtools.datasources.utils.monitorconfig.service.MonitorConfigManager; +import ohos.devtools.services.memory.ChartDataCache; +import ohos.devtools.services.memory.MemoryDao; +import ohos.devtools.views.charts.ProfilerChart; +import ohos.devtools.views.charts.model.ChartDataModel; +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; +import ohos.devtools.views.common.MonitorItemDetail; +import ohos.devtools.views.layout.chartview.event.IChartEventObserver; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import static ohos.devtools.views.common.MonitorItemDetail.MEM_CODE; +import static ohos.devtools.views.common.MonitorItemDetail.MEM_GRAPHICS; +import static ohos.devtools.views.common.MonitorItemDetail.MEM_JAVA; +import static ohos.devtools.views.common.MonitorItemDetail.MEM_NATIVE; +import static ohos.devtools.views.common.MonitorItemDetail.MEM_OTHERS; +import static ohos.devtools.views.common.MonitorItemDetail.MEM_STACK; + +/** + * MemoryStageObserver类 + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class MemoryStageObserver implements IChartEventObserver { + /** + * Profiler Chart + */ + private final ProfilerChart chart; + + private final Long sessionId; + + /** + * 构造函数 + * + * @param chart Profiler Chart + * @param sessionId Long sessionId + */ + public MemoryStageObserver(ProfilerChart chart, Long sessionId) { + this.chart = chart; + this.sessionId = sessionId; + } + + /** + * 刷新绘图标准 + * + * @param standard 绘图标准 + * @param startTime startTime + * @param endTime endTime + * @param maxDisplayTime maxDisplayTime + */ + @Override + public void refreshStandard(ChartStandard standard, int startTime, int endTime, int maxDisplayTime) { + // char绘制的跟随时间轴的放大缩小 + chart.setMaxDisplayX(standard.getMaxDisplayMillis()); + chart.setMinMarkIntervalX(standard.getMinMarkInterval()); + + // 跟随时间线同步 + chart.setStartTime(startTime); + chart.setEndTime(endTime); + + chart.repaint(); + chart.revalidate(); + } + + /** + * 刷新视图 + * + * @param range 时间范围 + * @param firstTimestamp 本次Chart首次创建并启动刷新时的时间戳 + * @param isUseCache 是否使用缓存 + */ + @Override + public void refreshView(ChartDataRange range, long firstTimestamp, boolean isUseCache) { + LinkedHashMap> dataMaps = new LinkedHashMap<>(); + LinkedHashMap dataMap; + + boolean isChartStop = chart.getBottomPanel().isFlagEnd() || chart.getBottomPanel().isStopFlag(); + if (isChartStop || !isUseCache) { + // 点击暂停后,读取数据库的时间 + dataMap = MemoryDao.getInstance() + .getData(sessionId, range.getStartTime(), range.getEndTime(), firstTimestamp, true); + } else { + dataMap = ChartDataCache.getInstance() + .getDataCache(String.valueOf(sessionId), range.getStartTime(), range.getEndTime(), firstTimestamp); + } + + Map> configMap = MonitorConfigManager.dataMap.get(sessionId); + if (configMap == null) { // 存放离线采集项数据 + LinkedList offLineIterm = new LinkedList<>(); + offLineIterm.add("Java"); + offLineIterm.add("Native"); + offLineIterm.add("Graphics"); + offLineIterm.add("Stack"); + offLineIterm.add("Code"); + offLineIterm.add("Others"); + // 存放memory离线采集项数据 + Map> offLineMap = new HashMap<>(); + offLineMap.put("Memory", offLineIterm); + // 构建离线memory采集项的dataMap对象 + MonitorConfigManager.dataMap.put(sessionId, offLineMap); + configMap = MonitorConfigManager.dataMap.get(sessionId); + } + + List configList = configMap.get("Memory"); + for (Long time : dataMap.keySet()) { + MemoryPluginResult.AppSummary app = dataMap.get(time); + List list = buildModelsByConfig(app, configList); + long showTime = time - firstTimestamp; + dataMaps.put((int) showTime, list); + } + chart.refreshChart(range.getStartTime(), range.getEndTime(), dataMaps); + } + + private List buildModelsByConfig(MemoryPluginResult.AppSummary app, List configList) { + List list = new ArrayList<>(); + if (configList.contains("Java")) { + ChartDataModel memJava = setConfigIndex(MEM_JAVA); + memJava.setValue((int) (app.getJavaHeap())); + list.add(memJava); + } + if (configList.contains("Native")) { + ChartDataModel memNative = setConfigIndex(MEM_NATIVE); + memNative.setValue((int) (app.getNativeHeap())); + list.add(memNative); + } + if (configList.contains("Graphics")) { + ChartDataModel memGraphics = setConfigIndex(MEM_GRAPHICS); + memGraphics.setValue((int) (app.getGraphics())); + list.add(memGraphics); + } + if (configList.contains("Stack")) { + ChartDataModel memStack = setConfigIndex(MEM_STACK); + memStack.setValue((int) (app.getStack())); + list.add(memStack); + } + if (configList.contains("Code")) { + ChartDataModel memCode = setConfigIndex(MEM_CODE); + memCode.setValue((int) (app.getCode())); + list.add(memCode); + } + if (configList.contains("Others")) { + ChartDataModel memOthers = setConfigIndex(MEM_OTHERS); + memOthers.setValue((int) (app.getPrivateOther())); + list.add(memOthers); + } + return list; + } + + private ChartDataModel setConfigIndex(MonitorItemDetail monitorItemDetail) { + ChartDataModel memIndex = new ChartDataModel(); + memIndex.setIndex(monitorItemDetail.getIndex()); + memIndex.setColor(monitorItemDetail.getColor()); + memIndex.setName(monitorItemDetail.getName()); + return memIndex; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/ProfilerChartsViewObserver.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/ProfilerChartsViewObserver.java new file mode 100644 index 000000000..fc1445021 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/ProfilerChartsViewObserver.java @@ -0,0 +1,464 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview.observer; + +import ohos.devtools.datasources.utils.common.util.DateTimeUtil; +import ohos.devtools.datasources.utils.quartzmanager.QuartzManager; +import ohos.devtools.datasources.utils.session.entity.SessionInfo; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import ohos.devtools.services.memory.ChartDataCache; +import ohos.devtools.services.memory.MemoryService; +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.hoscomp.HosJButton; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.chartview.event.IChartEventObserver; +import ohos.devtools.views.layout.chartview.event.IChartEventPublisher; +import ohos.devtools.views.layout.swing.CountingThread; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.ImageIcon; +import javax.swing.SwingWorker; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import static ohos.devtools.views.common.LayoutConstants.CHART_START_DELAY; +import static ohos.devtools.views.common.ViewConstants.INITIAL_VALUE; +import static ohos.devtools.views.common.ViewConstants.NUM_10; +import static ohos.devtools.views.common.ViewConstants.REFRESH_FREQ; + +/** + * 监控界面保存Chart的面板的事件发布者 + * + * @since 2021/1/26 20:34 + */ +public class ProfilerChartsViewObserver implements IChartEventPublisher { + /** + * 日志 + */ + private static final Logger LOGGER = LogManager.getLogger(ProfilerChartsViewObserver.class); + + /** + * Chart监控界面的定时刷新线程的名称 + */ + private static final String RUN_NAME = "ProfilerChartsViewMonitorTimer"; + + /** + * Chart监控界面的定时刷新线程的进度条名称 + */ + private static final String RUN_NAME_SCROLLBAR = "ScrollbarTimer"; + + /** + * 监听的视图 + */ + private final ProfilerChartsView view; + + /** + * 是否为Trace文件静态导入模式 + * + * @see "true表示静态导入,false表示动态实时跟踪" + */ + private final boolean isTraceFile; + + /** + * 监听者的集合 + */ + private final List listeners = new ArrayList<>(); + + /** + * 异步初始化滚动条线程池 + */ + private final ThreadPoolExecutor scrollBarThreadPool = + new ThreadPoolExecutor(1, 1, 0, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>()); + + /** + * 绘图标准 + */ + private final ChartStandard standard; + + /** + * Chart刷新线程是否在运行 + */ + private boolean isRefreshing = false; + + /** + * 滚动条是否显示 + */ + private boolean isScrollbarShow = false; + + /** + * 启动任务时,本机时间和数据流中的时间偏移量 + */ + private long startOffset = INITIAL_VALUE; + + /** + * 刷新缓存所需要的时间范围 + */ + private ChartDataRange range = new ChartDataRange(); + + /** + * 构造函数 + * + * @param view 监听的视图 + * @param isTraceFile 是否为Trace文件静态导入模式 + */ + public ProfilerChartsViewObserver(ProfilerChartsView view, boolean isTraceFile) { + this.view = view; + this.isTraceFile = isTraceFile; + standard = new ChartStandard(view.getSessionId()); + } + + /** + * 展示Trace文件分析结果 + * + * @param firstTimestamp Trace文件中数据的开始时间 + * @param lastTimestamp Trace文件中数据的结束时间 + */ + public void showTraceResult(long firstTimestamp, long lastTimestamp) { + if (!isTraceFile) { + return; + } + + standard.setFirstTimestamp(firstTimestamp); + // 保存trace文件导入模式下最后一个数据的时间戳 + standard.setLastTimestamp(lastTimestamp); + int end = (int) (lastTimestamp - firstTimestamp); + int start; + if (end > standard.getMaxDisplayMillis()) { + start = end - standard.getMaxDisplayMillis(); + // 这里需要异步初始化滚动条,否则会因为view没有渲染导致滚动条无法显示 + scrollBarThreadPool.execute(() -> { + try { + TimeUnit.MILLISECONDS.sleep(LayoutConstants.FIVE_HUNDRED); + view.initScrollbar(); + view.getHorizontalBar().resizeAndReposition(); + isScrollbarShow = true; + } catch (InterruptedException exception) { + LOGGER.error("Asynchronous initialization scrollbar failed!", exception); + } + }); + } else { + start = 0; + } + notifyRefresh(start, end); + } + + /** + * 检查Loading结果:Loading完成后启动刷新 + */ + public void checkLoadingResult() { + new SwingWorker() { + @Override + protected SessionInfo doInBackground() { + SessionInfo info = SessionManager.getInstance().isRefsh(standard.getSessionId()); + while (info == null || !info.isStartRefsh()) { + try { + TimeUnit.MILLISECONDS.sleep(NUM_10); + } catch (InterruptedException exception) { + LOGGER.info("InterruptedException"); + } + info = SessionManager.getInstance().isRefsh(standard.getSessionId()); + } + return info; + } + + @Override + protected void done() { + try { + SessionInfo info = get(); + long first = info.getStartTimestamp(); + // 等待一段时间再启动刷新Chart,否则会导致查询的数据还未入库完成 + TimeUnit.MILLISECONDS.sleep(CHART_START_DELAY); + view.hideLoading(); + // 启动缓存和Chart + ChartDataCache.getInstance() + .initCache(String.valueOf(standard.getSessionId()), LayoutConstants.TWENTY_FIVE); + MemoryService.getInstance().addData(standard.getSessionId(), 0, CHART_START_DELAY, first); + startRefresh(first); + } catch (InterruptedException | ExecutionException e) { + LOGGER.error(String.format(Locale.ENGLISH, "Error occur when loading done: %s", e.toString())); + } + } + }.execute(); + } + + /** + * 开始刷新Chart + * + * @param firstTimestamp 本次Chart最后一个数据的时间戳 + */ + public void startRefresh(long firstTimestamp) { + if (isTraceFile) { + return; + } + view.setStopFlag(false); + view.setFlagEnd(false); + standard.setFirstTimestamp(firstTimestamp); + startOffset = DateTimeUtil.getNowTimeLong() - standard.getFirstTimestamp(); + // 启动Chart绘制定时器 + startChartTimer(); + isRefreshing = true; + } + + /** + * 启动Chart绘制定时器 + */ + private void startChartTimer() { + // 启动绘制Chart线程 + QuartzManager.getInstance().addExecutor(RUN_NAME, () -> { + try { + // 保存LastTimestamp,为当前时间戳减去Chart启动延迟 + standard.setLastTimestamp(DateTimeUtil.getNowTimeLong() - startOffset - CHART_START_DELAY); + int end = (int) (standard.getLastTimestamp() - standard.getFirstTimestamp()); + int start = end > standard.getMaxDisplayMillis() ? end - standard.getMaxDisplayMillis() : 0; + notifyRefresh(start, end); + } catch (Exception exception) { + LOGGER.error(exception.getMessage()); + } + }); + // 刷新间隔暂定30ms + QuartzManager.getInstance().startExecutor(RUN_NAME, 0, REFRESH_FREQ); + + // 如果有线程在刷新,则不需要再另起一个轮询线程。 + if (!isRefreshing) { + QuartzManager.getInstance().addExecutor(RUN_NAME_SCROLLBAR, () -> { + // 保存LastTimestamp,为当前时间戳减去Chart启动延迟 + standard.setLastTimestamp(DateTimeUtil.getNowTimeLong() - startOffset - CHART_START_DELAY); + int end = (int) (standard.getLastTimestamp() - standard.getFirstTimestamp()); + int start = end > standard.getMaxDisplayMillis() ? end - standard.getMaxDisplayMillis() : 0; + // 当end大于最大展示时间时,且滚动条未显示时,初始化显示滚动条,并把isScrollbarShow置为true + if (end > standard.getMaxDisplayMillis() && !isScrollbarShow) { + // isScrollbarShow判断必须保留,否则会导致Scrollbar重复初始化,频繁闪烁 + view.initScrollbar(); + isScrollbarShow = true; + } + notifyRefreshScrollbar(start, end); + }); + + // 刷新间隔暂定30ms + QuartzManager.getInstance().startExecutor(RUN_NAME_SCROLLBAR, 0, REFRESH_FREQ); + } + } + + /** + * 暂停刷新Chart + */ + public void pauseRefresh() { + if (isRefreshing) { + QuartzManager.getInstance().endExecutor(RUN_NAME); + isRefreshing = false; + view.setFlagEnd(true); + } + } + + /** + * 停止刷新Chart + * + * @param isOffline 设备是否断连 + */ + public void stopRefresh(boolean isOffline) { + QuartzManager.getInstance().endExecutor(RUN_NAME); + QuartzManager.getInstance().endExecutor(RUN_NAME_SCROLLBAR); + isRefreshing = false; + view.setStopFlag(true); + view.setFlagEnd(true); + if (isOffline) { + HosJButton buttonRun = view.getTaskScenePanelChart().getjButtonRun(); + HosJButton buttonStop = view.getTaskScenePanelChart().getjButtonStop(); + buttonRun.setIcon( + new ImageIcon(ProfilerChartsViewObserver.class.getClassLoader().getResource("images/over.png"))); + buttonRun.setEnabled(true); + ActionListener[] actionListenersRun = buttonRun.getActionListeners(); + for (ActionListener listener : actionListenersRun) { + buttonRun.removeActionListener(listener); + } + buttonStop.setIcon( + new ImageIcon(ProfilerChartsViewObserver.class.getClassLoader().getResource("images/suspended.png"))); + buttonStop.setEnabled(true); + ActionListener[] actionListenersStop = buttonStop.getActionListeners(); + for (ActionListener listener : actionListenersStop) { + buttonStop.removeActionListener(listener); + } + CountingThread countingThread = view.getTaskScenePanelChart().getCounting(); + countingThread.setStopFlag(true); + } + } + + /** + * 暂停后重新开始刷新Chart + */ + public void restartRefresh() { + if (isTraceFile) { + return; + } + + if (view.isStopFlag()) { + // 如果是已停止状态,则返回 + return; + } + + if (!isRefreshing) { + isRefreshing = true; + view.setFlagEnd(false); + startChartTimer(); + // 重新开始时,也要移除框选状态(暂定) + standard.clearSelectedRange(); + } + } + + /** + * 添加监听者 + * + * @param listener IChartEventListener + */ + @Override + public void attach(IChartEventObserver listener) { + listeners.add(listener); + } + + /** + * 移除监听者 + * + * @param listener IChartEventListener + */ + @Override + public void detach(IChartEventObserver listener) { + listeners.remove(listener); + } + + /** + * 通知刷新 + * + * @param start 开始时间 + * @param end 结束时间 + */ + @Override + public void notifyRefresh(int start, int end) { + standard.updateDisplayTimeRange(start, end); + listeners.forEach((lis) -> { + if (!(lis instanceof CacheObserver)) { + lis.refreshView(standard.getDisplayRange(), standard.getFirstTimestamp(), !isTraceFile); + } + }); + } + + /** + * 通知刷新滚动条 + * + * @param start 开始时间 + * @param end 结束时间 + */ + private void notifyRefreshScrollbar(int start, int end) { + // 当前时间超过最大展示时间,则调整滚动条长度和位置 + if (end > standard.getMaxDisplayMillis()) { + if (view.getHorizontalBar() != null) { + view.getHorizontalBar().resizeAndReposition(); + } + } + // 不暂停缓存的观察者 + listeners.forEach((lis) -> { + if (lis instanceof CacheObserver) { + range.setStartTime(start); + range.setEndTime(end); + lis.refreshView(range, standard.getFirstTimestamp(), !isTraceFile); + } + }); + } + + /** + * 时间线和char缩放 + * + * @param startTime 缩放后的界面开始时间 + * @param endTime 结束时间的界面开始时间 + * @param maxDisplayTime 窗体上可以显示的最大毫秒数 + */ + public void charZoom(int startTime, int endTime, int maxDisplayTime) { + // 修改char展示的时间范围 + standard.setMaxDisplayMillis(maxDisplayTime); + standard.updateDisplayTimeRange(startTime, endTime); + // standard绘图标准(这个参数传输需要创建新的对象,而缩放功能只是修改部分时间线和char的标准,所以这个参数建议移出) + listeners.forEach((lis) -> { + if (!(lis instanceof CacheObserver)) { + standard.setMaxDisplayMillis(maxDisplayTime); + lis.refreshStandard(standard, startTime, endTime, maxDisplayTime); + lis.refreshView(standard.getDisplayRange(), standard.getFirstTimestamp(), !isTraceFile); + } + }); + } + + /** + * 界面毫秒数的时间刻度缩放 + * + * @param maxDisplayTime 窗体上可以显示的最大毫秒数 + * @param minMarkInterval 窗体上可以显示的时间刻度的单位 + * @param newStartTime 新的开始时间 + * @param newEndTime 新的结束时间 + */ + public void msTimeZoom(int maxDisplayTime, int minMarkInterval, int newStartTime, int newEndTime) { + standard.setMaxDisplayMillis(maxDisplayTime); + standard.setMinMarkInterval(minMarkInterval); + standard.updateDisplayTimeRange(newStartTime, newEndTime); + // standard绘图标准(这个参数传输需要创建新的对象,而缩放功能只是修改部分时间线和chart的标准,所以这个参数建议移出) + listeners.forEach((lis) -> { + if (!(lis instanceof CacheObserver)) { + lis.refreshStandard(standard, newStartTime, newEndTime, maxDisplayTime); + lis.refreshView(standard.getDisplayRange(), standard.getFirstTimestamp(), !isTraceFile); + } + }); + } + + /** + * Getter + * + * @return ChartStandard + */ + public ChartStandard getStandard() { + return standard; + } + + /** + * Getter + * + * @return isTraceFile + */ + public boolean isTraceFile() { + return isTraceFile; + } + + public List getListeners() { + return listeners; + } + + public boolean isRefreshing() { + return isRefreshing; + } + + public boolean isScrollbarShow() { + return isScrollbarShow; + } + + public void setScrollbarShow(boolean scrollbarShow) { + isScrollbarShow = scrollbarShow; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/TimelineObserver.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/TimelineObserver.java new file mode 100644 index 000000000..01a23dd61 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/chartview/observer/TimelineObserver.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview.observer; + +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; +import ohos.devtools.views.common.chart.ProfilerTimeline; +import ohos.devtools.views.layout.chartview.event.IChartEventObserver; + +/** + * Profiler时间线的观察者 + * + * @since 2021/2/1 10:36 + */ +public class TimelineObserver implements IChartEventObserver { + /** + * Profiler时间线 + */ + private final ProfilerTimeline timeline; + + /** + * 构造函数 + * + * @param timeline Profiler时间线 + */ + public TimelineObserver(ProfilerTimeline timeline) { + this.timeline = timeline; + } + + /** + * 刷新绘图标准 + * + * @param standard 绘图标准 + * @param startTime startTime + * @param endTime endTime + * @param maxDisplayTime maxDisplayTime + */ + @Override + public void refreshStandard(ChartStandard standard, int startTime, int endTime, int maxDisplayTime) { + // timeline绘制的缩放尺寸设置 + timeline.setMaxDisplayTime(standard.getMaxDisplayMillis()); + timeline.setMinMarkInterval(standard.getMinMarkInterval()); + + // 重新更新开始和结束时间 + timeline.setStartTime(startTime); + timeline.setEndTime(endTime); + timeline.repaint(); + timeline.revalidate(); + } + + /** + * 刷新视图 + * + * @param range 时间范围 + * @param firstTimestamp 本次Chart首次创建并启动刷新时的时间戳 + * @param isUseCache 是否使用缓存机制 + */ + @Override + public void refreshView(ChartDataRange range, long firstTimestamp, boolean isUseCache) { + timeline.setStartTime(range.getStartTime()); + timeline.setEndTime(range.getEndTime()); + + timeline.repaint(); + timeline.revalidate(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/DeviceProcessJpanelEvent.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/DeviceProcessJpanelEvent.java new file mode 100644 index 000000000..15761e26b --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/DeviceProcessJpanelEvent.java @@ -0,0 +1,509 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.device.service.MultiDeviceManager; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import ohos.devtools.datasources.utils.process.service.ProcessManager; +import ohos.devtools.datasources.utils.quartzmanager.QuartzManager; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.Constant; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.swing.DeviceProcessJpanel; +import ohos.devtools.views.layout.swing.TaskScenePanel; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.DefaultComboBoxModel; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTable; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Vector; +import java.util.concurrent.ExecutionException; + +import static ohos.devtools.views.common.Constant.DEVICEREFRESH; + +/** + * DeviceProcessJpanelEvent + * + * @version 1.0 + * @date 2021/3/4 19:02 + **/ +public class DeviceProcessJpanelEvent extends TaskScenePanelEvent { + private static final Logger LOGGER = LogManager.getLogger(DeviceProcessJpanelEvent.class); + + private boolean flag = false; + + private Vector oldDevice = new Vector<>(); + + // 原始jTable,包含当前表格所有的进程列表 + private List processInfoList; + + private int rowCount = -1; + + /** + * searchJButtonSelect + * + * @param deviceProcessJpanel deviceProcessJpanel + * @param processInfoList processInfoList + */ + public void searchJButtonSelect(DeviceProcessJpanel deviceProcessJpanel, List processInfoList) { + // 搜索框输入值直接开始搜索 + deviceProcessJpanel.getTextField().getDocument().addDocumentListener(new DocumentListener() { + /** + * insertUpdate + * + * @param exception exception + */ + @Override + public void insertUpdate(DocumentEvent exception) { + DeviceProcessJpanelEvent.this.processInfoList = deviceProcessJpanel.getProinfos(); + if (!StringUtils.isEmpty(deviceProcessJpanel.getTextField().getText())) { + autoComplete(deviceProcessJpanel.getTextField().getText(), deviceProcessJpanel.getTable()); + } else { + autoComplete("", deviceProcessJpanel.getTable()); + } + } + + /** + * removeUpdate + * + * @param exception exception + */ + @Override + public void removeUpdate(DocumentEvent exception) { + DeviceProcessJpanelEvent.this.processInfoList = deviceProcessJpanel.getProinfos(); + if (!StringUtils.isEmpty(deviceProcessJpanel.getTextField().getText())) { + autoComplete(deviceProcessJpanel.getTextField().getText(), deviceProcessJpanel.getTable()); + } else { + autoComplete("", deviceProcessJpanel.getTable()); + } + } + + /** + * changedUpdate + * + * @param exception exception + */ + @Override + public void changedUpdate(DocumentEvent exception) { + } + }); + } + + /** + * itemStateChanged + * + * @param deviceProcessJpanel deviceProcessJpanel + * @param taskScenePanel taskScenePanel + * @param deviceNum deviceNum + * @param scrollPane scrollPane + */ + public void itemStateChanged(DeviceProcessJpanel deviceProcessJpanel, TaskScenePanel taskScenePanel, + String deviceNum, JPanel scrollPane) { + deviceProcessJpanel.getJComboBoxPhone().addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent exception) { + // 获取选中项,设置对象信息用于查询对应的进程信息 + for (DeviceIPPortInfo deviceInfo : deviceProcessJpanel.getDeviceInfos()) { + if (deviceInfo.getDeviceName().equals(deviceProcessJpanel.getJComboBoxPhone().getSelectedItem())) { + deviceProcessJpanel.createProcessList(deviceInfo, deviceNum, scrollPane, taskScenePanel); + } + } + } + }); + } + + /** + * clickTable + * + * @param deviceProcessJpanel deviceProcessJpanel + * @param deviceNum deviceNum + * @param deviceInfo deviceInfo + * @param scrollPane scrollPane + * @param taskScenePanel taskScenePanel + */ + public void clickTable(DeviceProcessJpanel deviceProcessJpanel, String deviceNum, DeviceIPPortInfo deviceInfo, + JPanel scrollPane, TaskScenePanel taskScenePanel) { + deviceProcessJpanel.getTable().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + int selectedRow = deviceProcessJpanel.getTable().getSelectedRow(); + deviceProcessJpanel.getLabelName() + .setText(deviceProcessJpanel.getTable().getValueAt(selectedRow, 0) + ""); + // 获取当前设备下的选中的进程信息 + for (int index = 0; index < deviceProcessJpanel.getProinfos().size(); index++) { + ProcessInfo mapValue = deviceProcessJpanel.getProinfos().get(index); + if (deviceProcessJpanel.getLabelName().getText() + .equals(mapValue.getProcessName() + "(" + mapValue.getProcessId() + ")")) { + // 更新map + DeviceIPPortInfo deviceIPPortInfo = deviceProcessJpanel.getDeviceInfos().get(0); + Map mapObject = new HashMap<>(); + mapObject.put(deviceIPPortInfo, deviceProcessJpanel.getProinfos().get(index)); + Constant.map.put(deviceNum, mapObject); + } + } + // 当选中值后,关闭进程下拉列表 + closeProcessList(deviceProcessJpanel, scrollPane, deviceProcessJpanel.getTaskScenePanelEvent(), + taskScenePanel); + } + }); + } + + /** + * 设备信息修改 + * + * @param deviceProcessJpanel deviceProcessJpanel + */ + public void devicesInfoJComboBoxUpdate(DeviceProcessJpanel deviceProcessJpanel) { + QuartzManager.getInstance().addExecutor(DEVICEREFRESH, new Runnable() { + @Override + public void run() { + List deviceInfos = MultiDeviceManager.getInstance().getAllDeviceIPPortInfos(); + + if (!deviceInfos.isEmpty()) { + deviceProcessJpanel.setDeviceInfos(deviceInfos); + Vector items = new Vector<>(); + deviceInfos.forEach(deviceInfo -> { + items.add(deviceInfo.getDeviceName()); + }); + if (!oldDevice.equals(items)) { + oldDevice = items; + deviceProcessJpanel.getJComboBoxPhone().setModel(new DefaultComboBoxModel(items)); + } + } else { + // 清空设备列表 + Vector items = new Vector<>(); + deviceProcessJpanel.getJComboBoxPhone().setModel(new DefaultComboBoxModel(items)); + Constant.map.clear(); + deviceProcessJpanel.getDeviceInfos().clear(); + // 清空进程列表 + List processInfos = new ArrayList<>(); + deviceProcessJpanel.setDeviceInfos(deviceInfos); + deviceProcessJpanel.setProinfos(processInfos); + deviceProcessJpanel.getLabelName().setText(""); + Vector columnNames = new Vector(); + columnNames.add(""); + Vector processNames = new Vector<>(); + DefaultTableModel model = new DefaultTableModel(processNames, columnNames); + JTable table = deviceProcessJpanel.getTable(); + table.setModel(model); + table.getTableHeader().setVisible(false); + table.setRowHeight(LayoutConstants.DEVICE_ADD_HEIGHT); + } + } + }); + QuartzManager.getInstance().startExecutor(DEVICEREFRESH, 0, LayoutConstants.THOUSAND); + } + + /** + * 自动完成 + * + * @param name name + * @param jTable jTable + */ + public void autoComplete(String name, JTable jTable) { + int rowCountNew = processInfoList.size(); + String[] columnNames = {""}; + if (!name.isEmpty()) { + int numTableValues = 0; + int count = 0; + for (int index = 0; index < rowCountNew; index++) { + ProcessInfo processInfo = processInfoList.get(index); + String processName = processInfo.getProcessName(); + if (processName.contains(name)) { + count++; + } + } + String[][] tableValues = new String[count][1]; + for (int index = 0; index < rowCountNew; index++) { + ProcessInfo processInfo = processInfoList.get(index); + String processName = processInfo.getProcessName(); + if (processName.contains(name)) { + tableValues[numTableValues][0] = + processInfo.getProcessName() + "(" + processInfo.getProcessId() + ")"; + numTableValues++; + } + } + DefaultTableModel model = new DefaultTableModel(tableValues, columnNames); + jTable.setModel(model); + } else { + int numTableValues = 0; + String[][] tableValues = new String[rowCountNew][1]; + for (int index = 0; index < rowCountNew; index++) { + ProcessInfo processInfo = processInfoList.get(index); + tableValues[numTableValues][0] = processInfo.getProcessName() + "(" + processInfo.getProcessId() + ")"; + numTableValues++; + } + DefaultTableModel model = new DefaultTableModel(tableValues, columnNames); + jTable.setModel(model); + } + } + + private void judgmentJbutton(DeviceProcessJpanel deviceProcessJpanel, TaskScenePanel taskScenePanel, String type) { + if ("open".equals(type) && deviceProcessJpanel.getComponentCount() == LayoutConstants.EIGHT_NUM) { + taskScenePanel.getJButtonAddDevice().setBounds(LayoutConstants.APP_LABEL_Y1, + taskScenePanel.getJButtonAddDevice().getY() + LayoutConstants.DEVICE_NAME_WIDTH, + LayoutConstants.DEVICE_ADD_WIDTH, LayoutConstants.DEVICE_ADD_HEIGHT); + } + if ("close".equals(type) && deviceProcessJpanel.getComponentCount() == LayoutConstants.INDEX_SEVEN) { + taskScenePanel.getJButtonAddDevice().setBounds(LayoutConstants.APP_LABEL_Y1, + taskScenePanel.getJButtonAddDevice().getY() - LayoutConstants.DEVICE_NAME_WIDTH, + LayoutConstants.DEVICE_ADD_WIDTH, LayoutConstants.DEVICE_ADD_HEIGHT); + } + } + + private void closeOrOpenProcessList(DeviceProcessJpanel deviceProcessJpanel, JPanel scrollPane, + TaskScenePanelEvent taskScenePanelEvent, String deviceNum, TaskScenePanel taskScenePanel) { + if (!flag) { + int numHeight = 0; + deviceProcessJpanel.add(deviceProcessJpanel.getJPanelProcess()); + deviceProcessJpanel + .setBounds(LayoutConstants.DEVICE_PRO_X, deviceProcessJpanel.getY(), LayoutConstants.DEVICE_PRO_WIDTH, + deviceProcessJpanel.getHeight() + LayoutConstants.DEVICE_NAME_WIDTH); + numHeight = forCycle(deviceProcessJpanel, scrollPane); + scrollPane.setPreferredSize(new Dimension(LayoutConstants.DEVICE_PRO_WIDTH, numHeight)); + taskScenePanelEvent.setNum(taskScenePanelEvent.getNum() + LayoutConstants.DEVICE_NAME_WIDTH); + // 判断当前panel是否含有adddevice按钮 + judgmentJbutton(deviceProcessJpanel, taskScenePanel, "open"); + SwingWorker>, Integer> task = + new SwingWorker>, Integer>() { + /** + * doInBackground + * + * @return HashMap> + * @throws Exception Exception + */ + @Override + protected HashMap> doInBackground() throws Exception { + List processInfos = new ArrayList<>(); + HashMap> map = new HashMap<>(); + for (DeviceIPPortInfo deviceInfo : deviceProcessJpanel.getDeviceInfos()) { + if (deviceInfo.getDeviceName() + .equals(deviceProcessJpanel.getJComboBoxPhone().getSelectedItem())) { + processInfos = ProcessManager.getInstance().getProcessList(deviceInfo); + map.put(deviceInfo, processInfos); + break; + } + } + return map; + } + + /** + * done + */ + @Override + protected void done() { + try { + doneProcessList(get(), deviceProcessJpanel, deviceNum, scrollPane); + } catch (InterruptedException exception) { + LOGGER.error(exception.getMessage()); + } catch (ExecutionException exception) { + LOGGER.error(exception.getMessage()); + } + } + }; + task.execute(); + flag = true; + } else { + // 关闭进程下拉列表 + closeProcessList(deviceProcessJpanel, scrollPane, taskScenePanelEvent, taskScenePanel); + } + } + + private void doneProcessList(HashMap> deviceProcess, + DeviceProcessJpanel deviceProcessJpanel, String deviceNum, JPanel scrollPane) { + List processInfos = new ArrayList<>(); + DeviceIPPortInfo deviceInfo = new DeviceIPPortInfo(); + Set>> entries = deviceProcess.entrySet(); + Iterator>> iterator = entries.iterator(); + while (iterator.hasNext()) { + Map.Entry> entry = iterator.next(); + deviceInfo = entry.getKey(); + processInfos = entry.getValue(); + } + + deviceProcessJpanel.setProinfos(processInfos); + // 创建列表 + Vector columnNames = new Vector(); + columnNames.add(""); + // 根据设备信息获取进程信息 + Vector processNames = new Vector<>(); + for (int index = 0; index < processInfos.size(); index++) { + ProcessInfo processInfo = processInfos.get(index); + Vector vector = new Vector(); + vector.add(processInfo.getProcessName() + "(" + processInfo.getProcessId() + ")"); + processNames.add(vector); + } + if (!processInfos.isEmpty()) { + // 更新map + Map mapObject = new HashMap<>(); + mapObject.put(deviceInfo, processInfos.get(0)); + Constant.map.put(deviceNum, mapObject); + } + + DefaultTableModel model = new DefaultTableModel(processNames, columnNames); + JTable table = deviceProcessJpanel.getTable(); + table.setModel(model); + table.getTableHeader().setVisible(false); + table.setRowHeight(LayoutConstants.DEVICE_ADD_HEIGHT); + scrollPane.updateUI(); + scrollPane.repaint(); + } + + /** + * forCycle + * + * @param deviceProcessJpanel deviceProcessJpanel + * @param numHeight numHeight + * @param scrollPane scrollPane + * @return int + */ + public int forCycle(DeviceProcessJpanel deviceProcessJpanel, JPanel scrollPane) { + Component[] component = scrollPane.getComponents(); + int newHeight = 0; + for (Component componentJpanel : component) { + JPanel jCom = (JPanel) componentJpanel; + newHeight += jCom.getHeight(); + if (jCom.getY() > deviceProcessJpanel.getY()) { + jCom.setBounds(LayoutConstants.DEVICE_PRO_X, jCom.getY() + LayoutConstants.DEVICE_NAME_WIDTH, + LayoutConstants.DEVICE_PRO_WIDTH, jCom.getHeight()); + } + } + return newHeight; + } + + private void closeProcessList(DeviceProcessJpanel deviceProcessJpanel, JPanel scrollPane, + TaskScenePanelEvent taskScenePanelEvent, TaskScenePanel taskScenePanel) { + deviceProcessJpanel.remove(deviceProcessJpanel.getJPanelProcess()); + deviceProcessJpanel + .setBounds(LayoutConstants.DEVICE_PRO_X, deviceProcessJpanel.getY(), LayoutConstants.DEVICE_PRO_WIDTH, + deviceProcessJpanel.getHeight() - LayoutConstants.DEVICE_NAME_WIDTH); + Component[] component = scrollPane.getComponents(); + for (Component componentJpanel : component) { + JPanel jCom = null; + if (componentJpanel instanceof JPanel) { + jCom = (JPanel) componentJpanel; + if (jCom.getY() > deviceProcessJpanel.getY()) { + jCom.setBounds(LayoutConstants.DEVICE_PRO_X, jCom.getY() - LayoutConstants.DEVICE_NAME_WIDTH, + LayoutConstants.DEVICE_PRO_WIDTH, jCom.getHeight()); + } + } + } + scrollPane.setPreferredSize(new Dimension(LayoutConstants.DEVICE_PRO_WIDTH, + scrollPane.getHeight() - LayoutConstants.DEVICE_NAME_WIDTH)); + taskScenePanelEvent.setNum(taskScenePanelEvent.getNum() - LayoutConstants.DEVICE_NAME_WIDTH); + // 判断当前panel是否含有adddevice按钮 + judgmentJbutton(deviceProcessJpanel, taskScenePanel, "close"); + scrollPane.updateUI(); + scrollPane.repaint(); + flag = false; + } + + /** + * addClickListener + * + * @param deviceProcessJpanel deviceProcessJpanel + * @param scrollPane scrollPane + * @param taskScenePanelEvent taskScenePanelEvent + * @param taskScenePanel taskScenePanel + * @param deviceNum deviceNum + */ + public void addClickListener(DeviceProcessJpanel deviceProcessJpanel, JPanel scrollPane, + TaskScenePanelEvent taskScenePanelEvent, TaskScenePanel taskScenePanel, String deviceNum) { + deviceProcessJpanel.getLabelName().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + closeOrOpenProcessList(deviceProcessJpanel, scrollPane, taskScenePanelEvent, deviceNum, taskScenePanel); + } + }); + } + + /** + * table鼠标悬停效果 + * + * @param table table + */ + public void mouseEffectTable(JTable table) { + table.setDefaultRenderer(Object.class, new TableCellRenderer()); + table.addMouseMotionListener(new MouseMotionAdapter() { + @Override + public void mouseMoved(final MouseEvent mMoved) { + rowCount = table.rowAtPoint(mMoved.getPoint()); + int row = table.rowAtPoint(mMoved.getPoint()); + int col = table.columnAtPoint(mMoved.getPoint()); + table.setRowSelectionInterval(row, row); + table.setColumnSelectionInterval(col, col); + } + }); + table.addMouseListener(new java.awt.event.MouseAdapter() { + @Override + public void mouseReleased(java.awt.event.MouseEvent mre) { + if (mre.getClickCount() == LayoutConstants.INDEX_ONE && SwingUtilities.isRightMouseButton(mre)) { + int row = table.rowAtPoint(mre.getPoint()); + int col = table.columnAtPoint(mre.getPoint()); + table.setRowSelectionInterval(row, row); + table.setColumnSelectionInterval(col, col); + } + } + }); + } + + class TableCellRenderer extends DefaultTableCellRenderer { + private static final long serialVersionUID = LayoutConstants.SERIALVERSIONUID; + + @Override + public Component getTableCellRendererComponent(JTable jtable, Object value, boolean isSelected, + boolean hasFocus, int row, int column) { + JLabel label = null; + Component tableCellRendererComponent = + super.getTableCellRendererComponent(jtable, value, isSelected, hasFocus, row, column); + + if (tableCellRendererComponent instanceof JLabel) { + label = (JLabel) tableCellRendererComponent; + if (row == rowCount) { + label.setBackground(ColorConstants.SELECTED_TABLE_COLOR); + } else { + label.setBackground(ColorConstants.SYSTEM_TUNNING_SETTING_CENTER); + } + } + return label; + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/HomeWindowEvent.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/HomeWindowEvent.java new file mode 100644 index 000000000..cf0b26055 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/HomeWindowEvent.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; +import ohos.devtools.views.common.Common; +import ohos.devtools.views.common.Constant; +import ohos.devtools.views.layout.swing.HomeWindow; +import ohos.devtools.views.layout.swing.TaskPanel; +import org.apache.logging.log4j.Level; + +import javax.swing.ImageIcon; +import javax.swing.JMenuItem; +import javax.swing.JTabbedPane; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * 一级界面事件处理对象 + * + * @version 1.0 + * @date 2021/03/01 15:20 + **/ +public class HomeWindowEvent { + // 初始化公共方法类 + private Common common = new Common(); + + /** + * clickAddTask + * + * @param homeWindow homeWindow + */ + public void clickAddTask(HomeWindow homeWindow) { + homeWindow.getJNewRealTimeTaskJMenuItem().addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent actionEvent) { + homeWindow.getTaskPanel().removeAll(); + if (Constant.jtasksTab == null || (Constant.jtasksTab != null + && Constant.jtasksTab.getTabCount() == 0)) { + Constant.jtasksTab = new JTabbedPane(); + } + new TaskPanel(homeWindow.getTaskPanel(), homeWindow.getTaskPanelWelcome()); + // 更新所有的run -- of -- + common.updateNum(Constant.jtasksTab); + homeWindow.setVisible(true); + } + }); + } + + /** + * clickUpdateLogLevel + * + * @param homeWindow homeWindow + */ + public void clickUpdateLogLevel(HomeWindow homeWindow) { + JMenuItem switchLog = HomeWindow.getJLogSwitch(); + switchLog.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent exception) { + Level logLevel = ProfilerLogManager.getSingleton().getNowLogLevel(); + if (Level.ERROR.equals(logLevel)) { + ProfilerLogManager.getSingleton().updateLogLevel(Level.DEBUG); + switchLog.setIcon(new ImageIcon( + TaskScenePanelChartEvent.class.getClassLoader() + .getResource("images/selected.png"))); + } else { + ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + switchLog.setIcon(null); + } + } + }); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/SystemTunningByTraceConfigEvent.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/SystemTunningByTraceConfigEvent.java new file mode 100644 index 000000000..1c9b0e3db --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/SystemTunningByTraceConfigEvent.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.device.service.MultiDeviceManager; +import ohos.devtools.datasources.utils.quartzmanager.QuartzManager; +import ohos.devtools.views.layout.swing.SystemTunningConfigPanel; +import ohos.devtools.views.layout.swing.TaskSystemTunningByTracePanel; + +import javax.swing.DefaultComboBoxModel; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.ClipboardOwner; +import java.awt.datatransfer.Transferable; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.util.List; +import java.util.Vector; + +import static ohos.devtools.views.common.Constant.DEVICEREFRESH; + +/** + * SystemTunningByTraceConfigEvent + * + * @version 1.0 + * @date 2021/04/10 15:16 + **/ +public class SystemTunningByTraceConfigEvent implements ClipboardOwner { + private Vector oldDevice = new Vector<>(); + + DeviceIPPortInfo deviceIPPortInfo = null; + + /** + * requestByTrace + */ + public void requestByTrace() { + } + + /** + * devicesInfoJComboBoxUpdate + * + * @param taskSystemTunningByTracePanel taskSystemTunningByTracePanel + */ + public void devicesInfoJComboBoxUpdate(TaskSystemTunningByTracePanel taskSystemTunningByTracePanel) { + QuartzManager.getInstance().addExecutor(DEVICEREFRESH, new Runnable() { + @Override + public void run() { + List deviceInfos = MultiDeviceManager.getInstance().getAllDeviceIPPortInfos(); + taskSystemTunningByTracePanel.setDeviceInfos(deviceInfos); + Vector items = new Vector<>(); + deviceInfos.forEach(deviceInfo -> { + items.add(deviceInfo.getDeviceName()); + }); + if (!oldDevice.equals(items)) { + oldDevice = items; + taskSystemTunningByTracePanel.getJComboBoxPhone().setModel(new DefaultComboBoxModel(items)); + } + } + }); + QuartzManager.getInstance().startExecutor(DEVICEREFRESH, 0, 1000); + } + + /** + * itemStateChanged + * + * @param taskSystemTunningPanel taskSystemTunningPanel + */ + public void itemStateChanged(SystemTunningConfigPanel taskSystemTunningPanel) { + taskSystemTunningPanel.getJComboBoxPhone().addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent exception) { + // 获取选中项,设置对象信息用于查询对应的进程信息 + for (DeviceIPPortInfo deviceInfo : taskSystemTunningPanel.getDeviceInfos()) { + if (deviceInfo.getDeviceName() + .equals(taskSystemTunningPanel.getJComboBoxPhone().getSelectedItem())) { + deviceIPPortInfo = deviceInfo; + } + } + } + }); + if (taskSystemTunningPanel.getDeviceInfos() != null && deviceIPPortInfo == null) { + deviceIPPortInfo = taskSystemTunningPanel.getDeviceInfos().get(0); + } + } + + /** + * lostOwnership + * + * @param clipboard clipboard + * @param contents contents + */ + @Override + public void lostOwnership(Clipboard clipboard, Transferable contents) { + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/SystemTunningConfigEvent.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/SystemTunningConfigEvent.java new file mode 100644 index 000000000..77d01d139 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/SystemTunningConfigEvent.java @@ -0,0 +1,1006 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import static ohos.devtools.views.common.Constant.DEVICEREFRESH; + +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.ClipboardOwner; +import java.awt.datatransfer.StringSelection; +import java.awt.datatransfer.Transferable; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Vector; + +import javax.swing.ButtonGroup; +import javax.swing.DefaultComboBoxModel; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JSlider; +import javax.swing.JTextArea; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +import ohos.devtools.datasources.utils.common.GrpcException; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.device.service.MultiDeviceManager; +import ohos.devtools.datasources.utils.quartzmanager.QuartzManager; +import ohos.devtools.datasources.utils.trace.service.TraceManager; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.SystemTunningProbesCheckbox; +import ohos.devtools.views.layout.swing.SystemTunningLoadDialog; +import ohos.devtools.views.layout.swing.TaskPanel; +import ohos.devtools.views.layout.swing.SystemTunningConfigPanel; + +/** + * SystemTunningConfigEvent + * + * @version 1.0 + * @date 2021/04/14 20:13 + **/ +public class SystemTunningConfigEvent implements ClipboardOwner { + /** + * 显示maxDuration label的值 + */ + private int hours = 0; + private int minutes = 0; + private int seconds = 10; + + /** + * oldDevice + */ + private Vector oldDevice = new Vector<>(); + + /** + * getUserCheckBoxForPerfettoStr + */ + private String getUserCheckBoxForPerfettoStr = ""; + + /** + * 用于判断从bytrace还是ptrace 0:bytrace 1:ptrace 2:perfetto + */ + private int differentRequests = 0; + + /** + * 用于获取startsession后返回的sessionId + */ + private String sessionId = null; + + /** + * probes 复选框 + */ + private Boolean rbSchedulingIsSelect = true; + + /** + * rb2IsSelect + */ + private Boolean rbCpuIsSelect = true; + + /** + * rb3IsSelect + */ + private Boolean rbSyscallsIsSelect = false; + + /** + * rb4IsSelect + */ + private Boolean rbBoardIsSelect = false; + + /** + * rb5IsSelect + */ + private Boolean rbFrequencyIsSelect = false; + + /** + * rb6IsSelect + */ + private Boolean rbLowMemoryIsSelect = false; + + /** + * rb7IsSelect + */ + private Boolean rbAtraceIsSelect = false; + + /** + * RecordSetting 的参数值 + */ + private int inMemoryValue = LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_DEFAULT_NUMBER; + + /** + * maxDuration + */ + private int maxDuration = LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_MIN_DURATION_NUMBER; + + /** + * maxFileSize + */ + private int maxFileSize = LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_DEFAULT_NUMBER; + + /** + * flushOnDisk + */ + private int flushOnDisk = LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_DEFAULT_NUMBER; + + /** + * param + */ + private HashMap> param = new HashMap<>(); + + /** + * paramRecordSetting + */ + private HashMap paramRecordSetting = new HashMap<>(); + + /** + * clipboard + */ + private Clipboard clipboard; + + /** + * deviceIPPortInfo + */ + private DeviceIPPortInfo deviceIPPortInfo = null; + + /** + * checkBoxState + * + * @param rbScheduling rbScheduling + * @param rbCpu rbCpu + * @param rbSyscalls rbSyscalls + * @param rbBoard rbBoard + */ + public void checkBoxState(JCheckBox rbScheduling, JCheckBox rbCpu, JCheckBox rbSyscalls, JCheckBox rbBoard) { + rbScheduling.addMouseListener(new MouseAdapter() { + /** + * mouseClicked + * + * @param mouseEvent mouseEvent + */ + public void mouseClicked(MouseEvent mouseEvent) { + rbSchedulingIsSelect = rbScheduling.isSelected(); + } + }); + rbCpu.addMouseListener(new MouseAdapter() { + /** + * mouseClicked + * + * @param mouseEvent mouseEvent + */ + public void mouseClicked(MouseEvent mouseEvent) { + rbCpuIsSelect = rbCpu.isSelected(); + } + }); + rbSyscalls.addMouseListener(new MouseAdapter() { + /** + * mouseClicked + * + * @param mouseEvent mouseEvent + */ + public void mouseClicked(MouseEvent mouseEvent) { + rbSyscallsIsSelect = rbSyscalls.isSelected(); + } + }); + rbBoard.addMouseListener(new MouseAdapter() { + /** + * mouseClicked + * + * @param mouseEvent mouseEvent + */ + public void mouseClicked(MouseEvent mouseEvent) { + rbBoardIsSelect = rbBoard.isSelected(); + } + }); + } + + /** + * checkBoxStateLeft + * + * @param rbFrequency rbFrequency + * @param rbLowMemory rbLowMemory + * @param rbAtrace rbAtrace + */ + public void checkBoxStateLeft(JCheckBox rbFrequency, JCheckBox rbLowMemory, JCheckBox rbAtrace) { + rbFrequency.addMouseListener(new MouseAdapter() { + /** + * mouseClicked + * + * @param mouseEvent mouseEvent + */ + public void mouseClicked(MouseEvent mouseEvent) { + rbFrequencyIsSelect = rbFrequency.isSelected(); + } + }); + rbLowMemory.addMouseListener(new MouseAdapter() { + /** + * mouseClicked + * + * @param mouseEvent mouseEvent + */ + public void mouseClicked(MouseEvent mouseEvent) { + rbLowMemoryIsSelect = rbLowMemory.isSelected(); + } + }); + rbAtrace.addMouseListener(new MouseAdapter() { + /** + * mouseClicked + * + * @param mouseEvent mouseEvent + */ + public void mouseClicked(MouseEvent mouseEvent) { + rbAtraceIsSelect = rbAtrace.isSelected(); + } + }); + } + + /** + * getUserCheckBox + */ + public void getUserCheckBox() { + paramRecordSetting.clear(); + paramRecordSetting.put("inMemoryValue", inMemoryValue); + paramRecordSetting.put("maxDuration", maxDuration); + paramRecordSetting.put("maxFileSize", maxFileSize); + paramRecordSetting.put("flushOnDisk", flushOnDisk); + param.clear(); + if (rbSchedulingIsSelect) { + getParamListFromString(param, + SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_SECOND_MIDDLE_SCHEDULING_DETAIL_FTRACE); + } + if (rbCpuIsSelect) { + getParamListFromString(param, + SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_SECOND_MIDDLE_CPU_FREQUENCY_FTRACE); + } + if (rbSyscallsIsSelect) { + getParamListFromString(param, + SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_SECOND_MIDDLE_SYSCALLS_FTRACE); + } + if (rbBoardIsSelect) { + getParamListFromString(param, + SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_SECOND_MIDDLE_BOARD_VOLTAGES_FTRACE); + } + if (rbFrequencyIsSelect) { + getParamListFromString(param, + SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_SECOND_MIDDLE_HIGH_FREQUENCY_FTRACE); + } + if (rbLowMemoryIsSelect) { + getParamListFromString(param, + SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_SECOND_MIDDLE_LOW_MEMORY_FTRACE); + } + if (rbSchedulingIsSelect || rbCpuIsSelect || rbBoardIsSelect) { + getParamListFromString(param, SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_CONTAIN_SHARE_FTRACE_LABLE); + } + } + + /** + * getUserCheckBoxForPerfetto + */ + public void getUserCheckBoxForPerfetto() { + getUserCheckBoxForPerfettoStr = ""; + if (rbSchedulingIsSelect) { + getUserCheckBoxForPerfettoStr = getUserCheckBoxForPerfettoStr + .concat(SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_SECOND_MIDDLE_SCHEDULING_DETAIL_FTRACE); + } + if (rbCpuIsSelect) { + getUserCheckBoxForPerfettoStr = getUserCheckBoxForPerfettoStr + .concat(SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_SECOND_MIDDLE_CPU_FREQUENCY_FTRACE); + } + if (rbSyscallsIsSelect) { + getUserCheckBoxForPerfettoStr = getUserCheckBoxForPerfettoStr + .concat(SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_SECOND_MIDDLE_SYSCALLS_FTRACE); + } + if (rbBoardIsSelect) { + getUserCheckBoxForPerfettoStr = getUserCheckBoxForPerfettoStr + .concat(SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_SECOND_MIDDLE_BOARD_VOLTAGES_FTRACE); + } + if (rbFrequencyIsSelect) { + getUserCheckBoxForPerfettoStr = getUserCheckBoxForPerfettoStr + .concat(SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_SECOND_MIDDLE_HIGH_FREQUENCY_FTRACE); + } + if (rbLowMemoryIsSelect) { + getUserCheckBoxForPerfettoStr = getUserCheckBoxForPerfettoStr + .concat(SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_SECOND_MIDDLE_LOW_MEMORY_FTRACE); + } + if (rbSchedulingIsSelect || rbCpuIsSelect || rbBoardIsSelect) { + getUserCheckBoxForPerfettoStr = getUserCheckBoxForPerfettoStr + .concat(SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_CONTAIN_SHARE_FTRACE_LABLE); + } + } + + /** + * Get user checkBox ForBytrace + */ + private void getUserCheckBoxForBytrace() { + getUserCheckBoxForPerfettoStr = ""; + if (rbSchedulingIsSelect || rbCpuIsSelect || rbBoardIsSelect || rbFrequencyIsSelect) { + getUserCheckBoxForPerfettoStr = getUserCheckBoxForPerfettoStr.concat(";") + .concat(SystemTunningProbesCheckbox.CPU_FREQUENCY_BYTRACE_ONE_AND_TWO_AND_FOUR); + } + if (rbSchedulingIsSelect || rbLowMemoryIsSelect) { + getUserCheckBoxForPerfettoStr = getUserCheckBoxForPerfettoStr.concat(";") + .concat(SystemTunningProbesCheckbox.SCHEDULING_DETAIL_BYTRACE_ONE_AND_SIX); + } + } + + /** + * startTask + * + * @param taskSystemTunningPanel taskSystemTunningPanel + * @param jTaskPanel jTaskPanel + */ + public void startTask(SystemTunningConfigPanel taskSystemTunningPanel, TaskPanel jTaskPanel) { + taskSystemTunningPanel.getJButtonStartTask().addMouseListener(new MouseAdapter() { + /** + * mouseClicked + * + * @param mouseEvent mouseEvent + */ + @Override + public void mouseClicked(MouseEvent mouseEvent) { + // create system tunning load dialog object + SystemTunningLoadDialog taskSystemLoad = new SystemTunningLoadDialog(); + super.mouseClicked(mouseEvent); + try { + if (differentRequests == 0) { + getUserCheckBoxForBytrace(); + sessionId = new TraceManager() + .createSessionByTraceRequest(deviceIPPortInfo, getUserCheckBoxForPerfettoStr, maxDuration, + inMemoryValue, false); + } + if (differentRequests == 1) { + getUserCheckBoxForPerfetto(); + getStrResultForPerfetto(); + sessionId = new TraceManager() + .createSessionRequestPerfetto(deviceIPPortInfo, getUserCheckBoxForPerfettoStr, maxDuration, + false); + } + taskSystemLoad.load(jTaskPanel, differentRequests, maxDuration, sessionId, deviceIPPortInfo); + } catch (GrpcException grpcException) { + grpcException.printStackTrace(); + } + jTaskPanel.getOptionJPanel().repaint(); + } + }); + } + + /** + * getStrResultForPerfetto + */ + public void getStrResultForPerfetto() { + getUserCheckBoxForPerfettoStr = SystemTunningProbesCheckbox.PERFETTO_DURATION_MS_ONE + .concat(String.valueOf(maxDuration * SystemTunningProbesCheckbox.SECOND_TO_MS)).concat("\n") + .concat(SystemTunningProbesCheckbox.PERFETTO_DURATION_MS_TWO) + .concat(String.valueOf(inMemoryValue * SystemTunningProbesCheckbox.MEMORY_MB_TO_KB)).concat("\n") + .concat(SystemTunningProbesCheckbox.PERFETTO_DURATION_MS_THREE).concat(getUserCheckBoxForPerfettoStr) + .concat(SystemTunningProbesCheckbox.PERFETTO_DURATION_MS_FOUT); + } + + /** + * lastStep + * + * @param taskSystemTunningPanel taskSystemTunningPanel + * @param jTaskPanel jTaskPanel + */ + public void lastStep(SystemTunningConfigPanel taskSystemTunningPanel, TaskPanel jTaskPanel) { + taskSystemTunningPanel.getJButtonLastStep().addMouseListener(new MouseAdapter() { + /** + * mouseClicked + * + * @param mouseEvent mouseEvent + */ + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + jTaskPanel.getOptionJPanel().remove(taskSystemTunningPanel); + jTaskPanel.getOptionJPanelContent().setVisible(true); + jTaskPanel.getOptionJPanel().repaint(); + } + }); + } + + /** + * listenerJPanelSouth + * + * @param taskSystemTunningPanel taskSystemTunningPanel + */ + public void listenerJPanelSouth(SystemTunningConfigPanel taskSystemTunningPanel) { + taskSystemTunningPanel.getJPanelSouth().addComponentListener(new ComponentAdapter() { + /** + * componentResized + * + * @param componentEvent componentEvent + */ + public void componentResized(ComponentEvent componentEvent) { + int width = taskSystemTunningPanel.getJPanelSouth().getWidth(); + taskSystemTunningPanel.getJButtonLastStep() + .setBounds(LayoutConstants.NUMBER_STEP + (width - LayoutConstants.WINDOW_WIDTH), + LayoutConstants.DEVICES_HEIGHT, LayoutConstants.DEVICE_ADD_WIDTH, + LayoutConstants.CHOOSE_HEIGHT); + taskSystemTunningPanel.getJButtonStartTask() + .setBounds(LayoutConstants.POSITION_TASK_X + (width - LayoutConstants.WINDOW_WIDTH), + LayoutConstants.DEVICES_HEIGHT, LayoutConstants.DEVICE_ADD_WIDTH, + LayoutConstants.CHOOSE_HEIGHT); + } + }); + } + + /** + * recordSetting + * + * @param recordSettingLabel recordSettingLabel + * @param traceCommandLabel traceCommandLabel + * @param jPanelCenterSouthRight jPanelCenterSouthRight + * @param jPanelCenterSouthWest jPanelCenterSouthWest + */ + public void recordSetting(JLabel recordSettingLabel, JLabel traceCommandLabel, JPanel jPanelCenterSouthRight, + JPanel jPanelCenterSouthWest) { + recordSettingLabelRightShow(jPanelCenterSouthRight); + recordSettingLabel.addMouseListener(new MouseAdapter() { + /** + * mouseClicked + * + * @param mouseEvent mouseEvent + */ + public void mouseClicked(MouseEvent mouseEvent) { + recordSettingLabel.setOpaque(true); + traceCommandLabel.setOpaque(false); + recordSettingLabelRightShow(jPanelCenterSouthRight); + jPanelCenterSouthWest.updateUI(); + jPanelCenterSouthWest.repaint(); + } + }); + } + + /** + * radioButton + * + * @param jPanelCenterSouthRight jPanelCenterSouthRight + * @param rb1 rb1 + * @param rb2 rb2 + * @param rb3 rb3 + */ + public void radioButton(JPanel jPanelCenterSouthRight, JRadioButton rb1, JRadioButton rb2, JRadioButton rb3) { + jPanelCenterSouthRight.removeAll(); + rb1.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + rb2.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + rb3.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + JLabel jLabel = new JLabel("Record model:"); + jLabel.setBounds(LayoutConstants.SYSTEM_TUNNING_LABEL_INTT_X, + LayoutConstants.SYSTEM_TUNNING_RECORD_MODEL_LABLE_INTT_Y, LayoutConstants.SYSTEM_TUNNING_LABLE_WIDTH, + LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + ButtonGroup buttonGroup = new ButtonGroup(); + buttonGroup.add(rb1); + rb1.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_RADIO_INTT_X, LayoutConstants.SYSTEM_TUNNING_LABLE_INTT_Y, + LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_RADIO_WIDTH, LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + rb2.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_RADIO_DECOND_INTT_X, + LayoutConstants.SYSTEM_TUNNING_LABLE_INTT_Y, LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_RADIO_WIDTH, + LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + rb3.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_RADIO_THREE_INTT_X, + LayoutConstants.SYSTEM_TUNNING_LABLE_INTT_Y, LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_RADIO_WIDTH, + LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + jPanelCenterSouthRight.add(jLabel); + jPanelCenterSouthRight.add(rb1); + } + + /** + * recordSettingLabelRightShow + * + * @param jPanelCenterSouthRight jPanelCenterSouthRight + */ + public void recordSettingLabelRightShow(JPanel jPanelCenterSouthRight) { + // 单选按钮、进度条等 + JRadioButton rb1 = new JRadioButton("Stop when full", true); + JRadioButton rb2 = new JRadioButton("Ring buffer"); // 创建JRadioButton对象 + JRadioButton rb3 = new JRadioButton("Long trace"); + radioButton(jPanelCenterSouthRight, rb1, rb2, rb3); + // Long trace 选中显示 + JLabel memoryLabel3 = new JLabel("Max file size:"); + memoryLabel3.setBounds(LayoutConstants.SYSTEM_TUNNING_LABEL_INTT_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_FILE_SIZE_SLIDE_INT_LABEL_Y, + LayoutConstants.SYSTEM_TUNNING_LABLE_WIDTH, LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + JSlider sliderMaxFileSize = new JSlider(LayoutConstants.DEFAULT_NUMBER, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_MAX_IN_MEMORY_NUMBER); + sliderMaxFileSize.setValue(LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_DEFAULT_NUMBER); + // memoryThree + JLabel memoryThree = this.memoryThreeAttribute(); + JLabel memoryLabel4 = new JLabel("Flush on disk every:"); + memoryLabel4.setBounds(LayoutConstants.SYSTEM_TUNNING_LABEL_INTT_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_FLUSH_ON_DISK_SLIDE_INT_Y, + LayoutConstants.SYSTEM_TUNNING_LABLE_WIDTH, LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + JSlider sliderFLushOnDisk = new JSlider(LayoutConstants.DEFAULT_NUMBER, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_MAX_IN_MEMORY_NUMBER); + sliderFLushOnDisk.setValue(LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_DEFAULT_NUMBER); + // memoryFLushOnDisk + JLabel memoryFLushOnDisk = this.memoryFLushOnDisk(); + // Long trace 选中显示---结束 + rb1.addActionListener(new ActionListener() { + /** + * actionPerformed + * + * @param actionEvent actionEvent + */ + @Override + public void actionPerformed(ActionEvent actionEvent) { + jPanelCenterSouthRight.remove(memoryLabel3); + jPanelCenterSouthRight.remove(memoryThree); + jPanelCenterSouthRight.remove(sliderMaxFileSize); + jPanelCenterSouthRight.remove(memoryLabel4); + jPanelCenterSouthRight.remove(memoryFLushOnDisk); + jPanelCenterSouthRight.remove(sliderFLushOnDisk); + jPanelCenterSouthRight.updateUI(); + jPanelCenterSouthRight.repaint(); + } + }); + jPanelCenterSouthRightAddInMemory(jPanelCenterSouthRight); + jPanelCenterSouthRightAddMaxDuration(jPanelCenterSouthRight); + jPanelCenterSouthRight.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + jPanelCenterSouthRight.updateUI(); + jPanelCenterSouthRight.repaint(); + } + + /** + * memoryThreeAttribute + * + * @return JLabel + */ + public JLabel memoryThreeAttribute() { + JLabel memoryThree = + new JLabel("" + LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_DEFAULT_NUMBER + " MB", JLabel.CENTER); + memoryThree.setFont(new Font(Font.SANS_SERIF, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_LABEL_FONT)); + memoryThree.setForeground(Color.white); + memoryThree.setVerticalTextPosition(JLabel.CENTER); + memoryThree.setHorizontalTextPosition(JLabel.CENTER); + memoryThree.setOpaque(true); + memoryThree.setBounds(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SHOW_NUMBER_INTI_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_FILE_SIZE_SLIDE_LABEL_INT_LABEL_Y, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SHOW_NUMBER_INTI_WIDTH, + LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_SLIDE_LABEL); + return memoryThree; + } + + /** + * memoryFLushOnDisk + * + * @return JLabel + */ + public JLabel memoryFLushOnDisk() { + JLabel memoryFLushOnDisk = + new JLabel("" + LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_DEFAULT_NUMBER + " ms", JLabel.CENTER); + memoryFLushOnDisk.setFont(new Font(Font.SANS_SERIF, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_LABEL_FONT)); + memoryFLushOnDisk.setForeground(Color.white); + memoryFLushOnDisk.setVerticalTextPosition(JLabel.CENTER); + memoryFLushOnDisk.setHorizontalTextPosition(JLabel.CENTER); + memoryFLushOnDisk.setOpaque(true); + memoryFLushOnDisk.setBounds(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SHOW_NUMBER_INTI_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_FLUSH_ON_DISK_SLIDE_LABEL_INT_Y, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SHOW_NUMBER_INTI_WIDTH, + LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_SLIDE_LABEL); + return memoryFLushOnDisk; + } + + /** + * jPanelCenterSouthRightAddInMemory + * + * @param jPanelCenterSouthRight jPanelCenterSouthRight + */ + public void jPanelCenterSouthRightAddInMemory(JPanel jPanelCenterSouthRight) { + JLabel memoryLabel2 = new JLabel("In-memory buffer size:"); + memoryLabel2.setBounds(LayoutConstants.SYSTEM_TUNNING_LABEL_INTT_X, + LayoutConstants.SYSTEM_TUNNING_LABLE_INTT_Y + LayoutConstants.SYSTEM_TUNNING_LABLE_SPACING_Y, + LayoutConstants.SYSTEM_TUNNING_LABLE_WIDTH, LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + jPanelCenterSouthRight.add(memoryLabel2); + // memoryTWO + JLabel memoryTWO = + new JLabel("" + LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_DEFAULT_NUMBER + " MB", JLabel.CENTER); + memoryTWO.setFont(new Font(Font.SANS_SERIF, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_LABEL_FONT)); + memoryTWO.setForeground(Color.white); + memoryTWO.setVerticalTextPosition(JLabel.CENTER); + memoryTWO.setHorizontalTextPosition(JLabel.CENTER); + memoryTWO.setOpaque(true); + memoryTWO.setBounds(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SHOW_NUMBER_INTI_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_RIGHT_LABEL_INT_Y, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SHOW_NUMBER_INTI_WIDTH, + LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_SLIDE_LABEL); + jPanelCenterSouthRight.add(memoryTWO); + jProgressBarInMemory(jPanelCenterSouthRight, memoryTWO); + } + + /** + * jPanelCenterSouthRightAddMaxDuration + * + * @param jPanelCenterSouthRight jPanelCenterSouthRight + */ + public void jPanelCenterSouthRightAddMaxDuration(JPanel jPanelCenterSouthRight) { + JLabel durationLabel = new JLabel("Max duration:"); + durationLabel.setBounds(LayoutConstants.SYSTEM_TUNNING_LABEL_INTT_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_DURATION_LABEL, + LayoutConstants.SYSTEM_TUNNING_LABLE_WIDTH, LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + jPanelCenterSouthRight.add(durationLabel); + // durationTWO + JLabel durationTWO = new JLabel( + "00:00:" + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_MIN_DURATION_NUMBER + " h:m:s ", + JLabel.CENTER); + durationTWO.setFont(new Font(Font.SANS_SERIF, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_LABEL_FONT)); + durationTWO.setForeground(Color.white); + durationTWO.setVerticalTextPosition(JLabel.CENTER); + durationTWO.setHorizontalTextPosition(JLabel.CENTER); + durationTWO.setOpaque(true); + durationTWO.setBounds(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SHOW_NUMBER_INTI_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_DURATION_LABEL_INIT_Y, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SHOW_NUMBER_INTI_WIDTH, + LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_SLIDE_LABEL); + jPanelCenterSouthRight.add(durationTWO); + jProgressBarDuration(jPanelCenterSouthRight, durationTWO); + } + + /** + * jProgressBarInMemory + * + * @param jPanelCenterSouthRight jPanelCenterSouthRight + * @param memoryTWO memoryTWO + * @return JSlider + */ + public JSlider jProgressBarInMemory(JPanel jPanelCenterSouthRight, JLabel memoryTWO) { + JSlider slider = new JSlider(LayoutConstants.DEFAULT_NUMBER, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_MAX_IN_MEMORY_NUMBER); + slider.setValue(LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_DEFAULT_NUMBER); + slider.setPreferredSize( + new Dimension(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_DURATION_INTI_Y, + LayoutConstants.DEFAULT_NUMBER)); + slider.setBounds(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_Y, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_WIDTH, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_HIGHT); + jPanelCenterSouthRight.add(slider); + slider.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent changeEvent) { + memoryTWO.setText("" + slider.getValue() + " MB"); + memoryTWO.setFont(new Font(Font.SANS_SERIF, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_LABEL_FONT)); + memoryTWO.setForeground(Color.white); + memoryTWO.setVerticalTextPosition(JLabel.CENTER); + memoryTWO.setHorizontalTextPosition(JLabel.CENTER); + inMemoryValue = slider.getValue(); + } + }); + return slider; + } + + /** + * jProgressBarMaxFileSize + * + * @param jPanelCenterSouthRight jPanelCenterSouthRight + * @param memoryThree memoryThree + * @param sliderMaxFileSize sliderMaxFileSize + * @return JSlider + */ + public JSlider jProgressBarMaxFileSize(JPanel jPanelCenterSouthRight, JLabel memoryThree, + JSlider sliderMaxFileSize) { + sliderMaxFileSize.setValue(LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_DEFAULT_NUMBER); + sliderMaxFileSize.setPreferredSize( + new Dimension(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_DURATION_INTI_Y, + LayoutConstants.DEFAULT_NUMBER)); + sliderMaxFileSize.setBounds(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_FILE_SIZE_SLIDE_INT_LABEL_Y + + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_AND_LABEL_SPACING_Y, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_WIDTH, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_HIGHT); + jPanelCenterSouthRight.add(sliderMaxFileSize); + sliderMaxFileSize.addChangeListener(new ChangeListener() { + /** + * stateChanged + * + * @param changeEvent changeEvent + */ + @Override + public void stateChanged(ChangeEvent changeEvent) { + memoryThree.setText("" + sliderMaxFileSize.getValue() + " MB"); + memoryThree.setFont(new Font(Font.SANS_SERIF, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_LABEL_FONT)); + memoryThree.setForeground(Color.white); + memoryThree.setVerticalTextPosition(JLabel.CENTER); + memoryThree.setHorizontalTextPosition(JLabel.CENTER); + maxFileSize = sliderMaxFileSize.getValue(); + } + }); + return sliderMaxFileSize; + } + + /** + * jProgressBarFLushOnDisk + * + * @param jPanelCenterSouthRight jPanelCenterSouthRight + * @param memoryFLushOnDisk memoryFLushOnDisk + * @param sliderFLushOnDisk sliderFLushOnDisk + * @return JSlider + */ + public JSlider jProgressBarFLushOnDisk(JPanel jPanelCenterSouthRight, JLabel memoryFLushOnDisk, + JSlider sliderFLushOnDisk) { + sliderFLushOnDisk.setValue(LayoutConstants.SYSTEM_TUNNING_RECORD_SETTING_DEFAULT_NUMBER); + sliderFLushOnDisk.setPreferredSize( + new Dimension(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_DURATION_INTI_Y, + LayoutConstants.DEFAULT_NUMBER)); + sliderFLushOnDisk.setBounds(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_FLUSH_ON_DISK_SLIDE_INT_Y + + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_AND_LABEL_SPACING_Y, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_WIDTH, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_HIGHT); + jPanelCenterSouthRight.add(sliderFLushOnDisk); + sliderFLushOnDisk.addChangeListener(new ChangeListener() { + /** + * stateChanged + * + * @param changeEvent changeEvent + */ + @Override + public void stateChanged(ChangeEvent changeEvent) { + memoryFLushOnDisk.setText("" + sliderFLushOnDisk.getValue() + " ms"); + memoryFLushOnDisk + .setFont(new Font(Font.SANS_SERIF, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_LABEL_FONT)); + memoryFLushOnDisk.setForeground(Color.white); + memoryFLushOnDisk.setVerticalTextPosition(JLabel.CENTER); + memoryFLushOnDisk.setHorizontalTextPosition(JLabel.CENTER); + flushOnDisk = sliderFLushOnDisk.getValue(); + } + }); + return sliderFLushOnDisk; + } + + /** + * jProgressBarDuration + * + * @param jPanelCenterSouthRight jPanelCenterSouthRight + * @param durationTWO durationTWO + * @return JSlider + */ + public JSlider jProgressBarDuration(JPanel jPanelCenterSouthRight, JLabel durationTWO) { + JSlider slider = new JSlider(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_MIN_DURATION_NUMBER, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_MAX_DURATION_NUMBER); + slider.setValue(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_MIN_DURATION_NUMBER); + slider.setPreferredSize( + new Dimension(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_DURATION_INTI_Y, + LayoutConstants.DEFAULT_NUMBER)); + slider.setBounds(LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_MAX_DURATION_LABEL + + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_AND_LABEL_SPACING_Y, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_WIDTH, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_HIGHT); + jPanelCenterSouthRight.add(slider); + slider.addChangeListener(new ChangeListener() { + /** + * stateChanged + * + * @param changeEvent changeEvent + */ + @Override + public void stateChanged(ChangeEvent changeEvent) { + seconds = slider.getValue() % SystemTunningProbesCheckbox.TIME_CONVERSION_UNIT; + minutes = (slider.getValue() / SystemTunningProbesCheckbox.TIME_CONVERSION_UNIT) + % SystemTunningProbesCheckbox.TIME_CONVERSION_UNIT; + hours = slider.getValue() / (SystemTunningProbesCheckbox.TIME_CONVERSION_UNIT + * SystemTunningProbesCheckbox.TIME_CONVERSION_UNIT); + durationTWO.setText(" " + String.format(Locale.ENGLISH, "%02d", hours) + ":" + String + .format(Locale.ENGLISH, "%02d", minutes) + ":" + String.format(Locale.ENGLISH, "%02d", seconds) + + " h:m:s "); + durationTWO.setFont(new Font(Font.SANS_SERIF, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_LABEL_FONT)); + durationTWO.setForeground(Color.white); + durationTWO.setVerticalTextPosition(JLabel.CENTER); + durationTWO.setHorizontalTextPosition(JLabel.CENTER); + maxDuration = slider.getValue(); + } + }); + return slider; + } + + /** + * traceCommand + * + * @param recordSettingLabel recordSettingLabel + * @param traceCommandLabel traceCommandLabel + * @param jPanelCenterSouthRight jPanelCenterSouthRight + * @param jPanelCenterSouthWest jPanelCenterSouthWest + */ + public void traceCommand(JLabel recordSettingLabel, JLabel traceCommandLabel, JPanel jPanelCenterSouthRight, + JPanel jPanelCenterSouthWest) { + traceCommandLabel.addMouseListener(new MouseAdapter() { + /** + * mouseClicked + * + * @param mouseEvent mouseEvent + */ + public void mouseClicked(MouseEvent mouseEvent) { + recordSettingLabel.setOpaque(false); + traceCommandLabel.setOpaque(true); + try { + traceCommandLabelRightShow(jPanelCenterSouthRight); + } catch (GrpcException ex) { + ex.printStackTrace(); + } + jPanelCenterSouthWest.updateUI(); + jPanelCenterSouthWest.repaint(); + } + }); + } + + /** + * traceCommandLabelRightShow + * + * @param jPanelCenterSouthRight jPanelCenterSouthRight + * @throws GrpcException GrpcException + */ + public void traceCommandLabelRightShow(JPanel jPanelCenterSouthRight) throws GrpcException { + jPanelCenterSouthRight.removeAll(); + String str = SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_NO_SELECT_HEAD; + // 获得用户选中的复选框 + getUserCheckBox(); + // 走perfetto from siwei + getUserCheckBoxForPerfetto(); + getStrResultForPerfetto(); + str = str.concat(new TraceManager() + .createSessionRequestPerfetto(deviceIPPortInfo, getUserCheckBoxForPerfettoStr, maxDuration, true)); + if (str == null) { + str = ""; + } + str = str.concat(SystemTunningProbesCheckbox.SYSTEM_TUNNING_PROBES_NO_SELECT_END); + JTextArea jta = new JTextArea(str); + jta.setLineWrap(true); // 设置文本域中的文本为自动换行 + jta.setForeground(Color.gray); // 设置组件的背景色 + jta.setEditable(false); + jta.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); // 设置按钮背景色 + JScrollPane jsp = new JScrollPane(jta); // 将文本域放入滚动窗口 + jsp.setBounds(LayoutConstants.SYSTEM_TUNNING_TRACE_COMMAND_TEXT_AREA_INTT_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_COMMAND_TEXT_AREA_INTT_Y, + LayoutConstants.SYSTEM_TUNNING_TRACE_COMMAND_TEXTAREA_WIDTH, + LayoutConstants.SYSTEM_TUNNING_TRACE_COMMAND_TEXTAREA_HEIGHT); + jPanelCenterSouthRight.add(jsp); + JButton jButtonSave = new JButton(new ImageIcon( + SystemTunningConfigEvent.class.getClassLoader().getResource("images/copy.png"))); + jButtonSave.setOpaque(true); + jButtonSave.setCursor(new Cursor(LayoutConstants.SYSTEM_TUNNING_TRACE_COMMAND_COPY_FUNCTION_CURSOR)); + jButtonSave.setBounds(LayoutConstants.SYSTEM_TUNNING_TRACE_COMMAND_COPY_FUNCTION_INIT_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_COMMAND_TEXT_AREA_INTT_Y, + LayoutConstants.SYSTEM_TUNNING_TRACE_COMMAND_COPY_FUNCTION_INIT_WIDTH, + LayoutConstants.SYSTEM_TUNNING_TRACE_COMMAND_COPY_FUNCTION_INIT_WIDTH); + jButtonSave.setBorderPainted(false); + jButtonSave.addActionListener(new ActionListener() { + /** + * actionPerformed + * + * @param actionEvent actionEvent + */ + @Override + public void actionPerformed(ActionEvent actionEvent) { + clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + StringSelection contents = new StringSelection(jta.getText()); + clipboard.setContents(contents, SystemTunningConfigEvent.this); + } + }); + jPanelCenterSouthRight.add(jButtonSave); + jPanelCenterSouthRight.repaint(); + } + + /** + * getParamListFromString + * + * @param param param + * @param str str + */ + public void getParamListFromString(HashMap> param, String str) { + if (str != null && !str.isEmpty()) { + String[] oneCheckBoxArray = str.split("\n"); + for (int i = 0; i < oneCheckBoxArray.length; i++) { + if (oneCheckBoxArray[i] != null && !oneCheckBoxArray[i].isEmpty()) { + String[] everyLine = oneCheckBoxArray[i].split(":"); + if (oneCheckBoxArray[i].contains(everyLine[0].trim())) { + if (param.get(everyLine[0].trim()) != null) { + param.get(everyLine[0].trim()).add(oneCheckBoxArray[i]); + } else { + ArrayList everyList = new ArrayList<>(); + everyList.add(oneCheckBoxArray[i]); + param.put(everyLine[0].trim(), everyList); + } + } + } + } + } + } + + /** + * devicesInfoJComboBoxUpdate + * + * @param taskSystemTunningPanel taskSystemTunningPanel + */ + public void devicesInfoJComboBoxUpdate(SystemTunningConfigPanel taskSystemTunningPanel) { + QuartzManager.getInstance().addExecutor(DEVICEREFRESH, new Runnable() { + /** + * run + */ + @Override + public void run() { + List deviceInfos = MultiDeviceManager.getInstance().getAllDeviceIPPortInfos(); + taskSystemTunningPanel.setDeviceInfos(deviceInfos); + Vector items = new Vector<>(); + deviceInfos.forEach(deviceInfo -> { + items.add(deviceInfo.getDeviceName()); + }); + if (!oldDevice.equals(items)) { + oldDevice = items; + taskSystemTunningPanel.getJComboBoxPhone().setModel(new DefaultComboBoxModel(items)); + } + } + }); + QuartzManager.getInstance() + .startExecutor(DEVICEREFRESH, LayoutConstants.DEFAULT_NUMBER, LayoutConstants.NUMBER_THREAD); + } + + /** + * itemStateChanged + * + * @param taskSystemTunningPanel taskSystemTunningPanel + */ + public void itemStateChanged(SystemTunningConfigPanel taskSystemTunningPanel) { + taskSystemTunningPanel.getJComboBoxPhone().addItemListener(new ItemListener() { + /** + * itemStateChanged + * + * @param itemEvent itemEvent + */ + @Override + public void itemStateChanged(ItemEvent itemEvent) { + // 获取选中项,设置对象信息用于查询对应的进程信息 + for (DeviceIPPortInfo deviceInfo : taskSystemTunningPanel.getDeviceInfos()) { + if (deviceInfo.getDeviceName() + .equals(taskSystemTunningPanel.getJComboBoxPhone().getSelectedItem())) { + deviceIPPortInfo = deviceInfo; + } + } + } + }); + if (taskSystemTunningPanel.getDeviceInfos() != null && taskSystemTunningPanel.getDeviceInfos().size() > 0 + && deviceIPPortInfo == null) { + deviceIPPortInfo = taskSystemTunningPanel.getDeviceInfos().get(0); + } + } + + /** + * lostOwnership + * + * @param clipboard clipboard + * @param contents contents + */ + @Override + public void lostOwnership(Clipboard clipboard, Transferable contents) { + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/SystemTunningDialogEvent.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/SystemTunningDialogEvent.java new file mode 100644 index 000000000..8ae93df21 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/SystemTunningDialogEvent.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import java.awt.BorderLayout; +import java.awt.Frame; +import java.awt.Window; + +import javax.annotation.Nullable; +import javax.swing.JComponent; +import javax.swing.JPanel; + +import com.intellij.openapi.ui.DialogWrapper; +import com.intellij.openapi.ui.DialogWrapperDialog; + +/** + * SystemTunningDialog 加载框 + * + * @version 1.0 + * @date 2021/04/14 20:13 + **/ +public class SystemTunningDialogEvent extends DialogWrapper { + private JPanel fileJpanel = null; + + /** + * SystemTunningDialogEvent + * + * @param title title + * @param fileJpanel fileJpanel + */ + public SystemTunningDialogEvent(String title, JPanel fileJpanel) { + super(true); + this.fileJpanel = fileJpanel; + init(); + setTitle(title); + } + + /** + * createCenterPanel + * + * @return JComponent + */ + @Nullable + @Override + protected JComponent createCenterPanel() { + JPanel dialogPanel = new JPanel(new BorderLayout()); + if (fileJpanel != null) { + dialogPanel.add(fileJpanel, BorderLayout.CENTER); + } + return dialogPanel; + } + + @Nullable + @Override + protected JComponent createSouthPanel() { + JPanel dialogSouthPanel = new JPanel(new BorderLayout()); + return dialogSouthPanel; + } + + /** + * closeWindow + * + * @param window window + * @param modalOnly modalOnly + */ + public static void closeWindow(Window window, boolean modalOnly) { + if (modalOnly && window instanceof Frame) { + return; + } + if (window instanceof DialogWrapperDialog) { + ((DialogWrapperDialog) window).getDialogWrapper().doCancelAction(); + return; + } + window.setVisible(false); + window.dispose(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/TaskPanelEvent.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/TaskPanelEvent.java new file mode 100644 index 000000000..4841e63ef --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/TaskPanelEvent.java @@ -0,0 +1,431 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JPanel; +import javax.swing.JTabbedPane; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import ohos.devtools.datasources.utils.session.service.SessionManager; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.Common; +import ohos.devtools.views.common.Constant; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.swing.SystemTunningConfigPanel; +import ohos.devtools.views.layout.swing.TaskPanel; +import ohos.devtools.views.layout.swing.TaskPanelWelcome; +import ohos.devtools.views.layout.swing.TaskScenePanel; + +/** + * 设备进程容器 + * + * @version 1.0 + * @date 2021/03/02 + **/ +public class TaskPanelEvent { + private static final Logger LOGGER = LogManager.getLogger(TaskPanelEvent.class); + + private Common common = new Common(); + + /** + * AddClick + * + * @param jTaskPanel jTaskPanel + * @param taskPanel taskPanel + * @param taskPanelWelcome taskPanelWelcome + */ + public void jButtonAddClick(TaskPanel jTaskPanel, JPanel taskPanel, TaskPanelWelcome taskPanelWelcome) { + jTaskPanel.getJButtonAdd().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + taskPanel.removeAll(); + if (Constant.jtasksTab == null || (Constant.jtasksTab != null + && Constant.jtasksTab.getTabCount() == 0)) { + Constant.jtasksTab = new JTabbedPane(); + } + new TaskPanel(taskPanel, taskPanelWelcome); + // 更新所有的run -- of -- + common.updateNum(Constant.jtasksTab); + taskPanel.getParent().getParent().getParent().getParent().setVisible(true); + } + }); + } + + /** + * When the total length of the tab label is too long, the size of each label is automatically + * changed so that all the labels are in one line + * + * @param jButton jButton + * @param taskPanel taskPanel + */ + private void tabAdaptive(JButton jButton, JPanel taskPanel) { + int countX = Constant.jtasksTab.getTabCount() * LayoutConstants.NUMBER_X; + if (countX > taskPanel.getWidth()) { + for (int index = 0; index < Constant.jtasksTab.getTabCount(); index++) { + Constant.jtasksTab.getTabComponentAt(index).setPreferredSize(new Dimension( + ((taskPanel.getWidth() - LayoutConstants.APP_BUT_X) / Constant.jtasksTab.getTabCount()) + - LayoutConstants.TASK_DEC_NUM, LayoutConstants.JAVA_HEIGHT)); + jButton.setBounds(taskPanel.getWidth() - LayoutConstants.TASK_LABEL_X, LayoutConstants.NUMBER_Y, + LayoutConstants.BUTTON_HEIGHT, LayoutConstants.BUTTON_HEIGHT); + } + } else { + for (int index = 0; index < Constant.jtasksTab.getTabCount(); index++) { + Component taskTable = Constant.jtasksTab.getTabComponentAt(index); + if (taskTable instanceof JPanel) { + JPanel taskTablePanel = (JPanel) taskTable; + taskTablePanel.getComponents()[0] + .setPreferredSize(new Dimension(LayoutConstants.JP_LEFT_WIDTH, LayoutConstants.JAVA_HEIGHT)); + } + Constant.jtasksTab.getTabComponentAt(index) + .setPreferredSize(new Dimension(LayoutConstants.JPA_LABEL_WIDTH, LayoutConstants.JAVA_HEIGHT)); + jButton.setBounds(LayoutConstants.NUMBER_X_ADD * Constant.jtasksTab.getTabCount(), + LayoutConstants.NUMBER_Y, LayoutConstants.BUTTON_HEIGHT, LayoutConstants.BUTTON_HEIGHT); + } + } + } + + /** + * XButton to add close tab function + * + * @param jTaskPanel jTaskPanel + * @param taskPanel taskPanel + * @param taskPanelWelcome taskPanelWelcome + */ + public void clickClose(TaskPanel jTaskPanel, JPanel taskPanel, TaskPanelWelcome taskPanelWelcome) { + jTaskPanel.getJLabelClose().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + // 清除Constant.tracePath + Constant.tracePath = ""; + jTaskPanel.removeAll(); + taskPanel.removeAll(); + Constant.jtasksTab.remove(Constant.jtasksTab.indexOfTabComponent(jTaskPanel.getJPanelTabLabel())); + // 移除现有组件重新添加,解决+号位置问题 + JButton jButton = jTaskPanel.getJButtonAdd(); + // 当选项卡标签总长度过长时自动改变每个标签的大小使所有的标签在一行 + tabAdaptive(jButton, taskPanel); + jTaskPanel.setjButtonAdd(jButton); + jTaskPanel.add(jButton); + jTaskPanel.add(Constant.jtasksTab); + taskPanel.add(jTaskPanel); + taskPanel.repaint(); + // 更新所有的run -- of -- + common.updateNum(Constant.jtasksTab); + // 移除页面更新信息 + if (Constant.jtasksTab.getTabCount() == 0) { + Long localSessionId = jTaskPanel.getLocalSessionId(); + if (localSessionId != null && localSessionId != 0L) { + SessionManager sessionManager = SessionManager.getInstance(); + sessionManager.deleteSession(localSessionId); + } + taskPanel.removeAll(); + Constant.jtasksTab = null; + // 添加首页 + taskPanel.add(taskPanelWelcome); + taskPanel.updateUI(); + taskPanel.repaint(); + } + } + }); + } + + /** + * XAdd the button to move the mouse into the display close button + * + * @param jTaskPanel jTaskPanel + */ + public void mouseEntered(TaskPanel jTaskPanel) { + jTaskPanel.getJLabelClose().addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent mouseEvent) { + jTaskPanel.getJLabelClose().setText("X"); + } + }); + } + + /** + * X button is added when the mouse moves out without showing the close button + * + * @param jTaskPanel jTaskPanel + */ + public void mouseExited(TaskPanel jTaskPanel) { + jTaskPanel.getJLabelClose().addMouseListener(new MouseAdapter() { + @Override + public void mouseExited(MouseEvent mouseEvent) { + jTaskPanel.getJLabelClose().setText(""); + } + }); + } + + /** + * Add a click event to the figure JButtonApplyTun + * + * @param taskPanel taskPanel + * @param jTaskPanel jTaskPanel + */ + public void pplyTunMouseListener(JPanel taskPanel, TaskPanel jTaskPanel) { + jTaskPanel.getJButtonApplyTun().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + jTaskPanel.getJLabelTaskTun().setText( + "Application tuning

Tune application Launch performance with " + + "a 5 second time profile and a thread state trace."); + jTaskPanel.getjLabelIcon().setIcon(new ImageIcon( + TaskPanelEvent.class.getClassLoader().getResource("images/application_tuning.png"))); + taskPanel.repaint(); + } + }); + } + + /** + * Add a click event to the figure JButtonSystemTun + * + * @param taskPanel taskPanel + * @param jTaskPanel jTaskPanel + */ + public void addSystemMouseListener(JPanel taskPanel, TaskPanel jTaskPanel) { + jTaskPanel.getJButtonSystemTun().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + jTaskPanel.getJLabelTaskTun().setText( + "System tuning

A comprehensive view of what’s happing in the " + + "operating system. See how threads are being scheduled across CPUs."); + jTaskPanel.getjLabelIcon().setIcon(new ImageIcon( + TaskPanelEvent.class.getClassLoader().getResource("images/system_tuning.png"))); + taskPanel.repaint(); + } + }); + } + + /** + * Add a click event to the Choose button + * + * @param jTaskPanel jTaskPanel + */ + public void applicationTuningClickListener(TaskPanel jTaskPanel) { + jTaskPanel.getChooseButton().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + // 选项卡页面移除场景选择并添加三级页面 + jTaskPanel.getOptionJPanelContent().setVisible(false); + if (jTaskPanel.getJLabelTaskTun().getText().contains("System tuning")) { + SystemTunningConfigPanel taskSystemTuningPanel = new SystemTunningConfigPanel(jTaskPanel); + // 将三级界面添加进二级界面容器 + jTaskPanel.getOptionJPanel().setLayout(new BorderLayout()); + jTaskPanel.getOptionJPanel().add(taskSystemTuningPanel); + } else { + TaskScenePanel taskScenePanel = new TaskScenePanel(jTaskPanel); + // 将三级界面添加进二级界面容器 + jTaskPanel.getOptionJPanel().setLayout(new BorderLayout()); + jTaskPanel.getOptionJPanel().add(taskScenePanel); + } + // 刷新页面 + jTaskPanel.getOptionJPanel().repaint(); + } + }); + } + + /** + * Monitor window size changes to make graphicsJpanel size adaptive + * + * @param taskPanel taskPanel + * @param graphicsJpanel graphicsJpanel + */ + public void listenerGraphicsJpanel(JPanel graphicsJpanel, TaskPanel taskPanel) { + taskPanel.getOptionJPanelContent().addComponentListener(new ComponentAdapter() { + /** + * componentResized + * + * @param exception exception + */ + public void componentResized(ComponentEvent exception) { + graphicsJpanel.setBounds(0, LayoutConstants.WIDTHSUPEN, taskPanel.getOptionJPanelContent().getWidth(), + LayoutConstants.JAVA_WIDTH); + } + }); + } + + /** + * Monitor the size of taskPanel, and link the size of jTabbedPane to it + * + * @param taskPanel taskPanel + * @param jButtonAdd jButtonAdd + */ + public void listenerTaskPanel(JPanel taskPanel, JButton jButtonAdd) { + taskPanel.addComponentListener(new ComponentAdapter() { + /** + * componentResized + * + * @param exception exception + */ + public void componentResized(ComponentEvent exception) { + int width = taskPanel.getWidth(); + int height = taskPanel.getHeight(); + Constant.jtasksTab.setBounds(LayoutConstants.DEVICE_PRO_Y, LayoutConstants.DEVICE_PRO_Y, + LayoutConstants.WINDOW_WIDTH + (width - LayoutConstants.WINDOW_WIDTH), + LayoutConstants.WINDOW_HEIGHT + (height - LayoutConstants.WINDOW_HEIGHT)); + double result = Constant.jtasksTab.getTabCount() * LayoutConstants.NUMBER_X; + if (result > taskPanel.getWidth()) { + for (int index = 0; index < Constant.jtasksTab.getTabCount(); index++) { + Component taskTable = Constant.jtasksTab.getTabComponentAt(index); + if (taskTable instanceof JPanel) { + JPanel taskTablePanel = (JPanel) taskTable; + taskTablePanel.getComponents()[0].setPreferredSize(new Dimension( + (((taskPanel.getWidth() - LayoutConstants.APP_BUT_X) + / Constant.jtasksTab.getTabCount()) - LayoutConstants.TASK_DEC_NUM) + - LayoutConstants.JAVA_HEIGHT, LayoutConstants.JAVA_HEIGHT)); + } + Constant.jtasksTab.getTabComponentAt(index).setPreferredSize(new Dimension( + ((taskPanel.getWidth() - LayoutConstants.APP_BUT_X) / Constant.jtasksTab.getTabCount()) + - LayoutConstants.TASK_DEC_NUM, LayoutConstants.JAVA_HEIGHT)); + jButtonAdd + .setBounds(taskPanel.getWidth() - LayoutConstants.TASK_LABEL_X, LayoutConstants.NUMBER_Y, + LayoutConstants.BUTTON_HEIGHT, LayoutConstants.BUTTON_HEIGHT); + } + } else { + for (int index = 0; index < Constant.jtasksTab.getTabCount(); index++) { + Object tabObj = Constant.jtasksTab.getTabComponentAt(index); + if (tabObj instanceof JPanel) { + ((JPanel) tabObj).getComponents()[0].setPreferredSize( + new Dimension(LayoutConstants.JP_LEFT_WIDTH, LayoutConstants.JAVA_HEIGHT)); + } + Constant.jtasksTab.getTabComponentAt(index).setPreferredSize( + new Dimension(LayoutConstants.JPA_LABEL_WIDTH, LayoutConstants.JAVA_HEIGHT)); + jButtonAdd.setBounds(LayoutConstants.NUMBER_X_ADD * Constant.jtasksTab.getTabCount(), + LayoutConstants.NUMBER_Y, LayoutConstants.BUTTON_HEIGHT, LayoutConstants.BUTTON_HEIGHT); + } + } + } + }); + listenerTabPanel(taskPanel, jButtonAdd); + } + + /** + * Tab listening event + * + * @param taskPanel taskPanel + * @param jButtonAdd jButtonAdd + */ + private void listenerTabPanel(JPanel taskPanel, JButton jButtonAdd) { + Constant.jtasksTab.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent exception) { + double result = Constant.jtasksTab.getTabCount() * LayoutConstants.NUMBER_X; + if (result > taskPanel.getWidth()) { + for (int index = 0; index < Constant.jtasksTab.getTabCount(); index++) { + Object tabObj = Constant.jtasksTab.getTabComponentAt(index); + if (tabObj instanceof JPanel) { + ((JPanel) tabObj).getComponents()[0].setPreferredSize(new Dimension( + (((taskPanel.getWidth() - LayoutConstants.APP_BUT_X) + / Constant.jtasksTab.getTabCount()) - LayoutConstants.TASK_DEC_NUM) + - LayoutConstants.JAVA_HEIGHT, LayoutConstants.JAVA_HEIGHT)); + } + Constant.jtasksTab.getTabComponentAt(index).setPreferredSize(new Dimension( + ((taskPanel.getWidth() - LayoutConstants.APP_BUT_X) / Constant.jtasksTab.getTabCount()) + - LayoutConstants.TASK_DEC_NUM, LayoutConstants.JAVA_HEIGHT)); + jButtonAdd + .setBounds(taskPanel.getWidth() - LayoutConstants.TASK_LABEL_X, + LayoutConstants.NUMBER_Y, LayoutConstants.BUTTON_HEIGHT, LayoutConstants.BUTTON_HEIGHT); + } + } else { + jButtonAdd.setBounds(LayoutConstants.NUMBER_X_ADD * Constant.jtasksTab.getTabCount(), + LayoutConstants.NUMBER_Y, LayoutConstants.BUTTON_HEIGHT, LayoutConstants.BUTTON_HEIGHT); + } + } + }); + } + + /** + * 场景选择,添加选择样式。 + * + * @param taskPanel 二级界面 + */ + public void sigleClick(TaskPanel taskPanel) { + taskPanel.getJButtonApplyTun().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + taskPanel.getJButtonApplyTun().setBackground(ColorConstants.APPLYTUN_COLOR); + taskPanel.getJButtonSystemTun().setBackground(ColorConstants.SYSTEM_COLOR); + taskPanel.getJButtonHadoop().setBackground(ColorConstants.SYSTEM_COLOR); + } + }); + taskPanel.getJButtonSystemTun().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + taskPanel.getJButtonApplyTun().setBackground(ColorConstants.SYSTEM_COLOR); + taskPanel.getJButtonSystemTun().setBackground(ColorConstants.APPLYTUN_COLOR); + taskPanel.getJButtonHadoop().setBackground(ColorConstants.SYSTEM_COLOR); + } + }); + taskPanel.getJButtonHadoop().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + taskPanel.getJButtonApplyTun().setBackground(ColorConstants.SYSTEM_COLOR); + taskPanel.getJButtonSystemTun().setBackground(ColorConstants.SYSTEM_COLOR); + taskPanel.getJButtonHadoop().setBackground(ColorConstants.APPLYTUN_COLOR); + } + }); + } + + /** + * 监听窗体大小改变组件位置 + * + * @param taskPanel taskPanel + * @param jTaskPanel jTaskPanel + */ + public void listenerWindow(JPanel taskPanel, TaskPanel jTaskPanel) { + taskPanel.addComponentListener(new ComponentAdapter() { + /** + * componentResized + * + * @param exception exception + */ + public void componentResized(ComponentEvent exception) { + int width = taskPanel.getWidth(); + int height = taskPanel.getHeight(); + jTaskPanel.getChooseButton() + .setBounds(LayoutConstants.CHOSSE_X + (width - LayoutConstants.WINDOW_WIDTH), + LayoutConstants.CHOOSE_Y + (height - LayoutConstants.WINDOW_HEIGHT), + LayoutConstants.DEVICES_WIDTH, LayoutConstants.CHOOSE_HEIGHT); + jTaskPanel.getTraceButton().setBounds(LayoutConstants.TASK_SCENE_X, + LayoutConstants.CHOOSE_Y + (height - LayoutConstants.WINDOW_HEIGHT), LayoutConstants.CHOOSE_WIDTH, + LayoutConstants.CHOOSE_HEIGHT); + } + }); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/TaskPanelWelcomeEvent.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/TaskPanelWelcomeEvent.java new file mode 100644 index 000000000..a4a9239ed --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/TaskPanelWelcomeEvent.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import ohos.devtools.views.common.Common; +import ohos.devtools.views.common.Constant; +import ohos.devtools.views.layout.swing.TaskPanel; +import ohos.devtools.views.layout.swing.TaskPanelWelcome; + +import javax.swing.JPanel; +import javax.swing.JTabbedPane; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/** + * 二级欢迎界面事件处理对象 + * + * @version 1.0 + * @date 2021/03/01 15:20 + **/ +public class TaskPanelWelcomeEvent { + // 初始化公共方法类 + private Common common = new Common(); + + /** + * 给新增实时任务按钮添加事件 + * + * @param taskPanelWelcome taskPanelWelcome + * @date 2021/03/01 15:20 + */ + public void clickAddTask(TaskPanelWelcome taskPanelWelcome) { + taskPanelWelcome.getJNewButton().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + // 获取Jframe和taskPanel二级界面容器 + JPanel taskPanel = null; + Object obj = taskPanelWelcome.getParent(); + if (obj instanceof JPanel) { + taskPanel = (JPanel) obj; + taskPanel.remove(taskPanelWelcome); + if (Constant.jtasksTab == null || (Constant.jtasksTab != null + && Constant.jtasksTab.getTabCount() == 0)) { + Constant.jtasksTab = new JTabbedPane(); + } + new TaskPanel(taskPanel, taskPanelWelcome); + // 更新所有的run -- of -- + common.updateNum(Constant.jtasksTab); + taskPanel.updateUI(); + taskPanel.repaint(); + } + } + + }); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/TaskScenePanelChartEvent.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/TaskScenePanelChartEvent.java new file mode 100644 index 000000000..d3cef41c2 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/TaskScenePanelChartEvent.java @@ -0,0 +1,677 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import ohos.devtools.datasources.utils.session.service.SessionManager; +import ohos.devtools.services.memory.ChartDataCache; +import ohos.devtools.views.charts.model.ChartStandard; +import ohos.devtools.views.charts.utils.ChartUtils; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.Constant; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.hoscomp.HosDialog; +import ohos.devtools.views.common.hoscomp.HosJButton; +import ohos.devtools.views.common.hoscomp.HosJComboBox; +import ohos.devtools.views.common.hoscomp.HosJLabel; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.swing.CountingThread; +import ohos.devtools.views.layout.swing.SampleDialogWrapper; +import ohos.devtools.views.layout.swing.SaveTraceDialog; +import ohos.devtools.views.layout.swing.TaskPanel; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JLayeredPane; +import javax.swing.JPanel; +import javax.swing.JSplitPane; +import javax.swing.UIManager; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import static ohos.devtools.views.common.ViewConstants.NUM_10; +import static ohos.devtools.views.common.ViewConstants.NUM_2; + +/** + * 任务场景面板图事件类 + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class TaskScenePanelChartEvent { + private boolean flagLeft = false; + private boolean flag = false; + private Container obj = null; + private boolean buttonAvailable = true; + private boolean resultDelete = false; + + /** + * 点击删除 + * + * @param taskScenePanelChart taskScenePanelChart + */ + public void clickDelete(TaskScenePanelChart taskScenePanelChart) { + taskScenePanelChart.getJButtonDelete().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + long localSessionId = taskScenePanelChart.getJButtonDelete().getSessionId(); + Font font = new Font("", 0, LayoutConstants.SIXTEEN); + UIManager.put("OptionPane.messageFont", font); + if (localSessionId < 0) { + new SampleDialogWrapper("prompt", "Please select the task to delete first !").show(); + return; + } + SampleDialogWrapper sampleDialogWrapper = + new SampleDialogWrapper("prompt", "Are you sure you want to delete this task ?"); + boolean flags = sampleDialogWrapper.showAndGet(); + if (flags) { + // 调用SessionManager的删除sessionId + if (!SessionManager.getInstance().deleteSession(localSessionId)) { + return; + } + CountingThread countingThread = taskScenePanelChart.getCounting(); + countingThread.setStopFlag(true); + // 容器中销毁char和Session的panel + // 删除界面cards的Session + deleteSession(localSessionId, taskScenePanelChart); + // 删除界面char + deleteChart(localSessionId, taskScenePanelChart); + taskScenePanelChart.getJButtonDelete().setSessionId(Constant.ABNORMAL); + taskScenePanelChart.repaint(); + // 清除sessionid,保存trace文件时根据这个判断是否可以保存 + taskScenePanelChart.getjButtonSave().setSessionId(0); + + taskScenePanelChart.getjButtonRun().setIcon(new ImageIcon( + TaskScenePanelChartEvent.class.getClassLoader().getResource("images/over.png"))); + taskScenePanelChart.getjButtonStop().setIcon(new ImageIcon( + TaskScenePanelChartEvent.class.getClassLoader().getResource("images/suspended.png"))); + resultDelete = true; + } + } + }); + } + + /** + * Delete interface chart + * + * @param localSessionId localSessionId + * @param taskScenePanelChart taskScenePanelChart + */ + private void deleteChart(long localSessionId, TaskScenePanelChart taskScenePanelChart) { + Component[] carts = taskScenePanelChart.getCards().getComponents(); + for (Component cart : carts) { + if (cart instanceof JPanel) { + Component[] jcardsPanels = ((JPanel) cart).getComponents(); + for (Component item : jcardsPanels) { + ProfilerChartsView profilerView = null; + if (item instanceof ProfilerChartsView) { + profilerView = (ProfilerChartsView) item; + if (profilerView.getSessionId() == localSessionId) { + ((JPanel) cart).remove(profilerView); + } + } + } + } + } + } + + /** + * Delete Session + * + * @param localSessionId localSessionId + * @param taskScenePanelChart taskScenePanelChart + */ + private void deleteSession(long localSessionId, TaskScenePanelChart taskScenePanelChart) { + JPanel jScrollCardsPanelInner = taskScenePanelChart.getJScrollCardsPanelInner(); + Component[] innerJpanel = jScrollCardsPanelInner.getComponents(); + for (Component inner : innerJpanel) { + Component[] innerLable = null; + if (inner instanceof JPanel) { + innerLable = ((JPanel) inner).getComponents(); + for (Component item : innerLable) { + if (item instanceof HosJLabel && localSessionId == ((HosJLabel) item).getSessionId()) { + jScrollCardsPanelInner.remove(inner); + } + } + } + } + } + + /** + * clickUpAndNext + * + * @param taskScenePanelChart taskScenePanelChart + */ + public void clickUpAndNext(TaskScenePanelChart taskScenePanelChart) { + // 给上一个页面按钮添加点击事件 + taskScenePanelChart.getjButtonUp().addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent exception) { + if (Constant.jtasksTab.getSelectedIndex() > 0) { + Constant.jtasksTab.setSelectedIndex(Constant.jtasksTab.getSelectedIndex() - 1); + } + } + }); + // 给下一个页面按钮添加点击事件 + taskScenePanelChart.getjButtonNext().addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent exception) { + if (Constant.jtasksTab.getSelectedIndex() != Constant.jtasksTab.getTabCount() - 1) { + Constant.jtasksTab.setSelectedIndex(Constant.jtasksTab.getSelectedIndex() + 1); + } + } + }); + } + + private void stopTask(ProfilerChartsView profilerView, HosJButton stopButton, + TaskScenePanelChart taskScenePanelChart) { + profilerView.getObserver().stopRefresh(false); + stopButton.setIcon(new ImageIcon( + TaskScenePanelChartEvent.class.getClassLoader().getResource("images/over.png"))); + taskScenePanelChart.getjButtonStop().setIcon(new ImageIcon( + TaskScenePanelChartEvent.class.getClassLoader().getResource("images/suspended.png"))); + buttonAvailable = false; + CountingThread countingThread = taskScenePanelChart.getCounting(); + countingThread.setStopFlag(true); + stopButton.setToolTipText("启动"); + SessionManager.getInstance().endSession(stopButton.getSessionId()); + ChartDataCache.getInstance().clearDataCache(String.valueOf(stopButton.getSessionId())); + profilerView.setStopFlag(true); + profilerView.setFlagEnd(true); + } + + private void startTask(ProfilerChartsView profilerView, HosJButton stopButton, + TaskScenePanelChart taskScenePanelChart) { + stopButton.setIcon(new ImageIcon( + TaskScenePanelChartEvent.class.getClassLoader().getResource("images/button_record.png"))); + taskScenePanelChart.getjButtonStop().setIcon(new ImageIcon( + TaskScenePanelChartEvent.class.getClassLoader().getResource("images/button_stop.png"))); + buttonAvailable = true; + stopButton.setToolTipText("停止"); + // Set the icon change after the pause button is clicked Open the session to get data + long sessionId = stopButton.getSessionId(); + SessionManager sessionManager = SessionManager.getInstance(); + sessionManager.startSession(sessionId, true); + sessionManager.fetchData(sessionId); + if (profilerView.getObserver().isScrollbarShow()) { + profilerView.removeScrollbar(); + } + JLabel jTextArea = taskScenePanelChart.getjTextArea(); + CountingThread counting = new CountingThread(jTextArea); + taskScenePanelChart.setCounting(counting); + counting.start(); + // The "Pause/Resume" button will change accordingly + profilerView.getTimeline().removeTablePanel(); + profilerView.setFlagDown(false); + // Clear the selected time after restarting + profilerView.getObserver().getStandard().clearSelectedRange(); + profilerView.showLoading(); + profilerView.setStopFlag(false); + profilerView.setFlagEnd(false); + } + + /** + * clickRunAndStop + * + * @param taskScenePanelChart taskScenePanelChart + * @param profilerView profilerView + */ + public void clickRunAndStop(TaskScenePanelChart taskScenePanelChart, ProfilerChartsView profilerView) { + HosJButton stopButton = taskScenePanelChart.getjButtonRun(); + stopButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent exception) { + if (resultDelete) { + return; + } + if (profilerView.isLoading()) { + return; + } + if (!profilerView.isStopFlag()) { + stopTask(profilerView, stopButton, taskScenePanelChart); + } else { + startTask(profilerView, stopButton, taskScenePanelChart); + } + } + }); + pauseButtonEvent(taskScenePanelChart, profilerView); + } + + /** + * Pause button event + * + * @param taskScenePanelChart taskScenePanelChart + * @param profilerView profilerView + */ + private void pauseButtonEvent(TaskScenePanelChart taskScenePanelChart, ProfilerChartsView profilerView) { + taskScenePanelChart.getjButtonStop().addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent exception) { + if (resultDelete) { + return; + } + if (profilerView.isLoading()) { + return; + } + if (buttonAvailable) { + if (!profilerView.isFlagEnd()) { + taskScenePanelChart.getjButtonStop().setIcon(new ImageIcon( + TaskScenePanelChartEvent.class.getClassLoader().getResource("images/suspended.png"))); + taskScenePanelChart.getjButtonStop().setToolTipText("开始"); + profilerView.getObserver().pauseRefresh(); + profilerView.setFlagEnd(true); + } else { + taskScenePanelChart.getjButtonStop().setIcon(new ImageIcon( + TaskScenePanelChartEvent.class.getClassLoader().getResource("images/button_stop.png"))); + taskScenePanelChart.getjButtonBottom().setIcon(new ImageIcon( + TaskScenePanelChartEvent.class.getClassLoader() + .getResource("images/button_bottom_bar_grey.png"))); + taskScenePanelChart.getjButtonStop().setToolTipText("暂停"); + profilerView.getObserver().restartRefresh(); + profilerView.getTimeline().removeTablePanel(); + profilerView.setFlagDown(false); + profilerView.setFlagEnd(false); + } + } + } + }); + } + + /** + * clickBottom + * + * @param taskScenePanelChart taskScenePanelChart + * @param profilerView profilerView + */ + public void clickBottom(TaskScenePanelChart taskScenePanelChart, ProfilerChartsView profilerView) { + taskScenePanelChart.getjButtonBottom().addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent exception) { + if (!profilerView.isAbleUnfoldTable()) { + return; + } + if (!profilerView.isFlagDown()) { + if (profilerView.isFlagEnd() && profilerView.isChartLevel()) { + profilerView.getTimeline().removeTablePanel(); + } + } else { + if (profilerView.isFlagEnd() && profilerView.isChartLevel()) { + profilerView.getTimeline().addTablePanel(); + } + } + } + }); + } + + /** + * splitPaneChange + * + * @param taskScenePanelChart taskScenePanelChart + * @param numberSum numberSum + */ + public void splitPaneChange(TaskScenePanelChart taskScenePanelChart, int numberSum) { + taskScenePanelChart.getSplitPane().addPropertyChangeListener(new java.beans.PropertyChangeListener() { + /** + * propertyChange + * + * @param evt evt + */ + public void propertyChange(java.beans.PropertyChangeEvent evt) { + if (evt.getPropertyName().equals(JSplitPane.DIVIDER_LOCATION_PROPERTY)) { + int numEvt = 0; + for (int index = 0; index < numberSum; index++) { + JPanel jPanel = null; + Object objNew = taskScenePanelChart.getJScrollCardsPanelInner().getComponentAt(0, numEvt); + if (objNew instanceof JPanel) { + jPanel = (JPanel) objNew; + jPanel.setBounds(0, numEvt, + LayoutConstants.RIGHT_BUN_WIDTH + Integer.parseInt(evt.getNewValue().toString()) + - LayoutConstants.RIGHT_BUN_WIDTH, LayoutConstants.HEIGHT); + numEvt += LayoutConstants.HEIGHT; + jPanel.updateUI(); + jPanel.repaint(); + } + } + } + } + }); + } + + /** + * clickLeft + * + * @param taskScenePanelChart taskScenePanelChart + */ + public void clickLeft(TaskScenePanelChart taskScenePanelChart) { + taskScenePanelChart.getjButtonLeft().addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent exception) { + if (!flagLeft) { + taskScenePanelChart.getSplitPane().setDividerLocation(1); + taskScenePanelChart.getSplitPane().updateUI(); + taskScenePanelChart.getSplitPane().repaint(); + flagLeft = true; + } else { + taskScenePanelChart.getSplitPane().setDividerLocation(LayoutConstants.CHOOSE_WIDTH); + flagLeft = false; + taskScenePanelChart.getSplitPane().updateUI(); + taskScenePanelChart.getSplitPane().repaint(); + } + } + }); + taskScenePanelChart.addComponentListener(new ComponentAdapter() { + /** + * componentResized + * + * @param exception exception + */ + public void componentResized(ComponentEvent exception) { + if (flagLeft) { + taskScenePanelChart.getSplitPane().setDividerLocation(1); + taskScenePanelChart.getSplitPane().updateUI(); + taskScenePanelChart.getSplitPane().repaint(); + flagLeft = true; + } else { + taskScenePanelChart.getSplitPane() + .setDividerLocation(taskScenePanelChart.getSplitPane().getDividerLocation()); + taskScenePanelChart.getSplitPane().updateUI(); + taskScenePanelChart.getSplitPane().repaint(); + } + } + }); + } + + /** + * bindSessionId + * + * @param taskScenePanelChart taskScenePanelChart + * @param jLabelRight jLabelRight + * @param jMultiplePanel jMultiplePanel + */ + private void bindSessionId(TaskScenePanelChart taskScenePanelChart, HosJLabel jLabelRight, JPanel jMultiplePanel) { + taskScenePanelChart.getjButtonRun().setSessionId(jLabelRight.getSessionId()); + taskScenePanelChart.getjButtonStop().setSessionId(jLabelRight.getSessionId()); + taskScenePanelChart.getjButtonSave().setSessionId(jLabelRight.getSessionId()); + taskScenePanelChart.getjButtonSave().setDeviceName(jLabelRight.getDeviceName()); + taskScenePanelChart.getjButtonSave().setProcessName(jLabelRight.getProcessName()); + taskScenePanelChart.getJButtonDelete().setSessionId(jLabelRight.getSessionId()); + taskScenePanelChart.getJButtonDelete().setDeviceName(jLabelRight.getDeviceName()); + taskScenePanelChart.getJButtonDelete().setProcessName(jLabelRight.getProcessName()); + taskScenePanelChart.getjButtonInsert().setSessionId(jLabelRight.getSessionId()); + taskScenePanelChart.getjButtonBottom().setSessionId(jLabelRight.getSessionId()); + taskScenePanelChart.getjButtonLeft().setSessionId(jLabelRight.getSessionId()); + taskScenePanelChart.getjComboBox().setSessionId(jLabelRight.getSessionId()); + taskScenePanelChart.getTimeJComboBox().setSessionId(jLabelRight.getSessionId()); + taskScenePanelChart.getJScrollCardsPanelInner().remove(jMultiplePanel); + taskScenePanelChart.getJScrollCardsPanelInner().repaint(); + } + + /** + * clickEvery + * + * @param taskScenePanelChart taskScenePanelChart + * @param jLabelRight jLabelRight + * @param numberSum numberSum + * @param jLabelSelect jLabelSelect + * @param jMultiplePanel jMultiplePanel + */ + public void clickEvery(TaskScenePanelChart taskScenePanelChart, HosJLabel jLabelRight, int numberSum, + String jLabelSelect, JPanel jMultiplePanel) { + jLabelRight.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + // 绑定sessionId + bindSessionId(taskScenePanelChart, jLabelRight, jMultiplePanel); + // 获取其他jlabel设置背景色 + Component[] component = taskScenePanelChart.getJScrollCardsPanelInner().getComponents(); + for (Component componentEvery : component) { + JPanel jPanelEvery = null; + if (componentEvery instanceof JPanel) { + jPanelEvery = (JPanel) componentEvery; + Component[] componentjPanelEvery = jPanelEvery.getComponents(); + for (Component componentjPanelEverySet : componentjPanelEvery) { + JLabel jLabelEvery = null; + if (componentjPanelEverySet instanceof JLabel) { + jLabelEvery = (JLabel) componentjPanelEverySet; + jLabelEvery.setBackground(ColorConstants.BLACK_COLOR); + jLabelEvery.setForeground(Color.gray); + } + } + } + } + taskScenePanelChart.getJScrollCardsPanelInner().add(jMultiplePanel); + taskScenePanelChart.getJScrollCardsPanelInner().repaint(); + jLabelRight.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jLabelRight.setForeground(Color.white); + taskScenePanelChart.getjLabelLeft().setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + int numy = 0; + // 循环确定擦片布局显示哪个页面 + for (int index = 0; index < numberSum; index++) { + JPanel jPanel = null; + Object innerObj = taskScenePanelChart.getJScrollCardsPanelInner().getComponentAt(0, numy); + if (innerObj instanceof JPanel) { + jPanel = (JPanel) innerObj; + numy += LayoutConstants.HEIGHT; + Color colorBack = jPanel.getComponent(0).getBackground(); + if (colorBack == Color.black) { + taskScenePanelChart.getCardLayout().show(taskScenePanelChart.getCards(), "card" + index); + } + } + } + // Replace the content of the tab with the content of the clicked device information + replaceDevicesInfo(jLabelSelect); + } + }); + } + + /** + * Replace device information + * + * @param jLabelSelect Selected jLabel + */ + private void replaceDevicesInfo(String jLabelSelect) { + JPanel jCompent = null; + Object tabComObj = Constant.jtasksTab.getTabComponentAt(Constant.jtasksTab.getSelectedIndex()); + if (tabComObj instanceof JPanel) { + jCompent = (JPanel) tabComObj; + JPanel jCompentLeft = null; + Object componentObj = jCompent.getComponent(0); + if (componentObj instanceof JPanel) { + jCompentLeft = (JPanel) componentObj; + Object leftObj = jCompentLeft.getComponent(0); + if (leftObj instanceof JLabel) { + ((JLabel) leftObj).setText(jLabelSelect); + } + } + } + } + + /** + * 按钮增加点击时间触发时间刻度的选择 + * + * @param jComboBox jComboBox + * @param profilerView profilerView + */ + public void clickZoomEvery(HosJComboBox jComboBox, ProfilerChartsView profilerView) { + jComboBox.addItemListener(event -> { + long sessionId = jComboBox.getSessionId(); + int newSizeTime = 0; + if (event.getStateChange() == 1) { + // 获取点击时间选择的时间刻度间隔 + String[] msTime = jComboBox.getSelectedItem().toString().split("m"); + newSizeTime = Integer.parseInt(msTime[0]); + } + ChartStandard standard = profilerView.getObserver().getStandard(); + if (standard != null) { + checkNewTime(standard, newSizeTime, profilerView); + } + }); + } + + /** + * 检查频率切换后的时间是否需要修正 + * + * @param standard ChartStandard + * @param newSizeTime 新的时间大小 + * @param view ProfilerChartsView + */ + private void checkNewTime(ChartStandard standard, int newSizeTime, ProfilerChartsView view) { + int oldStart = standard.getDisplayRange().getStartTime(); + // 获取刻度间隔对应的最小时间单位值 + int minSize = ChartUtils.divideInt(newSizeTime, NUM_10) * NUM_2; + // 刷新绘图标准的最大展示时间和最小时间单位 + int newMaxDisplay = newSizeTime * NUM_10; + int lastTime = (int) (standard.getLastTimestamp() - standard.getFirstTimestamp()); + + int newStart; + int newEnd; + // 场景1:频率切换后oldStart + newDisplay超过了lastTime,这时要修正start + if (oldStart + newMaxDisplay > lastTime) { + // 场景1.1:切换后newDisplay > lastTime,这时就变成任务刚启动时,Chart没有铺满的场景,start为0,end为lastTime + // 场景1.2:切换后newDisplay < lastTime,修正start为lastTime - display + newStart = Math.max(lastTime - newMaxDisplay, 0); + newEnd = lastTime; + } else { + // 场景2:切换后oldStart + newDisplay未超过lastTime,说明可以正常显示,无需修正start + newStart = oldStart; + newEnd = oldStart + newMaxDisplay; + } + + standard.updateSizeTime(newSizeTime); + view.getObserver().msTimeZoom(newMaxDisplay, minSize, newStart, newEnd); + // 如果newDisplay > lastTime,这时候要隐藏滚动条 + if (newMaxDisplay > lastTime) { + view.removeScrollbar(); + view.revalidate(); + } else { + if (view.getHorizontalBar() == null) { + view.initScrollbar(); + } + view.getHorizontalBar().resizeAndReposition(); + } + } + + /** + * showSuspension + * + * @param taskScenePanelChart taskScenePanelChart + * @param jTaskPanel jTaskPanel + * @param jButtonSuspen jButtonSuspen + */ + public void showSuspension(TaskScenePanelChart taskScenePanelChart, TaskPanel jTaskPanel, JButton jButtonSuspen) { + jButtonSuspen.addActionListener(new ActionListener() { + /** + * actionPerformed + * + * @param exception exception + */ + @Override + public void actionPerformed(ActionEvent exception) { + if (!flag) { + taskScenePanelChart.getjPanelSuspension().setBackground(Color.RED); + taskScenePanelChart.getjPanelSuspension().setBounds( + LayoutConstants.WINDOW_HEIGHT + (jTaskPanel.getWidth() - LayoutConstants.WINDOW_WIDTH), + LayoutConstants.DEVICES_WIDTH + (jTaskPanel.getHeight() - LayoutConstants.WINDOW_HEIGHT), + LayoutConstants.WIDTHSUPEN, LayoutConstants.DEVICE_PRO_WIDTH); + jTaskPanel.add(taskScenePanelChart.getjPanelSuspension(), JLayeredPane.DRAG_LAYER); + flag = true; + jTaskPanel.repaint(); + } else { + jTaskPanel.remove(taskScenePanelChart.getjPanelSuspension()); + flag = false; + jTaskPanel.repaint(); + } + } + }); + } + + /** + * setSceneSize + * + * @param jTaskPanel jTaskPanel + * @param taskScenePanelChart taskScenePanelChart + */ + public void setSceneSize(TaskPanel jTaskPanel, TaskScenePanelChart taskScenePanelChart) { + jTaskPanel.addComponentListener(new ComponentAdapter() { + /** + * componentResized + * + * @param event event + */ + public void componentResized(ComponentEvent event) { + int width = jTaskPanel.getWidth(); + int height = jTaskPanel.getHeight(); + taskScenePanelChart.getjPanelSuspension() + .setBounds(LayoutConstants.WINDOW_HEIGHT + (width - LayoutConstants.WINDOW_WIDTH), + LayoutConstants.DEVICES_WIDTH + (height - LayoutConstants.WINDOW_HEIGHT), + LayoutConstants.WIDTHSUPEN, LayoutConstants.DEVICE_PRO_WIDTH); + } + }); + } + + /** + * 点击保存 + * + * @param jButton jButton + */ + public void clickSave(HosJButton jButton) { + jButton.addActionListener(new ActionListener() { + /** + * actionPerformed + * + * @param event event + */ + @Override + public void actionPerformed(ActionEvent event) { + if (jButton.getSessionId() == 0) { + new SampleDialogWrapper("prompt", "Please select a process record !").show(); + return; + } + new SaveTraceDialog().showCustomDialog(jButton); + } + }); + } + + /** + * Memory新增配置项 + * + * @param taskScenePanelChart taskScenePanelChart + * @param profilerView profilerView + */ + public void clickConfig(TaskScenePanelChart taskScenePanelChart, ProfilerChartsView profilerView) { + obj = taskScenePanelChart; + taskScenePanelChart.getjButtonInsert().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent exception) { + if (!profilerView.isAddItemFlag()) { + super.mouseClicked(exception); + long sessionId = taskScenePanelChart.getjButtonInsert().getSessionId(); + new HosDialog(sessionId, profilerView); + } + } + }); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/TaskScenePanelEvent.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/TaskScenePanelEvent.java new file mode 100644 index 000000000..cf56c0e16 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/event/TaskScenePanelEvent.java @@ -0,0 +1,386 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import com.alibaba.fastjson.JSONObject; +import ohos.devtools.datasources.utils.common.util.DateTimeUtil; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import ohos.devtools.datasources.utils.quartzmanager.QuartzManager; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import ohos.devtools.views.common.Common; +import ohos.devtools.views.common.Constant; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.hoscomp.HosJLabel; +import ohos.devtools.views.layout.swing.DeviceProcessJpanel; +import ohos.devtools.views.layout.swing.SampleDialogWrapper; +import ohos.devtools.views.layout.swing.TaskPanel; +import ohos.devtools.views.layout.swing.TaskScenePanel; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.JComboBox; +import javax.swing.JPanel; +import javax.swing.JTextField; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import static ohos.devtools.views.common.Constant.DEVICEREFRESH; + +/** + * 设备进程容器 + * + * @version 1.0 + * @date 2021/03/02 + **/ +public class TaskScenePanelEvent { + private static final Logger LOGGER = LogManager.getLogger(TaskScenePanelEvent.class); + + /** + * 设备进程容器标题计数 + */ + private int numDevices = LayoutConstants.INDEX_ONE; + + private int num = LayoutConstants.DEVICE_PRO_Y; + + private boolean flag = false; + + private Common common = new Common(); + + /** + * startTask + * + * @param taskScenePanel taskScenePanel + * @param jTaskPanel jTaskPanel + */ + public void startTask(TaskScenePanel taskScenePanel, TaskPanel jTaskPanel) { + taskScenePanel.getJButtonStartTask().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + + // 判断设备下拉框是否有数据 + int itemCount = taskScenePanel.getDeviceProcessJpanel().getJComboBoxPhone().getItemCount(); + if (itemCount == 0) { + new SampleDialogWrapper("prompt", "Device list is empty !").show(); + return; + } + + // 判断进程是否选择 + if ("Please select the device process !" + .equals(taskScenePanel.getDeviceProcessJpanel().getLabelName().getText())) { + new SampleDialogWrapper("prompt", "Please select the device process !").show(); + return; + } + + boolean isSelected = + taskScenePanel.getCheckBoxMemoryJava().isSelected() || taskScenePanel.getCheckBoxGpuMemoryNative() + .isSelected() || taskScenePanel.getCheckBoxGraphics().isSelected() || taskScenePanel + .getCheckBoxStack().isSelected() || taskScenePanel + .getCheckBoxCode().isSelected() || taskScenePanel.getCheckBoxOthers().isSelected(); + if (!isSelected) { + new SampleDialogWrapper("prompt", "please choose Monitor Items !").show(); + return; + } + // 获取所有进程设备信息map。用于请求后端接口 + List hosJLabels = obtainMap(taskScenePanel, jTaskPanel); + if (!hosJLabels.isEmpty()) { + // 移除三级页面,添加新的三级页面 + jTaskPanel.getOptionJPanel().removeAll(); + QuartzManager.getInstance().endExecutor(DEVICEREFRESH); + TaskScenePanelChart taskScenePanelChart = new TaskScenePanelChart(jTaskPanel, hosJLabels); + jTaskPanel.getOptionJPanel().add(taskScenePanelChart); + // 更新所有的run -- of -- + common.updateNum(Constant.jtasksTab); + jTaskPanel.getOptionJPanel().repaint(); + } + } + }); + } + + /** + * Get the value of the drop-down box + * + * @param taskScenePanel taskScenePanel + * @return JSONObject + */ + private JSONObject getValueJCheckBoxs(TaskScenePanel taskScenePanel) { + JSONObject memoryObject = new JSONObject(); + memoryObject.put(taskScenePanel.getJCheckBoxs()[LayoutConstants.INDEX_ONE].getText(), + taskScenePanel.getJCheckBoxs()[LayoutConstants.INDEX_ONE].isSelected()); + memoryObject.put(taskScenePanel.getJCheckBoxs()[LayoutConstants.INDEX_TWO].getText(), + taskScenePanel.getJCheckBoxs()[LayoutConstants.INDEX_TWO].isSelected()); + memoryObject.put(taskScenePanel.getJCheckBoxs()[LayoutConstants.INDEX_THREE].getText(), + taskScenePanel.getJCheckBoxs()[LayoutConstants.INDEX_THREE].isSelected()); + memoryObject.put(taskScenePanel.getJCheckBoxs()[LayoutConstants.INDEX_FOUR].getText(), + taskScenePanel.getJCheckBoxs()[LayoutConstants.INDEX_FOUR].isSelected()); + memoryObject.put(taskScenePanel.getJCheckBoxs()[LayoutConstants.INDEX_FIVE].getText(), + taskScenePanel.getJCheckBoxs()[LayoutConstants.INDEX_FIVE].isSelected()); + memoryObject.put(taskScenePanel.getJCheckBoxs()[LayoutConstants.INDEX_SIX].getText(), + taskScenePanel.getJCheckBoxs()[LayoutConstants.INDEX_SIX].isSelected()); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("Memory", memoryObject); + return jsonObject; + } + + /** + * obtainMap + * + * @param taskScenePanel taskScenePanel + * @param jTaskPanel jTaskPanel + * @return List + */ + public List obtainMap(TaskScenePanel taskScenePanel, TaskPanel jTaskPanel) { + // 获取下拉框的值 + JSONObject jsonObject = getValueJCheckBoxs(taskScenePanel); + SessionManager sessionManager = SessionManager.getInstance(); + Collection> selectMaps = Constant.map.values(); + if (selectMaps.isEmpty()) { + return new ArrayList(); + } + ArrayList hosJLabels = new ArrayList<>(); + for (Map seMap : selectMaps) { + for (Map.Entry entry : seMap.entrySet()) { + DeviceIPPortInfo mapKey = null; + Object keyObj = entry.getKey(); + if (keyObj instanceof DeviceIPPortInfo) { + mapKey = (DeviceIPPortInfo) keyObj; + } + ProcessInfo mapValue = null; + Object valueObj = entry.getValue(); + if (valueObj instanceof ProcessInfo) { + mapValue = (ProcessInfo) valueObj; + } + + if (mapKey != null && mapValue != null) { + Long localSessionID = sessionManager.createSession(mapKey, mapValue, 1, jsonObject); + if (localSessionID == ohos.devtools.datasources.utils.common.Constant.ABNORMAL + || localSessionID == null) { + return new ArrayList(); + } + jTaskPanel.setLocalSessionId(localSessionID); + HosJLabel hosJLabel = new HosJLabel(); + hosJLabel.setSessionId(localSessionID); + hosJLabel.setDeviceName(mapKey.getDeviceName()); + hosJLabel.setProcessName(mapValue.getProcessName() + "(" + mapValue.getProcessId() + ")"); + // 开启session + sessionManager.startSession(localSessionID, false); + // 获取数据 + long date = DateTimeUtil.getNowTimeLong(); + sessionManager.fetchData(localSessionID); + hosJLabel.setFirstStamp(date); + hosJLabels.add(hosJLabel); + } + } + } + return hosJLabels; + } + + /** + * Get device process information in the drop-down box for display + * + * @param scrollPane scrollPane + * @return String + */ + public String gain(JPanel scrollPane) { + String processName = ""; + Component[] component = scrollPane.getComponents(); + for (Component componentOut : component) { + if (componentOut instanceof JPanel) { + JPanel jPanel = (JPanel) componentOut; + Component[] componentInner = jPanel.getComponents(); + processName = judgCompontent(componentInner, processName); + } + } + return processName; + } + + /** + * judgCompontent + * + * @param componentInner componentInner + * @param processName processName + * @return String + */ + public String judgCompontent(Component[] componentInner, String processName) { + String processNameNew = processName; + for (Component componentAll : componentInner) { + if (componentAll instanceof JComboBox) { + JComboBox jComboBox = (JComboBox) componentAll; + processNameNew = processName + jComboBox.getSelectedItem().toString() + ","; + } + if (componentAll instanceof JPanel) { + JPanel jPanelText = (JPanel) componentAll; + Component[] componentText = jPanelText.getComponents(); + for (Component componentTextFile : componentText) { + if (componentTextFile instanceof JTextField) { + JTextField jTextField = (JTextField) componentTextFile; + processNameNew = processName + jTextField.getText() + ","; + } + } + } + } + return processNameNew; + } + + /** + * lastStep + * + * @param taskScenePanel taskScenePanel + * @param jTaskPanel jTaskPanel + */ + public void lastStep(TaskScenePanel taskScenePanel, TaskPanel jTaskPanel) { + taskScenePanel.getJButtonLastStep().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent event) { + super.mouseClicked(event); + jTaskPanel.getOptionJPanel().remove(taskScenePanel); + jTaskPanel.getOptionJPanelContent().setVisible(true); + jTaskPanel.getOptionJPanel().repaint(); + } + }); + } + + /** + * 监听器 + * + * @param taskScenePanel taskScenePanel + */ + public void listenerJPanelSouth(TaskScenePanel taskScenePanel) { + taskScenePanel.getJPanelSouth().addComponentListener(new ComponentAdapter() { + /** + * componentResized + * + * @param exception exception + */ + public void componentResized(ComponentEvent exception) { + int width = taskScenePanel.getJPanelSouth().getWidth(); + taskScenePanel.getJButtonLastStep() + .setBounds(LayoutConstants.NUMBER_STEP + (width - LayoutConstants.WINDOW_WIDTH), + LayoutConstants.DEVICES_HEIGHT, LayoutConstants.DEVICE_ADD_WIDTH, + LayoutConstants.CHOOSE_HEIGHT); + taskScenePanel.getJButtonStartTask() + .setBounds(LayoutConstants.POSITION_TASK_X + (width - LayoutConstants.WINDOW_WIDTH), + LayoutConstants.DEVICES_HEIGHT, LayoutConstants.DEVICE_ADD_WIDTH, + LayoutConstants.CHOOSE_HEIGHT); + } + }); + } + + /** + * 复选框选取 + * + * @param taskScenePanel taskScenePanel + */ + public void checkBoxSelect(TaskScenePanel taskScenePanel) { + taskScenePanel.getCheckBoxSelectAll().addItemListener(new ItemListener() { + /** + * itemStateChanged + * + * @param event event + */ + @Override + public void itemStateChanged(ItemEvent event) { + if (taskScenePanel.getCheckBoxSelectAll().isSelected()) { + taskScenePanel.getCheckBoxMemoryJava().setSelected(true); + taskScenePanel.getCheckBoxGpuMemoryNative().setSelected(true); + taskScenePanel.getCheckBoxGraphics().setSelected(true); + taskScenePanel.getCheckBoxStack().setSelected(true); + taskScenePanel.getCheckBoxCode().setSelected(true); + taskScenePanel.getCheckBoxOthers().setSelected(true); + } else { + taskScenePanel.getCheckBoxMemoryJava().setSelected(false); + taskScenePanel.getCheckBoxGpuMemoryNative().setSelected(false); + taskScenePanel.getCheckBoxGraphics().setSelected(false); + taskScenePanel.getCheckBoxStack().setSelected(false); + taskScenePanel.getCheckBoxCode().setSelected(false); + taskScenePanel.getCheckBoxOthers().setSelected(false); + } + } + }); + } + + /** + * Add device + * + * @param taskScenePanel taskScenePanel + * @param taskScenePanelEvent taskScenePanelEvent + */ + public void clickAddDevice(TaskScenePanel taskScenePanel, TaskScenePanelEvent taskScenePanelEvent) { + taskScenePanel.getJButtonAddDevice().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + numDevices++; + num += LayoutConstants.WIDTHS; + DeviceProcessJpanel deviceProcessJpanel = + new DeviceProcessJpanel(taskScenePanelEvent, taskScenePanel.getScrollPane(), taskScenePanel); + taskScenePanel.getScrollPane().add(deviceProcessJpanel); + taskScenePanel.getScrollPane() + .setPreferredSize(new Dimension(LayoutConstants.DEVICE_PRO_WIDTH, LayoutConstants.WIDTHS + num)); + taskScenePanel.getScrollPane().updateUI(); + taskScenePanel.getScrollPane().repaint(); + } + }); + } + + /** + * getNumDevices + * + * @return int + */ + public int getNumDevices() { + return numDevices; + } + + /** + * setNumDevices + * + * @param numDevices numDevices + */ + public void setNumDevices(int numDevices) { + this.numDevices = numDevices; + } + + /** + * getNum + * + * @return int + */ + public int getNum() { + return num; + } + + /** + * setNum + * + * @param num num + */ + public void setNum(int num) { + this.num = num; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/CountingThread.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/CountingThread.java new file mode 100644 index 000000000..6e466fb2f --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/CountingThread.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.views.common.LayoutConstants; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.JLabel; +import java.util.Locale; + +/** + * 数字时钟计时器 + * + * @version 1.0 + * @date 2021/03/25 17:00 + **/ +public class CountingThread extends Thread { + private static final Logger LOGGER = LogManager.getLogger(CountingThread.class); + + private int hours = 0; + private int minutes = 0; + private int seconds = 0; + private JLabel jTextArea; + private boolean stopFlag = false; + + public CountingThread(JLabel jTextArea) { + this.jTextArea = jTextArea; + } + + @Override + public void run() { + // 从0开始计时 + while (!stopFlag) { + try { + // 1毫秒更新一次显示 + sleep(LayoutConstants.NUMBER_THREAD); + } catch (InterruptedException exception) { + LOGGER.error(exception.getMessage()); + } + + if (seconds > LayoutConstants.NUMBER_SECONDS) { + continue; + } + jTextArea.setText("| " + String.format(Locale.ENGLISH, "%02d", hours) + ":" + String + .format(Locale.ENGLISH, "%02d", minutes) + ":" + String.format(Locale.ENGLISH, "%02d", seconds)); + seconds++; + if (seconds > LayoutConstants.NUMBER_SECONDS) { + seconds = 0; + minutes++; + if (minutes > LayoutConstants.NUMBER_SECONDS) { + minutes = 0; + hours++; + } + } + } + jTextArea.setText("| 0:0:0"); + } + + /** + * setStopFlag + * + * @param StopFlag StopFlag + */ + public void setStopFlag(boolean StopFlag) { + this.stopFlag = StopFlag; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/DeviceProcessJpanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/DeviceProcessJpanel.java new file mode 100644 index 000000000..33a8a18a2 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/DeviceProcessJpanel.java @@ -0,0 +1,385 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.device.service.MultiDeviceManager; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import ohos.devtools.datasources.utils.process.service.ProcessManager; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.Constant; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.event.DeviceProcessJpanelEvent; +import ohos.devtools.views.layout.event.TaskScenePanelEvent; + +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GridLayout; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Vector; + +/** + * 设备进程面板 + * + * @version 1.0 + * @date 2021/03/02 + **/ +public class DeviceProcessJpanel extends JPanel { + /** + * 设备描述 + */ + private JLabel jLabelDevice = new JLabel("Device"); + + /** + * 设备连接方式下拉框(usb,wifi,蓝牙) + */ + private JComboBox jComboBoxConnect = new JComboBox(); + + /** + * 设备名称下拉框 + */ + private JComboBox jComboBoxPhone = new JComboBox(); + + /** + * 设备信息集合 + */ + private List deviceInfos = null; + + /** + * 进程信息集合 + */ + private List proinfos = null; + + /** + * 进程描述 + */ + private JLabel jLabelApply = new JLabel("Application"); + + /** + * 进程信息输入框容器 + */ + private JPanel selectPanel = new JPanel(new GridLayout()); + + /** + * 进程信息输入框 + */ + private JTextFieldTable labelName = new JTextFieldTable("device"); + + /** + * 进程信息搜索框 + */ + private JTextFieldTable textField = new JTextFieldTable("press"); + + /** + * 进程信息下拉箭头 + */ + private JLabel labelSvg = new JLabel(); + + /** + * 进程信息下拉列表容器 + */ + private JPanel jPanelProcess = new JPanel(new BorderLayout()); + + /** + * 进程信息下拉列表容器top容器 + */ + private JPanel jPanelProcessTop = new JPanel(new GridLayout()); + + /** + * 进程信息下拉列表容器Center容器 + */ + private JPanel jPanelProcessCenter = new JPanel(new GridLayout()); + + /** + * 进程信息列表 + */ + private JTable table = new JTable(); + + /** + * 进程信息列表滚动条 + */ + private JScrollPane jScrollPane = new JScrollPane(); + + private DeviceProcessJpanelEvent deviceProcessJpanelEvent = new DeviceProcessJpanelEvent(); + + private TaskScenePanelEvent taskScenePanelEvent = new TaskScenePanelEvent(); + + /** + * DeviceProcessJpanel + * + * @param taskScenePanelEvent taskScenePanelEvent + * @param scrollPane scrollPane + * @param taskScenePanel taskScenePanel + */ + public DeviceProcessJpanel(TaskScenePanelEvent taskScenePanelEvent, JPanel scrollPane, + TaskScenePanel taskScenePanel) { + this.setLayout(null); + this.setOpaque(true); + this.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + this.setBounds(LayoutConstants.DEVICE_PRO_X, taskScenePanelEvent.getNum(), LayoutConstants.DEVICE_PRO_WIDTH, + LayoutConstants.WIDTHS); + Font fontTaskTun = new Font(Font.DIALOG, Font.BOLD, LayoutConstants.DEVICES_FONT); + JLabel jLabelDeviceNum = + new JLabel("Devices " + String.format(Locale.ENGLISH, "%02d", taskScenePanelEvent.getNumDevices())); + jLabelDeviceNum.setFont(fontTaskTun); + jLabelDeviceNum.setForeground(Color.white); + jLabelDeviceNum + .setBounds(LayoutConstants.CHOOSE_HEIGHT, LayoutConstants.JP_RIGHT_WIDTH, LayoutConstants.DEVICES_WIDTH, + LayoutConstants.DEVICES_HEIGHT); + // 属性设置 + setAttributes(taskScenePanelEvent, scrollPane, taskScenePanel); + DeviceIPPortInfo deviceIPPortInfo; + // 进程下拉列表 + if (deviceInfos.isEmpty()) { + deviceIPPortInfo = new DeviceIPPortInfo(); + } else { + deviceIPPortInfo = deviceInfos.get(0); + } + createProcessList(deviceIPPortInfo, jLabelDeviceNum.getText(), scrollPane, taskScenePanel); + // 获取add device按钮 + taskScenePanel.getJButtonAddDevice() + .setBounds(LayoutConstants.APP_LABEL_Y1, LayoutConstants.TWO_HUNDRED_TEN, LayoutConstants.DEVICE_ADD_WIDTH, + LayoutConstants.DEVICE_ADD_HEIGHT); + this.add(jLabelDeviceNum); + this.add(jLabelDevice); + this.add(jComboBoxConnect); + this.add(jComboBoxPhone); + this.add(jLabelApply); + this.add(selectPanel); + } + + /** + * Process drop-down list + * + * @param deviceInfo deviceInfo + * @param deviceNum deviceNum + * @param scrollPane scrollPane + * @param taskScenePanel taskScenePanel + */ + public void createProcessList(DeviceIPPortInfo deviceInfo, String deviceNum, JPanel scrollPane, + TaskScenePanel taskScenePanel) { + jPanelProcess + .setBounds(LayoutConstants.SELECT_ALL_Y, LayoutConstants.PRECCE_HEIGHT_Y, LayoutConstants.PRECCE_WIDTH, + LayoutConstants.SE_PANEL_WIDTH); + jPanelProcessTop + .setPreferredSize(new Dimension(LayoutConstants.SE_PANEL_WIDTH, LayoutConstants.DEVICE_ADD_HEIGHT)); + jPanelProcessCenter.setPreferredSize(new Dimension(LayoutConstants.PRECCE_WIDTH, LayoutConstants.TASK_DEC_X)); + jPanelProcess.add(jPanelProcessTop, BorderLayout.NORTH); + jPanelProcess.add(jPanelProcessCenter, BorderLayout.CENTER); + textField.setPreferredSize(new Dimension(LayoutConstants.TASK_DEC_X, LayoutConstants.DEVICE_ADD_HEIGHT)); + jPanelProcessTop.add(textField); + // 创建列表 + Vector columnNames = new Vector(); + columnNames.add(""); + // 根据设备信息获取进程信息 + Vector processNames = new Vector<>(); + for (int i = 0; i < proinfos.size(); i++) { + ProcessInfo processInfo = proinfos.get(i); + Vector vector = new Vector(); + vector.add(processInfo.getProcessName() + "(" + processInfo.getProcessId() + ")"); + processNames.add(vector); + } + if (!proinfos.isEmpty()) { + // 更新map + Map mapObject = new HashMap<>(); + mapObject.put(deviceInfo, proinfos.get(0)); + Constant.map.put(deviceNum, mapObject); + } + DefaultTableModel model = new DefaultTableModel(processNames, columnNames); + table.setModel(model); + table.getTableHeader().setVisible(false); + table.setRowHeight(LayoutConstants.DEVICE_ADD_HEIGHT); + DefaultTableCellRenderer renderer = new DefaultTableCellRenderer(); + renderer.setPreferredSize(new Dimension(0, 0)); + table.getTableHeader().setDefaultRenderer(renderer); + // table鼠标悬停效果 + deviceProcessJpanelEvent.mouseEffectTable(table); + jScrollPane.setViewportView(table); + jPanelProcessCenter.add(jScrollPane); + // table点击获取选中值 + deviceProcessJpanelEvent.clickTable(this, deviceNum, deviceInfo, scrollPane, taskScenePanel); + // 搜索按钮添加搜索事件 + deviceProcessJpanelEvent.searchJButtonSelect(this, proinfos); + } + + private void setComponent() { + jLabelDevice.setBounds(LayoutConstants.SELECT_ALL_Y, LayoutConstants.DEVICE_PRO_X, LayoutConstants.APP_BUT_X, + LayoutConstants.DEVICES_HEIGHT); + jComboBoxConnect.addItem("USB"); + jComboBoxConnect + .setBounds(LayoutConstants.CHOOSE_HEIGHT, LayoutConstants.JLABEL_SIZE, LayoutConstants.CON_BOX_WIDTH, + LayoutConstants.TASK_SCENE_Y); + jComboBoxPhone + .setBounds(LayoutConstants.RIGHT_BUN_WIDTH, LayoutConstants.JLABEL_SIZE, LayoutConstants.HEIGHT_PRESSE, + LayoutConstants.TASK_SCENE_Y); + jLabelApply + .setBounds(LayoutConstants.APP_NAME_X, LayoutConstants.EMB_BUT_HEIGHT, LayoutConstants.APP_NAME_WIDTH, + LayoutConstants.APP_NAME_HEIGHT); + selectPanel.setBounds(LayoutConstants.SELECT_ALL_Y, LayoutConstants.BUTTON_WIDTH, LayoutConstants.PRECCE_WIDTH, + LayoutConstants.TASK_SCENE_Y); + labelName.setEditable(false); + selectPanel.add(labelName); + } + + /** + * Property setting + * + * @param taskScenePanelEvent taskScenePanelEvent + * @param scrollPane scrollPane + * @param taskScenePanel taskScenePanel + */ + public void setAttributes(TaskScenePanelEvent taskScenePanelEvent, JPanel scrollPane, + TaskScenePanel taskScenePanel) { + setComponent(); + deviceInfos = MultiDeviceManager.getInstance().getAllDeviceIPPortInfos(); + deviceProcessJpanelEvent.devicesInfoJComboBoxUpdate(this); + if (deviceInfos.isEmpty()) { + proinfos = new ArrayList<>(); + } else { + proinfos = ProcessManager.getInstance().getProcessList(deviceInfos.get(0)); + Map mapObject = new HashMap<>(); + if (!proinfos.isEmpty()) { + mapObject.put(deviceInfos.get(0), proinfos.get(0)); + } + Constant.map.put("Devices " + String.format(Locale.ENGLISH, "%02d", taskScenePanelEvent.getNumDevices()), + mapObject); + } + if (!proinfos.isEmpty()) { + labelName.setText(proinfos.get(0).getProcessName() + "(" + proinfos.get(0).getProcessId() + ")"); + } else { + labelName.setText("Please select the device process !"); + labelName.setForeground(ColorConstants.TOP_PANEL_APPLICATION); + } + // 设备和进程信息联动 + deviceProcessJpanelEvent.itemStateChanged(this, taskScenePanel, + "Devices " + String.format(Locale.ENGLISH, "%02d", taskScenePanelEvent.getNumDevices()), scrollPane); + // 给进程列表框添加点击事件,点击后展开进程列表 + deviceProcessJpanelEvent.addClickListener(this, scrollPane, taskScenePanelEvent, taskScenePanel, + "Devices " + String.format(Locale.ENGLISH, "%02d", taskScenePanelEvent.getNumDevices())); + } + + /** + * getTable + * + * @return JTable + */ + public JTable getTable() { + return table; + } + + /** + * getLabelName + * + * @return JTextField + */ + public JTextField getLabelName() { + return labelName; + } + + /** + * setDeviceInfos + * + * @param deviceInfos deviceInfos + */ + public void setDeviceInfos(List deviceInfos) { + this.deviceInfos = deviceInfos; + } + + /** + * getDeviceInfos + * + * @return List + */ + public List getDeviceInfos() { + return deviceInfos; + } + + /** + * getProinfos + * + * @return List + */ + public List getProinfos() { + return proinfos; + } + + /** + * setProinfos + * + * @param proinfos proinfos + */ + public void setProinfos(List proinfos) { + this.proinfos = proinfos; + } + + /** + * getJComboBoxPhone + * + * @return JComboBox + */ + public JComboBox getJComboBoxPhone() { + return jComboBoxPhone; + } + + /** + * getTextField + * + * @return JTextField + */ + public JTextField getTextField() { + return textField; + } + + /** + * getLabelSvg + * + * @return JLabel + */ + public JLabel getLabelSvg() { + return labelSvg; + } + + /** + * getJPanelProcess + * + * @return JPanel + */ + public JPanel getJPanelProcess() { + return jPanelProcess; + } + + public TaskScenePanelEvent getTaskScenePanelEvent() { + return taskScenePanelEvent; + } + + public void setTaskScenePanelEvent(TaskScenePanelEvent taskScenePanelEvent) { + this.taskScenePanelEvent = taskScenePanelEvent; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/GraphicsJpanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/GraphicsJpanel.java new file mode 100644 index 000000000..21c54bea9 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/GraphicsJpanel.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.LayoutConstants; + +import javax.swing.JPanel; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.geom.Line2D; + +/** + * @Description GraphicsJpanel + * @Date 2021/4/13 13:15 + **/ +public class GraphicsJpanel extends JPanel { + private TaskPanel taskPanel; + + /** + * GraphicsJpanel + * + * @param taskPanel taskPanel + */ + public GraphicsJpanel(TaskPanel taskPanel) { + this.setOpaque(false); + this.setLayout(null); + this.taskPanel = taskPanel; + } + + /** + * 直线绘制 + * + * @param graphics graphics + */ + public void paint(Graphics graphics) { + super.paint(graphics); + graphics.setColor(ColorConstants.TOP_COLOR); + Graphics2D graphicsTop = (Graphics2D) graphics; + Graphics2D graphicsBottom = null; + if (graphics instanceof Graphics2D) { + graphicsBottom = (Graphics2D) graphics; + } + Line2D linTop = new Line2D.Float(LayoutConstants.THIRTY, 0, this.getWidth() - LayoutConstants.THIRTY, 0); + Line2D linBottom = new Line2D.Float(LayoutConstants.THIRTY, LayoutConstants.JP_LEFT_WIDTH, + this.getWidth() - LayoutConstants.THIRTY, LayoutConstants.JP_LEFT_WIDTH); + graphicsTop.draw(linTop); + if (graphicsBottom != null) { + graphicsBottom.draw(linBottom); + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/HomeWindow.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/HomeWindow.java new file mode 100644 index 000000000..9c597499d --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/HomeWindow.java @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.event.HomeWindowEvent; + +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GridLayout; + +import static ohos.devtools.views.common.LayoutConstants.FONT_SIZE; +import static ohos.devtools.views.common.LayoutConstants.WINDOW_HEIGHT; +import static ohos.devtools.views.common.LayoutConstants.WINDOW_WIDTH; + +/** + * 主界面 + * + * @version 1.0 + * @date 2021/02/27 11:07 + **/ +public class HomeWindow extends JPanel { + // 菜单栏 + private static JPanel menuPanel = new JPanel(new BorderLayout()); + + // 存放二级界面的容器 + private static JPanel taskPanel = new JPanel(new GridLayout()); + + private static JMenu jFileMenu = new JMenu("File"); + + private static JMenu jViewMenu = new JMenu("View"); + + private static JMenu jSetMenu = new JMenu("Setting"); + + private static JMenu jHelpMenu = new JMenu("Help"); + + private static JMenuItem jNewRealTimeTaskJMenuItem = new JMenuItem("New Task"); + + private static JMenuItem jImportFilesJMenuItem = new JMenuItem("Open File"); + + private static JMenuItem jSaveTaskJMenuItem = new JMenuItem("Save as"); + + private static JMenuItem jQuitJMenuItem = new JMenuItem("Quit"); + + private static JMenuItem jLogSwitch = new JMenuItem("Path to Log"); + + private HomeWindowEvent homeWindowEvent = new HomeWindowEvent(); + + private TaskPanelWelcome taskPanelWelcome = new TaskPanelWelcome(); + + /** + * HomeWindow + */ + public HomeWindow() { + this.setLayout(new BorderLayout()); + this.setPreferredSize(new Dimension(WINDOW_WIDTH, WINDOW_HEIGHT)); + initComponents(); + } + + /** + * 初始化一级界面 + */ + private void initComponents() { + JLabel logo = new JLabel("HosProfiler ", JLabel.RIGHT); + logo.setIcon(new ImageIcon(HomeWindow.class.getClassLoader().getResource("images/logo.png"))); + logo.setBackground(ColorConstants.HOME_PANE); + logo.setForeground(Color.WHITE); + Font fontZhu = new Font(Font.DIALOG, Font.BOLD, FONT_SIZE); + logo.setFont(fontZhu); + jFileMenu.add(jNewRealTimeTaskJMenuItem); + jSetMenu.add(jLogSwitch); + JMenuBar jMenuBar = new JMenuBar(); + JLabel logoKong = new JLabel(" ", JLabel.RIGHT); + jMenuBar.setFont(fontZhu); + jMenuBar.add(logoKong); + jMenuBar.add(logo); + jMenuBar.add(jSetMenu); + menuPanel.add(jMenuBar); + jFileMenu.setBackground(ColorConstants.TOP_COLOR); + jSetMenu.setBackground(ColorConstants.TOP_COLOR); + jMenuBar.setBackground(ColorConstants.TOP_COLOR); + menuPanel.setPreferredSize(new Dimension(LayoutConstants.WINDOW_WIDTH, LayoutConstants.SVGWIDTH_FOUR)); + // 将二级界面面板添加到主界面中 + this.add(menuPanel, BorderLayout.NORTH); + this.add(taskPanel, BorderLayout.CENTER); + this.setBackground(ColorConstants.CENTER_COLOR); + homeWindowEvent.clickUpdateLogLevel(this); + this.addTaskPanel(taskPanelWelcome); + } + + /** + * 将二级界面添加到二级界面的面板中 + * + * @param jPanel 二级界面 + */ + public void addTaskPanel(JPanel jPanel) { + taskPanel.add(jPanel); + if (jPanel instanceof TaskPanelWelcome) { + taskPanelWelcome = (TaskPanelWelcome) jPanel; + } + // 刷新页面 + this.setVisible(true); + } + + /** + * getJNewRealTimeTaskJMenuItem + * + * @return JMenuItem + */ + public JMenuItem getJNewRealTimeTaskJMenuItem() { + return jNewRealTimeTaskJMenuItem; + } + + /** + * getJLogSwitch + * + * @return JMenuItem + */ + public static JMenuItem getJLogSwitch() { + return jLogSwitch; + } + + /** + * getTaskPanel + * + * @return JPanel + */ + public JPanel getTaskPanel() { + return taskPanel; + } + + /** + * getTaskPanelWelcome + * + * @return TaskPanelWelcome + */ + public TaskPanelWelcome getTaskPanelWelcome() { + return taskPanelWelcome; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/JTextFieldTable.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/JTextFieldTable.java new file mode 100644 index 000000000..796898cf3 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/JTextFieldTable.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.LayoutConstants; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JTextField; +import javax.swing.border.Border; +import javax.swing.border.CompoundBorder; +import javax.swing.border.EmptyBorder; +import java.awt.Graphics; +import java.awt.Insets; + +/** + * JTextFieldTable + * + * @version 1.0 + * @date: 2021/4/14 15:35 + */ +public class JTextFieldTable extends JTextField { + private Icon icon; + + private String type; + + private Border line = BorderFactory.createLineBorder(ColorConstants.TOP_COLOR); + + private CompoundBorder border; + + private Border empty; + + public JTextFieldTable(String name) { + type = name; + + // 获取当前路径下的图片 + icon = new ImageIcon(JTextFieldTable.class.getClassLoader().getResource("images/search.png")); + if ("level".equals(type)) { + this.setBackground(ColorConstants.TRACE_TABLE_COLOR); + empty = new EmptyBorder(0, LayoutConstants.TASK_LABEL_Y, 0, 0); + } + if ("press".equals(type)) { + empty = new EmptyBorder(0, LayoutConstants.TASK_LABEL_Y, 0, 0); + } + if ("Analysis".equals(type)) { + empty = new EmptyBorder(0, LayoutConstants.DEVICE_ADD_Y, 0, LayoutConstants.TASK_LABEL_Y); + } + if ("device".equals(type)) { + icon = new ImageIcon(DeviceProcessJpanel.class.getClassLoader().getResource("images/down.png")); + empty = new EmptyBorder(0, LayoutConstants.DEVICE_ADD_Y, 0, LayoutConstants.TASK_LABEL_Y); + } + border = new CompoundBorder(line, empty); + this.setBorder(border); + } + + @Override + public void paintComponent(Graphics graphics) { + Insets insets = getInsets(); + super.paintComponent(graphics); + int iconWidth = icon.getIconWidth(); + int iconHeight = icon.getIconHeight(); + int height = this.getHeight(); + // 在文本框中画上之前图片 + if ("level".equals(type) || "press".equals(type)) { + icon.paintIcon(this, graphics, (insets.left - iconWidth) / LayoutConstants.DEVICES_Y, + (height - iconHeight) / LayoutConstants.DEVICES_Y); + } + if ("Analysis".equals(type)) { + icon.paintIcon(this, graphics, + LayoutConstants.LEFT_TOP_WIDTH / LayoutConstants.DEVICES_Y, + (height - iconHeight) / LayoutConstants.DEVICES_Y); + } + if ("device".equals(type)) { + icon.paintIcon(this, graphics, + LayoutConstants.DEVICE_NUMBER / LayoutConstants.DEVICES_Y, + (height - iconHeight) / LayoutConstants.DEVICES_Y); + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/LayoutView.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/LayoutView.java new file mode 100644 index 000000000..db2ee9014 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/LayoutView.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +/** + * 界面构造类 + * + * @version 1.0 + * @date 2021/02/27 15:31 + **/ +public class LayoutView { + private LayoutView() { + } + + /** + * 页面启动方法 + * + * @return HomeWindow + */ + public static HomeWindow init() { + HomeWindow homeWindow = new HomeWindow(); + return homeWindow; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/LevelTablePanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/LevelTablePanel.java new file mode 100644 index 000000000..9ee294398 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/LevelTablePanel.java @@ -0,0 +1,445 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.services.memory.ClassInfoManager; +import ohos.devtools.services.memory.MemoryHeapInfo; +import ohos.devtools.services.memory.MemoryHeapManager; +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.chart.treetable.DataNode; +import ohos.devtools.views.common.chart.treetable.DataNodeCompares; +import ohos.devtools.views.common.chart.treetable.AgentDataModel; +import ohos.devtools.views.common.chart.treetable.JTreeTable; +import ohos.devtools.views.common.chart.treetable.TreeTableModel; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.RowSorter; +import javax.swing.SwingConstants; +import javax.swing.SwingWorker; +import javax.swing.UIManager; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.event.RowSorterEvent; +import javax.swing.event.RowSorterListener; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; +import javax.swing.text.Position; +import javax.swing.tree.TreePath; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Label; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.concurrent.ExecutionException; + +/** + * 层级面板 + * + * @version 1.0 + * @date 2021/02/27 15:31 + **/ +public class LevelTablePanel extends JPanel { + private static final Logger LOGGER = LogManager.getLogger(LevelTablePanel.class); + + private boolean flag = false; + private JPanel suspensionTable = null; + private long sessionId; + private JTreeTable treeTable; + + /** + * getSuspensionTable + * + * @return JPanel + */ + public JPanel getSuspensionTable() { + return suspensionTable; + } + + /** + * setSuspensionTable + * + * @param suspensionTable suspensionTable + */ + public void setSuspensionTable(JPanel suspensionTable) { + this.suspensionTable = suspensionTable; + } + + private SuspensionTablePanel suspensionTablePanel = new SuspensionTablePanel(); + + /** + * LevelTablePanel + * + * @param jpanelSupenn jpanelSupenn + * @param sessionId long + */ + public LevelTablePanel(JPanel jpanelSupenn, long sessionId) { + this.setLayout(new BorderLayout()); + this.setOpaque(true); + this.setBackground(ColorConstants.TRACE_TABLE_COLOR); + jpanelSupenn.setBackground(ColorConstants.TRACE_TABLE_COLOR); + SwingWorker task = new SwingWorker<>() { + /** + * doInBackground + * + * @return JTreeTable + * @throws Exception Exception + */ + @Override + protected JTreeTable doInBackground() { + JTreeTable table = null; + try { + table = createTable(jpanelSupenn, sessionId); + return table; + } catch (Exception exception) { + LOGGER.error("createTable Exception {}", exception.getMessage()); + } + return table; + } + + /** + * done + */ + @Override + protected void done() { + // 此方法将在后台任务完成后在事件调度线程中被回调 + JTreeTable table = null; + try { + // 获取计算结果 + table = get(); + if (table == null) { + return; + } + if (treeTable == null && (table != null)) { + treeTable = table; + } + DefaultTableCellRenderer tcr = new DefaultTableCellRenderer(); + tcr.setHorizontalAlignment(SwingConstants.CENTER); + treeTable.setDefaultRenderer(Object.class, tcr); + // 初始化层级table + RowSorter sorter = new TableRowSorter(treeTable.getModel()); + treeTable.setRowSorter(sorter); + sorter.addRowSorterListener(new RowSorterListener() { + @Override + public void sorterChanged(RowSorterEvent event) { + if (!sorter.getSortKeys().isEmpty()) { + List keys = sorter.getSortKeys(); + AgentDataModel treeTableModel = null; + TreeTableModel treeTModel = treeTable.treeTableModel; + if (treeTModel instanceof AgentDataModel) { + treeTableModel = (AgentDataModel) treeTModel; + } + DataNode rootNode = treeTableModel.getDataNode(); + + ArrayList datNode = rootNode.getChildren(); + RowSorter.SortKey key = keys.get(0); + String sortOrder = key.getSortOrder().name(); + Comparator comparator = + new DataNodeCompares().chooseCompare(key.getColumn(), sortOrder); + if (comparator != null) { + Collections.sort(datNode, comparator); + } + rootNode.setChildren(datNode); + AgentDataModel agentDataModel = new AgentDataModel(rootNode); + treeTable.treeTableModel = agentDataModel; + treeTable.treeTableCellRenderer = treeTable.new TreeTableCellRenderer(agentDataModel); + treeTable.treeTableCellRenderer.setRowHeight(treeTable.getRowHeight()); + treeTable.setDefaultRenderer(TreeTableModel.class, treeTable.treeTableCellRenderer); + } + } + }); + JScrollPane jScrollPane = new JScrollPane(treeTable); + jScrollPane.getViewport().setOpaque(true); + jScrollPane.getViewport().setBackground(ColorConstants.TRACE_TABLE_COLOR); + jScrollPane.setBorder(BorderFactory.createEmptyBorder()); + jScrollPane.setBackground(ColorConstants.BLACK_COLOR); + treeTable.setBackground(ColorConstants.TRACE_TABLE_COLOR); + LevelTablePanel.this.add(jScrollPane, BorderLayout.CENTER); + // 这块,初始化模糊查询 + JPanel jPanel = selectData(treeTable); + LevelTablePanel.this.add(jPanel, BorderLayout.NORTH); + } catch (InterruptedException | ExecutionException exception) { + LOGGER.error(" Exception {}", exception.getMessage()); + } + } + }; + task.execute(); + } + + /** + * 创建表格 + * + * @param jpanelSupenn jpanelSupenn + * @param sessionId long + * @return JTreeTable + */ + public JTreeTable createTable(JPanel jpanelSupenn, long sessionId) { + Icon icon1 = new ImageIcon(LevelTablePanel.class.getClassLoader().getResource("images/right.png")); + Icon icon2 = new ImageIcon(LevelTablePanel.class.getClassLoader().getResource("images/down.png")); + Icon icon3 = new ImageIcon(""); + UIManager.put("Tree.collapsedIcon", icon1); + UIManager.put("Tree.textBackground", ColorConstants.TRACE_TABLE_COLOR); + UIManager.put("Tree.expandedIcon", icon2); + UIManager.put("Tree.openIcon", icon3); + UIManager.put("Tree.closedIcon", icon3); + UIManager.put("Tree.leafIcon", icon3); + AgentDataModel agentDataModel = new AgentDataModel(initData(sessionId)); + JTreeTable treeTables = new JTreeTable(agentDataModel); + treeTables.getTableHeader().setBackground(ColorConstants.TRACE_TABLE_COLOR); + treeTables.treeTableCellRenderer.putClientProperty("JTree.lineStyle", "None"); + treeTables.treeTableCellRenderer.addTreeSelectionListener(new TreeSelectionListener() { + @Override + public void valueChanged(TreeSelectionEvent treeSelectionEvent) { + // 获取被选中的相关节点 + TreePath path = treeSelectionEvent.getPath(); + } + }); + treeTables.addMouseListener(new MouseAdapter() { + /** + * mouseClicked + * + * @param mouseEvent mouseEvent + */ + public void mouseClicked(MouseEvent mouseEvent) { + treeTables.repaint(); + if (mouseEvent.getClickCount() == 1) { + // 单击悬浮展示table 页面 + jpanelSupenn + .setPreferredSize(new Dimension(LayoutConstants.THREE_HUNDRED, LayoutConstants.THREE_HUNDRED)); + // 获取选中行 + int selectedRow = treeTables.getSelectedRow(); + Object className = treeTables.getValueAt(selectedRow, 0); + if (className instanceof String) { + String clazzName = (String) className; + int cid = new ClassInfoManager().getClassIdByClassName(clazzName); + suspensionTable = + suspensionTablePanel.createSuspensionTable(jpanelSupenn, cid, sessionId, clazzName); + suspensionTable.revalidate(); + suspensionTable.setVisible(true); + } + } + } + }); + return treeTables; + } + + /** + * 初始化treeTable数据 + * + * @param sessionId long + * @return DataNode + */ + public DataNode initData(long sessionId) { + MemoryHeapManager memoryHeapManager = new MemoryHeapManager(); + ChartStandard standard = ProfilerChartsView.sessionMap.get(sessionId).getObserver().getStandard(); + ChartDataRange selectedRang = standard.getSelectedRange(); + long firstTime = standard.getFirstTimestamp(); + long startTimeNew = firstTime + selectedRang.getStartTime(); + long endTimeNew = firstTime + selectedRang.getEndTime(); + + List memoryHeapInfos = + memoryHeapManager.getMemoryHeapInfos(sessionId, startTimeNew, endTimeNew); + DataNode dataNode = new DataNode(); + Integer totalAllocations = 0; + Integer totalDeallocations = 0; + Integer totalTotalCount = 0; + Long totalShallowSize = 0L; + for (MemoryHeapInfo meInfo : memoryHeapInfos) { + dataNode.addChildren(buildClassNode(meInfo)); + totalAllocations = totalAllocations + meInfo.getAllocations(); + totalDeallocations = totalDeallocations + meInfo.getDeallocations(); + totalTotalCount = totalTotalCount + meInfo.getTotalCount(); + totalShallowSize = totalShallowSize + meInfo.getShallowSize(); + } + dataNode.setClassName("app heap"); + dataNode.setAllocations(totalAllocations); + dataNode.setDeallocations(totalDeallocations); + dataNode.setTotalCount(totalTotalCount); + dataNode.setShallowSize(totalShallowSize); + return dataNode; + } + + /** + * 初始化treeTable数据 + * + * @param sessionId long + * @return DataNode + */ + public DataNode reData(long sessionId) { + MemoryHeapManager memoryHeapManager = new MemoryHeapManager(); + ChartStandard standard = ProfilerChartsView.sessionMap.get(sessionId).getObserver().getStandard(); + long firstTime = standard.getFirstTimestamp(); + ChartDataRange selectedRange = standard.getSelectedRange(); + long startTimeNew = selectedRange.getStartTime() + firstTime; + long endTimeNew = selectedRange.getEndTime() + firstTime; + List memoryHeapInfos = + memoryHeapManager.getMemoryHeapInfos(standard.getSessionId(), startTimeNew, endTimeNew); + DataNode dataNode = new DataNode(); + Integer totalAllocations = 0; + Integer totalDeallocations = 0; + Integer totalTotalCount = 0; + Long totalShallowSize = 0L; + for (MemoryHeapInfo meInfo : memoryHeapInfos) { + dataNode.addChildren(buildClassNode(meInfo)); + totalAllocations = totalAllocations + meInfo.getAllocations(); + totalDeallocations = totalDeallocations + meInfo.getDeallocations(); + totalTotalCount = totalTotalCount + meInfo.getTotalCount(); + totalShallowSize = totalShallowSize + meInfo.getShallowSize(); + } + dataNode.setClassName("app heap"); + dataNode.setAllocations(totalAllocations); + dataNode.setDeallocations(totalDeallocations); + dataNode.setTotalCount(totalTotalCount); + dataNode.setShallowSize(totalShallowSize); + return dataNode; + } + + /** + * buildClassNode + * + * @param mhi mhi + * @return DataNode + */ + public DataNode buildClassNode(MemoryHeapInfo mhi) { + if (mhi == null) { + return new DataNode(); + } + DataNode dataNode = new DataNode(); + dataNode.setId(mhi.getId()); + dataNode.setcId(mhi.getcId()); + dataNode.setHeapId(mhi.getHeapId()); + dataNode.setSessionId(mhi.getSessionId()); + dataNode.setClassName(mhi.getClassName()); + dataNode.setAllocations(mhi.getAllocations()); + dataNode.setDeallocations(mhi.getDeallocations()); + dataNode.setTotalCount(mhi.getTotalCount()); + dataNode.setShallowSize(mhi.getShallowSize()); + return dataNode; + } + + /** + * 选取数据 + * + * @param treeTable treeTable + * @return JPanel + */ + public JPanel selectData(JTreeTable treeTable) { + JPanel jpanel = new JPanel(null); + jpanel.setPreferredSize(new Dimension(LayoutConstants.DEVICES_WIDTH, LayoutConstants.DEVICE_Y)); + JTextFieldTable jTextField = new JTextFieldTable("level"); + jTextField.setBounds(LayoutConstants.SEARCH_NUM, 0, LayoutConstants.DEVICE_NAME_X, LayoutConstants.DEVICE_Y); + jpanel.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent event) { + super.componentResized(event); + jTextField.setBounds(LayoutConstants.SEARCH_NUM + (jpanel.getWidth() - LayoutConstants.WINDOW_WIDTH), 0, + LayoutConstants.DEVICE_NAME_X, LayoutConstants.DEVICE_Y); + } + }); + Label lb = new Label("Table"); + lb.setBounds(LayoutConstants.JP_RIGHT_WIDTH, 0, LayoutConstants.DEVICES_WIDTH, LayoutConstants.DEVICE_Y); + jpanel.setBackground(ColorConstants.TRACE_TABLE_COLOR); + jpanel.add(jTextField); + jpanel.add(lb); + jTextField.getDocument().addDocumentListener(new DocumentListener() { + /** + * insertUpdate + * + * @param exception exception + */ + @Override + public void insertUpdate(DocumentEvent exception) { + TreePath pathForRow = treeTable.treeTableCellRenderer.getPathForRow(treeTable.getSelectedRow()); + TreePath com1 = treeTable.treeTableCellRenderer + .getNextMatch(jTextField.getText(), LayoutConstants.NEGATIVE_ONE, Position.Bias.Forward); + treeTable.treeTableCellRenderer.setSelectionPath(com1); + } + + /** + * removeUpdate + * + * @param exception exception + */ + @Override + public void removeUpdate(DocumentEvent exception) { + } + + /** + * changedUpdate + * + * @param exception exception + */ + @Override + public void changedUpdate(DocumentEvent exception) { + } + }); + jTextField.addActionListener(new ActionListener() { + /** + * actionPerformed + * + * @param actionEvent actionEvent + */ + @Override + public void actionPerformed(ActionEvent actionEvent) { + TreePath pathForRow = treeTable.treeTableCellRenderer.getPathForRow(treeTable.getSelectedRow()); + TreePath com1 = treeTable.treeTableCellRenderer + .getNextMatch(jTextField.getText(), treeTable.getSelectedRow(), Position.Bias.Forward); + treeTable.treeTableCellRenderer.setSelectionPath(com1); + } + }); + return jpanel; + } + + /** + * setTreeData + * + * @param sessionId long + * @return FileSystemModel + */ + public AgentDataModel getTreeDataModel(long sessionId) { + DataNode data = reData(sessionId); + return new AgentDataModel(data); + } + + /** + * getTreeTable + * + * @return JTreeTable + */ + public JTreeTable getTreeTable() { + return treeTable; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/MonitorPanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/MonitorPanel.java new file mode 100644 index 000000000..f416ac20a --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/MonitorPanel.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import javax.swing.JPanel; + +/** + * 监控配置 + * + * @version 1.0 + * @date 2021/02/27 15:05 + **/ +public class MonitorPanel extends JPanel { +} + diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SampleDialogWrapper.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SampleDialogWrapper.java new file mode 100644 index 000000000..78ff43d64 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SampleDialogWrapper.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import javax.annotation.Nullable; +import javax.swing.JComponent; +import javax.swing.JFileChooser; +import javax.swing.JLabel; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Dimension; + +import org.apache.commons.lang3.StringUtils; +import com.intellij.openapi.ui.DialogWrapper; + +import ohos.devtools.views.common.LayoutConstants; + +/** + * SampleDialogWrapper + * + * @version 1.0 + * @date 2021/4/1 15:01 + **/ +public class SampleDialogWrapper extends DialogWrapper { + private String message = ""; + private JFileChooser fileChooser = null; + private JPanel fileJpanel = null; + + /** + * SampleDialogWrapper + * + * @param title title + * @param message message + */ + public SampleDialogWrapper(String title, String message) { + super(true); + this.message = message; + init(); + setTitle(title); + } + + /** + * SampleDialogWrapper + * + * @param title title + * @param fileChooser fileChooser + */ + public SampleDialogWrapper(String title, JFileChooser fileChooser) { + super(true); + this.fileChooser = fileChooser; + init(); + setTitle(title); + } + + /** + * SampleDialogWrapper + * + * @param title title + * @param fileJpanel fileJpanel + */ + public SampleDialogWrapper(String title, JPanel fileJpanel) { + super(true); + this.fileJpanel = fileJpanel; + init(); + setTitle(title); + } + + /** + * createCenterPanel + * + * @return JComponent + */ + @Nullable + @Override + protected JComponent createCenterPanel() { + JPanel dialogPanel = new JPanel(new BorderLayout()); + if (!StringUtils.isEmpty(message)) { + JLabel label = new JLabel(message); + label.setPreferredSize(new Dimension(LayoutConstants.DEVICES_WIDTH, LayoutConstants.MONITOR_PANEL_HEIGHT)); + dialogPanel.add(label, BorderLayout.CENTER); + } + if (fileChooser != null) { + dialogPanel.add(fileChooser, BorderLayout.CENTER); + } + if (fileJpanel != null) { + dialogPanel.add(fileJpanel, BorderLayout.CENTER); + } + return dialogPanel; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SaveTraceDialog.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SaveTraceDialog.java new file mode 100644 index 000000000..a197c71d4 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SaveTraceDialog.java @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.datasources.utils.device.entity.DeviceProcessInfo; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.Constant; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.hoscomp.HosJButton; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.ImageIcon; +import javax.swing.JFileChooser; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.UIManager; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.io.File; +import java.io.IOException; + +/** + * @ClassName: SaveTraceDialog + * @Description: SaveTraceDialog类 + * @Date: 2021/3/22 19:02 + */ +public class SaveTraceDialog { + /** + * 全局日志 + */ + private static final Logger LOGGER = LogManager.getLogger(SaveTraceDialog.class); + + /** + * 显示一个自定义的对话框 + * + * @param btn 对话框的父级组件 + */ + public void showCustomDialog(HosJButton btn) { + // 创建一个模态对话框 + JPanel fileJpanel = new JPanel(null); + fileJpanel.setPreferredSize(new Dimension(LayoutConstants.FOUR_HUNDRED, LayoutConstants.TWO_HUNDRED_SIXTY)); + fileJpanel.setBackground(ColorConstants.HOME_PANE); + JLabel taskNameLabel = new JLabel("Save as"); + taskNameLabel.setBounds(LayoutConstants.TWENTY, LayoutConstants.TWENTY, LayoutConstants.HUNDRED_FIFTY, + LayoutConstants.THIRTY); + JTextField jTextField = new JTextField(LayoutConstants.THIRTY); + jTextField.setBackground(ColorConstants.SELECT_PANEL); + jTextField + .setBounds(LayoutConstants.TWENTY, LayoutConstants.FIFTY, LayoutConstants.SCROPNUM, LayoutConstants.THIRTY); + JLabel filePathLocation = new JLabel("Save Location"); + filePathLocation.setBounds(LayoutConstants.TWENTY, LayoutConstants.NINETY, LayoutConstants.HUNDRED_FIFTY, + LayoutConstants.THIRTY); + JTextArea msgTextArea = new JTextArea(LayoutConstants.TWENTY, LayoutConstants.THIRTY); + msgTextArea.setEditable(false); + msgTextArea.setLineWrap(true); + msgTextArea.setBounds(LayoutConstants.TWENTY, LayoutConstants.HUNDRED_TWENTY_TWO, LayoutConstants.THREE_HUNDRED, + LayoutConstants.THIRTY); + msgTextArea.setBackground(ColorConstants.SELECT_PANEL); + if (StringUtils.isNotBlank(Constant.tracePath)) { + msgTextArea.setText(Constant.tracePath); + } + JPanel selectPanel = new JPanel(new BorderLayout()); + selectPanel.setBounds(LayoutConstants.TWENTY, LayoutConstants.HUNDRED_TWENTY_TWO, LayoutConstants.SCROPNUM, + LayoutConstants.THIRTY); + // 获取文件下拉箭头 + JLabel labelSvg = new JLabel(); + labelSvg.setIcon(new ImageIcon(SaveTraceDialog.class.getClassLoader().getResource("images/down.png"))); + labelSvg.setBounds(LayoutConstants.THREE_HUNDRED, LayoutConstants.OTHERS_Y, LayoutConstants.JLABEL_SIZE, + LayoutConstants.THIRTY); + selectPanel.add(msgTextArea, BorderLayout.WEST); + selectPanel.add(labelSvg, BorderLayout.CENTER); + labelSvg.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + try { + showFileSaveDialog(fileJpanel, msgTextArea); + } catch (IOException exception) { + LOGGER.error("SaveTraceDialog:{}", exception.getMessage()); + } + } + }); + fileJpanel.add(taskNameLabel); + fileJpanel.add(jTextField); + fileJpanel.add(filePathLocation); + fileJpanel.add(selectPanel); + customDialogWrapper(btn, new SampleDialogWrapper("Save The Task", fileJpanel), jTextField, msgTextArea); + } + + /** + * 创建一个对话框Wrapper + * + * @param btn btn + * @param sampleDialog sampleDialog + * @param jTextField jTextField + * @param msgTextArea msgTextArea + */ + private void customDialogWrapper(HosJButton btn, SampleDialogWrapper sampleDialog, JTextField jTextField, + JTextArea msgTextArea) { + boolean flag = sampleDialog.showAndGet(); + if (flag) { + String fileName = jTextField.getText().trim(); + String filePath = msgTextArea.getText(); + if (StringUtils.isBlank(fileName)) { + new SampleDialogWrapper("Warring", "Please input the file name !").show(); + return; + } + if (!fileName.matches("^[A-Za-z0-9]+$")) { + new SampleDialogWrapper("Warring", "The file name can only contain numbers and letters !").show(); + return; + } + if (StringUtils.isBlank(filePath)) { + new SampleDialogWrapper("Warring", "Please select the file path !").show(); + return; + } + // 查询数据保存到file + String pathName = filePath + File.separator + fileName + Constant.TRACE_SUFFIX; + DeviceProcessInfo deviceProcessInfo = new DeviceProcessInfo(); + deviceProcessInfo.setDeviceName(btn.getDeviceName()); + deviceProcessInfo.setProcessName(btn.getProcessName()); + deviceProcessInfo.setLocalSessionId(btn.getSessionId()); + boolean saveResult = + SessionManager.getInstance().saveSessionDataToFile(btn.getSessionId(), deviceProcessInfo, pathName); + if (saveResult) { + sampleDialog.close(0); + new SampleDialogWrapper("prompt", "Save Successfully !").show(); + } else { + sampleDialog.close(0); + new SampleDialogWrapper("prompt", "Save failure !").show(); + } + } + } + + /** + * 选择文件保存路径 + * + * @param parent parent + * @param msgTextArea msgTextArea + * @throws IOException IOException + */ + private void showFileSaveDialog(Component parent, JTextArea msgTextArea) throws IOException { + UIManager.put("FileChooser.cancelButtonText", "Cancel"); + // 创建一个默认的文件选取器 + JFileChooser fileChooser = new JFileChooser(); + fileChooser.setDialogTitle("Select File Path"); + fileChooser.setCurrentDirectory(new File(".")); + fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + fileChooser.setMultiSelectionEnabled(false); + fileChooser.setApproveButtonText("choose"); + fileChooser.setControlButtonsAreShown(false); + SampleDialogWrapper sampleDialog = new SampleDialogWrapper("Select File Path", fileChooser); + boolean flag = sampleDialog.showAndGet(); + if (flag) { + File file = fileChooser.getCurrentDirectory(); + msgTextArea.setText(file.getAbsolutePath()); + Constant.tracePath = file.getAbsolutePath(); + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SuspensionTablePanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SuspensionTablePanel.java new file mode 100644 index 000000000..946d5a340 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SuspensionTablePanel.java @@ -0,0 +1,370 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import com.intellij.ui.components.JBScrollPane; +import com.intellij.ui.table.JBTable; +import ohos.devtools.services.memory.MemoryInstanceDetailsInfo; +import ohos.devtools.services.memory.MemoryInstanceDetailsManager; +import ohos.devtools.services.memory.MemoryInstanceInfo; +import ohos.devtools.services.memory.MemoryInstanceManager; +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.event.TaskScenePanelChartEvent; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JLayeredPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.RowSorter; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableColumnModel; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Label; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.Vector; +import java.util.concurrent.TimeUnit; + +/** + * 悬浮table 展示 + * + * @version 1.0 + * @date 2021/3/12 18:44 + **/ +public class SuspensionTablePanel extends TaskScenePanelChartEvent { + private boolean flag = false; + + private JTable jTable; + private JPanel jp = new JPanel(new BorderLayout()); + + /** + * 设置悬浮table + * + * @param jpanelSupenn Supen jpanel + * @param cId cId + * @param sessionId sessionId + * @param className Name class + * @return JPanel + */ + public JPanel createSuspensionTable(JPanel jpanelSupenn, Integer cId, long sessionId, String className) { + jpanelSupenn.setLayout(new BorderLayout()); + Vector columnNames = new Vector<>(); + columnNames.add("instance"); + columnNames.add("allocTime"); + columnNames.add("DealloTime"); + columnNames.add("ID"); + columnNames.add("InstanceId"); + DefaultTableModel model = new DefaultTableModel(); + model.setColumnIdentifiers(columnNames); + initData(model, cId, className, sessionId); + JBTable table = new JBTable(model); + setExtracted(model, table); + JBScrollPane jScrollPane = new JBScrollPane(table); + jScrollPane.setBorder(BorderFactory.createEmptyBorder()); + JPanel jpTop = getTopJPanel(); + JLabel jb = + new JLabel(new ImageIcon(SuspensionTablePanel.class.getClassLoader().getResource("images/close.png"))); + jb.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + jpanelSupenn.setVisible(false); + } + }); + + JPanel jPanel = new JPanel(new BorderLayout()); + jpTop.add(jb, BorderLayout.EAST); + jPanel.add(jpTop, BorderLayout.NORTH); + + JLayeredPane jLayeredPane = new JLayeredPane(); + + jPanel.add(jScrollPane, BorderLayout.CENTER); + jPanel.setBounds(0, 0, LayoutConstants.THREE_HUNDRED, LayoutConstants.THREE_HUNDRED); + jLayeredPane.add(jPanel, JLayeredPane.PALETTE_LAYER); + jpanelSupenn.removeAll(); + jpanelSupenn.add(jLayeredPane); + table.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + flag = true; + if (mouseEvent.getClickCount() == 1) { + getJTable(table, jpanelSupenn, jLayeredPane); + } + } + }); + return jpanelSupenn; + } + + /** + * get JTable + * + * @param table table + * @param jPanelSuspension jPanelSuspension + * @param jLayeredPane jLayeredPane + */ + private void getJTable(JBTable table, JPanel jPanelSuspension, JLayeredPane jLayeredPane) { + int selectedRow = table.getSelectedRow(); + RowSorter rowSorter = null; + Object sorterObj = table.getRowSorter(); + if (sorterObj instanceof RowSorter) { + rowSorter = (RowSorter) sorterObj; + DefaultTableModel detailModel = null; + Object modelObj = rowSorter.getModel(); + if (modelObj instanceof DefaultTableModel) { + detailModel = (DefaultTableModel) modelObj; + Vector detailModeldatas = detailModel.getDataVector(); + Vector detailModeldata = detailModeldatas.get(selectedRow); + Integer instanceId = 0; + Object dataObj = detailModeldata.get(4); + if (dataObj instanceof Integer) { + instanceId = (Integer) dataObj; + jTable = createChildTable(instanceId, flag, jPanelSuspension, jLayeredPane); + } + } + } + } + + private void setExtracted(DefaultTableModel model, JBTable table) { + TableColumnModel tcm = table.getColumnModel(); + table.removeColumn(tcm.getColumn(4)); + table.removeColumn(tcm.getColumn(3)); + table.getTableHeader().setBackground(ColorConstants.TRACE_TABLE_COLOR); + jp.setBackground(ColorConstants.TRACE_TABLE_COLOR); + table.setShowHorizontalLines(false); + table.setBackground(ColorConstants.TRACE_TABLE_COLOR); + RowSorter sorter = new TableRowSorter(model); + table.setRowSorter(sorter); + } + + private JPanel getTopJPanel() { + JLabel label = new JLabel("instanceView"); + label.setOpaque(true); + label.setBackground(ColorConstants.TRACE_TABLE_COLOR); + label.setPreferredSize(new Dimension(LayoutConstants.TASK_DEC_X, LayoutConstants.THIRTY)); + JPanel jpTop = new JPanel(new BorderLayout()); + jpTop.setBackground(ColorConstants.TRACE_TABLE_COLOR); + jpTop.add(label, BorderLayout.WEST); + return jpTop; + } + + /** + * 初始化table 表格 + * + * @param model model + * @param cId cId + * @param className className + * @param sessionId long + */ + public void initData(DefaultTableModel model, Integer cId, String className, long sessionId) { + MemoryInstanceManager memoryInstanceManager = new MemoryInstanceManager(); + ChartStandard standard = ProfilerChartsView.sessionMap.get(sessionId).getObserver().getStandard(); + long firstTime = standard.getFirstTimestamp(); + ChartDataRange selectedRange = standard.getSelectedRange(); + long startTime = selectedRange.getStartTime() + firstTime; + long endTime = selectedRange.getEndTime() + firstTime; + List memoryInstanceInfos = + memoryInstanceManager.getMemoryInstanceInfos(cId, startTime, endTime); + memoryInstanceInfos.forEach(memoryInstanceInfo -> { + long deallocTime = memoryInstanceInfo.getDeallocTime(); + long alloc = TimeUnit.MILLISECONDS.toMicros(memoryInstanceInfo.getAllocTime() - firstTime); + String allocTime = getSemiSimplifiedClockString(alloc); + String dellTime = "-- : -- : --"; + if (deallocTime != 0) { + long delloc = TimeUnit.MILLISECONDS.toMicros(memoryInstanceInfo.getDeallocTime() - firstTime); + dellTime = getSemiSimplifiedClockString(delloc); + } + Integer id = memoryInstanceInfo.getId(); + Integer instanceId = memoryInstanceInfo.getInstanceId(); + Vector rowData = new Vector<>(); + rowData.add(className); + rowData.add(allocTime); + rowData.add(dellTime); + rowData.add(id); + rowData.add(instanceId); + model.addRow(rowData); + }); + } + + /** + * Return a formatted time String in the form of "hh:mm:ss.sss". + * Default format for Range description. + * + * @param micro micro + * @return String + */ + public String getFullClockString(long micro) { + long micros = Math.max(0, micro); + long milli = TimeUnit.MICROSECONDS.toMillis(micros) % TimeUnit.SECONDS.toMillis(1); + long sec = TimeUnit.MICROSECONDS.toSeconds(micros) % TimeUnit.MINUTES.toSeconds(1); + long min = TimeUnit.MICROSECONDS.toMinutes(micros) % TimeUnit.HOURS.toMinutes(1); + long hour = TimeUnit.MICROSECONDS.toHours(micros); + return String.format(Locale.ENGLISH, "%02d:%02d:%02d.%03d", hour, min, sec, milli); + } + + /** + * Return a formatted time String in the form of "hh:mm:ss.sss"". + * Hide hours value if both hours and minutes value are zero. + * Default format for Tooltips. + * + * @param micro micro + * @return String + */ + public String getSemiSimplifiedClockString(long micro) { + long micros = Math.max(0, micro); + String result = getFullClockString(micros); + return result.startsWith("00:00:") ? result.substring(3) : result; + } + + /** + * 根据筛选填充table 表格 + * + * @param model model + */ + public void selectData(DefaultTableModel model) { + // 获取初始化数据,根目录 + Vector rowDat = new Vector<>(); + rowDat.add("John"); + model.addRow(rowDat); + } + + /** + * select Data + * + * @return JPanel + */ + public JPanel selectData() { + JPanel jpanel = new JPanel(new BorderLayout()); + JTextField jTextField = new JTextField(); + jTextField.setBackground(ColorConstants.TRACE_TABLE_COLOR); + Label lb = new Label("Table"); + lb.setPreferredSize(new Dimension(LayoutConstants.FORTY, LayoutConstants.TWENTY)); + jpanel.setBackground(ColorConstants.TRACE_TABLE_COLOR); + jpanel.add(jTextField, BorderLayout.EAST); + jpanel.setBackground(ColorConstants.TRACE_TABLE_COLOR); + jpanel.add(lb, BorderLayout.WEST); + jTextField.getDocument().addDocumentListener(new DocumentListener() { + @Override + public void insertUpdate(DocumentEvent exception) { + } + + @Override + public void removeUpdate(DocumentEvent exception) { + } + + @Override + public void changedUpdate(DocumentEvent exception) { + } + }); + return jpanel; + } + + /** + * 层级展示table 表格 + * + * @param model model + * @param id id + * @param sp sp + */ + public void insertData(DefaultTableModel model, String id, String sp) { + // 根据父亲id,获取子项 + String space = sp + " "; + Vector rowDate = new Vector<>(); + rowDate.add(space + "John"); + rowDate.add(LayoutConstants.EIGHTY); + rowDate.add(LayoutConstants.SEVENTY); + rowDate.add(LayoutConstants.SIXTY); + rowDate.add(LayoutConstants.TWO_HUNDRED_TEN); + rowDate.add(Math.random()); + rowDate.add(id); + rowDate.add("n"); + model.addRow(rowDate); + } + + /** + * 子悬浮table + * + * @param instanceId instanceId + * @param flag flag + * @param jpanelSupenn jpanelSupenn + * @param jLayeredPane jLayeredPane + * @return JTable + */ + public JTable createChildTable(Integer instanceId, boolean flag, JPanel jpanelSupenn, JLayeredPane jLayeredPane) { + Vector columnNames = new Vector<>(); + columnNames.add(""); + DefaultTableModel model = new DefaultTableModel(); + model.setColumnIdentifiers(columnNames); + JTable table = new JTable(model); + table.getTableHeader().setBackground(ColorConstants.TRACE_TABLE_COLOR); + table.setBackground(ColorConstants.TRACE_TABLE_COLOR); + MemoryInstanceDetailsManager detailsManager = new MemoryInstanceDetailsManager(); + ArrayList detailsInfos = detailsManager.getMemoryInstanceDetailsInfos(instanceId); + detailsInfos.forEach(detailsInfo -> { + Vector rowData = new Vector<>(); + rowData.add( + detailsInfo.getClassName() + "::" + detailsInfo.getMethodName() + " " + detailsInfo.getLineNumber() + + " " + detailsInfo.getFieldName()); + model.addRow(rowData); + }); + table.setShowHorizontalLines(false); + JScrollPane jScrollPane = new JScrollPane(table); + jScrollPane.getViewport().setOpaque(true); + jScrollPane.getViewport().setBackground(ColorConstants.TRACE_TABLE_COLOR); + jScrollPane.setBorder(BorderFactory.createEmptyBorder()); + jScrollPane.setBackground(ColorConstants.TRACE_TABLE_COLOR); + JLabel label = new JLabel("Allocation Call Stack "); + label.setPreferredSize(new Dimension(LayoutConstants.TASK_DEC_X, LayoutConstants.THIRTY)); + label.setOpaque(true); + label.setBackground(ColorConstants.TRACE_TABLE_COLOR); + JPanel jpTop = new JPanel(new BorderLayout()); + jpTop.setBackground(ColorConstants.TRACE_TABLE_COLOR); + jpTop.add(label, BorderLayout.WEST); + JLabel jb = + new JLabel(new ImageIcon(SuspensionTablePanel.class.getClassLoader().getResource("images/close.png"))); + jb.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + jLayeredPane.remove(jp); + } + }); + jpTop.add(jb, BorderLayout.EAST); + jp.removeAll(); + jp.add(jpTop, BorderLayout.NORTH); + jp.add(jScrollPane, BorderLayout.CENTER); + jp.setBounds(0, LayoutConstants.THREE_HUNDRED, LayoutConstants.THREE_HUNDRED, + LayoutConstants.THREE_HUNDRED_TWENTY); + jLayeredPane.add(jp, JLayeredPane.DRAG_LAYER); + jLayeredPane.revalidate(); + return table; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SystemTunningConfigPanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SystemTunningConfigPanel.java new file mode 100644 index 000000000..49558a4a0 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SystemTunningConfigPanel.java @@ -0,0 +1,500 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.datatransfer.Clipboard; +import java.util.List; + +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTabbedPane; + +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.device.service.MultiDeviceManager; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.event.SystemTunningConfigEvent; + +/** + * 三级System tuning场景界面 + * + * @version 1.0 + * @date 2021/03/8 11:11 + **/ +public class SystemTunningConfigPanel extends JPanel { + Clipboard clipboard; + /** + * 三级界面边框布局管理器,top容器 + */ + private JPanel jPanelNorth = new JPanel(null); + + /** + * 设备连接方式下拉框(usb,wifi,蓝牙) + */ + private JComboBox jComboBoxConnect = new JComboBox(); + + /** + * 设备名称下拉框 + */ + private JComboBox jComboBoxPhone = new JComboBox(); + + /** + * 设备信息集合 + */ + private List deviceInfos = null; + + /** + * 三级界面边框布局管理器,Center容器 + */ + private JPanel jPanelCenter = new JPanel(new BorderLayout()); + + /** + * 三级界面边框布局管理器,South容器 + */ + private JPanel jPanelSouth = new JPanel(null); + + /** + * top容器中文本描述 + */ + private JLabel jLabelTaskTun = new JLabel("Trace config & Probes"); + + /** + * top容器中文本描述 + */ + private JLabel jLabelDeviceSet = new JLabel("Task scene: System tuning"); + + /** + * Center容器中,Monitor Items页面复选框容器 + */ + private JPanel jPanelRightMemory = new JPanel(null); + + /** + * Monitor Items页面复选框存放数组 + */ + private JCheckBox[] jCheckBoxs = new JCheckBox[LayoutConstants.INDEX_SEVEN]; + + /** + * 三级页面事件类 + */ + private SystemTunningConfigEvent taskSystemTunningPanelEvent = new SystemTunningConfigEvent(); + + /** + * Center容器中,左边布局滚动条容器 + */ + private JPanel scrollPane = new JPanel(null); + + /** + * 返回上一页按钮 + */ + private JButton jButtonLastStep = new JButton("Last Step"); + + /** + * 开始任务按钮 + */ + private JButton jButtonStartTask = new JButton("Start Task"); + + public SystemTunningConfigPanel(TaskPanel jTaskPanel) { + // 设置三级界面布局方式为边框布局管理 + this.setLayout(new BorderLayout()); + // 设置top容器,Center容器,South容器的属性 + setAttributes(); + // Center容器设置 + setjPanelCenter(); + // South容器设置 + setJPanelSouth(jTaskPanel); + } + + /** + * 设置top容器,Center容器,South容器的属性 + */ + public void setAttributes() { + jPanelNorth.setOpaque(true); + jPanelNorth.setBackground(ColorConstants.TOP_PANEL); + jPanelCenter.setOpaque(true); + jPanelCenter.setBackground(ColorConstants.TOP_PANEL); + jPanelSouth.setOpaque(true); + jPanelSouth.setBackground(ColorConstants.TOP_PANEL); + jPanelNorth.setPreferredSize(new Dimension(LayoutConstants.TOP_SOUTH_WIDTH, + LayoutConstants.SYSTEM_TUNNING_TRACE_RECORDING_SETTING_SLIDE_INT_Y)); + jPanelSouth.setPreferredSize(new Dimension(LayoutConstants.WINDOW_WIDTH, LayoutConstants.TOP_SOUTH_HEIGHT)); + this.add(jPanelNorth, BorderLayout.NORTH); + this.add(jPanelCenter, BorderLayout.CENTER); + this.add(jPanelSouth, BorderLayout.SOUTH); + + JLabel jLabelDeviceNum = new JLabel("Device"); + Font fontTaskTun = new Font(Font.DIALOG, Font.BOLD, LayoutConstants.TASK_LABEL_FONT); + jLabelDeviceNum.setFont(fontTaskTun); + jLabelDeviceNum.setForeground(Color.white); + jLabelDeviceNum + .setBounds(LayoutConstants.CHOOSE_HEIGHT, LayoutConstants.JP_RIGHT_WIDTH, LayoutConstants.TASK_LABEL_WIDTH, + LayoutConstants.TASK_LABEL_HEIGHT); + jComboBoxConnect.addItem("USB"); + jComboBoxConnect + .setBounds(LayoutConstants.CHOOSE_HEIGHT, LayoutConstants.SYSTEM_TUNNING_DEVICE_COMBOX_EQUIPMENT_INIT_Y, + LayoutConstants.CON_BOX_WIDTH, LayoutConstants.TASK_SCENE_Y); + deviceInfos = MultiDeviceManager.getInstance().getAllDeviceIPPortInfos(); + taskSystemTunningPanelEvent.devicesInfoJComboBoxUpdate(this); + jComboBoxPhone + .setBounds(LayoutConstants.RIGHT_BUN_WIDTH, LayoutConstants.SYSTEM_TUNNING_DEVICE_COMBOX_EQUIPMENT_INIT_Y, + LayoutConstants.HEIGHT_PRESSE, LayoutConstants.TASK_SCENE_Y); + taskSystemTunningPanelEvent.itemStateChanged(this); + + jLabelTaskTun.setBounds(LayoutConstants.SYSTEM_TUNNING_CENTER_LEFT_AND_RIGHT_X, + LayoutConstants.SYSTEM_TUNNING_TRACE_CONFIG_AND_PROBES_INIT_Y, LayoutConstants.TASK_LABEL_WIDTH, + LayoutConstants.SYSTEM_TUNNING_ALL_LABEL_INIT_HEIGHT); + jLabelTaskTun.setFont(fontTaskTun); + jLabelTaskTun.setForeground(Color.WHITE); + jPanelNorth.add(jLabelDeviceNum); + jPanelNorth.add(jComboBoxConnect); + jPanelNorth.add(jComboBoxPhone); + jPanelNorth.add(jLabelTaskTun); + Font fontDeviceSet = new Font(Font.DIALOG, Font.BOLD, LayoutConstants.TASK_DEC_FONT); + jLabelDeviceSet.setFont(fontDeviceSet); + jLabelDeviceSet.setBounds(LayoutConstants.TASK_DEC_X, LayoutConstants.SYSTEM_TUNNING_SAMLL_TASH_SCENEINIT_Y, + LayoutConstants.TASK_DEC_WIDTH, LayoutConstants.TASK_DEC_HEIGHT); + jPanelNorth.add(jLabelDeviceSet); + } + + /** + * setDeviceInfos + * + * @param deviceInfos deviceInfos + */ + public void setDeviceInfos(List deviceInfos) { + this.deviceInfos = deviceInfos; + } + + /** + * getJComboBoxPhone + * + * @return JComboBox + */ + public JComboBox getJComboBoxPhone() { + return jComboBoxPhone; + } + + /** + * getDeviceInfos + * + * @return List + */ + public List getDeviceInfos() { + return deviceInfos; + } + + /** + * system tunning 设置页面 + */ + public void setjPanelCenter() { + // 左右黑色边框 + JPanel jPanelCenterLeft = new JPanel(); + jPanelCenterLeft.setPreferredSize( + new Dimension(LayoutConstants.SYSTEM_TUNNING_CENTER_LEFT_AND_RIGHT_X, LayoutConstants.DEFAULT_NUMBER)); + jPanelCenterLeft.setBackground(ColorConstants.SYSTEM_TUNNING_SETTING_BACK); + JPanel jPanelCenterEast = new JPanel(); + jPanelCenterEast.setPreferredSize( + new Dimension(LayoutConstants.SYSTEM_TUNNING_CENTER_LEFT_AND_RIGHT_X, LayoutConstants.DEFAULT_NUMBER)); + jPanelCenterEast.setBackground(ColorConstants.SYSTEM_TUNNING_SETTING_BACK); + + JLabel traceConfig = new JLabel("Trace config", JLabel.CENTER); + traceConfig.setForeground(Color.white); + traceConfig + .setFont(new Font(Font.DIALOG, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_TABBEDPANE_TRACE_CONFIG_FONT)); + traceConfig.setPreferredSize(new Dimension(LayoutConstants.SYSTEM_TUNNING_TABBEDPANE_TRACE_CONFIG_WIDTH_INIT, + LayoutConstants.SYSTEM_TUNNING_TABBEDPANE_TRACE_CONFIG_HEIGHT_INIT)); + JLabel probes = new JLabel("Probes", JLabel.CENTER); + probes.setForeground(Color.white); + probes.setFont(new Font(Font.DIALOG, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_TABBEDPANE_TRACE_CONFIG_FONT)); + probes.setPreferredSize(new Dimension(LayoutConstants.SYSTEM_TUNNING_TABBEDPANE_TRACE_CONFIG_WIDTH_INIT, + LayoutConstants.SYSTEM_TUNNING_TABBEDPANE_TRACE_CONFIG_HEIGHT_INIT)); + + JPanel traceConfigTab = new JPanel(new BorderLayout()); + traceConfigTab.add(traceConfig); + JPanel probesTab = new JPanel(new BorderLayout()); + JTabbedPane tab = new JTabbedPane(); + tab.addTab("", traceConfigTab); + tab.addTab("", probesTab); + tab.setTabComponentAt(tab.indexOfComponent(traceConfigTab), traceConfig); + tab.setTabComponentAt(tab.indexOfComponent(probesTab), probes); + + JPanel jPanelCenterTop = new JPanel(new BorderLayout()); + jPanelCenterTop.add(tab); + jPanelCenterTop.setBackground(ColorConstants.SYSTEM_TUNNING_SETTING_CENTER); + JPanel jPanelCenterSouthWest = new JPanel(null); + JPanel jPanelCenterSouthRight = new JPanel(null); + traceConfig(jPanelCenterSouthWest, jPanelCenterSouthRight); + traceConfigTab.add(jPanelCenterSouthWest, BorderLayout.WEST); + traceConfigTab.add(jPanelCenterSouthRight, BorderLayout.CENTER); + JPanel jPanelCenterSouthWestP2 = new JPanel(null); + JPanel jPanelCenterSouthEastP2 = new JPanel(null); + systemTunningProbes(jPanelCenterSouthWestP2, jPanelCenterSouthEastP2); + probesTab.add(jPanelCenterSouthWestP2, BorderLayout.WEST); + probesTab.add(jPanelCenterSouthEastP2, BorderLayout.CENTER); + jPanelCenter.add(jPanelCenterLeft, BorderLayout.WEST); + jPanelCenter.add(jPanelCenterTop, BorderLayout.CENTER); + jPanelCenter.add(jPanelCenterEast, BorderLayout.EAST); + } + + /** + * traceConfig + * + * @param jPanelCenterSouthWest jPanelCenterSouthWest + * @param jPanelCenterSouthRight jPanelCenterSouthRight + */ + public void traceConfig(JPanel jPanelCenterSouthWest, JPanel jPanelCenterSouthRight) { + JLabel recordSettingLabel = new JLabel( + "

Record Setting

" + + "

Buffer mode.size and duration

", JLabel.CENTER); + recordSettingLabel.setOpaque(true); + + recordSettingLabel.setBounds(LayoutConstants.DEFAULT_NUMBER, LayoutConstants.SYSTEM_TUNNING_LABLE_INTT_Y, + LayoutConstants.SYSTEM_TUNNING_LABLE_WIDTH, LayoutConstants.SYSTEM_TUNNING_SLIDE_LABLE_HEIGHT); + JLabel traceCommandLabel = new JLabel("

Trace command

Manually record trace

", JLabel.CENTER); + traceCommandLabel.setBounds(LayoutConstants.DEFAULT_NUMBER, + LayoutConstants.SYSTEM_TUNNING_LABLE_INTT_Y + LayoutConstants.SYSTEM_TUNNING_SLIDE_LABLE_SPACING_Y, + LayoutConstants.SYSTEM_TUNNING_LABLE_WIDTH, LayoutConstants.SYSTEM_TUNNING_SLIDE_LABLE_HEIGHT); + + taskSystemTunningPanelEvent + .recordSetting(recordSettingLabel, traceCommandLabel, jPanelCenterSouthRight, jPanelCenterSouthWest); + taskSystemTunningPanelEvent + .traceCommand(recordSettingLabel, traceCommandLabel, jPanelCenterSouthRight, jPanelCenterSouthWest); + + jPanelCenterSouthWest.add(recordSettingLabel); + jPanelCenterSouthWest.setPreferredSize( + new Dimension(LayoutConstants.SYSTEM_TUNNING_LABLE_WIDTH, LayoutConstants.DEFAULT_NUMBER)); + jPanelCenterSouthWest.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + } + + /** + * systemTunningProbes + * + * @param jPanelCenterSouthWestP2 jPanelCenterSouthWestP2 + * @param jPanelCenterSouthEastP2 jPanelCenterSouthEastP2 + */ + public void systemTunningProbes(JPanel jPanelCenterSouthWestP2, JPanel jPanelCenterSouthEastP2) { + JLabel probesCpu = new JLabel("

probes config

CPU usage,scheduling," + "
" + "wakeups

", JLabel.CENTER); + probesCpu.setOpaque(true); + probesCpu.setBounds(LayoutConstants.DEFAULT_NUMBER, LayoutConstants.SYSTEM_TUNNING_LABLE_INTT_Y, + LayoutConstants.SYSTEM_TUNNING_LABLE_WIDTH, LayoutConstants.SYSTEM_TUNNING_SLIDE_LABLE_HEIGHT); + systemTunningProbesCpuRightShow(jPanelCenterSouthEastP2); + jPanelCenterSouthWestP2.add(probesCpu); + jPanelCenterSouthWestP2.setPreferredSize( + new Dimension(LayoutConstants.SYSTEM_TUNNING_LABLE_WIDTH, LayoutConstants.DEFAULT_NUMBER)); + jPanelCenterSouthWestP2.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + } + + /** + * jPanelCenterSouthEastP2 settings + * + * @param jPanelCenterSouthEastP2 jPanelCenterSouthEastP2 + */ + public void systemTunningProbesCpuRightShow(JPanel jPanelCenterSouthEastP2) { + jPanelCenterSouthEastP2.removeAll(); + // 右边四个、左侧三个复选框 + jCheckBoxAttributeRight(jPanelCenterSouthEastP2); + jCheckBoxAttributeLeft(jPanelCenterSouthEastP2); + JLabel memoryLabel2 = new JLabel( + "

" + + "enables high-detailed tracking of scheduling events" + "

", JLabel.LEFT); + memoryLabel2.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE_INTT_X, + LayoutConstants.SYSTEM_TUNNING_PROBES_SCHEDULING_SPACING_Y, LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE, + LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + jPanelCenterSouthEastP2.add(memoryLabel2); + JLabel cPUFrequencyLabel2 = cPUFrequencyLabel2(); + jPanelCenterSouthEastP2.add(cPUFrequencyLabel2); + JLabel syscallsLabel2 = new JLabel("

" + + "Tracks the enter and exit of all syscalls" + "

", JLabel.LEFT); + syscallsLabel2.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE_INTT_X, + LayoutConstants.SYSTEM_TUNNING_PROBES_SYSCALLS_SPACING_Y, LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE, + LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + JLabel boardVoltagesLabel2 = new JLabel("

" + + "Tracks voltage and frequency changes from board sensors " + "

", JLabel.LEFT); + boardVoltagesLabel2.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE_INTT_RIGHT_X, + LayoutConstants.SYSTEM_TUNNING_PROBES_SCHEDULING_SPACING_Y, LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE, + LayoutConstants.SYSTEM_TUNNING_CHECKBOX_LABLE_HEIGHT); + jPanelCenterSouthEastP2.add(boardVoltagesLabel2); + JLabel highFrequencyLabel2 = new JLabel("

" + + "Allows to track short memory splikes and transitories through ftrace's mm_event. " + + "rss_stat and ion events. Available only on recent system kernels" + "

", JLabel.LEFT); + highFrequencyLabel2.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE_INTT_RIGHT_X, + LayoutConstants.SYSTEM_TUNNING_PROBES_HIGH_FREQUENCY_MEMORY_LABEL_INIT_Y, + LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE, LayoutConstants.SYSTEM_TUNNING_CHECKBOX_LABLE_HEIGHT); + JLabel lowMemoryLabel2 = new JLabel("

" + + "Record LMK events. Works both with the old in kernel LMK and " + + "the newer userspace Imkd. It also tracks OOM score adjustments " + "

", JLabel.LEFT); + lowMemoryLabel2.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE_INTT_RIGHT_X, + LayoutConstants.SYSTEM_TUNNING_PROBES_LOW_MEMORY_KILLER_LABEL_INIT_Y, + LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE, LayoutConstants.SYSTEM_TUNNING_CHECKBOX_LABLE_HEIGHT); + jPanelCenterSouthEastP2.add(lowMemoryLabel2); + JLabel atraceUserspaceLabel2 = new JLabel("

" + + "Enables C++ / Java codebase annotations (ATRACE_BEGIN() / os.Trace())" + "

", JLabel.LEFT); + atraceUserspaceLabel2.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE_INTT_RIGHT_X, + LayoutConstants.SYSTEM_TUNNING_PROBES_ATRACE_USERSPACE_ANNOTATIONS_LABEL_INIT_Y, + LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE, LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + jPanelCenterSouthEastP2.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + jPanelCenterSouthEastP2.repaint(); + } + + /** + * cPUFrequencyLabel2 + * + * @return JLabel + */ + public JLabel cPUFrequencyLabel2() { + JLabel cPUFrequencyLabel2 = new JLabel( + "

" + + "Records cpu frequency and idle state change viaftrace" + "

", JLabel.LEFT); + cPUFrequencyLabel2.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE_INTT_X, + LayoutConstants.SYSTEM_TUNNING_PROBES_CPU_SPACING_Y, LayoutConstants.SYSTEM_TUNNING_LABLE_DESCRIBE, + LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + return cPUFrequencyLabel2; + } + + /** + * jCheckBoxAttributeRight + * + * @param jPanelCenterSouthEastP2 jPanelCenterSouthEastP2 + */ + public void jCheckBoxAttributeRight(JPanel jPanelCenterSouthEastP2) { + JLabel label1 = new JLabel("Record model"); + + label1.setBounds(LayoutConstants.SYSTEM_TUNNING_LABEL_INTT_X, + LayoutConstants.SYSTEM_TUNNING_RECORD_MODEL_LABLE_INTT_Y, LayoutConstants.SYSTEM_TUNNING_LABLE_WIDTH, + LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + // 创建JCheckBox对象 + JCheckBox rbScheduling = new JCheckBox("Scheduling details", true); + JCheckBox rbCpu = new JCheckBox("CPU Frequency and idle states", true); + JCheckBox rbSyscalls = new JCheckBox("Syscalls", false); + JCheckBox rbBoard = new JCheckBox("Board voltages & frequency", false); + rbScheduling.setFont(new Font(Font.DIALOG, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_FONT)); + rbCpu.setFont(new Font(Font.DIALOG, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_FONT)); + rbSyscalls.setFont(new Font(Font.DIALOG, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_FONT)); + rbBoard.setFont(new Font(Font.DIALOG, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_FONT)); + + rbScheduling.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + rbCpu.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + rbSyscalls.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + rbBoard.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + rbScheduling + .setBounds(LayoutConstants.SYSTEM_TUNNING_LABEL_INTT_X, LayoutConstants.SYSTEM_TUNNING_LABLE_SPACING_Y, + LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_LABLE_WIDTH, LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + rbCpu.setBounds(LayoutConstants.SYSTEM_TUNNING_LABEL_INTT_X, + LayoutConstants.SYSTEM_TUNNING_LABLE_SPACING_Y + LayoutConstants.SYSTEM_TUNNING_PROBES_SPACING_Y, + LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_LABLE_WIDTH, LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + rbSyscalls.setBounds(LayoutConstants.SYSTEM_TUNNING_LABEL_INTT_X, + LayoutConstants.SYSTEM_TUNNING_LABLE_SPACING_Y + LayoutConstants.SYSTEM_TUNNING_PROBES_DOUBLE_SPACING_Y, + LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_LABLE_WIDTH, LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + rbBoard.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_INTT_RIGHT_X, + LayoutConstants.SYSTEM_TUNNING_LABLE_SPACING_Y, LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_LABLE_WIDTH, + LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + jPanelCenterSouthEastP2.add(label1); + jPanelCenterSouthEastP2.add(rbScheduling); + jPanelCenterSouthEastP2.add(rbCpu); + jPanelCenterSouthEastP2.add(rbBoard); + taskSystemTunningPanelEvent.checkBoxState(rbScheduling, rbCpu, rbSyscalls, rbBoard); + } + + /** + * jCheckBoxAttributeLeft + * + * @param jPanelCenterSouthEastP2 jPanelCenterSouthEastP2 + */ + public void jCheckBoxAttributeLeft(JPanel jPanelCenterSouthEastP2) { + JCheckBox rbFrequency = new JCheckBox("High frequency memory", false); + JCheckBox rbLowMemory = new JCheckBox("Low memory killer", false); + JCheckBox rbAtrace = new JCheckBox("Atrace userspace annotations", false); + // 右侧三个复选框 + rbFrequency.setFont(new Font(Font.DIALOG, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_FONT)); + rbLowMemory.setFont(new Font(Font.DIALOG, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_FONT)); + rbAtrace.setFont(new Font(Font.DIALOG, Font.BOLD, LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_FONT)); + rbFrequency.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + rbLowMemory.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + rbAtrace.setBackground(ColorConstants.SYSTEM_TUNNING_WEST_LABEL); + rbFrequency.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_INTT_RIGHT_X, + LayoutConstants.SYSTEM_TUNNING_LABLE_SPACING_Y, LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_LABLE_WIDTH, + LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + rbLowMemory.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_INTT_RIGHT_X, + LayoutConstants.SYSTEM_TUNNING_LABLE_SPACING_Y + LayoutConstants.SYSTEM_TUNNING_PROBES_SPACING_Y, + LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_LABLE_WIDTH, LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + rbAtrace.setBounds(LayoutConstants.SYSTEM_TUNNING_LABLE_INTT_RIGHT_X, + LayoutConstants.SYSTEM_TUNNING_LABLE_SPACING_Y + LayoutConstants.SYSTEM_TUNNING_PROBES_DOUBLE_SPACING_Y + + LayoutConstants.SYSTEM_TUNNING_PROBES_SPACING_Y, LayoutConstants.SYSTEM_TUNNING_JCHECKBOX_LABLE_WIDTH, + LayoutConstants.SYSTEM_TUNNING_LABLE_HEIGHT); + jPanelCenterSouthEastP2.add(rbLowMemory); + taskSystemTunningPanelEvent.checkBoxStateLeft(rbFrequency, rbLowMemory, rbAtrace); + } + + /** + * SouthContainer settings + * + * @param jTaskPanel jTaskPanel + */ + public void setJPanelSouth(TaskPanel jTaskPanel) { + jButtonLastStep.setBounds((int) (LayoutConstants.NUMBER_STEP + (jPanelSouth.getPreferredSize().getWidth() + - LayoutConstants.WINDOW_WIDTH)), LayoutConstants.JP_LABEL_HEIGHT, LayoutConstants.DEVICES_WIDTH, + LayoutConstants.DEVICE_X); + jButtonLastStep.setBackground(ColorConstants.BLACK_COLOR); + jButtonLastStep.setFocusPainted(false); + jButtonStartTask.setForeground(Color.white); + + jButtonStartTask.setBounds((int) (LayoutConstants.POSITION_TASK_X + (jPanelSouth.getPreferredSize().getWidth() + - LayoutConstants.WINDOW_WIDTH)), LayoutConstants.JP_LABEL_HEIGHT, LayoutConstants.DEVICES_WIDTH, + LayoutConstants.DEVICE_X); + jButtonStartTask.setBackground(ColorConstants.ADD_DEVICE_BUN); + jButtonStartTask.setFocusPainted(false); + jPanelSouth.add(jButtonLastStep); + jPanelSouth.add(jButtonStartTask); + // 监听jPanelSouth大小变化并改变按钮位置 + taskSystemTunningPanelEvent.listenerJPanelSouth(this); + // jButtonLastStep添加事件返回上一页 + taskSystemTunningPanelEvent.lastStep(this, jTaskPanel); + // jButtonStartTask添加事件开始任务 + taskSystemTunningPanelEvent.startTask(this, jTaskPanel); + } + + public JPanel getScrollPane() { + return scrollPane; + } + + public JPanel getJPanelSouth() { + return jPanelSouth; + } + + public JButton getJButtonLastStep() { + return jButtonLastStep; + } + + public JButton getJButtonStartTask() { + return jButtonStartTask; + } + + public JCheckBox[] getJCheckBoxs() { + return jCheckBoxs; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SystemTunningLoadDialog.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SystemTunningLoadDialog.java new file mode 100644 index 000000000..3d5d16162 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/SystemTunningLoadDialog.java @@ -0,0 +1,317 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.datasources.transport.hdc.HdcWrapper; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import ohos.devtools.datasources.utils.trace.service.TraceManager; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.SystemTunningProbesCheckbox; +import ohos.devtools.views.layout.event.SystemTunningDialogEvent; +import ohos.devtools.views.trace.component.AnalystPanel; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.Timer; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.util.Date; +import java.util.Locale; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +/** + * @Description TaskSystemLoad + * @Date 2021/4/10 15:16 + **/ +public class SystemTunningLoadDialog implements ActionListener { + private static final Logger LOGGER = LogManager.getLogger(SystemTunningLoadDialog.class); + private Date executeArrivalToTime = null; + private int bytraceFileSize; + private int hours = 0; + private int minutes = 0; + private int seconds = 0; + private int maxDurationParam = 0; + private String sessionId; + private DeviceIPPortInfo deviceIPPortInfo; + private int differentRequests = 0; + private Boolean pullBytraceFileState = false; + private Boolean analysisState = false; + /** + * loading + */ + private int hoursLoading = 0; + private int minutesLoading = 0; + private int secondsLoading = 0; + + private TaskPanel jTaskPanel = null; + + private JPanel jPanel = new JPanel(null); + + private JLabel statusJLabel = new JLabel("Status"); + + private JLabel durationJLabel = new JLabel("Duration"); + + private JLabel recordingJLabel = new JLabel("Recording"); + + private JLabel timeJLabel = new JLabel(); + + private JButton stopJButton = new JButton("Stop"); + + private SystemTunningDialogEvent systemTunningDialogEvent; + + private Timer timer = new Timer(LayoutConstants.NUMBER_THREAD, this::actionPerformed); + + private Timer timerLoading = null; + + private JLabel statusAnalysisJLabel = new JLabel("Status"); + + private JLabel durationAnalysisJLabel = new JLabel("Duration"); + + private JLabel loadingJLabel = new JLabel("Loading"); + + private JLabel loadingInitTimeJLabel = new JLabel(" 00:00:00"); + + /** + * load + * + * @param jTaskPanel jTaskPanel + * @param differentRequestsPram differentRequestsPram + * @param maxDurationParam maxDurationParam + * @param sessionIdParam sessionIdParam + * @param deviceIPPortInfoParam deviceIPPortInfoParam + */ + public void load(TaskPanel jTaskPanel, int differentRequestsPram, int maxDurationParam, String sessionIdParam, + DeviceIPPortInfo deviceIPPortInfoParam) { + // 当前时间大于大于采集的时间、小于采集加解析的时间 + if (timer.isRepeats()) { + timer.stop(); + } + timer = new Timer(LayoutConstants.NUMBER_THREAD, this::actionPerformed); + systemTunningDialogEvent = new SystemTunningDialogEvent("Prompt", jPanel); + stopJButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent actionEvent) { + timer.stop(); + systemTunningDialogEvent.close(1); + new TraceManager().stopAndDestroySession(deviceIPPortInfo, sessionId); + } + }); + this.jTaskPanel = jTaskPanel; + this.maxDurationParam = maxDurationParam; + this.sessionId = sessionIdParam; + this.deviceIPPortInfo = deviceIPPortInfoParam; + this.differentRequests = differentRequestsPram; + jPanel.setPreferredSize( + new Dimension(LayoutConstants.SYSTEM_TUNNING_LOADING_WIDTH, LayoutConstants.SYSTEM_TUNNING_LOADING_HEIGHT)); + statusJLabel.setForeground(Color.white); + durationJLabel.setForeground(Color.white); + recordingJLabel.setForeground(Color.white); + timeJLabel.setForeground(Color.white); + this.setLableAttribute(statusJLabel, durationJLabel, recordingJLabel, timeJLabel); + timeJLabel.setText(" 00:00:00"); + jPanel.add(statusJLabel); + jPanel.add(durationJLabel); + jPanel.add(recordingJLabel); + jPanel.add(timeJLabel); + jPanel.add(stopJButton); + timer.start(); + systemTunningDialogEvent.show(); + } + + /** + * actionPerformed + * + * @param actionEvent actionEvent + */ + public void actionPerformed(ActionEvent actionEvent) { + if ((hours * SystemTunningProbesCheckbox.MINUTE_TO_S * SystemTunningProbesCheckbox.MINUTE_TO_S + + minutes * SystemTunningProbesCheckbox.MINUTE_TO_S + seconds) > maxDurationParam) { + timer.stop(); + // 加载展示页面 + this.loading(); + } + if (seconds <= LayoutConstants.NUMBER_SECONDS) { + timeJLabel.setText(" " + String.format(Locale.ENGLISH, "%02d", hours) + ":" + String + .format(Locale.ENGLISH, "%02d", minutes) + ":" + String.format(Locale.ENGLISH, "%02d", seconds)); + seconds++; + if (seconds > LayoutConstants.NUMBER_SECONDS) { + seconds = 0; + minutes++; + if (minutes > LayoutConstants.NUMBER_SECONDS) { + minutes = 0; + hours++; + } + } + } + } + + /** + * loading + */ + public void loading() { + pullBytraceFileState = true; + timerLoading = new Timer(LayoutConstants.NUMBER_THREAD, this::actionLoadingPerformed); + jPanel.setPreferredSize( + new Dimension(LayoutConstants.SYSTEM_TUNNING_LOADING_WIDTH, LayoutConstants.SYSTEM_TUNNING_LOADING_HEIGHT)); + statusAnalysisJLabel.setForeground(Color.white); + durationAnalysisJLabel.setForeground(Color.white); + loadingJLabel.setForeground(Color.white); + loadingInitTimeJLabel.setForeground(Color.white); + this.setLableAttribute(statusAnalysisJLabel, durationAnalysisJLabel, loadingJLabel, loadingInitTimeJLabel); + jPanel.removeAll(); + jPanel.add(statusAnalysisJLabel); + jPanel.add(durationAnalysisJLabel); + jPanel.add(loadingJLabel); + jPanel.add(loadingInitTimeJLabel); + timerLoading.start(); + systemTunningDialogEvent.repaint(); + } + + + /** + * actionLoadingPerformed + * + * @param actionEvent actionEvent + */ + public void actionLoadingPerformed(ActionEvent actionEvent) { + if (secondsLoading <= LayoutConstants.NUMBER_SECONDS) { + loadingInitTimeJLabel.setText(" " + String.format(Locale.ENGLISH, "%02d", hoursLoading) + ":" + String + .format(Locale.ENGLISH, "%02d", minutesLoading) + ":" + String + .format(Locale.ENGLISH, "%02d", secondsLoading)); + secondsLoading++; + if (secondsLoading > LayoutConstants.NUMBER_SECONDS) { + secondsLoading = 0; + minutesLoading++; + if (minutesLoading > LayoutConstants.NUMBER_SECONDS) { + minutesLoading = 0; + hoursLoading++; + } + } + int num = secondsLoading % 2; + if (pullBytraceFileState && num == 0) { + String getBytraceFileInfoCmd = "hdc shell du /data/local/tmp/hiprofiler_data.bytrace "; + String bytraceFileInfo = HdcWrapper.getInstance().getHdcStringResult(getBytraceFileInfoCmd); + if (bytraceFileInfo != null && bytraceFileInfo.length() > 0) { + String[] bytraceFileInfoArray = bytraceFileInfo.split("\t"); + if (bytraceFileSize != 0 && bytraceFileSize == Integer.valueOf(bytraceFileInfoArray[0])) { + pullBytraceFileState = false; + pullAndAnalysisBytraceFile(); + }else { + bytraceFileSize = Integer.valueOf(bytraceFileInfoArray[0]); + } + } + } + } + if (analysisState) { + timerLoading.stop(); + systemTunningDialogEvent.close(1); + } + } + + /** + * pull and analysis bytrace file + * + */ + public void pullAndAnalysisBytraceFile() { + ExecutorService executor = Executors.newSingleThreadExecutor(); + executor.execute(new Runnable() { + @Override + public void run() { + getBytraceFile(); + String baseDir = SessionManager.getInstance().getPluginPath() + "trace_streamer\\"; + String dbPath = baseDir + "systrace.db"; + File file = new File(baseDir); + String cmd = baseDir + "trace_streamer.exe"; + if (differentRequests == 0) { + cmd = cmd + " " + baseDir + "hiprofiler_data.bytrace"; + } + if (differentRequests == 1) { + cmd = cmd + " " + baseDir + "hiprofiler_data.ptrace"; + } + cmd = cmd + " -e " + dbPath; + LOGGER.info("cmd: {}", cmd); + HdcWrapper.getInstance().getHdcStringResult(cmd); + jTaskPanel.getOptionJPanel().removeAll(); + AnalystPanel component = new AnalystPanel(); + component.load(dbPath, true); + jTaskPanel.getOptionJPanel().add(component); + jTaskPanel.repaint(); + analysisState = true; + } + }); + } + + /** + * get bytrace file + * + */ + public void getBytraceFile() { + String pluginPath = SessionManager.getInstance().getPluginPath() + "trace_streamer\\"; + LOGGER.info("start >>> hdc file recv /data/local/tmp/hiprofiler_data.bytrace"); + String cmd = null; + if (differentRequests == 0) { + cmd = "hdc file recv /data/local/tmp/hiprofiler_data.bytrace " + pluginPath; + } + if (differentRequests == 1) { + cmd = "hdc file recv /data/local/tmp/hiprofiler_data.ptrace " + pluginPath; + } + HdcWrapper.getInstance().execCmdBy(cmd, LayoutConstants.TEN); + + // 抓取数据结束,获取ptrace数据到本地过后,stopSession、destroySession + new TraceManager().stopAndDestroySession(deviceIPPortInfo, sessionId); + LOGGER.info("end >>> hdc file recv /data/local/tmp/hiprofiler_data.ptrace"); + } + + /** + * set Label Attribute + * + * @param statusJLabelParam statusJLabelParam + * @param durationJLabelParam durationJLabelParam + * @param recordingJLabelParam recordingJLabelParam + * @param timeJLabelParam timeJLabelParam + */ + public void setLableAttribute(JLabel statusJLabelParam, JLabel durationJLabelParam, + JLabel recordingJLabelParam, JLabel timeJLabelParam) { + statusJLabelParam.setBounds(LayoutConstants.SYSTEM_TUNNING_LOADING_INITLINE_ONE_X, + LayoutConstants.SYSTEM_TUNNING_LOADING_INIT_INITLINE_ONE_Y, + LayoutConstants.SYSTEM_TUNNING_LOADING_INITLINE_ONE_WIDTH, + LayoutConstants.SYSTEM_TUNNING_LOADING_INITLINE_ONE_HEIGHT); + recordingJLabelParam.setBounds(LayoutConstants.SYSTEM_TUNNING_LOADING_INIT_LINE_TWO_X, + LayoutConstants.SYSTEM_TUNNING_LOADING_INIT_INITLINE_ONE_Y, + LayoutConstants.SYSTEM_TUNNING_LOADING_INITLINE_ONE_WIDTH, + LayoutConstants.SYSTEM_TUNNING_LOADING_INITLINE_ONE_HEIGHT); + durationJLabelParam.setBounds(LayoutConstants.SYSTEM_TUNNING_LOADING_INITLINE_ONE_X, + LayoutConstants.SYSTEM_TUNNING_LOADING_INIT_INITLINE_TWO_Y, + LayoutConstants.SYSTEM_TUNNING_LOADING_INITLINE_ONE_WIDTH, + LayoutConstants.SYSTEM_TUNNING_LOADING_INITLINE_ONE_HEIGHT); + timeJLabelParam.setBounds(LayoutConstants.SYSTEM_TUNNING_LOADING_INIT_LINE_TWO_X, + LayoutConstants.SYSTEM_TUNNING_LOADING_INIT_INITLINE_TWO_Y, + LayoutConstants.SYSTEM_TUNNING_LOADING_INITLINE_ONE_WIDTH, + LayoutConstants.SYSTEM_TUNNING_LOADING_INITLINE_ONE_HEIGHT); + stopJButton + .setBounds(LayoutConstants.SYSTEM_TUNNING_LOADING_HEIGHT, LayoutConstants.SYSTEM_TUNNING_LOADING_BUTTON_Y, + LayoutConstants.SYSTEM_TUNNING_LOADING_INITLINE_ONE_WIDTH, + LayoutConstants.SYSTEM_TUNNING_LOADING_INITLINE_ONE_HEIGHT); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskPanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskPanel.java new file mode 100644 index 000000000..6625873f4 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskPanel.java @@ -0,0 +1,613 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.datasources.transport.hdc.HdcWrapper; +import ohos.devtools.datasources.utils.device.entity.DeviceProcessInfo; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.Constant; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.hoscomp.HosJLabel; +import ohos.devtools.views.layout.event.TaskPanelEvent; +import ohos.devtools.views.trace.component.AnalystPanel; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JLabel; +import javax.swing.JLayeredPane; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; +import javax.swing.UIManager; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GridLayout; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.ExecutionException; + +/** + * 二级界面 + * + * @version 1.0 + * @date 2021/02/27 11:09 + **/ +public class TaskPanel extends JLayeredPane { + /** + * 全局日志 + */ + private static final Logger LOGGER = LogManager.getLogger(TaskPanel.class); + + /** + * 二级界面选项卡容器 + */ + private JPanel optionJPanel = new JPanel(new BorderLayout()); + + /** + * 二级界面选项卡内容容器 + */ + private JPanel optionJPanelContent = new JPanel(); + + /** + * 多配置界面选项卡标签 + */ + private JPanel jPanelTabLabel = new JPanel(); + + /** + * 多配置界面选项卡标签左侧 + */ + private JPanel jPanelLeft = new JPanel(); + + /** + * 多配置界面选项卡标签右侧 + */ + private JPanel jPanelRight = new JPanel(); + + /** + * 配置界面选项卡标签命名 + */ + private JLabel jLabelSetting = new JLabel("NewTask-Configure"); + + /** + * 多配置界面选项卡标签关闭按钮 + */ + private JLabel jLabelClose = new JLabel("x"); + + private TaskPanelEvent taskPanelEvent = new TaskPanelEvent(); + + private JLabel jButtonApplyTun = new JLabel(new ImageIcon(TaskPanel.class.getClassLoader() + .getResource("images/application_tuning.png"))); + private JLabel jButtonSystemTun = + new JLabel(new ImageIcon(TaskPanel.class.getClassLoader().getResource("images/system_tuning.png"))); + private JLabel jButtonHadoop = new JLabel( + new ImageIcon(TaskPanel.class.getClassLoader().getResource("images/distributed_scenario.png"))); + + private JLabel jLabelIcon = new JLabel(); + + private JLabel jLabelTaskTun = new JLabel("Application tuning

Tune application Launch perfoam" + + "ace with a 5 second time profile and a thread state trace."); + + private JLabel chooseButton = new JLabel("Choose", JLabel.CENTER); + + private JLabel traceButton = new JLabel("Open Trace File", JLabel.CENTER); + + private JButton jButtonAdd = new JButton("+"); + + private Long localSessionId; + + private TransferringWindow jProgressBar = null; + + /** + * 运行可执行文件将数据源转为db文件的是否成功结果 + */ + private Boolean traceAnalysisResult = true; + + /** + * Task Panel + */ + public TaskPanel() { + } + + /** + * Task Panel + * + * @param taskPanel task Panel + * @param taskPanelWelcome task Panel Welcome + */ + public TaskPanel(JPanel taskPanel, TaskPanelWelcome taskPanelWelcome) { + // 设置多配置界面 选项卡窗体大小 + this.setPreferredSize(new Dimension(LayoutConstants.OPT_WIDTH, LayoutConstants.OPT_HEIGHT)); + // 设置背景不透明 + this.setOpaque(true); + this.setBackground(ColorConstants.TOP_COLOR); + // 将选项卡内容容器添加到选项卡容器 + optionJPanel.add(optionJPanelContent); + // 设置属性 + setAttributes(taskPanel); + // 实现可新增多任务功能 + Constant.jtasksTab.addTab("", optionJPanel); + Constant.jtasksTab.setTabComponentAt(Constant.jtasksTab.indexOfComponent(optionJPanel), jPanelTabLabel); + taskLabel(jButtonApplyTun, jButtonSystemTun, jButtonHadoop); + taskPanel.setLayout(new BorderLayout()); + jButtonAdd.setBackground(ColorConstants.HOME_PANE); + jButtonAdd.setForeground(Color.GRAY); + Font font = new Font(Font.DIALOG, Font.PLAIN, LayoutConstants.DEVICES_HEIGHT); + jButtonAdd.setFont(font); + jButtonAdd.setBorderPainted(false); + jButtonAdd.setBounds(LayoutConstants.NUMBER_X_ADD * Constant.jtasksTab.getTabCount(), LayoutConstants + .NUMBER_Y, LayoutConstants.BUTTON_HEIGHT, LayoutConstants.BUTTON_HEIGHT); + Constant.jtasksTab.setBounds(0, 0, taskPanel.getWidth(), taskPanel.getHeight()); + this.add(Constant.jtasksTab); + taskPanel.add(this); + double result = Constant.jtasksTab.getTabCount() * LayoutConstants.NUMBER_X; + // 当选项卡标签总长度过长时自动改变每个标签的大小使所有的标签在一行 + if (result > taskPanel.getWidth()) { + for (int index = 0; index < Constant.jtasksTab.getTabCount(); index++) { + Object tabObj = Constant.jtasksTab.getTabComponentAt(index); + if (tabObj instanceof JPanel) { + ((JPanel) tabObj).getComponents()[0].setPreferredSize(new Dimension( + (((taskPanel.getWidth() - LayoutConstants.MEMORY_WIDTH) / Constant.jtasksTab + .getTabCount()) - LayoutConstants.TASK_DEC_NUM) - LayoutConstants.JAVA_HEIGHT, + LayoutConstants.JAVA_HEIGHT)); + } + Constant.jtasksTab.getTabComponentAt(index).setPreferredSize(new Dimension( + ((taskPanel.getWidth() - LayoutConstants.MEMORY_WIDTH) / + Constant.jtasksTab.getTabCount()) + - LayoutConstants.TASK_DEC_NUM, LayoutConstants.JAVA_HEIGHT)); + jButtonAdd.setBounds(taskPanel.getWidth() - LayoutConstants.TASK_LABEL_X, + LayoutConstants.NUMBER_Y, + LayoutConstants.BUTTON_HEIGHT, LayoutConstants.BUTTON_HEIGHT); + } + } + optionJPanelContent.add(chooseButton); + // 关闭选项卡事件 + taskPanelEvent.clickClose(this, taskPanel, taskPanelWelcome); + // 选择不同场景对应显示 + taskPanelEvent.pplyTunMouseListener(taskPanel, this); + taskPanelEvent.addSystemMouseListener(taskPanel, this); + // chooseButton按钮添加点击事件 + taskPanelEvent.applicationTuningClickListener(this); + // 监听taskPanel大小,将jTabbedPane大小于其联动 + taskPanelEvent.listenerTaskPanel(taskPanel, jButtonAdd); + // jButtonAdd事件添加配置页面 + // 点击不同场景,出现选择状态 + taskPanelEvent.sigleClick(this); + // 监听窗体大小改变组件位置 + taskPanelEvent.listenerWindow(taskPanel, this); + } + + /** + * 设置属性 + * + * @param taskPanel taskPanel + */ + public void setAttributes(JPanel taskPanel) { + if (taskPanel == null) { + return; + } + optionJPanelContent.setLayout(null); + // 设置背景不透明 + optionJPanelContent.setOpaque(true); + optionJPanelContent.setBackground(ColorConstants.SCROLL_PANE); + jPanelTabLabel.setOpaque(false); + jPanelTabLabel.setPreferredSize(new Dimension(LayoutConstants.JPA_LABEL_WIDTH, LayoutConstants.DEVICES_HEIGHT)); + jPanelLeft.setOpaque(false); + jPanelRight.setOpaque(false); + jPanelTabLabel.setLayout(new BorderLayout()); + jPanelLeft.setLayout(null); + jPanelRight.setLayout(new GridLayout()); + jPanelLeft.setPreferredSize(new Dimension(LayoutConstants.JP_LEFT_WIDTH, LayoutConstants.JP_LEFT_HEIGHT)); + jPanelRight.setPreferredSize(new Dimension(LayoutConstants.JP_RIGHT_WIDTH, LayoutConstants.JP_RIGHT_HEIGHT)); + jPanelTabLabel.add(jPanelLeft, BorderLayout.WEST); + jPanelTabLabel.add(jPanelRight, BorderLayout.CENTER); + // 给jPanelLeft添加标题 + jLabelSetting.setBounds(0, 0, LayoutConstants.JP_SET_WIDTH, LayoutConstants.JP_SET_HEIGHT); + jPanelLeft.add(jLabelSetting); + jPanelRight.add(jLabelClose); + jLabelClose.setHorizontalAlignment(JLabel.RIGHT); + jLabelIcon.setIcon(new ImageIcon(TaskPanel.class.getClassLoader() + .getResource("images/application_tuning.png"))); + jLabelIcon.setBounds(LayoutConstants.DEVICES_X, LayoutConstants.DESCRIPTION_NUMBER, LayoutConstants.HIGTHSCEECS, + LayoutConstants.HIGTHSCEECS); + jLabelTaskTun + .setBounds(LayoutConstants.JAVA_WIDTH, LayoutConstants.DESCRIPTION_NUMBER, LayoutConstants.APP_LABEL_WIDTH, + LayoutConstants.JLABEL_SIZE); + Font fontTaskTun = new Font(Font.DIALOG, Font.BOLD, LayoutConstants.TUN_LABEL_FONT); + jLabelTaskTun.setFont(fontTaskTun); + jLabelTaskTun.setForeground(Color.WHITE); + Font font = new Font(Font.DIALOG, Font.PLAIN, LayoutConstants.OPTION_FONT); + setButtonAttributter(font, taskPanel); + JPanel graphicsJpanel = new GraphicsJpanel(this); + graphicsJpanel.setBounds(0, LayoutConstants.WIDTHSUPEN, taskPanel.getWidth(), LayoutConstants.JAVA_WIDTH); + // Monitor window size changes to make graphicsJpanel size adaptive + taskPanelEvent.listenerGraphicsJpanel(graphicsJpanel, this); + optionJPanelContent.add(jLabelIcon); + optionJPanelContent.add(jLabelTaskTun); + optionJPanelContent.add(graphicsJpanel); + optionJPanelContent.add(traceButton); + } + + private void setButtonAttributter(Font font, JPanel taskPanel) { + chooseButton.setBounds(LayoutConstants.CHOSSE_X + (taskPanel.getWidth() - LayoutConstants.WINDOW_WIDTH), + LayoutConstants.CHOOSE_Y + (taskPanel.getHeight() - LayoutConstants.WINDOW_HEIGHT), + LayoutConstants.DEVICES_WIDTH, LayoutConstants.CHOOSE_HEIGHT); + chooseButton.setOpaque(true); + chooseButton.setBackground(ColorConstants.CHOOSE_BUTTON); + chooseButton.setFont(font); + chooseButton.setForeground(Color.WHITE); + traceButton.setFont(font); + traceButton.setOpaque(true); + traceButton.setBounds(LayoutConstants.TASK_SCENE_X, + LayoutConstants.CHOOSE_Y + (taskPanel.getHeight() - LayoutConstants.WINDOW_HEIGHT), + LayoutConstants.CHOOSE_WIDTH, LayoutConstants.CHOOSE_HEIGHT); + traceButton.setBackground(ColorConstants.CHOOSE_BUTTON); + traceButton.setForeground(Color.WHITE); + traceButton.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + super.mouseClicked(mouseEvent); + showFileOpenDialog(optionJPanelContent); + } + }); + } + + /** + * 打开trace文件 + * + * @param parent parent + */ + private void showFileOpenDialog(JPanel parent) { + JFileChooser fileChooser = new JFileChooser(); + if (StringUtils.isNotBlank(Constant.path)) { + fileChooser.setCurrentDirectory(new File(Constant.path)); + } else { + fileChooser.setCurrentDirectory(new File(".")); + } + UIManager.put("FileChooser.cancelButtonText", "Cancel"); + fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); + fileChooser.setMultiSelectionEnabled(false); + fileChooser.removeChoosableFileFilter(fileChooser.getAcceptAllFileFilter()); + fileChooser.setDialogTitle("Select a Trace File"); + fileChooser.setApproveButtonText("Open"); + fileChooser.setControlButtonsAreShown(false); + SampleDialogWrapper sampleDialog = new SampleDialogWrapper("Select a Trace File", fileChooser); + boolean flag = sampleDialog.showAndGet(); + if (flag) { + if (fileChooser.getSelectedFile() == null || fileChooser.getSelectedFile().isDirectory()) { + new SampleDialogWrapper("Prompt", "Please select the trace file !").show(); + return; + } + jProgressBar = new TransferringWindow(parent); + // 移除按钮显示滚动条 + parent.remove(chooseButton); + parent.remove(traceButton); + // 监听JProgressBar的大小 + parent.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent event) { + super.componentResized(event); + jProgressBar.setBounds(LayoutConstants.TEN, parent.getHeight() - LayoutConstants.FORTY, + parent.getWidth() - LayoutConstants.TWENTY, LayoutConstants.THIRTY); + } + }); + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + loadOfflineFile(parent, TaskPanel.this, fileChooser, optionJPanel); + } + }); + } + } + + /** + * 加载离线文件 + * + * @param optionJPanelContent optionJPanelContent + * @param taskPanel taskPanel + * @param fileChooser fileChooser + * @param optionJPanel optionJPanel + */ + private void loadOfflineFile(JPanel optionJPanelContent, TaskPanel taskPanel, JFileChooser fileChooser, + JPanel optionJPanel) { + SwingWorker, Object> task = new SwingWorker, Object>() { + /** + * doInBackground + * + * @return Optional + * @throws Exception Exception + */ + @Override + protected Optional doInBackground() throws Exception { + File file = fileChooser.getSelectedFile(); + Constant.path = fileChooser.getCurrentDirectory().getPath(); + Optional deviceProcessInfo = + SessionManager.getInstance().localSessionDataFromFile(jProgressBar, file); + return deviceProcessInfo; + } + + /** + * done + */ + @Override + protected void done() { + Optional deviceProcessInfo = null; + try { + deviceProcessInfo = get(); + } catch (InterruptedException | ExecutionException exception) { + exception.printStackTrace(); + } + if (deviceProcessInfo != null && deviceProcessInfo.isPresent()) { + DeviceProcessInfo deviceInfo = deviceProcessInfo.get(); + HosJLabel hosJLabel = new HosJLabel(); + hosJLabel.setProcessName(deviceInfo.getProcessName()); + hosJLabel.setSessionId(deviceInfo.getLocalSessionId()); + hosJLabel.setDeviceName(deviceInfo.getDeviceName()); + hosJLabel.setDeviceType(true); + hosJLabel.setStartTime(deviceInfo.getStartTime()); + hosJLabel.setEndTime(deviceInfo.getEndTime()); + List hosJLabels = new ArrayList(); + hosJLabels.add(hosJLabel); + optionJPanel.removeAll(); + TaskScenePanelChart taskScenePanelChart = new TaskScenePanelChart(taskPanel, hosJLabels); + TaskPanel.this.setLocalSessionId(deviceInfo.getLocalSessionId()); + optionJPanel.add(taskScenePanelChart); + } else { + loadSystemTurningFile(optionJPanelContent, fileChooser, optionJPanel); + return; + } + } + }; + task.execute(); + } + + /** + * load systrace file + * + * @param optionJPanelContent optionJPanelContent + * @param fileChooser fileChooser + * @param optionJPanel optionJPanel + */ + private void loadSystemTurningFile(JPanel optionJPanelContent, JFileChooser fileChooser, JPanel optionJPanel) { + SwingWorker task = new SwingWorker() { + @Override + protected String doInBackground() throws Exception { + File directory = new File(""); + traceAnalysisResult = true; + String courseFile = directory.getCanonicalPath(); + String pluginPath = SessionManager.getInstance().getPluginPath(); + String logPath = pluginPath + "trace_streamer/trace_streamer.log"; + File logFile = new File(logPath); + if (logFile.exists()) { + logFile.delete(); + } + // 将数据源转为db文件 + String baseDir = pluginPath + "trace_streamer\\"; + String dbPath = baseDir + "systrace.db"; + File file = fileChooser.getSelectedFile(); + String[] cmd = {baseDir + "trace_streamer.exe", file.getPath(), "-e", dbPath}; + HdcWrapper.getInstance().getHdcStringArrayResult(cmd); + // 获取.log日志(存放在根目录) + randomFile(logFile); + jProgressBar.setValue(LayoutConstants.FIFTY); + return dbPath; + } + + /** + * done + */ + @Override + protected void done() { + if (!traceAnalysisResult) { + optionJPanelContent.remove(jProgressBar); + optionJPanelContent.add(chooseButton); + optionJPanelContent.add(traceButton); + optionJPanelContent.repaint(); + new SampleDialogWrapper("Warring", + "The system cannot parse the file properly. Please import the legal file.").show(); + } + try { + if (traceAnalysisResult) { + String dbPath = get(); + optionJPanel.removeAll(); + AnalystPanel component = new AnalystPanel(); + component.load(dbPath, true); + jProgressBar.setValue(LayoutConstants.HUNDRED); + optionJPanel.add(component); + } + } catch (Exception exception) { + LOGGER.error("loadSystemTurningFile exception:{}", exception.getMessage()); + } + } + }; + task.execute(); + } + + /** + * random File + * + * @param logFile log File + * @throws IOException IOException + */ + private void randomFile(File logFile) throws IOException { + RandomAccessFile randomFile = null; + try { + if (logFile.exists()) { + randomFile = new RandomAccessFile(logFile, "r"); + String tmp = null; + while ((tmp = randomFile.readLine()) != null) { + if (Integer.valueOf(tmp.split(":")[1]) != 0) { + traceAnalysisResult = false; + } + } + } + } catch (FileNotFoundException fileNotFoundException) { + LOGGER.error("randomFile exception:{}", fileNotFoundException.getMessage()); + } catch (IOException iOException) { + LOGGER.error("randomFile exception:{}", iOException.getMessage()); + } finally { + if (randomFile != null) { + randomFile.close(); + } + } + } + + /** + * 新建描述图标 + * + * @param jButtonApplyTun jButtonApplyTun + * @param jButtonSystemTun jButtonSystemTun + * @param jButtonHadoop jButtonHadoop + */ + public void taskLabel(JLabel jButtonApplyTun, JLabel jButtonSystemTun, JLabel jButtonHadoop) { + if (jButtonApplyTun == null || jButtonSystemTun == null || jButtonHadoop == null) { + return; + } + // 新建描述图标 + JLabel jLabelRealTimeTaskZhu = new JLabel("Task scene"); + jLabelRealTimeTaskZhu.setForeground(Color.white); + JLabel jLabelRealTimeTaskCi = new JLabel("Choose the most suitable scene."); + Font fontZhu = new Font(Font.DIALOG, Font.BOLD, LayoutConstants.TASK_FONT); + Font fontCi = new Font(Font.DIALOG, Font.PLAIN, LayoutConstants.APP_BUT_FONT); + jLabelRealTimeTaskZhu.setFont(fontZhu); + jLabelRealTimeTaskCi.setFont(fontCi); + jLabelRealTimeTaskCi.setForeground(ColorConstants.BORDER_COLOR); + jLabelRealTimeTaskZhu + .setBounds(LayoutConstants.TASK_SCENE_X, LayoutConstants.TASK_SCENE_Y, LayoutConstants.TASK_WIDTH, + LayoutConstants.TASK_HEIGHT); + jLabelRealTimeTaskCi + .setBounds(LayoutConstants.CH_TASK_X, LayoutConstants.CH_TASK_Y, LayoutConstants.CH_TASK_WIDTH, + LayoutConstants.CH_TASK_HEIGHT); + jButtonApplyTun + .setBounds(LayoutConstants.APP_BUT_X, LayoutConstants.APP_BUT_Y, LayoutConstants.TWO_HUNDRED_EIGHTEEN, + LayoutConstants.HUNDRED_FIFTY_FIVE); + jButtonApplyTun.setText("Application tuning"); + Font fontAll = new Font(Font.DIALOG, Font.BOLD, LayoutConstants.APP_BUT_FONT); + jButtonApplyTun.setFont(fontAll); + jButtonApplyTun.setOpaque(true); + jButtonApplyTun.setVerticalTextPosition(JLabel.BOTTOM); + jButtonApplyTun.setHorizontalTextPosition(JLabel.CENTER); + jButtonApplyTun.setBackground(ColorConstants.APPLYTUN_COLOR); + jButtonSystemTun.setBounds(LayoutConstants.LABEL_NAME_WIDTH, LayoutConstants.SYS_BUT_Y, + LayoutConstants.TWO_HUNDRED_EIGHTEEN, LayoutConstants.HUNDRED_FIFTY_FIVE); + jButtonSystemTun.setText("System tuning"); + jButtonSystemTun.setFont(fontAll); + jButtonSystemTun.setOpaque(true); + jButtonSystemTun.setVerticalTextPosition(JLabel.BOTTOM); + jButtonSystemTun.setHorizontalTextPosition(JLabel.CENTER); + jButtonSystemTun.setBackground(ColorConstants.SYSTEM_COLOR); + jButtonHadoop + .setBounds(LayoutConstants.EMB_BUT_X, LayoutConstants.EMB_BUT_Y, LayoutConstants.TWO_HUNDRED_EIGHTEEN, + LayoutConstants.HUNDRED_FIFTY_FIVE); + jButtonHadoop.setText("Embrace scene"); + jButtonHadoop.setFont(fontAll); + jButtonHadoop.setOpaque(true); + jButtonHadoop.setVerticalTextPosition(JLabel.BOTTOM); + jButtonHadoop.setHorizontalTextPosition(JLabel.CENTER); + jButtonHadoop.setBackground(ColorConstants.SYSTEM_COLOR); + optionJPanelContent.add(jLabelRealTimeTaskZhu); + optionJPanelContent.add(jLabelRealTimeTaskCi); + optionJPanelContent.add(jButtonApplyTun); + optionJPanelContent.add(jButtonSystemTun); + } + + public JLabel getJLabelClose() { + return jLabelClose; + } + + public JPanel getJPanelTabLabel() { + return jPanelTabLabel; + } + + public JLabel getJLabelTaskTun() { + return jLabelTaskTun; + } + + public JLabel getChooseButton() { + return chooseButton; + } + + public JLabel getJButtonApplyTun() { + return jButtonApplyTun; + } + + public JLabel getJButtonSystemTun() { + return jButtonSystemTun; + } + + public JLabel getJButtonHadoop() { + return jButtonHadoop; + } + + public JPanel getOptionJPanel() { + return optionJPanel; + } + + public JPanel getOptionJPanelContent() { + return optionJPanelContent; + } + + public JLabel getJLabelSetting() { + return jLabelSetting; + } + + public JPanel getJPanelRight() { + return jPanelRight; + } + + public JPanel getJPanelLeft() { + return jPanelLeft; + } + + public JButton getJButtonAdd() { + return jButtonAdd; + } + + public void setjButtonAdd(JButton jButtonAdd) { + this.jButtonAdd = jButtonAdd; + } + + public JLabel getjLabelIcon() { + return jLabelIcon; + } + + public JLabel getTraceButton() { + return traceButton; + } + + public void setLocalSessionId(Long localSessionId) { + this.localSessionId = localSessionId; + } + + public Long getLocalSessionId() { + return localSessionId; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskPanelWelcome.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskPanelWelcome.java new file mode 100644 index 000000000..c888fabde --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskPanelWelcome.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.event.TaskPanelWelcomeEvent; + +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; + +/** + * 二级欢迎界面 + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class TaskPanelWelcome extends JPanel { + /** + * 新建实时任务按钮 + */ + private static JLabel jNewButton = new JLabel("+ New Task", JLabel.CENTER); + + /** + * 新建按钮区域背景面板 + */ + private static JPanel colorJPanel = new JPanel(null); + + /** + * 欢迎页面面板 + */ + private static JPanel welcomeJPanel = new JPanel(new BorderLayout()); + + /** + * 欢迎语 + */ + private static JLabel jLabelWelcome = new JLabel("

Welcome HosProfiler


Click New Sessions Bu!on to process or load a capture.

", JLabel.CENTER); + + private TaskPanelWelcomeEvent taskPanelWelcomeEvent = new TaskPanelWelcomeEvent(); + + public TaskPanelWelcome() { + // 添加新建按钮背景面板和欢迎页面面板 + this.setLayout(new BorderLayout()); + this.add(colorJPanel, BorderLayout.NORTH); + this.add(welcomeJPanel, BorderLayout.CENTER); + // 设置新建按钮背景面板大小和颜色 + colorJPanel.setPreferredSize(new Dimension(LayoutConstants.DEVICES_WIDTH, LayoutConstants.DEVICE_WIDTH)); + colorJPanel.setBackground(ColorConstants.TOP_COLOR); + // 将新建按钮添加进背景面板和欢迎图片标语添加进欢迎面板 + jNewButton.setOpaque(true); + jNewButton.setBounds(LayoutConstants.MEMORY_X_TESTING, LayoutConstants.MEMORY_Y, LayoutConstants.JP_LEFT_WIDTH, + LayoutConstants.CON_BOX_Y); + Font font = new Font(Font.DIALOG, Font.PLAIN, LayoutConstants.SYSTEM_TUNNING_LABEL_FONT); + jNewButton.setFont(font); + jNewButton.setBackground(ColorConstants.CENTER_COLOR); + jNewButton.setForeground(Color.white); + colorJPanel.add(jNewButton); + jLabelWelcome.setIcon(new ImageIcon(TaskPanelWelcome.class.getClassLoader().getResource("images/pic.png"))); + jLabelWelcome.setVerticalTextPosition(JLabel.BOTTOM); + jLabelWelcome.setHorizontalTextPosition(JLabel.CENTER); + welcomeJPanel.setBackground(ColorConstants.CENTER_COLOR); + welcomeJPanel.add(jLabelWelcome); + // +号新建实时任务按钮事件 + taskPanelWelcomeEvent.clickAddTask(this); + } + + /** + * 获取JNewButton按钮 + * + * @return JButton + */ + public JLabel getJNewButton() { + return jNewButton; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskScenePanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskScenePanel.java new file mode 100644 index 000000000..e3436d1b2 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskScenePanel.java @@ -0,0 +1,402 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.event.TaskScenePanelEvent; + +import javax.swing.BorderFactory; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; + +/** + * 三级场景界面 + * + * @version 1.0 + * @date 2021/02/27 11:11 + **/ +public class TaskScenePanel extends JPanel { + /** + * 三级界面边框布局管理器,top容器 + */ + private JPanel jPanelNorth = new JPanel(null); + + /** + * 三级界面边框布局管理器,Center容器 + */ + private JPanel jPanelCenter = new JPanel(new BorderLayout()); + + /** + * 三级界面边框布局管理器,South容器 + */ + private JPanel jPanelSouth = new JPanel(null); + + /** + * top容器中文本描述 + */ + private JLabel jLabelTaskTun = new JLabel("Devices & Applications"); + + /** + * top容器中文本描述 + */ + private JLabel jLabelDeviceSet = new JLabel("Task scene: Application tuning"); + + /** + * Center容器中,左边容器 + */ + private JPanel jPanelCenterWest = new JPanel(new BorderLayout()); + + /** + * Center容器中,右边容器 + */ + private JPanel jPanelCenterRight = new JPanel(null); + + /** + * Center容器中,Monitor Items页面复选框容器 + */ + private JPanel jPanelRightMemory = new JPanel(null); + + /** + * Monitor Items页面复选框存放数组 + */ + private JCheckBox[] jCheckBoxs = new JCheckBox[LayoutConstants.INDEX_SEVEN]; + + /** + * 三级页面事件类 + */ + private TaskScenePanelEvent taskScenePanelEvent = new TaskScenePanelEvent(); + + /** + * Center容器左边部分边框布局top容器 + */ + private JPanel jPanelCenterWestTop = new JPanel(new BorderLayout()); + + /** + * Center容器左边部分边框布局center容器 + */ + private JPanel jPanelCenterWestCenter = new JPanel(new BorderLayout()); + + /** + * Center容器左边部分边框布局center容器中左边容器,用于布局按钮位置 + */ + private JPanel jPanelCenterWestCenterLeft = new JPanel(); + + /** + * Center容器左边部分边框布局center容器中右边容器,用于添加 Add Device按钮 + */ + private JPanel jPanelCenterWestCenterRight = new JPanel(null); + + /** + * Add Device按钮,添加设备 + */ + private JLabel jButtonAddDevice = new JLabel("Add Device", JLabel.CENTER); + + /** + * Monitor Items页面复选框内容 + */ + private JLabel jLabelMemory = new JLabel("Memory"); + private JCheckBox checkBoxSelectAll = new JCheckBox("Select All"); + private JCheckBox checkBoxMemoryJava = new JCheckBox("Java"); + private JCheckBox checkBoxGpuMemoryNative = new JCheckBox("Native"); + private JCheckBox checkBoxGraphics = new JCheckBox("Graphics"); + private JCheckBox checkBoxStack = new JCheckBox("Stack"); + private JCheckBox checkBoxCode = new JCheckBox("Code"); + private JCheckBox checkBoxOthers = new JCheckBox("Others"); + + /** + * Center容器中,左边布局滚动条容器 + */ + private JPanel scrollPane = new JPanel(null); + + /** + * 返回上一页按钮 + */ + private JLabel jButtonLastStep = new JLabel("Last Step", JLabel.CENTER); + + /** + * 开始任务按钮 + */ + private JLabel jButtonStartTask = new JLabel("Start Task", JLabel.CENTER); + + private JScrollPane jScrollPane = + new JScrollPane(scrollPane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + + private DeviceProcessJpanel deviceProcessJpanel; + + /** + * Task Scene Panel + */ + public TaskScenePanel() { + } + + /** + * TaskScenePanel + * + * @param jTaskPanel jTaskPanel + */ + public TaskScenePanel(TaskPanel jTaskPanel) { + // 设置三级界面布局方式为边框布局管理 + this.setLayout(new BorderLayout()); + // 设置top容器,Center容器,South容器的属性 + setAttributes(); + // 给Center容器分为左右边框布局 + setBorderLeftRight(); + // Center容器左边部分分为上下边框布局 + setBorderTopCenter(); + // 三级页面中Monitor Items页面设置 + setJPanelCenterRight(); + // 添加复选框 + addCheckBox(); + // South容器设置 + setJPanelSouth(jTaskPanel); + } + + /** + * SouthContainer settings + * + * @param jTaskPanel jTaskPanel + */ + public void setJPanelSouth(TaskPanel jTaskPanel) { + Font font = new Font(Font.DIALOG, Font.PLAIN, LayoutConstants.OPTION_FONT); + jButtonLastStep.setFont(font); + jButtonLastStep.setBorder(BorderFactory.createLineBorder(ColorConstants.BORDER_COLOR)); + jButtonLastStep.setOpaque(true); + jButtonLastStep.setBounds(LayoutConstants.NUMBER_STEP + (jPanelSouth.getWidth() - LayoutConstants.WINDOW_WIDTH), + LayoutConstants.JP_LABEL_HEIGHT, LayoutConstants.JP_LEFT_WIDTH, LayoutConstants.DEVICE_X); + jButtonLastStep.setBackground(ColorConstants.CENTER_COLOR); + jButtonStartTask.setForeground(Color.white); + jButtonStartTask.setOpaque(true); + jButtonStartTask + .setBounds(LayoutConstants.POSITION_TASK_X + (jPanelSouth.getWidth() - LayoutConstants.WINDOW_WIDTH), + LayoutConstants.JP_LABEL_HEIGHT, LayoutConstants.JP_LEFT_WIDTH, LayoutConstants.DEVICE_X); + jButtonStartTask.setBackground(ColorConstants.CHOOSE_BUTTON); + jButtonStartTask.setFont(font); + jPanelSouth.add(jButtonLastStep); + jPanelSouth.add(jButtonStartTask); + // 监听jPanelSouth大小变化并改变按钮位置 + taskScenePanelEvent.listenerJPanelSouth(this); + // jButtonLastStep添加事件返回上一页 + taskScenePanelEvent.lastStep(this, jTaskPanel); + // jButtonStartTask添加事件开始任务 + taskScenePanelEvent.startTask(this, jTaskPanel); + } + + /** + * Center容器左边部分分为边框布局上下两个部分 + */ + public void setBorderTopCenter() { + scrollPane.setBackground(ColorConstants.SCROLL_PANE); + jScrollPane.setBorder(null); + // 设置鼠标滚轮速度 + jScrollPane.getVerticalScrollBar().setUnitIncrement(LayoutConstants.SCROLL_UNIT_INCREMENT); + jPanelCenterWest.add(jScrollPane); + // Add Device按钮事件 + taskScenePanelEvent.clickAddDevice(this, taskScenePanelEvent); + deviceProcessJpanel = new DeviceProcessJpanel(taskScenePanelEvent, scrollPane, this); + scrollPane.add(deviceProcessJpanel); + } + + /** + * Monitor Items页面,添加复选框 + */ + public void addCheckBox() { + jCheckBoxs[LayoutConstants.INDEX_ZERO] = checkBoxSelectAll; + jCheckBoxs[LayoutConstants.INDEX_ONE] = checkBoxMemoryJava; + jCheckBoxs[LayoutConstants.INDEX_TWO] = checkBoxGpuMemoryNative; + jCheckBoxs[LayoutConstants.INDEX_THREE] = checkBoxGraphics; + jCheckBoxs[LayoutConstants.INDEX_FOUR] = checkBoxStack; + jCheckBoxs[LayoutConstants.INDEX_FIVE] = checkBoxCode; + jCheckBoxs[LayoutConstants.INDEX_SIX] = checkBoxOthers; + // 默认全选 + checkBoxSelectAll.setSelected(true); + checkBoxMemoryJava.setSelected(true); + checkBoxGpuMemoryNative.setSelected(true); + checkBoxGraphics.setSelected(true); + checkBoxStack.setSelected(true); + checkBoxCode.setSelected(true); + checkBoxOthers.setSelected(true); + jLabelMemory.setBounds(LayoutConstants.MEMORY_X, LayoutConstants.MEMORY_Y, LayoutConstants.MEMORY_WIDTH, + LayoutConstants.MEMORY_HEIGHT); + checkBoxSelectAll + .setBounds(LayoutConstants.SELECT_ALL_X, LayoutConstants.SELECT_ALL_Y, LayoutConstants.SELECT_ALL_WIDTH, + LayoutConstants.SELECT_ALL_HEIGHT); + checkBoxMemoryJava.setBounds(LayoutConstants.JAVA_X, LayoutConstants.JAVA_Y, LayoutConstants.JAVA_WIDTH, + LayoutConstants.JAVA_HEIGHT); + checkBoxGpuMemoryNative + .setBounds(LayoutConstants.NATIVE_X, LayoutConstants.NATIVE_Y, LayoutConstants.NATIVE_WIDTH, + LayoutConstants.NATIVE_HEIGHT); + checkBoxGraphics + .setBounds(LayoutConstants.GRAPHICS_X, LayoutConstants.GRAPHICS_Y, LayoutConstants.GRAPHICS_WIDTH, + LayoutConstants.GRAPHICS_HEIGHT); + checkBoxStack.setBounds(LayoutConstants.STACK_X, LayoutConstants.STACK_Y, LayoutConstants.STACK_WIDTH, + LayoutConstants.STACK_HEIGHT); + checkBoxCode.setBounds(LayoutConstants.CODE_X, LayoutConstants.CODE_Y, LayoutConstants.CODE_WIDTH, + LayoutConstants.CODE_HEIGHT); + checkBoxOthers.setBounds(LayoutConstants.OTHERS_X, LayoutConstants.OTHERS_Y, LayoutConstants.OTHERS_WIDTH, + LayoutConstants.OTHERS_HEIGHT); + jPanelRightMemory.add(jLabelMemory); + jPanelRightMemory.add(checkBoxSelectAll); + jPanelRightMemory.add(checkBoxMemoryJava); + jPanelRightMemory.add(checkBoxGpuMemoryNative); + jPanelRightMemory.add(checkBoxGraphics); + jPanelRightMemory.add(checkBoxStack); + jPanelRightMemory.add(checkBoxCode); + jPanelRightMemory.add(checkBoxOthers); + // 复选框选中事件 + taskScenePanelEvent.checkBoxSelect(this); + } + + /** + * 三级页面中Monitor Items页面设置 + */ + public void setJPanelCenterRight() { + JPanel jPanelRightTop = new JPanel(null); + jPanelRightTop.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jPanelRightTop.setBounds(LayoutConstants.MONITOR_PANEL_X, LayoutConstants.MONITOR_PANEL_Y, + LayoutConstants.MONITOR_PANEL_WIDTH, LayoutConstants.MONITOR_PANEL_HEIGHT); + JLabel jLabel = new JLabel("Monitor Items"); + Font fontTaskTun = new Font(Font.DIALOG, Font.BOLD, LayoutConstants.MONITOR_BUN_FONT); + jLabel.setFont(fontTaskTun); + jLabel.setForeground(Color.WHITE); + jLabel + .setBounds(LayoutConstants.MONITOR_BUN_X, LayoutConstants.MONITOR_BUN_Y, LayoutConstants.MONITOR_BUN_WIDTH, + LayoutConstants.MONITOR_BUN_HEIGHT); + jPanelRightTop.add(jLabel); + jPanelRightMemory + .setBounds(LayoutConstants.MONITOR_OPT_X, LayoutConstants.MONITOR_OPT_Y, LayoutConstants.MONITOR_OPT_WIDTH, + LayoutConstants.MONITOR_OPT_HEIGHT); + jPanelRightMemory.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jPanelCenterRight.add(jPanelRightTop); + jPanelCenterRight.add(jPanelRightMemory); + + // 设置背景色 + checkBoxSelectAll.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + checkBoxMemoryJava.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + checkBoxGpuMemoryNative.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + checkBoxGraphics.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + checkBoxStack.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + checkBoxCode.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + checkBoxOthers.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + } + + /** + * 给Center容器分为左右边框布局 + */ + public void setBorderLeftRight() { + jPanelCenterWest.setOpaque(false); + jPanelCenterRight.setOpaque(false); + jPanelCenterWest + .setPreferredSize(new Dimension(LayoutConstants.WEST_LABEL_WIDTH, LayoutConstants.WEST_LABEL_HEIGHT)); + jPanelCenterRight + .setPreferredSize(new Dimension(LayoutConstants.EAST_LABEL_WIDTH, LayoutConstants.EAST_LABEL_HEIGHT)); + jPanelCenter.add(jPanelCenterWest, BorderLayout.WEST); + jPanelCenter.add(jPanelCenterRight, BorderLayout.CENTER); + } + + /** + * 设置top容器,Center容器,South容器的属性 + */ + public void setAttributes() { + jPanelNorth.setOpaque(true); + jPanelNorth.setBackground(ColorConstants.TOP_PANEL); + jPanelCenter.setOpaque(true); + jPanelCenter.setBackground(ColorConstants.TOP_PANEL); + jPanelSouth.setOpaque(true); + jPanelSouth.setBackground(ColorConstants.TOP_PANEL); + jPanelNorth.setPreferredSize(new Dimension(LayoutConstants.TOP_SOUTH_WIDTH, LayoutConstants.TOP_SOUTH_HEIGHT)); + jPanelSouth.setPreferredSize(new Dimension(LayoutConstants.TOP_SOUTH_WIDTH, LayoutConstants.TOP_SOUTH_HEIGHT)); + this.add(jPanelNorth, BorderLayout.NORTH); + this.add(jPanelCenter, BorderLayout.CENTER); + this.add(jPanelSouth, BorderLayout.SOUTH); + jLabelTaskTun + .setBounds(LayoutConstants.TASK_LABEL_X, LayoutConstants.TASK_LABEL_Y, LayoutConstants.TASK_LABEL_WIDTH, + LayoutConstants.TASK_LABEL_HEIGHT); + Font fontTaskTun = new Font(Font.DIALOG, Font.BOLD, LayoutConstants.TASK_LABEL_FONT); + jLabelTaskTun.setFont(fontTaskTun); + jLabelTaskTun.setForeground(Color.WHITE); + jPanelNorth.add(jLabelTaskTun); + Font fontDeviceSet = new Font(Font.DIALOG, Font.BOLD, LayoutConstants.TASK_DEC_FONT); + jLabelDeviceSet.setFont(fontDeviceSet); + jLabelDeviceSet.setForeground(ColorConstants.BORDER_COLOR); + jLabelDeviceSet + .setBounds(LayoutConstants.TASK_DEC_X, LayoutConstants.TASK_DEC_Y, LayoutConstants.TASK_DEC_WIDTH, + LayoutConstants.TASK_DEC_HEIGHT); + jPanelNorth.add(jLabelDeviceSet); + } + + public JCheckBox getCheckBoxSelectAll() { + return checkBoxSelectAll; + } + + public JCheckBox getCheckBoxMemoryJava() { + return checkBoxMemoryJava; + } + + public JCheckBox getCheckBoxGpuMemoryNative() { + return checkBoxGpuMemoryNative; + } + + public JCheckBox getCheckBoxGraphics() { + return checkBoxGraphics; + } + + public JCheckBox getCheckBoxStack() { + return checkBoxStack; + } + + public JCheckBox getCheckBoxCode() { + return checkBoxCode; + } + + public JCheckBox getCheckBoxOthers() { + return checkBoxOthers; + } + + public JLabel getJButtonAddDevice() { + return jButtonAddDevice; + } + + public JPanel getScrollPane() { + return scrollPane; + } + + public JPanel getJPanelSouth() { + return jPanelSouth; + } + + public JLabel getJButtonLastStep() { + return jButtonLastStep; + } + + public JLabel getJButtonStartTask() { + return jButtonStartTask; + } + + public JCheckBox[] getJCheckBoxs() { + return jCheckBoxs; + } + + public DeviceProcessJpanel getDeviceProcessJpanel() { + return deviceProcessJpanel; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskScenePanelChart.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskScenePanelChart.java new file mode 100644 index 000000000..c8cd32766 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskScenePanelChart.java @@ -0,0 +1,736 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.hoscomp.HosJButton; +import ohos.devtools.views.common.hoscomp.HosJComboBox; +import ohos.devtools.views.common.hoscomp.HosJLabel; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.event.TaskScenePanelChartEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JSplitPane; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.util.List; +import java.awt.LayoutManager; + +import static ohos.devtools.views.common.ProfilerMonitorItem.MEMORY; +import static ohos.devtools.views.common.ViewConstants.NUM_1000; +import static ohos.devtools.views.common.ViewConstants.NUM_4; + +/** + * chart监测页面三级容器 + * + * @version 1.0 + * @date 2021/03/02 + **/ +public class TaskScenePanelChart extends JPanel { + private static final Logger LOGGER = LogManager.getLogger(TaskScenePanelChart.class); + private Component add; + + /** + * Task Scene Panel Chart + */ + public TaskScenePanelChart() { + } + + /** + * 整体页面top容器 + */ + private JPanel panelTop = new JPanel(new BorderLayout()); + + /** + * 整体页面center容器 + */ + private JPanel panelMiddle = new JPanel(new BorderLayout()); + + /** + * 整体页面Bottom容器 + */ + private JPanel panelBottom = new JPanel(new BorderLayout()); + + /** + * panelTop中,west容器 + */ + private JPanel jPanelWest = new JPanel(); + + /** + * panelTop中,Center容器 + */ + private JPanel jPanelCenter = new JPanel(); + + /** + * panelTop中,East容器 + */ + private JPanel jPanelEast = new JPanel(); + + /** + * 选项卡标签命名 + */ + private JLabel jLabelSetting = new JLabel(); + + /** + * 停止按钮 + */ + private HosJButton jButtonRun = new HosJButton( + new ImageIcon(TaskScenePanelChart.class.getClassLoader().getResource("images/button_record.png")), "停止任务"); + + /** + * 暂停按钮 + */ + private HosJButton jButtonStop = + new HosJButton(new ImageIcon(TaskScenePanelChart.class.getClassLoader().getResource("images/button_stop.png")), + "暂停任务"); + + /** + * 保存任务按钮 + */ + private HosJButton jButtonSave = + new HosJButton(new ImageIcon(TaskScenePanelChart.class.getClassLoader().getResource("images/button_save.png")), + "保存任务"); + + /** + * 删除任务按钮 + */ + private HosJButton jButtonDelete = new HosJButton( + new ImageIcon(TaskScenePanelChart.class.getClassLoader().getResource("images/button_delete.png")), "删除任务"); + + /** + * 新增配置项按钮 + */ + private HosJButton jButtonInsert = + new HosJButton(new ImageIcon(TaskScenePanelChart.class.getClassLoader().getResource("images/button_add.png")), + "新增配置项"); + + /** + * 向下扩展页面按钮 + */ + private HosJButton jButtonBottom = new HosJButton( + new ImageIcon(TaskScenePanelChart.class.getClassLoader().getResource("images/button_bottom_bar_grey.png")), + "向下扩展"); + + /** + * 帮助按钮 + */ + private HosJButton jButtonHelp = + new HosJButton(new ImageIcon(TaskScenePanelChart.class.getClassLoader().getResource("images/button_help.png")), + "帮助"); + + /** + * 向左扩展页面按钮 + */ + private HosJButton jButtonLeft = new HosJButton( + new ImageIcon(TaskScenePanelChart.class.getClassLoader().getResource("images/button_left_bar.png")), "向左扩展"); + + /** + * 切换上一页按钮 + */ + private HosJButton jButtonUp = + new HosJButton(new ImageIcon(TaskScenePanelChart.class.getClassLoader().getResource("images/left_grey.png")), + "上一页"); + + /** + * 切换下一页按钮 + */ + private HosJButton jButtonNext = + new HosJButton(new ImageIcon(TaskScenePanelChart.class.getClassLoader().getResource("images/right_grey.png")), + "下一页"); + + /** + * Run xx of xx 信息文本 + */ + private JLabel jLabelMidde = new JLabel(); + + /** + * 00:24:27 chart计时容器 + */ + private JPanel jPanelLabel = new JPanel(new GridLayout()); + + /** + * 计时器文字显示 + */ + private JLabel jTextArea = new JLabel(); + + /** + * panelMiddle容器中左边容器 + */ + private JPanel jPanelMiddleLeft = new JPanel(); + + /** + * panelMiddle容器中右边容器 + */ + private JPanel jPanelMiddleRight = new JPanel(); + + /** + * panelMiddle容器分割线 + */ + private JSplitPane splitPane = new JSplitPane(); + + /** + * jPanelMiddleLeft容器子容器 + */ + private JPanel jScrollCardsPanel = new JPanel(new BorderLayout()); + + /** + * jScrollCardsPanel容器子容器 + */ + private JPanel jScrollCardsPanelInner = new JPanel(); + + /** + * jPanelMiddleLeft滚动条 + */ + private JScrollPane jScrollPane = new JScrollPane(jScrollCardsPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, + JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + + /** + * 卡片式布局的面板,用于多个chart页面 + */ + private JPanel cards = new JPanel(new CardLayout()); + + /** + * 卡片模型对象 + */ + private CardLayout cardLayout; + + /** + * 用于jPanelMiddleLeft布局和内容显示 + */ + private int number = 0; + + private int numberJlabel = 0; + + private TaskScenePanelChartEvent taskScenePanelChartEvent = new TaskScenePanelChartEvent(); + + private JLabel jLabelLeft = new JLabel(); + + private CountingThread counting; + + private ProfilerChartsView profilerView; + + /** + * 悬浮框 + */ + private JPanel jPanelSuspension = new JPanel(); + + private JPanel jpanelSupen = new JPanel(); + + private HosJComboBox jComboBox = new HosJComboBox(); + + private HosJComboBox timeJComboBox = new HosJComboBox(); + + /** + * getCardLayout + * + * @param cards cards + */ + private void getCardLayout(JPanel cards) { + if (cards != null) { + LayoutManager layout = cards.getLayout(); + if (layout instanceof CardLayout) { + cardLayout = (CardLayout) layout; + } + } + } + + /** + * chart监测页面三级容器 + * + * @param jTaskPanel jTaskPanel + * @param hosJLabelList hosJLabelList + */ + public TaskScenePanelChart(TaskPanel jTaskPanel, List hosJLabelList) { + getCardLayout(cards); + // 整体页面布局设置 + setLayAttributes(jTaskPanel, hosJLabelList); + // 设置按钮属性 + setButtonAttributes(); + // 布局panelTop容器,添加按钮 + setPanelTopAttributes(); + // 设置标签页标题滚动显示 + new DynamicThread().start(); + // 布局panelBigTwo中间容器 + panelMiddle.setLayout(new BorderLayout()); + // 创建页面分割事件 + createSplitPanel(); + // 布局jPanelMiddleLeft容器 + setScrollPane(); + jPanelMiddleRight.add(cards); + // 获取有多少个设备开始了任务,并循环设置 + int numberSum = hosJLabelList.size(); + int sum = 0; + setTaskLoop(numberSum, sum, hosJLabelList); + // 初始化绘图标准刻度间隔 + refreshTime(); + // 默认显示第一页 + cardLayout.show(cards, "card0"); + // 监听窗体大小使悬浮窗紧贴窗体 + taskScenePanelChartEvent.setSceneSize(jTaskPanel, this); + // 给删除按钮添加点击事件 + taskScenePanelChartEvent.clickDelete(this); + // 给上一个页面按钮,下一个页面按钮添加点击事件 + taskScenePanelChartEvent.clickUpAndNext(this); + // 给jButtonBottom按钮添加点击事件,向下放大页面 + taskScenePanelChartEvent.clickBottom(this, profilerView); + // 给jsplitPane添加监听事件 + taskScenePanelChartEvent.splitPaneChange(this, numberSum); + // 给jButtonLeft按钮添加点击事件,向左放大页面 + taskScenePanelChartEvent.clickLeft(this); + // 给jButton按钮添加点击时间,保存trace文件 + taskScenePanelChartEvent.clickSave(jButtonSave); + // memory配置项新增点击事件 + taskScenePanelChartEvent.clickConfig(this, profilerView); + // trace导入,不需要这些按钮 + if (hosJLabelList.get(0).getDeviceType()) { + jPanelWest.removeAll(); + } else { + // 开始计时 + counting = new CountingThread(jTextArea); + counting.start(); + } + // 刷新页面 + jTaskPanel.getOptionJPanel().repaint(); + } + + /** + * 创建表格 + * + * @param panelBottom panelBottom + * @param jTaskPanel jTaskPanel + */ + public void createTable(JPanel panelBottom, TaskPanel jTaskPanel) { + JButton jButtonSuspen = new JButton("悬浮框"); + panelBottom.add(jButtonSuspen); + taskScenePanelChartEvent.showSuspension(this, jTaskPanel, jButtonSuspen); + } + + private void refreshTime() { + long sessionId = jComboBox.getSessionId(); + ProfilerChartsView view = ProfilerChartsView.sessionMap.get(sessionId); + if (view != null) { + view.getObserver().getStandard().updateSizeTime(NUM_1000); + } + } + + /** + * chart display + * + * @param num num + * @param jcardsPanel jcardsPanel + * @param hosJLabel hosJLabel + */ + private void chartDisplay(int num, JPanel jcardsPanel, HosJLabel hosJLabel) { + // sessionId绑定按钮 + if (num == 0) { + jButtonRun.setSessionId(hosJLabel.getSessionId()); + jButtonStop.setSessionId(hosJLabel.getSessionId()); + jButtonSave.setSessionId(hosJLabel.getSessionId()); + jButtonSave.setDeviceName(hosJLabel.getDeviceName()); + jButtonSave.setProcessName(hosJLabel.getProcessName()); + jButtonDelete.setSessionId(hosJLabel.getSessionId()); + jButtonDelete.setDeviceName(hosJLabel.getDeviceName()); + jButtonDelete.setProcessName(hosJLabel.getProcessName()); + jButtonInsert.setSessionId(hosJLabel.getSessionId()); + jButtonBottom.setSessionId(hosJLabel.getSessionId()); + jButtonLeft.setSessionId(hosJLabel.getSessionId()); + jComboBox.setSessionId(hosJLabel.getSessionId()); + timeJComboBox.setSessionId(hosJLabel.getSessionId()); + } + // 判断是导入还是实时 + if (hosJLabel.getDeviceType()) { + // 添加chart + profilerView = new ProfilerChartsView(hosJLabel.getSessionId(), true, this); + jcardsPanel.add(profilerView); + profilerView.addMonitorItemView(MEMORY); + profilerView.getObserver().showTraceResult(hosJLabel.getStartTime(), hosJLabel.getEndTime()); + taskScenePanelChartEvent.clickZoomEvery(timeJComboBox, profilerView); + } else { + // 添加chart + profilerView = new ProfilerChartsView(hosJLabel.getSessionId(), false, this); + jcardsPanel.add(profilerView); + profilerView.addMonitorItemView(MEMORY); + // 显示Loading标识,等数据库初始化完成时再显示chart + profilerView.showLoading(); + taskScenePanelChartEvent.clickZoomEvery(timeJComboBox, profilerView); + // 给开始暂停按钮添加点击事件 + taskScenePanelChartEvent.clickRunAndStop(this, profilerView); + } + } + + /** + * Set PanelMidder container layout and content cyclically + * + * @param numberSum numberSum + * @param sum sum + * @param hosJLabelList hosJLabelList + */ + public void setTaskLoop(int numberSum, int sum, List hosJLabelList) { + int sumInt = sum; + for (int index = 0; index < numberSum; index++) { + sumInt += LayoutConstants.HEIGHT; + JPanel jcardsPanel = new JPanel(new BorderLayout()); + jcardsPanel.setOpaque(true); + HosJLabel hosJLabel = hosJLabelList.get(index); + // sessionId绑定按钮,判断是导入还是实时 + chartDisplay(index, jcardsPanel, hosJLabel); + // 显示设备进程名称 + HosJLabel jLabelRight = new HosJLabel( + "

" + hosJLabel.getProcessName() + "
" + "(" + hosJLabel + .getDeviceName() + ")" + "

"); + // 绑定sessionid,进程设备信息 + jLabelRight.setSessionId(hosJLabel.getSessionId()); + jLabelRight.setDeviceName(hosJLabel.getDeviceName()); + jLabelRight.setProcessName(hosJLabel.getProcessName()); + jLabelRight.setOpaque(true); + // 显示颜色 + JLabel jLabelLefts = new JLabel(); + // 判断显示具体颜色布局 + judge(index, jLabelLefts, jLabelRight); + // 每个设备进程信息用jpanel包围 + JPanel jMultiplePanel = new JPanel(new BorderLayout()); + jMultiplePanel.setBounds(0, number, LayoutConstants.HEIGHT_Y, LayoutConstants.HEIGHT); + number += LayoutConstants.HEIGHT; + numberJlabel += LayoutConstants.INDEX_THREE; + + jMultiplePanel.add(jLabelRight, BorderLayout.CENTER); + jScrollCardsPanelInner.add(jMultiplePanel); + cards.add(jcardsPanel, "card" + index); + // 存放点击选择的进程信息用于标签动态展示 + String jLabelSelect = hosJLabel.getProcessName() + "(" + hosJLabel.getDeviceName() + ")"; + // 给每个jpanel添加点击事件 + taskScenePanelChartEvent.clickEvery(this, jLabelRight, numberSum, jLabelSelect, jMultiplePanel); + } + if (sumInt > LayoutConstants.SCROPNUM) { + jScrollCardsPanelInner.setPreferredSize(new Dimension(LayoutConstants.HEIGHT_Y, sumInt)); + } + } + + /** + * Determine the specific color layout + * + * @param index index + * @param jLabelLeft jLabelLeft + * @param jLabelRight jLabelRight + */ + public void judge(int index, JLabel jLabelLeft, JLabel jLabelRight) { + if (index == 0) { + jLabelRight.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jLabelRight.setForeground(Color.WHITE); + jLabelRight.setPreferredSize(new Dimension(LayoutConstants.WIDTH, LayoutConstants.HEIGHT)); + jLabelLeft.setOpaque(true); + jLabelLeft.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jLabelLeft.setPreferredSize(new Dimension(LayoutConstants.DEVICE_ADD_X, LayoutConstants.HEIGHT)); + } else { + jLabelRight.setBackground(ColorConstants.SCROLL_PANE); + jLabelRight.setForeground(Color.gray); + jLabelRight.setPreferredSize(new Dimension(LayoutConstants.WIDTH, HEIGHT)); + jLabelLeft.setOpaque(true); + jLabelLeft.setBackground(ColorConstants.SCROLL_PANE); + jLabelLeft.setPreferredSize(new Dimension(LayoutConstants.DEVICE_ADD_X, LayoutConstants.HEIGHT)); + } + jLabelRight + .setIcon(new ImageIcon(TaskScenePanelChart.class.getClassLoader().getResource("images/icon_usb.png"))); + } + + /** + * 布局jPanelMiddleLeft容器 + */ + public void setScrollPane() { + jPanelMiddleLeft.setLayout(new BorderLayout()); + jScrollCardsPanelInner.setOpaque(true); + jScrollCardsPanelInner.setBackground(ColorConstants.BLACK_COLOR); + jScrollPane.setBorder(null); + jScrollPane.getVerticalScrollBar().setUnitIncrement(LayoutConstants.MEMORY_Y); + jScrollCardsPanel.add(jScrollCardsPanelInner); + jScrollCardsPanelInner.setPreferredSize(new Dimension(LayoutConstants.HEIGHT_Y, LayoutConstants.SCROPNUM)); + jPanelMiddleLeft.add(jScrollPane); + jScrollCardsPanelInner.setLayout(null); + } + + /** + * 创建页面分割事件 + */ + public void createSplitPanel() { + jPanelMiddleLeft.setMinimumSize(new Dimension(LayoutConstants.HEIGHT_Y, LayoutConstants.JAVA_WIDTH)); + jPanelMiddleRight.setMinimumSize(new Dimension(0, LayoutConstants.JAVA_WIDTH)); + + jpanelSupen.setPreferredSize(new Dimension(0, LayoutConstants.HUNDRED)); + jPanelMiddleLeft.setLayout(new GridLayout()); + jPanelMiddleRight.setLayout(new GridLayout()); + jPanelMiddleLeft.setOpaque(true); + jPanelMiddleRight.setOpaque(true); + jPanelMiddleLeft.setBackground(ColorConstants.BLACK_COLOR); + jPanelMiddleRight.setBackground(Color.white); + jPanelMiddleLeft.setPreferredSize(new Dimension(LayoutConstants.HEIGHT_Y, LayoutConstants.JAVA_WIDTH)); + // 让分割线显示出箭头 + splitPane.setOneTouchExpandable(false); + splitPane.setContinuousLayout(true); + // 设定分割线的距离左边的位置. + splitPane.setDividerLocation(LayoutConstants.HEIGHT_Y); + splitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT); + splitPane.setDividerSize(1); + splitPane.setLeftComponent(jPanelMiddleLeft); + splitPane.setRightComponent(jPanelMiddleRight); + panelMiddle.add(splitPane); + panelMiddle.add(jpanelSupen, BorderLayout.EAST); + } + + /** + * 使用内部类完成标签移动操作 + */ + private class DynamicThread extends Thread { + @Override + public void run() { + while (true) { + for (int index = 0; index < LayoutConstants.NUMBER_FOR; index++) { + try { + Thread.sleep(LayoutConstants.NUMBER_SLEEEP); + } catch (InterruptedException exception) { + LOGGER.error(exception.getMessage()); + } + jLabelSetting.setLocation(-index, 0); + } + } + } + } + + /** + * 布局panelTop容器,添加按钮 + */ + public void setPanelTopAttributes() { + timeJComboBox.setBorder(BorderFactory.createLineBorder(Color.black)); + timeJComboBox.setPreferredSize(new Dimension(LayoutConstants.SE_PANEL_Y_TWO, LayoutConstants.APP_LABEL_X)); + timeJComboBox.addItem("200ms"); + timeJComboBox.addItem("400ms"); + timeJComboBox.addItem("600ms"); + timeJComboBox.addItem("800ms"); + timeJComboBox.addItem("1000ms"); + timeJComboBox.setSelectedIndex(NUM_4); + jPanelWest.setLayout( + new FlowLayout(FlowLayout.LEADING, LayoutConstants.JP_LABEL_HEIGHT, LayoutConstants.JP_LABEL_HEIGHT)); + jPanelEast.setLayout( + new FlowLayout(FlowLayout.LEADING, LayoutConstants.JP_LABEL_HEIGHT, LayoutConstants.JP_LABEL_HEIGHT)); + jButtonRun.setPreferredSize(new Dimension(LayoutConstants.BUTTON_WIDTHS, LayoutConstants.BUTTON_SIZE)); + jButtonStop.setPreferredSize(new Dimension(LayoutConstants.BUTTON_WIDTHS, LayoutConstants.BUTTON_SIZE)); + jPanelWest.add(jButtonRun); + jPanelWest.add(jButtonStop); + jPanelWest.add(jButtonUp); + jPanelWest.add(jLabelMidde); + jPanelWest.add(jPanelLabel); + jPanelWest.add(jButtonNext); + jPanelWest.add(jButtonSave); + jPanelWest.add(jButtonDelete); + jPanelEast.add(timeJComboBox); + jPanelEast.add(jButtonInsert); + jPanelEast.add(jButtonBottom); + jPanelEast.add(jButtonLeft); + jPanelEast.add(jButtonHelp); + } + + /** + * 设置按钮属性 + */ + public void setButtonAttributes() { + jButtonUp.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jButtonUp.setFocusPainted(false); + jButtonUp.setBorderPainted(false); + jButtonUp.setToolTipText("上一页"); + jButtonNext.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jButtonNext.setFocusPainted(false); + jButtonNext.setBorderPainted(false); + jButtonNext.setToolTipText("下一页"); + jButtonRun.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jButtonRun.setFocusPainted(false); + jButtonRun.setBorderPainted(false); + jButtonRun.setToolTipText("停止"); + jButtonStop.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jButtonStop.setFocusPainted(false); + jButtonStop.setBorderPainted(false); + jButtonStop.setToolTipText("暂停"); + jButtonSave.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jButtonSave.setFocusPainted(false); + jButtonSave.setBorderPainted(false); + jButtonSave.setToolTipText("保存当前任务"); + jButtonDelete.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jButtonDelete.setFocusPainted(false); + jButtonDelete.setBorderPainted(false); + jButtonDelete.setToolTipText("删除当前任务"); + jButtonInsert.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jButtonInsert.setFocusPainted(false); + jButtonInsert.setBorderPainted(false); + jButtonInsert.setToolTipText("新增配置"); + jButtonBottom.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jButtonBottom.setFocusPainted(false); + jButtonBottom.setBorderPainted(false); + jButtonBottom.setToolTipText("向下展开页面"); + jButtonHelp.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jButtonHelp.setFocusPainted(false); + jButtonHelp.setBorderPainted(false); + jButtonHelp.setToolTipText("帮助"); + jButtonLeft.setBackground(ColorConstants.DEVICE_PROCESS_PANEL); + jButtonLeft.setFocusPainted(false); + jButtonLeft.setBorderPainted(false); + jButtonLeft.setToolTipText("向左展开页面"); + } + + /** + * Overall page layout settings + * + * @param jTaskPanel jTaskPanel + * @param hosJLabelList hosJLabelList + */ + public void setLayAttributes(TaskPanel jTaskPanel, List hosJLabelList) { + this.setLayout(new BorderLayout()); + panelTop.setBackground(ColorConstants.BLACK_COLOR); + panelTop.setPreferredSize(new Dimension(LayoutConstants.DEVICES_WIDTH, LayoutConstants.APP_LABEL_HIGHT)); + // 页面中间部分 + panelMiddle.setBackground(Color.white); + panelMiddle.setPreferredSize(new Dimension(LayoutConstants.DEVICES_WIDTH, LayoutConstants.JAVA_WIDTH)); + // 页面下面部分 + panelBottom.setBackground(ColorConstants.BLACK_COLOR); + panelBottom.setPreferredSize(new Dimension(LayoutConstants.DEVICES_WIDTH, LayoutConstants.LABEL_NAME_WIDTH)); + this.add(panelTop, BorderLayout.NORTH); + this.add(panelMiddle, BorderLayout.CENTER); + jPanelWest.setOpaque(false); + jPanelCenter.setOpaque(false); + jPanelEast.setOpaque(false); + jPanelWest.setPreferredSize(new Dimension(LayoutConstants.EAST_LABEL_WIDTH, LayoutConstants.LABEL_NAME_HEIGHT)); + jPanelCenter.setPreferredSize(new Dimension(LayoutConstants.DEVICES_WIDTH, LayoutConstants.LABEL_NAME_HEIGHT)); + jPanelEast.setPreferredSize(new Dimension(LayoutConstants.TASK_WIDTH, LayoutConstants.LABEL_NAME_HEIGHT)); + panelTop.add(jPanelWest, BorderLayout.WEST); + panelTop.add(jPanelCenter, BorderLayout.CENTER); + panelTop.add(jPanelEast, BorderLayout.EAST); + HosJLabel hosJLabel = hosJLabelList.get(0); + jLabelSetting = new JLabel(hosJLabel.getProcessName() + "(" + hosJLabel.getDeviceName() + ")"); + + jLabelSetting.setBounds(0, 0, LayoutConstants.EAST_LABEL_WIDTH, LayoutConstants.LABEL_NAME_HEIGHT); + jTaskPanel.getJPanelLeft().removeAll(); + jTaskPanel.getJPanelRight().removeAll(); + jTaskPanel.getJPanelLeft().add(jLabelSetting); + jTaskPanel.getJPanelRight().add(jTaskPanel.getJLabelClose()); + jTextArea.setOpaque(true); + jTextArea.setBackground(ColorConstants.BLACK_COLOR); + jPanelLabel.add(jTextArea); + } + + public HosJButton getJButtonDelete() { + return jButtonDelete; + } + + public HosJButton getjButtonRun() { + return jButtonRun; + } + + public HosJButton getjButtonStop() { + return jButtonStop; + } + + public HosJButton getjButtonSave() { + return jButtonSave; + } + + public HosJButton getjButtonInsert() { + return jButtonInsert; + } + + public HosJButton getjButtonBottom() { + return jButtonBottom; + } + + public JButton getjButtonHelp() { + return jButtonHelp; + } + + public HosJButton getjButtonLeft() { + return jButtonLeft; + } + + public JButton getjButtonUp() { + return jButtonUp; + } + + public JButton getjButtonNext() { + return jButtonNext; + } + + public JPanel getPanelBottom() { + return panelBottom; + } + + public JSplitPane getSplitPane() { + return splitPane; + } + + public JPanel getJScrollCardsPanelInner() { + return jScrollCardsPanelInner; + } + + public JLabel getjLabelLeft() { + return jLabelLeft; + } + + public JPanel getCards() { + return cards; + } + + public CardLayout getCardLayout() { + return cardLayout; + } + + public JPanel getjPanelSuspension() { + return jPanelSuspension; + } + + public HosJComboBox getjComboBox() { + return jComboBox; + } + + public HosJComboBox getTimeJComboBox() { + return timeJComboBox; + } + + public CountingThread getCounting() { + return counting; + } + + public void setCounting(CountingThread counting) { + this.counting = counting; + } + + public JLabel getjTextArea() { + return jTextArea; + } + + public JPanel getJpanelSupen() { + return jpanelSupen; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskSystemTunningByTracePanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskSystemTunningByTracePanel.java new file mode 100644 index 000000000..7ff0e4766 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TaskSystemTunningByTracePanel.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import java.awt.BorderLayout; +import java.util.List; + +import javax.swing.JComboBox; +import javax.swing.JPanel; + +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.views.layout.event.SystemTunningByTraceConfigEvent; + +/** + * @Description TaskSystemTunningByTracePanel + * @Date 2021/4/9 13:15 + **/ +public class TaskSystemTunningByTracePanel extends JPanel { + /** + * 设备信息集合 + */ + private List deviceInfos = null; + + /** + * 设备名称下拉框 + */ + private JComboBox jComboBoxPhone = new JComboBox(); + + /** + * 三级页面事件类 + */ + private SystemTunningByTraceConfigEvent taskSystemTunningByTracePanelEvent = new SystemTunningByTraceConfigEvent(); + + /** + * TaskSystemTunningByTracePanel + * + * @param jTaskPanel jTaskPanel + */ + public TaskSystemTunningByTracePanel(TaskPanel jTaskPanel) { + // 设置三级界面布局方式为边框布局管理 + this.setLayout(new BorderLayout()); + // 设置top容器,Center容器,South容器的属性 + // Center容器设置 + setjPanelCenter(); + // South容器设置 + } + + /** + * setjPanelCenter + */ + public void setjPanelCenter() { + taskSystemTunningByTracePanelEvent.devicesInfoJComboBoxUpdate(this); + } + + /** + * setDeviceInfos + * + * @param deviceInfos deviceInfos + */ + public void setDeviceInfos(List deviceInfos) { + this.deviceInfos = deviceInfos; + } + + /** + * getJComboBoxPhone + * + * @return JComboBox + */ + public JComboBox getJComboBoxPhone() { + return jComboBoxPhone; + } + + /** + * getDeviceInfos + * + * @return List + */ + public List getDeviceInfos() { + return deviceInfos; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TransferringWindow.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TransferringWindow.java new file mode 100644 index 000000000..4af96249b --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/swing/TransferringWindow.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.LayoutConstants; + +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +/** + * @Description TransferringWindow + * @Date 2021/3/25 15:58 + **/ +public class TransferringWindow extends JProgressBar { + /** + * TransferringWindow + * + * @param owner owner + */ + public TransferringWindow(JPanel owner) { + this.setBounds(LayoutConstants.TEN, owner.getHeight() - LayoutConstants.FORTY, + owner.getWidth() - LayoutConstants.TWENTY, LayoutConstants.THIRTY); + this.setMinimum(0); + this.setMaximum(LayoutConstants.HUNDRED); + this.setValue(0); + this.setStringPainted(true); + this.setForeground(ColorConstants.CYAN); + this.setBackground(ColorConstants.BLACK); + this.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent event) { + } + }); + owner.add(this); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/util/ColorTableCellRenderer.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/util/ColorTableCellRenderer.java new file mode 100644 index 000000000..b2f5e298e --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/util/ColorTableCellRenderer.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.util; + +import javax.swing.JTable; +import javax.swing.table.DefaultTableCellRenderer; +import java.awt.Color; +import java.awt.Component; + +/** + * ColorTableCellRenderer + * + * @version 1.0 + * @date 2021/3/4 10:55 + **/ +public class ColorTableCellRenderer extends DefaultTableCellRenderer { + /** + * getTableCellRendererComponent + * + * @param table table + * @param value value + * @param isSelected isSelected + * @param hasFocus hasFocus + * @param row row + * @param column column + * @return Component + */ + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, + int row, int column) { + Component comp = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + + Object selectedValue = table.getModel().getValueAt(row, column); + if ("E".equals(selectedValue.toString())) { + comp.setForeground(Color.RED); + } else if ("D".equals(selectedValue.toString())) { + comp.setForeground(Color.blue); + } else if ("I".equals(selectedValue.toString())) { + comp.setForeground(Color.GREEN); + } else if ("V".equals(selectedValue.toString())) { + comp.setForeground(Color.WHITE); + } else if ("W".equals(selectedValue.toString())) { + comp.setForeground(Color.orange); + } else { + return comp; + } + return comp; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/util/FileUtil.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/util/FileUtil.java new file mode 100644 index 000000000..50b42c711 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/layout/util/FileUtil.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.util; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.Writer; + +/** + * 文件工具类 + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class FileUtil { + // 日志 + private static final Logger LOGGER = LogManager.getLogger(FileUtil.class); + + /** + * 保存日志内容到txt中 + * + * @param path path + * @param content content + */ + public void writeFile(String path, String content) { + File writefile; + // 通过这个对象来判断是否向文本文件中追加内容 + writefile = new File(path); + // 如果文本文件不存在则创建它 + if (!writefile.exists()) { + try { + writefile.createNewFile(); + writefile = new File(path); + } catch (IOException exception) { + LOGGER.error("createNewFile" + exception.getMessage()); + } + } + try (FileOutputStream fw = new FileOutputStream(writefile, true); + Writer out = new OutputStreamWriter(fw, "utf-8")) { + // 重新实例化 + out.write(content); + String newline = System.getProperty("line.separator"); + // 写入换行 + out.write(newline); + } catch (IOException exception) { + LOGGER.error("createNewFile" + exception.getMessage()); + } + } + + /** + * 读txt 文件 + * + * @param filePath filePath + * @return String + */ + public String readTxtFile(String filePath) { + String end = null; + InputStreamReader read = null; + try { + String encoding = "utf-8"; + String lineTxt = null; + File file = new File(filePath); + if (file.isFile() && file.exists()) { + // 判断文件是否存在 + read = new InputStreamReader(new FileInputStream(file), encoding); + // 考虑到编码格式 + try (BufferedReader bufferedReader = new BufferedReader(read)) { + lineTxt = bufferedReader.readLine(); + while (lineTxt != null) { + end = end + lineTxt + File.separator; + lineTxt = bufferedReader.readLine(); + } + } + read.close(); + } + } catch (IOException exception) { + LOGGER.error(exception.getMessage()); + } finally { + try { + if (read != null) { + read.close(); + } + } catch (IOException exception) { + LOGGER.error("createNewFile" + exception.getMessage()); + } + } + return end.toString(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CPUProcessBean.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CPUProcessBean.java new file mode 100644 index 000000000..b0e6d8b2d --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CPUProcessBean.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +/** + * cpu process data + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class CPUProcessBean { + private long avgDuration; + + private long wallDuration; + + private String pid; + + private String occurrences; + + private String process; + + /** + * Construction method with parameters + * + * @param mAvgDuration mAvgDuration + * @param mWallDuration mWallDuration + * @param mPid mPid + * @param mOccurrences mOccurrences + * @param mProcess mProcess + */ + public CPUProcessBean(final long mAvgDuration, final long mWallDuration, final String mPid, + final String mOccurrences, final String mProcess) { + this.avgDuration = mAvgDuration; + this.wallDuration = mWallDuration; + this.pid = mPid; + this.occurrences = mOccurrences; + this.process = mProcess; + } + + /** + * Gets the value of avgDuration . + * + * @return the value of long + */ + public long getAvgDuration() { + return avgDuration; + } + + /** + * Sets the avgDuration . + *

You can use getAvgDuration() to get the value of avgDuration

+ * + * @param avgDuration avgDuration + */ + public void setAvgDuration(final long avgDuration) { + this.avgDuration = avgDuration; + } + + /** + * Gets the value of wallDuration . + * + * @return the value of long + */ + public long getWallDuration() { + return wallDuration; + } + + /** + * Sets the wallDuration . + *

You can use getWallDuration() to get the value of wallDuration

+ * + * @param wallDuration wallDuration + */ + public void setWallDuration(final long wallDuration) { + this.wallDuration = wallDuration; + } + + /** + * Gets the value of pid . + * + * @return the value of java.lang.String + */ + public String getPid() { + return pid; + } + + /** + * Sets the pid . + *

You can use getPid() to get the value of pid

+ * + * @param pid pid + */ + public void setPid(final String pid) { + this.pid = pid; + } + + /** + * Gets the value of occurrences . + * + * @return the value of java.lang.String + */ + public String getOccurrences() { + return occurrences; + } + + /** + * Sets the occurrences . + *

You can use getOccurrences() to get the value of occurrences

+ * + * @param occurrences occurrences + */ + public void setOccurrences(final String occurrences) { + this.occurrences = occurrences; + } + + /** + * Gets the value of process . + * + * @return the value of java.lang.String + */ + public String getProcess() { + return process; + } + + /** + * Sets the process . + *

You can use getProcess() to get the value of process

+ * + * @param process process + */ + public void setProcess(final String process) { + this.process = process; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CPUThreadBean.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CPUThreadBean.java new file mode 100644 index 000000000..98cb70091 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CPUThreadBean.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +/** + * cup thread entity class + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class CPUThreadBean { + private long avgDuration; + + private long wallDuration; + + private String pid; + + private String tid; + + private String occurrences; + + private String process; + + private String thread; + + /** + * Parametric structure + * + * @param mAvgDuration mAvgDuration + * @param mWallDuration mWallDuration + * @param mPid mPid + * @param mTid mTid + * @param mOccurrences mOccurrences + * @param mProcess mProcess + * @param mThread mThread + */ + public CPUThreadBean(final long mAvgDuration, final long mWallDuration, final String mPid, final String mTid, + final String mOccurrences, final String mProcess, final String mThread) { + this.avgDuration = mAvgDuration; + this.wallDuration = mWallDuration; + this.pid = mPid; + this.tid = mTid; + this.occurrences = mOccurrences; + this.process = mProcess; + this.thread = mThread; + } + + /** + * Gets the value of avgDuration . + * + * @return the value of long + */ + public long getAvgDuration() { + return avgDuration; + } + + /** + * Sets the avgDuration . + *

You can use getAvgDuration() to get the value of avgDuration

+ * + * @param avgDuration avgDuration + */ + public void setAvgDuration(final long avgDuration) { + this.avgDuration = avgDuration; + } + + /** + * Gets the value of wallDuration . + * + * @return the value of long + */ + public long getWallDuration() { + return wallDuration; + } + + /** + * Sets the wallDuration . + *

You can use getWallDuration() to get the value of wallDuration

+ * + * @param wallDuration wallDuration + */ + public void setWallDuration(final long wallDuration) { + this.wallDuration = wallDuration; + } + + /** + * Gets the value of pid . + * + * @return the value of java.lang.String + */ + public String getPid() { + return pid; + } + + /** + * Sets the pid . + *

You can use getPid() to get the value of pid

+ * + * @param pid pid + */ + public void setPid(final String pid) { + this.pid = pid; + } + + /** + * Gets the value of tid . + * + * @return the value of java.lang.String + */ + public String getTid() { + return tid; + } + + /** + * Sets the tid . + *

You can use getTid() to get the value of tid

+ * + * @param tid tid + */ + public void setTid(final String tid) { + this.tid = tid; + } + + /** + * Gets the value of occurrences . + * + * @return the value of java.lang.String + */ + public String getOccurrences() { + return occurrences; + } + + /** + * Sets the occurrences . + *

You can use getOccurrences() to get the value of occurrences

+ * + * @param occurrences occurrences + */ + public void setOccurrences(final String occurrences) { + this.occurrences = occurrences; + } + + /** + * Gets the value of process . + * + * @return the value of java.lang.String + */ + public String getProcess() { + return process; + } + + /** + * Sets the process . + *

You can use getProcess() to get the value of process

+ * + * @param process process + */ + public void setProcess(final String process) { + this.process = process; + } + + /** + * Gets the value of thread . + * + * @return the value of java.lang.String + */ + public String getThread() { + return thread; + } + + /** + * Sets the thread . + *

You can use getThread() to get the value of thread

+ * + * @param thread thread + */ + public void setThread(final String thread) { + this.thread = thread; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CpuData.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CpuData.java new file mode 100644 index 000000000..253d3d6bc --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CpuData.java @@ -0,0 +1,553 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import ohos.devtools.views.trace.fragment.CpuDataFragment; +import ohos.devtools.views.trace.fragment.graph.AbstractGraph; +import ohos.devtools.views.trace.util.ColorUtils; +import ohos.devtools.views.trace.util.Final; + +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; +import java.awt.geom.Rectangle2D; +import java.util.ArrayList; + +/** + * cpu data + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class CpuData extends AbstractGraph { + private int cpu; + + /** + * get the number of cpu . + * + * @return int Returns the number of cpu + */ + public int getCpu() { + return cpu; + } + + /** + * set the value of cpu . + * + * @param cpu Set the number of cpu + */ + public void setCpu(final int cpu) { + this.cpu = cpu; + } + + private String name; + + /** + * get the name . + * + * @return String Get the name + */ + public String getName() { + return name; + } + + /** + * set the name . + * + * @param name Set name + */ + public void setName(final String name) { + this.name = name; + } + + private ArrayList stats = new ArrayList<>(); + + /** + * get the stats . + * + * @return java.util.ArrayList + */ + public java.util.ArrayList getStats() { + return stats; + } + + /** + * set the stats . + * + * @param stats stats + */ + public void setStats(final java.util.ArrayList stats) { + this.stats = stats; + } + + private String endState; + + /** + * get the endState . + * + * @return String endState + */ + public String getEndState() { + return endState; + } + + /** + * get the endState . + * + * @param endState endState + */ + public void setEndState(final String endState) { + this.endState = endState; + } + + private int priority; + + /** + * get the priority . + * + * @return int priority + */ + public int getPriority() { + return priority; + } + + /** + * set the priority . + * + * @param priority priority + */ + public void setPriority(final int priority) { + this.priority = priority; + } + + private int schedId; + + /** + * get the schedId . + * + * @return int + */ + public int getSchedId() { + return schedId; + } + + /** + * set the schedId . + * + * @param schedId schedId + */ + public void setSchedId(final int schedId) { + this.schedId = schedId; + } + + private long startTime; + + /** + * get the startTime . + * + * @return long + */ + public long getStartTime() { + return startTime; + } + + /** + * set the startTime . + * + * @param startTime startTime + */ + public void setStartTime(final long startTime) { + this.startTime = startTime; + } + + private long duration; + + /** + * get the duration . + * + * @return long + */ + public long getDuration() { + return duration; + } + + /** + * set the duration . + * + * @param duration duration + */ + public void setDuration(final long duration) { + this.duration = duration; + } + + private String type; + + /** + * get the type . + * + * @return String + */ + public String getType() { + return type; + } + + /** + * set the type . + * + * @param type type + */ + public void setType(final String type) { + this.type = type; + } + + private int id; + + /** + * get the id . + * + * @return int + */ + public int getId() { + return id; + } + + /** + * set the id . + * + * @param id id + */ + public void setId(final int id) { + this.id = id; + } + + private int tid; + + /** + * get the tid . + * + * @return int + */ + public int getTid() { + return tid; + } + + /** + * set the tid . + * + * @param tid tid + */ + public void setTid(final int tid) { + this.tid = tid; + } + + private String processCmdLine; + + /** + * get the processCmdLine . + * + * @return String + */ + public String getProcessCmdLine() { + return processCmdLine; + } + + /** + * set the processCmdLine . + * + * @param processCmdLine processCmdLine + */ + public void setProcessCmdLine(final String processCmdLine) { + this.processCmdLine = processCmdLine; + } + + private String processName; + + /** + * get the processName . + * + * @return String + */ + public String getProcessName() { + return processName; + } + + /** + * set the processName . + * + * @param processName processName + */ + public void setProcessName(final String processName) { + this.processName = processName; + } + + private int processId; + + /** + * get the processId . + * + * @return int + */ + public int getProcessId() { + return processId; + } + + /** + * set the processId . + * + * @param processId processId + */ + public void setProcessId(final int processId) { + this.processId = processId; + } + + /** + * ui control extension field. + */ + public CpuData() { + } + + private double chartWidth; + + private double chartNum; + + private String str; + + private Rectangle2D bounds; + + private javax.swing.JComponent root; + + /** + * Get rootcomponent + * + * @return javax.swing.JComponent + */ + public javax.swing.JComponent getRoot() { + return root; + } + + /** + * Set to get rootcomponent + * + * @param root root + */ + public void setRoot(final javax.swing.JComponent root) { + this.root = root; + } + + private final int padding1 = 2; + + private final int padding2 = 4; + + private final float alpha90 = .9f; + + private final float alpha60 = .6f; + + private final int strOffsetY = 16; + + private final int processNameControl = -2; + + /** + * Draw graphics based on attributes + * + * @param graphics graphics + */ + @Override + public void draw(final Graphics2D graphics) { + if (isSelected) { + drawSelect(graphics); + } else { + drawNoSelect(graphics); + } + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f)); + graphics.setColor(Color.white); + int nameControl = processNameControl; + if (processName != null && !processName.isEmpty()) { + nameControl = processName.lastIndexOf("/"); + } + Rectangle rectangle = new Rectangle(); + if (nameControl >= 0) { + rectangle.setRect(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight()); + drawString(graphics, rectangle, processName.substring(nameControl + 1) + "[" + processId + "]", + Placement.CENTER); + } else if (nameControl == -1) { + rectangle.setRect(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight()); + drawString(graphics, rectangle, processName + "[" + processId + "]", Placement.CENTER); + } else { + rectangle.setRect(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight()); + drawString(graphics, rectangle, name + "[" + processId + "]", Placement.CENTER); + } + graphics.setFont(Final.SMALL_FONT); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha90)); + rectangle.setRect(rect.getX(), rect.getY() + strOffsetY, rect.getWidth(), rect.getHeight()); + drawString(graphics, rectangle, name + "[" + tid + "]", Placement.CENTER); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f)); + graphics.setFont(Final.NORMAL_FONT); + } + + private void drawSelect(final Graphics2D graphics) { + graphics.setColor(Color.BLACK); + graphics.fillRect((int) rect.getX(), (int) (rect.getY() - padding1), rect.width, rect.height + padding2); + if (CpuDataFragment.focusCpuData != null) { + if (CpuDataFragment.focusCpuData.processId != processId) { + graphics.setColor(Color.GRAY); + } else { + if (CpuDataFragment.focusCpuData.hashCode() != this.hashCode()) { + graphics.setComposite(AlphaComposite.getInstance(java.awt.AlphaComposite.SRC_OVER, alpha60)); + } + graphics.setColor(ColorUtils.colorForTid(processId > 0 ? processId : tid)); + } + } else { + graphics.setColor(ColorUtils.colorForTid(processId > 0 ? processId : tid)); + } + graphics.fillRect((int) (rect.getX() + padding1), (int) rect.getY(), rect.width - padding2, rect.height); + } + + private void drawNoSelect(final Graphics2D graphics) { + if (CpuDataFragment.focusCpuData != null) { + if (CpuDataFragment.focusCpuData.processId != processId) { + graphics.setColor(Color.GRAY); + } else { + if (CpuDataFragment.focusCpuData.hashCode() != this.hashCode()) { + graphics.setComposite(java.awt.AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha60)); + } + graphics.setColor(ColorUtils.colorForTid(processId > 0 ? processId : tid)); + } + } else { + graphics.setColor(ColorUtils.colorForTid(processId > 0 ? processId : tid)); + } + graphics.fillRect((int) rect.getX(), (int) rect.getY(), rect.width, rect.height); + } + + private boolean isSelected; // Whether to be selected + + /** + * Set selected state + * + * @param isSelected isSelected + */ + public void select(final boolean isSelected) { + this.isSelected = isSelected; + } + + /** + * Redraw the current page + */ + public void repaint() { + if (root != null) { + root.repaint(rect.x, rect.y - padding1, rect.width, rect.height + padding2); + } + } + + /** + * Focus acquisition event + * + * @param event event + */ + @Override + public void onFocus(final MouseEvent event) { + if (eventListener != null) { + eventListener.focus(event, this); + } + } + + /** + * Focus loss event + * + * @param event event + */ + @Override + public void onBlur(final MouseEvent event) { + if (eventListener != null) { + eventListener.blur(event, this); + } + } + + /** + * Click event + * + * @param event event + */ + @Override + public void onClick(final MouseEvent event) { + if (eventListener != null) { + eventListener.click(event, this); + } + } + + /** + * Mouse movement event + * + * @param event event + */ + @Override + public void onMouseMove(final MouseEvent event) { + if (edgeInspect(event)) { + if (eventListener != null) { + eventListener.mouseMove(event, this); + } + } + } + + private IEventListener eventListener; + + /** + * Set callback event listener + * + * @param eventListener eventListener + */ + public void setEventListener(final IEventListener eventListener) { + this.eventListener = eventListener; + } + + /** + * Listener + */ + public interface IEventListener { + /** + * Mouse click event + * + * @param event event + * @param data data + */ + void click(MouseEvent event, CpuData data); + + /** + * Mouse blur event + * + * @param event event + * @param data data + */ + void blur(MouseEvent event, CpuData data); + + /** + * Mouse focus event + * + * @param event event + * @param data data + */ + void focus(MouseEvent event, CpuData data); + + /** + * Mouse move event + * + * @param event event + * @param data data + */ + void mouseMove(MouseEvent event, CpuData data); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CpuFreqData.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CpuFreqData.java new file mode 100644 index 000000000..88d6a806a --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CpuFreqData.java @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import ohos.devtools.views.trace.fragment.graph.AbstractGraph; +import ohos.devtools.views.trace.util.ColorUtils; + +import javax.swing.JComponent; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; + +/** + * cpu frequency data + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class CpuFreqData extends AbstractGraph { + private int cpu; + + private long value; + + private long startTime; + + private long duration; + + private JComponent root; + + private boolean flagFocus; + + private double max; + + /** + * Empty parameter construction method + */ + public CpuFreqData() { + } + + /** + * Gets the value of cpu . + * + * @return the value of int + */ + public int getCpu() { + return cpu; + } + + /** + * Sets the cpu . + *

You can use getCpu() to get the value of cpu

+ * + * @param cpu cpu + */ + public void setCpu(final int cpu) { + this.cpu = cpu; + } + + /** + * Gets the value of value . + * + * @return the value of long + */ + public long getValue() { + return value; + } + + /** + * Sets the value . + *

You can use getValue() to get the value of value

+ * + * @param value value + */ + public void setValue(final long value) { + this.value = value; + } + + /** + * Gets the value of startTime . + * + * @return the value of long + */ + public long getStartTime() { + return startTime; + } + + /** + * Sets the startTime . + *

You can use getStartTime() to get the value of startTime

+ * + * @param startTime startTime + */ + public void setStartTime(final long startTime) { + this.startTime = startTime; + } + + /** + * Gets the value of duration . + * + * @return the value of long + */ + public long getDuration() { + return duration; + } + + /** + * Sets the duration . + *

You can use getDuration() to get the value of duration

+ * + * @param duration duration + */ + public void setDuration(final long duration) { + this.duration = duration; + } + + /** + * Gets the value of root . + * + * @return the value of javax.swing.JComponent + */ + public JComponent getRoot() { + return root; + } + + /** + * Sets the root . + *

You can use getRoot() to get the value of root

+ * + * @param root root + */ + public void setRoot(final JComponent root) { + this.root = root; + } + + /** + * Gets the value of flagFocus . + * + * @return the value of boolean + */ + public boolean isFlagFocus() { + return flagFocus; + } + + /** + * Sets the flagFocus . + *

You can use getFlagFocus() to get the value of flagFocus

+ * + * @param flagFocus flagFocus + */ + public void setFlagFocus(final boolean flagFocus) { + this.flagFocus = flagFocus; + } + + /** + * Gets the value of max . + * + * @return the value of double + */ + public double getMax() { + return max; + } + + /** + * Sets the max . + *

You can use getMax() to get the value of max

+ * + * @param max max + */ + public void setMax(double max) { + this.max = max; + } + + /** + * Rewrite drawing method + * + * @param graphics graphics + */ + @Override + public void draw(final Graphics2D graphics) { + double drawHeight = (value * (rect.height - 5) * 1.0) / max; + graphics.setColor(ColorUtils.MD_PALETTE[cpu]); + graphics.fillRect(rect.x, rect.y + rect.height - (int) drawHeight, rect.width, (int) drawHeight); + } + + @Override + public void onFocus(final MouseEvent event) { + } + + @Override + public void onBlur(final MouseEvent event) { + } + + @Override + public void onClick(final MouseEvent event) { + } + + @Override + public void onMouseMove(final MouseEvent event) { + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CpuRateBean.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CpuRateBean.java new file mode 100644 index 000000000..3618fa37f --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/CpuRateBean.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +/** + * cup usage rate entity class + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class CpuRateBean { + private int cpu; + + private int index; + + private double rate; + + /** + * Gets the value of cpu . + * + * @return the value of int + */ + public int getCpu() { + return cpu; + } + + /** + * Sets the cpu . + *

You can use getCpu() to get the value of cpu

+ * + * @param cpu cpu + */ + public void setCpu(final int cpu) { + this.cpu = cpu; + } + + /** + * Gets the value of index . + * + * @return the value of int + */ + public int getIndex() { + return index; + } + + /** + * Sets the index . + *

You can use getIndex() to get the value of index

+ * + * @param index index + */ + public void setIndex(final int index) { + this.index = index; + } + + /** + * Gets the value of rate . + * + * @return the value of double + */ + public double getRate() { + return rate; + } + + /** + * Sets the rate . + *

You can use getRate() to get the value of rate

+ * + * @param rate rate + */ + public void setRate(final double rate) { + this.rate = rate; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/FlagBean.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/FlagBean.java new file mode 100644 index 000000000..8963d45ce --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/FlagBean.java @@ -0,0 +1,265 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import ohos.devtools.views.trace.fragment.graph.AbstractGraph; +import ohos.devtools.views.trace.util.ColorUtils; + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; + +/** + * Little Red Flag Data + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class FlagBean extends AbstractGraph { + private long ns; + + private boolean visible; + + private String name; + + private long time; + + private Color color; + + /** + * Gets the value of ns . + * + * @return the value of long + */ + public long getNs() { + return ns; + } + + /** + * Sets the ns . + *

You can use getNs() to get the value of ns

+ * + * @param ns Nanoseconds + */ + public void setNs(final long ns) { + this.ns = ns; + } + + /** + * Gets the value of visible . + * + * @return the value of boolean + */ + public boolean isVisible() { + return visible; + } + + /** + * Sets the visible . + *

You can use getVisible() to get the value of visible

+ * + * @param visible Whether to show + */ + public void setVisible(final boolean visible) { + this.visible = visible; + } + + /** + * Gets the value of name . + * + * @return the value of java.lang.String + */ + public String getName() { + return name; + } + + /** + * Sets the name . + *

You can use getName() to get the value of name

+ * + * @param name name + */ + public void setName(final String name) { + this.name = name; + } + + /** + * Gets the value of time . + * + * @return the value of long + */ + public long getTime() { + return time; + } + + /** + * Sets the time . + *

You can use getTime() to get the value of time

+ * + * @param time time + */ + public void setTime(final long time) { + this.time = time; + } + + /** + * Gets the value of color . + * + * @return the value of java.awt.Color + */ + public Color getColor() { + return color; + } + + /** + * Sets the color . + *

You can use getColor() to get the value of color

+ * + * @param color color + */ + public void setColor(final Color color) { + this.color = color; + } + + /** + * remove listener + */ + public void remove() { + if (eventListener != null) { + eventListener.delete(this); + } + } + + private final int defaultFuncColorIndex = 6; + + /** + * no parameter structure + */ + public FlagBean() { + visible = false; + color = ColorUtils.FUNC_COLOR[defaultFuncColorIndex]; + } + + /** + * Draw the corresponding shape according to the brush + * + * @param graphics graphics + */ + @Override + public void draw(final Graphics2D graphics) { + if (name != null && !name.isEmpty()) { + graphics.setColor(color); + final int sx = 202; + final int xy = 4; + graphics.drawString(name, sx + rect.x + rect.width, rect.y + rect.height - xy); + } + } + + /** + * Focus acquisition + * + * @param event event + */ + @Override + public void onFocus(final MouseEvent event) { + } + + /** + * lose focus + * + * @param event event + */ + @Override + public void onBlur(final MouseEvent event) { + } + + /** + * Click event + * + * @param event event + */ + @Override + public void onClick(final MouseEvent event) { + if (eventListener != null) { + eventListener.click(event, this); + } + } + + /** + * Mouse movement event + * + * @param event event + */ + @Override + public void onMouseMove(final MouseEvent event) { + } + + private IEventListener eventListener; + + /** + * Set up the event listener + * + * @param eventListener eventListener + */ + public void setEventListener(final IEventListener eventListener) { + this.eventListener = eventListener; + } + + /** + * Event listener + */ + public interface IEventListener { + /** + * Click event + * + * @param event event + * @param data data + */ + void click(MouseEvent event, FlagBean data); + + /** + * Focus cancel event + * + * @param event event + * @param data data + */ + void blur(MouseEvent event, FlagBean data); + + /** + * Focus acquisition event + * + * @param event event + * @param data data + */ + void focus(MouseEvent event, FlagBean data); + + /** + * Mouse movement event + * + * @param event event + * @param data data + */ + void mouseMove(MouseEvent event, FlagBean data); + + /** + * Delete event + * + * @param data data + */ + void delete(FlagBean data); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/FunctionBean.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/FunctionBean.java new file mode 100644 index 000000000..04077ffeb --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/FunctionBean.java @@ -0,0 +1,365 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import ohos.devtools.views.trace.fragment.graph.AbstractGraph; +import ohos.devtools.views.trace.util.ColorUtils; + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; + +/** + * Method entity class + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class FunctionBean extends AbstractGraph { + private int tid; + + private String threadName; + + private int isMainThread; + + private int trackId; + + private long startTime; + + private long duration; + + private String funName; + + private int depth; + + private String category; + + private boolean isSelected; // Whether to be selected + + /** + * Gets the value of tid . + * + * @return the value of int + */ + public int getTid() { + return tid; + } + + /** + * Sets the tid . + *

You can use getTid() to get the value of tid

+ * + * @param pTid pTid + */ + public void setTid(final int pTid) { + this.tid = pTid; + } + + /** + * Gets the value of threadName . + * + * @return the value of java.lang.String + */ + public String getThreadName() { + return threadName; + } + + /** + * Sets the threadName . + *

You can use getThreadName() to get the value of threadName

+ * + * @param name name + */ + public void setThreadName(final String name) { + this.threadName = name; + } + + /** + * Gets the value of isMainThread . + * + * @return the value of int + */ + public int getIsMainThread() { + return isMainThread; + } + + /** + * Sets the isMainThread . + *

You can use getIsMainThread() to get the value of isMainThread

+ * + * @param mainThread mainThread + */ + public void setIsMainThread(final int mainThread) { + this.isMainThread = mainThread; + } + + /** + * Gets the value of trackId . + * + * @return the value of int + */ + public int getTrackId() { + return trackId; + } + + /** + * Sets the trackId . + *

You can use getTrackId() to get the value of trackId

+ * + * @param id id + */ + public void setTrackId(final int id) { + this.trackId = id; + } + + /** + * Gets the value of startTime . + * + * @return the value of long + */ + public long getStartTime() { + return startTime; + } + + /** + * Sets the startTime . + *

You can use getStartTime() to get the value of startTime

+ * + * @param time time + */ + public void setStartTime(final long time) { + this.startTime = time; + } + + /** + * Gets the value of duration . + * + * @return the value of long + */ + public long getDuration() { + return duration; + } + + /** + * Sets the duration . + *

You can use getDuration() to get the value of duration

+ * + * @param dur dur + */ + public void setDuration(final long dur) { + this.duration = dur; + } + + /** + * Gets the value of funName . + * + * @return the value of java.lang.String + */ + public String getFunName() { + return funName; + } + + /** + * Sets the funName . + *

You can use getFunName() to get the value of funName

+ * + * @param name name + */ + public void setFunName(final String name) { + this.funName = name; + } + + /** + * Gets the value of depth . + * + * @return the value of int + */ + public int getDepth() { + return depth; + } + + /** + * Sets the depth . + *

You can use getDepth() to get the value of depth

+ * + * @param dep dep + */ + public void setDepth(final int dep) { + this.depth = dep; + } + + /** + * Gets the value of category . + * + * @return the value of java.lang.String + */ + public String getCategory() { + return category; + } + + /** + * Sets the category . + *

You can use getCategory() to get the value of category

+ * + * @param cate cate + */ + public void setCategory(final String cate) { + this.category = cate; + } + + /** + * Gets the value of isSelected . + * + * @return the value of boolean + */ + public boolean isSelected() { + return isSelected; + } + + /** + * Sets the isSelected . + *

You can use getSelected() to get the value of isSelected

+ * + * @param selected selected + */ + public void setSelected(final boolean selected) { + this.isSelected = selected; + } + + /** + * Draw the corresponding shape according to the brush + * + * @param graphics graphics + */ + @Override + public void draw(final Graphics2D graphics) { + if (isSelected) { + graphics.setColor(Color.black); + graphics.fillRect(rect.x, rect.y, rect.width, rect.height); + graphics.setColor(ColorUtils.FUNC_COLOR[depth % ColorUtils.FUNC_COLOR.length]); + graphics.fillRect(rect.x + 1, rect.y + 1, rect.width - 2, rect.height - 2); + graphics.setColor(Color.white); + Rectangle rectangle = new Rectangle(); + rectangle.setRect(rect.getX() + 1, rect.getY() + 1, rect.getWidth() - 2, rect.getHeight() - 2); + drawString(graphics, rectangle, funName, Placement.CENTER_LINE); + } else { + graphics.setColor(ColorUtils.FUNC_COLOR[depth % ColorUtils.FUNC_COLOR.length]); + graphics.fillRect(rect.x, rect.y, rect.width, rect.height); + graphics.setColor(Color.white); + drawString(graphics, rect, funName, Placement.CENTER_LINE); + } + } + + /** + * Focus acquisition event + * + * @param event event + */ + @Override + public void onFocus(final MouseEvent event) { + if (eventListener != null) { + eventListener.focus(event, this); + } + } + + /** + * Focus cancel event + * + * @param event event + */ + @Override + public void onBlur(final MouseEvent event) { + if (eventListener != null) { + eventListener.blur(event, this); + } + } + + /** + * Click event + * + * @param event event + */ + @Override + public void onClick(final MouseEvent event) { + if (eventListener != null) { + eventListener.click(event, this); + } + } + + /** + * Mouse movement event + * + * @param event event + */ + @Override + public void onMouseMove(final MouseEvent event) { + if (edgeInspect(event)) { + if (eventListener != null) { + eventListener.mouseMove(event, this); + } + } + } + + private IEventListener eventListener; + + /** + * Set up the event listener + * + * @param listener listener + */ + public void setEventListener(final IEventListener listener) { + this.eventListener = listener; + } + + /** + * listener + */ + public interface IEventListener { + /** + * Click event + * + * @param event event + * @param data data + */ + void click(MouseEvent event, FunctionBean data); + + /** + * Focus cancel event + * + * @param event event + * @param data data + */ + void blur(MouseEvent event, FunctionBean data); + + /** + * Focus acquisition event + * + * @param event event + * @param data data + */ + void focus(MouseEvent event, FunctionBean data); + + /** + * Mouse movement event + * + * @param event event + * @param data data + */ + void mouseMove(MouseEvent event, FunctionBean data); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/Process.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/Process.java new file mode 100644 index 000000000..1d46b71d6 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/Process.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +/** + * Process entity class + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class Process { + private int pid; + + private String name; + + /** + * Gets the value of pid . + * + * @return the value of int + */ + public int getPid() { + return pid; + } + + /** + * Sets the pid . + *

You can use getPid() to get the value of pid

+ * + * @param id id + */ + public void setPid(final int id) { + this.pid = id; + } + + /** + * Gets the value of name . + * + * @return the value of java.lang.String + */ + public String getName() { + return name; + } + + /** + * Sets the name . + *

You can use getName() to get the value of name

+ * + * @param name name + */ + public void setName(final String name) { + this.name = name; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/ProcessData.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/ProcessData.java new file mode 100644 index 000000000..f818e2987 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/ProcessData.java @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import ohos.devtools.views.trace.fragment.graph.AbstractGraph; + +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; + +/** + * Process data + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class ProcessData extends AbstractGraph { + private int id; + + private int utid; + + private int cpu; + + private long startTime; + + private long duration; + + private String state; + + /** + * Gets the value of id . + * + * @return the value of int + */ + public int getId() { + return id; + } + + /** + * Sets the id . + *

You can use getId() to get the value of id

+ * + * @param id id + */ + public void setId(final int id) { + this.id = id; + } + + /** + * Gets the value of utid . + * + * @return the value of int + */ + public int getUtid() { + return utid; + } + + /** + * Sets the utid . + *

You can use getUtid() to get the value of utid

+ * + * @param id id + */ + public void setUtid(final int id) { + this.utid = id; + } + + /** + * Gets the value of cpu . + * + * @return the value of int + */ + public int getCpu() { + return cpu; + } + + /** + * Sets the cpu . + *

You can use getCpu() to get the value of cpu

+ * + * @param cpu cpu + */ + public void setCpu(final int cpu) { + this.cpu = cpu; + } + + /** + * Gets the value of startTime . + * + * @return the value of long + */ + public long getStartTime() { + return startTime; + } + + /** + * Sets the startTime . + *

You can use getStartTime() to get the value of startTime

+ * + * @param time time + */ + public void setStartTime(final long time) { + this.startTime = time; + } + + /** + * Gets the value of duration . + * + * @return the value of long + */ + public long getDuration() { + return duration; + } + + /** + * Sets the duration . + *

You can use getDuration() to get the value of duration

+ * + * @param dur dur + */ + public void setDuration(final long dur) { + this.duration = dur; + } + + /** + * Gets the value of state . + * + * @return the value of java.lang.String + */ + public String getState() { + return state; + } + + /** + * Sets the state . + *

You can use getState() to get the value of state

+ * + * @param state state + */ + public void setState(final String state) { + this.state = state; + } + + /** + * Draw the corresponding shape according to the brush + * + * @param graphics graphics + */ + @Override + public void draw(final Graphics2D graphics) { + } + + /** + * Get focus event + * + * @param event event + */ + @Override + public void onFocus(final MouseEvent event) { + } + + /** + * Focus cancel callback event + * + * @param event event + */ + @Override + public void onBlur(final MouseEvent event) { + } + + /** + * Click event + * + * @param event event + */ + @Override + public void onClick(final MouseEvent event) { + } + + /** + * Mouse movement event + * + * @param event event + */ + @Override + public void onMouseMove(final MouseEvent event) { + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/ProcessMem.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/ProcessMem.java new file mode 100644 index 000000000..dafd2444c --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/ProcessMem.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +/** + * Process memory directory + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class ProcessMem { + private int trackId; + + private String processName; + + private int pid; + + private int upid; + + private String trackName; + + /** + * Gets the value of trackId . + * + * @return the value of int + */ + public int getTrackId() { + return trackId; + } + + /** + * Sets the trackId . + *

You can use getTrackId() to get the value of trackId

+ * + * @param track track + */ + public void setTrackId(final int track) { + this.trackId = track; + } + + /** + * Gets the value of processName . + * + * @return the value of java.lang.String + */ + public String getProcessName() { + return processName; + } + + /** + * Sets the processName . + *

You can use getProcessName() to get the value of processName

+ * + * @param name name + */ + public void setProcessName(final String name) { + this.processName = name; + } + + /** + * Gets the value of pid . + * + * @return the value of int + */ + public int getPid() { + return pid; + } + + /** + * Sets the pid . + *

You can use getPid() to get the value of pid

+ * + * @param id id + */ + public void setPid(final int id) { + this.pid = id; + } + + /** + * Gets the value of upid . + * + * @return the value of int + */ + public int getUpid() { + return upid; + } + + /** + * Sets the upid . + *

You can use getUpid() to get the value of upid

+ * + * @param id id + */ + public void setUpid(final int id) { + this.upid = id; + } + + /** + * Gets the value of trackName . + * + * @return the value of java.lang.String + */ + public String getTrackName() { + return trackName; + } + + /** + * Sets the trackName . + *

You can use getTrackName() to get the value of trackName

+ * + * @param name name + */ + public void setTrackName(final String name) { + this.trackName = name; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/ProcessMemData.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/ProcessMemData.java new file mode 100644 index 000000000..92d189bb2 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/ProcessMemData.java @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import ohos.devtools.views.trace.fragment.graph.AbstractGraph; +import ohos.devtools.views.trace.util.ColorUtils; + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; + +/** + * Process memory data + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class ProcessMemData extends AbstractGraph { + private int maxValue; + + /** + * Gets the value of maxValue . + * + * @return the value of int + */ + public int getMaxValue() { + return maxValue; + } + + /** + * Sets the maxValue . + *

You can use getMaxValue() to get the value of maxValue

+ * + * @param max max + */ + public void setMaxValue(final int max) { + this.maxValue = max; + } + + private int id; + + private String type; + + private int trackId; + + private int value; + + private long startTime; + + private long duration; + + /** + * Gets the value of id . + * + * @return the value of int + */ + public int getId() { + return id; + } + + /** + * Sets the id . + *

You can use getId() to get the value of id

+ * + * @param id id + */ + public void setId(final int id) { + this.id = id; + } + + /** + * Gets the value of type . + * + * @return the value of java.lang.String + */ + public String getType() { + return type; + } + + /** + * Sets the type . + *

You can use getType() to get the value of type

+ * + * @param type type + */ + public void setType(final String type) { + this.type = type; + } + + /** + * Gets the value of trackId . + * + * @return the value of int + */ + public int getTrackId() { + return trackId; + } + + /** + * Sets the trackId . + *

You can use getTrackId() to get the value of trackId

+ * + * @param id id + */ + public void setTrackId(final int id) { + this.trackId = id; + } + + /** + * Gets the value of value . + * + * @return the value of int + */ + public int getValue() { + return value; + } + + /** + * Sets the value . + *

You can use getValue() to get the value of value

+ * + * @param value value + */ + public void setValue(final int value) { + this.value = value; + } + + /** + * Gets the value of startTime . + * + * @return the value of long + */ + public long getStartTime() { + return startTime; + } + + /** + * Sets the startTime . + *

You can use getStartTime() to get the value of startTime

+ * + * @param time time + */ + public void setStartTime(final long time) { + this.startTime = time; + } + + /** + * Gets the value of duration . + * + * @return the value of long + */ + public long getDuration() { + return duration; + } + + /** + * Sets the duration . + *

You can use getDuration() to get the value of duration

+ * + * @param dur dur + */ + public void setDuration(final long dur) { + this.duration = dur; + } + + /** + * Draw the corresponding shape according to the brush + * + * @param graphics graphics + */ + @Override + public void draw(final Graphics2D graphics) { + Color color = ColorUtils.MD_PALETTE[trackId % ColorUtils.MD_PALETTE.length]; + int height = 0; + if (maxValue > 0) { + height = ((rect.height - 5) * value) / maxValue; + graphics.setColor(color); + graphics.fillRect(rect.x, rect.y + rect.height - height, rect.width, height); + } + } + + /** + * Focus acquisition event + * + * @param event event + */ + @Override + public void onFocus(final MouseEvent event) { + } + + /** + * Focus cancel event + * + * @param event event + */ + @Override + public void onBlur(final MouseEvent event) { + } + + /** + * Click event + * + * @param event event + */ + @Override + public void onClick(final MouseEvent event) { + } + + /** + * Mouse movement event + * + * @param event event + */ + @Override + public void onMouseMove(final MouseEvent event) { + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/ThreadData.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/ThreadData.java new file mode 100644 index 000000000..2e91ee17b --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/ThreadData.java @@ -0,0 +1,456 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import ohos.devtools.views.trace.fragment.graph.AbstractGraph; +import ohos.devtools.views.trace.util.Final; +import ohos.devtools.views.trace.util.Utils; + +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; + +/** + * Thread data + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class ThreadData extends AbstractGraph { + private static Color runningColor = new Color(Final.RUNNING_COLOR); + + private static Color rColor = new Color(Final.R_COLOR); + + private static Color uninterruptibleSleepColor = new Color(Final.UNINTERRUPTIBLE_SLEEP_COLOR); + + private static Color sColor = new Color(Final.S_COLOR); + + private int uPid; + + private int uTid; + + private int pid; // Process id + + private int tid; // Thread id + + private String processName; + + private String threadName; + + private String state; + + private long startTime; + + private long duration; + + private boolean isSelected; // Whether to be selected + + private int cpu; + + /** + * Gets the value of uPid . + * + * @return the value of uPid . + */ + public int getuPid() { + return uPid; + } + + /** + * Sets the uPid . + *

You can use getuPid() to get the value of uPid.

+ * + * @param param param. + */ + public void setuPid(final int param) { + this.uPid = param; + } + + /** + * Gets the value of uTid . + * + * @return the value of uTid . + */ + public int getuTid() { + return uTid; + } + + /** + * Sets the uTid . + *

You can use getuTid() to get the value of uTid.

+ * + * @param param . + */ + public void setuTid(final int param) { + this.uTid = param; + } + + /** + * Gets the value of pid . + * + * @return the value of pid . + */ + public int getPid() { + return pid; + } + + /** + * Sets the pid . + *

You can use getPid() to get the value of pid.

+ * + * @param param . + */ + public void setPid(final int param) { + this.pid = param; + } + + /** + * Gets the value of tid . + * + * @return the value of tid . + */ + public int getTid() { + return tid; + } + + /** + * Sets the tid . + *

You can use getTid() to get the value of tid.

+ * + * @param param . + */ + public void setTid(final int param) { + this.tid = param; + } + + /** + * Gets the value of processName . + * + * @return the value of processName . + */ + public String getProcessName() { + return processName; + } + + /** + * Sets the processName . + *

You can use getProcessName() to get the value of processName.

+ * + * @param param . + */ + public void setProcessName(final String param) { + this.processName = param; + } + + /** + * Gets the value of threadName . + * + * @return the value of threadName . + */ + public String getThreadName() { + return threadName; + } + + /** + * Sets the threadName . + *

You can use getThreadName() to get the value of threadName.

+ * + * @param param param + */ + public void setThreadName(final String param) { + this.threadName = param; + } + + /** + * Gets the value of state . + * + * @return the value of state . + */ + public String getState() { + return state; + } + + /** + * Sets the state . + *

You can use getState() to get the value of state.

+ * + * @param param param + */ + public void setState(final String param) { + this.state = param; + } + + /** + * Gets the value of startTime . + * + * @return the value of startTime . + */ + public long getStartTime() { + return startTime; + } + + /** + * Sets the startTime . + *

You can use getStartTime() to get the value of startTime.

+ * + * @param param param + */ + public void setStartTime(final long param) { + this.startTime = param; + } + + /** + * Gets the value of duration . + * + * @return the value of duration . + */ + public long getDuration() { + return duration; + } + + /** + * Sets the duration . + *

You can use getDuration() to get the value of duration.

+ * + * @param param param + */ + public void setDuration(final long param) { + this.duration = param; + } + + /** + * Gets the value of cpu . + * + * @return the value of cpu . + */ + public int getCpu() { + return cpu; + } + + /** + * Sets the cpu . + *

You can use getCpu() to get the value of cpu.

+ * + * @param param param + */ + public void setCpu(final int param) { + this.cpu = param; + } + + /** + * Sets the isSelected . + *

You can use getSelected() to get the value of isSelected.

+ * + * @param param param + */ + public void select(final boolean param) { + isSelected = param; + } + + private final int padding1 = 5; + + private final int padding2 = 10; + + private final float alpha2 = 0.02f; + + /** + * repaint. + **/ + public void repaint() { + if (root != null) { + root.repaint(rect.x, rect.y - padding1, rect.width, rect.height + padding2); + } + } + + /** + * Draw the corresponding shape according to the brush + * + * @param graphics graphics + **/ + @Override + public void draw(final Graphics2D graphics) { + if (isSelected && !"S".equals(state)) { + graphics.setColor(Color.BLACK); + graphics.fillRect(rect.x, rect.y - padding1, rect.width, rect.height + padding2); + drawSelected(graphics); + } else { + drawUnSelected(graphics); + } + } + + private void drawSelected(final Graphics2D graphics) { + if ("S".equals(state)) { + graphics.setColor(sColor); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha2)); // transparency + graphics.fillRect(rect.x + padding1, rect.y, rect.width - padding2, rect.height); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f)); // transparency + } else if ("R".equals(state)) { + graphics.setColor(rColor); + graphics.fillRect(rect.x + padding1, rect.y, rect.width - padding2, rect.height); + graphics.setColor(Color.white); + drawString(graphics, rect, Utils.getEndState(state), Placement.CENTER_LINE); + } else if ("D".equals(state)) { + graphics.setColor(uninterruptibleSleepColor); + graphics.fillRect(rect.x + padding1, rect.y, rect.width - padding2, rect.height); + graphics.setColor(Color.white); + drawString(graphics, rect, Utils.getEndState(state), Placement.CENTER_LINE); + } else if ("Running".equals(state)) { + graphics.setColor(runningColor); + graphics.fillRect(rect.x + padding1, rect.y, rect.width - padding2, rect.height); + graphics.setColor(Color.white); + Rectangle rectangle = new Rectangle(); + rectangle.setRect(rect.getX() + padding1, rect.getY(), rect.getWidth() - padding2, rect.getHeight()); + drawString(graphics, rectangle, Utils.getEndState(state), Placement.CENTER_LINE); + } else { + graphics.setColor(rColor); + graphics.fillRect(rect.x + padding1, rect.y, rect.width - padding2, rect.height); + graphics.setColor(Color.white); + Rectangle rectangle = new Rectangle(); + rectangle.setRect(rect.getX() + padding1, rect.getY(), rect.getWidth() - padding2, rect.getHeight()); + drawString(graphics, rectangle, Utils.getEndState(state), Placement.CENTER_LINE); + } + } + + private void drawUnSelected(final Graphics2D graphics) { + if ("S".equals(state)) { + graphics.setColor(sColor); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha2)); // transparency + graphics.fillRect(rect.x, rect.y, rect.width, rect.height); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f)); // transparency + } else if ("R".equals(state)) { + graphics.setColor(rColor); + graphics.fillRect(rect.x, rect.y, rect.width, rect.height); + graphics.setColor(Color.white); + drawString(graphics, rect, Utils.getEndState(state), Placement.CENTER_LINE); + } else if ("D".equals(state)) { + graphics.setColor(uninterruptibleSleepColor); + graphics.fillRect(rect.x + padding1, rect.y, rect.width - padding2, rect.height); + graphics.setColor(Color.white); + drawString(graphics, rect, Utils.getEndState(state), Placement.CENTER_LINE); + } else if ("Running".equals(state)) { + graphics.setColor(runningColor); + graphics.fillRect(rect.x, rect.y, rect.width, rect.height); + graphics.setColor(Color.white); + drawString(graphics, rect, Utils.getEndState(state), Placement.CENTER_LINE); + } else { + graphics.setColor(rColor); + graphics.fillRect(rect.x, rect.y, rect.width, rect.height); + graphics.setColor(Color.white); + drawString(graphics, rect, Utils.getEndState(state), Placement.CENTER_LINE); + } + } + + /** + * Focus acquisition callback event + * + * @param event event + **/ + @Override + public void onFocus(final MouseEvent event) { + if (eventListener != null) { + eventListener.focus(event, this); + } + } + + /** + * Focus cancel callback event + * + * @param event event + **/ + @Override + public void onBlur(final MouseEvent event) { + if (eventListener != null) { + eventListener.blur(event, this); + } + } + + /** + * Click event callback + * + * @param event event + **/ + @Override + public void onClick(final MouseEvent event) { + if (eventListener != null) { + eventListener.click(event, this); + } + } + + /** + * Mouse movement event callback + * + * @param event event + **/ + @Override + public void onMouseMove(final MouseEvent event) { + if (edgeInspect(event)) { + if (eventListener != null) { + eventListener.mouseMove(event, this); + } + } + } + + private IEventListener eventListener; + + /** + * Set callback event listener + * + * @param listener listener + **/ + public void setEventListener(final IEventListener listener) { + this.eventListener = listener; + } + + /** + * listener + */ + public interface IEventListener { + /** + * Mouse click event + * + * @param event event + * @param data data + **/ + void click(MouseEvent event, ThreadData data); + + /** + * Mouse blur event + * + * @param event event + * @param data data + **/ + void blur(MouseEvent event, ThreadData data); + + /** + * Mouse focus event + * + * @param event event + * @param data data + **/ + void focus(MouseEvent event, ThreadData data); + + /** + * Mouse move event + * + * @param event event + * @param data data + **/ + void mouseMove(MouseEvent event, ThreadData data); + } +} + diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/WakeupBean.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/WakeupBean.java new file mode 100644 index 000000000..49d6ce67b --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/bean/WakeupBean.java @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +/** + * Wake up data + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class WakeupBean { + private long wakeupTime; + + private int wakeupCpu; + + private String wakeupProcess; + + private String wakeupPid; + + private String wakeupThread; + + private String wakeupTid; + + private long schedulingLatency; + + private String schedulingDesc; + + /** + * get wakeup time. + * + * @return wakeup time + */ + public long getWakeupTime() { + return wakeupTime; + } + + /** + * set wakeup time. + * + * @param wt wt + */ + public void setWakeupTime(final long wt) { + this.wakeupTime = wt; + } + + /** + * get wakeup cpu. + * + * @return wakeup cpu + */ + public int getWakeupCpu() { + return wakeupCpu; + } + + /** + * set wakeup cpu. + * + * @param cpu cpu + */ + public void setWakeupCpu(final int cpu) { + this.wakeupCpu = cpu; + } + + /** + * get wakeup process. + * + * @return wakeup process + */ + public String getWakeupProcess() { + return wakeupProcess; + } + + /** + * set wakeup process. + * + * @param process process + */ + public void setWakeupProcess(final String process) { + this.wakeupProcess = process; + } + + /** + * get wakeup pId. + * + * @return wakeup pId + */ + public String getWakeupPid() { + return wakeupPid; + } + + /** + * set wakeup pId. + * + * @param pid pid + */ + public void setWakeupPid(final String pid) { + this.wakeupPid = pid; + } + + /** + * get wakeup thread. + * + * @return wakeup thread + */ + public String getWakeupThread() { + return wakeupThread; + } + + /** + * set wakeup thread. + * + * @param thread thread + */ + public void setWakeupThread(final String thread) { + this.wakeupThread = thread; + } + + /** + * get wakeup tId. + * + * @return wakeup thread id + */ + public String getWakeupTid() { + return wakeupTid; + } + + /** + * set wakeup tId. + * + * @param tid tid + */ + public void setWakeupTid(final String tid) { + this.wakeupTid = tid; + } + + /** + * get scheduling Latency. + * + * @return scheduling Latency + */ + public long getSchedulingLatency() { + return schedulingLatency; + } + + /** + * set scheduling Latency. + * + * @param latency latency + */ + public void setSchedulingLatency(final long latency) { + this.schedulingLatency = latency; + } + + /** + * get scheduling Desc. + * + * @return scheduling Desc + */ + public String getSchedulingDesc() { + return schedulingDesc; + } + + /** + * set scheduling Desc. + * + * @param desc desc + */ + public void setSchedulingDesc(final String desc) { + this.schedulingDesc = desc; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/AnalystPanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/AnalystPanel.java new file mode 100644 index 000000000..625d102c4 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/AnalystPanel.java @@ -0,0 +1,718 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import com.intellij.ui.components.JBLayeredPane; +import com.intellij.ui.components.JBScrollPane; +import ohos.devtools.views.trace.bean.CpuData; +import ohos.devtools.views.trace.bean.CpuFreqData; +import ohos.devtools.views.trace.bean.FlagBean; +import ohos.devtools.views.trace.bean.FunctionBean; +import ohos.devtools.views.trace.bean.Process; +import ohos.devtools.views.trace.bean.ProcessMem; +import ohos.devtools.views.trace.bean.ThreadData; +import ohos.devtools.views.trace.bean.WakeupBean; +import ohos.devtools.views.trace.fragment.AbstractDataFragment; +import ohos.devtools.views.trace.fragment.CpuDataFragment; +import ohos.devtools.views.trace.fragment.CpuFreqDataFragment; +import ohos.devtools.views.trace.fragment.MemDataFragment; +import ohos.devtools.views.trace.fragment.ProcessDataFragment; +import ohos.devtools.views.trace.fragment.ThreadDataFragment; +import ohos.devtools.views.trace.listener.IFlagListener; +import ohos.devtools.views.trace.util.Db; +import ohos.devtools.views.trace.util.TimeUtils; +import ohos.devtools.views.trace.util.Utils; + +import javax.swing.JLayeredPane; +import javax.swing.SwingUtilities; +import java.awt.Rectangle; +import java.awt.event.AdjustmentEvent; +import java.awt.event.AdjustmentListener; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ForkJoinPool; +import java.util.stream.Collectors; + +import static java.awt.event.KeyEvent.VK_A; +import static java.awt.event.KeyEvent.VK_CONTROL; +import static java.awt.event.KeyEvent.VK_D; +import static java.awt.event.KeyEvent.VK_S; +import static java.awt.event.KeyEvent.VK_SHIFT; +import static java.awt.event.KeyEvent.VK_W; + +/** + * Analysis component + * + * @version 1.0.1 + * @date 2021/04/20 12:24 + */ +public final class AnalystPanel extends JBLayeredPane + implements MouseWheelListener, KeyListener, MouseListener, MouseMotionListener { + /** + * cpu click listener + */ + public static ICpuDataClick iCpuDataClick; + + /** + * thread click listener + */ + public static IThreadDataClick iThreadDataClick; + + /** + * function click listener + */ + public static IFunctionDataClick iFunctionDataClick; + + /** + * flag click listener + */ + public static IFlagClick iFlagClick; + + /** + * cpu data list + */ + public static List> cpuList; + + /** + * cpu freg data list + */ + public static List> cpuFreqList; + + /** + * thread data list + */ + public static List threadsList; + + /** + * duration + */ + public static long DURATION = 10_000_000_000L; + + /** + * cpu count + */ + public static int cpuNum; + + /** + * bottom tab + */ + public TabPanel tab; + + private final javax.swing.JScrollPane scrollPane = new JBScrollPane(); + private ContentPanel contentPanel; + private TimeViewPort viewport; + private final int defaultFragmentHeight = 40; + private double wheelSize; + private double rangeNs; + private double lefPercent; + private double rightPercent; + private long startNS; + private final double defaultScale = 0.1; + private boolean isUserInteraction; + + /** + * Constructor + */ + public AnalystPanel() { + viewport = new TimeViewPort(height -> viewport.setBorder(null), (sn, en) -> { + // When the time axis range changes, + // the contentPanel is notified that all data is refreshed according to the time axis + contentPanel.rangeChange(sn, en); + }); + setBorder(null); + contentPanel = new ContentPanel(this); + contentPanel.setBorder(null); + viewport.setView(contentPanel); + scrollPane.setViewport(viewport); + scrollPane.setBorder(null); + viewport.addChangeListener(event -> { + if (TabPanel.getMyHeight() != 0) { + moveToFront(tab); + } + }); + tab = new TabPanel(); + this.add(scrollPane); + this.add(tab); + tab.setFocusable(true); + // tab Set invisible first + this.setLayer(scrollPane, DEFAULT_LAYER); + this.setPosition(scrollPane, 0); + this.setLayer(tab, FRAME_CONTENT_LAYER); + this.setPosition(tab, 1); + this.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(final ComponentEvent event) { + super.componentResized(event); + Rectangle rootBounds = AnalystPanel.this.getBounds(); + scrollPane.setBounds(rootBounds); + tab.setBounds(rootBounds.x, rootBounds.height - tab.getMHeight(), rootBounds.width, tab.getMHeight()); + viewport.setRootHeight(getHeight()); + contentPanel.repaint(); + } + }); + contentPanel.setFocusable(true); + contentPanel.addMouseMotionListener(this); + contentPanel.addMouseListener(this); + contentPanel.addKeyListener(this); + iCpuDataClick = cpu -> clickCpuData(cpu); + iThreadDataClick = thread -> clickThreadData(thread); + iFunctionDataClick = fun -> clickFunctionData(fun); + iFlagClick = flag -> clickTimeFlag(flag); + scrollPane.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() { + @Override + public void adjustmentValueChanged(final AdjustmentEvent e) { + tab.hide(); + } + }); + } + + /** + * add cpu data list + * + * @param list source + */ + public void addCpuList(final List> list) { + cpuList = list; + cpuNum = list.size(); + for (int index = 0; index < list.size(); index++) { + List dataList = list.get(index); + contentPanel.addDataFragment(new CpuDataFragment(contentPanel, index, dataList)); + } + } + + /** + * add cpu freg data list + * + * @param list source + * @param cpuMaxFreq cpu size + */ + public void addCpuFreqList(final List> list, final Map cpuMaxFreq) { + cpuFreqList = list; + for (int index = 0; index < list.size(); index++) { + List dataList = list.get(index); + + // Fill in the duration field in FreqData and calculate based on the start time of the next node + for (int idx = 0, len = dataList.size(); idx < len; idx++) { + CpuFreqData cpuGraph = dataList.get(idx); + if (idx == len - 1) { + cpuGraph.setDuration(AnalystPanel.DURATION - cpuGraph.getStartTime()); + } else { + cpuGraph.setDuration(dataList.get(idx + 1).getStartTime() - cpuGraph.getStartTime()); + } + } + contentPanel.addDataFragment( + new CpuFreqDataFragment(contentPanel, "Cpu " + index + " Frequency", cpuMaxFreq, dataList)); + } + } + + /** + * add thread data list + * + * @param list thread list + * @param processMem process list + */ + public void addThreadsList(final List list, final List processMem) { + threadsList = list; + List processes = Db.getInstance().queryProcess(); + for (Process process : processes) { + if (process.getPid() == 0) { + continue; + } + ProcessDataFragment processDataFragment = new ProcessDataFragment(contentPanel, process); + contentPanel.addDataFragment(processDataFragment); + processMem.stream().filter(mem -> mem.getPid() == process.getPid()).forEach(mem -> { + MemDataFragment fgr = new MemDataFragment(contentPanel, mem); + fgr.defaultHeight = defaultFragmentHeight; + fgr.parentUuid = processDataFragment.uuid; + fgr.visible = false; + contentPanel.addDataFragment(fgr); + }); + List collect = list.stream().filter( + threadData -> threadData.getPid() == process.getPid() && threadData.getTid() != 0 + && threadData.getThreadName() != null).collect(Collectors.toList()); + for (ThreadData data : collect) { + ThreadDataFragment fgr = new ThreadDataFragment(contentPanel, data); + fgr.defaultHeight = defaultFragmentHeight; + fgr.parentUuid = processDataFragment.uuid; + fgr.visible = false; + contentPanel.addDataFragment(fgr); + } + } + list.stream().filter(data -> data.getProcessName() == null || data.getProcessName().isEmpty()) + .forEach(threadData -> { + Process process = new Process(); + process.setPid(threadData.getTid()); + process.setName(threadData.getThreadName()); + ProcessDataFragment processDataFragment = new ProcessDataFragment(contentPanel, process); + contentPanel.addDataFragment(processDataFragment); + if (!process.getName().startsWith("swapper") && process.getPid() != 0) { + ThreadDataFragment fgr = new ThreadDataFragment(contentPanel, threadData); + fgr.defaultHeight = defaultFragmentHeight; + fgr.parentUuid = processDataFragment.uuid; + fgr.visible = false; + contentPanel.addDataFragment(fgr); + } + }); + } + + /** + * load database + * + * @param name db name + * @param isLocal is local db + */ + public void load(final String name, final boolean isLocal) { + Db.setDbName(name); + Db.load(isLocal); + ForkJoinPool.commonPool().submit(() -> { + DURATION = Db.getInstance().queryTotalTime(); + + // Add cpu time slice information + int cpuMax = Db.getInstance().queryCpuMax(); + List> list = new ArrayList<>(); + for (int index = 0; index <= cpuMax; index++) { + List cpuData = Db.getInstance().queryCpuData(index); + list.add(cpuData); + } + + // Add cpu frequency information + List> freqList = + Db.getInstance().queryCpuFreq().stream().map(Db.getInstance()::queryCpuFreqData) + .collect(Collectors.toList()); + + // Add the memory information of the process + List processMem = Db.getInstance().getProcessMem(); + + // Add thread information + List processThreads = Db.getInstance().queryProcessThreads(); + Map cpuMaxFreq = Db.getInstance().queryCpuMaxFreq(); + javax.swing.SwingUtilities.invokeLater(() -> { + viewport.rulerFragment.setRange(0, AnalystPanel.DURATION, 0); + tab.hide(); + addCpuList(list); + addCpuFreqList(freqList, cpuMaxFreq); + addThreadsList(processThreads, processMem); // The memory information of the process and + + // The thread information of the process is displayed together + contentPanel.refresh(); + }); + }); + } + + /** + * cpu data click callback + */ + public interface ICpuDataClick { + /** + * cpu data click callback + * + * @param cpu cpu + */ + void click(CpuData cpu); + } + + /** + * thread data click callback + */ + public interface IThreadDataClick { + /** + * thread data click callback + * + * @param data thread + */ + void click(ThreadData data); + } + + /** + * function data click callback + */ + public interface IFunctionDataClick { + /** + * function data click callback + * + * @param data function + */ + void click(FunctionBean data); + } + + /** + * flag click callback + */ + public interface IFlagClick { + /** + * flag click callback + * + * @param data flag + */ + void click(FlagBean data); + } + + /** + * The bottom tab is displayed when the method event is clicked. + * + * @param bean function + */ + public void clickFunctionData(final FunctionBean bean) { + setLayer(tab, JLayeredPane.DRAG_LAYER); + ArrayList dataSource = new ArrayList<>(); + dataSource.add(ScrollSlicePanel.createSliceData("Name", bean.getFunName(), false)); + dataSource.add(ScrollSlicePanel.createSliceData("Category", bean.getCategory(), false)); + dataSource.add( + ScrollSlicePanel.createSliceData("StartTime", TimeUtils.getTimeString(bean.getStartTime()) + "", false)); + dataSource + .add(ScrollSlicePanel.createSliceData("Duration", TimeUtils.getTimeString(bean.getDuration()) + "", false)); + SwingUtilities.invokeLater(() -> { + tab.recovery(); + tab.removeAll(); + ScrollSlicePanel ssp = new ScrollSlicePanel(); + ssp.setData("Slice Details", dataSource, null); + tab.add("Current Selection", ssp); + }); + } + + /** + * When you click the CPU event, the bottom tab is displayed. + * + * @param threadData thread + */ + public void clickThreadData(final ThreadData threadData) { + setLayer(tab, javax.swing.JLayeredPane.DRAG_LAYER); + ArrayList dataSource = new ArrayList<>(); + dataSource.add(ScrollSlicePanel + .createSliceData("StartTime", TimeUtils.getTimeString(threadData.getStartTime()) + "", false)); + dataSource.add(ScrollSlicePanel + .createSliceData("Duration", TimeUtils.getTimeString(threadData.getDuration()) + "", false)); + String state = Utils.getEndState(threadData.getState()); + if ("Running".equals(Utils.getEndState(threadData.getState()))) { + state = state + " on CPU " + threadData.getCpu(); + } + dataSource.add(ScrollSlicePanel.createSliceData("State", state, false)); + String processName = threadData.getProcessName(); + if (processName == null || processName.isEmpty()) { + processName = threadData.getThreadName(); + } + dataSource + .add(ScrollSlicePanel.createSliceData("Process", processName + " [" + threadData.getPid() + "]", false)); + javax.swing.SwingUtilities.invokeLater(() -> { + tab.recovery(); + tab.removeAll(); + ScrollSlicePanel ssp = new ScrollSlicePanel(); + ssp.setData("Thread State", dataSource, null); + tab.add("Current Selection", ssp); + }); + } + + /** + * The bottom tab is displayed when you click the CPU event. + * + * @param cpu cpu + */ + public void clickCpuData(final CpuData cpu) { + setLayer(tab, javax.swing.JLayeredPane.DRAG_LAYER); + ArrayList dataSource = new ArrayList<>(); + String process = cpu.getProcessName(); + int processId = cpu.getProcessId(); + if (cpu.getProcessName() == null || cpu.getProcessName().isEmpty()) { + process = cpu.getName(); + processId = cpu.getTid(); + } + dataSource.add(ScrollSlicePanel.createSliceData("Process", process + " [" + processId + "]", false)); + dataSource.add(ScrollSlicePanel.createSliceData("Thread", cpu.getName() + " [" + cpu.getTid() + "]", true)); + dataSource.add(ScrollSlicePanel.createSliceData("CmdLine", cpu.getProcessCmdLine() + "", false)); + dataSource.add( + ScrollSlicePanel.createSliceData("StartTime", TimeUtils.getTimeString(cpu.getStartTime()) + "", false)); + dataSource + .add(ScrollSlicePanel.createSliceData("Duration", TimeUtils.getTimeString(cpu.getDuration()) + "", false)); + dataSource.add(ScrollSlicePanel.createSliceData("Prio", cpu.getPriority() + "", false)); + dataSource.add(ScrollSlicePanel.createSliceData("End State", Utils.getEndState(cpu.getEndState()), false)); + + // wakeup description + ForkJoinPool.commonPool().submit(() -> { + Optional wb = Db.getInstance().queryWakeupThread(cpu); + SwingUtilities.invokeLater(() -> { + contentPanel.setWakeupBean(wb.orElse(null)); + tab.recovery(); + tab.removeAll(); + ScrollSlicePanel ssp = new ScrollSlicePanel(); + ssp.setData("Slice Details", dataSource, wb.orElse(null)); + tab.add("Current Selection", ssp); + repaint(); + }); + }); + } + + /** + * Evoking the red flag corresponds to the tabPanel at the bottom. + * + * @param flagBean flag + */ + public void clickTimeFlag(final FlagBean flagBean) { + setLayer(tab, javax.swing.JLayeredPane.DRAG_LAYER); + tab.recovery(); + tab.removeAll(); + ScrollFlagPanel flagPanel = new ScrollFlagPanel(flagBean); + flagPanel.setFlagListener(new IFlagListener() { + @Override + public void flagRemove(final FlagBean flag) { + flag.remove(); + viewport.rulerFragment.repaint(); + tab.recovery(); + tab.removeAll(); + tab.hide(); + } + + @Override + public void flagChange(final FlagBean flag) { + if (flag.getName() != null && !flag.getName().isEmpty()) { + flagBean.setName(flag.getName()); + } + flagBean.setColor(flag.getColor()); + viewport.rulerFragment.repaint(); + } + }); + tab.add("Current Selection", flagPanel); + } + + @Override + public void keyTyped(final KeyEvent event) { + } + + @Override + public void keyPressed(final KeyEvent event) { + switch (event.getExtendedKeyCode()) { + case VK_A: + wheelSize = viewport.rulerFragment.getScale() * -0.2; + translation(); + break; + case VK_D: + wheelSize = viewport.rulerFragment.getScale() * 0.2; + translation(); + break; + case VK_W: + wheelSize = viewport.rulerFragment.getScale() * -0.2; + lefPercent = 0.5; + scale(); + break; + case VK_S: + wheelSize = viewport.rulerFragment.getScale() * 0.2; + lefPercent = 0.5; + scale(); + break; + case VK_SHIFT: + case VK_CONTROL: + if (!isUserInteraction) { + isUserInteraction = true; + contentPanel.addMouseWheelListener(this); + } + break; + default: + break; + } + } + + @Override + public void keyReleased(final KeyEvent event) { + switch (event.getExtendedKeyCode()) { + case VK_SHIFT: + case VK_CONTROL: + if (isUserInteraction) { + isUserInteraction = false; + contentPanel.removeMouseWheelListener(this); + } + break; + default: + break; + } + } + + @Override + public void mouseClicked(final MouseEvent event) { + contentPanel.fragmentList.forEach(fragment -> fragment.mouseClicked(event)); + } + + @Override + public void mousePressed(final MouseEvent event) { + viewport.mousePressed(event); + contentPanel.fragmentList.forEach(fragment -> fragment.mouseReleased(event)); + } + + @Override + public void mouseReleased(final MouseEvent event) { + contentPanel.fragmentList.forEach(fragment -> fragment.mouseReleased(event)); + } + + @Override + public void mouseEntered(final MouseEvent event) { + contentPanel.fragmentList.forEach(fragment -> fragment.mouseEntered(event)); + } + + @Override + public void mouseExited(final MouseEvent event) { + contentPanel.fragmentList.forEach(fragment -> fragment.mouseExited(event)); + } + + @Override + public void mouseDragged(final MouseEvent event) { + viewport.mouseDragged(event); + } + + @Override + public void mouseMoved(final MouseEvent event) { + viewport.mouseMoved(event); + if (event.getY() < tab.getBounds().y) { + contentPanel.requestFocusInWindow(); + } + contentPanel.fragmentList.forEach(fragment -> fragment.mouseMoved(event)); + } + + @Override + public void mouseWheelMoved(final MouseWheelEvent event) { + tab.hide(); + if (event.isShiftDown() && !event.isControlDown()) { // Pan + long scale = viewport.rulerFragment.getScale(); + if (Math.abs(event.getPreciseWheelRotation()) >= 1) { + wheelSize = scale * event.getPreciseWheelRotation() * defaultScale; + } else { + wheelSize = scale * event.getPreciseWheelRotation(); + } + translation(); + } + if (event.isControlDown() && !event.isShiftDown()) { // Zoom + if (Math.abs(event.getPreciseWheelRotation()) >= 1) { + wheelSize = viewport.rulerFragment.getScale() * event.getPreciseWheelRotation() * defaultScale; + } else { + wheelSize = viewport.rulerFragment.getScale() * event.getPreciseWheelRotation(); + } + int rulerFragmentWidth = viewport.rulerFragment.getRect().width; + lefPercent = (event.getX() - viewport.rulerFragment.getRect().x) * 1.0 / rulerFragmentWidth; + if (scaleMin(event)) { + scale(); + } + } + } + + private boolean scaleMin(MouseWheelEvent event) { + if (event.getPreciseWheelRotation() < 0) { // Zoom out + long rightNS = viewport.rulerFragment.getRightNS(); + long leftNS = viewport.rulerFragment.getLeftNS(); + long centerNS = viewport.rulerFragment.getCenterNS(); + final int minRul = 1000; + if (rightNS - leftNS <= minRul) { + rightNS = leftNS + minRul; + centerNS = leftNS; + viewport.rulerFragment.setRange(leftNS, rightNS, centerNS); + viewport.cpuFragment.setRange(leftNS, rightNS); + for (AbstractDataFragment fragment : viewport.favoriteFragments) { + fragment.range(leftNS, rightNS); + } + repaint(); + return false; + } + } + return true; + } + + private void scale() { + if (lefPercent < 0) { + lefPercent = 0; + } + if (lefPercent > 1) { + lefPercent = 1; + } + rightPercent = 1 - lefPercent; + if (lefPercent > 0) { + double leftNs = viewport.rulerFragment.getLeftNS() - this.wheelSize * lefPercent; + viewport.rulerFragment.setLeftNS((long) leftNs); + } + if (rightPercent > 0) { + double rightNs = viewport.rulerFragment.getRightNS() + this.wheelSize * rightPercent; + viewport.rulerFragment.setRightNS((long) rightNs); + } + if (viewport.rulerFragment.getLeftNS() <= 0) { + viewport.rulerFragment.setLeftNS(0); + } + if (viewport.rulerFragment.getRightNS() >= DURATION) { + viewport.rulerFragment.setRightNS(DURATION); + } + viewport.rulerFragment.setCenterNS(viewport.rulerFragment.getLeftNS()); + viewport.rulerFragment.setRange(viewport.rulerFragment.getLeftNS(), viewport.rulerFragment.getRightNS(), + viewport.rulerFragment.getCenterNS()); + viewport.cpuFragment.setRange(viewport.rulerFragment.getLeftNS(), viewport.rulerFragment.getRightNS()); + if (lefPercent > 0) { + startNS = viewport.leftFragment.getStartNS(); + startNS -= wheelSize * lefPercent; + if (startNS > 0) { + viewport.leftFragment.setStartTime(startNS); + } else { + viewport.leftFragment.setStartTime(0); + } + } + for (AbstractDataFragment fragment : viewport.favoriteFragments) { + fragment.range(viewport.rulerFragment.getLeftNS(), viewport.rulerFragment.getRightNS()); + } + repaint(); + } + + private void translation() { + long leftNS = viewport.rulerFragment.getLeftNS(); + long rightNS = viewport.rulerFragment.getRightNS(); + long centerNS; + + if (leftNS + wheelSize <= 0) { + rangeNs = rightNS - leftNS; + leftNS = 0; + rightNS = (long) rangeNs; + centerNS = leftNS; + viewport.rulerFragment.setRange(leftNS, rightNS, centerNS); + viewport.cpuFragment.setRange(leftNS, rightNS); + viewport.leftFragment.setStartTime(0); + } else if (rightNS + wheelSize >= DURATION) { + rangeNs = rightNS - leftNS; + rightNS = DURATION; + leftNS = (long) (DURATION - rangeNs); + centerNS = leftNS; + viewport.rulerFragment.setRange(leftNS, rightNS, centerNS); + viewport.cpuFragment.setRange(leftNS, rightNS); + viewport.leftFragment.setStartTime(leftNS); + } else { + leftNS += wheelSize; + rightNS += wheelSize; + centerNS = leftNS; + viewport.rulerFragment.setRange(leftNS, rightNS, centerNS); + viewport.cpuFragment.setRange(leftNS, rightNS); + startNS = viewport.leftFragment.getStartNS(); + startNS += wheelSize; + viewport.leftFragment.setStartTime(startNS); + } + // Slide the icons that need to be viewed in the timeShaft collection + for (AbstractDataFragment fragment : viewport.favoriteFragments) { + fragment.range(leftNS, rightNS); + } + repaint(); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/BottomScrollPanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/BottomScrollPanel.java new file mode 100644 index 000000000..d303a74b3 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/BottomScrollPanel.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import com.intellij.ui.components.JBBox; +import com.intellij.ui.components.JBPanel; +import com.intellij.ui.components.JBScrollPane; + +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/** + * Bottom scroll component + * + * @date 2021/04/20 12:24 + * @version 1.0.1 + */ +public class BottomScrollPanel extends JBScrollPane { + /** + * box container + */ + protected JBBox box = JBBox.createHorizontalBox(); + + /** + * Constructor + */ + public BottomScrollPanel() { + setViewportView(box); + addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(final MouseEvent event) { + super.mouseEntered(event); + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + } + }); + } + + /** + * @date 2021/04/20 12:24 + * @version 1.0.1 + */ + public static class ChildPanel extends JBPanel { + /** + * line height + */ + public int lineHeight; + /** + * line width + */ + public int lineWidth; + + /** + * construct with line width and line height + * + * @param lineWidth line width + * @param lineHeight line height + */ + public ChildPanel(final int lineWidth, final int lineHeight) { + this.lineHeight = lineHeight; + this.lineWidth = lineWidth; + } + + @Override + public Dimension getMinimumSize() { + Dimension dimension = super.getMinimumSize(); + if (this.lineWidth != 0) { + dimension.width = lineWidth; + } + dimension.height = lineHeight; + return dimension; + } + + @Override + public Dimension getPreferredSize() { + Dimension dimension = super.getPreferredSize(); + if (this.lineWidth != 0) { + dimension.width = lineWidth; + } + dimension.height = lineHeight; + return dimension; + } + + @Override + public Dimension getMaximumSize() { + Dimension dimension = super.getMaximumSize(); + if (this.lineWidth != 0) { + dimension.width = lineWidth; + } + dimension.height = lineHeight; + return dimension; + } + } + + /** + * @date 2021/04/20 12:24 + * @version 1.0.1 + */ + public static class ChildLineComponent extends ChildPanel { + private static final int DEFAULT_LINE_HEIGHT = 27; + /** + * Monitor whether the mouse is moved into the component + */ + public boolean mouseIn; + + /** + * Constructor + */ + public ChildLineComponent() { + super(0, DEFAULT_LINE_HEIGHT); + addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(final MouseEvent event) { + childMouseEntered(event); + } + + @Override + public void mouseExited(final MouseEvent event) { + childMouseExited(event); + } + + @Override + public void mouseClicked(final MouseEvent event) { + childMouseClicked(event); + } + }); + } + + /** + * Custom mouse events + * + * @param event mouse event + */ + public void childMouseEntered(final MouseEvent event) { + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + mouseIn = true; + repaint(); + } + + /** + * Custom mouse events + * + * @param event mouse event + */ + public void childMouseExited(final MouseEvent event) { + mouseIn = false; + repaint(); + } + + /** + * Custom mouse events + * + * @param event mouse event + */ + public void childMouseClicked(final MouseEvent event) { } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/ContentPanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/ContentPanel.java new file mode 100644 index 000000000..c14a3536a --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/ContentPanel.java @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import com.intellij.ui.components.JBPanel; +import ohos.devtools.views.trace.bean.WakeupBean; +import ohos.devtools.views.trace.fragment.AbstractDataFragment; +import ohos.devtools.views.trace.util.Final; + +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * Rolling container + * + * @version 1.0.1 + * @date 2021/04/20 12:24 + */ +public final class ContentPanel extends JBPanel { + /** + * FragmentList to be rendered + */ + public List fragmentList = new ArrayList<>(); + + /** + * Analysis component + */ + public AnalystPanel analystPanel; + private WakeupBean wakeupBean; + + /** + * Constructor + * + * @param analystPanel component + */ + public ContentPanel(AnalystPanel analystPanel) { + this.analystPanel = analystPanel; + this.setOpaque(false); + setFont(Final.NORMAL_FONT); + } + + /** + * Sets the wakeupBean . + *

You can use getWakeupBean() to get the value of wakeupBean

+ * + * @param wakeup wakeup + */ + public void setWakeupBean(WakeupBean wakeup) { + this.wakeupBean = wakeup; + } + + /** + * Gets the value of wakeupBean . + * + * @return the value of ohos.devtools.views.trace.bean.WakeupBean + */ + public WakeupBean getWakeupBean() { + return wakeupBean; + } + + /** + * refresh bottom tab + */ + public void refreshTab() { + if (analystPanel != null) { + if (TabPanel.getMyHeight() != 0) { + analystPanel.moveToFront(analystPanel.tab); + } + } + } + + @Override + protected void paintComponent(Graphics graphics) { + super.paintComponent(graphics); + if (graphics instanceof Graphics2D) { + Graphics2D g2 = (Graphics2D) graphics; + g2.setFont(Final.NORMAL_FONT); + g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + if (getParent() instanceof TimeViewPort) { + TimeViewPort parent = (TimeViewPort) getParent(); + Rectangle viewRect = parent.getViewRect(); + // Render the line in the viewport display area, and the line beyond the range will not be rendered + fragmentList.stream().filter(fragment -> fragment.visible).filter(fragment -> { + if (fragment != null && fragment.getRect() != null && viewRect != null) { + return fragment.getRect().y + fragment.getRect().height >= viewRect.y + TimeViewPort.height + && fragment.getRect().y <= viewRect.y + viewRect.height - TabPanel.getMyHeight(); + } else { + return false; + } + }).forEach(fragment -> { + if (fragment != null) { + fragment.draw(g2); + } + }); + } + } + } + + /** + * add data line + * + * @param fragment data fragment + */ + public void addDataFragment(AbstractDataFragment fragment) { + fragmentList.add(fragment); + } + + /** + * add data line + * + * @param index line index + * @param fragment data fragment + */ + public void addDataFragment(int index, AbstractDataFragment fragment) { + fragmentList.add(index, fragment); + } + + /** + * refresh content data + */ + public void refresh() { + List fs = + fragmentList.stream().filter(fragment -> fragment.visible).collect(Collectors.toList()); + int timeViewHeight = TimeViewPort.height; + for (int index = 0, len = fs.size(); index < len; index++) { + AbstractDataFragment dataFragment = fs.get(index); + timeViewHeight += dataFragment.defaultHeight; + dataFragment.getRect().height = dataFragment.defaultHeight; + dataFragment.getDescRect().height = dataFragment.defaultHeight; + dataFragment.getDataRect().height = dataFragment.defaultHeight; + dataFragment.getRect().y = timeViewHeight - dataFragment.defaultHeight; + dataFragment.getDescRect().y = timeViewHeight - dataFragment.defaultHeight; + dataFragment.getDataRect().y = timeViewHeight - dataFragment.defaultHeight; + dataFragment.getRect().x = 0; + dataFragment.getDescRect().x = 0; + dataFragment.getDataRect().x = 200; + } + Dimension dim = new Dimension(0, timeViewHeight); + this.setPreferredSize(dim); + this.setSize(dim); + this.setMaximumSize(dim); + repaint(); + } + + /** + * time range change will call this + * + * @param startNS range start ns + * @param endNS range end ns + */ + public void rangeChange(long startNS, long endNS) { + fragmentList.forEach(fragment -> fragment.range(startNS, endNS)); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/ScrollFlagPanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/ScrollFlagPanel.java new file mode 100644 index 000000000..ec257a74b --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/ScrollFlagPanel.java @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import com.intellij.ui.components.JBLabel; +import com.intellij.ui.components.JBLayeredPane; +import com.intellij.ui.components.JBTextField; +import ohos.devtools.views.trace.bean.FlagBean; +import ohos.devtools.views.trace.listener.IFlagListener; +import ohos.devtools.views.trace.util.Final; +import ohos.devtools.views.trace.util.TimeUtils; + +import javax.swing.JButton; +import javax.swing.JColorChooser; +import javax.swing.JDialog; +import javax.swing.colorchooser.AbstractColorChooserPanel; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Graphics; +import java.awt.Rectangle; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/** + * flag component + * + * @version 1.0.1 + * @date 2021/04/20 12:24 + */ +public class ScrollFlagPanel extends BottomScrollPanel { + private FlagBean flag; + private JBLabel title = new JBLabel("Annotation at "); + private JBLabel changeColor = new JBLabel("Change Color "); + private JBTextField input; + private ColorPanel colorPanel = new ColorPanel(Color.magenta); + private JButton remove = new JButton("Remove"); + private JBLayeredPane layer; + private IFlagListener flagListener; + + /** + * construct + * + * @param flag flag object + */ + public ScrollFlagPanel(FlagBean flag) { + super(); + setFont(Final.NORMAL_FONT); + this.flag = flag; + if (this.flag != null) { + this.flag = new FlagBean(); + } + setFocusable(true); + layer = new JBLayeredPane(); + setViewportView(layer); + input = new JBTextField(); + box.add(title); + box.add(input); + box.add(changeColor); + box.add(colorPanel); + box.add(remove); + layer.add(box); + input.setText(flag.getName()); + colorPanel.setCurrentColor(flag.getColor()); + layer.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent componentEvent) { + super.componentResized(componentEvent); + Rectangle rootBounds = layer.getBounds(); + box.setBounds(rootBounds.x + 10, rootBounds.y + 10, + rootBounds.width - 20, 40); + } + }); + input.addKeyListener(new KeyAdapter() { + @Override + public void keyPressed(KeyEvent keyEvent) { + if (keyEvent.getKeyCode() == KeyEvent.VK_ENTER) { + if (flagListener != null) { + flag.setName(input.getText()); + flagListener.flagChange(flag); + } + } + } + }); + remove.addActionListener(actionEvent -> { + if (flagListener != null) { + flagListener.flagRemove(flag); + } + }); + setData(flag); + } + + /** + * set flag object + * + * @param flag flag object + */ + public void setData(FlagBean flag) { + this.flag = flag; + title.setText("Annotation at " + TimeUtils.getTimeString(flag.getNs())); + input.setText(flag.getName()); + colorPanel.setCurrentColor(flag.getColor() == null ? Color.pink : flag.getColor()); + } + + /** + * set flag listener + * + * @param listener listener + */ + public void setFlagListener(IFlagListener listener) { + this.flagListener = listener; + } + + /** + * @version 1.0.1 + * @date 2021/04/20 12:24 + */ + class ColorPanel extends ChildPanel { + private Color currentColor; + private JColorChooser colorChooser; + private Cursor handCursor = new Cursor(Cursor.HAND_CURSOR); + + public ColorPanel(Color color) { + super(60, 24); + this.currentColor = color; + colorChooser = new JColorChooser(color); + AbstractColorChooserPanel[] cps = colorChooser.getChooserPanels(); + for (AbstractColorChooserPanel cp : cps) { + colorChooser.removeChooserPanel(cp); + } + colorChooser.addChooserPanel(cps[3]); + this.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(final MouseEvent mouseEvent) { + selectColor(); + } + + @Override + public void mouseEntered(final MouseEvent mouseEvent) { + setCursor(handCursor); + } + + @Override + public void mouseExited(final MouseEvent mouseEvent) { + setCursor(handCursor); + } + }); + } + + /** + * set current color + * + * @param currentColor color + */ + public void setCurrentColor(Color currentColor) { + this.currentColor = currentColor; + flag.setColor(currentColor); + if (flagListener != null) { + flagListener.flagChange(flag); + } + repaint(); + } + + /** + * select flag color + */ + public void selectColor() { + JDialog dialog = JColorChooser.createDialog(getRootPane(), "Choose Color", true, colorChooser, + actionEvent -> setCurrentColor(colorChooser.getColor()), null); + dialog.setVisible(true); + } + + @Override + public void paint(Graphics graphics) { + super.paint(graphics); + graphics.setColor(getForeground()); + graphics.drawRect(0, 0, 60, lineHeight); + graphics.setColor(currentColor); + graphics.fillRect(10, 6, 40, lineHeight - 12); + } + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/ScrollSlicePanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/ScrollSlicePanel.java new file mode 100644 index 000000000..7045aa4e2 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/ScrollSlicePanel.java @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import com.intellij.ui.components.JBBox; +import ohos.devtools.views.trace.bean.WakeupBean; +import ohos.devtools.views.trace.listener.IScrollSliceLinkListener; +import ohos.devtools.views.trace.util.Final; +import ohos.devtools.views.trace.util.TimeUtils; +import ohos.devtools.views.trace.util.Utils; + +import javax.imageio.ImageIO; +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Cursor; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; +import java.awt.geom.Rectangle2D; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * bottom Slice panel + * + * @version 1.0.1 + * @date 2021/04/20 12:24 + */ +public class ScrollSlicePanel extends BottomScrollPanel { + private Font font = getFont(); + private List comps = new ArrayList<>(); + private List dataSource; + private WakeupBean wakeupBean; + private IScrollSliceLinkListener listener; + + /** + * set component data source + * + * @param title table title + * @param dataSource table data source + * @param wakeupBean wakeup data information + */ + public void setData(String title, List dataSource, WakeupBean wakeupBean) { + this.dataSource = dataSource; + this.wakeupBean = wakeupBean; + box.removeAll(); + JBBox b1 = JBBox.createVerticalBox(); + b1.add(new TitlePanel(title)); + comps.clear(); + if (dataSource != null) { + for (SliceData sliceData : dataSource) { + LineComponent lc = new LineComponent(sliceData.key, sliceData.value == null ? "" : sliceData.value, + sliceData.linkable); + lc.setListener(listener); + comps.add(lc); + b1.add(lc); + } + } + b1.add(JBBox.createVerticalGlue()); + JBBox b2 = JBBox.createVerticalBox(); + b2.add(new RightPanel()); + b2.add(JBBox.createVerticalGlue()); + box.add(b1); + box.add(b2); + revalidate(); + } + + /** + * set link click listener + * + * @param listener listener + */ + public void setScrollSliceLinkListener(IScrollSliceLinkListener listener) { + this.listener = listener; + for (LineComponent comp : comps) { + if (comp.linkable) { + comp.setListener(listener); + } + } + } + + /** + * create table line data + * + * @param key key + * @param value value + * @param linkable link + * @return SliceData data + */ + public static SliceData createSliceData(String key, String value, boolean linkable) { + SliceData data = new SliceData(); + data.key = key; + data.value = value; + data.linkable = linkable; + return data; + } + + /** + * @version 1.0.1 + * @date 2021/04/20 12:24 + */ + public static class SliceData { + /** + * parameter key + */ + public String key; + + /** + * parameter value + */ + public String value; + + /** + * parameter linkable + */ + public boolean linkable; + } + + /** + * @version 1.0.1 + * @date 2021/04/20 12:24 + */ + class RightPanel extends ChildPanel { + private final int[][] pointX = {{11, 2, 11, 20}, {13, 13, 18, 20, 15, 20, 18}, {103, 103, 98, 96, 101, 96, 98}}; + private final int[][] pointY = {{50, 58, 66, 58}, {120, 124, 129, 127, 122, 117, 115}}; + private final int strStartX = 30; + private final int lineCharSize = 60; + + /** + * RightPanel constructor + */ + public RightPanel() { + super(0, 222); + } + + /** + * paint + * + * @param graphics graphics + */ + @Override + public void paint(Graphics graphics) { + super.paint(graphics); + setFont(Final.NORMAL_FONT); + if (wakeupBean == null || wakeupBean.getWakeupProcess() == null) { + return; + } + graphics.setFont(font.deriveFont(13f)); + if (graphics instanceof Graphics2D) { + ((Graphics2D) graphics) + .setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + ((Graphics2D) graphics) + .setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + } + graphics.drawString("Scheduling Latency", 10, 20); + graphics.fillRect(10, 30, 3, 130); + graphics.fillPolygon(pointX[0], pointY[0], pointX[0].length); + graphics.fillPolygon(pointX[1], pointY[1], pointX[1].length); + graphics.fillPolygon(pointX[2], pointY[1], pointX[2].length); + graphics.fillRect(13, 121, 90, 3); + graphics.setFont(font.deriveFont(11f)); + graphics.drawString( + "Wakeup @" + TimeUtils.getTimeString(wakeupBean.getWakeupTime()) + " on CPU " + wakeupBean + .getWakeupCpu() + " by", strStartX, 55); + graphics + .drawString("P:" + wakeupBean.getWakeupProcess() + " [ " + wakeupBean.getWakeupPid() + " ]", strStartX, + 75); + graphics + .drawString("T:" + wakeupBean.getWakeupThread() + " [ " + wakeupBean.getWakeupTid() + " ]", strStartX, + 95); + graphics.drawString("Scheduling latency:" + TimeUtils.getTimeString(wakeupBean.getSchedulingLatency()), 115, + 125); + graphics.setFont(font.deriveFont(9f)); + graphics.setColor(new Color(0x88, 0x88, 0x88)); + int lines = wakeupBean.getSchedulingDesc().length() % lineCharSize == 0 ? + wakeupBean.getSchedulingDesc().length() / lineCharSize : + wakeupBean.getSchedulingDesc().length() / lineCharSize + 1; + for (int index = 0; index < lines; index++) { + String str = ""; + if (index == lines - 1) { + str = wakeupBean.getSchedulingDesc().substring(index * lineCharSize); + } else { + str = wakeupBean.getSchedulingDesc().substring(index * lineCharSize, (index + 1) * lineCharSize); + } + graphics.drawString(str, 115, 142 + index * 14); + } + setFont(Final.NORMAL_FONT); + } + } + + /** + * @version 1.0.1 + * @date 2021/04/20 12:24 + */ + class TitlePanel extends ChildLineComponent { + private String title; + + /** + * set title + */ + public TitlePanel(String title) { + this.title = title; + setFont(Final.NORMAL_FONT); + } + + /** + * paint + * + * @param graphics graphics + */ + @Override + public void paint(Graphics graphics) { + super.paint(graphics); + graphics.setFont(font.deriveFont(13f)); + graphics.drawString(title, 10, 20); + } + } + + /** + * @version 1.0.1 + * @date 2021/04/20 12:24 + */ + class LineComponent extends ChildLineComponent { + /** + * linkable + */ + public boolean linkable; + + private String key; + + private String value; + + private IScrollSliceLinkListener listener; + + private Rectangle linkRect; + + private final int leftW = 200; + + /** + * LineComponent constructor + * + * @param key key + * @param value value + * @param linkable linkable + */ + public LineComponent(String key, String value, boolean linkable) { + super(); + this.key = key; + this.value = value; + this.linkable = linkable; + addMouseMotionListener(new MouseMotionAdapter() { + @Override + public void mouseMoved(final MouseEvent event) { + if (Utils.pointInRect(linkRect, event.getX(), event.getY())) { + setCursor(new Cursor(Cursor.HAND_CURSOR)); + } else { + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + } + } + }); + } + + /** + * set link listener + * + * @param listener listener + */ + public void setListener(IScrollSliceLinkListener listener) { + this.listener = listener; + } + + /** + * child mouse clicked + * + * @param event event + */ + @Override + public void childMouseClicked(final MouseEvent event) { + if (Utils.pointInRect(linkRect, event.getX(), event.getY())) { + if (listener != null) { + listener.linkClick(value); + } + } + } + + /** + * paint + * + * @param graphics graphics + */ + @Override + public void paint(Graphics graphics) { + super.paint(graphics); + graphics.setFont(font.deriveFont(11f)); + if (graphics instanceof Graphics2D) { + ((Graphics2D) graphics) + .setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + } + if (mouseIn) { + if (graphics instanceof Graphics2D) { + graphics.setColor(getForeground()); + Composite originalComposite = ((Graphics2D) graphics).getComposite(); + ((Graphics2D) graphics).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.15f)); + graphics.fillRect(0, 0, leftW - 2, lineHeight); + graphics.fillRect(leftW, 0, getWidth() - leftW, lineHeight); + ((Graphics2D) graphics).setComposite(originalComposite); + } + } + graphics.setColor(getForeground()); + graphics.drawString(key, 10, lineHeight / 2 + 4); + int sw = getWidth() - (leftW + 2); + int chars = sw / 7; + if (value.length() > chars && chars > 0) { + String vs1 = value.substring(0, chars); + String vs2 = value.substring(chars, value.length() - 1); + graphics.drawString(vs1, leftW + 2, lineHeight / 3); + graphics.drawString(vs2, leftW + 2, (lineHeight * 2) / 3); + } else { + graphics.drawString(value, leftW, lineHeight / 2 + 4); + } + if (linkable) { + try { + if (value != null && value.length() > 0) { + Rectangle2D bounds = graphics.getFontMetrics(font).getStringBounds(value, graphics); + linkRect = new Rectangle((int) (202 + bounds.getWidth() + 5), (lineHeight - 20) / 2, 20, 20); + Image link = ImageIO.read(getClass().getResourceAsStream("/assets/link.png")); + graphics.drawImage(link, linkRect.x + 2, linkRect.y + 3, 15, 15, null); + } + } catch (IOException ioException) { + ioException.printStackTrace(); + } + } + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/ScrollTablePanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/ScrollTablePanel.java new file mode 100644 index 000000000..e36fb07a6 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/ScrollTablePanel.java @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ohos.devtools.views.trace.component; + +import com.intellij.ui.components.JBBox; +import ohos.devtools.views.trace.bean.CPUProcessBean; +import ohos.devtools.views.trace.bean.CPUThreadBean; +import ohos.devtools.views.trace.util.Final; +import ohos.devtools.views.trace.util.Utils; + +import javax.imageio.ImageIO; +import java.awt.AlphaComposite; +import java.awt.Composite; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; +import java.awt.geom.Rectangle2D; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Scroll table component + * + * @version 1.0.1 + * @date 2021/04/20 12:24 + */ +public class ScrollTablePanel extends BottomScrollPanel { + private String[] columns; + private List dataSource = new ArrayList<>(); + + /** + * Constructor + * + * @param columns columns + * @param dataSource dataSource + */ + public ScrollTablePanel(String[] columns, ArrayList dataSource) { + super(); + setFont(Final.NORMAL_FONT); + box = JBBox.createVerticalBox(); + setViewportView(box); + setColumnsAndData(columns, dataSource); + } + + /** + * Set up columns and data sources + * + * @param columns columns + * @param dataSource dataSource + */ + public void setColumnsAndData(String[] columns, ArrayList dataSource) { + this.columns = columns; + this.dataSource = dataSource; + box.removeAll(); + if (columns != null) { + box.add(new TitleComponent()); + } + if (dataSource != null) { + for (Object obj : dataSource) { + box.add(new LineComponent(obj, columns.length)); + } + } + } + + /** + * @version 1.0.1 + * @date 2021/04/20 12:24 + */ + class TitleComponent extends ChildLineComponent { + private Rectangle[] rects = new Rectangle[columns.length]; + private int[] filters = {-1, -1}; + + @Override + public void childMouseClicked(final MouseEvent event) { + for (int index = 0; index < rects.length; index++) { + if (Utils.pointInRect(rects[index], event.getX(), event.getY())) { + if (filters[0] == index) { + filters[1] = filters[1] == 0 ? 1 : 0; + } else { + filters[0] = index; + filters[1] = 0; + } + repaint(); + return; + } + } + } + + @Override + public void paint(Graphics graphics) { + if (columns.length == 0) { + return; + } + graphics.setColor(getForeground()); + graphics.clearRect(0, 0, getWidth(), lineHeight); + graphics.setFont(getFont().deriveFont(Font.BOLD, 12f)); + int width = (getWidth() - 20) / columns.length; + if (mouseIn) { + if (graphics instanceof Graphics2D) { + Composite originalComposite = ((Graphics2D) graphics).getComposite(); + ((Graphics2D) graphics).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.15f)); + graphics.setColor(getForeground()); + graphics.fillRect(0, 0, getWidth(), lineHeight); + ((Graphics2D) graphics).setComposite(originalComposite); + } + graphics.setColor(getBackground()); + for (int index = 0; index < columns.length; index++) { + if (rects[index] == null) { + rects[index] = new Rectangle(10 + index * width - 4, 0, width - 2, lineHeight); + } + if (index > 0) { + graphics.fillRect(rects[index].x, rects[index].y, 2, rects[index].height); + } + } + } + graphics.setColor(getForeground()); + for (int index = 0; index < columns.length; index++) { + Rectangle2D bounds = graphics.getFontMetrics().getStringBounds(columns[index], graphics); + graphics.drawString(columns[index], 10 + index * width, lineHeight / 2 + 4); + if (index == filters[0]) { + try { + int xVal = (int) (10 + index * width + bounds.getWidth() + 10); + Image img = ImageIO.read( + getClass().getResourceAsStream(filters[1] == 0 ? "/assets/down.png" : "/assets/up.png")); + graphics.drawImage(img, xVal, (lineHeight - 20) / 2, 20, 20, null); + } catch (IOException ioException) { + ioException.printStackTrace(); + } + } + } + } + } + + /** + * @version 1.0.1 + * @date 2021/04/20 12:24 + */ + class LineComponent extends ChildLineComponent { + private Object data; + private int columnSize = 7; + private final int xAxis = 10; + + public LineComponent(Object data, int columnSize) { + super(); + this.data = data; + this.columnSize = columnSize; + } + + @Override + public void paint(Graphics graphics) { + graphics.setColor(getForeground()); + graphics.clearRect(0, 0, getWidth(), lineHeight); + graphics.setFont(getFont().deriveFont(11f)); + int width = (getWidth() - 20) / columnSize; + if (mouseIn) { + graphics.setColor(getForeground()); + Composite originalComposite = ((Graphics2D) graphics).getComposite(); + ((Graphics2D) graphics).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.15f)); + graphics.fillRect(0, 0, getWidth(), lineHeight); + ((Graphics2D) graphics).setComposite(originalComposite); + graphics.setColor(getBackground()); + for (int index = 0; index < columns.length; index++) { + if (index > 0) { + graphics.fillRect(xAxis + index * width - 4, 0, 2, lineHeight); + } + } + } + graphics.setColor(getForeground()); + int yNum = lineHeight / 2 + 4; + if (data instanceof CPUThreadBean) { + drawString(graphics, xAxis, yNum, width - 2, ((CPUThreadBean) data).getProcess()); + drawString(graphics, xAxis + 1 * width, yNum, width - 2, ((CPUThreadBean) data).getPid()); + drawString(graphics, xAxis + 2 * width, yNum, width - 2, ((CPUThreadBean) data).getThread()); + drawString(graphics, xAxis + 3 * width, yNum, width - 2, ((CPUThreadBean) data).getTid()); + drawString(graphics, xAxis + 4 * width, yNum, width - 2, ((CPUThreadBean) data).getWallDuration() + ""); + drawString(graphics, xAxis + 5 * width, yNum, width - 2, ((CPUThreadBean) data).getAvgDuration() + ""); + drawString(graphics, xAxis + 6 * width, yNum, width - 2, ((CPUThreadBean) data).getOccurrences()); + } + if (data instanceof CPUProcessBean) { + drawString(graphics, xAxis, yNum, width - 2, ((CPUProcessBean) data).getProcess()); + drawString(graphics, xAxis + 1 * width, yNum, width - 2, ((CPUProcessBean) data).getPid()); + drawString(graphics, xAxis + 2 * width, yNum, width - 2, + ((CPUProcessBean) data).getWallDuration() + ""); + drawString(graphics, xAxis + 3 * width, yNum, width - 2, ((CPUProcessBean) data).getAvgDuration() + ""); + drawString(graphics, xAxis + 4 * width, yNum, width - 2, ((CPUProcessBean) data).getOccurrences()); + } + } + + /** + * draw String + * + * @param graphics graphics + * @param xAxis xAxis + * @param yAxis yAxis + * @param width width + * @param str string + */ + private void drawString(Graphics graphics, int xAxis, int yAxis, int width, String str) { + int size = width / 7; + if (str.length() > size) { + graphics.drawString(str.substring(0, size) + "...", xAxis, yAxis); + } else { + graphics.drawString(str, xAxis, yAxis); + } + } + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/TabPanel.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/TabPanel.java new file mode 100644 index 000000000..2a921663c --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/TabPanel.java @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import com.intellij.ui.components.JBTabbedPane; +import ohos.devtools.views.trace.util.Final; +import ohos.devtools.views.trace.util.Utils; + +import javax.imageio.ImageIO; +import java.awt.Cursor; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionListener; +import java.io.IOException; + +/** + * tab component + * + * @version 1.0.1 + * @date 2021/04/20 12:12 + */ +public class TabPanel extends JBTabbedPane implements MouseMotionListener { + private static int mHeight = 300; + private static int barHeight; + + private final int iconWH = 20; + private Rectangle topRect; + private Rectangle bottomRect; + private int pressedY; + private Image top = null; + private Image bottom = null; + + /** + * construct + */ + public TabPanel() { + setFont(Final.NORMAL_FONT); + this.addMouseMotionListener(this); + try { + top = ImageIO.read(getClass().getResourceAsStream("/assets/top.png")); + bottom = ImageIO.read(getClass().getResourceAsStream("/assets/bottom.png")); + } catch (IOException ioException) { + ioException.printStackTrace(); + } + addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(final MouseEvent event) { + clickTop(event); + clickBottom(event); + } + + @Override + public void mousePressed(final MouseEvent event) { + pressedY = event.getYOnScreen(); + } + + @Override + public void mouseReleased(final MouseEvent event) { + super.mouseReleased(event); + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + } + }); + } + + @Override + public void paint(Graphics graphics) { + super.paint(graphics); + if (getTabCount() > 0) { + Rectangle tabBounds = getUI().getTabBounds(this, 0); + barHeight = tabBounds.height; + } + topRect = new Rectangle(getWidth() - 65, (barHeight - iconWH) / 2, iconWH, iconWH); + bottomRect = new Rectangle(getWidth() - 35, (barHeight - iconWH) / 2, iconWH, iconWH); + if (top != null) { + graphics.drawImage(top, topRect.x + 2, topRect.y + 2, iconWH - 5, iconWH - 5, null); + } + if (bottom != null) { + graphics.drawImage(bottom, bottomRect.x + 2, bottomRect.y + 2, iconWH - 5, iconWH - 5, null); + } + } + + @Override + public void mouseDragged(final MouseEvent event) { + if (getCursor().getType() == Cursor.N_RESIZE_CURSOR) { + Rectangle rect = getBounds(); + int drag = event.getYOnScreen() - pressedY; + pressedY = event.getYOnScreen(); + rect.y = rect.y + drag; + int ph = getParent().getHeight(); + int heightTmp = ph - rect.y; + if (heightTmp < barHeight) { + heightTmp = barHeight; + rect.y = ph - barHeight; + } + if (heightTmp > ph) { + rect.y = 0; + heightTmp = ph; + } + rect.height = heightTmp; + mHeight = rect.height; + setBounds(rect); + } + } + + @Override + public void mouseMoved(final MouseEvent event) { + int xAxis = event.getX(); + int yAxis = event.getY(); + int xNum = 0; + if (getTabCount() > 0) { + Rectangle rect = getUI().getTabBounds(this, getTabCount() - 1); + xNum = rect.width + rect.x + 10; + } + if (yAxis > 0 && yAxis < barHeight && xAxis > xNum) { + if (Utils.pointInRect(topRect, xAxis, yAxis) || Utils.pointInRect(bottomRect, xAxis, yAxis)) { + setCursor(new Cursor(Cursor.HAND_CURSOR)); + } else { + setCursor(new Cursor(Cursor.N_RESIZE_CURSOR)); + } + } else { + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + } + } + + /** + * Click to top + * + * @param event Mouse event + */ + private void clickTop(final MouseEvent event) { + if (Utils.pointInRect(topRect, event.getX(), event.getY())) { + mHeight = getParent().getHeight(); + setBounds(0, 0, getWidth(), mHeight); + } + } + + /** + * Click to bottom + * + * @param event Mouse event + */ + private void clickBottom(final MouseEvent event) { + if (Utils.pointInRect(bottomRect, event.getX(), event.getY())) { + hideInBottom(); + } + } + + /** + * Restore the default height of the bottom tab + */ + public void recovery() { + if (getMyHeight() == 0) { + mHeight = 300; + setBounds(0, getParent().getHeight() - mHeight, getWidth(), mHeight); + } + } + + /** + * Minimize the bottom tab + */ + public void hideInBottom() { + if (mHeight != barHeight && barHeight > 0) { + mHeight = barHeight; + setBounds(0, getParent().getHeight() - barHeight, getWidth(), mHeight); + } + } + + /** + * hide bottom tab + */ + public void hide() { + if (mHeight != 0) { + mHeight = 0; + setBounds(0, getParent().getHeight(), getWidth(), mHeight); + } + } + + /** + * Get the height of the current tab + * + * @return height + */ + public int getMHeight() { + return mHeight; + } + + /** + * Get the height of the current tab + * + * @return height + */ + public static int getMyHeight() { + return mHeight == barHeight || barHeight == 0 ? 0 : mHeight; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/TimeViewPort.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/TimeViewPort.java new file mode 100644 index 000000000..2d23ec71b --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/component/TimeViewPort.java @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import com.intellij.ui.components.JBViewport; +import ohos.devtools.views.trace.fragment.AbstractDataFragment; +import ohos.devtools.views.trace.fragment.CpuDataFragment; +import ohos.devtools.views.trace.fragment.ruler.CpuFragment; +import ohos.devtools.views.trace.fragment.ruler.LeftFragment; +import ohos.devtools.views.trace.fragment.ruler.RulerFragment; +import ohos.devtools.views.trace.fragment.ruler.TopFragment; +import ohos.devtools.views.trace.util.Final; + +import javax.swing.JComponent; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; + +/** + * Timeline component + * + * @version 1.0.1 + * @date 2021/04/20 12:24 + */ +public final class TimeViewPort extends JBViewport { + /** + * Initial height of the time axis + */ + public static int height = 140; + + /** + * Fragment above + */ + public TopFragment topFragment; + + /** + * Fragment on the left + */ + public LeftFragment leftFragment; + + /** + * Cpu fragment + */ + public CpuFragment cpuFragment; + + /** + * Rule fragment + */ + public RulerFragment rulerFragment; + + /** + * Favorite fragment list + */ + public List favoriteFragments = new ArrayList<>(); + + private final IRangeChangeListener rangeChangeListener; + private final IHeightChangeListener heightChangeListener; + + /** + * Timeline interval change listener + */ + @FunctionalInterface + public interface IRangeChangeListener { + void change(long startNS, long endNS); + } + + /** + * Height change listener + */ + @FunctionalInterface + public interface IHeightChangeListener { + void change(int height); + } + + /** + * Constructor。 + * + * @param heightChangeListener Altitude change monitoring + * @param rangeChangeListener Altitude change monitoring + */ + public TimeViewPort(IHeightChangeListener heightChangeListener, IRangeChangeListener rangeChangeListener) { + this.rangeChangeListener = rangeChangeListener; + this.heightChangeListener = heightChangeListener; + this.topFragment = new TopFragment(this); + this.leftFragment = new LeftFragment(this); + this.cpuFragment = new CpuFragment(this, (leftX, rightX, leftNS, rightNS, centerNS) -> { + leftFragment.setStartTime(leftNS); + rulerFragment.setRange(leftNS, rightNS, centerNS); + }); + this.rulerFragment = new RulerFragment(this, (startNS, endNS) -> { + if (rangeChangeListener != null) { + rangeChangeListener.change(startNS, endNS); + } + }); + this.setOpaque(true); + setFont(Final.NORMAL_FONT); + } + + /** + * set root height + * + * @param rootHeight root height + */ + public void setRootHeight(int rootHeight) { + rulerFragment.setExtendHeight(rootHeight - height); + leftFragment.setExtendHeight(rootHeight - height); + } + + /** + * collect fragment + * + * @param dataFragment fragment + */ + public void favorite(AbstractDataFragment dataFragment) { + dataFragment.getRect().y = height; + height += dataFragment.getRect().height; + favoriteFragments.add(dataFragment); + if (heightChangeListener != null) { + heightChangeListener.change(height); + repaint(); + } + } + + /** + * cancel collect fragment + * + * @param dataFragment fragment + */ + public void cancel(AbstractDataFragment dataFragment) { + if (favoriteFragments.contains(dataFragment)) { + height -= dataFragment.getRect().height; + favoriteFragments.remove(dataFragment); + if (heightChangeListener != null) { + heightChangeListener.change(height); + repaint(); + } + } + } + + @Override + protected void paintComponent(Graphics graphics) { + super.paintComponent(graphics); + } + + @Override + public void paint(Graphics graphics) { + super.paint(graphics); + if (graphics instanceof Graphics2D) { + Graphics2D g2 = (Graphics2D) graphics; + graphics.setColor(getBackground()); + graphics.fillRect(0, 0, getWidth(), height); + leftFragment.draw(g2); + topFragment.draw(g2); + cpuFragment.draw(g2); + rulerFragment.draw(g2); + } + } + + /** + * custom mouse event pressed + * + * @param event mouse event + */ + public void mousePressed(final MouseEvent event) { + Object eventSource = event.getSource(); + if (eventSource instanceof JComponent) { + JComponent jComponent = ((JComponent) eventSource); + int scrollY = event.getY() + jComponent + .getY(); // subtract the scroll height of the parent node. After scrolling down, y is a negative number. + cpuFragment.setSelectX(event.getX() < cpuFragment.getRect().x ? cpuFragment.getRect().x : event.getX()); + cpuFragment.setSelectY(scrollY); + rulerFragment + .setSelectX(event.getX() < rulerFragment.getRect().x ? rulerFragment.getRect().x : event.getX()); + rulerFragment.setSelectY(scrollY); + rulerFragment.mousePressed(event); + } + } + + /** + * custom mouse event dragged + * + * @param event mouse event + */ + public void mouseDragged(final MouseEvent event) { + cpuFragment.mouseDragged(event); + } + + /** + * custom mouse event moved + * + * @param event mouse event + */ + public void mouseMoved(final MouseEvent event) { + Object eventSource = event.getSource(); + if (eventSource instanceof JComponent) { + JComponent jComponent = ((JComponent) eventSource); + int scrollY = event.getY() + jComponent + .getY(); // Subtract the scroll height of the parent node. After scrolling down, y is a negative number. + cpuFragment.setSelectX(event.getX() < cpuFragment.getRect().x ? cpuFragment.getRect().x : event.getX()); + cpuFragment.setSelectY(scrollY); + rulerFragment + .setSelectX(event.getX() < rulerFragment.getRect().x ? rulerFragment.getRect().x : event.getX()); + rulerFragment.setSelectY(scrollY); + CpuDataFragment.focusCpuData = null; + rulerFragment.mouseMoved(event); + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/AbstractDataFragment.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/AbstractDataFragment.java new file mode 100644 index 000000000..6f79e5eae --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/AbstractDataFragment.java @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import ohos.devtools.views.trace.component.AnalystPanel; +import ohos.devtools.views.trace.fragment.ruler.AbstractFragment; + +import java.awt.AlphaComposite; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; +import java.util.UUID; + +/** + * Draw data rows + * + * @param Plot data type + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public abstract class AbstractDataFragment extends AbstractFragment { + /** + * uuid + */ + public String uuid = UUID.randomUUID().toString(); + + /** + * Parent node uuid + */ + public String parentUuid = UUID.randomUUID().toString(); + + /** + * The default height can be modified. After hiding, the height of rect descRect dataRect is 0, + * no rendering, and the display restores the height according to defaultHeight + */ + public int defaultHeight = 40; + + /** + * Small font + */ + public Font smallFont = new Font("宋体", Font.ITALIC, 10); + + /** + * Start event + */ + public long startNS; + + /** + * End event + */ + public long endNS; + + /** + * ndicates whether the data row is selected. + * null does not display the selected state. true/false displays the sufficient selection box + */ + public Boolean isSelected = false; + + /** + * Whether to show + */ + public boolean visible = true; + + /** + * Set to show or hide + * + * @param visible visible + */ + public void setVisible(boolean visible) { + this.visible = visible; + } + + /** + * Time range interval change + * + * @param startNS Starting time + * @param endNS End Time + */ + public void range(long startNS, long endNS) { + this.startNS = startNS; + this.endNS = endNS; + } + + /** + * Data click event + * + * @param event event + */ + public abstract void mouseClicked(MouseEvent event); + + /** + * Mouse click event + * + * @param event event + */ + public abstract void mousePressed(MouseEvent event); + + /** + * Mouse exited event + * + * @param event event + */ + public abstract void mouseExited(MouseEvent event); + + /** + * Mouse entered event + * + * @param event event + */ + public abstract void mouseEntered(MouseEvent event); + + /** + * Mouse move event + * + * @param event event + */ + public abstract void mouseMoved(MouseEvent event); + + /** + * Mouse release event + * + * @param event event + */ + public abstract void mouseReleased(MouseEvent event); + + /** + * Drawing method + * + * @param graphics graphics + */ + @Override + public void draw(Graphics2D graphics) { + if (endNS == 0) { + endNS = AnalystPanel.DURATION; + } + getRect().width = getRoot().getWidth(); + getDescRect().width = 200; + getDataRect().width = getRoot().getWidth() - 200; + graphics.setColor(getRoot().getForeground()); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .5f)); + graphics.drawLine(getRect().x, getRect().y + getRect().height, getRoot().getWidth(), + getRect().y + getRect().height); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f)); + } + + /** + * Calculate the x coordinate based on time + * + * @param ns time + * @return int x coordinate + */ + public int getX(long ns) { + if (endNS == 0) { + endNS = AnalystPanel.DURATION; + } + int xSize = (int) ((ns - startNS) * getDataRect().width / (endNS - startNS)); + if (xSize < 0) { + xSize = 0; + } + if (xSize > getDataRect().width) { + xSize = getDataRect().width; + } + return xSize; + } + + /** + * Calculate the x coordinate based on time + * + * @param ns time + * @return double Returns the x coordinate + */ + public double getXDouble(long ns) { + if (endNS == 0) { + endNS = AnalystPanel.DURATION; + } + double xSize = (ns - startNS) * getDataRect().width / (endNS - startNS); + if (xSize < 0) { + xSize = 0; + } + if (xSize > getDataRect().width) { + xSize = getDataRect().width; + } + return xSize; + } + + /** + * Clear focus + * + * @param event Mouse event + */ + public void clearFocus(MouseEvent event) { + if (edgeInspect(event)) { + CpuDataFragment.focusCpuData = null; + } + } + + /** + * Clear selection element + */ + public void clearSelected() { + if (CpuDataFragment.currentSelectedCpuData != null) { + CpuDataFragment.currentSelectedCpuData.select(false); + CpuDataFragment.currentSelectedCpuData.repaint(); + } + if (ThreadDataFragment.currentSelectedThreadData != null) { + ThreadDataFragment.currentSelectedThreadData.select(false); + ThreadDataFragment.currentSelectedThreadData.repaint(); + } + if (FunctionDataFragment.currentSelectedFunctionData != null) { + FunctionDataFragment.currentSelectedFunctionData.setSelected(false); + FunctionDataFragment.currentSelectedFunctionData.repaint(); + } + } + + /** + * Set rect object + * + * @param xSize x coordinate + * @param ySize y coordinate + * @param width width + * @param height height + */ + public void setRect(int xSize, int ySize, int width, int height) { + getRect().x = xSize; + getRect().y = ySize; + getRect().width = width; + getRect().height = height; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/CpuDataFragment.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/CpuDataFragment.java new file mode 100644 index 000000000..8cc05a38d --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/CpuDataFragment.java @@ -0,0 +1,371 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import ohos.devtools.views.trace.bean.CpuData; +import ohos.devtools.views.trace.component.AnalystPanel; +import ohos.devtools.views.trace.component.ContentPanel; +import ohos.devtools.views.trace.fragment.graph.CheckGraph; +import ohos.devtools.views.trace.fragment.graph.FavoriteGraph; +import ohos.devtools.views.trace.util.Final; +import ohos.devtools.views.trace.util.TimeUtils; + +import javax.swing.JComponent; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; +import java.awt.geom.Rectangle2D; +import java.util.List; +import java.util.Optional; + +/** + * cpu data + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class CpuDataFragment extends AbstractDataFragment implements CpuData.IEventListener { + /** + * The node that currently has focus + */ + public static CpuData focusCpuData; + + /** + * Currently selected cpu graphics node + */ + public static CpuData currentSelectedCpuData; + + /** + * cpu data collection + */ + public List data; + + /** + * Favorite button + */ + public FavoriteGraph favoriteGraph; + + /** + * Select button + */ + public CheckGraph checkGraph; + + private double x1; + + private double x2; + + private Rectangle2D bounds; + + private CpuData showTipCpuData; // Prompt window + + private int tipX; // X position of the message + + private int tipWidth; // Prompt message width + + private int index; + + private final BasicStroke boldStoke = new BasicStroke(2); + private final BasicStroke normalStoke = new BasicStroke(1); + + /** + * structure + * + * @param root root + * @param index index + * @param data data + */ + public CpuDataFragment(javax.swing.JComponent root, int index, List data) { + this.index = index; + this.setRoot(root); + this.data = data; + favoriteGraph = new FavoriteGraph(this, root); + checkGraph = new CheckGraph(this, root); + } + + /** + * Drawing method + * + * @param graphics graphics + */ + @Override + public void draw(Graphics2D graphics) { + super.draw(graphics); + + // Supplement the information on the left + graphics.setColor(getRoot().getForeground()); + bounds = graphics.getFontMetrics().getStringBounds("Cpu " + index, graphics); + graphics.drawString("Cpu " + index, (int) (getDescRect().getX() + 10), + (int) (getDescRect().getY() + (getDescRect().getHeight()) / 2 + bounds.getHeight() / 3)); + favoriteGraph.setRightGraph(isSelected != null ? checkGraph : null); + checkGraph.setChecked(isSelected); + checkGraph.draw(graphics); + favoriteGraph.draw(graphics); + data.stream().filter( + cpuData -> cpuData.getStartTime() + cpuData.getDuration() > startNS && cpuData.getStartTime() < endNS) + .forEach(cpuGraph -> { + if (cpuGraph.getStartTime() < startNS) { + x1 = 0; + } else { + x1 = getXDouble(cpuGraph.getStartTime()); + } + if (cpuGraph.getStartTime() + cpuGraph.getDuration() > endNS) { + x2 = getDataRect().width; + } else { + x2 = getXDouble(cpuGraph.getStartTime() + cpuGraph.getDuration()); + } + cpuGraph.setRoot(getRoot()); + double getV = x2 - x1 <= 0 ? 1 : x2 - x1; + cpuGraph + .setRect(x1 + getDataRect().getX(), getDataRect().getY() + 5, getV, getDataRect().getHeight() - 10); + cpuGraph.setEventListener(CpuDataFragment.this); + cpuGraph.draw(graphics); + }); + drawTips(graphics); + drawWakeup(graphics); + } + + private void drawTips(Graphics2D graphics) { + if (showTipCpuData != null) { + graphics.setFont(Final.NORMAL_FONT); + if (showTipCpuData.getProcessName() == null || showTipCpuData.getProcessName().isEmpty()) { + showTipCpuData.setProcessName(showTipCpuData.getName()); + } + String process = "P:" + showTipCpuData.getProcessName() + " [" + showTipCpuData.getProcessId() + "]"; + String thread = "T:" + showTipCpuData.getName() + " [" + showTipCpuData.getTid() + "]"; + Rectangle2D processBounds = graphics.getFontMetrics(Final.NORMAL_FONT).getStringBounds(process, graphics); + Rectangle2D threadBounds = graphics.getFontMetrics(Final.NORMAL_FONT).getStringBounds(thread, graphics); + tipWidth = (int) (Math.max(processBounds.getWidth(), threadBounds.getWidth()) + 20); + graphics.setColor(getRoot().getForeground()); + graphics.fillRect(tipX, showTipCpuData.rect.y, tipWidth, showTipCpuData.rect.height); + graphics.setColor(getRoot().getBackground()); + graphics.drawString(process, tipX + 10, showTipCpuData.rect.y + 12); + graphics.drawString(thread, tipX + 10, showTipCpuData.rect.y + 24); + } + } + + private void drawWakeup(Graphics2D graphics) { + if (getRoot() instanceof ContentPanel) { + ContentPanel contentPanel = (ContentPanel) getRoot(); + Optional.ofNullable(contentPanel.getWakeupBean()).ifPresent(wakeup -> { + int wakeupX = getX(wakeup.getWakeupTime()); + graphics.setColor(Color.BLACK); + graphics.setStroke(boldStoke); + Rectangle visibleRect = contentPanel.getVisibleRect(); + graphics.drawLine(wakeupX + getDataRect().x, visibleRect.y, wakeupX + getDataRect().x, + visibleRect.y + visibleRect.height); + if (wakeup.getWakeupCpu() == index) { + final int[] xs = + {getDataRect().x + wakeupX, getDataRect().x + wakeupX + 6, getDataRect().x + wakeupX, + getDataRect().x + wakeupX - 6}; + final int[] ys = {getRect().y + getRect().height / 2 - 10, getRect().y + getRect().height / 2, + getRect().y + getRect().height / 2 + 10, getRect().y + getRect().height / 2}; + graphics.fillPolygon(xs, ys, xs.length); + if (currentSelectedCpuData != null) { + Rectangle rectangle = new Rectangle(wakeupX + getDataRect().x, + currentSelectedCpuData.rect.y + currentSelectedCpuData.rect.height / 2, + currentSelectedCpuData.rect.x - wakeupX - getDataRect().x, 30); + graphics.drawLine(getDataRect().x + wakeupX, + currentSelectedCpuData.rect.y + currentSelectedCpuData.rect.height - 2, + currentSelectedCpuData.rect.x, + currentSelectedCpuData.rect.y + currentSelectedCpuData.rect.height - 2); + if (rectangle.width > 10) { + drawArrow(graphics, getDataRect().x + wakeupX, + currentSelectedCpuData.rect.y + currentSelectedCpuData.rect.height - 2, -1); + drawArrow(graphics, currentSelectedCpuData.rect.x, + currentSelectedCpuData.rect.y + currentSelectedCpuData.rect.height - 2, 1); + } + long offsetTime = currentSelectedCpuData.getStartTime() - wakeup.getWakeupTime(); + String timeString = TimeUtils.getTimeString(offsetTime); + rectangle.y -= 5; + drawString(graphics, rectangle, timeString, Placement.CENTER); + } + } + graphics.setStroke(normalStoke); + }); + } + } + + private void drawArrow(Graphics2D graphics, int xVal, int yVal, int align) { + if (align == -1) { + final int[] xArray = {xVal, xVal + 5, xVal + 5}; + final int[] yArray = {yVal, yVal - 5, yVal + 5}; + graphics.fillPolygon(xArray, yArray, xArray.length); + } + if (align == 1) { + final int[] xArray = {xVal, xVal - 5, xVal - 5}; + final int[] yArray = {yVal, yVal - 5, yVal + 5}; + graphics.fillPolygon(xArray, yArray, xArray.length); + } + } + + /** + * Mouse click event + * + * @param event event + */ + @Override + public void mouseClicked(MouseEvent event) { + if (favoriteGraph.edgeInspect(event)) { + favoriteGraph.onClick(event); + } + if (checkGraph.edgeInspect(event)) { + checkGraph.onClick(event); + } + data.stream().filter( + cpuData -> cpuData.getStartTime() + cpuData.getDuration() > startNS && cpuData.getStartTime() < endNS) + .filter(cpuData -> cpuData.edgeInspect(event)).findFirst().ifPresent(cpuData -> { + cpuData.onClick(event); + }); + } + + /** + * Mouse pressed event + * + * @param event event + */ + @Override + public void mousePressed(MouseEvent event) { + } + + /** + * Mouse exited event + * + * @param event event + */ + @Override + public void mouseExited(MouseEvent event) { + } + + /** + * Mouse entered event + * + * @param event event + */ + @Override + public void mouseEntered(MouseEvent event) { + } + + /** + * Mouse move event + * + * @param event event + */ + @Override + public void mouseMoved(MouseEvent event) { + favoriteGraph.display(edgeInspectRect(getDescRect(), event)); + if (favoriteGraph.edgeInspect(event)) { + if (!favoriteGraph.flagFocus) { + favoriteGraph.flagFocus = true; + favoriteGraph.onFocus(event); + } + } else { + if (favoriteGraph.flagFocus) { + favoriteGraph.flagFocus = false; + favoriteGraph.onBlur(event); + } + } + if (edgeInspect(event)) { + data.stream().filter( + cpuData -> cpuData.getStartTime() + cpuData.getDuration() > startNS && cpuData.getStartTime() < endNS) + .forEach(cpuData -> { + cpuData.onMouseMove(event); + if (cpuData.edgeInspect(event)) { + if (!cpuData.flagFocus) { + cpuData.flagFocus = true; + cpuData.onFocus(event); + } + } + }); + } else { + showTipCpuData = null; + } + JComponent component = getRoot(); + if (component instanceof ContentPanel) { + ContentPanel root = ((ContentPanel) component); + root.refreshTab(); + } + } + + /** + * Mouse released event + * + * @param event event + */ + @Override + public void mouseReleased(MouseEvent event) { + } + + /** + * Click event + * + * @param event event + * @param data data + */ + @Override + public void click(MouseEvent event, CpuData data) { + if (showTipCpuData != null) { + clearSelected(); + showTipCpuData.select(true); + showTipCpuData.repaint(); + currentSelectedCpuData = data; + if (AnalystPanel.iCpuDataClick != null) { + AnalystPanel.iCpuDataClick.click(showTipCpuData); + } + } + } + + /** + * Loss of focus event + * + * @param event event + * @param data data + */ + @Override + public void blur(MouseEvent event, CpuData data) { + showTipCpuData = null; + CpuDataFragment.focusCpuData = null; + getRoot().repaint(); + } + + /** + * Get focus event + * + * @param event event + * @param data data + */ + @Override + public void focus(MouseEvent event, CpuData data) { + showTipCpuData = data; + CpuDataFragment.focusCpuData = data; + getRoot().repaint(); + } + + /** + * Mouse movement event + * + * @param event event + * @param data data + */ + @Override + public void mouseMove(MouseEvent event, CpuData data) { + showTipCpuData = data; + CpuDataFragment.focusCpuData = data; + tipX = event.getX(); + getRoot().repaint(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/CpuFreqDataFragment.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/CpuFreqDataFragment.java new file mode 100644 index 000000000..a58fc2465 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/CpuFreqDataFragment.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import ohos.devtools.views.trace.bean.CpuData; +import ohos.devtools.views.trace.bean.CpuFreqData; +import ohos.devtools.views.trace.component.AnalystPanel; +import ohos.devtools.views.trace.fragment.graph.CheckGraph; +import ohos.devtools.views.trace.fragment.graph.FavoriteGraph; + +import javax.swing.JComponent; +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; +import java.awt.geom.Rectangle2D; +import java.util.List; +import java.util.Map; + +/** + * cpu frequency data + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class CpuFreqDataFragment extends AbstractDataFragment implements CpuData.IEventListener { + /** + * The currently selected cpu frequency data + */ + public static CpuData currentSelectedCpuData; + + /** + * cpu frequency data collection + */ + public List data; + + /** + * Favorite button + */ + public FavoriteGraph favoriteGraph; + + /** + * Select button + */ + public CheckGraph checkGraph; + + private double x1; + + private double x2; + + private Rectangle2D bounds; + + private String name; + + private Map cpuMaxFreq; + + /** + * Construction method + * + * @param root root + * @param name name + * @param cpuMaxFreq cpuMaxFreq + * @param data data + */ + public CpuFreqDataFragment(JComponent root, String name, Map cpuMaxFreq, List data) { + this.name = name; + this.setRoot(root); + this.data = data; + this.cpuMaxFreq = cpuMaxFreq; + favoriteGraph = new FavoriteGraph(this, root); + checkGraph = new CheckGraph(this, root); + } + + /** + * Drawing method + * + * @param graphics graphics + */ + @Override + public void draw(Graphics2D graphics) { + super.draw(graphics); + + // Supplement the information on the left + graphics.setColor(getRoot().getForeground()); + bounds = graphics.getFontMetrics().getStringBounds(name, graphics); + graphics.drawString(name, getDescRect().x + 10, + (int) (getDescRect().y + (getDescRect().height) / 2 + bounds.getHeight() / 3)); + favoriteGraph.setRightGraph(isSelected != null ? checkGraph : null); + checkGraph.setChecked(isSelected); + checkGraph.draw(graphics); + favoriteGraph.draw(graphics); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .7f)); // transparency + String cupFreqName = cpuMaxFreq.get("name").toString(); + Object value = cpuMaxFreq.get("value"); + data.stream().filter(cpuFreqData -> cpuFreqData.getStartTime() + cpuFreqData.getDuration() > startNS + && cpuFreqData.getStartTime() < endNS).forEach(cpuGraph -> { + if (cpuGraph.getStartTime() <= startNS) { + x1 = 0; + } else { + x1 = getXDouble(cpuGraph.getStartTime()); + } + if (cpuGraph.getStartTime() + cpuGraph.getDuration() >= endNS) { + x2 = getDataRect().width; + } else { + x2 = getXDouble(cpuGraph.getStartTime() + cpuGraph.getDuration()); + } + if (value instanceof Double) { + cpuGraph.setMax((Double) value); + } + cpuGraph.setRoot(getRoot()); + cpuGraph.setRect(x1 + getDataRect().x, getDataRect().y, x2 - x1 <= 0 ? 1 : x2 - x1, getDataRect().height); + cpuGraph.draw(graphics); + }); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f)); // transparency + bounds = graphics.getFontMetrics().getStringBounds(cupFreqName, graphics); + graphics.setColor(Color.lightGray); + graphics.drawString(cupFreqName, getDataRect().x + 2, (int) (getDataRect().y + 2 + bounds.getHeight())); + } + + /** + * Mouse click event + * + * @param event event + */ + @Override + public void mouseClicked(MouseEvent event) { + if (favoriteGraph.edgeInspect(event)) { + favoriteGraph.onClick(event); + } + if (checkGraph.edgeInspect(event)) { + checkGraph.onClick(event); + } + } + + /** + * Mouse pressed event + * + * @param event event + */ + @Override + public void mousePressed(MouseEvent event) { + } + + /** + * Mouse exited event + * + * @param event event + */ + @Override + public void mouseExited(MouseEvent event) { + } + + /** + * Mouse entered event + * + * @param event event + */ + @Override + public void mouseEntered(MouseEvent event) { + } + + /** + * Mouse move event + * + * @param event event + */ + @Override + public void mouseMoved(MouseEvent event) { + clearFocus(event); + favoriteGraph.display(edgeInspectRect(getDescRect(), event)); + if (favoriteGraph.edgeInspect(event)) { + if (!favoriteGraph.flagFocus) { + favoriteGraph.flagFocus = true; + favoriteGraph.onFocus(event); + } + } else { + if (favoriteGraph.flagFocus) { + favoriteGraph.flagFocus = false; + favoriteGraph.onBlur(event); + } + } + if (edgeInspect(event)) { + data.forEach(cpuFreqData -> { + if (cpuFreqData.edgeInspect(event)) { + if (!cpuFreqData.isFlagFocus()) { + cpuFreqData.setFlagFocus(true); + cpuFreqData.onFocus(event); + } + } else { + if (cpuFreqData.isFlagFocus()) { + cpuFreqData.setFlagFocus(false); + cpuFreqData.onBlur(event); + } + } + }); + } + } + + /** + * Mouse released event + * + * @param event event + */ + @Override + public void mouseReleased(MouseEvent event) { + } + + /** + * Click event + * + * @param event event + * @param cpuData cpuData + */ + @Override + public void click(MouseEvent event, CpuData cpuData) { + if (currentSelectedCpuData != null) { + currentSelectedCpuData.select(false); + currentSelectedCpuData.repaint(); + } + cpuData.select(true); + cpuData.repaint(); + currentSelectedCpuData = cpuData; + if (AnalystPanel.iCpuDataClick != null) { + AnalystPanel.iCpuDataClick.click(cpuData); + } + } + + /** + * Loss of focus event + * + * @param event event + * @param data data + */ + @Override + public void blur(MouseEvent event, CpuData data) { + } + + /** + * Get focus event + * + * @param event event + * @param data data + */ + @Override + public void focus(MouseEvent event, CpuData data) { + } + + /** + * Mouse move event + * + * @param event event + * @param data data + */ + @Override + public void mouseMove(MouseEvent event, CpuData data) { + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/FunctionDataFragment.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/FunctionDataFragment.java new file mode 100644 index 000000000..bd3363dab --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/FunctionDataFragment.java @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import ohos.devtools.views.trace.bean.FunctionBean; +import ohos.devtools.views.trace.bean.ThreadData; +import ohos.devtools.views.trace.component.AnalystPanel; +import ohos.devtools.views.trace.component.ContentPanel; +import ohos.devtools.views.trace.util.Final; + +import javax.swing.JComponent; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; +import java.awt.geom.Rectangle2D; +import java.util.ArrayList; + +/** + * Method call data row + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class FunctionDataFragment extends AbstractDataFragment implements FunctionBean.IEventListener { + /** + * graph event callback + */ + public static FunctionBean currentSelectedFunctionData; + + /** + * Thread object + */ + public ThreadData thread; + + private final ArrayList data; + + /** + * structure + * + * @param contentPanel contentPanel + * @param functionBeans functionBeans + */ + public FunctionDataFragment(JComponent contentPanel, ArrayList functionBeans) { + super(); + this.setRoot(contentPanel); + this.data = functionBeans; + } + + /** + * Drawing method + * + * @param graphics graphics + */ + @Override + public void draw(Graphics2D graphics) { + super.draw(graphics); + + // Supplement the information on the left + graphics.setColor(getRoot().getForeground()); + String name = thread.getThreadName() + " " + thread.getTid(); + Rectangle2D bounds = graphics.getFontMetrics().getStringBounds(name, graphics); + double wordWidth = bounds.getWidth() / name.length(); // Width per character + double wordNum = (getDescRect().width - 40) / wordWidth; // How many characters can be displayed on each line + if (bounds.getWidth() < getDescRect().width - 40) { // Direct line display + graphics.drawString(name, getDescRect().x + 10, (int) (getDescRect().y + bounds.getHeight() + 10)); + } else { + String substring = name.substring((int) wordNum); + if (substring.length() < wordNum) { + graphics.drawString(name.substring(0, (int) wordNum), getDescRect().x + 10, + (int) (getDescRect().y + bounds.getHeight() + 8)); + graphics + .drawString(substring, getDescRect().x + 10, (int) (getDescRect().y + bounds.getHeight() * 2 + 8)); + } else { + graphics.drawString(name.substring(0, (int) wordNum), getDescRect().x + 10, + (int) (getDescRect().y + bounds.getHeight() + 2)); + graphics.drawString(substring.substring(0, (int) wordNum), getDescRect().x + 10, + (int) (getDescRect().y + bounds.getHeight() * 2 + 2)); + graphics.drawString(substring.substring((int) wordNum), getDescRect().x + 10, + (int) (getDescRect().y + bounds.getHeight() * 3 + 2)); + } + } + for (FunctionBean bean : data) { + int x1; + int x2; + if (bean.getStartTime() < startNS) { + x1 = getX(startNS); + } else { + x1 = getX(bean.getStartTime()); + } + if (bean.getStartTime() + bean.getDuration() > endNS) { + x2 = getX(endNS); + } else { + x2 = getX(bean.getStartTime() + bean.getDuration()); + } + bean.setRect(x1 + getDataRect().x, getDataRect().y + 10 + 20 * bean.getDepth(), x2 - x1 <= 0 ? 1 : x2 - x1, + 20); + bean.root = getRoot(); + bean.setEventListener(this); + bean.draw(graphics); + } + } + + /** + * Mouse click event + * + * @param event event + */ + @Override + public void mouseClicked(MouseEvent event) { + if (data != null) { + data.stream() + .filter(bean -> bean.getStartTime() + bean.getDuration() > startNS && bean.getStartTime() < endNS) + .filter(bean -> bean.edgeInspect(event)).findFirst().ifPresent(bean -> { + bean.onClick(event); + }); + } + } + + /** + * Mouse pressed event + * + * @param event event + */ + @Override + public void mousePressed(MouseEvent event) { + } + + /** + * Mouse exited event + * + * @param event event + */ + @Override + public void mouseExited(MouseEvent event) { + } + + /** + * Mouse entered event + * + * @param event event + */ + @Override + public void mouseEntered(MouseEvent event) { + } + + /** + * Mouse moved event + * + * @param event event + */ + @Override + public void mouseMoved(MouseEvent event) { + clearFocus(event); + JComponent component = getRoot(); + if (component instanceof ContentPanel) { + ContentPanel root = ((ContentPanel) component); + root.refreshTab(); + } + } + + /** + * Mouse released event + * + * @param event event + */ + @Override + public void mouseReleased(MouseEvent event) { + } + + /** + * Click event + * + * @param event event + * @param data data + */ + @Override + public void click(MouseEvent event, FunctionBean data) { + clearSelected(); + data.setSelected(true); + data.repaint(); + currentSelectedFunctionData = data; + if (AnalystPanel.iFunctionDataClick != null) { + AnalystPanel.iFunctionDataClick.click(data); + } + } + + /** + * Loss of focus event + * + * @param event event + * @param data data + */ + @Override + public void blur(MouseEvent event, FunctionBean data) { + } + + /** + * Get focus event + * + * @param event event + * @param data data + */ + @Override + public void focus(MouseEvent event, FunctionBean data) { + } + + /** + * Mouse move event + * + * @param event event + * @param data data + */ + @Override + public void mouseMove(MouseEvent event, FunctionBean data) { + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/MemDataFragment.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/MemDataFragment.java new file mode 100644 index 000000000..a0e72edc1 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/MemDataFragment.java @@ -0,0 +1,249 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import ohos.devtools.views.trace.bean.ProcessMem; +import ohos.devtools.views.trace.bean.ProcessMemData; +import ohos.devtools.views.trace.bean.ThreadData; +import ohos.devtools.views.trace.component.AnalystPanel; +import ohos.devtools.views.trace.component.ContentPanel; +import ohos.devtools.views.trace.util.Db; +import ohos.devtools.views.trace.util.Final; + +import javax.swing.JComponent; +import javax.swing.SwingUtilities; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; +import java.awt.geom.Rectangle2D; +import java.util.List; +import java.util.concurrent.ForkJoinPool; +import java.util.stream.Collectors; + +/** + * Memory data line + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class MemDataFragment extends AbstractDataFragment implements ThreadData.IEventListener { + /** + * graph event callback + */ + public static ThreadData currentSelectedThreadData; + + /** + * Process memory data + */ + public List data; + + /** + * Process memory + */ + public ProcessMem mem; + private boolean isLoading; + private Rectangle2D bounds; + private int max; + + /** + * structure + * + * @param root root + * @param mem mem + */ + public MemDataFragment(JComponent root, ProcessMem mem) { + this.mem = mem; + this.setRoot(root); + } + + /** + * Drawing method + * + * @param graphics graphics + */ + @Override + public void draw(Graphics2D graphics) { + super.draw(graphics); + graphics.setFont(Final.NORMAL_FONT); + graphics.setColor(getRoot().getForeground()); + String name = mem.getTrackName(); + bounds = graphics.getFontMetrics().getStringBounds(name, graphics); + double wordWidth = bounds.getWidth() / name.length(); // Width per character + double wordNum = (getDescRect().width - 40) / wordWidth; // How many characters can be displayed on each line + if (bounds.getWidth() < getDescRect().width - 40) { // Direct line display + graphics.drawString(name, getDescRect().x + 10, (int) (getDescRect().y + bounds.getHeight() + 10)); + } else { + String substring = name.substring((int) wordNum); + if (substring.length() < wordNum) { + graphics.drawString(name.substring(0, (int) wordNum), getDescRect().x + 10, + (int) (getDescRect().y + bounds.getHeight() + 8)); + graphics + .drawString(substring, getDescRect().x + 10, (int) (getDescRect().y + bounds.getHeight() * 2 + 8)); + } else { + graphics.drawString(name.substring(0, (int) wordNum), getDescRect().x + 10, + (int) (getDescRect().y + bounds.getHeight() + 2)); + graphics.drawString(substring.substring(0, (int) wordNum), getDescRect().x + 10, + (int) (getDescRect().y + bounds.getHeight() * 2 + 2)); + } + } + drawData(graphics); + } + + private void drawData(Graphics2D graphics) { + if (data != null) { + List collect = data.stream().filter( + memData -> memData.getStartTime() + memData.getDuration() > startNS && memData.getStartTime() < endNS) + .collect(Collectors.toList()); + int x1; + int x2; + for (int index = 0, len = collect.size(); index < len; index++) { + ProcessMemData memData = collect.get(index); + if (index == len - 1) { + memData.setDuration(AnalystPanel.DURATION); + } else { + memData.setDuration(collect.get(index + 1).getStartTime() - memData.getStartTime()); + } + if (memData.getStartTime() < startNS) { + x1 = getX(startNS); + } else { + x1 = getX(memData.getStartTime()); + } + if (memData.getStartTime() + memData.getDuration() > endNS) { + x2 = getX(endNS); + } else { + x2 = getX(memData.getStartTime() + memData.getDuration()); + } + memData.root = getRoot(); + memData + .setRect(x1 + getDataRect().x, getDataRect().y, x2 - x1 <= 0 ? 1 : x2 - x1, getDataRect().height); + memData.setMaxValue(max); + memData.draw(graphics); + } + } else { + graphics.setColor(getRoot().getForeground()); + graphics.drawString("Loading...", getDataRect().x, getDataRect().y + 12); + loadData(); + } + } + + /** + * Mouse clicked event + * + * @param event event + */ + @Override + public void mouseClicked(MouseEvent event) { + } + + /** + * Mouse pressed event + * + * @param event event + */ + @Override + public void mousePressed(MouseEvent event) { + } + + /** + * Mouse exited event + * + * @param event event + */ + @Override + public void mouseExited(MouseEvent event) { + } + + @Override + public void mouseEntered(MouseEvent event) { + } + + @Override + public void mouseMoved(MouseEvent event) { + clearFocus(event); + JComponent component = getRoot(); + if (component instanceof ContentPanel) { + ContentPanel root = ((ContentPanel) component); + root.refreshTab(); + } + } + + @Override + public void mouseReleased(MouseEvent event) { + } + + private void loadData() { + if (!isLoading) { + isLoading = true; + ForkJoinPool.commonPool().submit(() -> { + data = Db.getInstance().getProcessMemData(mem.getTrackId()); + SwingUtilities.invokeLater(() -> { + data.stream().mapToInt(memData -> memData.getValue()).max().ifPresent(maxData -> { + max = maxData; + }); + isLoading = false; + repaint(); + }); + }); + } + } + + /** + * Mouse click event + * + * @param event event + * @param data data + */ + @Override + public void click(MouseEvent event, ThreadData data) { + clearSelected(); + data.select(true); + data.repaint(); + currentSelectedThreadData = data; + if (AnalystPanel.iThreadDataClick != null) { + AnalystPanel.iThreadDataClick.click(data); + } + } + + /** + * Mouse blur event + * + * @param event event + * @param data data + */ + @Override + public void blur(MouseEvent event, ThreadData data) { + } + + /** + * Mouse focus event + * + * @param event event + * @param data data + */ + @Override + public void focus(MouseEvent event, ThreadData data) { + } + + /** + * Mouse move event + * + * @param event event + * @param data data + */ + @Override + public void mouseMove(MouseEvent event, ThreadData data) { + getRoot().repaint(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ProcessDataFragment.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ProcessDataFragment.java new file mode 100644 index 000000000..e527c7357 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ProcessDataFragment.java @@ -0,0 +1,245 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import ohos.devtools.views.trace.bean.CpuFreqData; +import ohos.devtools.views.trace.bean.Process; +import ohos.devtools.views.trace.bean.ProcessData; +import ohos.devtools.views.trace.component.AnalystPanel; +import ohos.devtools.views.trace.component.ContentPanel; +import ohos.devtools.views.trace.fragment.graph.ExpandGraph; +import ohos.devtools.views.trace.util.ColorUtils; +import ohos.devtools.views.trace.util.Db; +import ohos.devtools.views.trace.util.ImageUtils; + +import javax.swing.JComponent; +import javax.swing.SwingUtilities; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; +import java.awt.geom.Rectangle2D; +import java.util.List; +import java.util.concurrent.ForkJoinPool; + +/** + * process data + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class ProcessDataFragment extends AbstractDataFragment implements ExpandGraph.IClickListener { + private final ExpandGraph expandGraph; + private final Process process; + private int defaultHeight; + private boolean isLoading; + private int x1; + private int x2; + private Rectangle2D bounds; + + /** + * constructor + * + * @param root root + * @param process process + */ + public ProcessDataFragment(JComponent root, Process process) { + this.process = process; + this.setRoot(root); + expandGraph = new ExpandGraph(this, root); + expandGraph.setOnClickListener(this); + } + + /** + * draw method + * + * @param graphics graphics + */ + @Override + public void draw(Graphics2D graphics) { + super.draw(graphics); + if (AnalystPanel.cpuNum == 0) { + return; + } + drawDefaultState(graphics); + + // left data info + String name; + if (process.getName() == null || process.getName().isEmpty()) { + process.setName("Process"); + } + name = process.getName() + " " + process.getPid(); + bounds = graphics.getFontMetrics().getStringBounds(name, graphics); + double wordWidth = bounds.getWidth() / name.length(); // Width per character + double wordNum = (getDescRect().width - 40) / wordWidth; // How many characters can be displayed on each line + if (bounds.getWidth() < getDescRect().width - 40) { // Direct line display + graphics.drawString(name, getDescRect().x + 30, (int) (getDescRect().y + bounds.getHeight() + 10)); + } else { + String substring = name.substring((int) wordNum); + if (substring.length() < wordNum) { + graphics.drawString(name.substring(0, (int) wordNum), getDescRect().x + 30, + (int) (getDescRect().y + bounds.getHeight() + 8)); + graphics + .drawString(substring, getDescRect().x + 30, (int) (getDescRect().y + bounds.getHeight() * 2 + 8)); + } else { + graphics.drawString(name.substring(0, (int) wordNum), getDescRect().x + 30, + (int) (getDescRect().y + bounds.getHeight() + 2)); + graphics.drawString(substring.substring(0, (int) wordNum), getDescRect().x + 30, + (int) (getDescRect().y + bounds.getHeight() * 2 + 2)); + graphics.drawString(substring.substring((int) wordNum), getDescRect().x + 30, + (int) (getDescRect().y + bounds.getHeight() * 3 + 2)); + } + } + expandGraph.setRect(getDescRect().x + 8, getRect().y + getRect().height / 2 - 6, 12, 12); + expandGraph.draw(graphics); + } + + private void drawDefaultState(Graphics graphics) { + if (!expandGraph.isExpand()) { + int height = (getRect().height) / AnalystPanel.cpuNum; + if (processData != null) { + for (int index = 0; index < processData.size(); index++) { + ProcessData data = this.processData.get(index); + if (data.getStartTime() < startNS) { + x1 = getX(startNS); + } else { + x1 = getX(data.getStartTime()); + } + if (data.getStartTime() + data.getDuration() > endNS) { + x2 = getX(endNS); + } else { + x2 = getX(data.getStartTime() + data.getDuration()); + } + graphics.setColor(ColorUtils.MD_PALETTE[process.getPid() % ColorUtils.MD_PALETTE.length]); + graphics.fillRect(x1 + getDataRect().x, getDataRect().y + height * data.getCpu() + 2, + x2 - x1 <= 0 ? 1 : x2 - x1, height - 4); + } + } else { + if (process.getPid() != 0) { + graphics.setColor(getRoot().getForeground()); + graphics.drawString("Loading...", getDataRect().x, getDataRect().y + 12); + loadData(); + } + } + graphics.setColor(getRoot().getForeground()); + } else { + graphics.setColor(getRoot().getForeground()); + graphics.fillRect(getRect().x, getRect().y, getRect().width, getRect().height); + graphics.setColor(getRoot().getBackground()); + } + } + + /** + * click handler + * + * @param event event + */ + @Override + public void mouseClicked(MouseEvent event) { + if (expandGraph.edgeInspect(event)) { + expandGraph.onClick(event); + } + } + + /** + * mouse pressed handler + * + * @param event event + */ + @Override + public void mousePressed(MouseEvent event) { + } + + /** + * mouse exited handler + * + * @param event event + */ + @Override + public void mouseExited(MouseEvent event) { + } + + /** + * mouse entered handler + * + * @param event event + */ + @Override + public void mouseEntered(MouseEvent event) { + } + + /** + * mouse moved handler + * + * @param event event + */ + @Override + public void mouseMoved(MouseEvent event) { + clearFocus(event); + } + + /** + * mouse released handler + * + * @param event event + */ + @Override + public void mouseReleased(MouseEvent event) { + } + + /** + * click handler + * + * @param event event + */ + @Override + public void click(MouseEvent event) { + expandGraph.setExpand(!expandGraph.isExpand()); + if (this.getRoot() instanceof ContentPanel) { + ContentPanel contentPanel = (ContentPanel) this.getRoot(); + if (expandGraph.isExpand()) { + expandGraph.setImage(ImageUtils.getInstance().getArrowUpFocus()); + for (AbstractDataFragment dataFragment : contentPanel.fragmentList) { + if (dataFragment.parentUuid.equals(uuid)) { + dataFragment.visible = true; + } + } + } else { + expandGraph.setImage(ImageUtils.getInstance().getArrowDownFocus()); + for (AbstractDataFragment dataFragment : contentPanel.fragmentList) { + if (dataFragment.parentUuid.equals(uuid)) { + dataFragment.visible = false; + } + } + } + contentPanel.refresh(); + } + } + + private List processData; + + private void loadData() { + if (!isLoading) { + isLoading = true; + ForkJoinPool.commonPool().submit(() -> { + processData = Db.getInstance().queryProcessData(process.getPid()); + SwingUtilities.invokeLater(() -> { + isLoading = false; + repaint(); + }); + }); + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ThreadDataFragment.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ThreadDataFragment.java new file mode 100644 index 000000000..45aecfa87 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ThreadDataFragment.java @@ -0,0 +1,305 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import ohos.devtools.views.trace.bean.CpuFreqData; +import ohos.devtools.views.trace.bean.FunctionBean; +import ohos.devtools.views.trace.bean.ThreadData; +import ohos.devtools.views.trace.component.AnalystPanel; +import ohos.devtools.views.trace.component.ContentPanel; +import ohos.devtools.views.trace.util.Db; + +import javax.swing.JComponent; +import javax.swing.SwingUtilities; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; +import java.awt.geom.Rectangle2D; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ForkJoinPool; + +/** + * Thread data row + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class ThreadDataFragment extends AbstractDataFragment implements ThreadData.IEventListener { + /** + * graph event callback + */ + public static ThreadData currentSelectedThreadData; + + /** + * Thread data collection + */ + public List data; + + /** + * Thread object + */ + public ThreadData thread; + + private int x1; + + private int x2; + + private Rectangle2D bounds; + + private boolean isLoading; + + /** + * structure + * + * @param root root + * @param thread thread + */ + public ThreadDataFragment(JComponent root, ThreadData thread) { + this.thread = thread; + this.setRoot(root); + this.data = data; + } + + /** + * Drawing method + * + * @param graphics graphics + */ + @Override + public void draw(Graphics2D graphics) { + super.draw(graphics); + + // Supplement the information on the left + graphics.setColor(getRoot().getForeground()); + String name = thread.getThreadName() + " " + thread.getTid(); + bounds = graphics.getFontMetrics().getStringBounds(name, graphics); + double wordWidth = bounds.getWidth() / name.length(); // Width per character + double wordNum = (getDescRect().getWidth() - 40) / wordWidth; + if (bounds.getWidth() < getDescRect().getWidth() - 40) { // Direct line display + graphics.drawString(name, (int) (getDescRect().getX() + 10), + (int) (getDescRect().getY() + bounds.getHeight() + 10)); + } else { + String substring = name.substring((int) wordNum); + if (substring.length() < wordNum) { + graphics.drawString(name.substring(0, (int) wordNum), (int) (getDescRect().getX() + 10), + (int) (getDescRect().getY() + bounds.getHeight() + 8)); + graphics.drawString(substring, getDescRect().x + 10, + (int) (getDescRect().getY() + bounds.getHeight() * 2 + 8)); + } else { + graphics.drawString(name.substring(0, (int) wordNum), (int) (getDescRect().getX() + 10), + (int) (getDescRect().getY() + bounds.getHeight() + 2)); + graphics.drawString(substring.substring(0, (int) wordNum), (int) (getDescRect().getX() + 10), + (int) (getDescRect().getY() + bounds.getHeight() * 2 + 2)); + graphics.drawString(substring.substring((int) wordNum), (int) (getDescRect().getX() + 10), + (int) (getDescRect().getY() + bounds.getHeight() * 3 + 2)); + } + } + drawData(graphics); + } + + private void drawData(Graphics2D graphics) { + if (data != null) { + data.stream().filter(threadData -> threadData.getStartTime() + threadData.getDuration() > startNS + && threadData.getStartTime() < endNS).forEach(threadData -> { + if (threadData.getStartTime() < startNS) { + x1 = getX(startNS); + } else { + x1 = getX(threadData.getStartTime()); + } + if (threadData.getStartTime() + threadData.getDuration() > endNS) { + x2 = getX(endNS); + } else { + x2 = getX(threadData.getStartTime() + threadData.getDuration()); + } + threadData.setRect(x1 + getDataRect().x, getDataRect().y + 5, x2 - x1 <= 0 ? 1 : x2 - x1, + getDataRect().height - 10); + threadData.root = getRoot(); + threadData.setEventListener(this); + threadData.draw(graphics); + }); + } else { + graphics.setColor(getRoot().getForeground()); + graphics.drawString("Loading...", getDataRect().x, getDataRect().y + 12); + loadData(); + } + } + + /** + * Mouse clicked event + * + * @param event event + */ + @Override + public void mouseClicked(MouseEvent event) { + if (data != null) { + data.stream().filter(threadData -> threadData.getStartTime() + threadData.getDuration() > startNS + && threadData.getStartTime() < endNS).filter(threadData -> threadData.edgeInspect(event)).findFirst() + .ifPresent(threadData -> { + threadData.onClick(event); + }); + } + } + + /** + * Mouse pressed event + * + * @param event event + */ + @Override + public void mousePressed(MouseEvent event) { + } + + /** + * Mouse exited event + * + * @param event event + */ + @Override + public void mouseExited(MouseEvent event) { + } + + /** + * Mouse entered event + * + * @param event event + */ + @Override + public void mouseEntered(MouseEvent event) { + } + + /** + * Mouse moved event + * + * @param event event + */ + @Override + public void mouseMoved(MouseEvent event) { + clearFocus(event); + if (edgeInspect(event)) { + if (data != null) { + data.stream().filter(threadData -> threadData.getStartTime() + threadData.getDuration() > startNS + && threadData.getStartTime() < endNS).filter(threadData -> threadData.edgeInspect(event)) + .findFirst().ifPresent(filter -> { + filter.onMouseMove(event); + if (filter.edgeInspect(event)) { + if (!filter.flagFocus) { + filter.flagFocus = true; + filter.onFocus(event); + } + } else { + if (filter.flagFocus) { + filter.flagFocus = false; + filter.onBlur(event); + } + } + }); + } + } + JComponent component = getRoot(); + if (component instanceof ContentPanel) { + ContentPanel root = ((ContentPanel) component); + root.refreshTab(); + } + } + + /** + * Mouse released event + * + * @param event event + */ + @Override + public void mouseReleased(MouseEvent event) { + } + + private void loadData() { + if (!isLoading) { + isLoading = true; + ForkJoinPool.commonPool().submit(() -> { + data = Db.getInstance().queryThreadData(thread.getTid()); + ArrayList functionBeans = Db.getInstance().getFunDataByTid(thread.getTid()); + SwingUtilities.invokeLater(() -> { + isLoading = false; + if (!functionBeans.isEmpty()) { + int maxHeight = + (functionBeans.stream().mapToInt(bean -> bean.getDepth()).max().getAsInt() + 1) * 20; + FunctionDataFragment functionDataFragment = + new FunctionDataFragment(this.getRoot(), functionBeans); + functionDataFragment.parentUuid = this.parentUuid; + functionDataFragment.thread = this.thread; + functionDataFragment.defaultHeight = maxHeight + 20; + functionDataFragment.visible = true; + if (this.getRoot() instanceof ContentPanel) { + ContentPanel contentPanel = (ContentPanel) this.getRoot(); + int index = contentPanel.fragmentList.indexOf(this) + 1; + contentPanel.addDataFragment(index, functionDataFragment); + contentPanel.refresh(); + } + } else { + repaint(); + } + }); + }); + } + } + + /** + * click event + * + * @param event event + * @param data data + */ + @Override + public void click(MouseEvent event, ThreadData data) { + clearSelected(); + data.select(true); + data.repaint(); + currentSelectedThreadData = data; + if (AnalystPanel.iThreadDataClick != null) { + AnalystPanel.iThreadDataClick.click(data); + } + } + + /** + * Mouse blur event + * + * @param event event + * @param data data + */ + @Override + public void blur(MouseEvent event, ThreadData data) { + } + + /** + * Mouse focus event + * + * @param event event + * @param data data + */ + @Override + public void focus(MouseEvent event, ThreadData data) { + } + + /** + * Mouse move event + * + * @param event event + * @param data data + */ + @Override + public void mouseMove(MouseEvent event, ThreadData data) { + getRoot().repaint(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/graph/AbstractGraph.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/graph/AbstractGraph.java new file mode 100644 index 000000000..3497920d1 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/graph/AbstractGraph.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.graph; + +import ohos.devtools.views.trace.fragment.AbstractDataFragment; +import ohos.devtools.views.trace.fragment.ruler.AbstractNode; + +import javax.swing.JComponent; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; + +/** + * Data line graphics + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public abstract class AbstractGraph extends AbstractNode { + /** + * fragment + */ + public AbstractDataFragment fragment; + /** + * root + */ + public JComponent root; + /** + * rect + */ + public Rectangle rect = new Rectangle(0, 0, 0, 0); + + /** + * Drawing method + * + * @param graphics graphics + */ + public abstract void draw(Graphics2D graphics); + + /** + * Get focus event + * + * @param event event + */ + public abstract void onFocus(MouseEvent event); + + /** + * Loss of focus event + * + * @param event event + */ + public abstract void onBlur(MouseEvent event); + + /** + * Click event + * + * @param event event + */ + public abstract void onClick(MouseEvent event); + + /** + * Mouse movement event + * + * @param event event + */ + public abstract void onMouseMove(MouseEvent event); + + /** + * Control the focus blur event is triggered only once, the focus blur is initiated by mouseMove + */ + public boolean flagFocus; + + /** + * Whether the mouse is inside the graphics area + * + * @param event event + * @return boolean boolean + */ + public boolean edgeInspect(final MouseEvent event) { + return event.getX() >= rect.getX() && event.getX() <= rect.getX() + rect.getWidth() && event.getY() >= rect + .getY() && event.getY() <= rect.getY() + rect.getHeight(); + } + + /** + * Redraw the current graph + */ + public void repaint() { + if (root != null) { + root.repaint(rect); + } + } + + /** + * Set rect object + * + * @param xAxis x coordinate + * @param yAxis y coordinate + * @param width width + * @param height height + */ + public void setRect(final double xAxis, final double yAxis, final double width, final double height) { + if (rect == null) { + rect = new Rectangle(); + } + rect.setRect(xAxis, yAxis, width, height); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/graph/CheckGraph.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/graph/CheckGraph.java new file mode 100644 index 000000000..8dbdb0c28 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/graph/CheckGraph.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.graph; + +import ohos.devtools.views.trace.fragment.AbstractDataFragment; +import ohos.devtools.views.trace.util.ImageUtils; + +import javax.swing.JComponent; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.event.MouseEvent; + +/** + * Data row selection CheckBox + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class CheckGraph extends AbstractGraph { + private Boolean isChecked; + private Image checkNo = ImageUtils.getInstance().getCheckNo(); + private Image checkYes = ImageUtils.getInstance().getCheckYes(); + + /** + * Gets the value of isChecked . + * + * @return the value of java.lang.Boolean + */ + public Boolean getChecked() { + return isChecked; + } + + /** + * Sets the isChecked . + *

You can use getChecked() to get the value of isChecked

+ * + * @param isChecked isChecked + */ + public void setChecked(final Boolean isChecked) { + this.isChecked = isChecked; + } + + /** + * structure + * + * @param fragment fragment + * @param root root + */ + public CheckGraph(final AbstractDataFragment fragment, final JComponent root) { + this.fragment = fragment; + this.root = root; + } + + /** + * Drawing method + * + * @param graphics graphics + */ + @Override + public void draw(final Graphics2D graphics) { + if (isChecked != null) { + final int size = 12; + final int xOffset = 18; + final int yOffset = 6; + rect.width = size; + rect.height = size; + rect.x = fragment.getDescRect().width - xOffset; + rect.y = fragment.getRect().y + fragment.getRect().height / 2 - yOffset; + if (isChecked) { + graphics.drawImage(checkYes, rect.x, rect.y, rect.width, rect.height, null); + } else { + graphics.drawImage(checkNo, rect.x, rect.y, rect.width, rect.height, null); + } + } + } + + /** + * Get focus event + * + * @param event event + */ + @Override + public void onFocus(final MouseEvent event) { + } + + /** + * Loss of focus event + * + * @param event event + */ + @Override + public void onBlur(final MouseEvent event) { + } + + /** + * Click event + * + * @param event event + */ + @Override + public void onClick(final MouseEvent event) { + } + + /** + * Mouse movement event + * + * @param event event + */ + @Override + public void onMouseMove(final MouseEvent event) { + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/graph/ExpandGraph.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/graph/ExpandGraph.java new file mode 100644 index 000000000..a8733487d --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/graph/ExpandGraph.java @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.graph; + +import ohos.devtools.views.trace.fragment.AbstractDataFragment; +import ohos.devtools.views.trace.util.ImageUtils; + +import javax.swing.JComponent; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.event.MouseEvent; + +/** + * dataPanel open + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class ExpandGraph extends AbstractGraph { + private boolean isExpand; + private Image image = ImageUtils.getInstance().getArrowDown(); + + /** + * Gets the value of image . + * + * @return the value of java.awt.Image + */ + public Image getImage() { + return image; + } + + /** + * Sets the image . + *

You can use getImage() to get the value of image

+ * + * @param image image + */ + public void setImage(final Image image) { + this.image = image; + } + + /** + * Gets the value of isExpand . + * + * @return the value of boolean + */ + public boolean isExpand() { + return isExpand; + } + + /** + * Sets the isExpand . + *

You can use getExpand() to get the value of isExpand

+ * + * @param expand expand + */ + public void setExpand(final boolean expand) { + this.isExpand = expand; + } + + /** + * class construct + * + * @param fragment fragment + * @param root root + */ + public ExpandGraph(final AbstractDataFragment fragment, final JComponent root) { + this.fragment = fragment; + this.root = root; + } + + /** + * draw by graphics + * + * @param graphics graphics + */ + @Override + public void draw(final Graphics2D graphics) { + if (isExpand) { + image = ImageUtils.getInstance().getArrowUpFocus(); + } else { + if (flagFocus) { + image = ImageUtils.getInstance().getArrowDownFocus(); + } else { + image = ImageUtils.getInstance().getArrowDown(); + } + } + graphics.drawImage(image, rect.x, rect.y, 12, 12, null); + } + + /** + * when view onFocus + * + * @param event event + */ + @Override + public void onFocus(final MouseEvent event) { + if (isExpand) { + image = ImageUtils.getInstance().getArrowUpFocus(); + } else { + image = ImageUtils.getInstance().getArrowDownFocus(); + } + repaint(); + } + + /** + * when view onBlur + * + * @param event event + */ + @Override + public void onBlur(final MouseEvent event) { + if (isExpand) { + image = ImageUtils.getInstance().getArrowUp(); + } else { + image = ImageUtils.getInstance().getArrowDown(); + } + repaint(); + } + + /** + * when view onClick + * + * @param event event + */ + @Override + public void onClick(final MouseEvent event) { + if (clickListener != null) { + clickListener.click(event); + } + } + + /** + * when view onMouseMove + * + * @param event event + */ + @Override + public void onMouseMove(final MouseEvent event) { + } + + private IClickListener clickListener; + + /** + * setOnClickListener + * + * @param listener listener + */ + public void setOnClickListener(final IClickListener listener) { + clickListener = listener; + } + + /** + * click listener class + */ + public interface IClickListener { + /** + * click event + * + * @param event event + */ + void click(MouseEvent event); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/graph/FavoriteGraph.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/graph/FavoriteGraph.java new file mode 100644 index 000000000..b7c4917c5 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/graph/FavoriteGraph.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.graph; + +import ohos.devtools.views.trace.fragment.AbstractDataFragment; +import ohos.devtools.views.trace.util.ImageUtils; + +import javax.swing.JComponent; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.event.MouseEvent; + +/** + * Data row collection button + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class FavoriteGraph extends AbstractGraph { + private boolean isFavorite; + private boolean isDisplay; + private Image img = ImageUtils.getInstance().getStar(); + private Image imgFill = ImageUtils.getInstance().getStarFill(); + private AbstractGraph rightGraph; + + /** + * Gets the value of rightGraph . + * + * @return the value of ohos.devtools.views.trace.fragment.graph.Graph + */ + public AbstractGraph getRightGraph() { + return rightGraph; + } + + /** + * Sets the rightGraph . + *

You can use getRightGraph() to get the value of rightGraph

+ * + * @param rightGraph rightGraph + */ + public void setRightGraph(final AbstractGraph rightGraph) { + this.rightGraph = rightGraph; + } + + /** + * structure + * + * @param fragment fragment fragment + * @param root root root + */ + public FavoriteGraph(final AbstractDataFragment fragment, final JComponent root) { + this.fragment = fragment; + this.root = root; + } + + /** + * Determine whether to display + * + * @return boolean boolean + */ + public boolean isDisplay() { + return isDisplay; + } + + /** + * Show favorites + * + * @param show show + */ + public void display(final boolean show) { + isDisplay = show; + if (root != null) { + root.repaint(rect); + } + } + + /** + * Determine whether to save + * + * @return boolean boolean + */ + public boolean isFavorite() { + return isFavorite; + } + + /** + * favorite + * + * @param favorite favorite + */ + public void favorite(final boolean favorite) { + isFavorite = favorite; + } + + /** + * Drawing method + * + * @param graphics graphics + */ + @Override + public void draw(final Graphics2D graphics) { + final int size = 12; + final int xOffset = 18; + final int yOffset = 6; + final int padding = 10; + rect.width = size; + rect.height = size; + rect.y = fragment.getRect().y + fragment.getRect().height / 2 - yOffset; + if (rightGraph == null) { + rect.x = fragment.getDescRect().width - xOffset; + } else { + rect.x = fragment.getDescRect().width - xOffset - size - padding; + } + if (isFavorite) { + graphics.drawImage(ImageUtils.getInstance().getStarFill(), rect.x, rect.y, rect.width, rect.height, null); + } else { + if (isDisplay) { + graphics.drawImage(ImageUtils.getInstance().getStar(), rect.x, rect.y, rect.width, rect.height, null); + } + } + } + + /** + * Get focus event + * + * @param event event + */ + @Override + public void onFocus(final MouseEvent event) { + } + + /** + * Loss of focus event + * + * @param event event + */ + @Override + public void onBlur(final MouseEvent event) { + } + + /** + * Click event + * + * @param event event + */ + @Override + public void onClick(final MouseEvent event) { + } + + /** + * Mouse movement event + * + * @param event event + */ + @Override + public void onMouseMove(final MouseEvent event) { + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/AbstractFragment.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/AbstractFragment.java new file mode 100644 index 000000000..da34c6288 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/AbstractFragment.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.ruler; + +import ohos.devtools.views.trace.component.AnalystPanel; + +import javax.swing.JComponent; +import java.awt.Color; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; + +/** + * basic data + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public abstract class AbstractFragment extends AbstractNode implements IFragment { + private Rectangle rect = new Rectangle(0, 0, 0, 0); + private Rectangle descRect = new Rectangle(0, 0, 0, 0); + private Rectangle dataRect = new Rectangle(0, 0, 0, 0); + private JComponent root; + private final Color lineColor = new Color(255, 255, 255, 80); + private final Color textColor = new Color(0x999999); + + /** + * Gets the value of rect . + * + * @return the value of java.awt.Rectangle + */ + public Rectangle getRect() { + return rect; + } + + /** + * Sets the rect . + *

You can use getRect() to get the value of rect

+ * + * @param rect rect + */ + public void setRect(final Rectangle rect) { + this.rect = rect; + } + + /** + * Gets the value of descRect . + * + * @return the value of java.awt.Rectangle + */ + public Rectangle getDescRect() { + return descRect; + } + + /** + * Sets the descRect . + *

You can use getDescRect() to get the value of descRect

+ * + * @param descRect descRect + */ + public void setDescRect(final Rectangle descRect) { + this.descRect = descRect; + } + + /** + * Gets the value of dataRect . + * + * @return the value of java.awt.Rectangle + */ + public Rectangle getDataRect() { + return dataRect; + } + + /** + * Sets the dataRect . + *

You can use getDataRect() to get the value of dataRect

+ * + * @param dataRect dataRect + */ + public void setDataRect(final Rectangle dataRect) { + this.dataRect = dataRect; + } + + /** + * Gets the value of root . + * + * @return the value of javax.swing.JComponent + */ + public JComponent getRoot() { + return root; + } + + /** + * Sets the root . + *

You can use getRoot() to get the value of root

+ * + * @param jComponent component + */ + public void setRoot(final JComponent jComponent) { + this.root = jComponent; + } + + /** + * Gets the value of lineColor . + * + * @return the value of java.awt.Color + */ + public Color getLineColor() { + return lineColor; + } + + /** + * Gets the value of textColor . + * + * @return the value of java.awt.Color + */ + public Color getTextColor() { + return textColor; + } + + /** + * repaint. + */ + public void repaint() { + if (root != null) { + root.repaint(rect); + } + } + + /** + * x to time. + * + * @param xValue x + * @return long time + */ + public long x2ns(final int xValue) { + long ns = (xValue - rect.x) * AnalystPanel.DURATION / (root.getWidth() - rect.x); + return ns; + } + + /** + * time to x. + * + * @param ns time + * @return int x + */ + public int ns2x(final long ns) { + long xValue = ns * (root.getWidth() - rect.x) / AnalystPanel.DURATION; + return (int) xValue + rect.x; + } + + /** + + * edge inspect + * + * @param event event + * @return boolean boolean + */ + public boolean edgeInspect(final MouseEvent event) { + return event.getX() >= rect.x && event.getX() <= rect.x + rect.width && event.getY() >= rect.y + && event.getY() <= rect.y + rect.height; + } + + /** + * edge inspect + * + * @param rectangle rectangle + * @param event event + * @return boolean boolean + */ + public boolean edgeInspectRect(final Rectangle rectangle, final MouseEvent event) { + return event.getX() >= rectangle.x && event.getX() <= rectangle.x + rectangle.width + && event.getY() >= rectangle.y && event.getY() <= rectangle.y + rectangle.height; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/AbstractNode.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/AbstractNode.java new file mode 100644 index 000000000..6aab31069 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/AbstractNode.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.ruler; + +import ohos.devtools.views.trace.fragment.graph.AbstractGraph; + +import java.awt.Graphics; +import java.awt.Rectangle; +import java.awt.geom.Rectangle2D; + +/** + * all of data node graph node + * + * @version 1.0 + * @date 2021/4/26 14:33 + **/ +public abstract class AbstractNode { + /** + * Left padding + */ + static final int LEFT_PADDING = 5; + + /** + * Right padding + */ + static final int RIGHT_PADDING = 5; + + /** + * Direction Enum + */ + public enum Placement { + /** + * center + */ + CENTER, + /** + * Multi-line + */ + MULTILINE, + /** + * Middle row + */ + CENTER_LINE + } + + /** + * Draw string + * + * @param graphics graphics + * @param rectangle rectangle + * @param str str + * @param placement placement + */ + public void drawString(final Graphics graphics, final Rectangle rectangle, final String str, + final AbstractGraph.Placement placement) { + if (str == null) { + return; + } + final int len = 3; + if (placement == Placement.CENTER) { + Rectangle2D bounds = graphics.getFontMetrics(graphics.getFont()).getStringBounds(str, graphics); + double chartWidth = bounds.getWidth() / str.length(); // The width of each character + /** + * How many characters can be displayed in the rectangle + */ + double chartNum = (rectangle.getWidth() - LEFT_PADDING - RIGHT_PADDING) / chartWidth; + int mY = (int) (rectangle.getY() + bounds.getHeight()); + /** + * If the width is enough to display, the display text is in the middle of the rectangle + */ + if (chartNum >= str.length()) { + graphics.drawString(str, (int) (rectangle.getX() + (rectangle.width - bounds.getWidth()) / 2), mY); + } else if (chartNum >= len + 1) { + /** + * If the width is not enough to display, cut out the part that can be displayed with an ellipsis behind + */ + graphics + .drawString(str.substring(0, (int) chartNum - len) + "...", (int) (rectangle.getX() + LEFT_PADDING), + mY); + } else if (chartNum > 1 && chartNum < len) { // If only one character can be displayed + graphics.drawString(str.substring(0, 1), (int) (rectangle.getX() + LEFT_PADDING), mY); + } else { + graphics.drawString("", (int) (rectangle.getX() + LEFT_PADDING), mY); + } + } + if (placement == Placement.CENTER_LINE) { + Rectangle2D bounds = graphics.getFontMetrics(graphics.getFont()).getStringBounds(str, graphics); + double chartWidth = bounds.getWidth() / str.length(); // The width of each character + /** + * How many characters can be displayed in the rectangle + */ + double chartNum = (rectangle.width - LEFT_PADDING - RIGHT_PADDING) / chartWidth; + int mY = (int) (rectangle.getY() + rectangle.height / 2 + bounds.getHeight() / 2); + if (chartNum >= str.length()) { + /** + * If the width is enough to display, the display text is in the middle of the rectangle + */ + graphics.drawString(str, (int) (rectangle.getX() + (rectangle.width - bounds.getWidth()) / 2), mY); + } else if (chartNum >= len + 1) { + graphics + .drawString(str.substring(0, (int) chartNum - len) + "...", (int) (rectangle.getX() + LEFT_PADDING), + mY); + } else if (chartNum > 1 && chartNum < len) { // If only one character can be displayed + graphics.drawString(str.substring(0, 1), (int) (rectangle.getX() + LEFT_PADDING), mY); + } else { + graphics.drawString("", (int) (rectangle.getX() + LEFT_PADDING), mY); + } + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/CpuFragment.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/CpuFragment.java new file mode 100644 index 000000000..3451fcb33 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/CpuFragment.java @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.ruler; + +import ohos.devtools.views.trace.bean.CpuRateBean; +import ohos.devtools.views.trace.component.AnalystPanel; +import ohos.devtools.views.trace.listener.IRangeChangeListener; +import ohos.devtools.views.trace.util.ColorUtils; +import ohos.devtools.views.trace.util.Db; + +import javax.swing.JComponent; +import javax.swing.SwingUtilities; +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ForkJoinPool; +import java.util.stream.Collectors; + +/** + * cpu graphics + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class CpuFragment extends AbstractFragment { + private final Color shadowColor = new Color(0x99, 0x99, 0x99, 0xCE); + private int leftX; + private int rightX; + private int selectX; + private int selectY; + + /** + * scale center x ,centerX is leftX or rightX + */ + private int centerX; + private IRangeChangeListener rangeChangeListener; + + /** + * Gets the value of selectX . + * + * @return the value of int + */ + public int getSelectX() { + return selectX; + } + + /** + * Sets the selectX . + *

You can use getSelectX() to get the value of selectX

+ * + * @param selectX selectX + */ + public void setSelectX(final int selectX) { + this.selectX = selectX; + } + + /** + * Gets the value of selectY . + * + * @return the value of int + */ + public int getSelectY() { + return selectY; + } + + /** + * Sets the selectY . + *

You can use getSelectY() to get the value of selectY

+ * + * @param selectY selectY + */ + public void setSelectY(final int selectY) { + this.selectY = selectY; + } + + private Map> listMap; + + /** + * CpuFragment Constructor + * + * @param root parent + * @param listener listener + */ + public CpuFragment(final JComponent root, final IRangeChangeListener listener) { + this.setRoot(root); + getRect().setBounds(200, 22, root.getWidth() - 200, 72); + this.rangeChangeListener = listener; + ForkJoinPool.commonPool().submit(() -> { + ArrayList cpus = Db.getInstance().getCpuUtilizationRate(); + listMap = cpus.stream().collect(Collectors.groupingBy(cpuRateBean -> cpuRateBean.getCpu())); + SwingUtilities.invokeLater(() -> { + repaint(); + }); + }); + } + + /** + * listener + * + * @param listener listener + */ + public void setRangeChangeListener(final IRangeChangeListener listener) { + this.rangeChangeListener = listener; + } + + /** + * draw method + * + * @param graphics graphics + */ + @Override + public void draw(final Graphics2D graphics) { + getRect().width = getRoot().getWidth() - getRect().x; + graphics.setColor(Color.white); + graphics.fillRect(getRect().x, getRect().y, getRect().width, getRect().height); + if (listMap != null && !listMap.isEmpty()) { + int height = getRect().height / listMap.size(); + double rw = (getRect().width) / 100.00; + listMap.forEach((map, beanList) -> { + for (int index = 0, len = beanList.size(); index < len; index++) { + CpuRateBean cpuRateBean = beanList.get(index); + graphics.setStroke(new BasicStroke(0)); + graphics.setComposite( + AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float) cpuRateBean.getRate())); + graphics.setColor(ColorUtils.MD_PALETTE[map]); + int side = (int) (getRect().x + rw * index); + graphics.fillRect(side, getRect().y + map * height, (int) rw + 1, height); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f)); + } + }); + } + if (leftX == rightX && leftX != 0) { + rightX = leftX + 1; + } + if (leftX > 0 && leftX <= getRect().x + getRect().width) { + graphics.setColor(getRoot().getForeground()); + graphics.drawLine(leftX, getRect().y, leftX, getRect().y + getRect().height); + graphics.setColor(shadowColor); + graphics.fillRect(getRect().x, getRect().y, leftX - getRect().x, getRect().height); + graphics.drawRect(getRect().x, getRect().y, leftX - getRect().x, getRect().height); + } + if (rightX < getRoot().getWidth() && rightX >= getRect().x) { + graphics.setColor(getRoot().getForeground()); + graphics.drawLine(rightX, getRect().y, rightX, getRect().y + getRect().height); + graphics.setColor(shadowColor); + graphics.fillRect(rightX, getRect().y, getRect().x + getRect().width - rightX, getRect().height); + graphics.drawRect(rightX, getRect().y, getRect().x + getRect().width - rightX, getRect().height); + } + graphics.setColor(getRoot().getForeground()); + graphics.drawRect(leftX, getRect().y, rightX - leftX, getRect().height); + } + + /** + * mouse dragged listener + * + * @param event event + */ + public void mouseDragged(final MouseEvent event) { + if (selectY > getRect().y && selectY < getRect().y + getRect().height) { + if (event.getX() < selectX) { + rightX = selectX; + leftX = event.getX() <= getRect().x ? getRect().x : event.getX(); + } else { + rightX = event.getX() >= getRoot().getWidth() ? getRoot().getWidth() : event.getX(); + leftX = selectX; + } + if (leftX == rightX) { + if (leftX == getRect().x) { + rightX = leftX + 2; + } + if (rightX == getRoot().getWidth()) { + leftX = rightX - 2; + } + } + if (rangeChangeListener != null) { + if (selectX == leftX) { + centerX = leftX; + } + if (selectX == rightX) { + centerX = rightX; + } + rangeChangeListener.change(leftX, rightX, x2ns(leftX), x2ns(rightX), x2ns(centerX)); + } + getRoot().repaint(); + } + } + + /** + * change time range + * + * @param sn startNs + * @param en endNs + */ + public void setRange(final long sn, final long en) { + leftX = (int) (sn * getRect().width / AnalystPanel.DURATION) + getRect().x; + rightX = (int) (en * getRect().width / AnalystPanel.DURATION) + getRect().x; + repaint(); + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/IFragment.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/IFragment.java new file mode 100644 index 000000000..5b9d9bd32 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/IFragment.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.ruler; + +import java.awt.Graphics2D; + +/** + * Interface specification for drawing data + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public interface IFragment { + /** + * Drawing graphics method + * + * @param graphics graphics + */ + void draw(Graphics2D graphics); +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/LeftFragment.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/LeftFragment.java new file mode 100644 index 000000000..0b7c460ba --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/LeftFragment.java @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.ruler; + +import ohos.devtools.views.trace.util.TimeUtils; + +import javax.swing.JComponent; +import java.awt.AlphaComposite; +import java.awt.Graphics2D; +import java.awt.geom.Rectangle2D; + +import static ohos.devtools.views.trace.component.AnalystPanel.DURATION; + +/** + * The left part of the timeline display area + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public class LeftFragment extends AbstractFragment { + private String startTimeS = "0.0s"; + private long startNS; + private int extendHeight; + private String logString; + + /** + * Gets the value of startTimeS . + * + * @return the value of java.lang.String + */ + public String getStartTimeS() { + return startTimeS; + } + + /** + * Sets the startTimeS . + *

You can use getStartTimeS() to get the value of startTimeS

+ * + * @param time time + */ + public void setStartTimeS(final String time) { + this.startTimeS = time; + } + + /** + * Sets the startNS . + *

You can use getStartNS() to get the value of startNS

+ * + * @param ns Starting time + */ + public void setStartNS(final long ns) { + this.startNS = ns; + } + + /** + * Gets the value of extendHeight . + * + * @return the value of int + */ + public int getExtendHeight() { + return extendHeight; + } + + /** + * Sets the extendHeight . + *

You can use getExtendHeight() to get the value of extendHeight

+ * + * @param height height + */ + public void setExtendHeight(final int height) { + this.extendHeight = height; + } + + /** + * Gets the value of logString . + * + * @return the value of java.lang.String + */ + public String getLogString() { + return logString; + } + + /** + * Sets the logString . + *

You can use getLogString() to get the value of logString

+ * + * @param log log + */ + public void setLogString(final String log) { + this.logString = log; + } + + /** + * @param root Component + */ + public LeftFragment(final JComponent root) { + this.setRoot(root); + final int width = 200; + final int height = 134; + getRect().setBounds(0, 0, width, height); + } + + /** + * Drawing method + * + * @param graphics graphics + */ + @Override + public void draw(final Graphics2D graphics) { + final int yAxis = 94; + final float alpha50 = 0.5f; + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha50)); + graphics.setColor(getRoot().getForeground()); + graphics.drawLine(0, yAxis, getRect().width, yAxis); + graphics.drawLine(getRect().width, 0, getRect().width, getRect().height + extendHeight); + final int pad = 4; + graphics.drawLine(0, getRect().height, getRoot().getWidth(), getRect().height); + graphics.drawLine(0, 0, 0, getRect().height + extendHeight); + graphics.drawRect(getRect().x, getRect().y, getRect().width, getRect().height); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f)); + Rectangle2D rectangle2D = graphics.getFontMetrics().getStringBounds(startTimeS, graphics); + int strHeight = (int) rectangle2D.getHeight(); + int strWidth = (int) rectangle2D.getWidth() + pad; + graphics.drawString(TimeUtils.getSecondFromNSecond(DURATION), 2, yAxis + strHeight); + graphics.drawString(startTimeS, getRect().width - strWidth, yAxis + strHeight); + + if (logString != null && !logString.isEmpty()) { + int index = 0; + for (String str : logString.split(System.getProperty("line.separator"))) { + graphics.drawString(str, 1, index * 12 + 10); + index++; + } + } + } + + /** + * set Start Time + * + * @param leftNS leftNS + */ + public void setStartTime(final long leftNS) { + this.startNS = leftNS; + startTimeS = TimeUtils.getSecondFromNSecond(leftNS); + repaint(); + } + + /** + * get Start Time + * + * @return long Starting time + */ + public long getStartNS() { + return this.startNS; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/RulerFragment.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/RulerFragment.java new file mode 100644 index 000000000..3f45bd451 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/RulerFragment.java @@ -0,0 +1,516 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.ruler; + +import ohos.devtools.views.trace.bean.FlagBean; +import ohos.devtools.views.trace.component.AnalystPanel; +import ohos.devtools.views.trace.util.Final; +import ohos.devtools.views.trace.util.TimeUtils; + +import javax.swing.JComponent; +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; +import java.awt.geom.Rectangle2D; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +/** + * Timeline zoom size + * + * @version 1.0 + * @date 2021/4/22 12:25 + **/ +public class RulerFragment extends AbstractFragment implements FlagBean.IEventListener { + private static final BasicStroke BOLD_STORE = new BasicStroke(2); + private long leftNS; + private long rightNS; + private final long[] scales = + new long[] {50, 100, 200, 500, 1_000, 2_000, 5_000, 10_000, 20_000, 50_000, 100_000, 200_000, 500_000, + 1_000_000, 2_000_000, 5_000_000, 10_000_000, 20_000_000, 50_000_000, 100_000_000, 200_000_000, 500_000_000, + 1_000_000_000, 2_000_000_000, 5_000_000_000L, 10_000_000_000L, 20_000_000_000L, 50_000_000_000L, + 100_000_000_000L, 200_000_000_000L, 500_000_000_000L}; + + // The current time selection range is based on 20 units. + // The zoom level obtained by the position in the scales array is 70ns if calculated + private long min; + + // Then in the middle of 50L 100L min=50L + // The current time selection range The position in the zoom level scales array based on 20 units. + // If calculated, it is 70ns + private long max; + + // Then it is in the middle of 50L 100L max = 100L + private long l20; // The current time selection range is based on 20 units + + // When the weight ratio is greater than 24.3%, scale=max; otherwise, scale=min schematic diagram + private long scale; + + // min---l20-------max + private long centerNS; // Select from left to right is true + + // From right to left is false; + // when moving from left to right, use the left as the reference, + // and fill the cell to the left; when moving from right to left, fill the cell to the right + private double weight; // (l20-min)/(max-min) to get the proportion + private int extendHeight; + private int selectX; + private int selectY; + private FlagBean focusFlag = new FlagBean(); + private List flags = new ArrayList<>(); + private double realW; + private double startX; + private IChange changeListener; + + /** + * time range change listener + */ + public interface IChange { + /** + * Time range change monitoring + * + * @param startNS Starting time + * @param endNS End Time + */ + void change(long startNS, long endNS); + } + + /** + * Constructor + * + * @param root Parent component + * @param listener monitor + */ + public RulerFragment(final JComponent root, final IChange listener) { + this.changeListener = listener; + this.setRoot(root); + getRect().setBounds(200, 94, root.getWidth(), 40); + setRange(0, AnalystPanel.DURATION, 0); + } + + /** + * Set time range + * + * @param left left + * @param right right + * @param center center + */ + public void setRange(final long left, final long right, final long center) { + this.centerNS = center; + this.leftNS = left; + this.rightNS = right; + l20 = (this.rightNS - left) / 20; + for (int index = 0; index < scales.length; index++) { + if (scales[index] > l20) { + if (index > 0) { + min = scales[index - 1]; + } else { + min = 0; + } + max = scales[index]; + weight = (l20 - min) * 1.0 / (max - min); + if (weight > 0.243) { + scale = max; + } else { + scale = min; + } + break; + } + } + if (scale == 0) { + scale = scales[0]; + } + for (FlagBean flag : flags) { + flag.rect.x = getX(flag.getNs()); + } + repaint(); + } + + /** + * Drawing method + * + * @param graphics graphics + */ + @Override + public void draw(final Graphics2D graphics) { + getRect().width = getRoot().getWidth() - getRect().x; + graphics.setFont(Final.SMALL_FONT); + graphics.setColor(getRoot().getForeground()); + if (rightNS - leftNS == 0) { + return; + } + if (scale == 0) { + setRange(0, AnalystPanel.DURATION, 0); + } + if (changeListener != null) { + changeListener.change(leftNS, rightNS); + } + if (centerNS == leftNS) { // Fill from left to right + drawLeft2Right(graphics); + } + if (centerNS == rightNS) { // Fill from right to left + drawRight2Left(graphics); + } + for (FlagBean flagBean : flags) { + graphics.setColor(flagBean.getColor()); + graphics.setStroke(new BasicStroke(2)); + int xAxis = flagBean.rect.x; + if (xAxis > 0) { + graphics.drawLine(xAxis + getRect().x, getRect().y + getRect().height / 2, getRect().x + xAxis, + getRect().y + getRect().height - 2); + graphics.fillRect(xAxis + getRect().x, getRect().y + getRect().height / 2, 10, 10); + graphics.fillRect(xAxis + getRect().x + 7, getRect().y + getRect().height / 2 + 2, 7, 7); + flagBean.draw(graphics); + } + } + drawFocusFlag(graphics); + } + + private void drawRight2Left(Graphics2D graphics) { + graphics.setColor(getRoot().getForeground()); + final AlphaComposite alpha = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f); + graphics.setComposite(alpha); + graphics.drawLine(getRect().x, getRect().y, getRect().x + getRect().width, getRect().y); + long tmpNs = rightNS - leftNS; + startX = getRect().x + getRect().width; + realW = (scale * getRect().width) / (rightNS - leftNS); + String str; + while (tmpNs > 0) { + str = TimeUtils.getSecondFromNSecond(tmpNs); + if (str.isEmpty()) { + str = "0s"; + } + graphics.setColor(getRoot().getForeground()); + final AlphaComposite alpha50 = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .5f); + graphics.setComposite(alpha50); + graphics.drawLine((int) startX, getRect().y, (int) startX, getRect().y + getRect().height + extendHeight); + graphics.setColor(getRoot().getForeground()); + final AlphaComposite alphaFul = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f); + graphics.setComposite(alphaFul); + graphics.drawString("+" + str, (int) startX, + getRect().y + (int) (graphics.getFontMetrics().getStringBounds("+" + str, graphics).getHeight())); + startX -= realW; + tmpNs -= scale; + } + } + + private void drawLeft2Right(Graphics2D graphics) { + if (scale == 0) { + return; + } + long tmpNs = 0; + long yu = leftNS % scale; + realW = (scale * getRect().width) / (rightNS - leftNS); + startX = getRect().x; + if (yu != 0) { + float firstNodeWidth = (float) ((yu * 1.0) / scale * realW); + startX += firstNodeWidth; + tmpNs += yu; + graphics.setColor(getRoot().getForeground()); + final AlphaComposite alpha = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .5f); + graphics.setComposite(alpha); + graphics.drawLine((int) startX, getRect().y, (int) startX, getRect().y + getRect().height); + } + graphics.setColor(getRoot().getForeground()); + graphics.drawLine(getRect().x, getRect().y, getRect().x + getRect().width, getRect().y); + String str; + while (tmpNs < rightNS - leftNS) { + graphics.setColor(getRoot().getForeground()); + final AlphaComposite alpha = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .5f); + graphics.setComposite(alpha); + graphics.drawLine((int) startX, getRect().y, (int) startX, getRect().y + getRect().height + extendHeight); + str = TimeUtils.getSecondFromNSecond(tmpNs); + if (str.isEmpty()) { + str = "0s"; + } + graphics.setColor(getRoot().getForeground()); + final AlphaComposite alphaFull = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f); + graphics.setComposite(alphaFull); + String timS = "+" + str; + Rectangle2D bounds = graphics.getFontMetrics(Final.SMALL_FONT).getStringBounds(timS, graphics); + graphics.drawString(timS, (int) startX, (int) (getRect().y + bounds.getHeight())); + startX += realW; + tmpNs += scale; + } + } + + private void drawFocusFlag(Graphics2D graphics) { + if (focusFlag.isVisible()) { + final int side = 10; + graphics.setColor(focusFlag.getColor()); + graphics.setStroke(BOLD_STORE); + graphics.drawLine(focusFlag.rect.x + getRect().x, getRect().y + getRect().height / 2, + getRect().x + focusFlag.rect.x, getRect().y + getRect().height + extendHeight); + graphics.fillRect(focusFlag.rect.x + getRect().x, getRect().y + getRect().height / 2, side, side); + final int offset = 7; + graphics + .fillRect(focusFlag.rect.x + getRect().x + offset, getRect().y + getRect().height / 2 + 2, side, side); + } + } + + /** + * Convert x coordinate according to time + * + * @param ns ns + * @return int int + */ + public int getX(final long ns) { + return (int) ((ns - leftNS) * getRect().width / ((rightNS - leftNS) * 1.0)); + } + + /** + * Mouse movement event + * + * @param event event + */ + public void mouseMoved(final MouseEvent event) { + final int leftW = 200; + if (selectY > getRect().y && selectY < getRect().y + getRect().height && event.getX() >= leftW) { + Optional first = flags.stream().filter(bean -> event.getX() >= bean.rect.x + getRect().x + && event.getX() <= bean.rect.x + getRect().x + bean.rect.width).findFirst(); + if (first.isPresent()) { + focusFlag.setVisible(false); + } else { + focusFlag.setVisible(true); + focusFlag.rect.x = event.getX() - getRect().x; + focusFlag.rect.y = getRect().y + getRect().height / 2; + focusFlag.rect.width = 17; + focusFlag.rect.height = getRect().height / 2; + } + } else { + focusFlag.setVisible(false); + } + getRoot().repaint(); + } + + /** + * Mouse pressed event + * + * @param event event + */ + public void mousePressed(final MouseEvent event) { + final int leftW = 200; + if (selectY > getRect().y && selectY < getRect().y + getRect().height && event.getX() >= leftW) { + Optional first = flags.stream().filter(bean -> event.getX() >= bean.rect.x + getRect().x + && event.getX() <= bean.rect.x + getRect().x + bean.rect.width).findFirst(); + if (first.isPresent()) { + FlagBean flagBean = first.get(); + flagBean.onClick(event); + } else { + FlagBean flagBean = new FlagBean(); + flagBean.root = getRoot(); + flagBean.rect.x = event.getX() - getRect().x; + flagBean.rect.y = getRect().y + getRect().height / 2; + flagBean.setEventListener(this); + flagBean.rect.width = 17; + flagBean.rect.height = getRect().height / 2; + flagBean.setNs((long) ((rightNS - leftNS) / (getRect().width * 1.0) * flagBean.rect.x) + leftNS); + flagBean.setVisible(true); + flags.add(flagBean); + } + repaint(); + } + } + + /** + * FlagBean object click event + * + * @param event event + * @param data data + */ + @Override + public void click(final MouseEvent event, final FlagBean data) { + if (AnalystPanel.iFlagClick != null) { + AnalystPanel.iFlagClick.click(data); + } + } + + /** + * Loss of focus event + * + * @param event event + * @param data data + */ + @Override + public void blur(final MouseEvent event, final FlagBean data) { + } + + /** + * Get focus event + * + * @param event event + * @param data data + */ + @Override + public void focus(final MouseEvent event, final FlagBean data) { + } + + /** + * Mouse move event + * + * @param event event + * @param data data + */ + @Override + public void mouseMove(final MouseEvent event, final FlagBean data) { + } + + /** + * Remove the flag mark + * + * @param data data + */ + @Override + public void delete(final FlagBean data) { + flags.removeIf(bean -> bean.getNs() == data.getNs()); + repaint(); + } + + /** + * Gets the value of leftNS . + * + * @return the value of long + */ + public long getLeftNS() { + return leftNS; + } + + /** + * Sets the leftNS . + *

You can use getLeftNS() to get the value of leftNS

+ * + * @param ns ns + */ + public void setLeftNS(final long ns) { + this.leftNS = ns; + } + + /** + * Gets the value of rightNS . + * + * @return the value of long + */ + public long getRightNS() { + return rightNS; + } + + /** + * Sets the rightNS . + *

You can use getRightNS() to get the value of rightNS

+ * + * @param ns ns + */ + public void setRightNS(final long ns) { + this.rightNS = ns; + } + + /** + * Gets the value of scale . + * + * @return the value of long + */ + public long getScale() { + return scale; + } + + /** + * Sets the scale . + *

You can use getScale() to get the value of scale

+ * + * @param scale scale + */ + public void setScale(final long scale) { + this.scale = scale; + } + + /** + * Gets the value of centerNS . + * + * @return the value of long + */ + public long getCenterNS() { + return centerNS; + } + + /** + * Sets the centerNS . + *

You can use getCenterNS() to get the value of centerNS

+ * + * @param ns ns + */ + public void setCenterNS(final long ns) { + this.centerNS = ns; + } + + /** + * Gets the value of extendHeight . + * + * @return the value of int + */ + public int getExtendHeight() { + return extendHeight; + } + + /** + * Sets the extendHeight . + *

You can use getExtendHeight() to get the value of extendHeight

+ * + * @param height height + */ + public void setExtendHeight(final int height) { + this.extendHeight = height; + } + + /** + * Gets the value of selectX . + * + * @return the value of int + */ + public int getSelectX() { + return selectX; + } + + /** + * Sets the selectX . + *

You can use getSelectX() to get the value of selectX

+ * + * @param select select + */ + public void setSelectX(final int select) { + this.selectX = select; + } + + /** + * Gets the value of selectY . + * + * @return the value of int + */ + public int getSelectY() { + return selectY; + } + + /** + * Sets the selectY . + *

You can use getSelectY() to get the value of selectY

+ * + * @param select select + */ + public void setSelectY(final int select) { + this.selectY = select; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/TopFragment.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/TopFragment.java new file mode 100644 index 000000000..83c03d79e --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/fragment/ruler/TopFragment.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.ruler; + +import ohos.devtools.views.trace.util.TimeUtils; + +import javax.swing.JComponent; +import java.awt.AlphaComposite; +import java.awt.Font; +import java.awt.Graphics2D; + +import static ohos.devtools.views.trace.component.AnalystPanel.DURATION; + + +/** + * Time axis scale + * + * @version 1.0 + * @date 2021/4/22 12:25 + **/ +public class TopFragment extends AbstractFragment { + private final Font smallFont = new Font("宋体", Font.ITALIC, 10); + + /** + * constructor + * + * @param root parent component + */ + public TopFragment(final JComponent root) { + this.setRoot(root); + final int leftW = 200; + final int height = 18; + getRect().setBounds(leftW, 0, root.getWidth(), height); + } + + /** + * Drawing method + * + * @param graphics graphics + */ + @Override + public void draw(final Graphics2D graphics) { + int width = getRoot().getWidth() - getRect().x; + final int height = 18; + final double sq = 10.00; // 10 equal parts + double wid = width / sq; + double sqWidth = wid / sq; + graphics.setFont(getRoot().getFont()); + graphics.setColor(getRoot().getForeground()); + final AlphaComposite alpha50 = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .5f); + graphics.setComposite(alpha50); + int yAxis = 0; + graphics.drawLine(getRect().x, yAxis, getRect().x + width, yAxis); + final int num = 10; + long second = DURATION / num; + final AlphaComposite alpha100 = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f); + for (int index = 0; index <= num; index++) { + int tx = (int) (index * wid) + getRect().x; + graphics.setColor(getRoot().getForeground()); + graphics.setComposite(alpha50); + graphics.drawLine(tx, yAxis, tx, height); + String str = TimeUtils.getSecondFromNSecond(second * index); + graphics.setColor(getRoot().getForeground()); + graphics.setComposite(alpha100); + final int offset = 3; + graphics.drawString(str, tx + offset, height); + for (int numIndex = 1; numIndex < num; numIndex++) { + int side = (int) (numIndex * sqWidth) + tx; + graphics.setColor(getRoot().getForeground()); + graphics.drawLine(side, yAxis, side, height / offset); + } + } + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/listener/IFlagListener.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/listener/IFlagListener.java new file mode 100644 index 000000000..16c871dd8 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/listener/IFlagListener.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.listener; + +import ohos.devtools.views.trace.bean.FlagBean; + +/** + * Small flag change callback + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public interface IFlagListener { + /** + * Remove the small flag callback. + * + * @param flag flag + */ + void flagRemove(FlagBean flag); + + /** + * The color of the small flag and the name change callback. + * + * @param flag flag + */ + void flagChange(FlagBean flag); +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/listener/IRangeChangeListener.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/listener/IRangeChangeListener.java new file mode 100644 index 000000000..756335f97 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/listener/IRangeChangeListener.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.listener; + +/** + * Timeline range change callback listener + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public interface IRangeChangeListener { + /** + * Range change callback + * + * @param leftX x-axis left coordinate + * @param rightX x-axis right coordinate + * @param leftNS Nanoseconds on the left + * @param rightNS Nanoseconds on the right + * @param centerNS Nanoseconds on the center + */ + void change(int leftX, int rightX, long leftNS, long rightNS, long centerNS); +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/listener/IScrollSliceLinkListener.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/listener/IScrollSliceLinkListener.java new file mode 100644 index 000000000..129060dda --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/listener/IScrollSliceLinkListener.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.listener; + +/** + * Scroll distance change listener + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public interface IScrollSliceLinkListener { + /** + * The currently clicked data object + * + * @param bean bean + */ + void linkClick(Object bean); +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/ColorUtils.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/ColorUtils.java new file mode 100644 index 000000000..e5e4d44ce --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/ColorUtils.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.util; + +import ohos.devtools.views.trace.bean.CpuData; + +import java.awt.Color; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Color tool + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public final class ColorUtils { + /** + * Gray color object + */ + public static final Color GREY_COLOR = Color.getHSBColor(0, 0, 62); // grey + + /** + * Color array of all current columns + */ + public static final Color[] MD_PALETTE = new Color[] {new Color(0xf44034), // red + new Color(0xe92063), // pink + new Color(0x9b27b0), // purple + new Color(0x673ab6), // deep purple + new Color(0x4051b5), // indigo + new Color(0x2094f3), // blue + new Color(0x02a6f2), // light blue + new Color(0x00bdd6), // cyan + new Color(0x009485), // teal + new Color(0x4cae4f), // green + new Color(0x8bc34b), // light green + new Color(0xcbdc38), // lime + new Color(0xff9105), // amber 0xffc105 + new Color(0xff9900), // orange + new Color(0xff5724), // deep orange + new Color(0x795649), // brown + new Color(0x607c8a), // blue gray + new Color(0xbdaa00), // yellow 0xffec3d + }; + + /** + * Current method color array + */ + public static final Color[] FUNC_COLOR = new Color[] {new Color(0x9b27b0), // purple + new Color(0x317d31), new Color(0x673ab6), // deep purple + new Color(0xa25b57), new Color(0x4051b5), // indigo + new Color(0x2094f3), // blue + new Color(0x99ba36), new Color(0x4051b5) }; + + private static Map colorHashMap = new ConcurrentHashMap(); + + private ColorUtils() { + } + + /** + * Get color according to id + * + * @param id id + * @return Color Color + */ + public static Color getColor(final int id) { + if (colorHashMap.containsKey(id)) { + return colorHashMap.get(id); + } else { + final int red = ((id * 10000000) & 0xff0000) >> 16; + final int green = ((id * 10000000) & 0x00ff00) >> 8; + final int blue = id * 10000000 & 0x0000ff; + final Color color = new Color(red, green, blue, 255); + colorHashMap.put(id, color); + return color; + } + } + + /** + * Get the color value according to the length of the string + * + * @param str str + * @param max max + * @return int + */ + public static int hash(final String str, final int max) { + final int colorA = 0x811c9dc5; + final int colorB = 0xfffffff; + final int colorC = 16777619; + final int colorD = 0xffffffff; + int hash = colorA & colorB; + for (int index = 0; index < str.length(); index++) { + hash ^= str.charAt(index); + hash = (hash * colorC) & colorD; + } + return Math.abs(hash) % max; + } + + /** + * Get color based on cpu object data + * + * @param thread thread + * @return Color + */ + public static Color colorForThread(final CpuData thread) { + if (thread == null) { + return GREY_COLOR; + } + int tid = thread.getProcessId() >= 0 ? thread.getProcessId() : thread.getTid(); + return colorForTid(tid); + } + + /** + * Get color according to tid + * + * @param tid tid + * @return Color + */ + public static Color colorForTid(final int tid) { + int colorIdx = hash(String.valueOf(tid), MD_PALETTE.length); + return MD_PALETTE[colorIdx]; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/DataUtils.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/DataUtils.java new file mode 100644 index 000000000..67c32cbde --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/DataUtils.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.util; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; + +/** + * Data tools + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public final class DataUtils { + private DataUtils() { + } + + /** + * Get the json object + * + * @return JsonObject + */ + public static JsonObject getJson() { + JsonObject jsonObject = null; + try (InputStream STREAM = DataUtils.class.getClassLoader().getResourceAsStream("data.json")) { + jsonObject = new Gson().fromJson(new InputStreamReader(STREAM, "UTF-8"), JsonObject.class); + } catch (UnsupportedEncodingException unsupportedEncodingException) { + unsupportedEncodingException.printStackTrace(); + } catch (IOException ioException) { + ioException.printStackTrace(); + } + return jsonObject; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/Db.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/Db.java new file mode 100644 index 000000000..78a4f45b3 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/Db.java @@ -0,0 +1,833 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.util; + +import ohos.devtools.views.trace.bean.CpuData; +import ohos.devtools.views.trace.bean.CpuFreqData; +import ohos.devtools.views.trace.bean.CpuRateBean; +import ohos.devtools.views.trace.bean.FunctionBean; +import ohos.devtools.views.trace.bean.Process; +import ohos.devtools.views.trace.bean.ProcessData; +import ohos.devtools.views.trace.bean.ProcessMem; +import ohos.devtools.views.trace.bean.ProcessMemData; +import ohos.devtools.views.trace.bean.ThreadData; +import ohos.devtools.views.trace.bean.WakeupBean; +import org.apache.commons.io.IOUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.URL; +import java.nio.charset.Charset; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.LinkedBlockingQueue; + +/** + * Database operation class + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public final class Db { + private static boolean isLocal; + private static volatile Db db; + private static String dbName = "trace.db"; + private final String[] units = new String[] {"", "K", "M", "G", "T", "E"}; + + /** + * Gets the value of dbName . + * + * @return the value of java.lang.String + */ + public static String getDbName() { + return dbName; + } + + /** + * Sets the dbName . + *

You can use getDbName() to get the value of dbName

+ * + * @param dbName dbName + */ + public static void setDbName(final String dbName) { + Db.dbName = dbName; + } + + private Db() { + } + + private LinkedBlockingQueue pool = new LinkedBlockingQueue(); + + /** + * Get database connection + * + * @return Connection + */ + public Connection getConn() { + Connection connection = null; + try { + connection = pool.take(); + } catch (InterruptedException exception) { + exception.printStackTrace(); + } + return connection; + } + + /** + * Return the connection to the database connection pool after use + * + * @param conn conn + */ + public void free(final Connection conn) { + try { + pool.put(conn); + } catch (InterruptedException exception) { + exception.printStackTrace(); + } + } + + private Optional newConn() { + URL path = DataUtils.class.getClassLoader().getResource(dbName); + Connection conn = null; + try { + if (isLocal) { + conn = DriverManager.getConnection("jdbc:sqlite:" + dbName); + } else { + conn = DriverManager.getConnection("jdbc:sqlite::resource:" + path); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } + return Optional.ofNullable(conn); + } + + /** + * Load the database file according to the file location variable + * + * @param isLocal isLocal + */ + public static void load(final boolean isLocal) { + Db.isLocal = isLocal; + final int maxConnNum = 10; + try { + Class.forName("org.sqlite.JDBC"); + for (Connection connection : db.pool) { + connection.close(); + } + db.pool.clear(); + for (int size = 0; size < maxConnNum; size++) { + db.newConn().ifPresent(c -> { + try { + db.pool.put(c); + } catch (InterruptedException e) { + e.printStackTrace(); + } + }); + } + db.newConn().ifPresent(c -> { + try { + Statement statement = c.createStatement(); + statement.execute("CREATE VIEW IF NOT EXISTS thread AS SELECT id as utid, * FROM internal_thread;"); + statement + .execute("CREATE VIEW IF NOT EXISTS process AS SELECT id as upid, * FROM internal_process;"); + statement + .execute("CREATE VIEW IF NOT EXISTS sched AS SELECT *, ts + dur as ts_end FROM sched_slice;"); + statement.execute("CREATE VIEW IF NOT EXISTS instants AS SELECT *, 0.0 as value FROM instant;"); + statement.close(); + c.close(); + } catch (SQLException exception) { + exception.printStackTrace(); + } + }); + } catch (SQLException throwables) { + throwables.printStackTrace(); + } catch (ClassNotFoundException classNotFoundException) { + classNotFoundException.printStackTrace(); + } + } + + /** + * Get the current current db object + * + * @return Db + */ + public static Db getInstance() { + if (db == null) { + db = new Db(); + } + return db; + } + + /** + * Read the sql directory under resource + * + * @param sqlName sqlName + * @return String sql + */ + public static String getSql(String sqlName) { + String path = "sql/" + sqlName + ".txt"; + try (InputStream STREAM = DataUtils.class.getClassLoader().getResourceAsStream(path)) { + return IOUtils.toString(STREAM, Charset.forName("UTF-8")); + } catch (UnsupportedEncodingException exception) { + exception.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return ""; + } + + /** + * Query the current maximum and minimum time + * + * @return long + */ + public long queryTotalTime() { + long res = 0; + Statement stat = null; + ResultSet rs = null; + Connection conn = getConn(); + try { + stat = conn.createStatement(); + rs = stat.executeQuery(getSql("QueryTotalTime")); // Query data + while (rs.next()) { // Print out the queried data + res = rs.getLong("total"); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + rs.close(); + stat.close(); + free(conn); + } catch (SQLException exception) { + exception.printStackTrace(); + } + } + return res; + } + + /** + * Get the number of cpu + * + * @return List + */ + public List queryCpu() { + ArrayList res = new ArrayList<>(); + Statement stat = null; + ResultSet rs = null; + Connection conn = getConn(); + try { + stat = conn.createStatement(); + rs = + stat.executeQuery("select cpu from cpu_counter_track where name='cpuidle' order by cpu;"); // Query data + while (rs.next()) { // Print out the queried data + res.add(rs.getInt("cpu")); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + rs.close(); + stat.close(); + free(conn); + } catch (SQLException throwables) { + throwables.printStackTrace(); + } + } + return res; + } + + /** + * Get the number of cpu according to the cpu frequency + * + * @return List Integer + */ + public List queryCpuFreq() { + ArrayList res = new ArrayList<>(); + Statement stat = null; + ResultSet rs = null; + Connection conn = getConn(); + try { + stat = conn.createStatement(); + rs = stat.executeQuery( + "select cpu from cpu_counter_track where (name='cpufreq' or name='cpu_frequency') order by cpu;"); + while (rs.next()) { // Print out the queried data + res.add(rs.getInt("cpu")); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + rs.close(); + stat.close(); + free(conn); + } catch (SQLException exception) { + exception.printStackTrace(); + } + } + return res; + } + + /** + * Get the maximum number of cpu + * + * @return int + */ + public int queryCpuMax() { + String queryCpuSql = "select cpu from sched_slice order by cpu desc limit 1"; + Statement stat = null; + ResultSet rs = null; + Connection conn = getConn(); + try { + stat = conn.createStatement(); + rs = stat.executeQuery(queryCpuSql); // Query data + while (rs.next()) { // Print out the queried data + return rs.getInt("cpu"); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + rs.close(); + stat.close(); + free(conn); + } catch (SQLException exception) { + exception.printStackTrace(); + } + } + return -1; + } + + /** + * Query cpu data list according to cpu + * + * @param cpu cpu + * @return List CpuData + */ + public List queryCpuData(final int cpu) { + ArrayList res = new ArrayList<>(); + Statement stat = null; + ResultSet rs = null; + Connection conn = getConn(); + try { + stat = conn.createStatement(); + String sql = String.format(Locale.ENGLISH, getSql("QueryCpuData"), cpu); + rs = stat.executeQuery(sql); + while (rs.next()) { // Print out the queried data + CpuData cpuData = new CpuData(); + cpuData.setCpu(rs.getInt("cpu")); + cpuData.setProcessId(rs.getInt("processId")); + cpuData.setProcessName(rs.getString("processName")); + cpuData.setProcessCmdLine(rs.getString("processCmdLine")); + cpuData.setName(rs.getString("name")); + cpuData.setTid(rs.getInt("tid")); + cpuData.setId(rs.getInt("id")); + cpuData.setSchedId(rs.getInt("schedId")); + cpuData.setType(rs.getString("type")); + cpuData.setDuration(rs.getLong("dur")); + cpuData.setStartTime(rs.getLong("startTime")); + cpuData.setPriority(rs.getInt("priority")); + cpuData.setEndState(rs.getString("end_state")); + res.add(cpuData); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + rs.close(); + stat.close(); + free(conn); + } catch (SQLException exception) { + exception.printStackTrace(); + } + } + return res; + } + + /** + * Get the maximum frequency of the cpu + * + * @return String + */ + public Map queryCpuMaxFreq() { + String queryMaxFreqSql = "select max(value) as maxFreq\n" + " from counter c\n" + + " inner join cpu_counter_track t on c.track_id = t.id\n" + + " where (name = 'cpufreq' or name='cpu_frequency');"; + Statement stat = null; + ResultSet rs = null; + Connection conn = getConn(); + StringBuilder maxFreq = new StringBuilder(); + Map resMap = new HashMap<>(); + resMap.put("name", "0 Ghz"); + resMap.put("value", 0); + try { + int maxIntFreq = 0; + stat = conn.createStatement(); + rs = stat.executeQuery(queryMaxFreqSql); // Query data + while (rs.next()) { // Print out the queried data + maxIntFreq = rs.getInt("maxFreq"); + } + if (maxIntFreq > 0) { + double log10 = Math.ceil(Math.log10(maxIntFreq)); + double pow10 = Math.pow(10, log10); + double afterCeil = Math.ceil(maxIntFreq / (pow10 / 4)) * (pow10 / 4); + resMap.put("value", afterCeil); + double unitIndex = Math.floor(log10 / 3); + maxFreq.append(afterCeil / Math.pow(10, unitIndex * 3)); + maxFreq.append(units[(int) unitIndex + 1]); + } else { + maxFreq.append(maxIntFreq); + } + maxFreq.append("hz"); + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + rs.close(); + stat.close(); + free(conn); + } catch (SQLException exception) { + exception.printStackTrace(); + } + } + resMap.put("name", maxFreq.toString()); + return resMap; + } + + /** + * Query cpu frequency information + * + * @param cpu cpu + * @return List CpuFreqData + */ + public List queryCpuFreqData(final int cpu) { + ArrayList res = new ArrayList<>(); + String queryCpuFreqDataSql = + "select cpu,value,ts-tb.start_ts as startNS \n" + " from counter c ,trace_bounds tb\n" + + " inner join cpu_counter_track t on c.track_id = t.id\n" + // The id in cpu_counter_track is invalid, here change t.id to t.cpu + + " where (name = 'cpufreq' or name='cpu_frequency') and cpu=" + cpu + " order by " + "ts ;"; + Statement stat = null; + ResultSet rs = null; + Connection conn = getConn(); + try { + stat = conn.createStatement(); + rs = stat.executeQuery(queryCpuFreqDataSql); // Query data + while (rs.next()) { // Print out the queried data + CpuFreqData cpuData = new CpuFreqData(); + cpuData.setCpu(rs.getInt("cpu")); + cpuData.setValue(rs.getLong("value")); + cpuData.setStartTime(rs.getLong("startNS")); + res.add(cpuData); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + rs.close(); + stat.close(); + free(conn); + } catch (SQLException exception) { + exception.printStackTrace(); + } + } + return res; + } + + /** + * Get all process information. + * + * @return List Process + */ + public List queryProcess() { + String sql = getSql("QueryProcess"); + ArrayList res = new ArrayList<>(); + Statement stat = null; + ResultSet rs = null; + Connection conn = getConn(); + try { + stat = conn.createStatement(); + rs = stat.executeQuery(sql); // Query data + while (rs.next()) { // Print out the queried data + Process data = new Process(); + data.setName(rs.getString("processName")); + data.setPid(rs.getInt("pid")); + res.add(data); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + rs.close(); + stat.close(); + free(conn); + } catch (SQLException exception) { + exception.printStackTrace(); + } + } + return res; + } + + /** + * Obtain process process thread information, group by the above process information + * + * @return List ThreadData + */ + public List queryProcessThreads() { + String sql = getSql("QueryProcessThreads"); + ArrayList res = new ArrayList<>(); + Statement stat = null; + ResultSet rs = null; + Connection conn = getConn(); + try { + stat = conn.createStatement(); + rs = stat.executeQuery(sql); // Query data + while (rs.next()) { // Print out the queried data + ThreadData threadData = new ThreadData(); + threadData.setuPid(rs.getInt("upid")); + threadData.setuTid(rs.getInt("utid")); + threadData.setTid(rs.getInt("tid")); + threadData.setPid(rs.getInt("pid")); + threadData.setProcessName(rs.getString("processName")); + threadData.setThreadName(rs.getString("threadName")); + res.add(threadData); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + rs.close(); + stat.close(); + free(conn); + } catch (SQLException exception) { + exception.printStackTrace(); + } + } + return res; + } + + /** + * Drawing process information is related to multiple CPUs. + * + * @param id id + * @return List ProcessData + */ + public List queryProcessData(final int id) { + String sql = + "select thread_state.*,ts-tb.start_ts as startTime from thread_state,trace_bounds tb where utid in(\n" + + "select it.id from internal_thread as it\n" + " left join internal_process ip on it.upid = ip.id\n" + + "where ip.pid=" + id + ") and cpu is not null order by startTime"; + ArrayList res = new ArrayList<>(); + Statement stat = null; + ResultSet rs = null; + Connection conn = getConn(); + try { + stat = conn.createStatement(); + rs = stat.executeQuery(sql); // Query data + while (rs.next()) { // Print out the queried data + ProcessData data = new ProcessData(); + data.setId(rs.getInt("id")); + data.setUtid(rs.getInt("utid")); + data.setCpu(rs.getInt("cpu")); + data.setStartTime(rs.getLong("startTime")); + data.setDuration(rs.getLong("dur")); + data.setState(rs.getString("state")); + res.add(data); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + rs.close(); + stat.close(); + free(conn); + } catch (SQLException exception) { + exception.printStackTrace(); + } + } + return res; + } + + /** + * Thread information. + * + * @param id id + * @return List ThreadData + */ + public List queryThreadData(final int id) { + String sql = String.format(Locale.ENGLISH, getSql("QueryThreadData"), id); + ArrayList res = new ArrayList<>(); + Statement stat = null; + ResultSet rs = null; + Connection conn = getConn(); + try { + stat = conn.createStatement(); + rs = stat.executeQuery(sql); // Query data + while (rs.next()) { // Print out the queried data + ThreadData data = new ThreadData(); + data.setTid(rs.getInt("tid")); + data.setPid(rs.getInt("pid")); + data.setCpu(rs.getInt("cpu")); + data.setStartTime(rs.getLong("startTime")); + data.setDuration(rs.getLong("dur")); + data.setProcessName(rs.getString("processName")); + data.setState(rs.getString("state")); + res.add(data); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + rs.close(); + stat.close(); + free(conn); + } catch (SQLException exception) { + exception.printStackTrace(); + } + } + return res; + } + + /** + * Get the current ring thread object + * + * @param cpuData cpuData + * @return WakeupBean + */ + public Optional queryWakeupThread(final CpuData cpuData) { + WakeupBean wb = null; + String wakeTimeSql = String + .format(Locale.ENGLISH, getSql("QueryWakeUpThread_WakeTime"), cpuData.getId(), cpuData.getStartTime(), + cpuData.getId(), cpuData.getStartTime()); + Connection conn = getConn(); + try { + Statement statement = conn.createStatement(); + ResultSet rs = statement.executeQuery(wakeTimeSql); + while (rs.next()) { + long wakeupTs = rs.getLong("wakeTs"); + long startTs = rs.getLong("start_ts"); + long preRow = rs.getLong("preRow"); + if (wakeupTs < preRow) { + rs.close(); + statement.close(); + return Optional.ofNullable(wb); + } + String wakeThreadSql = String.format(Locale.ENGLISH, getSql("QueryWakeUpThread_WakeThread")); + wakeThreadSql = wakeThreadSql.replaceAll("wakeup_ts", wakeupTs + ""); + ResultSet rs1 = statement.executeQuery(wakeThreadSql); + while (rs1.next()) { + wb = new WakeupBean(); + wb.setWakeupTime(wakeupTs - startTs); + wb.setSchedulingLatency(cpuData.getStartTime() - wb.getWakeupTime()); + wb.setWakeupCpu(rs1.getInt("cpu")); + wb.setWakeupThread(rs1.getString("thread")); + wb.setWakeupProcess(rs1.getString("process")); + wb.setWakeupPid(rs1.getString("pid")); + wb.setWakeupTid(rs1.getString("tid")); + if (wb.getWakeupProcess() == null) { + wb.setWakeupProcess(wb.getWakeupThread()); + } + if (wb.getWakeupPid() == null) { + wb.setWakeupPid(wb.getWakeupTid()); + } + wb.setSchedulingDesc(getSql("QueryWakeUpThread_Desc")); + rs1.close(); + rs.close(); + statement.close(); + break; + } + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + free(conn); + } + return Optional.ofNullable(wb); + } + + /** + * Get cpu utilization + * + * @return ArrayList CpuRateBean + */ + public ArrayList getCpuUtilizationRate() { + ArrayList list = new ArrayList<>(); + String sql = getSql("GetCpuUtilizationRate"); + Connection conn = getConn(); + Statement st = null; + ResultSet rs = null; + try { + st = conn.createStatement(); + rs = st.executeQuery(sql); + while (rs.next()) { + CpuRateBean cpuRateBean = new CpuRateBean(); + cpuRateBean.setCpu(rs.getInt("cpu")); + cpuRateBean.setIndex(rs.getInt("ro")); + cpuRateBean.setRate(rs.getDouble("rate")); + list.add(cpuRateBean); + } + rs.close(); + st.close(); + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + free(conn); + } + return list; + } + + /** + * Get the memory information of the process + * + * @return List ProcessMem + */ + public List getProcessMem() { + ArrayList list = new ArrayList<>(); + String sql = "select\n" + " process_counter_track.id as trackId,\n" + + " process_counter_track.name as trackName,\n" + " upid,\n" + " process.pid,\n" + + " process.name as processName,\n" + " process.start_ts as startTs,\n" + + " process.end_ts as endTs\n" + " from process_counter_track\n" + + " join process using(upid) order by trackName"; + Connection conn = getConn(); + Statement st = null; + ResultSet rs = null; + try { + st = conn.createStatement(); + rs = st.executeQuery(sql); + while (rs.next()) { + ProcessMem bean = new ProcessMem(); + bean.setTrackId(rs.getInt("trackId")); + bean.setTrackName(rs.getString("trackName")); + bean.setUpid(rs.getInt("upid")); + bean.setPid(rs.getInt("pid")); + bean.setProcessName(rs.getString("processName")); + list.add(bean); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + if (st != null) { + st.close(); + } + if (rs != null) { + rs.close(); + } + free(conn); + } catch (SQLException exception) { + exception.printStackTrace(); + } + } + return list; + } + + /** + * Get memory data information occupied by a process + * + * @param trackId trackId + * @return List list + */ + public List getProcessMemData(final int trackId) { + ArrayList list = new ArrayList<>(); + String sql = "select c.*,c.ts-tb.start_ts startTime from counter c,trace_bounds tb where track_id=" + trackId; + Connection conn = getConn(); + Statement st = null; + ResultSet rs = null; + try { + st = conn.createStatement(); + rs = st.executeQuery(sql); + while (rs.next()) { + ProcessMemData bean = new ProcessMemData(); + bean.setTrackId(rs.getInt("track_id")); + bean.setValue(rs.getInt("value")); + bean.setStartTime(rs.getLong("startTime")); + bean.setType(rs.getString("type")); + list.add(bean); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + if (st != null) { + st.close(); + } + if (rs != null) { + rs.close(); + } + free(conn); + } catch (SQLException exception) { + exception.printStackTrace(); + } + } + return list; + } + + /** + * Get method call information according to tid + * + * @param tid tid + * @return ArrayList + */ + public ArrayList getFunDataByTid(final int tid) { + ArrayList list = new ArrayList<>(); + String sql = String.format(Locale.ENGLISH, getSql("GetFunDataByTid"), tid); + Connection conn = getConn(); + Statement st = null; + ResultSet rs = null; + try { + st = conn.createStatement(); + rs = st.executeQuery(sql); + while (rs.next()) { + FunctionBean bean = new FunctionBean(); + bean.setTid(rs.getInt("tid")); + bean.setIsMainThread(rs.getInt("is_main_thread")); + bean.setTrackId(rs.getInt("track_id")); + bean.setDepth(rs.getInt("depth")); + bean.setThreadName(rs.getString("threadName")); + bean.setFunName(rs.getString("funName")); + bean.setStartTime(rs.getLong("startTs")); + bean.setDuration(rs.getLong("dur")); + list.add(bean); + } + } catch (SQLException exception) { + exception.printStackTrace(); + } finally { + try { + if (st != null) { + st.close(); + } + if (rs != null) { + rs.close(); + } + free(conn); + } catch (SQLException exception) { + exception.printStackTrace(); + } + } + return list; + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/Final.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/Final.java new file mode 100644 index 000000000..81e7e3616 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/Final.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.util; + +import java.awt.Font; + +/** + * Font color information tool + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public final class Final { + /** + * Font name + */ + public static final String FONT_NAME = "宋体"; + + /** + * Default font style + */ + public static final int PLAIN_STYLE = Font.PLAIN; + + /** + * Minimum font size + */ + public static final int SMALL_FONT_SIZE = 10; + + /** + * Normal font size + */ + public static final int NORMAL_FONT_SIZE = 11; + + /** + * Runtime color constants + */ + public static final int RUNNING_COLOR = 0x467b3b; + + /** + * R_COLOR + */ + public static final int R_COLOR = 0xa0b84d; + + /** + * UNINTERRUPTIBLE_SLEEP_COLOR + */ + public static final int UNINTERRUPTIBLE_SLEEP_COLOR = 0xf19d38; + + /** + * S_COLOR + */ + public static final int S_COLOR = 0xFBFBFB; + + /** + * NORMAL_FONT + */ + public static final Font NORMAL_FONT = new Font(FONT_NAME, PLAIN_STYLE, NORMAL_FONT_SIZE); + + /** + * NORMAL_FONT + */ + public static final Font SMALL_FONT = new Font(FONT_NAME, PLAIN_STYLE, SMALL_FONT_SIZE); + + private Final() { } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/ImageUtils.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/ImageUtils.java new file mode 100644 index 000000000..b624d3d98 --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/ImageUtils.java @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.util; + +import javax.imageio.ImageIO; +import java.awt.Image; +import java.io.IOException; + +/** + * Image processing tools + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public final class ImageUtils { + private static ImageUtils instance; + + private Image starFill; + + private Image star; + + private Image checkYes; + + private Image checkNo; + + private Image arrowDown; + + private Image arrowDownFocus; + + private Image arrowUp; + + private Image arrowUpFocus; + + + private ImageUtils() { + try { + starFill = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + star = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star.png")); + checkNo = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/check_box_1.png")); + checkYes = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/check_box_2.png")); + arrowUp = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/arrow-up.png")); + arrowUpFocus = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/arrow-up-2.png")); + arrowDown = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/arrow-down.png")); + arrowDownFocus = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/arrow-down-2.png")); + } catch (IOException exception) { + exception.printStackTrace(); + } + } + + /** + * Gets the value of starFill . + * + * @return the value of java.awt.Image + */ + public Image getStarFill() { + return starFill; + } + + /** + * Sets the starFill . + *

You can use getStarFill() to get the value of starFill

+ * + * @param image image + */ + public void setStarFill(final Image image) { + this.starFill = image; + } + + /** + * Gets the value of star . + * + * @return the value of java.awt.Image + */ + public Image getStar() { + return star; + } + + /** + * Sets the star . + *

You can use getStar() to get the value of star

+ * + * @param image image + */ + public void setStar(final Image image) { + this.star = image; + } + + /** + * Gets the value of checkYes . + * + * @return the value of java.awt.Image + */ + public Image getCheckYes() { + return checkYes; + } + + /** + * Sets the checkYes . + *

You can use getCheckYes() to get the value of checkYes

+ * + * @param image image + */ + public void setCheckYes(final Image image) { + this.checkYes = image; + } + + /** + * Gets the value of checkNo . + * + * @return the value of java.awt.Image + */ + public Image getCheckNo() { + return checkNo; + } + + /** + * Sets the checkNo . + *

You can use getCheckNo() to get the value of checkNo

+ * + * @param image image + */ + public void setCheckNo(final Image image) { + this.checkNo = image; + } + + /** + * Gets the value of arrowDown . + * + * @return the value of java.awt.Image + */ + public Image getArrowDown() { + return arrowDown; + } + + /** + * Sets the arrowDown . + *

You can use getArrowDown() to get the value of arrowDown

+ * + * @param image image + */ + public void setArrowDown(final Image image) { + this.arrowDown = image; + } + + /** + * Gets the value of arrowDownFocus . + * + * @return the value of java.awt.Image + */ + public Image getArrowDownFocus() { + return arrowDownFocus; + } + + /** + * Sets the arrowDownFocus . + *

You can use getArrowDownFocus() to get the value of arrowDownFocus

+ * + * @param image image + */ + public void setArrowDownFocus(final Image image) { + this.arrowDownFocus = image; + } + + /** + * Gets the value of arrowUp . + * + * @return the value of java.awt.Image + */ + public Image getArrowUp() { + return arrowUp; + } + + /** + * Sets the arrowUp . + *

You can use getArrowUp() to get the value of arrowUp

+ * + * @param image image + */ + public void setArrowUp(final Image image) { + this.arrowUp = image; + } + + /** + * Gets the value of arrowUpFocus . + * + * @return the value of java.awt.Image + */ + public Image getArrowUpFocus() { + return arrowUpFocus; + } + + /** + * Sets the arrowUpFocus . + *

You can use getArrowUpFocus() to get the value of arrowUpFocus

+ * + * @param image image + */ + public void setArrowUpFocus(final Image image) { + arrowUpFocus = image; + } + + + /** + * Get the current ImageUtils instantiation object + * + * @return ImageUtils + */ + public static ImageUtils getInstance() { + if (instance == null) { + instance = new ImageUtils(); + } + return instance; + } +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/TimeUtils.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/TimeUtils.java new file mode 100644 index 000000000..062ee2f9e --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/TimeUtils.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.util; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +/** + * Time formatting tool + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public final class TimeUtils { + private TimeUtils() { + } + + private static DecimalFormat df = new DecimalFormat("#.0"); + + /** + * Convert to s according to ns + * + * @param ns ns + * @return String + */ + public static String getSecondFromNSecond(final long ns) { + final long second1 = 1_000_000_000L; // 1 second + final long millisecond1 = 1_000_000L; // 1 millisecond + final long microsecond1 = 1_000L; // 1 microsecond + final double nanosecond1 = 1000.0; + String res; + if (ns >= second1) { + res = df.format(TimeUnit.MILLISECONDS.convert(ns, TimeUnit.NANOSECONDS) / nanosecond1) + "s"; + } else if (ns >= millisecond1) { + res = df.format(TimeUnit.MICROSECONDS.convert(ns, TimeUnit.NANOSECONDS) / nanosecond1) + "ms"; + } else if (ns >= microsecond1) { + res = df.format(ns / nanosecond1) + "us"; + } else { + res = ns + "ns"; + } + return res; + } + + /** + * Get the current formatting time + * + * @param nsL nsL + * @return String + */ + public static String getTimeString(final long nsL) { + long ns = nsL; + long hours = TimeUnit.NANOSECONDS.toHours(ns); + ns = ns - TimeUnit.HOURS.toNanos(hours); + long minutes = TimeUnit.NANOSECONDS.toMinutes(ns); + ns = ns - TimeUnit.MINUTES.toNanos(minutes); + long second = TimeUnit.NANOSECONDS.toSeconds(ns); // second + ns = ns - TimeUnit.SECONDS.toNanos(second); + long millis = TimeUnit.NANOSECONDS.toMillis(ns); // millisecond + ns = ns - TimeUnit.MILLISECONDS.toNanos(millis); + long micros = TimeUnit.NANOSECONDS.toMicros(ns); // microsecond + ns = ns - TimeUnit.MICROSECONDS.toNanos(micros); + List list = new ArrayList<>(); + if (hours > 0) { + list.add(hours + "h"); + } + if (minutes > 0) { + list.add(minutes + "m"); + } + if (second > 0) { + list.add(second + "s"); + } + if (millis > 0) { + list.add(millis + "ms"); + } + if (micros > 0) { + list.add(micros + "us"); + } + long nanos = ns; + if (nanos > 0) { + list.add(nanos + "ns"); + } + return list.stream().collect(Collectors.joining(" ")); + } + +} diff --git a/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/Utils.java b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/Utils.java new file mode 100644 index 000000000..8b8485dcc --- /dev/null +++ b/host/ohosprofiler/src/main/java/ohos/devtools/views/trace/util/Utils.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.util; + +import org.apache.commons.collections.map.HashedMap; + +import java.awt.Rectangle; +import java.util.Map; + +/** + * Tools + * + * @version 1.0 + * @date 2021/04/22 12:25 + **/ +public final class Utils { + private static Map statusMap = new HashedMap(); + private static Utils instance; + + private Utils() { + statusMap.put("D", "Uninterruptible Sleep"); + statusMap.put("S", "Sleeping"); + statusMap.put("R", "Runnable"); + statusMap.put("Running", "Running"); + statusMap.put("R+", "Runnable (Preempted)"); + statusMap.put("DK", "Uninterruptible Sleep + Wake Kill"); + statusMap.put("I", "Task Dead"); + statusMap.put("T", "Stopped"); + statusMap.put("t", "Traced"); + statusMap.put("X", "Exit (Dead)"); + statusMap.put("Z", "Exit (Zombie)"); + statusMap.put("K", "Wake Kill"); + statusMap.put("W", "Waking"); + statusMap.put("P", "Parked"); + statusMap.put("N", "No Load"); + } + + /** + * Gets the value of statusMap . + * + * @return Get state collection + */ + public Map getStatusMap() { + return statusMap; + } + + /** + * Get singleton object + * + * @return Utils + */ + public static Utils getInstance() { + if (instance == null) { + instance = new Utils(); + } + return instance; + } + + /** + * Calculate whether it is within the range of Rectangle according to the x and y coordinates + * + * @param rect rect + * @param xAxis xAxis + * @param yAxis yAxis + * @return boolean + */ + public static boolean pointInRect(final Rectangle rect, final int xAxis, final int yAxis) { + if (rect == null) { + return false; + } + return xAxis >= rect.x && xAxis <= rect.x + rect.width && yAxis >= rect.y && yAxis < rect.y + rect.height; + } + + /** + * Get the last status description + * + * @param state state + * @return String + */ + public static String getEndState(final String state) { + if (Utils.getInstance().getStatusMap().containsKey(state)) { + return Utils.getInstance().getStatusMap().get(state); + } else { + return "Unknown State"; + } + } +} diff --git a/host/ohosprofiler/src/main/proto/agent_plugin_config.proto b/host/ohosprofiler/src/main/proto/agent_plugin_config.proto new file mode 100644 index 000000000..2e6782a9f --- /dev/null +++ b/host/ohosprofiler/src/main/proto/agent_plugin_config.proto @@ -0,0 +1,21 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; +option optimize_for = LITE_RUNTIME; + + +message AgentConfig { + int32 pid = 1; +} diff --git a/host/ohosprofiler/src/main/proto/agent_plugin_result.proto b/host/ohosprofiler/src/main/proto/agent_plugin_result.proto new file mode 100644 index 000000000..27639d6e5 --- /dev/null +++ b/host/ohosprofiler/src/main/proto/agent_plugin_result.proto @@ -0,0 +1,58 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; +option optimize_for = LITE_RUNTIME; + +message ClassInfo { + int32 class_id = 1; + string class_name = 2; +} + +message AllocationInfo { + int32 object_id = 1; + int32 class_id = 2; + int32 object_size = 3; + int32 array_length = 4; + int32 heap_id = 5; + string thread_name = 6; + + message StackFrameInfo { + int32 frame_id = 1; + string class_name = 2; + string method_name = 3; + string file_name = 4; + int32 line_number = 5; + } + // First element means stack top. + repeated StackFrameInfo frame_info = 7; +} + +message DeallocationInfo { + int32 object_id = 1; +} + +message AgentMemoryEvent { + int64 timestamp = 1; + + oneof event { + ClassInfo class_data = 2; + AllocationInfo alloc_data = 3; + DeallocationInfo free_data = 4; + } +} + +message BatchAgentMemoryEvent { + repeated AgentMemoryEvent events = 1; +} diff --git a/host/ohosprofiler/src/main/proto/bytrace_plugin_config.proto b/host/ohosprofiler/src/main/proto/bytrace_plugin_config.proto new file mode 100644 index 000000000..c2106c3c8 --- /dev/null +++ b/host/ohosprofiler/src/main/proto/bytrace_plugin_config.proto @@ -0,0 +1,24 @@ + +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; +option java_package = "ohos.devtools.datasources.transport.grpc.service"; + +message BytracePluginConfig { + uint32 buffe_size = 1; // size of the buffer (KB) for storing and reading traces. + repeated string categories = 2; // Lists available bytrace categories. + uint32 time = 3; // Sets the bytrace running duration in seconds (5s by default) + string clock = 4; // boot (default), global, mono, uptime, or perf. + string outfile_name = 5; // the name of the target file (stdout by default). +} diff --git a/host/ohosprofiler/src/main/proto/common_types.proto b/host/ohosprofiler/src/main/proto/common_types.proto new file mode 100644 index 000000000..eeab24f0c --- /dev/null +++ b/host/ohosprofiler/src/main/proto/common_types.proto @@ -0,0 +1,56 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; + +message ProfilerPluginConfig { + string name = 1; + string plugin_sha256 = 2; + uint32 sample_interval = 3; + bytes config_data = 4; +} + +message ProfilerPluginState { + string name = 1; + enum State { + INITED = 0; + REGISTERED = 1; // registered to plugin service. + LOADED = 2; // have created session. + IN_SESSION = 3; // have started session. + }; + State state = 2; +} + +// for FetchDataResponse +message ProfilerPluginData { + string name = 1; + uint32 status = 2; + bytes data = 3; + enum ClockId { + CLOCKID_REALTIME = 0; + CLOCKID_REALTIME_ALARM = 1; // since Linux 3.0; Linux-specific + CLOCKID_REALTIME_COARSE = 2; // since Linux 2.6.32; Linux-specific + CLOCKID_TAI = 3; // since Linux 3.10; Linux-specific + CLOCKID_MONOTONIC = 4; + CLOCKID_MONOTONIC_COARSE = 5; // since Linux 2.6.32; Linux-specific + CLOCKID_MONOTONIC_RAW = 6; // since Linux 2.6.28; Linux-specific + CLOCKID_BOOTTIME = 7; // since Linux 2.6.39; Linux-specific + CLOCKID_BOOTTIME_ALARM = 8; // since Linux 3.0; Linux-specific + CLOCKID_PROCESS_CPUTIME_ID = 9; // since Linux 2.6.12 + CLOCKID_THREAD_CPUTIME_ID = 10; // since Linux 2.6.12 + }; + ClockId clock_id = 4; + uint64 tv_sec = 5; + uint64 tv_nsec = 6; +} diff --git a/host/ohosprofiler/src/main/proto/memory_plugin_common.proto b/host/ohosprofiler/src/main/proto/memory_plugin_common.proto new file mode 100644 index 000000000..ecf3a1794 --- /dev/null +++ b/host/ohosprofiler/src/main/proto/memory_plugin_common.proto @@ -0,0 +1,185 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; +option optimize_for = LITE_RUNTIME; + +enum SysMeminfoType { + MEMINFO_UNSPECIFIED = 0; + MEMINFO_MEM_TOTAL = 1; + MEMINFO_MEM_FREE = 2; + MEMINFO_MEM_AVAILABLE = 3; + MEMINFO_BUFFERS = 4; + MEMINFO_CACHED = 5; + MEMINFO_SWAP_CACHED = 6; + MEMINFO_ACTIVE = 7; + MEMINFO_INACTIVE = 8; + MEMINFO_ACTIVE_ANON = 9; + MEMINFO_INACTIVE_ANON = 10; + MEMINFO_ACTIVE_FILE = 11; + MEMINFO_INACTIVE_FILE = 12; + MEMINFO_UNEVICTABLE = 13; + MEMINFO_MLOCKED = 14; + MEMINFO_SWAP_TOTAL = 15; + MEMINFO_SWAP_FREE = 16; + MEMINFO_DIRTY = 17; + MEMINFO_WRITEBACK = 18; + MEMINFO_ANON_PAGES = 19; + MEMINFO_MAPPED = 20; + MEMINFO_SHMEM = 21; + MEMINFO_SLAB = 22; + MEMINFO_SLAB_RECLAIMABLE = 23; + MEMINFO_SLAB_UNRECLAIMABLE = 24; + MEMINFO_KERNEL_STACK = 25; + MEMINFO_PAGE_TABLES = 26; + MEMINFO_COMMIT_LIMIT = 27; + MEMINFO_COMMITED_AS = 28; + MEMINFO_VMALLOC_TOTAL = 29; + MEMINFO_VMALLOC_USED = 30; + MEMINFO_VMALLOC_CHUNK = 31; + MEMINFO_CMA_TOTAL = 32; + MEMINFO_CMA_FREE = 33; +} + +enum SysVMeminfoType { + VMEMINFO_UNSPECIFIED = 0; + VMEMINFO_NR_FREE_PAGES = 1; + VMEMINFO_NR_ALLOC_BATCH = 2; + VMEMINFO_NR_INACTIVE_ANON = 3; + VMEMINFO_NR_ACTIVE_ANON = 4; + VMEMINFO_NR_INACTIVE_FILE = 5; + VMEMINFO_NR_ACTIVE_FILE = 6; + VMEMINFO_NR_UNEVICTABLE = 7; + VMEMINFO_NR_MLOCK = 8; + VMEMINFO_NR_ANON_PAGES = 9; + VMEMINFO_NR_MAPPED = 10; + VMEMINFO_NR_FILE_PAGES = 11; + VMEMINFO_NR_DIRTY = 12; + VMEMINFO_NR_WRITEBACK = 13; + VMEMINFO_NR_SLAB_RECLAIMABLE = 14; + VMEMINFO_NR_SLAB_UNRECLAIMABLE = 15; + VMEMINFO_NR_PAGE_TABLE_PAGES = 16; + VMEMINFO_NR_KERNEL_STACK = 17; + VMEMINFO_NR_OVERHEAD = 18; + VMEMINFO_NR_UNSTABLE = 19; + VMEMINFO_NR_BOUNCE = 20; + VMEMINFO_NR_VMSCAN_WRITE = 21; + VMEMINFO_NR_VMSCAN_IMMEDIATE_RECLAIM = 22; + VMEMINFO_NR_WRITEBACK_TEMP = 23; + VMEMINFO_NR_ISOLATED_ANON = 24; + VMEMINFO_NR_ISOLATED_FILE = 25; + VMEMINFO_NR_SHMEM = 26; + VMEMINFO_NR_DIRTIED = 27; + VMEMINFO_NR_WRITTEN = 28; + VMEMINFO_NR_PAGES_SCANNED = 29; + VMEMINFO_WORKINGSET_REFAULT = 30; + VMEMINFO_WORKINGSET_ACTIVATE = 31; + VMEMINFO_WORKINGSET_NODERECLAIM = 32; + VMEMINFO_NR_ANON_TRANSPARENT_HUGEPAGES = 33; + VMEMINFO_NR_FREE_CMA = 34; + VMEMINFO_NR_SWAPCACHE = 35; + VMEMINFO_NR_DIRTY_THRESHOLD = 36; + VMEMINFO_NR_DIRTY_BACKGROUND_THRESHOLD = 37; + VMEMINFO_PGPGIN = 38; + VMEMINFO_PGPGOUT = 39; + VMEMINFO_PGPGOUTCLEAN = 40; + VMEMINFO_PSWPIN = 41; + VMEMINFO_PSWPOUT = 42; + VMEMINFO_PGALLOC_DMA = 43; + VMEMINFO_PGALLOC_NORMAL = 44; + VMEMINFO_PGALLOC_MOVABLE = 45; + VMEMINFO_PGFREE = 46; + VMEMINFO_PGACTIVATE = 47; + VMEMINFO_PGDEACTIVATE = 48; + VMEMINFO_PGFAULT = 49; + VMEMINFO_PGMAJFAULT = 50; + VMEMINFO_PGREFILL_DMA = 51; + VMEMINFO_PGREFILL_NORMAL = 52; + VMEMINFO_PGREFILL_MOVABLE = 53; + VMEMINFO_PGSTEAL_KSWAPD_DMA = 54; + VMEMINFO_PGSTEAL_KSWAPD_NORMAL = 55; + VMEMINFO_PGSTEAL_KSWAPD_MOVABLE = 56; + VMEMINFO_PGSTEAL_DIRECT_DMA = 57; + VMEMINFO_PGSTEAL_DIRECT_NORMAL = 58; + VMEMINFO_PGSTEAL_DIRECT_MOVABLE = 59; + VMEMINFO_PGSCAN_KSWAPD_DMA = 60; + VMEMINFO_PGSCAN_KSWAPD_NORMAL = 61; + VMEMINFO_PGSCAN_KSWAPD_MOVABLE = 62; + VMEMINFO_PGSCAN_DIRECT_DMA = 63; + VMEMINFO_PGSCAN_DIRECT_NORMAL = 64; + VMEMINFO_PGSCAN_DIRECT_MOVABLE = 65; + VMEMINFO_PGSCAN_DIRECT_THROTTLE = 66; + VMEMINFO_PGINODESTEAL = 67; + VMEMINFO_SLABS_SCANNED = 68; + VMEMINFO_KSWAPD_INODESTEAL = 69; + VMEMINFO_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70; + VMEMINFO_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71; + VMEMINFO_PAGEOUTRUN = 72; + VMEMINFO_ALLOCSTALL = 73; + VMEMINFO_PGROTATED = 74; + VMEMINFO_DROP_PAGECACHE = 75; + VMEMINFO_DROP_SLAB = 76; + VMEMINFO_PGMIGRATE_SUCCESS = 77; + VMEMINFO_PGMIGRATE_FAIL = 78; + VMEMINFO_COMPACT_MIGRATE_SCANNED = 79; + VMEMINFO_COMPACT_FREE_SCANNED = 80; + VMEMINFO_COMPACT_ISOLATED = 81; + VMEMINFO_COMPACT_STALL = 82; + VMEMINFO_COMPACT_FAIL = 83; + VMEMINFO_COMPACT_SUCCESS = 84; + VMEMINFO_COMPACT_DAEMON_WAKE = 85; + VMEMINFO_UNEVICTABLE_PGS_CULLED = 86; + VMEMINFO_UNEVICTABLE_PGS_SCANNED = 87; + VMEMINFO_UNEVICTABLE_PGS_RESCUED = 88; + VMEMINFO_UNEVICTABLE_PGS_MLOCKED = 89; + VMEMINFO_UNEVICTABLE_PGS_MUNLOCKED = 90; + VMEMINFO_UNEVICTABLE_PGS_CLEARED = 91; + VMEMINFO_UNEVICTABLE_PGS_STRANDED = 92; + VMEMINFO_NR_ZSPAGES = 93; + VMEMINFO_NR_ION_HEAP = 94; + VMEMINFO_NR_GPU_HEAP = 95; + VMEMINFO_ALLOCSTALL_DMA = 96; + VMEMINFO_ALLOCSTALL_MOVABLE = 97; + VMEMINFO_ALLOCSTALL_NORMAL = 98; + VMEMINFO_COMPACT_DAEMON_FREE_SCANNED = 99; + VMEMINFO_COMPACT_DAEMON_MIGRATE_SCANNED = 100; + VMEMINFO_NR_FASTRPC = 101; + VMEMINFO_NR_INDIRECTLY_RECLAIMABLE = 102; + VMEMINFO_NR_ION_HEAP_POOL = 103; + VMEMINFO_NR_KERNEL_MISC_RECLAIMABLE = 104; + VMEMINFO_NR_SHADOW_CALL_STACK_BYTES = 105; + VMEMINFO_NR_SHMEM_HUGEPAGES = 106; + VMEMINFO_NR_SHMEM_PMDMAPPED = 107; + VMEMINFO_NR_UNRECLAIMABLE_PAGES = 108; + VMEMINFO_NR_ZONE_ACTIVE_ANON = 109; + VMEMINFO_NR_ZONE_ACTIVE_FILE = 110; + VMEMINFO_NR_ZONE_INACTIVE_ANON = 111; + VMEMINFO_NR_ZONE_INACTIVE_FILE = 112; + VMEMINFO_NR_ZONE_UNEVICTABLE = 113; + VMEMINFO_NR_ZONE_WRITE_PENDING = 114; + VMEMINFO_OOM_KILL = 115; + VMEMINFO_PGLAZYFREE = 116; + VMEMINFO_PGLAZYFREED = 117; + VMEMINFO_PGREFILL = 118; + VMEMINFO_PGSCAN_DIRECT = 119; + VMEMINFO_PGSCAN_KSWAPD = 120; + VMEMINFO_PGSKIP_DMA = 121; + VMEMINFO_PGSKIP_MOVABLE = 122; + VMEMINFO_PGSKIP_NORMAL = 123; + VMEMINFO_PGSTEAL_DIRECT = 124; + VMEMINFO_PGSTEAL_KSWAPD = 125; + VMEMINFO_SWAP_RA = 126; + VMEMINFO_SWAP_RA_HIT = 127; + VMEMINFO_WORKINGSET_RESTORE = 128; +} diff --git a/host/ohosprofiler/src/main/proto/memory_plugin_config.proto b/host/ohosprofiler/src/main/proto/memory_plugin_config.proto new file mode 100644 index 000000000..28689280f --- /dev/null +++ b/host/ohosprofiler/src/main/proto/memory_plugin_config.proto @@ -0,0 +1,31 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; +option optimize_for = LITE_RUNTIME; + +import "memory_plugin_common.proto"; + +message MemoryConfig { + // set true to report process list + bool report_process_tree = 1; + bool report_sysmem_mem_info = 2; + repeated SysMeminfoType sys_meminfo_counters = 3; + bool report_sysmem_vmem_info = 4; + repeated SysVMeminfoType sys_vmeminfo_counters = 5; + bool report_process_mem_info = 6; + bool report_app_mem_info = 7; + bool report_app_mem_by_dumpsys = 8; + repeated int32 pid = 9; +} diff --git a/host/ohosprofiler/src/main/proto/memory_plugin_result.proto b/host/ohosprofiler/src/main/proto/memory_plugin_result.proto new file mode 100644 index 000000000..3597c81aa --- /dev/null +++ b/host/ohosprofiler/src/main/proto/memory_plugin_result.proto @@ -0,0 +1,69 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; +option optimize_for = LITE_RUNTIME; + +import "memory_plugin_common.proto"; + +message SysMeminfo { + SysMeminfoType key = 1; + uint64 value = 2; +}; +message SysVMeminfo { + SysVMeminfoType key = 1; + uint64 value = 2; +}; + +message SmapsInfo { + string mapinfo = 1; + int32 size = 2; + int32 rss = 3; + int32 pss = 4; + int32 anonymous = 5; +}; + +message AppSummary { + uint64 java_heap = 1; + uint64 native_heap = 2; + uint64 code = 3; + uint64 stack = 4; + uint64 graphics = 5; + uint64 private_other = 6; + uint64 system = 7; +}; + +message ProcessMemoryInfo { + int32 pid = 1; + string name = 2; + // data from /proc/$pid/stat + uint64 vm_size_kb = 3; + uint64 vm_rss_kb = 4; + uint64 rss_anon_kb = 5; + uint64 rss_file_kb = 6; + uint64 rss_shmem_kb = 7; + uint64 vm_swap_kb = 8; + uint64 vm_locked_kb = 9; + uint64 vm_hwm_kb = 10; + int64 oom_score_adj = 11; + // data from /proc/$pid/smaps + repeated SmapsInfo smapinfo = 12; + AppSummary memsummary = 13; +} + +message MemoryData { + repeated ProcessMemoryInfo processesinfo = 1; + repeated SysMeminfo meminfo = 2; + repeated SysVMeminfo vmeminfo = 3; +} diff --git a/host/ohosprofiler/src/main/proto/profiler_service.proto b/host/ohosprofiler/src/main/proto/profiler_service.proto new file mode 100644 index 000000000..f91bef805 --- /dev/null +++ b/host/ohosprofiler/src/main/proto/profiler_service.proto @@ -0,0 +1,40 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; + +import "profiler_service_types.proto"; + +service IProfilerService { + // get all plugin infos and capabilities. + rpc GetCapabilities(GetCapabilitiesRequest) returns (GetCapabilitiesResponse); + + // create tracing sesion and pass tracing config to plugins. + rpc CreateSession(CreateSessionRequest) returns (CreateSessionResponse); + + // start tracing session, active server side tracing triggers. + rpc StartSession(StartSessionRequest) returns (StartSessionResponse); + + // get server-side cached tracing data since current session started. + rpc FetchData(FetchDataRequest) returns (stream FetchDataResponse); + + // stop tracing session, deactivate server side tracing triggers. + rpc StopSession(StopSessionRequest) returns (StopSessionResponse); + + // destroy tracing session. + rpc DestroySession(DestroySessionRequest) returns (DestroySessionResponse); + + // get device time 下一轮迭代再添加相关定义 + // rpc GetTime(GetTimeRequest) returns (GetTimeResponse); +} diff --git a/host/ohosprofiler/src/main/proto/profiler_service_types.proto b/host/ohosprofiler/src/main/proto/profiler_service_types.proto new file mode 100644 index 000000000..ec0b34ac0 --- /dev/null +++ b/host/ohosprofiler/src/main/proto/profiler_service_types.proto @@ -0,0 +1,117 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; + +import "common_types.proto"; + +// for GetCapabilities +message GetCapabilitiesRequest { + uint32 request_id = 1; +} + +message ProfilerPluginCapability { + string path = 1; + string name = 2; +} + +message GetCapabilitiesResponse { + uint32 status = 1; + repeated ProfilerPluginCapability capabilities = 2; +} + + +// for CreateSessionRequest +message ProfilerSessionConfig { + message BufferConfig { + enum Policy { + RECYCLE = 0; + FLATTEN = 1; + }; + uint32 pages = 1; + Policy policy = 2; + } + repeated BufferConfig buffers = 1; + + enum Mode { + OFFLINE = 0; // save all plugin results to result file. + ONLINE = 1; // push all plugin results to host PC with streamed FetchDataResponse. + }; + Mode session_mode = 2; + string result_file = 3; // for OFFLINE mode, result file path + uint32 result_max_size = 4; // for OFFLINE mode, result file max size in KB + uint32 sample_duration = 5; // for OFFLINE mode, smaple duration in ms +} + +message CreateSessionRequest { + uint32 request_id = 1; + ProfilerSessionConfig session_config = 2; + repeated ProfilerPluginConfig plugin_configs = 3; +} + +message CreateSessionResponse { + uint32 status = 1; + uint32 session_id = 2; + repeated ProfilerPluginState plugin_status = 3; +} + +// for StartSession +message StartSessionRequest { + uint32 request_id = 1; + uint32 session_id = 2; + repeated ProfilerPluginConfig update_configs = 3; +} + +message StartSessionResponse { + uint32 status = 1; + repeated ProfilerPluginState plugin_status = 3; +} + +// for FetchData +message FetchDataRequest { + uint32 request_id = 1; + uint32 session_id = 2; + bytes addtion_data = 3; +} + +message FetchDataResponse { + uint32 status = 1; + uint32 response_id = 2; + bool has_more = 3; + repeated ProfilerPluginData plugin_data = 4; +} + +// for StopSession +message StopSessionRequest { + uint32 request_id = 1; + uint32 session_id = 2; +} + +message StopSessionResponse { + uint32 status = 1; + repeated ProfilerPluginState plugin_status = 3; +} + +// for DestroySession +message DestroySessionRequest { + uint32 request_id = 1; + uint32 session_id = 2; +} + +message DestroySessionResponse { + uint32 status = 1; + repeated ProfilerPluginState plugin_status = 3; +} + + diff --git a/host/ohosprofiler/src/main/proto/ptrace_plugin_config.proto b/host/ohosprofiler/src/main/proto/ptrace_plugin_config.proto new file mode 100644 index 000000000..bfa11a302 --- /dev/null +++ b/host/ohosprofiler/src/main/proto/ptrace_plugin_config.proto @@ -0,0 +1,20 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; +option java_package = "ohos.devtools.datasources.transport.grpc.service"; + +message PtracePluginConfig { + string config_text = 1; + string result_path = 2; +} diff --git a/host/ohosprofiler/src/main/proto/trace_plugin_config.proto b/host/ohosprofiler/src/main/proto/trace_plugin_config.proto new file mode 100644 index 000000000..74dfabfa5 --- /dev/null +++ b/host/ohosprofiler/src/main/proto/trace_plugin_config.proto @@ -0,0 +1,33 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; +option java_package = "ohos.devtools.datasources.transport.grpc.service"; + +message TracePluginConfig { + repeated string ftrace_events = 1; + repeated string bytrace_categories = 2; + repeated string bytrace_apps = 3; + uint32 buffer_size_kb = 4; /*cpu buffer_size*/ + uint32 trace_period_ms = 5; + bool symbolize_ksyms = 6; /*Enables symbol /proc/kallsyms.*/ + string clock = 7; + ExtractSchedConfig extract_sched = 8; + repeated string debug_outfile_name = 9; /*1: file 2:binary file*/ + bool debug_enable = 10; + string debug_fifo_path = 11; +} + +message ExtractSchedConfig { + bool enabled = 1; +} diff --git a/host/ohosprofiler/src/main/resources/META-INF/plugin.xml b/host/ohosprofiler/src/main/resources/META-INF/plugin.xml new file mode 100644 index 000000000..8bebb1a28 --- /dev/null +++ b/host/ohosprofiler/src/main/resources/META-INF/plugin.xml @@ -0,0 +1,39 @@ + + + ohos.devtools.ohosprofilerplugin + Ohosprofiler + YourCompany + + + most HTML tags may be used + ]]> + + + com.intellij.modules.platform + + + + + + + + + + \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/assets/arrow-down-2.png b/host/ohosprofiler/src/main/resources/assets/arrow-down-2.png new file mode 100644 index 000000000..856fc0aa5 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/assets/arrow-down-2.png differ diff --git a/host/ohosprofiler/src/main/resources/assets/arrow-down.png b/host/ohosprofiler/src/main/resources/assets/arrow-down.png new file mode 100644 index 000000000..b2e9b3944 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/assets/arrow-down.png differ diff --git a/host/ohosprofiler/src/main/resources/assets/arrow-up-2.png b/host/ohosprofiler/src/main/resources/assets/arrow-up-2.png new file mode 100644 index 000000000..dbc705bdd Binary files /dev/null and b/host/ohosprofiler/src/main/resources/assets/arrow-up-2.png differ diff --git a/host/ohosprofiler/src/main/resources/assets/arrow-up.png b/host/ohosprofiler/src/main/resources/assets/arrow-up.png new file mode 100644 index 000000000..c9d7c808c Binary files /dev/null and b/host/ohosprofiler/src/main/resources/assets/arrow-up.png differ diff --git a/host/ohosprofiler/src/main/resources/assets/bottom.png b/host/ohosprofiler/src/main/resources/assets/bottom.png new file mode 100644 index 000000000..b2e9b3944 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/assets/bottom.png differ diff --git a/host/ohosprofiler/src/main/resources/assets/check_box_1.png b/host/ohosprofiler/src/main/resources/assets/check_box_1.png new file mode 100644 index 000000000..49e98856d Binary files /dev/null and b/host/ohosprofiler/src/main/resources/assets/check_box_1.png differ diff --git a/host/ohosprofiler/src/main/resources/assets/check_box_2.png b/host/ohosprofiler/src/main/resources/assets/check_box_2.png new file mode 100644 index 000000000..8000ed31f Binary files /dev/null and b/host/ohosprofiler/src/main/resources/assets/check_box_2.png differ diff --git a/host/ohosprofiler/src/main/resources/assets/down.png b/host/ohosprofiler/src/main/resources/assets/down.png new file mode 100644 index 000000000..daa5fdeb4 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/assets/down.png differ diff --git a/host/ohosprofiler/src/main/resources/assets/link.png b/host/ohosprofiler/src/main/resources/assets/link.png new file mode 100644 index 000000000..a512a3eea Binary files /dev/null and b/host/ohosprofiler/src/main/resources/assets/link.png differ diff --git a/host/ohosprofiler/src/main/resources/assets/top.png b/host/ohosprofiler/src/main/resources/assets/top.png new file mode 100644 index 000000000..bf2b3cc56 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/assets/top.png differ diff --git a/host/ohosprofiler/src/main/resources/assets/top_star.png b/host/ohosprofiler/src/main/resources/assets/top_star.png new file mode 100644 index 000000000..4d4f1e0ba Binary files /dev/null and b/host/ohosprofiler/src/main/resources/assets/top_star.png differ diff --git a/host/ohosprofiler/src/main/resources/assets/top_star_fill.png b/host/ohosprofiler/src/main/resources/assets/top_star_fill.png new file mode 100644 index 000000000..b688ea1e6 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/assets/top_star_fill.png differ diff --git a/host/ohosprofiler/src/main/resources/assets/up.png b/host/ohosprofiler/src/main/resources/assets/up.png new file mode 100644 index 000000000..fe5b4c315 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/assets/up.png differ diff --git a/host/ohosprofiler/src/main/resources/db.properties b/host/ohosprofiler/src/main/resources/db.properties new file mode 100644 index 000000000..a8371e4fc --- /dev/null +++ b/host/ohosprofiler/src/main/resources/db.properties @@ -0,0 +1,14 @@ +driver=org.sqlite.JDBC +initialSize=30 +minIdle=10 +maxActive=100 +filters=stat +maxWait=60000 +timeBetweenEvictionRunsMillis=60000 +minEvictableIdleTimeMillis=300000 +validationQuery=SELECT 1 +testWhileIdle=true +testOnBorrow=false +testOnReturn=false + +defaultSql=init.sql \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/images/application_tuning.png b/host/ohosprofiler/src/main/resources/images/application_tuning.png new file mode 100644 index 000000000..d3d80156d Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/application_tuning.png differ diff --git a/host/ohosprofiler/src/main/resources/images/attchLive.png b/host/ohosprofiler/src/main/resources/images/attchLive.png new file mode 100644 index 000000000..cf46e2798 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/attchLive.png differ diff --git a/host/ohosprofiler/src/main/resources/images/backtrack.png b/host/ohosprofiler/src/main/resources/images/backtrack.png new file mode 100644 index 000000000..ef6572be0 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/backtrack.png differ diff --git a/host/ohosprofiler/src/main/resources/images/button_add.png b/host/ohosprofiler/src/main/resources/images/button_add.png new file mode 100644 index 000000000..dbf0af0c9 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/button_add.png differ diff --git a/host/ohosprofiler/src/main/resources/images/button_bottom_bar.png b/host/ohosprofiler/src/main/resources/images/button_bottom_bar.png new file mode 100644 index 000000000..f4b4bb435 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/button_bottom_bar.png differ diff --git a/host/ohosprofiler/src/main/resources/images/button_bottom_bar_grey.png b/host/ohosprofiler/src/main/resources/images/button_bottom_bar_grey.png new file mode 100644 index 000000000..950ab62fe Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/button_bottom_bar_grey.png differ diff --git a/host/ohosprofiler/src/main/resources/images/button_delete.png b/host/ohosprofiler/src/main/resources/images/button_delete.png new file mode 100644 index 000000000..f83499dca Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/button_delete.png differ diff --git a/host/ohosprofiler/src/main/resources/images/button_help.png b/host/ohosprofiler/src/main/resources/images/button_help.png new file mode 100644 index 000000000..019926110 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/button_help.png differ diff --git a/host/ohosprofiler/src/main/resources/images/button_left_bar.png b/host/ohosprofiler/src/main/resources/images/button_left_bar.png new file mode 100644 index 000000000..940314c6c Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/button_left_bar.png differ diff --git a/host/ohosprofiler/src/main/resources/images/button_record.png b/host/ohosprofiler/src/main/resources/images/button_record.png new file mode 100644 index 000000000..2d6e22ea6 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/button_record.png differ diff --git a/host/ohosprofiler/src/main/resources/images/button_save.png b/host/ohosprofiler/src/main/resources/images/button_save.png new file mode 100644 index 000000000..f49475fb0 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/button_save.png differ diff --git a/host/ohosprofiler/src/main/resources/images/button_stop.png b/host/ohosprofiler/src/main/resources/images/button_stop.png new file mode 100644 index 000000000..9be654da0 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/button_stop.png differ diff --git a/host/ohosprofiler/src/main/resources/images/close.png b/host/ohosprofiler/src/main/resources/images/close.png new file mode 100644 index 000000000..69c6c6415 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/close.png differ diff --git a/host/ohosprofiler/src/main/resources/images/copy.png b/host/ohosprofiler/src/main/resources/images/copy.png new file mode 100644 index 000000000..33790a449 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/copy.png differ diff --git a/host/ohosprofiler/src/main/resources/images/distributed_scenario.png b/host/ohosprofiler/src/main/resources/images/distributed_scenario.png new file mode 100644 index 000000000..411d4ed03 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/distributed_scenario.png differ diff --git a/host/ohosprofiler/src/main/resources/images/down.png b/host/ohosprofiler/src/main/resources/images/down.png new file mode 100644 index 000000000..4dfdbdc0e Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/down.png differ diff --git a/host/ohosprofiler/src/main/resources/images/icon_usb.png b/host/ohosprofiler/src/main/resources/images/icon_usb.png new file mode 100644 index 000000000..1ee13268c Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/icon_usb.png differ diff --git a/host/ohosprofiler/src/main/resources/images/icon_wifi.png b/host/ohosprofiler/src/main/resources/images/icon_wifi.png new file mode 100644 index 000000000..4dd7202b7 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/icon_wifi.png differ diff --git a/host/ohosprofiler/src/main/resources/images/left_grey.png b/host/ohosprofiler/src/main/resources/images/left_grey.png new file mode 100644 index 000000000..8d132173e Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/left_grey.png differ diff --git a/host/ohosprofiler/src/main/resources/images/loading.gif b/host/ohosprofiler/src/main/resources/images/loading.gif new file mode 100644 index 000000000..ab88c5384 --- /dev/null +++ b/host/ohosprofiler/src/main/resources/images/loading.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9beeb94b4a3efc836ed59526cedaadcf78f688bd1ef2a20fa5764310717f95ac +size 46803 diff --git a/host/ohosprofiler/src/main/resources/images/logo.png b/host/ohosprofiler/src/main/resources/images/logo.png new file mode 100644 index 000000000..7f76c492b Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/logo.png differ diff --git a/host/ohosprofiler/src/main/resources/images/over.png b/host/ohosprofiler/src/main/resources/images/over.png new file mode 100644 index 000000000..024135416 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/over.png differ diff --git a/host/ohosprofiler/src/main/resources/images/pic.png b/host/ohosprofiler/src/main/resources/images/pic.png new file mode 100644 index 000000000..d598734d9 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/pic.png differ diff --git a/host/ohosprofiler/src/main/resources/images/right.png b/host/ohosprofiler/src/main/resources/images/right.png new file mode 100644 index 000000000..4f924f6ad Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/right.png differ diff --git a/host/ohosprofiler/src/main/resources/images/right_grey.png b/host/ohosprofiler/src/main/resources/images/right_grey.png new file mode 100644 index 000000000..d4b700fc6 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/right_grey.png differ diff --git a/host/ohosprofiler/src/main/resources/images/search.png b/host/ohosprofiler/src/main/resources/images/search.png new file mode 100644 index 000000000..6888a8820 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/search.png differ diff --git a/host/ohosprofiler/src/main/resources/images/selected.png b/host/ohosprofiler/src/main/resources/images/selected.png new file mode 100644 index 000000000..68516d124 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/selected.png differ diff --git a/host/ohosprofiler/src/main/resources/images/suspended.png b/host/ohosprofiler/src/main/resources/images/suspended.png new file mode 100644 index 000000000..f17add8df Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/suspended.png differ diff --git a/host/ohosprofiler/src/main/resources/images/system_tuning.png b/host/ohosprofiler/src/main/resources/images/system_tuning.png new file mode 100644 index 000000000..a02350aa6 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/images/system_tuning.png differ diff --git a/host/ohosprofiler/src/main/resources/log4j2.xml b/host/ohosprofiler/src/main/resources/log4j2.xml new file mode 100644 index 000000000..ce52d730a --- /dev/null +++ b/host/ohosprofiler/src/main/resources/log4j2.xml @@ -0,0 +1,285 @@ + + + + + + + + + + + hosprofilerLogs + + + + logs/${logFileName} + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] %l - %m%n + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] %C.%M[%L line] - %m%n + + + 200MB + + INFO + + + + ${basePath}/ohosprofiler.log + + ${basePath}/%d{yyyy-MM}/all-%d{yyyy-MM-dd-HH}-%i.log.gz + + 10 + + 12 + + true + + + + ${basePath}/ohosprofiler-debug.log + + ${basePath}/%d{yyyy-MM}/info-%d{yyyy-MM-dd}-%i.log.gz + + 10 + + 1 + + true + + + + ${basePath}/ohosprofiler-info.log + + ${basePath}/%d{yyyy-MM}/info-%d{yyyy-MM-dd}-%i.log.gz + + 10 + + 1 + + true + + + + ${basePath}/ohosprofiler-warn.log + + ${basePath}/%d{yyyy-MM}/warn-%d{yyyy-MM-dd}-%i.log.gz + + 10 + + 1 + + true + + + + ${basePath}/ohosprofiler-error.log + + ${basePath}/%d{yyyy-MM}/error-%d{yyyy-MM-dd}-%i.log.gz + + 10 + + 1 + + true + + + + + ${basePath}/ohosprofiler-data.log + + ${basePath}/%d{yyyy-MM}/info-%d{yyyy-MM-dd}-%i.log.gz + + 10 + + 1 + + true + + + + + ${basePath}/ohosprofiler-agent.log + + ${basePath}/%d{yyyy-MM}/info-%d{yyyy-MM-dd}-%i.log.gz + + 10 + + 1 + + true + + + + INFO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/ohos/devtools.tar b/host/ohosprofiler/src/main/resources/ohos/devtools.tar new file mode 100644 index 000000000..57f8de94b Binary files /dev/null and b/host/ohosprofiler/src/main/resources/ohos/devtools.tar differ diff --git a/host/ohosprofiler/src/main/resources/ohos/init.sql b/host/ohosprofiler/src/main/resources/ohos/init.sql new file mode 100644 index 000000000..cfff13152 --- /dev/null +++ b/host/ohosprofiler/src/main/resources/ohos/init.sql @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +##设备详情信息表 +CREATE TABLE DeviceInfo +( + ID integer primary key autoincrement NOT NULL, + deviceID varchar(50) NOT NULL, + deviceName varchar(100) NOT NULL, + ramInfo varchar(100), + romInfo varchar(100) +); +##进程列表 +CREATE TABLE ProcessInfo +( + processId integer primary key not null, + deviceId varchar(50) not null, + processName varchar(100), + state integer(50), + startTime integer(50), + arch varchar(100), + agentStatus varchar(100) +); + +##设备实时动态表 +CREATE TABLE DeviceIPPortInfo +( + ID integer primary key autoincrement not null, + deviceID varchar(100) not null, + deviceName varchar(100) NOT NULL, + ip varchar(100) not null, + deviceType varchar(100) not null, + port int not null, + forwardPort int not null +); + +##监控项配置表 +CREATE TABLE MonitorInfo +( + localSessionId INT PRIMARY KEY NOT NULL, + monitorType varchar(64) NOT NULL, + parameter varchar(64) NOT NULL, + value varchar(256) DEFAULT '' +); +##自研插件表 +CREATE TABLE HiProfilerPlugin +( + deviceId INT PRIMARY KEY NOT NULL, + plugId INT NOT NULL, + name varchar(64) NOT NULL, + statue INT NOT NULL, + version INT NOT NULL, + plugSha256 varchar(256) NOT NULL, + sampleInterval INT NOT NULL, + configData varbinary(500) +); diff --git a/host/ohosprofiler/src/main/resources/ohos/ohosprofiler b/host/ohosprofiler/src/main/resources/ohos/ohosprofiler new file mode 100644 index 000000000..83502ab00 --- /dev/null +++ b/host/ohosprofiler/src/main/resources/ohos/ohosprofiler @@ -0,0 +1,194 @@ +#!/bin/bash + +# +# Copyright (c) 2021 Huawei Device Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +WORK_DIR=/data/local/tmp +function error(){ + echo -e "\033[1;31m$1\033[0m" + exit 1 +} +process_name=$2 + +function start_daemon() { + echo "start Profiler Daemon Process" + cd $WORK_DIR/developtools + start_hiprofilerd + sleep 1 + start_plugins + echo "StartDaemonSuccess" + exit 0 +} + +function restart_daemon(){ + local pid=$(pgrep -l .|grep hiprofilerd |grep -v grep |sed 's/^¥s*//'|sed 's/[[:space:]].*//') + local plugPid=$(pgrep -l .|grep hiprofiler_plug |grep -v grep |sed 's/^¥s*//'|sed 's/[[:space:]].*//') + if [ !$pid ]; then + kill -9 $pid + fi + if [ !$plugPid ]; then + kill -9 $plugPid + fi + start_hiprofilerd + sleep 1 + start_plugins + echo "StartDaemonSuccess" + exit 0 +} + +function start_hiprofilerd() { + cd $WORK_DIR/developtools + if [ `ps -ef | grep hiprofilerd | grep -v grep | wc -l` == 0 ]; then + chmod +x $WORK_DIR/developtools/hiprofilerd + LD_LIBRARY_PATH=./ ./hiprofilerd & + fi +} + +function start_plugins() { + cd $WORK_DIR/developtools + if [ `ps -ef | grep hiprofiler_plugins | grep -v grep | wc -l` == 0 ]; then + chmod +x $WORK_DIR/developtools/hiprofiler_plugins + LD_LIBRARY_PATH=./ ./hiprofiler_plugins & + fi + +} + +function start_v7daemon(){ + echo "start Profiler Daemon V7 Process" + cd $WORK_DIR/developtools + if [ `ps -ef | grep hiprofilerd | grep -v grep | wc -l` == 0 ]; then + chmod +x $WORK_DIR/developtools/hiprofilerd + LD_LIBRARY_PATH=./ ./hiprofilerd & + fi + sleep 2 + if [ `ps -ef | grep hiprofiler_plugins | grep -v grep | wc -l` == 0 ]; then + chmod +x $WORK_DIR/developtools/hiprofiler_plugins + LD_LIBRARY_PATH=./ ./hiprofiler_plugins & + fi + echo "StartDaemonSuccess" + exit 0 +} + +function start_java_heap(){ + echo "start collect heap ${process_name}" + run-as ${process_name} sh -c 'cp /data/local/tmp/developtools/libagentplugin.z.so ./' + #run-as ${process_name} sh -c "cp /data/local/tmp/libagentplugin.z.so ./" + sh -c "cmd activity attach-agent ${process_name} /data/data/${process_name}/libagentplugin.z.so" + if [ "$?" == "0" ]; then + echo "start javaHeapSuccess" + else + echo "failed" + fi + exit 0 +} + + +function uzip_file(){ + echo "uzip devtools file" + cd $WORK_DIR + if [ `ls $WORK_DIR | grep devtool | grep -v grep | wc -l` -eq 1 ]; then + tar -xf $WORK_DIR/devtool + chmod +x * + cp $WORK_DIR/developtools/libmemdataplugin.z.so $WORK_DIR + if [ `ls ${WORK_DIR}/developtools/ | grep libbytraceplugin.z.so | grep -v grep | wc -l` -eq 1 ]; then + cp $WORK_DIR/developtools/libbytraceplugin.z.so $WORK_DIR + fi + if [ `ls ${WORK_DIR}/developtools/ | grep libptrace_plugin.z.so | grep -v grep | wc -l` -eq 1 ]; then + cp $WORK_DIR/developtools/libptrace_plugin.z.so $WORK_DIR + fi + if [ `ls ${WORK_DIR}/developtools/ | grep libtraceplugin.z.so | grep -v grep | wc -l` -eq 1 ]; then + cp $WORK_DIR/developtools/libtraceplugin.z.so $WORK_DIR + fi + fi +} + + +function check_server(){ + chmod +x /data/local/tmp/developtools/hiprofiler_cmd + cd /data/local/tmp/developtools/ + if [ `ps -ef| grep hiprofiler_plugins | grep -v grep | wc -l` -eq 0 ];then + echo "FAIL" + fi + LD_LIBRARY_PATH=./ /data/local/tmp/developtools/hiprofiler_cmd -q +} + + +function unzip_start_daemon(){ + uzip_file + start_daemon + exit 0 +} + +function unzip_start_daemonV7(){ + uzip_file + start_v7daemon + exit 0 +} + +function check_file_exits(){ + echo "check daemon File " + if [ `ls $WORK_DIR | grep hiprofiler_cmd | wc -l` == 0 ]; then + echo "hiprofiler_cmd is not found" + exit 1 + fi + chmod +x $WORK_DIR/hiprofiler_cmd + + if [ `ls $WORK_DIR | grep hiprofilerd | wc -l` == 0 ]; then + echo "hiprofilerd is not found" + exit 2 + fi + chmod +x $WORK_DIR/hiprofilerd + + if [ `ls $WORK_DIR | grep hiprofiler_plugins | wc -l` == 0 ]; then + echo "hiprofilerd is not found" + exit 3 + fi + chmod +x $WORK_DIR/hiprofiler_plugins +} + +case $1 in + check) + echo "check file" + check_file_exits + ;; + start) + echo "start" + start_daemon + ;; + unzipStart) + echo "start" + unzip_start_daemon + ;; + startHeap) + echo "start Heap" + start_java_heap + ;; + check_server) + check_server + ;; + startV7) + start_v7daemon + ;; + restart) + restart_daemon + ;; + unzipStartV7) + unzip_start_daemonV7 + ;; + *) + echo "Ignorant" + ;; +esac diff --git a/host/ohosprofiler/src/main/resources/sql/GetCpuUtilizationRate.txt b/host/ohosprofiler/src/main/resources/sql/GetCpuUtilizationRate.txt new file mode 100644 index 000000000..fb1275350 --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/GetCpuUtilizationRate.txt @@ -0,0 +1,19 @@ +with cpu as ( + select cpu,ts,dur,(case when ro < 99 then ro else 99 end) as ro , + (case when ro < 99 then stime+ro*cell else stime + 99 * cell end) as st, + (case when ro < 99 then stime + (ro+1)*cell else etime end) as et + from ( + select cpu,ts,A.dur,((ts+A.dur)-D.start_ts)/((D.end_ts-D.start_ts)/100) as ro,D.start_ts as stime,D.end_ts etime,(D.end_ts-D.start_ts)/100 as cell + from sched_slice A + left join trace_bounds D + left join internal_thread B on A.utid = B.id + left join internal_process C on B.upid = C.id + where tid != 0 )) +select cpu,ro, + sum(case + when ts <= st and ts + dur <= et then (ts + dur - st) + when ts <= st and ts + dur > et then et-st + when ts > st and ts + dur <= et then dur + when ts > st and ts + dur > et then et - ts end)/cast(et-st as float) as rate +from cpu +group by cpu,ro \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/GetFunDataByTid.txt b/host/ohosprofiler/src/main/resources/sql/GetFunDataByTid.txt new file mode 100644 index 000000000..efaf10a39 --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/GetFunDataByTid.txt @@ -0,0 +1,13 @@ +select tid, + A.name as threadName, + is_main_thread, + c.track_id, + c.ts-D.start_ts as startTs, + c.dur, + c.name as funName, + c.depth +-- ,(case when category isnull then 'N/A' else category end) as cat +from internal_thread A,trace_bounds D +left join thread_track B on A.id = B.utid +left join internal_slice C on B.id = C.track_id +where startTs not null and A.tid = %s \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/GetTabCounters.txt b/host/ohosprofiler/src/main/resources/sql/GetTabCounters.txt new file mode 100644 index 000000000..90bb37f3b --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/GetTabCounters.txt @@ -0,0 +1,8 @@ +-- delta value 计算规则 框选范围内 last value - first value +-- rate/s 计算规则 框选范围时间内 delta value / range time(单位换算成 s ) +-- weight avg value 计算规则 以 value 在所选时间区域内 时间占比为权重,计算加权平均值 +-- count 计算规则 计算选中范围内的 count 数量 +-- first value 计算规则 框选区间内 first value +-- last value 计算规则 框选区间内 last value +-- min value 计算规则 框选区间内 min value +-- max value 计算规则 框选区间内 max value \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/GetTabCpuByProcess.txt b/host/ohosprofiler/src/main/resources/sql/GetTabCpuByProcess.txt new file mode 100644 index 000000000..0af4bcb23 --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/GetTabCpuByProcess.txt @@ -0,0 +1,18 @@ +--参数 1 cpus 数组,框选范围中选中的 cpu +--参数 2 leftNs 框选范围左边的时间,单位 ns +--参数 3 rightNs 框选范围右边的时间 单位 ns +select IP.name as processName, + IP.pid as processId, + sum(B.dur) as wallDuration, + avg(B.dur) as avgDuration, + count(A.tid) as occurrences +from thread_state AS B + left join internal_thread as A + left join trace_bounds AS TR + left join internal_process AS IP +where B.utid = A.id + and A.upid = IP.id + and B.cpu in (${cpus}) + and not ((B.ts - TR.start_ts + B.dur < ${leftNs}) or (B.ts - TR.start_ts > ${rightNs})) +group by IP.name, IP.pid +order by wallDuration desc; \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/GetTabCpuByThread.txt b/host/ohosprofiler/src/main/resources/sql/GetTabCpuByThread.txt new file mode 100644 index 000000000..76652b682 --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/GetTabCpuByThread.txt @@ -0,0 +1,20 @@ +--参数 1 cpus 数组,框选范围中选中的 cpu +--参数 2 leftNs 框选范围左边的时间,单位 ns +--参数 3 rightNs 框选范围右边的时间 单位 ns +select IP.name as processName, + IP.pid as processId, + A.name as threadName, + A.tid as threadId, + sum(B.dur) as wallDuration, + avg(B.dur) as avgDuration, + count(A.tid) as occurrences +from thread_state AS B + left join internal_thread as A + left join trace_bounds AS TR + left join internal_process AS IP +where B.utid = A.id + and A.upid = IP.id + and B.cpu in (${cpus}) + and not ((B.ts - TR.start_ts + B.dur < ${leftNs}) or (B.ts - TR.start_ts > ${rightNs})) +group by IP.name, IP.pid, A.name, A.tid +order by wallDuration desc; \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/GetTabSlices.txt b/host/ohosprofiler/src/main/resources/sql/GetTabSlices.txt new file mode 100644 index 000000000..c8fd2bc4e --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/GetTabSlices.txt @@ -0,0 +1,16 @@ +--参数 1 tids 数组,框选范围中选中的 thread id 集合 +--参数 2 leftNs 框选范围左边的时间,单位 ns +--参数 3 rightNs 框选范围右边的时间 单位 ns +select + c.name as funName, + sum(c.dur) as wallDuration, + avg(c.dur) as avgDuration, + count(c.name) as occurrences +from internal_thread A,trace_bounds D +left join thread_track B on A.id = B.utid +left join internal_slice C on B.id = C.track_id +where C.ts not null + and A.tid in (${tids}) + and not ((C.ts - D.start_ts + C.dur < ${leftNs}) or (C.ts - D.start_ts > ${rightNs})) +group by c.name +order by wallDuration desc; \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/GetTabThreadStates.txt b/host/ohosprofiler/src/main/resources/sql/GetTabThreadStates.txt new file mode 100644 index 000000000..e6c9f0eae --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/GetTabThreadStates.txt @@ -0,0 +1,20 @@ +--参数 1 tids 数组,框选范围中选中的 thread id 集合 +--参数 2 leftNs 框选范围左边的时间,单位 ns +--参数 3 rightNs 框选范围右边的时间 单位 ns +select + IP.name as processName, + IP.pid, + A.name as threadName, + A.tid, + B.state, + sum(B.dur) as wallDuration, + avg(B.dur) as avgDuration, + count(A.tid) as occurrences +from thread_state AS B +left join internal_thread as A on A.id = B.utid +left join trace_bounds AS TR +left join internal_process AS IP on IP.id=upid +where A.tid in (${tids}) +and not ((B.ts - TR.start_ts + B.dur < ${leftNs}) or (B.ts - TR.start_ts > ${rightNs})) +group by IP.name, IP.pid, A.name, A.tid, B.state +order by wallDuration desc; \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/QueryCpuData.txt b/host/ohosprofiler/src/main/resources/sql/QueryCpuData.txt new file mode 100644 index 000000000..8a4ee52b6 --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/QueryCpuData.txt @@ -0,0 +1,17 @@ +SELECT IP.name as processName, + IP.name processCmdLine, + IP.pid as processId,B.cpu, + A.name,C.id as schedId, + A.tid, + A.id, A.type, + B.dur, B.ts - TR.start_ts AS startTime, + C.priority, C.end_state +from thread_state AS B + left join internal_thread as A + left join sched_slice AS C + left join trace_bounds AS TR + left join internal_process AS IP +where B.utid = A.id and B.cpu = %s + and B.utid = C.utid and B.ts = C.ts + and A.upid = IP.id +order by B.rowid \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/QueryProcess.txt b/host/ohosprofiler/src/main/resources/sql/QueryProcess.txt new file mode 100644 index 000000000..5b69f8d6a --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/QueryProcess.txt @@ -0,0 +1,45 @@ +select + distinct process.pid as pid, + process.name as processName + from ( +-- select upid, 0 as utid from process_track +-- union +-- select upid, 0 as utid from process_counter_track +-- union +-- select upid, utid from thread_counter_track join thread using(utid) +-- union +-- select upid, utid from thread_track join thread using(utid) +-- union + select upid, utid from sched_slice join thread using(utid) group by utid +-- union +-- select upid, utid from ( +-- select distinct(utid) from cpu_profile_stack_sample +-- ) join thread using(utid) +-- union +-- select distinct(upid) as upid, 0 as utid from heap_profile_allocation +-- union +-- select distinct(upid) as upid, 0 as utid from heap_graph_object + ) the_tracks + left join (select upid, sum(dur) as total_dur + from sched join thread using(utid) + group by upid + ) using(upid) +-- left join ( +-- select +-- distinct(upid) as upid, +-- true as hasHeapProfiles +-- from heap_profile_allocation +-- union +-- select +-- distinct(upid) as upid, +-- true as hasHeapProfiles +-- from heap_graph_object +-- ) using (upid) + left join process using(upid) + -- where pid is not null + order by +-- hasHeapProfiles, + total_dur desc, + the_tracks.upid, + processName, + the_tracks.utid; \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/QueryProcessThreads.txt b/host/ohosprofiler/src/main/resources/sql/QueryProcessThreads.txt new file mode 100644 index 000000000..616943926 --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/QueryProcessThreads.txt @@ -0,0 +1,49 @@ +select + the_tracks.upid, + the_tracks.utid, + total_dur as hasSched, +-- hasHeapProfiles, + process.pid as pid, + thread.tid as tid, + process.name as processName, + thread.name as threadName + from ( +-- select upid, 0 as utid from process_track +-- union +-- select upid, 0 as utid from process_counter_track +-- union +-- select upid, utid from thread_counter_track join thread using(utid) +-- union +-- select upid, utid from thread_track join thread using(utid) +-- union + select upid, utid from sched join thread using(utid) group by utid +-- union +-- select upid, utid from ( +-- select distinct(utid) from cpu_profile_stack_sample +-- ) join thread using(utid) + "-- union +-- select distinct(upid) as upid, 0 as utid from heap_profile_allocation +-- union +-- select distinct(upid) as upid, 0 as utid from heap_graph_object + ) the_tracks + left join (select upid, sum(dur) as total_dur + from sched join thread using(utid) + group by upid + ) using(upid) +-- left join ( +-- select +-- distinct(upid) as upid, +-- true as hasHeapProfiles +-- from heap_profile_allocation +-- union +-- select +-- distinct(upid) as upid, +-- true as hasHeapProfiles +-- from heap_graph_object +-- ) using (upid) + left join thread using(utid) + left join process using(upid) + order by +-- hasHeapProfiles, + total_dur desc, + the_tracks.upid, + the_tracks.utid \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/QueryThreadData.txt b/host/ohosprofiler/src/main/resources/sql/QueryThreadData.txt new file mode 100644 index 000000000..b5299d033 --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/QueryThreadData.txt @@ -0,0 +1,6 @@ +select A.*, B.cpu, B.ts-TR.start_ts AS startTime,B.dur,B.state,IP.pid,IP.name as processName + from thread_state AS B + left join internal_thread as A + left join trace_bounds AS TR + left join internal_process AS IP on IP.id=upid + where A.id=B.utid and tid = %s \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/QueryTotalTime.txt b/host/ohosprofiler/src/main/resources/sql/QueryTotalTime.txt new file mode 100644 index 000000000..de98cb12a --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/QueryTotalTime.txt @@ -0,0 +1 @@ +select end_ts-start_ts as total from trace_bounds; \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/QueryWakeUpThread_Desc.txt b/host/ohosprofiler/src/main/resources/sql/QueryWakeUpThread_Desc.txt new file mode 100644 index 000000000..d03d458c8 --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/QueryWakeUpThread_Desc.txt @@ -0,0 +1,2 @@ +This is the interval from when the task became eligible to run +(e.g.because of notifying a wait queue it was a suspended on) to when it started running. \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/QueryWakeUpThread_WakeThread.txt b/host/ohosprofiler/src/main/resources/sql/QueryWakeUpThread_WakeThread.txt new file mode 100644 index 000000000..660b60d1a --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/QueryWakeUpThread_WakeThread.txt @@ -0,0 +1,7 @@ +select TB.tid,TB.name as thread ,TA.cpu,TC.pid,TC.name as process +from sched TA +left join internal_thread TB on TA.utid = TB.id +left join internal_process TC on TB.upid = TC.id +where utid = (select utid from raw where name = 'sched_waking' and ts = wakeup_ts ) + and TA.ts < wakeup_ts + and Ta.ts + Ta.dur >= wakeup_ts \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/sql/QueryWakeUpThread_WakeTime.txt b/host/ohosprofiler/src/main/resources/sql/QueryWakeUpThread_WakeTime.txt new file mode 100644 index 000000000..4ee6c16d9 --- /dev/null +++ b/host/ohosprofiler/src/main/resources/sql/QueryWakeUpThread_WakeTime.txt @@ -0,0 +1,11 @@ +select * from + ( select ts as wakeTs,start_ts from instants,trace_bounds + where name = 'sched_waking' + and ref = %s + and ts < start_ts + %s + order by ts desc limit 1) TA + left join + (select ts as preRow from sched,trace_bounds + where utid = %s + and ts < start_ts + %s + order by ts desc limit 1) TB \ No newline at end of file diff --git a/host/ohosprofiler/src/main/resources/trace.db b/host/ohosprofiler/src/main/resources/trace.db new file mode 100644 index 000000000..44aa13ef5 Binary files /dev/null and b/host/ohosprofiler/src/main/resources/trace.db differ diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/databaseapi/DataBaseApiTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/databaseapi/DataBaseApiTest.java new file mode 100644 index 000000000..be8c7c085 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/databaseapi/DataBaseApiTest.java @@ -0,0 +1,980 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.databaseapi; + +import com.alibaba.druid.pool.DruidDataSource; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +/** + * @version 1.0 + * @date 2021/03/22 16:07 + **/ +public class DataBaseApiTest { + private List processMemInfo; + private List processMemInfoIndex; + + /** + * functional testing init + * + * @tc.name: setUp + * @tc.number: OHOS_JAVA_database_DataBaseApi_setUp_0001 + * @tc.desc: setUp + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Before + public void setUp() { + processMemInfo = new ArrayList() { + { + add("id INTEGER primary key autoincrement not null"); + add("sessionId INTEGER NOT NULL"); + add("session INTEGER NOT NULL"); + add("timeStamp Long NOT NULL"); + add("Data BLOB NOT NULL"); + } + }; + processMemInfoIndex = new ArrayList() { + { + add("id"); + add("sessionId"); + add("timeStamp"); + } + }; + SessionManager.getInstance().setDevelopMode(true); + } + + /** + * functional testing init + * + * @tc.name: init DataSourceManager + * @tc.number: OHOS_JAVA_database_DataBaseApi_initDataSourceManager_0001 + * @tc.desc: init DataSourceManager + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void initDataSourceManager() { + try { + DataBaseApi.getInstance().initDataSourceManager(); + Assert.assertTrue(true); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing init + * + * @tc.name: init DataSourceManager + * @tc.number: OHOS_JAVA_database_DataBaseApi_initDataSourceManager_0002 + * @tc.desc: init DataSourceManager + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void initDataSourceManager02() { + try { + DataBaseApi.getInstance().initDataSourceManager(); + DataBaseApi.getInstance().initDataSourceManager(); + Assert.assertTrue(true); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing get Connect + * + * @tc.name: get DefaultDataBase Connect + * @tc.number: OHOS_JAVA_database_DataBaseApi_getDefaultDataBaseConnect_0001 + * @tc.desc: get DefaultDataBase Connect + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getDefaultDataBaseConnect01() { + Optional res = null; + try { + DataBaseApi.getInstance().initDataSourceManager(); + res = DataBaseApi.getInstance().getDefaultDataBaseConnect(); + Assert.assertTrue(res.isPresent()); + } catch (Exception exception) { + Assert.assertTrue(res.isPresent()); + } + } + + /** + * functional testing get Connect + * + * @tc.name: get DefaultDataBase Connect + * @tc.number: OHOS_JAVA_database_DataBaseApi_getDefaultDataBaseConnect_0002 + * @tc.desc: get DefaultDataBase Connect + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getDefaultDataBaseConnect02() { + Optional res = null; + try { + DataBaseApi.getInstance().initDataSourceManager(); + res = DataBaseApi.getInstance().getDefaultDataBaseConnect(); + Assert.assertTrue(res.isPresent()); + Connection conn = res.get(); + Assert.assertNotNull(conn); + } catch (Exception exception) { + Assert.assertTrue(res.isPresent()); + } + } + + /** + * functional testing get Connect + * + * @tc.name: get DefaultDataBase Connect + * @tc.number: OHOS_JAVA_database_DataBaseApi_getDefaultDataBaseConnect_0003 + * @tc.desc: get DefaultDataBase Connect + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getDefaultDataBaseConnect03() { + Optional res = null; + try { + res = DataBaseApi.getInstance().getDefaultDataBaseConnect(); + Assert.assertTrue(res.isPresent()); + } catch (Exception exception) { + Assert.assertTrue(res.isPresent()); + } + } + + /** + * functional testing get Connect + * + * @tc.name: get DefaultDataBase Connect + * @tc.number: OHOS_JAVA_database_DataBaseApi_getDefaultDataBaseConnect_0004 + * @tc.desc: get DefaultDataBase Connect + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getDefaultDataBaseConnect04() { + Optional res = null; + try { + res = DataBaseApi.getInstance().getDefaultDataBaseConnect(); + Assert.assertTrue(res.isPresent()); + Connection cc = res.get(); + Assert.assertNotNull(cc); + } catch (Exception exception) { + Assert.assertTrue(res.isPresent()); + } + } + + /** + * functional testing get Connect + * + * @tc.name: get Connect By Table + * @tc.number: OHOS_JAVA_database_DataBaseApi_getConnectByTable_0001 + * @tc.desc: get Connect By Table + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getConnectByTableTest01() { + Optional res = null; + try { + DataBaseApi.getInstance().initDataSourceManager(); + res = DataBaseApi.getInstance().getConnectByTable("DeviceInfo"); + Assert.assertTrue(res.isPresent()); + } catch (Exception exception) { + Assert.assertTrue(res.isPresent()); + } + } + + /** + * functional testing get Connect + * + * @tc.name: get Connect By Table + * @tc.number: OHOS_JAVA_database_DataBaseApi_getConnectByTable_0002 + * @tc.desc: get Connect By Table + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getConnectByTableTest02() { + Optional res = null; + try { + DataBaseApi.getInstance().initDataSourceManager(); + res = DataBaseApi.getInstance().getConnectByTable(""); + Assert.assertFalse(res.isPresent()); + } catch (Exception exception) { + Assert.assertTrue(res.isPresent()); + } + } + + /** + * functional testing get Connect + * + * @tc.name: get Connect By Table + * @tc.number: OHOS_JAVA_database_DataBaseApi_getConnectByTable_0003 + * @tc.desc: get Connect By Table + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getConnectByTableTest03() { + Optional res = null; + try { + DataBaseApi.getInstance().initDataSourceManager(); + res = DataBaseApi.getInstance().getConnectByTable(null); + Assert.assertFalse(res.isPresent()); + } catch (Exception exception) { + Assert.assertTrue(res.isPresent()); + } + } + + /** + * functional testing get Connect + * + * @tc.name: get Connect By Table + * @tc.number: OHOS_JAVA_database_DataBaseApi_getConnectByTable_0004 + * @tc.desc: get Connect By Table + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getConnectByTableTest04() { + Optional res = null; + try { + res = DataBaseApi.getInstance().getConnectByTable("DeviceInfo"); + Assert.assertTrue(res.isPresent()); + } catch (Exception exception) { + Assert.assertTrue(res.isPresent()); + } + } + + /** + * functional testing get Connect + * + * @tc.name: get Connect By Table + * @tc.number: OHOS_JAVA_database_DataBaseApi_getConnectByTable_0005 + * @tc.desc: get Connect By Table + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getConnectByTableTest05() { + Optional res = null; + try { + res = DataBaseApi.getInstance().getConnectByTable(""); + Assert.assertFalse(res.isPresent()); + } catch (Exception exception) { + Assert.assertTrue(res.isPresent()); + } + } + + /** + * functional testing get Connect + * + * @tc.name: get Connect By dbname + * @tc.number: OHOS_JAVA_database_DataBaseApi_getConnectBydbname_0001 + * @tc.desc: get Connect By dbname + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getConnectBydbnameTest01() { + Optional res = DataBaseApi.getInstance().getConnectBydbname("defaultDB"); + Assert.assertTrue(res.isPresent()); + } + + /** + * functional testing get Connect + * + * @tc.name: get Connect By dbname + * @tc.number: OHOS_JAVA_database_DataBaseApi_getConnectBydbname_0002 + * @tc.desc: get Connect By dbname + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getConnectBydbnameTest02() { + Optional res = null; + try { + res = DataBaseApi.getInstance().getConnectBydbname("defaultDB"); + Assert.assertTrue(res.isPresent()); + } catch (Exception exception) { + Assert.assertTrue(res.isPresent()); + } + } + + /** + * functional testing get Connect + * + * @tc.name: get Connect By dbname + * @tc.number: OHOS_JAVA_database_DataBaseApi_getConnectBydbname_0003 + * @tc.desc: get Connect By dbname + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getConnectBydbnameTest03() { + Optional res = null; + try { + res = DataBaseApi.getInstance().getConnectBydbname("test"); + Assert.assertTrue(res.isPresent()); + } catch (Exception exception) { + Assert.assertTrue(res.isPresent()); + } + } + + /** + * functional testing get Connect + * + * @tc.name: get Connect By dbname + * @tc.number: OHOS_JAVA_database_DataBaseApi_getConnectBydbname_0004 + * @tc.desc: get Connect By dbname + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getConnectBydbnameTest04() { + Optional res = null; + try { + res = DataBaseApi.getInstance().getConnectBydbname("test"); + Assert.assertTrue(res.isPresent()); + res = DataBaseApi.getInstance().getConnectBydbname("test"); + Assert.assertTrue(res.isPresent()); + } catch (Exception exception) { + Assert.assertTrue(res.isPresent()); + } + } + + /** + * functional testing get Connect + * + * @tc.name: get Connect By dbname + * @tc.number: OHOS_JAVA_database_DataBaseApi_getConnectBydbname_0005 + * @tc.desc: get Connect By dbname + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getConnectBydbnameTest05() { + Optional res = null; + try { + res = DataBaseApi.getInstance().getConnectBydbname("defaultDB"); + Assert.assertTrue(res.isPresent()); + res = DataBaseApi.getInstance().getConnectBydbname("test"); + Assert.assertTrue(res.isPresent()); + } catch (Exception exception) { + Assert.assertTrue(res.isPresent()); + } + } + + /** + * functional testing get DataBaseName + * + * @tc.name: get Pool By DataBaseName + * @tc.number: OHOS_JAVA_database_DataBaseApi_getPoolByDataBaseName_0001 + * @tc.desc: get Pool By DataBaseName + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getPoolByDataBaseNameTest01() { + DataSource res = null; + try { + res = DataBaseApi.getInstance().getPoolByDataBaseName(""); + Assert.assertNotNull(res); + } catch (Exception exception) { + Assert.assertNotNull(res); + } + } + + /** + * functional testing get DataBaseName + * + * @tc.name: get Pool By DataBaseName + * @tc.number: OHOS_JAVA_database_DataBaseApi_getPoolByDataBaseName_0002 + * @tc.desc: get Pool By DataBaseName + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getPoolByDataBaseNameTest02() { + DataSource res = null; + try { + res = DataBaseApi.getInstance().getPoolByDataBaseName(null); + Assert.assertNotNull(res); + } catch (Exception exception) { + Assert.assertNotNull(res); + } + } + + /** + * functional testing get DataBaseName + * + * @tc.name: get Pool By DataBaseName + * @tc.number: OHOS_JAVA_database_DataBaseApi_getPoolByDataBaseName_0003 + * @tc.desc: get Pool By DataBaseName + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getPoolByDataBaseNameTest03() { + DataSource res = null; + try { + res = DataBaseApi.getInstance().getPoolByDataBaseName("test"); + Assert.assertNotNull(res); + } catch (Exception exception) { + Assert.assertNotNull(res); + } + } + + /** + * functional testing get DataBaseName + * + * @tc.name: get Pool By DataBaseName + * @tc.number: OHOS_JAVA_database_DataBaseApi_getPoolByDataBaseName_0004 + * @tc.desc: get Pool By DataBaseName + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getPoolByDataBaseNameTest04() { + DataSource res = null; + try { + res = DataBaseApi.getInstance().getPoolByDataBaseName("test"); + Assert.assertNotNull(res); + res = DataBaseApi.getInstance().getPoolByDataBaseName("test"); + Assert.assertNotNull(res); + } catch (Exception exception) { + Assert.assertNotNull(res); + } + } + + /** + * functional testing get DataBaseName + * + * @tc.name: get Pool By DataBaseName + * @tc.number: OHOS_JAVA_database_DataBaseApi_getPoolByDataBaseName_0005 + * @tc.desc: get Pool By DataBaseName + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getPoolByDataBaseNameTest05() { + DataSource res = null; + try { + res = DataBaseApi.getInstance().getPoolByDataBaseName(null); + Assert.assertNotNull(res); + res = DataBaseApi.getInstance().getPoolByDataBaseName("test"); + Assert.assertNotNull(res); + } catch (Exception exception) { + Assert.assertNotNull(res); + } + } + + /** + * functional testing register table + * + * @tc.name: register table + * @tc.number: OHOS_JAVA_database_DataBaseApi_registerTable_0001 + * @tc.desc: register table + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void registerTableTest01() { + try { + DataBaseApi.getInstance().registerTable("test", "ttest"); + Assert.assertTrue(true); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing register table + * + * @tc.name: register table + * @tc.number: OHOS_JAVA_database_DataBaseApi_registerTable_0002 + * @tc.desc: register table + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void registerTableTest02() { + try { + DataBaseApi.getInstance().registerTable("", "ttest"); + Assert.assertTrue(true); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing register table + * + * @tc.name: register table + * @tc.number: OHOS_JAVA_database_DataBaseApi_registerTable_0003 + * @tc.desc: register table + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void registerTableTest03() { + try { + DataBaseApi.getInstance().registerTable("test", ""); + Assert.assertTrue(true); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing register table + * + * @tc.name: register table + * @tc.number: OHOS_JAVA_database_DataBaseApi_registerTable_0004 + * @tc.desc: register table + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void registerTableTest04() { + try { + DataBaseApi.getInstance().registerTable(null, null); + Assert.assertTrue(true); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing register table + * + * @tc.name: register table + * @tc.number: OHOS_JAVA_database_DataBaseApi_registerTable_0005 + * @tc.desc: register table + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void registerTableTest05() { + try { + DataBaseApi.getInstance().registerTable("test", "ttest"); + Assert.assertTrue(true); + DataBaseApi.getInstance().registerTable("test", "ttest"); + Assert.assertTrue(true); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing register DataSource + * + * @tc.name: register DataSource + * @tc.number: OHOS_JAVA_database_DataBaseApi_registerDataSource_0001 + * @tc.desc: register DataSource + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void registerDataSourceTest01() { + try { + DataBaseApi.getInstance().registerDataSource(null, null); + Assert.assertTrue(true); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing register DataSource + * + * @tc.name: register DataSource + * @tc.number: OHOS_JAVA_database_DataBaseApi_registerDataSource_0002 + * @tc.desc: register DataSource + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void registerDataSourceTest02() { + try { + DataBaseApi.getInstance().registerDataSource("dataBase", null); + Assert.assertTrue(true); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing register DataSource + * + * @tc.name: register DataSource + * @tc.number: OHOS_JAVA_database_DataBaseApi_registerDataSource_0003 + * @tc.desc: register DataSource + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void registerDataSourceTest03() { + try { + DataBaseApi.getInstance().registerDataSource("dataBase", new DruidDataSource()); + Assert.assertTrue(true); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing register DataSource + * + * @tc.name: register DataSource + * @tc.number: OHOS_JAVA_database_DataBaseApi_registerDataSource_0004 + * @tc.desc: register DataSource + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void registerDataSourceTest04() { + try { + DataBaseApi.getInstance().registerDataSource(null, new DruidDataSource()); + Assert.assertTrue(true); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing register DataSource + * + * @tc.name: register DataSource + * @tc.number: OHOS_JAVA_database_DataBaseApi_registerDataSource_0005 + * @tc.desc: register DataSource + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void registerDataSourceTest05() { + try { + DataBaseApi.getInstance().registerDataSource("dataBase", new DruidDataSource()); + Assert.assertTrue(true); + DataBaseApi.getInstance().registerDataSource(null, new DruidDataSource()); + Assert.assertTrue(true); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing Database creation + * + * @tc.name: Database creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createDataBase_0001 + * @tc.desc: Database creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createDataBaseTest01() { + try { + boolean res = DataBaseApi.getInstance().createDataBase(null); + Assert.assertFalse(res); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing Database creation + * + * @tc.name: Database creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createDataBase_0002 + * @tc.desc: Database creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createDataBaseTest02() { + try { + boolean res = DataBaseApi.getInstance().createDataBase("testaa"); + Assert.assertTrue(res); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing Database creation + * + * @tc.name: Database creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createDataBase_0003 + * @tc.desc: Database creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createDataBaseTest03() { + try { + boolean res = DataBaseApi.getInstance().createDataBase("testaa"); + Assert.assertTrue(res); + boolean res0 = DataBaseApi.getInstance().createDataBase("testaa"); + Assert.assertTrue(res0); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing Database creation + * + * @tc.name: Database creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createDataBase_0005 + * @tc.desc: Database creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createDataBaseTest05() { + try { + boolean res = DataBaseApi.getInstance().createDataBase(null); + Assert.assertFalse(res); + boolean res0 = DataBaseApi.getInstance().createDataBase("testaa"); + Assert.assertTrue(res0); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing table creation + * + * @tc.name: Database table creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createTable_0001 + * @tc.desc: Database table creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createTableTest01() { + try { + boolean res = + DataBaseApi.getInstance().createTable(DataBaseApi.DEFAULT_DATABASE_DBNAME, "testTable", processMemInfo); + Assert.assertTrue(res); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing table creation + * + * @tc.name: Database table creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createTable_0002 + * @tc.desc: Database table creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createTableTest02() { + try { + boolean res = + DataBaseApi.getInstance().createTable(DataBaseApi.DEFAULT_DATABASE_DBNAME, null, processMemInfo); + Assert.assertFalse(res); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing table creation + * + * @tc.name: Database table creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createTable_0003 + * @tc.desc: Database table creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createTableTest03() { + try { + boolean res = DataBaseApi.getInstance().createTable("", null, processMemInfo); + Assert.assertFalse(res); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing table creation + * + * @tc.name: Database table creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createTable_0004 + * @tc.desc: Database table creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createTableTest04() { + try { + boolean res = DataBaseApi.getInstance().createTable(null, null, processMemInfo); + Assert.assertFalse(res); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing table creation + * + * @tc.name: Database table creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createTable_0005 + * @tc.desc: Database table creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createTableTest05() { + try { + boolean res = DataBaseApi.getInstance().createTable(null, null, processMemInfo); + Assert.assertFalse(res); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing index creation + * + * @tc.name: Database index creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createIndex_0001 + * @tc.desc: Database index creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createIndexTest01() { + try { + boolean res = + DataBaseApi.getInstance().createTable(DataBaseApi.DEFAULT_DATABASE_DBNAME, "testTable", processMemInfo); + Assert.assertTrue(res); + boolean result = DataBaseApi.getInstance().createIndex("testTable", "testIndex", processMemInfoIndex); + Assert.assertTrue(result); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing index creation + * + * @tc.name: Database index creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createIndex_0002 + * @tc.desc: Database index creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createIndexTest02() { + try { + boolean res = + DataBaseApi.getInstance().createTable(DataBaseApi.DEFAULT_DATABASE_DBNAME, "testTable", processMemInfo); + Assert.assertTrue(res); + boolean result = DataBaseApi.getInstance().createIndex("testTable", null, processMemInfoIndex); + Assert.assertFalse(result); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing index creation + * + * @tc.name: Database index creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createIndex_0003 + * @tc.desc: Database index creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createIndexTest03() { + try { + boolean res = + DataBaseApi.getInstance().createTable(DataBaseApi.DEFAULT_DATABASE_DBNAME, "testTable", processMemInfo); + Assert.assertTrue(res); + boolean result = DataBaseApi.getInstance().createIndex(null, "aaa", processMemInfoIndex); + Assert.assertFalse(result); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing index creation + * + * @tc.name: Database index creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createIndex_0004 + * @tc.desc: Database index creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createIndexTest04() { + try { + boolean res = + DataBaseApi.getInstance().createTable(DataBaseApi.DEFAULT_DATABASE_DBNAME, "testTable", processMemInfo); + Assert.assertTrue(res); + + boolean result = DataBaseApi.getInstance().createIndex(null, null, processMemInfoIndex); + Assert.assertFalse(result); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing index creation + * + * @tc.name: Database index creation + * @tc.number: OHOS_JAVA_database_DataBaseApi_createIndex_0005 + * @tc.desc: Database index creation + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createIndexTest05() { + try { + boolean res = + DataBaseApi.getInstance().createTable(DataBaseApi.DEFAULT_DATABASE_DBNAME, "testTable", processMemInfo); + Assert.assertTrue(res); + boolean result = DataBaseApi.getInstance().createIndex(null, null, null); + Assert.assertFalse(result); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/databasemanager/DataBaseManagerTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/databasemanager/DataBaseManagerTest.java new file mode 100644 index 000000000..8dd7c21dd --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/databasemanager/DataBaseManagerTest.java @@ -0,0 +1,284 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.databasemanager; + +import ohos.devtools.datasources.databases.databasepool.DataBase; +import ohos.devtools.datasources.databases.databasepool.DataBaseHelper; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import javax.sql.DataSource; +import static ohos.devtools.datasources.databases.databaseapi.DataBaseApi.DEFAULT_DATABASE_DBNAME; +import static ohos.devtools.datasources.databases.databasepool.DataBaseHelper.getUrlByDataBaseName; + +/** + * @version 1.0 + * @date 2021/03/26 11:06 + **/ +public class DataBaseManagerTest { + /** + * functional testing init + * + * @tc.name: setUp + * @tc.number: OHOS_JAVA_database_DataBaseManager_setUp_0001 + * @tc.desc: setUp + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Before + public void setUp() { + SessionManager.getInstance().setDevelopMode(true); + } + + /** + * functional testing DefaultDataBase + * + * @tc.name: init DefaultDataBase + * @tc.number: OHOS_JAVA_database_DataBaseManager_initDefaultDataBase_0001 + * @tc.desc: init DefaultDataBase + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void initDefaultDataBaseTest01() { + try { + DataBase dataBase = DataBaseHelper.createDefaultDataBase(); + dataBase.setUrl(getUrlByDataBaseName(DEFAULT_DATABASE_DBNAME)); + boolean res = DataBaseManager.getInstance().initDefaultDataBase(dataBase); + Assert.assertTrue(res); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing DefaultDataBase + * + * @tc.name: init DefaultDataBase + * @tc.number: OHOS_JAVA_database_DataBaseManager_initDefaultDataBase_0002 + * @tc.desc: init DefaultDataBase + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void initDefaultDataBaseTest02() { + try { + DataBase dataBase = DataBaseHelper.createDefaultDataBase(); + dataBase.setUrl(getUrlByDataBaseName(DEFAULT_DATABASE_DBNAME)); + boolean res = DataBaseManager.getInstance().initDefaultDataBase(dataBase); + Assert.assertTrue(res); + boolean res01 = DataBaseManager.getInstance().initDefaultDataBase(dataBase); + Assert.assertTrue(res01); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing initDefaultSql + * + * @tc.name: init DefaultSql + * @tc.number: OHOS_JAVA_database_DataBaseManager_initDefaultSql_0001 + * @tc.desc: init DefaultSql + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void initDefaultSqlTest01() { + try { + DataBase dataBase = DataBaseHelper.createDefaultDataBase(); + dataBase.setUrl(getUrlByDataBaseName(DEFAULT_DATABASE_DBNAME)); + boolean result = DataBaseManager.getInstance().initDefaultSql(dataBase); + Assert.assertTrue(result); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing initDefaultSql + * + * @tc.name: init DefaultSql + * @tc.number: OHOS_JAVA_database_DataBaseManager_initDefaultSql_0002 + * @tc.desc: init DefaultSql + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void initDefaultSqlTest02() { + try { + DataBase dataBase = DataBaseHelper.createDefaultDataBase(); + dataBase.setUrl(getUrlByDataBaseName(DEFAULT_DATABASE_DBNAME)); + boolean res = DataBaseManager.getInstance().initDefaultDataBase(dataBase); + Assert.assertTrue(res); + boolean result = DataBaseManager.getInstance().initDefaultSql(dataBase); + Assert.assertTrue(result); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing createDataBase + * + * @tc.name: create DataBase + * @tc.number: OHOS_JAVA_database_DataBaseManager_createDataBase_0001 + * @tc.desc: create DataBase + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createDataBaseTest01() { + try { + boolean res = DataBaseManager.getInstance().createDataBase("test01"); + Assert.assertTrue(res); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing createDataBase + * + * @tc.name: create DataBase + * @tc.number: OHOS_JAVA_database_DataBaseManager_createDataBase_0002 + * @tc.desc: create DataBase + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createDataBaseTest02() { + try { + boolean res = DataBaseManager.getInstance().createDataBase(null); + Assert.assertTrue(res); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing createDataBase + * + * @tc.name: create DataBase + * @tc.number: OHOS_JAVA_database_DataBaseManager_createDataBase_0003 + * @tc.desc: create DataBase + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createDataBaseTest03() { + try { + boolean res = DataBaseManager.getInstance().createDataBase(""); + Assert.assertTrue(res); + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing createDruidConnectionPool + * + * @tc.name: create DruidConnection Pool + * @tc.number: OHOS_JAVA_database_DataBaseManager_createDruidConnectionPool_0001 + * @tc.desc: create DruidConnection Pool + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createDruidConnectionPoolTest01() { + DataSource result = null; + try { + boolean res = DataBaseManager.getInstance().createDataBase("test01"); + Assert.assertTrue(res); + DataBase dataBase = DataBaseHelper.createDataBase(); + dataBase.setUrl(getUrlByDataBaseName("test01")); + result = DataBaseManager.getInstance().createDruidConnectionPool(dataBase); + Assert.assertNotNull(result); + } catch (Exception exception) { + Assert.assertNotNull(result); + } + } + + /** + * functional testing createDruidConnectionPool + * + * @tc.name: create DruidConnection Pool + * @tc.number: OHOS_JAVA_database_DataBaseManager_createDruidConnectionPool_0002 + * @tc.desc: create DruidConnection Pool + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createDruidConnectionPoolTest02() { + DataSource result = null; + try { + DataBase dataBase = DataBaseHelper.createDataBase(); + dataBase.setUrl(getUrlByDataBaseName("test02")); + result = DataBaseManager.getInstance().createDruidConnectionPool(dataBase); + Assert.assertNotNull(result); + } catch (Exception exception) { + Assert.assertNotNull(result); + } + } + + /** + * functional testing createDruidConnectionPool + * + * @tc.name: create DruidConnection Pool + * @tc.number: OHOS_JAVA_database_DataBaseManager_createDruidConnectionPool_0003 + * @tc.desc: create DruidConnection Pool + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createDruidConnectionPoolTest03() { + DataSource result = null; + try { + result = DataBaseManager.getInstance().createDruidConnectionPool(null); + Assert.assertNull(result); + } catch (Exception exception) { + Assert.assertNull(result); + } + } + + /** + * functional testing createDruidConnectionPool + * + * @tc.name: create DruidConnection Pool + * @tc.number: OHOS_JAVA_database_DataBaseManager_createDruidConnectionPool_0004 + * @tc.desc: create DruidConnection Pool + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createDruidConnectionPoolTest04() { + DataSource result = null; + try { + boolean res = DataBaseManager.getInstance().createDataBase("test01"); + Assert.assertTrue(res); + DataBase dataBase = DataBaseHelper.createDataBase(); + dataBase.setUrl(getUrlByDataBaseName("test01")); + result = DataBaseManager.getInstance().createDruidConnectionPool(dataBase); + DataBase dataBas2 = DataBaseHelper.createDataBase(); + dataBas2.setUrl(getUrlByDataBaseName("test01")); + result = DataBaseManager.getInstance().createDruidConnectionPool(dataBase); + Assert.assertNotNull(result); + } catch (Exception exception) { + Assert.assertNotNull(result); + } + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/databasepool/DataBaseHelperTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/databasepool/DataBaseHelperTest.java new file mode 100644 index 000000000..4bd9d1691 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/databasepool/DataBaseHelperTest.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.databasepool; + +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; +import java.util.List; + +/** + * DataBaseHelperTest + * + * @version 1.0 + * @date 2021/04/12 18:38 + **/ +public class DataBaseHelperTest { + private static String url = "jdbc:sqlite://localhost:1521"; + + /** + * functional testing checkDataBaseExists + * + * @tc.name: checkDataBaseExists + * @tc.number: OHOS_JAVA_database_DataBaseHelper_checkDataBaseExists_0001 + * @tc.desc: checkDataBaseExists + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void checkDataBaseExistsTest() { + boolean flag = DataBaseHelper.checkDataBaseExists(url); + if (flag) { + Assert.assertTrue(true); + } + } + + /** + * functional testing loadSqlFileToList + * + * @tc.name: loadSqlFileToList + * @tc.number: OHOS_JAVA_database_DataBaseHelper_loadSqlFileToList_0001 + * @tc.desc: loadSqlFileToList + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void loadSqlFileToListTest() { + List list = null; + try { + list = DataBaseHelper.loadSqlFileToList("d://"); + Assert.assertNotNull(list); + } catch (IOException ioException) { + Assert.assertNotNull(list); + } + } + + /** + * functional testing getFilePath + * + * @tc.name: getFilePath + * @tc.number: OHOS_JAVA_database_DataBaseHelper_getFilePath_0001 + * @tc.desc: get FilePath + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getFilePathTest() { + String fileStr = DataBaseHelper.getFilePath(url); + Assert.assertNotNull(fileStr); + } + + /** + * functional testing getUrlByDataBaseName + * + * @tc.name: getUrlByDataBaseName + * @tc.number: OHOS_JAVA_database_DataBaseHelper_getUrlByDataBaseName_0001 + * @tc.desc: get Url By DataBaseName + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getUrlByDataBaseNameTest() { + String dataBaseStr = DataBaseHelper.getUrlByDataBaseName("defaultDB"); + Assert.assertNotNull(dataBaseStr); + } + + /** + * functional testing createDataBase + * + * @tc.name: createDataBase + * @tc.number: OHOS_JAVA_database_DataBaseHelper_createDataBase_0001 + * @tc.desc: createDataBase + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createDataBaseTest() { + DataBase dataBase = DataBaseHelper.createDataBase(); + Assert.assertNotNull(dataBase); + } + + /** + * functional testing createDefaultDataBase + * + * @tc.name: createDefaultDataBase + * @tc.number: OHOS_JAVA_database_DataBaseHelper_createDefaultDataBase_0001 + * @tc.desc: create DefaultDataBase + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void createDefaultDataBaseTest() { + DataBase dataBaseDefault = DataBaseHelper.createDefaultDataBase(); + Assert.assertNotNull(dataBaseDefault); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/databasepool/DataTableHelperTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/databasepool/DataTableHelperTest.java new file mode 100644 index 000000000..5994c510e --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/databasepool/DataTableHelperTest.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.databases.databasepool; + +import org.junit.Assert; +import org.junit.Test; + +import java.util.HashMap; + +/** + * @Description DataTableHelperTest + * @Date 2021/04/12 17:33 + **/ +public class DataTableHelperTest { + /** + * functional testing getTableNameBySql + * + * @tc.name: getTableNameBySql + * @tc.number: OHOS_JAVA_database_DataBaseHelper_getTableNameBySql_0001 + * @tc.desc: getTableNameBySql + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getTableNameBySqlTest() { + String str = DataTableHelper.getTableNameBySql("("); + Assert.assertNotNull(str); + } + + /** + * functional testing sqlPlaceholder + * + * @tc.name: sqlPlaceholder + * @tc.number: OHOS_JAVA_database_DataTableHelper_sqlPlaceholder_0001 + * @tc.desc: sqlPlaceholder + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void sqlPlaceholderTest() { + String sqlStr = DataTableHelper.sqlPlaceholder(10); + Assert.assertNotNull(sqlStr); + } + + /** + * functional testing getDeleteCondition + * + * @tc.name: getDeleteCondition + * @tc.number: OHOS_JAVA_database_DataTableHelper_getDeleteCondition_0001 + * @tc.desc: getDeleteCondition + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void getDeleteConditionTest() { + String deleteStr = DataTableHelper.getDeleteCondition(new HashMap<>()); + Assert.assertNotNull(deleteStr); + } + + /** + * functional testing mapToString + * + * @tc.name: mapToString + * @tc.number: OHOS_JAVA_database_DataTableHelper_mapToString_0001 + * @tc.desc: mapToString + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void mapToStringTest() { + String mapStr = DataTableHelper.mapToString(new HashMap<>()); + Assert.assertNotNull(mapStr); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/datatable/MemoryDataTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/datatable/MemoryDataTest.java new file mode 100644 index 000000000..b689a0d41 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/databases/datatable/MemoryDataTest.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package ohos.devtools.datasources.databases.datatable; + +import ohos.devtools.datasources.databases.datatable.enties.MemoryData; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * @Description MemoryDataTest + * @Date 2021/4/23 11:30 + **/ +public class MemoryDataTest { + /** + * 时间戳 + */ + private long timeStamp = 2006 - 07 - 11; + + /** + * sessionId数字3243 + */ + private int sessionId = 3243; + + /** + * localSessionId + */ + private long localSessionId = 1619147859561L; + + /** + * memoryData 实例 + */ + private MemoryData memoryData = new MemoryData(); + + /** + * object 数据实例 + */ + private Object object = new Object(); + + /** + * functional testing init + * + * @tc.name: initObj + * @tc.number: OHOS_JAVA_database_MemoryData_initObj_0001 + * @tc.desc: initObj + * @tc.type: functional testing + * @tc.require: SR-011 + */ + @Before + public void initObj() { + memoryData.setSession(localSessionId); + memoryData.setSessionId(sessionId); + memoryData.setTimeStamp(timeStamp); + memoryData.setData(object); + } + + /** + * functional testing getSession + * + * @tc.name: getSession + * @tc.number: OHOS_JAVA_database_MemoryData_getSession_0001 + * @tc.desc: getSession + * @tc.type: functional testing + * @tc.require: SR-011 + */ + @Test + public void getSessionTest() { + long session = memoryData.getSession(); + Assert.assertEquals(session, 1619147859561L); + } + + /** + * functional testing getSessionId + * + * @tc.name: getSessionId + * @tc.number: OHOS_JAVA_database_MemoryData_getSessionId_0001 + * @tc.desc: getSessionId + * @tc.type: functional testing + * @tc.require: SR-011 + */ + @Test + public void getSessionIdTest() { + int session = memoryData.getSessionId(); + Assert.assertEquals(session, 3243); + } + + /** + * functional testing getlocalSessionId + * + * @tc.name: getlocalSessionId + * @tc.number: OHOS_JAVA_database_MemoryData_getlocalSessionId_0001 + * @tc.desc: getlocalSessionId + * @tc.type: functional testing + * @tc.require: SR-011 + */ + @Test + public void getlocalSessionIdTest() { + long session = memoryData.getLocalSessionId(); + Assert.assertEquals(session, 1619147859561L); + } + + /** + * functional testing getTimeStamp + * + * @tc.name: getTimeStamp + * @tc.number: OHOS_JAVA_database_MemoryData_getTimeStamp_0001 + * @tc.desc: getTimeStamp + * @tc.type: functional testing + * @tc.require: SR-011 + */ + @Test + public void getTimeStampTest() { + long session = memoryData.getTimeStamp(); + Assert.assertEquals(session, 2006 - 07 - 11); + } + + /** + * functional testing getData + * + * @tc.name: getData + * @tc.number: OHOS_JAVA_database_MemoryData_getData_0001 + * @tc.desc: getData + * @tc.type: functional testing + * @tc.require: SR-011 + */ + @Test + public void getDataTest() { + Object obj = memoryData.getData(); + Assert.assertNotNull(obj); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/transport/grpc/HiprofilerClientTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/transport/grpc/HiprofilerClientTest.java new file mode 100644 index 000000000..4790a6c6c --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/transport/grpc/HiprofilerClientTest.java @@ -0,0 +1,1263 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.transport.grpc; + +import io.grpc.ManagedChannel; +import io.grpc.inprocess.InProcessChannelBuilder; +import io.grpc.inprocess.InProcessServerBuilder; +import io.grpc.stub.StreamObserver; +import io.grpc.testing.GrpcCleanupRule; +import io.grpc.util.MutableHandlerRegistry; +import ohos.devtools.datasources.transport.grpc.service.CommonTypes; +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; +import ohos.devtools.datasources.transport.grpc.service.ProfilerServiceTypes; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; +import java.util.List; + +/** + * 测试Hiprofiler模块 + * + * @version 1.0 + * @date 2021/02/02 10:11 + **/ +public class HiprofilerClientTest { + private static volatile int requestId = 1; + private String IP; + private int firstPort; + private int secondPort; + private int thirPort; + private String serverName; + private final MutableHandlerRegistry serviceRegistry = new MutableHandlerRegistry(); + + /** + * grpcCleanup + */ + private final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); + + /** + * functional testing init + * + * @tc.name: setUp + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_setUp_0001 + * @tc.desc: setUp + * @tc.type: functional testing + * @tc.require: SR-005 + * @throws IOException throw IOException + */ + @Before + public void setUp() throws IOException { + IP = ""; + firstPort = 5001; + secondPort = 5002; + thirPort = 5003; + serverName = InProcessServerBuilder.generateName(); + grpcCleanup.register( + InProcessServerBuilder.forName(serverName).fallbackHandlerRegistry(serviceRegistry).directExecutor().build() + .start()); + } + + /** + * functional testing getProfilerClient normal get Single + * + * @tc.name: getProfilerClient + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_getProfilerClient_0001 + * @tc.desc: getProfilerClient + * @tc.type: functional testing + * @tc.require: SR-005 + */ + @Test + public void getProfilerClientTest01() { + ProfilerClient profierlClient = HiProfilerClient.getInstance().getProfilerClient(IP, firstPort); + Assert.assertNotNull(profierlClient); + } + + /** + * functional testing getProfilerClient normal get instance diffrent port is not equals + * + * @tc.name: getProfilerClient + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_getProfilerClient_0002 + * @tc.desc: getProfilerClient + * @tc.type: functional testing + * @tc.require: SR-005 + */ + @Test + public void getProfilerClientTest02() { + ProfilerClient profierlClientOne = HiProfilerClient.getInstance().getProfilerClient(IP, firstPort); + ProfilerClient profilerClientTWo = HiProfilerClient.getInstance().getProfilerClient(IP, secondPort); + Assert.assertNotEquals(profierlClientOne, profilerClientTWo); + } + + /** + * functional testing getProfilerClient normal get instance same port is equals + * + * @tc.name: getProfilerClient + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_getProfilerClient_0003 + * @tc.desc: getProfilerClient + * @tc.type: functional testing + * @tc.require: SR-005 + */ + @Test + public void getProfilerClientTest03() { + ProfilerClient profierlClientOne = HiProfilerClient.getInstance().getProfilerClient(IP, secondPort); + ProfilerClient profilerClientTWo = HiProfilerClient.getInstance().getProfilerClient(IP, secondPort); + Assert.assertEquals(profierlClientOne, profilerClientTWo); + } + + /** + * functional testing getProfilerClient abnormal port is -1 + * + * @tc.name: getProfilerClient + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_getProfilerClient_0004 + * @tc.desc: getProfilerClient + * @tc.type: functional testing + * @tc.require: SR-005 + */ + @Test + public void getProfilerClientTest04() { + ProfilerClient profierlClient = HiProfilerClient.getInstance().getProfilerClient(IP, -1); + Assert.assertNull(profierlClient); + } + + /** + * functional testing getProfilerClient abnormal port is 0 + * + * @tc.name: getProfilerClient + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_getProfilerClient_0005 + * @tc.desc: getProfilerClient + * @tc.type: functional testing + * @tc.require: SR-005 + */ + @Test + public void getProfilerClientTest05() { + ProfilerClient profierlClient = HiProfilerClient.getInstance().getProfilerClient(IP, 0); + Assert.assertNull(profierlClient); + } + + /** + * functional testing destroyProfiler normal + * + * @tc.name: destroyProfiler + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_destroyProfiler_0001 + * @tc.desc: destroyProfiler + * @tc.type: functional testing + * @tc.require: SR-005-AR-004 + */ + @Test + public void destroyProfilerTest01() { + ProfilerClient profierlClient = HiProfilerClient.getInstance().getProfilerClient(IP, secondPort); + Assert.assertNotNull(profierlClient); + boolean res = HiProfilerClient.getInstance().destroyProfiler(IP, secondPort); + Assert.assertTrue(res); + } + + /** + * functional testing destroyProfiler normal different port + * + * @tc.name: destroyProfiler + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_destroyProfiler_0002 + * @tc.desc: destroyProfiler + * @tc.type: functional testing + * @tc.require: SR-005-AR-004 + */ + @Test + public void destroyProfilerTest02() { + boolean res = HiProfilerClient.getInstance().destroyProfiler(IP, firstPort); + Assert.assertTrue(res); + } + + /** + * functional testing destroyProfiler abnormal port is 0 + * + * @tc.name: destroyProfiler + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_destroyProfiler_0003 + * @tc.desc: destroyProfiler + * @tc.type: functional testing + * @tc.require: SR-005-AR-004 + */ + @Test + public void destroyProfilerTest03() { + boolean res = HiProfilerClient.getInstance().destroyProfiler(IP, 0); + Assert.assertFalse(res); + } + + /** + * functional testing destroyProfiler abnormal port is 65536 + * + * @tc.name: destroyProfiler + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_destroyProfiler_0004 + * @tc.desc: destroyProfiler + * @tc.type: functional testing + * @tc.require: SR-005-AR-004 + */ + @Test + public void destroyProfilerTest04() { + boolean res = HiProfilerClient.getInstance().destroyProfiler(IP, 65536); + Assert.assertFalse(res); + } + + /** + * functional testing destroyProfiler abnormal port is -1 + * + * @tc.name: destroyProfiler + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_destroyProfiler_0005 + * @tc.desc: destroyProfiler + * @tc.type: functional testing + * @tc.require: SR-005-AR-004 + */ + @Test + public void destroyProfilerTest05() { + boolean res = HiProfilerClient.getInstance().destroyProfiler(IP, -1); + Assert.assertFalse(res); + } + + /** + * functional testing getCapabilities normal based on port and Status + * + * @tc.name: getCapabilities + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_getCapabilities_0001 + * @tc.desc: getCapabilities + * @tc.type: functional testing + * @tc.require: SR-004-AR-002 + */ + @Test + public void getCapabilitiesTest01() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void getCapabilities(ProfilerServiceTypes.GetCapabilitiesRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.ProfilerPluginCapability pluginCapability = + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder( + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder().setName("test0") + .setPath("/data/local/tmp/libmemdata.z.so").build()).build(); + ProfilerServiceTypes.GetCapabilitiesResponse reply = + ProfilerServiceTypes.GetCapabilitiesResponse.newBuilder().addCapabilities(pluginCapability) + .setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, thirPort, channel); + ProfilerServiceTypes.GetCapabilitiesResponse res = HiProfilerClient.getInstance().getCapabilities(IP, thirPort); + List caps = res.getCapabilitiesList(); + caps.forEach(profilerPluginCapability -> { + Assert.assertEquals(profilerPluginCapability.getName(), "test0"); + }); + Assert.assertEquals(caps.size(), 1); + } + + /** + * functional testing getCapabilities abnormal based on port is 0 + * + * @tc.name: getCapabilities + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_getCapabilities_0002 + * @tc.desc: getCapabilities + * @tc.type: functional testing + * @tc.require: SR-004-AR-002 + */ + @Test + public void getCapabilitiesTest02() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void getCapabilities(ProfilerServiceTypes.GetCapabilitiesRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.ProfilerPluginCapability pluginCapability = + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder( + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder().setName("test0") + .setPath("/data/local/tmp/libmemdata.z.so").build()).build(); + ProfilerServiceTypes.GetCapabilitiesResponse reply = + ProfilerServiceTypes.GetCapabilitiesResponse.newBuilder().addCapabilities(pluginCapability) + .setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 0, channel); + ProfilerServiceTypes.GetCapabilitiesResponse res = HiProfilerClient.getInstance().getCapabilities(IP, 0); + Assert.assertNull(res); + } + + /** + * functional testing getCapabilities abnormal based on port and Status is -1 + * + * @tc.name: getCapabilities + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_getCapabilities_0003 + * @tc.desc: getCapabilities + * @tc.type: functional testing + * @tc.require: SR-004-AR-002 + */ + @Test + public void getCapabilitiesTest03() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void getCapabilities(ProfilerServiceTypes.GetCapabilitiesRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.ProfilerPluginCapability pluginCapability = + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder( + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder().setName("test0") + .setPath("/data/local/tmp/libmemdata.z.so").build()).build(); + ProfilerServiceTypes.GetCapabilitiesResponse reply = + ProfilerServiceTypes.GetCapabilitiesResponse.newBuilder().addCapabilities(pluginCapability) + .setStatus(-1).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 10001, channel); + ProfilerServiceTypes.GetCapabilitiesResponse res = HiProfilerClient.getInstance().getCapabilities(IP, 10001); + Assert.assertEquals(res.getStatus(), -1); + } + + /** + * functional testing getCapabilities abnormal based on port is -1 + * + * @tc.name: getCapabilities + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_getCapabilities_0004 + * @tc.desc: getCapabilities + * @tc.type: functional testing + * @tc.require: SR-004-AR-002 + */ + @Test + public void getCapabilitiesTest04() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void getCapabilities(ProfilerServiceTypes.GetCapabilitiesRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.ProfilerPluginCapability pluginCapability = + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder( + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder().setName("test0") + .setPath("/data/local/tmp/libmemdata.z.so").build()).build(); + ProfilerServiceTypes.GetCapabilitiesResponse reply = + ProfilerServiceTypes.GetCapabilitiesResponse.newBuilder().addCapabilities(pluginCapability) + .setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, -1, channel); + ProfilerServiceTypes.GetCapabilitiesResponse res = HiProfilerClient.getInstance().getCapabilities(IP, -1); + Assert.assertNull(res); + } + + /** + * functional testing getCapabilities 2 normal based on port and Status + * + * @tc.name: getCapabilities + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_getCapabilities_0005 + * @tc.desc: getCapabilities + * @tc.type: functional testing + * @tc.require: SR-004-AR-002 + */ + @Test + public void getCapabilitiesTest05() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void getCapabilities(ProfilerServiceTypes.GetCapabilitiesRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.ProfilerPluginCapability pluginCapability = + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder( + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder() + .setName("/data/local/tmp/libbytraceplugin.z.so") + .setPath("/data/local/tmp/libbytraceplugin.z.so").build()).build(); + + ProfilerServiceTypes.ProfilerPluginCapability pluginCapabilityPtrace = + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder( + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder() + .setName("/data/local/tmp/libptrace_plugin.z.so") + .setPath("/data/local/tmp/libptrace_plugin.z.so").build()).build(); + + ProfilerServiceTypes.GetCapabilitiesResponse reply = + ProfilerServiceTypes.GetCapabilitiesResponse.newBuilder().addCapabilities(pluginCapability) + .addCapabilities(pluginCapabilityPtrace).setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 11004, channel); + ProfilerServiceTypes.GetCapabilitiesResponse res = HiProfilerClient.getInstance().getCapabilities(IP, 11004); + List caps = res.getCapabilitiesList(); + Assert.assertEquals(caps.size(), 2); + } + + /** + * functional testing requestCreateSession Normal based on reportprocesstree is true + * + * @tc.name: requestCreateSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestCreateSession_0001 + * @tc.desc: requestCreateSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-001 + */ + @Test + public void requestCreateSessionTest01() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void createSession(ProfilerServiceTypes.CreateSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.CreateSessionResponse reply = + ProfilerServiceTypes.CreateSessionResponse.getDefaultInstance(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + HiProfilerClient.getInstance().getProfilerClient(IP, 10002, channel); + int res = HiProfilerClient.getInstance() + .requestCreateSession(10002, "/data/local/tmp/libmemdata.z.so", 212, true, ""); + Assert.assertEquals(res, 0); + } + + /** + * functional testing requestCreateSession Normal based on reportprocesstree is false + * + * @tc.name: requestCreateSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestCreateSession_0002 + * @tc.desc: requestCreateSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-001 + */ + @Test + public void requestCreateSessionTest02() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void createSession(ProfilerServiceTypes.CreateSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.CreateSessionResponse reply = + ProfilerServiceTypes.CreateSessionResponse.getDefaultInstance(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + HiProfilerClient.getInstance().getProfilerClient(IP, 10002, channel); + int res = HiProfilerClient.getInstance() + .requestCreateSession(10002, "/data/local/tmp/libmemdata.z.so", 212, false, ""); + Assert.assertEquals(res, 0); + } + + /** + * functional testing requestCreateSession abNormal based on SessionId is -1 and reportprocesstree is true + * + * @tc.name: requestCreateSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestCreateSession_0003 + * @tc.desc: requestCreateSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-001 + */ + @Test + public void requestCreateSessionTest03() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void createSession(ProfilerServiceTypes.CreateSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.CreateSessionResponse reply = + ProfilerServiceTypes.CreateSessionResponse.newBuilder().setSessionId(-1).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + HiProfilerClient.getInstance().getProfilerClient(IP, 10003, channel); + int res = HiProfilerClient.getInstance() + .requestCreateSession(10003, "/data/local/tmp/libmemdata.z.so", 212, true, ""); + + Assert.assertEquals(res, -1); + } + + /** + * functional testing requestCreateSession abNormal based on port is 0 + * + * @tc.name: requestCreateSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestCreateSession_0004 + * @tc.desc: requestCreateSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-001 + */ + @Test + public void requestCreateSessionTest04() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void createSession(ProfilerServiceTypes.CreateSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.CreateSessionResponse reply = + ProfilerServiceTypes.CreateSessionResponse.newBuilder().setSessionId(1).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + HiProfilerClient.getInstance().getProfilerClient(IP, 0, channel); + int res = + HiProfilerClient.getInstance().requestCreateSession(0, "/data/local/tmp/libmemdata.z.so", 212, false, ""); + Assert.assertEquals(res, -1); + } + + /** + * functional testing requestCreateSession abNormal based on port is -1 + * + * @tc.name: requestCreateSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestCreateSession_0005 + * @tc.desc: requestCreateSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-001 + */ + @Test + public void requestCreateSessionTest05() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void createSession(ProfilerServiceTypes.CreateSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.CreateSessionResponse reply = + ProfilerServiceTypes.CreateSessionResponse.newBuilder().setSessionId(-1).setStatus(-1).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + HiProfilerClient.getInstance().getProfilerClient(IP, -1, channel); + int res = + HiProfilerClient.getInstance().requestCreateSession(-1, "/data/local/tmp/libmemdata.z.so", 212, true, ""); + Assert.assertEquals(res, -1); + } + + /** + * functional testing requestStartSession normal based on status is 0 + * + * @tc.name: requestStartSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestStartSession_0001 + * @tc.desc: requestStartSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-001 + */ + @Test + public void requestStartSessionTest01() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void startSession(ProfilerServiceTypes.StartSessionRequest request, + StreamObserver responseObserver) { + CommonTypes.ProfilerPluginState profilerPluginState = + CommonTypes.ProfilerPluginState.newBuilder().build(); + ProfilerServiceTypes.StartSessionResponse reply = + ProfilerServiceTypes.StartSessionResponse.newBuilder().setStatus(0) + .addPluginStatus(profilerPluginState).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 10003, channel); + boolean res = HiProfilerClient.getInstance().requestStartSession(IP, 10003, 1); + Assert.assertTrue(res); + } + + /** + * functional testing requestStartSession abnormal based on status is -1 + * + * @tc.name: requestStartSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestStartSession_0002 + * @tc.desc: requestStartSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-001 + */ + @Test + public void requestStartSessionTest02() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void startSession(ProfilerServiceTypes.StartSessionRequest request, + StreamObserver responseObserver) { + CommonTypes.ProfilerPluginState profilerPluginState = + CommonTypes.ProfilerPluginState.newBuilder().build(); + ProfilerServiceTypes.StartSessionResponse reply = + ProfilerServiceTypes.StartSessionResponse.newBuilder().setStatus(-1) + .addPluginStatus(profilerPluginState).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 11103, channel); + boolean res = HiProfilerClient.getInstance().requestStartSession(IP, 11103, 1); + Assert.assertFalse(res); + } + + /** + * functional testing requestStartSession normal based on status is 0 and port different + * + * @tc.name: requestStartSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestStartSession_0003 + * @tc.desc: requestStartSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-001 + */ + @Test + public void requestStartSessionTest03() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void startSession(ProfilerServiceTypes.StartSessionRequest request, + StreamObserver responseObserver) { + CommonTypes.ProfilerPluginState profilerPluginState = + CommonTypes.ProfilerPluginState.newBuilder().build(); + ProfilerServiceTypes.StartSessionResponse reply = + ProfilerServiceTypes.StartSessionResponse.newBuilder().setStatus(0) + .addPluginStatus(profilerPluginState).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 10004, channel); + boolean res = HiProfilerClient.getInstance().requestStartSession(IP, 10004, 2); + Assert.assertTrue(res); + } + + /** + * functional testing requestStartSession abnormal based on port is 0 + * + * @tc.name: requestStartSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestStartSession_0004 + * @tc.desc: requestStartSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-001 + */ + @Test + public void requestStartSessionTest04() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void startSession(ProfilerServiceTypes.StartSessionRequest request, + StreamObserver responseObserver) { + CommonTypes.ProfilerPluginState profilerPluginState = + CommonTypes.ProfilerPluginState.newBuilder().build(); + ProfilerServiceTypes.StartSessionResponse reply = + ProfilerServiceTypes.StartSessionResponse.newBuilder().setStatus(0) + .addPluginStatus(profilerPluginState).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 0, channel); + boolean res = HiProfilerClient.getInstance().requestStartSession(IP, 0, 2); + Assert.assertFalse(res); + } + + /** + * functional testing requestStartSession abnormal based on port is -1 + * + * @tc.name: requestStartSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestStartSession_0005 + * @tc.desc: requestStartSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-001 + */ + @Test + public void requestStartSessionTest05() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void startSession(ProfilerServiceTypes.StartSessionRequest request, + StreamObserver responseObserver) { + CommonTypes.ProfilerPluginState profilerPluginState = + CommonTypes.ProfilerPluginState.newBuilder().build(); + ProfilerServiceTypes.StartSessionResponse reply = + ProfilerServiceTypes.StartSessionResponse.newBuilder().setStatus(0) + .addPluginStatus(profilerPluginState).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, -1, channel); + boolean res = HiProfilerClient.getInstance().requestStartSession(IP, -1, 2); + Assert.assertFalse(res); + } + + /** + * functional testing requestStopSession normal based on status is 0 + * + * @tc.name: requestStopSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestStopSession_0001 + * @tc.desc: requestStopSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-002 + */ + @Test + public void requestStopSessionTest01() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void stopSession(ProfilerServiceTypes.StopSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.StopSessionResponse reply = + ProfilerServiceTypes.StopSessionResponse.newBuilder().setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 10004, channel); + + boolean res = HiProfilerClient.getInstance().requestStopSession(IP, 10004, 111, false); + Assert.assertTrue(res); + } + + /** + * functional testing requestStopSession normal based on status is -1 + * + * @tc.name: requestStopSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestStopSession_0002 + * @tc.desc: requestStopSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-002 + */ + @Test + public void requestStopSessionTest02() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void stopSession(ProfilerServiceTypes.StopSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.StopSessionResponse reply = + ProfilerServiceTypes.StopSessionResponse.newBuilder().setStatus(-1).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 10104, channel); + + boolean res = HiProfilerClient.getInstance().requestStopSession(IP, 10104, 111, false); + Assert.assertFalse(res); + } + + /** + * functional testing requestStopSession normal based on port + * + * @tc.name: requestStopSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestStopSession_0003 + * @tc.desc: requestStopSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-002 + */ + @Test + public void requestStopSessionTest03() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void stopSession(ProfilerServiceTypes.StopSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.StopSessionResponse reply = + ProfilerServiceTypes.StopSessionResponse.newBuilder().setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 12004, channel); + + boolean res = HiProfilerClient.getInstance().requestStopSession(IP, 12004, 111, false); + Assert.assertTrue(res); + } + + /** + * functional testing requestStopSession abnormal based on port is 0 + * + * @tc.name: requestStopSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestStopSession_0004 + * @tc.desc: requestStopSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-002 + */ + @Test + public void requestStopSessionTest04() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void stopSession(ProfilerServiceTypes.StopSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.StopSessionResponse reply = + ProfilerServiceTypes.StopSessionResponse.newBuilder().setStatus(-1).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 0, channel); + + boolean res = HiProfilerClient.getInstance().requestStopSession(IP, 0, 111, false); + Assert.assertFalse(res); + } + + /** + * functional testing requestStopSession abnormal based on port is -1 + * + * @tc.name: requestStopSession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestStopSession_0005 + * @tc.desc: requestStopSession + * @tc.type: functional testing + * @tc.require: SR-005-AR-002 + */ + @Test + public void requestStopSessionTest05() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void stopSession(ProfilerServiceTypes.StopSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.StopSessionResponse reply = + ProfilerServiceTypes.StopSessionResponse.newBuilder().setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, -1, channel); + + boolean res = HiProfilerClient.getInstance().requestStopSession(IP, -1, 111, true); + Assert.assertFalse(res); + } + + /** + * functional testing requestdestorySession normal based on status is 0 + * + * @tc.name: requestdestorySession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestdestorySession_0001 + * @tc.desc: requestdestorySession + * @tc.type: functional testing + * @tc.require: SR-005-AR-004 + */ + @Test + public void requestdestorySessionTest01() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void destroySession(ProfilerServiceTypes.DestroySessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.DestroySessionResponse reply = + ProfilerServiceTypes.DestroySessionResponse.newBuilder().setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 10005, channel); + boolean res = HiProfilerClient.getInstance().requestDestroySession(IP, 10005, 222); + Assert.assertTrue(res); + } + + /** + * functional testing requestdestorySession abnormal based on status is -1 + * + * @tc.name: requestdestorySession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestdestorySession_0002 + * @tc.desc: requestdestorySession + * @tc.type: functional testing + * @tc.require: SR-005-AR-004 + */ + @Test + public void requestdestorySessionTest02() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void destroySession(ProfilerServiceTypes.DestroySessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.DestroySessionResponse reply = + ProfilerServiceTypes.DestroySessionResponse.newBuilder().setStatus(-1).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 10006, channel); + boolean res = HiProfilerClient.getInstance().requestDestroySession(IP, 10006, 222); + Assert.assertFalse(res); + } + + /** + * functional testing requestdestorySession normal based on status is 0 and diffrent port + * + * @tc.name: requestdestorySession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestdestorySession_0003 + * @tc.desc: requestdestorySession + * @tc.type: functional testing + * @tc.require: SR-005-AR-004 + */ + @Test + public void requestdestorySessionTest03() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void destroySession(ProfilerServiceTypes.DestroySessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.DestroySessionResponse reply = + ProfilerServiceTypes.DestroySessionResponse.newBuilder().setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 10016, channel); + boolean res = HiProfilerClient.getInstance().requestDestroySession(IP, 10016, 222); + Assert.assertTrue(res); + } + + /** + * functional testing requestdestorySession abnormal based on port is 0 + * + * @tc.name: requestdestorySession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestdestorySession_0004 + * @tc.desc: requestdestorySession + * @tc.type: functional testing + * @tc.require: SR-005-AR-004 + */ + @Test + public void requestdestorySessionTest04() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void destroySession(ProfilerServiceTypes.DestroySessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.DestroySessionResponse reply = + ProfilerServiceTypes.DestroySessionResponse.newBuilder().setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 0, channel); + boolean res = HiProfilerClient.getInstance().requestDestroySession(IP, 0, 222); + Assert.assertFalse(res); + } + + /** + * functional testing requestdestorySession abnormal based on port is -1 + * + * @tc.name: requestdestorySession + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_requestdestorySession_0005 + * @tc.desc: requestdestorySession + * @tc.type: functional testing + * @tc.require: SR-005-AR-004 + */ + @Test + public void requestdestorySessionTest05() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void destroySession(ProfilerServiceTypes.DestroySessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.DestroySessionResponse reply = + ProfilerServiceTypes.DestroySessionResponse.newBuilder().setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, -1, channel); + boolean res = HiProfilerClient.getInstance().requestDestroySession(IP, -1, 222); + Assert.assertFalse(res); + } + + /** + * functional testing fetchProcessData normal Single get 3 + * + * @tc.name: fetchProcessData + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_fetchProcessData_0001 + * @tc.desc: fetchProcessData + * @tc.type: functional testing + * @tc.require: SR-005-AR-005 + */ + @Test + public void fetchProcessDataTest01() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void fetchData(ProfilerServiceTypes.FetchDataRequest request, + StreamObserver responseObserver) { + MemoryPluginResult.AppSummary sss = + MemoryPluginResult.AppSummary.newBuilder().setJavaHeap(getIntData()).setNativeHeap(getIntData()) + .setCode(getIntData()).setStack(getIntData()).setGraphics(getIntData()) + .setPrivateOther(getIntData()).setSystem(0).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoOne = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31141) + .setName("com.eg.and.AlipayGphone:push").setRssShmemKb(1).setMemsummary(sss).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoTwo = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31142).setName("com.eg.and.AlipayGphone") + .setRssShmemKb(2222222).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoThree = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31144) + .setName("com.hisunflytone.and:pushservice").setRssShmemKb(3333333).build(); + MemoryPluginResult.MemoryData aaa = + MemoryPluginResult.MemoryData.newBuilder().addProcessesinfo(processesInfoOne) + .addProcessesinfo(processesInfoTwo).addProcessesinfo(processesInfoThree).build(); + CommonTypes.ProfilerPluginData data = + CommonTypes.ProfilerPluginData.newBuilder().setName("memory-plugin").setStatus(0) + .setData(aaa.toByteString()).build(); + ProfilerServiceTypes.FetchDataResponse fetchDataResponse = + ProfilerServiceTypes.FetchDataResponse.newBuilder().setResponseId(123456789).setStatus(0) + .setHasMore(false).addPluginData(data).build(); + responseObserver.onNext(fetchDataResponse); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 10007, channel); + List res = HiProfilerClient.getInstance().fetchProcessData(IP, 10007, 11111); + Assert.assertEquals(res.size(), 3); + } + + /** + * functional testing fetchProcessData normal Repeated get 3 and 2 + * + * @tc.name: fetchProcessData + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_fetchProcessData_0002 + * @tc.desc: fetchProcessData + * @tc.type: functional testing + * @tc.require: SR-005-AR-005 + */ + @Test + public void fetchProcessDataTest02() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void fetchData(ProfilerServiceTypes.FetchDataRequest request, + StreamObserver responseObserver) { + int sessionId = request.getSessionId(); + if (sessionId == 1) { + MemoryPluginResult.AppSummary sss = + MemoryPluginResult.AppSummary.newBuilder().setJavaHeap(getIntData()).setNativeHeap(getIntData()) + .setCode(getIntData()).setStack(getIntData()).setGraphics(getIntData()) + .setPrivateOther(getIntData()).setSystem(0).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoZero = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31141) + .setName("com.eg.and.AlipayGphone:push").setRssShmemKb(1).setMemsummary(sss).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoOne = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31142) + .setName("com.eg.and.AlipayGphone").setRssShmemKb(2222222).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoTwo = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31144) + .setName("com.hisunflytone.and:pushservice").setRssShmemKb(3333333).build(); + MemoryPluginResult.MemoryData aaa = + MemoryPluginResult.MemoryData.newBuilder().addProcessesinfo(processesInfoZero) + .addProcessesinfo(processesInfoOne).addProcessesinfo(processesInfoTwo).build(); + CommonTypes.ProfilerPluginData data = + CommonTypes.ProfilerPluginData.newBuilder().setName("memory-plugin").setStatus(0) + .setData(aaa.toByteString()).build(); + ProfilerServiceTypes.FetchDataResponse fetchDataResponse = + ProfilerServiceTypes.FetchDataResponse.newBuilder().setResponseId(123456789).setStatus(0) + .setHasMore(false).addPluginData(data).build(); + responseObserver.onNext(fetchDataResponse); + responseObserver.onCompleted(); + } else { + MemoryPluginResult.AppSummary appSummary = + MemoryPluginResult.AppSummary.newBuilder().setJavaHeap(getIntData()).setNativeHeap(getIntData()) + .setCode(getIntData()).setStack(getIntData()).setGraphics(getIntData()) + .setPrivateOther(getIntData()).setSystem(0).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoZero = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31141) + .setName("com.eg.and.AlipayGphone:push").setRssShmemKb(1).setMemsummary(appSummary).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoOne = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31143) + .setName("com.eg.and.AlipayGphone").setRssShmemKb(1111).build(); + MemoryPluginResult.MemoryData aaa = + MemoryPluginResult.MemoryData.newBuilder().addProcessesinfo(processesInfoZero) + .addProcessesinfo(processesInfoOne).build(); + CommonTypes.ProfilerPluginData data = + CommonTypes.ProfilerPluginData.newBuilder().setName("memory-plugin").setStatus(0) + .setData(aaa.toByteString()).build(); + ProfilerServiceTypes.FetchDataResponse fetchDataResponse = + ProfilerServiceTypes.FetchDataResponse.newBuilder().setResponseId(222).setStatus(0) + .setHasMore(false).addPluginData(data).build(); + responseObserver.onNext(fetchDataResponse); + responseObserver.onCompleted(); + } + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 10008, channel); + List res = HiProfilerClient.getInstance().fetchProcessData(IP, 10008, 1); + Assert.assertEquals(res.size(), 3); + List ress = HiProfilerClient.getInstance().fetchProcessData(IP, 10008, 22); + Assert.assertEquals(ress.size(), 2); + } + + /** + * functional testing fetchProcessData normal get no response data base on status is 0 + * + * @tc.name: fetchProcessData + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_fetchProcessData_0003 + * @tc.desc: fetchProcessData + * @tc.type: functional testing + * @tc.require: SR-005-AR-005 + */ + @Test + public void fetchProcessDataTest03() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void fetchData(ProfilerServiceTypes.FetchDataRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.FetchDataResponse fetchDataResponse = + ProfilerServiceTypes.FetchDataResponse.newBuilder().setResponseId(123456789).setStatus(0) + .setHasMore(false).build(); + responseObserver.onNext(fetchDataResponse); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 10009, channel); + List res = HiProfilerClient.getInstance().fetchProcessData(IP, 10009, 2222); + Assert.assertEquals(res.size(), 0); + } + + /** + * functional testing fetchProcessData normal get no response data base on status is 0 + * + * @tc.name: fetchProcessData + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_fetchProcessData_0004 + * @tc.desc: fetchProcessData + * @tc.type: functional testing + * @tc.require: SR-005-AR-005 + */ + @Test + public void fetchProcessDataTest04() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void fetchData(ProfilerServiceTypes.FetchDataRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.FetchDataResponse fetchDataResponse = + ProfilerServiceTypes.FetchDataResponse.newBuilder().setResponseId(1).setStatus(-1).setHasMore(false) + .build(); + responseObserver.onNext(fetchDataResponse); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 11009, channel); + List res = HiProfilerClient.getInstance().fetchProcessData(IP, 11009, 2222); + Assert.assertEquals(res.size(), 0); + } + + /** + * functional testing fetchProcessData + * + * @tc.name: fetchProcessData + * @tc.number: OHOS_JAVA_grpc_HiProfilerClient_fetchProcessData_0005 + * @tc.desc: fetchProcessData + * @tc.type: functional testing + * @tc.require: SR-005-AR-005 + */ + @Test + public void fetchProcessDataTest05() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + @Override + public void fetchData(ProfilerServiceTypes.FetchDataRequest request, + StreamObserver responseObserver) { + MemoryPluginResult.AppSummary sss = + MemoryPluginResult.AppSummary.newBuilder().setJavaHeap(getIntData()).setNativeHeap(getIntData()) + .setCode(getIntData()).setStack(getIntData()).setGraphics(getIntData()) + .setPrivateOther(getIntData()).setSystem(0).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoZero = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(3114) + .setName("com.eg.and.AlipayGphone:push").setRssShmemKb(1).setMemsummary(sss).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoOne = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(3114).setName("com.eg.and.AlipayGphone") + .setRssShmemKb(2222).build(); + MemoryPluginResult.MemoryData aaa = + MemoryPluginResult.MemoryData.newBuilder().addProcessesinfo(processesInfoZero) + .addProcessesinfo(processesInfoOne).build(); + CommonTypes.ProfilerPluginData data = + CommonTypes.ProfilerPluginData.newBuilder().setName("memory-plugin").setStatus(0) + .setData(aaa.toByteString()).build(); + ProfilerServiceTypes.FetchDataResponse fetchDataResponse = + ProfilerServiceTypes.FetchDataResponse.newBuilder().setResponseId(12345).setStatus(-1) + .setHasMore(false).addPluginData(data).build(); + responseObserver.onNext(fetchDataResponse); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, 11007, channel); + List res = HiProfilerClient.getInstance().fetchProcessData(IP, 11007, 11111); + Assert.assertEquals(res.size(), 0); + } + + /** + * get Int Data + * + * @return int + */ + private int getIntData() { + requestId++; + if (requestId == Integer.MAX_VALUE) { + requestId = 0; + } + return requestId; + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/transport/grpc/MockProfilerServiceImplBase.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/transport/grpc/MockProfilerServiceImplBase.java new file mode 100644 index 000000000..a77c1416a --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/transport/grpc/MockProfilerServiceImplBase.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.transport.grpc; + +import ohos.devtools.datasources.transport.grpc.service.IProfilerServiceGrpc; + +/** + * @version 1.0 + * @date 2021/03/22 13:52 + **/ +public class MockProfilerServiceImplBase extends IProfilerServiceGrpc.IProfilerServiceImplBase { +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/ConstantTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/ConstantTest.java new file mode 100644 index 000000000..b2e3f08d9 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/ConstantTest.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common; + +import org.junit.Assert; +import org.junit.Test; + +/** + * @Description ConstantTest + * @Date 2021/4/3 20:47 + **/ +public class ConstantTest { + /** + * functional testing init + * + * @tc.name: constant test + * @tc.number: OHOS_JAVA_utils_Constant_0001 + * @tc.desc: constant test + * @tc.type: functional testing + * @tc.require: SR-010 + */ + @Test + public void test01() { + Long abnormal = Constant.ABNORMAL; + int normalStatus = Constant.NORMAL_STATUS; + int fileImportScene = Constant.FILE_IMPORT_SCENE; + String memoryPlug = Constant.MEMORY_PLUG; + String cpuPlugName = Constant.CPU_PLUG_NAME; + String destPath = Constant.DEST_PATH; + String deviceSataStatPushed = Constant.DEVICE_SATA_STAT_PUSHED; + String deviceStatClosed = Constant.DEVICE_STAT_CLOSED; + String deviceStatError = Constant.DEVICE_STAT_ERROR; + String deviceStatFail = Constant.DEVICE_STAT_FAIL; + String deviceStatNotFound = Constant.DEVICE_STAT_NOT_FOUND; + String deviceStatOffline = Constant.DEVICE_STAT_OFFLINE; + String deviceStatOnline = Constant.DEVICE_STAT_ONLINE; + String deviceStstUnauthorized = Constant.DEVICE_STST_UNAUTHORIZED; + String fileName = Constant.FILE_NAME; + String fileSuffix = Constant.FILE_SUFFIX; + String targetPlugPath = Constant.TARGET_PLUG_PATH; + String sourceFilepath = Constant.SOURCE_FILEPATH; + int realtimeScene = Constant.REALTIME_SCENE; + int radix = Constant.RADIX; + Assert.assertNotNull(radix); + Assert.assertNotNull(realtimeScene); + Assert.assertNotNull(sourceFilepath); + Assert.assertNotNull(targetPlugPath); + Assert.assertNotNull(fileSuffix); + Assert.assertNotNull(fileName); + Assert.assertNotNull(deviceStstUnauthorized); + Assert.assertNotNull(deviceStatOnline); + Assert.assertNotNull(deviceStatOffline); + Assert.assertNotNull(deviceStatNotFound); + Assert.assertNotNull(deviceStatFail); + Assert.assertNotNull(deviceStatError); + Assert.assertNotNull(deviceStatClosed); + Assert.assertNotNull(deviceSataStatPushed); + Assert.assertNotNull(destPath); + Assert.assertNotNull(cpuPlugName); + Assert.assertNotNull(abnormal); + Assert.assertNotNull(normalStatus); + Assert.assertNotNull(fileImportScene); + Assert.assertNotNull(memoryPlug); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/BeanUtilTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/BeanUtilTest.java new file mode 100644 index 000000000..ffed8b51e --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/BeanUtilTest.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common.util; + +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.List; +import java.util.Map; + +/** + * @Description BeanUtilTest + * @Date 2021/4/8 13:15 + **/ +public class BeanUtilTest { + /** + * DeviceIPPortInfo + */ + private DeviceIPPortInfo deviceIPPortInfo; + + /** + * serializes + */ + private byte[] serializes; + + /** + * functional testing init + * + * @tc.name: init + * @tc.number: OHOS_JAVA_common_BeanUtil_init_0001 + * @tc.desc: init + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Before + public void init() { + deviceIPPortInfo = new DeviceIPPortInfo(); + deviceIPPortInfo.setPort(1); + deviceIPPortInfo.setIp(""); + deviceIPPortInfo.setDeviceName(""); + deviceIPPortInfo.setDeviceID(""); + deviceIPPortInfo.setDeviceType(""); + serializes = BeanUtil.serialize(deviceIPPortInfo); + } + + /** + * functional testing serialize + * + * @tc.name: serialize + * @tc.number: OHOS_JAVA_common_BeanUtil_serialize_0001 + * @tc.desc: serialize + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testserialize() { + byte[] serialize = BeanUtil.serialize(deviceIPPortInfo); + Assert.assertNotNull(serialize); + } + + /** + * functional testing deserialize + * + * @tc.name: deserialize + * @tc.number: OHOS_JAVA_common_BeanUtil_deserialize_0001 + * @tc.desc: deserialize + * @tc.type: functional testing + * @tc.require: AR000FK61M + */ + @Test + public void testdeserialize() { + Object obj = new BeanUtil().deserialize(serializes); + Assert.assertNotNull(obj); + } + + /** + * functional testing getFiledsInfo + * + * @tc.name: getFiledsInfo + * @tc.number: OHOS_JAVA_common_BeanUtil_getFiledsInfo_0001 + * @tc.desc: getFiledsInfo + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetFiledsInfo() { + List fieldsInfo = BeanUtil.getFieldsInfo(deviceIPPortInfo); + Assert.assertNotNull(fieldsInfo); + } + + /** + * functional testing getFileds + * + * @tc.name: getFileds + * @tc.number: OHOS_JAVA_common_BeanUtil_getFileds_0001 + * @tc.desc: getFileds + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetFiled() { + List> fields = BeanUtil.getFields(deviceIPPortInfo); + Assert.assertNotNull(fields); + } + + /** + * functional testing getFiledsInfo + * + * @tc.name: getFiledsInfo + * @tc.number: OHOS_JAVA_common_BeanUtil_getFiledsInfo_0001 + * @tc.desc: getFiledsInfo + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetFiledsInfos() { + Map fieldsInfoInfos = BeanUtil.getFiledsInfos(deviceIPPortInfo); + Assert.assertNotNull(fieldsInfoInfos); + } + + /** + * functional testing getObjectAttributeNames + * + * @tc.name: getObjectAttributeNames + * @tc.number: OHOS_JAVA_common_BeanUtil_getObjectAttributeNames_0001 + * @tc.desc: getObjectAttributeNames + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetObjectAttributeNames() { + List objectAttributeNames = BeanUtil.getObjectAttributeNames(deviceIPPortInfo); + Assert.assertNotNull(objectAttributeNames); + } + + /** + * functional testing getObjectValue + * + * @tc.name: getObjectValue + * @tc.number: OHOS_JAVA_common_BeanUtil_getObjectValue_0001 + * @tc.desc: getObjectValue + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetObjectValue() { + List objectValue = BeanUtil.getObjectValue(deviceIPPortInfo); + Assert.assertNotNull(objectValue); + } + + /** + * functional testing getObjectName + * + * @tc.name: getObjectName + * @tc.number: OHOS_JAVA_common_BeanUtil_getObjectName_0001 + * @tc.desc: getObjectName + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetObjectName() { + String objectName = BeanUtil.getObjectName(deviceIPPortInfo); + Assert.assertNotNull(objectName); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/CharsetUtilTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/CharsetUtilTest.java new file mode 100644 index 000000000..481a5a641 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/CharsetUtilTest.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common.util; + +import org.junit.Assert; +import org.junit.Test; + +import java.nio.charset.Charset; + +/** + * CharsetUtilTest测试类 + * + * @version 1.0 + * @date 2021/04/08 16:42 + **/ +public class CharsetUtilTest { + /** + * GBK + */ + private String GBK = "GBK"; + + /** + * UTF-8 + */ + private String UTF_8 = "UTF-8"; + + /** + * functional testing parse + * + * @tc.name: parse + * @tc.number: OHOS_JAVA_common_CharsetUtil_parse_0001 + * @tc.desc: 解析字符串编码为Charset对象,解析失败返回系统默认编码 + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void parseTest() { + Charset charset = CharsetUtil.parse(UTF_8); + Assert.assertNotNull(charset); + } + + /** + * functional testing parse + * + * @tc.name: parse + * @tc.number: OHOS_JAVA_common_CharsetUtil_parse_0002 + * @tc.desc: 解析字符串编码为Charset对象,解析失败返回系统默认编码 + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void parseTest01() { + Charset charset = CharsetUtil.parse(UTF_8, Charset.forName(GBK)); + Assert.assertNotNull(charset); + } + + /** + * functional testing convert + * + * @tc.name: convert + * @tc.number: OHOS_JAVA_common_CharsetUtil_convert_0001 + * @tc.desc: 转换字符串的字符集编码 + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void convertTest() { + String str = CharsetUtil.convert("convertTest", GBK, UTF_8); + Assert.assertNotNull(str); + } + + /** + * functional testing convert + * + * @tc.name: convert + * @tc.number: OHOS_JAVA_common_CharsetUtil_convert_0002 + * @tc.desc: 转换字符串的字符集编码 + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void convertTest01() { + String str = CharsetUtil.convert("convertTest", Charset.forName(GBK), Charset.forName(UTF_8)); + Assert.assertNotNull(str); + } + + /** + * functional testing defaultCharsetName + * + * @tc.name: defaultCharsetName + * @tc.number: OHOS_JAVA_common_CharsetUtil_defaultCharsetName_0001 + * @tc.desc: 系统默认Charset + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void defaultCharsetNameTest() { + String str = CharsetUtil.defaultCharsetName(); + Assert.assertNotNull(str); + } + + /** + * functional testing defaultCharset + * + * @tc.name: defaultCharset + * @tc.number: OHOS_JAVA_common_CharsetUtil_defaultCharset_0001 + * @tc.desc: 系统默认Charset + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void defaultCharsetTest() { + Charset charset = CharsetUtil.defaultCharset(); + Assert.assertNotNull(charset); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/CommonUtilTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/CommonUtilTest.java new file mode 100644 index 000000000..c7ff5de3c --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/CommonUtilTest.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common.util; + +import ohos.devtools.views.common.LayoutConstants; +import org.junit.Assert; +import org.junit.Test; + +/** + * @Description CommonUtilTest + * @Date 2021/4/9 13:15 + **/ +public class CommonUtilTest { + /** + * functional testing collectionSize + * + * @tc.name: collectionSize + * @tc.number: OHOS_JAVA_common_CommonUtil_collectionSize_0001 + * @tc.desc: collectionSize + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testcollectionSizeOne() { + int num = CommonUtil.collectionSize(0); + Assert.assertEquals(num, LayoutConstants.SIXTEEN); + } + + /** + * functional testing collectionSize + * + * @tc.name: collectionSize + * @tc.number: OHOS_JAVA_common_CommonUtil_collectionSize_0002 + * @tc.desc: collectionSize + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testcollectionSizeTwo() { + int num = CommonUtil.collectionSize(1); + Assert.assertNotNull(num); + } + + /** + * functional testing getRequestId + * + * @tc.name: getRequestId + * @tc.number: OHOS_JAVA_common_CommonUtil_getRequestId_0001 + * @tc.desc: getRequestId + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetRequestId() { + int num = CommonUtil.getRequestId(); + Assert.assertNotNull(num); + } + + /** + * functional testing generateSessionName + * + * @tc.name: generateSessionName + * @tc.number: OHOS_JAVA_common_CommonUtil_generateSessionName_0001 + * @tc.desc: generateSessionName + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgenerateSessionName() { + String sessionName = CommonUtil.generateSessionName("", 1); + Assert.assertNotNull(sessionName); + } + + /** + * functional testing getLocalSessionId + * + * @tc.name: getLocalSessionId + * @tc.number: OHOS_JAVA_common_CommonUtil_getLocalSessionId_0001 + * @tc.desc: getLocalSessionId + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetLocalSessionId() { + long num = CommonUtil.getLocalSessionId(); + Assert.assertNotNull(num); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/DateTimeUtilTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/DateTimeUtilTest.java new file mode 100644 index 000000000..91bd70c30 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/DateTimeUtilTest.java @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common.util; + +import org.junit.Assert; +import org.junit.Test; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +/** + * @Description DateTimeUtilTest + * @Date 2021/2/7 15:00 + **/ +public class DateTimeUtilTest { + /** + * yyyy-MM-dd HH:mm:ss + */ + private static DateTimeFormatter COMMON_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + + /** + * functional testing dateToString + * + * @tc.name: dateToString + * @tc.number: OHOS_JAVA_common_DateTimeUtil_dateToString_0001 + * @tc.desc: dateToString + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void dateToStringTest() { + String str = DateTimeUtil.dateToString(LocalDateTime.now()); + Assert.assertNotNull(str); + } + + /** + * functional testing stringToDate + * + * @tc.name: stringToDate + * @tc.number: OHOS_JAVA_common_DateTimeUtil_stringToDate_0001 + * @tc.desc: stringToDate + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void stringToDateTest() { + LocalDateTime localDateTime = DateTimeUtil.stringToDate("2021-04-09 10:14:48"); + Assert.assertNotNull(localDateTime); + } + + /** + * functional testing getNowTime + * + * @tc.name: getNowTime + * @tc.number: OHOS_JAVA_common_DateTimeUtil_getNowTime_0001 + * @tc.desc: getNowTime + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void getNowTimeTest() { + LocalDateTime localDateTime = DateTimeUtil.getNowTime(); + Assert.assertNotNull(localDateTime); + } + + /** + * functional testing dateToString + * + * @tc.name: dateToString + * @tc.number: OHOS_JAVA_common_DateTimeUtil_dateToString_0001 + * @tc.desc: dateToString + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testDateToString() { + String str = DateTimeUtil.dateToString(LocalDateTime.now(), COMMON_FORMATTER); + Assert.assertNotNull(str); + } + + /** + * functional testing stringToDate + * + * @tc.name: stringToDate + * @tc.number: OHOS_JAVA_common_DateTimeUtil_stringToDate_0001 + * @tc.desc: stringToDate + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testStringToDate() { + LocalDateTime localDateTime = DateTimeUtil.stringToDate("2021-04-09 10:14:48", COMMON_FORMATTER); + Assert.assertNotNull(localDateTime); + } + + /** + * functional testing dateToTimeMillis + * + * @tc.name: dateToTimeMillis + * @tc.number: OHOS_JAVA_common_DateTimeUtil_dateToTimeMillis_0001 + * @tc.desc: dateToTimeMillis + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void dateToTimeMillisTest() { + long timeMillis = DateTimeUtil.dateToTimeMillis(LocalDateTime.now()); + Assert.assertNotNull(timeMillis); + } + + /** + * functional testing timeMillisToDate + * + * @tc.name: timeMillisToDate + * @tc.number: OHOS_JAVA_common_DateTimeUtil_timeMillisToDate_0001 + * @tc.desc: timeMillisToDate + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void timeMillisToDateTest() { + LocalDateTime localDateTime = DateTimeUtil.timeMillisToDate(System.currentTimeMillis()); + Assert.assertNotNull(localDateTime); + } + + /** + * functional testing getNowTimeString + * + * @tc.name: getNowTimeString + * @tc.number: OHOS_JAVA_common_DateTimeUtil_getNowTimeString_0001 + * @tc.desc: getNowTimeString + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void getNowTimeStringTest() { + String str = DateTimeUtil.getNowTimeString("yyyy-MM-dd HH:mm:ss"); + Assert.assertNotNull(str); + } + + /** + * functional testing getNowTimeLong + * + * @tc.name: getNowTimeLong + * @tc.number: OHOS_JAVA_common_DateTimeUtil_getNowTimeLong_0001 + * @tc.desc: getNowTimeLong + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void getNowTimeLongTest() { + Long timeLong = DateTimeUtil.getNowTimeLong(); + Assert.assertNotNull(timeLong); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/FileSafeUtilsTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/FileSafeUtilsTest.java new file mode 100644 index 000000000..b53a3639e --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/common/util/FileSafeUtilsTest.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.common.util; + +import ohos.devtools.datasources.utils.session.service.SessionManager; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.io.File; + +/** + * FileSafeUtilsTest + * + * @version 1.0 + * @date 2021/04/06 13:18 + **/ +public class FileSafeUtilsTest { + private String filepath; + + private String sha; + + private File file; + + /** + * functional testing setFile + * + * @tc.name: setFile + * @tc.number: OHOS_JAVA_common_FileSafeUtils_setFile_0001 + * @tc.desc: setFile + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Before + public void setFile() { + filepath = SessionManager.getInstance().getPluginPath() + "libmemdataplugin.z.so"; + sha = "SHA-256"; + file = new File(filepath); + } + + /** + * functional testing getFileSha + * + * @tc.name: getFileSha + * @tc.number: OHOS_JAVA_common_FileSafeUtils_getFileSha_0001 + * @tc.desc: getFileSha + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void getFileSha01() { + String fileSha = FileSafeUtils.getFileSha(file, sha); + Assert.assertNotNull(fileSha); + } + + /** + * functional testing getFileSha + * + * @tc.name: getFileSha + * @tc.number: OHOS_JAVA_common_FileSafeUtils_getFileSha_0002 + * @tc.desc: getFileSha + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void getFileSha02() { + String fileSha = FileSafeUtils.getFileSha(file, null); + Assert.assertNotNull(fileSha); + } + + /** + * functional testing getFileSha + * + * @tc.name: getFileSha + * @tc.number: OHOS_JAVA_common_FileSafeUtils_getFileSha_0003 + * @tc.desc: getFileSha + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void getFileSha03() { + String fileSha = FileSafeUtils.getFileSha(null, sha); + Assert.assertNotNull(fileSha); + } + + /** + * functional testing getFileSha + * + * @tc.name: getFileSha + * @tc.number: OHOS_JAVA_common_FileSafeUtils_getFileSha_0004 + * @tc.desc: getFileSha + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void getFileSha04() { + String fileSha01 = FileSafeUtils.getFileSha(file, sha); + String fileSha02 = FileSafeUtils.getFileSha(file, sha); + Assert.assertEquals(fileSha01, fileSha02); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/datahandler/datapoller/DataPollerTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/datahandler/datapoller/DataPollerTest.java new file mode 100644 index 000000000..36aefd0df --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/datahandler/datapoller/DataPollerTest.java @@ -0,0 +1,234 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.datahandler.datapoller; + +import com.alibaba.fastjson.JSONObject; +import io.grpc.ManagedChannel; +import io.grpc.inprocess.InProcessChannelBuilder; +import io.grpc.inprocess.InProcessServerBuilder; +import io.grpc.stub.StreamObserver; +import io.grpc.testing.GrpcCleanupRule; +import io.grpc.util.MutableHandlerRegistry; +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.databases.datatable.MemoryTable; +import ohos.devtools.datasources.transport.grpc.HiProfilerClient; +import ohos.devtools.datasources.transport.grpc.MockProfilerServiceImplBase; +import ohos.devtools.datasources.transport.grpc.ProfilerClient; +import ohos.devtools.datasources.transport.grpc.service.CommonTypes; +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; +import ohos.devtools.datasources.transport.grpc.service.ProfilerServiceTypes; +import ohos.devtools.datasources.utils.common.Constant; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; +import java.util.HashMap; + +import static ohos.devtools.datasources.utils.common.Constant.MEMORY_PLUG; + +/** + * DataPollerTest + * + * @Description DataPollerTest + * @Date 2021/4/3 15:02 + **/ +public class DataPollerTest { + /** + * requestId + */ + private static volatile Integer requestId = 1; + + /** + * grpcCleanup + */ + public GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); + + /** + * serverName + */ + private String serverName; + + /** + * SessionManager + */ + private SessionManager session; + + /** + * DeviceIPPortInfo + */ + private DeviceIPPortInfo device; + + /** + * ProcessInfo + */ + private ProcessInfo process; + + /** + * JSONObject + */ + private JSONObject jsonObject; + + private MutableHandlerRegistry serviceRegistry = new MutableHandlerRegistry(); + + /** + * init + * + * @throws IOException IOException + */ + @Before + public void init() throws IOException { + session = SessionManager.getInstance(); + session.setDevelopMode(true); + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + jsonObject = new JSONObject(); + JSONObject memoryObject = new JSONObject(); + memoryObject.put("Select All", true); + memoryObject.put("Java", true); + memoryObject.put("Native", true); + memoryObject.put("Graphics", true); + memoryObject.put("Stack", true); + memoryObject.put("Code", true); + memoryObject.put("Others", true); + jsonObject.put("Memory", memoryObject); + device = new DeviceIPPortInfo(); + device.setIp(""); + device.setPort(11007); + device.setForwardPort(11007); + process = new ProcessInfo(); + process.setProcessId(111); + process.setProcessName("process"); + serverName = InProcessServerBuilder.generateName(); + grpcCleanup.register( + InProcessServerBuilder.forName(serverName).fallbackHandlerRegistry(serviceRegistry).directExecutor().build() + .start()); + } + + /** + * functional testing dataPoller + * + * @tc.name: dataPoller + * @tc.number: OHOS_JAVA_utils_DataPoller_dataPoller_0001 + * @tc.desc: dataPoller + * @tc.type: functional testing + * @tc.require: SR000FK61J + */ + @Test + public void dataPollerTest() { + MockProfilerServiceImplBase getFeatureImpl = new MockProfilerServiceImplBase() { + /** + * init createSession + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void createSession(ProfilerServiceTypes.CreateSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.CreateSessionResponse reply = + ProfilerServiceTypes.CreateSessionResponse.newBuilder().setSessionId(1).setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init getCapabilities + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void getCapabilities(ProfilerServiceTypes.GetCapabilitiesRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.ProfilerPluginCapability pluginCapability = + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder( + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder() + .setName("/data/local/tmp/libmemdataplugin.z.so") + .setPath("/data/local/tmp/libmemdataplugin.z.so").build()).build(); + ProfilerServiceTypes.GetCapabilitiesResponse reply = + ProfilerServiceTypes.GetCapabilitiesResponse.newBuilder().addCapabilities(pluginCapability) + .setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init fetchData + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void fetchData(ProfilerServiceTypes.FetchDataRequest request, + StreamObserver responseObserver) { + MemoryPluginResult.AppSummary sss = + MemoryPluginResult.AppSummary.newBuilder().setJavaHeap(getIntData()).setNativeHeap(getIntData()) + .setCode(getIntData()).setStack(getIntData()).setGraphics(getIntData()) + .setPrivateOther(getIntData()).setSystem(0).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoOne = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31141) + .setName("com.eg.and.AlipayGphone:push").setRssShmemKb(1).setMemsummary(sss).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoTwo = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31142).setName("com.eg.and.AlipayGphone") + .setRssShmemKb(2222222).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoThree = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31144) + .setName("com.hisunflytone.and:pushservice").setRssShmemKb(3333333).build(); + MemoryPluginResult.MemoryData aaa = + MemoryPluginResult.MemoryData.newBuilder().addProcessesinfo(processesInfoOne) + .addProcessesinfo(processesInfoTwo).addProcessesinfo(processesInfoThree).build(); + CommonTypes.ProfilerPluginData data = + CommonTypes.ProfilerPluginData.newBuilder().setName("memory-plugin").setStatus(0) + .setData(aaa.toByteString()).build(); + ProfilerServiceTypes.FetchDataResponse fetchDataResponse = + ProfilerServiceTypes.FetchDataResponse.newBuilder().setResponseId(123456789).setStatus(0) + .setHasMore(false).addPluginData(data).build(); + responseObserver.onNext(fetchDataResponse); + responseObserver.onCompleted(); + } + }; + ManagedChannel channel = + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + SessionManager.getInstance(); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient("", 11007, channel); + long num = session.createSession(device, process, Constant.REALTIME_SCENE, jsonObject); + HashMap map = new HashMap(); + map.put(MEMORY_PLUG, new MemoryTable()); + DataPoller dataPoller = new DataPoller(num, 111, client, map); + dataPoller.run(); + Assert.assertNotNull(dataPoller); + } + + /** + * get Int Data + * + * @return int + */ + private int getIntData() { + requestId++; + if (requestId == Integer.MAX_VALUE) { + requestId = 0; + } + return requestId; + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/datahandler/datapoller/MemoryDataConsumerTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/datahandler/datapoller/MemoryDataConsumerTest.java new file mode 100644 index 000000000..9992369f6 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/datahandler/datapoller/MemoryDataConsumerTest.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.datahandler.datapoller; + +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.databases.datatable.MemoryTable; +import ohos.devtools.services.memory.ClassInfoDao; +import ohos.devtools.services.memory.MemoryHeapDao; +import ohos.devtools.services.memory.MemoryInstanceDao; +import ohos.devtools.services.memory.MemoryInstanceDetailsDao; +import org.junit.Before; +import org.junit.Test; +import java.util.HashMap; +import java.util.Queue; +import java.util.concurrent.LinkedBlockingQueue; +import static ohos.devtools.datasources.utils.common.Constant.JVMTI_AGENT_PLUG; +import static ohos.devtools.datasources.utils.common.Constant.MEMORY_PLUG; + +/** + * @Description MemoryDataConsumerTest + * @Date 2021/4/23 15:02 + **/ +public class MemoryDataConsumerTest { + private long localSessionId; + private int sessionId; + private Queue queue; + private MemoryTable memoryTable; + + /** + * functional testing init + * + * @tc.name: Memory initialization configuration + * @tc.number: OHOS_JAVA_datahandler_MemoryDataConsumer_init_0001 + * @tc.desc: Memory initialization configuration + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Before + public void init() { + this.localSessionId = 3274894L; + this.sessionId = 3247; + queue = new LinkedBlockingQueue(); + HashMap tableService = new HashMap<>(); + tableService.put(MEMORY_PLUG, new MemoryTable()); + tableService.put(JVMTI_AGENT_PLUG, new ClassInfoDao()); + tableService.put("jvmtiagentDetails", new MemoryInstanceDetailsDao()); + tableService.put("jvmtiagentInstance", new MemoryInstanceDao()); + tableService.put("jvmtiagentMemoryHeap", new MemoryHeapDao()); + if (tableService.get(MEMORY_PLUG) instanceof MemoryTable) { + memoryTable = (MemoryTable) tableService.get(MEMORY_PLUG); + } + } + + /** + * functional testing MemoryDataConsumer + * + * @tc.name: MemoryDataConsumer + * @tc.number: OHOS_JAVA_datahandler_MemoryDataConsumer_constructor_0001 + * @tc.desc: MemoryDataConsumer + * @tc.type: functional testing + * @tc.require: SR000FK61J + */ + @Test + public void handleMemoryDataTest() { + MemoryDataConsumer consumer = new MemoryDataConsumer(queue, memoryTable, sessionId, localSessionId); + consumer.start(); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/datahandler/datapoller/MemoryHeapDataConsumerTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/datahandler/datapoller/MemoryHeapDataConsumerTest.java new file mode 100644 index 000000000..379e802a9 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/datahandler/datapoller/MemoryHeapDataConsumerTest.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.datahandler.datapoller; + +import ohos.devtools.datasources.databases.databasepool.AbstractDataStore; +import ohos.devtools.datasources.databases.datatable.MemoryTable; +import ohos.devtools.datasources.utils.common.util.DateTimeUtil; +import ohos.devtools.services.memory.ClassInfoDao; +import ohos.devtools.services.memory.MemoryHeapDao; +import ohos.devtools.services.memory.MemoryInstanceDao; +import ohos.devtools.services.memory.MemoryInstanceDetailsDao; +import org.junit.Before; +import org.junit.Test; + +import java.util.HashMap; +import java.util.Queue; +import java.util.concurrent.LinkedBlockingQueue; + +import static ohos.devtools.datasources.utils.common.Constant.JVMTI_AGENT_PLUG; +import static ohos.devtools.datasources.utils.common.Constant.MEMORY_PLUG; + +/** + * @Description MemoryHeapDataConsumerTest + * @Date 2021/4/23 15:02 + **/ +public class MemoryHeapDataConsumerTest { + private long localSessionId; + private Queue queue; + private ClassInfoDao classInfoDao; + private MemoryInstanceDetailsDao memoryInstanceDetailsDao; + private MemoryInstanceDao memoryInstanceDao; + private MemoryHeapDao memoryHeapDao; + private Long countTime; + + /** + * functional testing init + * + * @tc.name: MemoryHeapData initialization configuration + * @tc.number: OHOS_JAVA_datahandler_MemoryHeapHandle_init_0001 + * @tc.desc: MemoryHeapData initialization configuration + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Before + public void init() { + this.localSessionId = 3274894L; + queue = new LinkedBlockingQueue(); + HashMap tableService = new HashMap<>(); + tableService.put(MEMORY_PLUG, new MemoryTable()); + tableService.put(JVMTI_AGENT_PLUG, new ClassInfoDao()); + tableService.put("jvmtiagentDetails", new MemoryInstanceDetailsDao()); + tableService.put("jvmtiagentInstance", new MemoryInstanceDao()); + tableService.put("jvmtiagentMemoryHeap", new MemoryHeapDao()); + if (tableService.get(JVMTI_AGENT_PLUG) instanceof ClassInfoDao) { + classInfoDao = (ClassInfoDao) tableService.get(JVMTI_AGENT_PLUG); + } + if (tableService.get("jvmtiagentDetails") instanceof MemoryInstanceDetailsDao) { + memoryInstanceDetailsDao = (MemoryInstanceDetailsDao) tableService.get("jvmtiagentDetails"); + } + if (tableService.get("jvmtiagentInstance") instanceof MemoryInstanceDao) { + memoryInstanceDao = (MemoryInstanceDao) tableService.get("jvmtiagentInstance"); + } + + if (tableService.get("jvmtiagentMemoryHeap") instanceof MemoryHeapDao) { + memoryHeapDao = (MemoryHeapDao) tableService.get("jvmtiagentMemoryHeap"); + } + countTime = DateTimeUtil.getNowTimeLong(); + } + + /** + * functional testing MemoryHeapHandle + * + * @tc.name: MemoryHeapHandle + * @tc.number: OHOS_JAVA_datahandler_MemoryHeapHandle_constructor_0001 + * @tc.desc: MemoryHeapHandle + * @tc.type: functional testing + * @tc.require: SR000FK61J + */ + @Test + public void handleMemoryHeapHandleTest() { + MemoryHeapDataConsumer memoryHeapDataConsumer = + new MemoryHeapDataConsumer(queue, localSessionId, classInfoDao, memoryInstanceDetailsDao, memoryInstanceDao, + memoryHeapDao); + memoryHeapDataConsumer.start(); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/datahandler/timesync/DeviceTimeStampSnapshootTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/datahandler/timesync/DeviceTimeStampSnapshootTest.java new file mode 100644 index 000000000..62df7977c --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/datahandler/timesync/DeviceTimeStampSnapshootTest.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.datahandler.timesync; + +/** + * @Description DeviceTimeStampSnapshootTest + * @Date 2021/4/3 17:44 + **/ +public class DeviceTimeStampSnapshootTest { +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/entity/DeviceProcessInfoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/entity/DeviceProcessInfoTest.java new file mode 100644 index 000000000..cb4b531c5 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/entity/DeviceProcessInfoTest.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.entity; + +import org.junit.Assert; +import org.junit.Test; + +/** + * @Description DeviceProcessInfoTest + * @Date 2021/4/3 19:50 + **/ +public class DeviceProcessInfoTest { + /** + * functional testing init + * + * @tc.name: DeviceProcessInfo initialization configuration + * @tc.number: OHOS_JAVA_device_DeviceProcessInfo_init_0001 + * @tc.desc: DeviceProcessInfo initialization configuration + * @tc.type: functional testing + * @tc.require: SR-004-AR-001 + */ + @Test + public void getTraceFileInfo() { + DeviceProcessInfo deviceProcessInfo = new DeviceProcessInfo(); + deviceProcessInfo.setDeviceName("test"); + deviceProcessInfo.setDeviceType("test"); + deviceProcessInfo.setProcessName("test"); + deviceProcessInfo.setEndTime(23472L); + deviceProcessInfo.setLocalSessionId(24367L); + deviceProcessInfo.setStartTime(24379L); + deviceProcessInfo.getDeviceName(); + deviceProcessInfo.getDeviceType(); + deviceProcessInfo.getProcessName(); + deviceProcessInfo.getEndTime(); + deviceProcessInfo.getLocalSessionId(); + deviceProcessInfo.getStartTime(); + Assert.assertNotNull(deviceProcessInfo); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/entity/TraceFileInfoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/entity/TraceFileInfoTest.java new file mode 100644 index 000000000..87f4b594c --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/entity/TraceFileInfoTest.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.entity; + +import org.junit.Assert; +import org.junit.Test; + +/** + * @Description TraceFileInfoTest + * @Date 2021/4/3 19:46 + **/ +public class TraceFileInfoTest { + /** + * functional testing TraceFileInfo initialization configuration + * + * @tc.name: TraceFileInfo initialization configuration + * @tc.number: OHOS_JAVA_device_TraceFileInfo_init_0001 + * @tc.desc: TraceFileInfo initialization configuration + * @tc.type: functional testing + * @tc.require: SR-011 + */ + @Test + public void getTraceFileInfo() { + TraceFileInfo traceFileInfo = new TraceFileInfo(); + traceFileInfo.setCreateTime(2342L); + traceFileInfo.setRecordNum(73829L); + traceFileInfo.setVersion("test"); + traceFileInfo.getCreateTime(); + traceFileInfo.getRecordNum(); + traceFileInfo.getVersion(); + Assert.assertNotNull(traceFileInfo); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/service/DeviceForwardPortTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/service/DeviceForwardPortTest.java new file mode 100644 index 000000000..6e3bcb425 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/service/DeviceForwardPortTest.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.service; + +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * @Description 设备转发端口类 + * @Date 2021/4/9 19:02 + **/ +public class DeviceForwardPortTest { + /** + * DeviceForwardPort + */ + private DeviceForwardPort deviceForwardPort; + + /** + * DeviceIPPortInfo类 + */ + private DeviceIPPortInfo deviceIPPortInfo; + + /** + * functional testing init + * + * @tc.name: DeviceForwardPort initialization configuration + * @tc.number: OHOS_JAVA_device_DeviceForwardPort_init_0001 + * @tc.desc: DeviceForwardPort initialization configuration + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Before + public void initObj() { + deviceForwardPort = DeviceForwardPort.getInstance(); + deviceIPPortInfo = new DeviceIPPortInfo(); + deviceIPPortInfo.setIp(""); + deviceIPPortInfo.setPort(5001); + } + + /** + * functional testing getInstance + * + * @tc.name: getInstance + * @tc.number: OHOS_JAVA_device_DeviceForwardPort_getInstance_0001 + * @tc.desc: getInstance + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void getInstanceTest() { + DeviceForwardPort deviceForwardPorts = DeviceForwardPort.getInstance(); + Assert.assertNotNull(deviceForwardPorts); + } + + /** + * functional testing setDeviceIPPortInfo + * + * @tc.name: setDeviceIPPortInfo + * @tc.number: OHOS_JAVA_device_DeviceForwardPort_setDeviceIPPortInfo_0001 + * @tc.desc: setDeviceIPPortInfo + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void setDeviceIPPortInfoTest() { + DeviceIPPortInfo deviceIPPortInfoNew = deviceForwardPort.setDeviceIPPortInfo(deviceIPPortInfo); + Assert.assertNotNull(deviceIPPortInfoNew); + } + + /** + * functional testing configuration + * + * @tc.name: DeviceForwardPort initialization configuration + * @tc.number: OHOS_JAVA_device_DeviceForwardPort_getForwardPort_0001 + * @tc.desc: DeviceForwardPort initialization configuration + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void getForwardPortTest() { + int anInt = deviceForwardPort.getForwardPort(); + Assert.assertNotNull(anInt); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/service/DeviceGrpcThreadTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/service/DeviceGrpcThreadTest.java new file mode 100644 index 000000000..cc6f8330a --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/service/DeviceGrpcThreadTest.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.service; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; +import org.apache.logging.log4j.Level; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * DeviceGrpcThreadTest + * + * @version 1.0 + * @date 2021/04/05 17:12 + **/ +public class DeviceGrpcThreadTest { + private DeviceGrpcThread deviceGrpcThread; + private DeviceIPPortInfo deviceIPPortInfo; + + /** + * functional testing getDeviceGrpcThread + * + * @tc.name: getDeviceGrpcThread + * @tc.number: OHOS_JAVA_device_DeviceGrpcThread_getDeviceGrpcThread_0001 + * @tc.desc: getDeviceGrpcThread + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Before + public void getDeviceGrpcThread() { + ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + deviceIPPortInfo = new DeviceIPPortInfo(); + deviceIPPortInfo.setPort(1); + deviceIPPortInfo.setIp(""); + deviceIPPortInfo.setDeviceName(""); + deviceIPPortInfo.setDeviceID(""); + deviceIPPortInfo.setDeviceType(""); + deviceGrpcThread = new DeviceGrpcThread(deviceIPPortInfo); + } + + /** + * functional testing run + * + * @tc.name: DeviceGrpcThread run + * @tc.number: OHOS_JAVA_device_DeviceGrpcThread_run_0001 + * @tc.desc: DeviceGrpcThread run + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void run() { + deviceGrpcThread.run(); + Assert.assertTrue(true); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/service/DeviceInstallThreadTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/service/DeviceInstallThreadTest.java new file mode 100644 index 000000000..781fab41c --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/service/DeviceInstallThreadTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.service; + +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import org.junit.Before; + +/** + * DeviceInstallThreadTest + * + * @version 1.0 + * @date 2021/04/09 11:30 + **/ +public class DeviceInstallThreadTest { + /** + * DeviceIPPortInfo类 + */ + private DeviceIPPortInfo deviceIPPortInfo; + + /** + * functional testing init + * + * @tc.name: DeviceIPPortInfo initialization configuration + * @tc.number: OHOS_JAVA_device_DeviceIPPortInfo_init_0001 + * @tc.desc: DeviceIPPortInfo initialization configuration + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Before + public void initObj() { + deviceIPPortInfo = new DeviceIPPortInfo(); + deviceIPPortInfo.setIp(""); + deviceIPPortInfo.setPort(5001); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/service/MultiDeviceManagerTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/service/MultiDeviceManagerTest.java new file mode 100644 index 000000000..dbfea4eb6 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/device/service/MultiDeviceManagerTest.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.device.service; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.device.entity.DeviceInfo; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +/** + * 多设备管理测试类 + * + * @version 1.0 + * @date 2021/2/2 19:02 + **/ +public class MultiDeviceManagerTest { + private String serialNumber; + + /** + * functional testing init + * + * @tc.name: MultiDeviceManager setup + * @tc.number: OHOS_JAVA_device_MultiDeviceManager_init_0001 + * @tc.desc: MultiDeviceManager setup + * @tc.type: functional testing + * @tc.require: SR-004-AR-002 + */ + @Before + public void setUp() { + serialNumber = "emulator-5554"; + DataBaseApi.getInstance().initDataSourceManager(); + MultiDeviceManager.getInstance().run(); + } + + /** + * functional testing pushDevToolsShell + * + * @tc.name: pushDevToolsShell + * @tc.number: OHOS_JAVA_device_MultiDeviceManager_pushDevToolsShell_0001 + * @tc.desc: pushDevToolsShell + * @tc.type: functional testing + * @tc.require: SR-004-AR-002 + */ + @Test + public void pushHiprofilerCliTest1() { + boolean cli = MultiDeviceManager.getInstance().pushDevToolsShell(serialNumber); + Assert.assertTrue(cli); + } + + /** + * functional testing pushDevToolsShell + * + * @tc.name: pushDevToolsShell + * @tc.number: OHOS_JAVA_device_MultiDeviceManager_pushDevToolsShell_0002 + * @tc.desc: pushDevToolsShell + * @tc.type: functional testing + * @tc.require: SR-004-AR-002 + */ + @Test + public void pushHiprofilerCliTest2() { + boolean cli = MultiDeviceManager.getInstance().pushDevToolsShell(serialNumber); + Assert.assertTrue(cli); + } + + /** + * functional testing getDeviceIPPort + * + * @tc.name: getDeviceIPPort + * @tc.number: OHOS_JAVA_device_MultiDeviceManager_getDeviceIPPort_0001 + * @tc.desc: getDeviceIPPort + * @tc.type: functional testing + * @tc.require: SR-004-AR-002 + */ + @Test + public void getDeviceIPPortTest() { + ArrayList> deviceIPPortList = MultiDeviceManager.getInstance().getDeviceIPPort(serialNumber); + Assert.assertNotNull(deviceIPPortList); + } + + /** + * functional testing getDevicesInfo + * + * @tc.name: getDevicesInfo + * @tc.number: OHOS_JAVA_device_MultiDeviceManager_getDevicesInfo_0001 + * @tc.desc: getDevicesInfo + * @tc.type: functional testing + * @tc.require: SR-004-AR-002 + */ + @Test + public void getDevicesInfoTest() { + List devicesInfo = MultiDeviceManager.getInstance().getDevicesInfo(); + Assert.assertNotNull(devicesInfo); + } + + /** + * functional testing getAllDeviceIPPortInfos + * + * @tc.name: getAllDeviceIPPortInfos + * @tc.number: OHOS_JAVA_device_MultiDeviceManager_getAllDeviceIPPortInfos_0001 + * @tc.desc: getAllDeviceIPPortInfos + * @tc.type: functional testing + * @tc.require: SR-004-AR-002 + */ + @Test + public void getAllDeviceIPPortInfosTest() { + List list = MultiDeviceManager.getInstance().getAllDeviceIPPortInfos(); + Assert.assertNotNull(list); + } + + /** + * functional testing getInstance + * + * @tc.name: getInstance + * @tc.number: OHOS_JAVA_device_MultiDeviceManager_getInstance_0001 + * @tc.desc: getInstance + * @tc.type: functional testing + * @tc.require: SR-004-AR-002 + */ + @Test + public void getInstanceTest() { + MultiDeviceManager multiDeviceManager = MultiDeviceManager.getInstance(); + Assert.assertNotNull(multiDeviceManager); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/monitorconfig/dao/MonitorConfigDaoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/monitorconfig/dao/MonitorConfigDaoTest.java new file mode 100644 index 000000000..76b82e95f --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/monitorconfig/dao/MonitorConfigDaoTest.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.monitorconfig.dao; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.monitorconfig.entity.MonitorInfo; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +/** + * 监控项配置数据的dao层测试类 + * + * @version 1.0 + * @date 2021/04/12 14:13 + **/ +public class MonitorConfigDaoTest { + private MonitorConfigDao monitorConfigDao; + + /** + * init + */ + @Before + public void init() { + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + } + + /** + * functional testing getInstance + * + * @tc.name: MonitorConfigDao initialization configuration + * @tc.number: OHOS_JAVA_monitor_MonitorConfigDao_getInstance_0001 + * @tc.desc: MonitorConfigDao getInstance + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void getInstanceTest() { + monitorConfigDao = MonitorConfigDao.getInstance(); + Assert.assertNotNull(monitorConfigDao); + } + + /** + * functional testing insertMonitorInfo + * + * @tc.name: MonitorConfigDao insertMonitorInfo + * @tc.number: OHOS_JAVA_monitor_MonitorConfigDao_insertMonitorInfo_0001 + * @tc.desc: MonitorConfigDao insertMonitorInfo + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void testInsert() { + MonitorInfo monitorInfo = + MonitorInfo.builder().monitorType("type").localSessionId(1L).parameter("name").value("value").build(); + monitorConfigDao = MonitorConfigDao.getInstance(); + boolean flag = monitorConfigDao.insertMonitorInfo(monitorInfo); + Assert.assertTrue(flag); + } + + /** + * functional testing insertMonitorInfos + * + * @tc.name: MonitorConfigDao insertMonitorInfos + * @tc.number: OHOS_JAVA_monitor_MonitorConfigDao_insertMonitorInfos_0001 + * @tc.desc: MonitorConfigDao insertMonitorInfos + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void testInsertList() { + List list = new ArrayList<>(); + MonitorInfo monitorInfo = + MonitorInfo.builder().monitorType("type").localSessionId(1L).parameter("name").value("value").build(); + list.add(monitorInfo); + monitorConfigDao = MonitorConfigDao.getInstance(); + boolean flag = monitorConfigDao.insertMonitorInfos(list); + Assert.assertTrue(flag); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/monitorconfig/entity/MonitorInfoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/monitorconfig/entity/MonitorInfoTest.java new file mode 100644 index 000000000..b4f5c038f --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/monitorconfig/entity/MonitorInfoTest.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.monitorconfig.entity; + +import org.junit.Assert; +import org.junit.Test; + +/** + * MonitorInfoTest + * + * @version 1.0 + * @date 2021/04/14 10:52 + **/ +public class MonitorInfoTest { + private Long sessionId = 0L; + + /** + * functional testing set localSessionId + * + * @tc.name: MonitorInfo localSessionId + * @tc.number: OHOS_JAVA_monitor_MonitorInfo_localSessionId_0001 + * @tc.desc: MonitorInfo localSessionId + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void localSessionIdTest() { + MonitorInfo.Builder builder = MonitorInfo.builder().localSessionId(sessionId); + Assert.assertNotNull(builder); + } + + /** + * functional testing set monitorType + * + * @tc.name: MonitorInfo monitorType + * @tc.number: OHOS_JAVA_monitor_MonitorInfo_monitorType_0001 + * @tc.desc: MonitorInfo monitorType + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void monitorTypeTest() { + MonitorInfo.Builder builder = MonitorInfo.builder().monitorType(""); + Assert.assertNotNull(builder); + } + + /** + * functional testing set parameter + * + * @tc.name: MonitorInfo parameter + * @tc.number: OHOS_JAVA_monitor_MonitorInfo_parameter_0001 + * @tc.desc: MonitorInfo parameter + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void parameterTest() { + MonitorInfo.Builder builder = MonitorInfo.builder().parameter(""); + Assert.assertNotNull(builder); + } + + /** + * functional testing set value + * + * @tc.name: MonitorInfo value + * @tc.number: OHOS_JAVA_monitor_MonitorInfo_value_0001 + * @tc.desc: MonitorInfo value + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void valueTest() { + MonitorInfo.Builder builder = MonitorInfo.builder().value(""); + Assert.assertNotNull(builder); + } + + /** + * functional testing set build + * + * @tc.name: MonitorInfo build + * @tc.number: OHOS_JAVA_monitor_MonitorInfo_build_0001 + * @tc.desc: MonitorInfo build + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void buildTest() { + MonitorInfo monitorInfo = MonitorInfo.builder().build(); + Assert.assertNotNull(monitorInfo); + } + + /** + * functional testing equals + * + * @tc.name: MonitorInfo equals + * @tc.number: OHOS_JAVA_monitor_MonitorInfo_equals_0001 + * @tc.desc: MonitorInfo equals + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void equalsTest() { + boolean flag = MonitorInfo.builder().build().equals(Object.class); + Assert.assertFalse(flag); + } + + /** + * functional testing toString + * + * @tc.name: MonitorInfo toString + * @tc.number: OHOS_JAVA_monitor_MonitorInfo_toString_0001 + * @tc.desc: MonitorInfo toString + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void toStringTest() { + String str = MonitorInfo.builder().build().toString(); + Assert.assertNotNull(str); + } + + /** + * functional testing hashCode + * + * @tc.name: MonitorInfo hashCode + * @tc.number: OHOS_JAVA_monitor_MonitorInfo_hashCode_0001 + * @tc.desc: MonitorInfo hashCode + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void hashCodeTest() { + int number = MonitorInfo.builder().build().hashCode(); + Assert.assertNotNull(number); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/monitorconfig/service/MonitorConfigManagerTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/monitorconfig/service/MonitorConfigManagerTest.java new file mode 100644 index 000000000..ad5f2aafc --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/monitorconfig/service/MonitorConfigManagerTest.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.monitorconfig.service; + +import com.alibaba.fastjson.JSONObject; +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.monitorconfig.entity.MonitorInfo; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.LinkedList; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * MonitorConfigManagerTest + * + * @version 1.0 + * @date 2021/03/31 10:10 + **/ +public class MonitorConfigManagerTest { + private long localSessionId = 0; + private JSONObject jsonObject; + private DeviceIPPortInfo device; + private ProcessInfo processInfo; + private MonitorConfigManager monitorConfigManager; + private LinkedList monitorInfo; + + /** + * functional testing setAnalyzeJson + * + * @tc.name: MonitorConfigManager setAnalyzeJson + * @tc.number: OHOS_JAVA_monitor_MonitorConfigManager_setAnalyzeJson_0001 + * @tc.desc: MonitorConfigManager setAnalyzeJson + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Before + public void setAnalyzeJson() { + SessionManager.getInstance().setDevelopMode(true); + localSessionId = 1000L; + jsonObject = new JSONObject(); + JSONObject memoryObject = new JSONObject(); + memoryObject.put("Select All", true); + memoryObject.put("Java", true); + memoryObject.put("Native", true); + memoryObject.put("Graphics", true); + memoryObject.put("Stack", true); + memoryObject.put("Code", true); + memoryObject.put("Others", true); + JSONObject cPUObject = new JSONObject(); + cPUObject.put("Select All1", true); + cPUObject.put("System Memory1", true); + cPUObject.put("Gpu Memory1", true); + cPUObject.put("BandWidth1", true); + jsonObject.put("Memory", memoryObject); + jsonObject.put("CPU", cPUObject); + device = new DeviceIPPortInfo(); + device.setIp(""); + device.setForwardPort(5001); + processInfo = new ProcessInfo(); + processInfo.setProcessId(1); + processInfo.setProcessName("process"); + monitorConfigManager = MonitorConfigManager.getInstance(); + DataBaseApi.getInstance().initDataSourceManager(); + ConcurrentHashMap>> dataMap = monitorConfigManager.dataMap; + } + + /** + * functional testing getInstance + * + * @tc.name: MonitorConfigManager getInstance + * @tc.number: OHOS_JAVA_monitor_MonitorConfigManager_getInstance_0001 + * @tc.desc: MonitorConfigManager getInstance + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void getInstance01() { + MonitorConfigManager configManager = MonitorConfigManager.getInstance(); + Assert.assertNotNull(configManager); + } + + /** + * functional testing getInstance + * + * @tc.name: MonitorConfigManager getInstance + * @tc.number: OHOS_JAVA_monitor_MonitorConfigManager_getInstance_0002 + * @tc.desc: MonitorConfigManager getInstance + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void getInstance02() { + MonitorConfigManager configManager01 = MonitorConfigManager.getInstance(); + MonitorConfigManager configManager02 = MonitorConfigManager.getInstance(); + Assert.assertEquals(configManager01, configManager02); + } + + /** + * functional testing analyzeCharTarget + * + * @tc.name: MonitorConfigManager analyzeCharTarget + * @tc.number: OHOS_JAVA_monitor_MonitorConfigManager_analyzeCharTarget_0001 + * @tc.desc: MonitorConfigManager analyzeCharTarget + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void analyzeCharTargetTest1() { + Map> stringLinkedListMap = + MonitorConfigManager.getInstance().analyzeCharTarget(localSessionId, jsonObject); + Assert.assertNotNull(stringLinkedListMap); + } + + /** + * functional testing analyzeCharTarget + * + * @tc.name: MonitorConfigManager analyzeCharTarget + * @tc.number: OHOS_JAVA_monitor_MonitorConfigManager_analyzeCharTarget_0002 + * @tc.desc: MonitorConfigManager analyzeCharTarget + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void analyzeCharTargetTest3() { + Map> stringLinkedListMap = + MonitorConfigManager.getInstance().analyzeCharTarget(localSessionId, jsonObject); + Map> stringLinkedListMap1 = + MonitorConfigManager.getInstance().analyzeCharTarget(localSessionId, jsonObject); + Assert.assertEquals(stringLinkedListMap, stringLinkedListMap1); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/plugin/dao/PlugDaoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/plugin/dao/PlugDaoTest.java new file mode 100644 index 000000000..0bf32eb3a --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/plugin/dao/PlugDaoTest.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.plugin.dao; + +import ohos.devtools.datasources.utils.plugin.entity.HiProfilerPlugin; +import org.junit.Assert; +import org.junit.Test; + +import java.util.List; + +/** + * 插件dao层(与sqlite交互)测试类 + * + * @version 1.0 + * @date 2021/04/12 11:11 + **/ +public class PlugDaoTest { + /** + * functional testing getInstance + * + * @tc.name: PlugDao getInstance + * @tc.number: OHOS_JAVA_plugin_PlugDao_getInstance_0001 + * @tc.desc: PlugDao getInstance + * @tc.type: functional testing + * @tc.require: AR000FK5SH + */ + @Test + public void getInstanceTest() { + PlugDao plugDao = PlugDao.getInstance(); + Assert.assertNotNull(plugDao); + } + + /** + * functional testing selectPlugConfig + * + * @tc.name: PlugDao selectPlugConfig + * @tc.number: OHOS_JAVA_plugin_PlugDao_selectPlugConfig_0001 + * @tc.desc: PlugDao selectPlugConfig + * @tc.type: functional testing + * @tc.require: AR000FK5SH + */ + @Test + public void selectPlugConfigTest() { + List list = null; + list = PlugDao.getInstance().selectPlugConfig("1"); + if (list != null) { + Assert.assertTrue(true); + } + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/plugin/service/PlugManagerTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/plugin/service/PlugManagerTest.java new file mode 100644 index 000000000..6b2da0cec --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/plugin/service/PlugManagerTest.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.plugin.service; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.plugin.entity.HiProfilerPlugin; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.List; + +/** + * PlugManagerTest + * + * @version 1.0 + * @date 2021/03/31 10:10 + **/ +public class PlugManagerTest { + private DeviceIPPortInfo deviceInfo; + + /** + * functional testing init + * + * @tc.name: PlugManager init + * @tc.number: OHOS_JAVA_plugin_PlugManager_init_0001 + * @tc.desc: PlugManager init + * @tc.type: functional testing + * @tc.require: AR000FK5SH + */ + @Before + public void setDeviceInfo() { + SessionManager.getInstance().setDevelopMode(true); + String serialNumber = "emulator-5554"; + deviceInfo = new DeviceIPPortInfo(); + deviceInfo.setDeviceID(serialNumber); + DataBaseApi.getInstance().initDataSourceManager(); + } + + /** + * functional testing getInstance + * + * @tc.name: PlugManager getInstance + * @tc.number: OHOS_JAVA_plugin_PlugManager_getInstance_0001 + * @tc.desc: PlugManager getInstance + * @tc.type: functional testing + * @tc.require: AR000FK5SH + */ + @Test + public void getInstance01() { + PlugManager plugManager = PlugManager.getInstance(); + Assert.assertNotNull(plugManager); + } + + /** + * functional testing getInstance + * + * @tc.name: PlugManager getInstance + * @tc.number: OHOS_JAVA_plugin_PlugManager_getInstance_0002 + * @tc.desc: PlugManager getInstance + * @tc.type: functional testing + * @tc.require: AR000FK5SH + */ + @Test + public void getInstance02() { + PlugManager plugManager01 = PlugManager.getInstance(); + PlugManager plugManager02 = PlugManager.getInstance(); + Assert.assertEquals(plugManager01, plugManager02); + } + + /** + * functional testing insertPlugInfo + * + * @tc.name: PlugManager insertPlugInfo + * @tc.number: OHOS_JAVA_plugin_PlugManager_insertPlugInfo_0001 + * @tc.desc: PlugManager insertPlugInfo + * @tc.type: functional testing + * @tc.require: AR000FK5SH + */ + @Test + public void insertPlugInfoTest() { + HiProfilerPlugin hiProfilerPlugin = + HiProfilerPlugin.builder().deviceId("dsf").version("dsfaf").sampleInterval(3).plugSha256("dshfjka") + .status(1).id(3).name("tst").build(); + hiProfilerPlugin.setPath("C:\\ohoslibmemdataplugin.z.so"); + hiProfilerPlugin.toString(); + PlugManager.getInstance().insertPlugInfo(hiProfilerPlugin); + } + + /** + * functional testing selectPlugConfig + * + * @tc.name: PlugManager selectPlugConfig + * @tc.number: OHOS_JAVA_plugin_PlugManager_selectPlugConfig_0001 + * @tc.desc: PlugManager selectPlugConfig + * @tc.type: functional testing + * @tc.require: AR000FK5SH + */ + @Test + public void selectPlugConfigTest() { + List list = PlugManager.getInstance().selectPlugConfig(deviceInfo.getDeviceID()); + Assert.assertNotNull(list); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/process/service/ProcessManagerTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/process/service/ProcessManagerTest.java new file mode 100644 index 000000000..4e65e0755 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/process/service/ProcessManagerTest.java @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.process.service; + +import io.grpc.ManagedChannel; +import io.grpc.inprocess.InProcessChannelBuilder; +import io.grpc.inprocess.InProcessServerBuilder; +import io.grpc.stub.StreamObserver; +import io.grpc.testing.GrpcCleanupRule; +import io.grpc.util.MutableHandlerRegistry; +import ohos.devtools.datasources.transport.grpc.service.CommonTypes; +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; +import ohos.devtools.datasources.transport.grpc.service.ProfilerServiceTypes; +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.transport.grpc.HiProfilerClient; +import ohos.devtools.datasources.transport.grpc.MockProfilerServiceImplBase; +import ohos.devtools.datasources.transport.grpc.ProfilerClient; +import ohos.devtools.datasources.utils.device.dao.DeviceUtil; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.device.entity.DeviceInfo; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import org.apache.logging.log4j.Level; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; +import java.util.List; + +/** + * process Unit Test + * + * @version 1.0 + * @date 2021/02/25 14:22 + **/ +public class ProcessManagerTest { + private static volatile Integer requestId = 1; + private ProcessInfo processInfo; + private String processName; + private DeviceInfo deviceInfo; + private DeviceIPPortInfo deviceIPPortInfo; + private String deviceId; + private String serverName; + private String IP; + private int firstPort; + private MockProfilerServiceImplBase getFeatureImpl; + private ManagedChannel channel; + private final MutableHandlerRegistry serviceRegistry = new MutableHandlerRegistry(); + + /** + * grpcCleanup + */ + private final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); + + /** + * functional testing init + * + * @tc.name: ProcessManager init + * @tc.number: OHOS_JAVA_process_ProcessManager_init_0001 + * @tc.desc: ProcessManager init + * @tc.type: functional testing + * @tc.require: SR-004 + * @throws IOException throw IOException + */ + @Before + public void initObj() throws IOException { + SessionManager.getInstance().setDevelopMode(true); + // 应用初始化 Step1 初始化数据中心 + ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + deviceInfo = new DeviceInfo(); + deviceInfo.setDeviceID("1"); + deviceInfo.setDeviceName("华为p40"); + deviceInfo.setRamInfo("zz"); + deviceInfo.setRomInfo("vv"); + deviceIPPortInfo = new DeviceIPPortInfo(); + deviceIPPortInfo.setIp(""); + deviceIPPortInfo.setDeviceID("1"); + deviceIPPortInfo.setPort(5001); + deviceIPPortInfo.setForwardPort(5001); + deviceIPPortInfo.setDeviceName(""); + deviceIPPortInfo.setDeviceType(""); + deviceId = "1"; + processInfo = new ProcessInfo(); + processInfo.setDeviceId("1"); + processInfo.setProcessId(1); + processInfo.setProcessName("com.go.maps"); + processName = "goo"; + IP = ""; + firstPort = 5001; + serverName = InProcessServerBuilder.generateName(); + getFeatureImpl = new MockProfilerServiceImplBase() { + /** + * init getCapabilities + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void getCapabilities(ProfilerServiceTypes.GetCapabilitiesRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.ProfilerPluginCapability pluginCapability = + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder( + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder().setName("test0") + .setPath("/data/local/tmp/libmemdata.z.so").build()).build(); + ProfilerServiceTypes.GetCapabilitiesResponse reply = + ProfilerServiceTypes.GetCapabilitiesResponse.newBuilder().addCapabilities(pluginCapability) + .setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init createSession + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void createSession(ProfilerServiceTypes.CreateSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.CreateSessionResponse reply = + ProfilerServiceTypes.CreateSessionResponse.newBuilder().setSessionId(1).setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init startSession + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void startSession(ProfilerServiceTypes.StartSessionRequest request, + StreamObserver responseObserver) { + CommonTypes.ProfilerPluginState profilerPluginState = + CommonTypes.ProfilerPluginState.newBuilder().build(); + ProfilerServiceTypes.StartSessionResponse reply = + ProfilerServiceTypes.StartSessionResponse.newBuilder().setStatus(0) + .addPluginStatus(profilerPluginState).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init fetchData + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void fetchData(ProfilerServiceTypes.FetchDataRequest request, + StreamObserver responseObserver) { + MemoryPluginResult.AppSummary sss = + MemoryPluginResult.AppSummary.newBuilder().setJavaHeap(getIntData()).setNativeHeap(getIntData()) + .setCode(getIntData()).setStack(getIntData()).setGraphics(getIntData()) + .setPrivateOther(getIntData()).setSystem(0).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoZero = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31141).setName("rcu_gp").setRssShmemKb(1) + .setMemsummary(sss).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoOne = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31142).setName("rcu_bh") + .setRssShmemKb(2222222).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoTwo = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31144).setName("netns") + .setRssShmemKb(3333333).build(); + MemoryPluginResult.MemoryData aaa = + MemoryPluginResult.MemoryData.newBuilder().addProcessesinfo(processesInfoZero) + .addProcessesinfo(processesInfoOne).addProcessesinfo(processesInfoTwo).build(); + CommonTypes.ProfilerPluginData data = + CommonTypes.ProfilerPluginData.newBuilder().setName("memory-plugin").setStatus(0) + .setData(aaa.toByteString()).build(); + ProfilerServiceTypes.FetchDataResponse fetchDataResponse = + ProfilerServiceTypes.FetchDataResponse.newBuilder().setResponseId(123456789).setStatus(0) + .setHasMore(false).addPluginData(data).build(); + responseObserver.onNext(fetchDataResponse); + responseObserver.onCompleted(); + } + + /** + * init stopSession + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void stopSession(ProfilerServiceTypes.StopSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.StopSessionResponse reply = + ProfilerServiceTypes.StopSessionResponse.newBuilder().build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init destroySession + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void destroySession(ProfilerServiceTypes.DestroySessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.DestroySessionResponse reply = + ProfilerServiceTypes.DestroySessionResponse.newBuilder().setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + }; + grpcCleanup.register( + InProcessServerBuilder.forName(serverName).fallbackHandlerRegistry(serviceRegistry).directExecutor().build() + .start()); + channel = grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + } + + /** + * functional testing getInstance + * + * @tc.name: ProcessManager getInstance + * @tc.number: OHOS_JAVA_process_ProcessManager_getInstance_0001 + * @tc.desc: ProcessManager getInstance + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void getProcessManager01() { + ProcessManager processManager = ProcessManager.getInstance(); + Assert.assertNotNull(processManager); + } + + /** + * functional testing getInstance + * + * @tc.name: ProcessManager getInstance + * @tc.number: OHOS_JAVA_process_ProcessManager_getInstance_0002 + * @tc.desc: ProcessManager getInstance + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void getProcessManager02() { + ProcessManager processManagerOne = ProcessManager.getInstance(); + ProcessManager processManagerTwo = ProcessManager.getInstance(); + Assert.assertEquals(processManagerOne, processManagerTwo); + } + + /** + * functional testing getProcessList + * + * @tc.name: ProcessManager getProcessList + * @tc.number: OHOS_JAVA_process_ProcessManager_getProcessList_0001 + * @tc.desc: ProcessManager getProcessList + * @tc.type: functional testing + * @tc.require: SR-004-AR-003 + */ + @Test + public void getProcessList() { + List processList = ProcessManager.getInstance().getProcessList(null); + int size = processList.size(); + Assert.assertEquals(0, size); + } + + /** + * functional testing getProcessList + * + * @tc.name: ProcessManager getProcessList + * @tc.number: OHOS_JAVA_process_ProcessManager_getProcessList_0002 + * @tc.desc: ProcessManager getProcessList + * @tc.type: functional testing + * @tc.require: SR-004-AR-003 + */ + @Test + public void getProcessList1() { + new DeviceUtil().insertDeviceIPPortInfo(deviceIPPortInfo); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient(IP, firstPort, channel); + List processList = ProcessManager.getInstance().getProcessList(deviceIPPortInfo); + int size = processList.size(); + Assert.assertEquals(0, size); + } + + private int getIntData() { + requestId++; + if (requestId == Integer.MAX_VALUE) { + requestId = 0; + } + return requestId; + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/process/service/entity/ProcessInfoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/process/service/entity/ProcessInfoTest.java new file mode 100644 index 000000000..88f3af580 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/process/service/entity/ProcessInfoTest.java @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.process.service.entity; + +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * 进程实体测试类 + * + * @version 1.0 + * @date 2021/04/09 15:14 + **/ +public class ProcessInfoTest { + /** + * ProcessInfo类 + */ + private ProcessInfo processInfo; + + /** + * functional testing init + * + * @tc.name: ProcessInfo init + * @tc.number: OHOS_JAVA_process_ProcessInfo_init_0001 + * @tc.desc: ProcessInfo init + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Before + public void initObj() { + processInfo = new ProcessInfo(); + } + + /** + * functional testing getDeviceId + * + * @tc.name: ProcessInfo getDeviceId + * @tc.number: OHOS_JAVA_process_ProcessInfo_getDeviceId_0001 + * @tc.desc: ProcessInfo getDeviceId + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void getDeviceIdTest() { + try { + if (new ProcessInfo().getDeviceId() != null) { + Assert.assertTrue(true); + } + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing getProcessId + * + * @tc.name: ProcessInfo getProcessId + * @tc.number: OHOS_JAVA_process_ProcessInfo_getProcessId_0001 + * @tc.desc: ProcessInfo getProcessId + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void getProcessIdTest() { + try { + if (new ProcessInfo().getProcessId() != null) { + Assert.assertTrue(true); + } + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing getProcessName + * + * @tc.name: ProcessInfo getProcessName + * @tc.number: OHOS_JAVA_process_ProcessInfo_getProcessName_0001 + * @tc.desc: ProcessInfo getProcessName + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void getProcessNameTest() { + try { + if (new ProcessInfo().getProcessName() != null) { + Assert.assertTrue(true); + } + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing getState + * + * @tc.name: ProcessInfo getState + * @tc.number: OHOS_JAVA_process_ProcessInfo_getState_0001 + * @tc.desc: ProcessInfo getState + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void getStateTest() { + try { + if (new ProcessInfo().getState() != null) { + Assert.assertTrue(true); + } + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing getStartTime + * + * @tc.name: ProcessInfo getStartTime + * @tc.number: OHOS_JAVA_process_ProcessInfo_getStartTime_0001 + * @tc.desc: ProcessInfo getStartTime + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void getStartTimeTest() { + try { + if (new ProcessInfo().getStartTime() != null) { + Assert.assertTrue(true); + } + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing getArch + * + * @tc.name: ProcessInfo getArch + * @tc.number: OHOS_JAVA_process_ProcessInfo_getArch_0001 + * @tc.desc: ProcessInfo getArch + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void getArchTest() { + try { + if (new ProcessInfo().getArch() != null) { + Assert.assertTrue(true); + } + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing getAgentStatus + * + * @tc.name: ProcessInfo getAgentStatus + * @tc.number: OHOS_JAVA_process_ProcessInfo_getAgentStatus_0001 + * @tc.desc: ProcessInfo getAgentStatus + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void getAgentStatusTest() { + try { + if (new ProcessInfo().getAgentStatus() != null) { + Assert.assertTrue(true); + } + } catch (Exception exception) { + Assert.assertTrue(false); + } + } + + /** + * functional testing toString + * + * @tc.name: ProcessInfo toString + * @tc.number: OHOS_JAVA_process_ProcessInfo_toString_0001 + * @tc.desc: ProcessInfo toString + * @tc.type: functional testing + * @tc.require: SR-004 + */ + @Test + public void toStringTest() { + try { + if (new ProcessInfo().toString() != null) { + Assert.assertTrue(true); + } + } catch (Exception exception) { + Assert.assertTrue(false); + } + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/profilerlog/ProfilerLogManagerTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/profilerlog/ProfilerLogManagerTest.java new file mode 100644 index 000000000..bcd77c764 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/profilerlog/ProfilerLogManagerTest.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.profilerlog; + +import org.apache.logging.log4j.Level; +import org.junit.Assert; +import org.junit.Test; + +/** + * @version 1.0 + * @date 2021/03/27 15:34 + **/ +public class ProfilerLogManagerTest { + /** + * functional testing updateLogLevel + * + * @tc.name: ProfilerLogManager updateLogLevel + * @tc.number: OHOS_JAVA_profiler_ProfilerLogManager_updateLogLevel_0001 + * @tc.desc: ProfilerLogManager updateLogLevel + * @tc.type: functional testing + * @tc.require: SR-005 + */ + @Test + public void updateLogLevelTest01() { + boolean res = false; + try { + res = ProfilerLogManager.getSingleton().updateLogLevel(null); + Assert.assertFalse(res); + } catch (Exception exception) { + Assert.assertFalse(res); + } + } + + /** + * functional testing updateLogLevel + * + * @tc.name: ProfilerLogManager updateLogLevel + * @tc.number: OHOS_JAVA_profiler_ProfilerLogManager_updateLogLevel_0002 + * @tc.desc: ProfilerLogManager updateLogLevel + * @tc.type: functional testing + * @tc.require: SR-005 + */ + @Test + public void updateLogLevelTest02() { + boolean res = false; + try { + res = ProfilerLogManager.getSingleton().updateLogLevel(Level.OFF); + Assert.assertTrue(res); + } catch (Exception exception) { + Assert.assertTrue(res); + } + } + + /** + * functional testing updateLogLevel + * + * @tc.name: ProfilerLogManager updateLogLevel + * @tc.number: OHOS_JAVA_profiler_ProfilerLogManager_updateLogLevel_0003 + * @tc.desc: ProfilerLogManager updateLogLevel + * @tc.type: functional testing + * @tc.require: SR-005 + */ + @Test + public void updateLogLevelTest03() { + boolean res = false; + try { + res = ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + Assert.assertTrue(res); + } catch (Exception exception) { + Assert.assertTrue(res); + } + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/quartzmanager/QuartzManagerTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/quartzmanager/QuartzManagerTest.java new file mode 100644 index 000000000..e9c895232 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/quartzmanager/QuartzManagerTest.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.quartzmanager; + +import org.junit.Assert; +import org.junit.Test; + +/** + * 定时任务管理类 + * + * @version 1.0 + * @date 2021/04/12 10:29 + **/ +public class QuartzManagerTest { + /** + * functional testing getInstance + * + * @tc.name: QuartzManager getInstance + * @tc.number: OHOS_JAVA_quartz_QuartzManager_getInstance_0001 + * @tc.desc: QuartzManager getInstance + * @tc.type: functional testing + * @tc.require: SR-011 + */ + @Test + public void getInstanceTest() { + QuartzManager quartzManager = QuartzManager.getInstance(); + Assert.assertNotNull(quartzManager); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/session/entity/SessionInfoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/session/entity/SessionInfoTest.java new file mode 100644 index 000000000..a817b74dc --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/session/entity/SessionInfoTest.java @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.session.entity; + +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * SessionInfoTest测试类 + * + * @version 1.0 + * @date 2021/04/09 14:06 + **/ +public class SessionInfoTest { + /** + * 时间戳 + */ + private long longParam = 2006 - 07 - 11; + + /** + * sessionId数字3243 + */ + private int sessionId = 3243; + + /** + * DeviceIPPortInfo类 + */ + private DeviceIPPortInfo deviceIPPortInfo; + + /** + * functional testing init + * + * @tc.name: SessionInfo init + * @tc.number: OHOS_JAVA_session_SessionInfo_init_0001 + * @tc.desc: SessionInfo init + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Before + public void initObj() { + deviceIPPortInfo = new DeviceIPPortInfo(); + deviceIPPortInfo.setIp(""); + deviceIPPortInfo.setPort(5001); + } + + /** + * functional testing getInstance + * + * @tc.name: SessionInfo getDefaultInstance + * @tc.number: OHOS_JAVA_session_SessionInfo_getDefaultInstance_0001 + * @tc.desc: SessionInfo getDefaultInstance + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void getDefaultInstanceTest() { + SessionInfo sessionInfo = SessionInfo.getDefaultInstance(); + Assert.assertNotNull(sessionInfo); + } + + /** + * functional testing set sessionName + * + * @tc.name: SessionInfo sessionName + * @tc.number: OHOS_JAVA_session_SessionInfo_sessionName_0001 + * @tc.desc: SessionInfo sessionName + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void sessionNameTest() { + SessionInfo.Builder builder = SessionInfo.builder().sessionName(Object.class.toString()); + Assert.assertNotNull(builder); + } + + /** + * functional testing set sessionId + * + * @tc.name: SessionInfo sessionId + * @tc.number: OHOS_JAVA_session_SessionInfo_sessionId_0001 + * @tc.desc: SessionInfo sessionId + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void sessionIdTest() { + SessionInfo.Builder builder = SessionInfo.builder().sessionId(sessionId); + Assert.assertNotNull(builder); + } + + /** + * functional testing set startTimestamp + * + * @tc.name: SessionInfo startTimestamp + * @tc.number: OHOS_JAVA_session_SessionInfo_startTimestamp_0001 + * @tc.desc: SessionInfo startTimestamp + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void startTimestampTest() { + SessionInfo.Builder builder = SessionInfo.builder().startTimestamp(longParam); + Assert.assertNotNull(builder); + } + + /** + * functional testing set endTimestamp + * + * @tc.name: SessionInfo endTimestamp + * @tc.number: OHOS_JAVA_session_SessionInfo_endTimestamp_0001 + * @tc.desc: SessionInfo endTimestamp + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void endTimestampTest() { + SessionInfo.Builder builder = SessionInfo.builder().endTimestamp(longParam); + Assert.assertNotNull(builder); + } + + /** + * functional testing set streamId + * + * @tc.name: SessionInfo streamId + * @tc.number: OHOS_JAVA_session_SessionInfo_streamId_0001 + * @tc.desc: SessionInfo streamId + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void streamIdTest() { + SessionInfo.Builder builder = SessionInfo.builder().streamId(longParam); + Assert.assertNotNull(builder); + } + + /** + * functional testing set pid + * + * @tc.name: SessionInfo pid + * @tc.number: OHOS_JAVA_session_SessionInfo_pid_0001 + * @tc.desc: SessionInfo pid + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void pidTest() { + SessionInfo.Builder builder = SessionInfo.builder().pid(longParam); + Assert.assertNotNull(builder); + } + + /** + * functional testing set deviceIPPortInfo + * + * @tc.name: SessionInfo deviceIPPortInfo + * @tc.number: OHOS_JAVA_session_SessionInfo_deviceIPPortInfo_0001 + * @tc.desc: SessionInfo deviceIPPortInfo + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void deviceIPPortInfoTest() { + SessionInfo.Builder builder = SessionInfo.builder().deviceIPPortInfo(deviceIPPortInfo); + Assert.assertNotNull(builder); + } + + /** + * functional testing build + * + * @tc.name: SessionInfo build + * @tc.number: OHOS_JAVA_session_SessionInfo_build_0001 + * @tc.desc: SessionInfo build + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void buildTest() { + SessionInfo sessionInfo = SessionInfo.builder().build(); + Assert.assertNotNull(sessionInfo); + } + + /** + * functional testing hashCode + * + * @tc.name: SessionInfo hashCode + * @tc.number: OHOS_JAVA_session_SessionInfo_hashCode_0001 + * @tc.desc: SessionInfo hashCode + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void hashCodeTest() { + int number = SessionInfo.getDefaultInstance().hashCode(); + Assert.assertNotNull(number); + } + + /** + * functional testing equals + * + * @tc.name: SessionInfo equals + * @tc.number: OHOS_JAVA_session_SessionInfo_equals_0001 + * @tc.desc: SessionInfo equals + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void equalsTest() { + boolean flag = SessionInfo.getDefaultInstance().equals(Object.class); + Assert.assertFalse(flag); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/session/service/SessionManagerTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/session/service/SessionManagerTest.java new file mode 100644 index 000000000..a29412992 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/session/service/SessionManagerTest.java @@ -0,0 +1,1011 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.session.service; + +import com.alibaba.fastjson.JSONObject; +import io.grpc.ManagedChannel; +import io.grpc.inprocess.InProcessChannelBuilder; +import io.grpc.inprocess.InProcessServerBuilder; +import io.grpc.stub.StreamObserver; +import io.grpc.testing.GrpcCleanupRule; +import io.grpc.util.MutableHandlerRegistry; +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.transport.grpc.HiProfilerClient; +import ohos.devtools.datasources.transport.grpc.MockProfilerServiceImplBase; +import ohos.devtools.datasources.transport.grpc.ProfilerClient; +import ohos.devtools.datasources.transport.grpc.service.CommonTypes; +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; +import ohos.devtools.datasources.transport.grpc.service.ProfilerServiceTypes; +import ohos.devtools.datasources.utils.common.Constant; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.device.entity.DeviceProcessInfo; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import ohos.devtools.services.memory.MemoryHeapInfo; +import ohos.devtools.services.memory.MemoryHeapManager; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import javax.swing.JProgressBar; +import java.io.File; +import java.io.IOException; +import java.util.Optional; + +/** + * @version 1.0 + * @date 2021/03/23 19:40 + **/ +public class SessionManagerTest { + private static volatile Integer requestId = 1; + private final MutableHandlerRegistry serviceRegistry = new MutableHandlerRegistry(); + /** + * grpcCleanup + */ + private final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); + private SessionManager session; + private DeviceIPPortInfo device; + private ProcessInfo process; + private JSONObject jsonObject; + private DeviceProcessInfo deviceProcessInfo; + private String serverName; + private MemoryHeapInfo memoryHeapInfo; + private MemoryHeapManager memoryHeapManager; + private MockProfilerServiceImplBase getFeatureImpl; + private ManagedChannel channel; + + /** + * functional testing init + * + * @tc.name: init + * @tc.number: OHOS_JAVA_session_SessionManager_init + * @tc.desc: init + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Before + public void init() { + session = SessionManager.getInstance(); + session.setDevelopMode(true); + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + jsonObject = new JSONObject(); + JSONObject memoryObject = new JSONObject(); + memoryObject.put("Select All", true); + memoryObject.put("Java", true); + memoryObject.put("Native", true); + memoryObject.put("Graphics", true); + memoryObject.put("Stack", true); + memoryObject.put("Code", true); + memoryObject.put("Others", true); + jsonObject.put("Memory", memoryObject); + device = new DeviceIPPortInfo(); + device.setIp(""); + device.setPort(3333); + device.setForwardPort(3333); + device.setDeviceID("1"); + process = new ProcessInfo(); + process.setProcessId(1); + process.setProcessName("process"); + deviceProcessInfo = new DeviceProcessInfo(); + serverName = InProcessServerBuilder.generateName(); + memoryHeapManager = new MemoryHeapManager(); + memoryHeapInfo = new MemoryHeapInfo(); + memoryHeapInfo.setcId(1); + memoryHeapInfo.setHeapId(1); + memoryHeapInfo.setSessionId(1L); + memoryHeapInfo.setArrangeStyle("name"); + memoryHeapInfo.setAllocations(10); + memoryHeapInfo.setDeallocations(0); + memoryHeapInfo.setTotalCount(79); + memoryHeapInfo.setShallowSize(348L); + memoryHeapInfo.setCreateTime(20210406L); + try { + grpcCleanup.register( + InProcessServerBuilder.forName(serverName).fallbackHandlerRegistry(serviceRegistry).directExecutor() + .build().start()); + } catch (IOException exception) { + exception.printStackTrace(); + } + getFeatureImpl = new MockProfilerServiceImplBase() { + /** + * init getCapabilities + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void getCapabilities(ProfilerServiceTypes.GetCapabilitiesRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.ProfilerPluginCapability pluginCapability = + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder( + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder() + .setName("/data/local/tmp/libmemdataplugin.z.so") + .setPath("/data/local/tmp/libmemdataplugin.z.so").build()).build(); + ProfilerServiceTypes.GetCapabilitiesResponse reply = + ProfilerServiceTypes.GetCapabilitiesResponse.newBuilder().addCapabilities(pluginCapability) + .setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init createSession + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void createSession(ProfilerServiceTypes.CreateSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.CreateSessionResponse reply = + ProfilerServiceTypes.CreateSessionResponse.newBuilder().setSessionId(1).setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init startSession + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void startSession(ProfilerServiceTypes.StartSessionRequest request, + StreamObserver responseObserver) { + CommonTypes.ProfilerPluginState profilerPluginState = + CommonTypes.ProfilerPluginState.newBuilder().build(); + ProfilerServiceTypes.StartSessionResponse reply = + ProfilerServiceTypes.StartSessionResponse.newBuilder().setStatus(0) + .addPluginStatus(profilerPluginState).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init fetchData + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void fetchData(ProfilerServiceTypes.FetchDataRequest request, + StreamObserver responseObserver) { + MemoryPluginResult.AppSummary sss = + MemoryPluginResult.AppSummary.newBuilder().setJavaHeap(getIntData()).setNativeHeap(getIntData()) + .setCode(getIntData()).setStack(getIntData()).setGraphics(getIntData()) + .setPrivateOther(getIntData()).setSystem(0).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoZero = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31141).setName("rcu_gp").setRssShmemKb(1) + .setMemsummary(sss).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoOne = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31142).setName("rcu_bh") + .setRssShmemKb(2222222).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfoTwo = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31144).setName("netns") + .setRssShmemKb(3333333).build(); + MemoryPluginResult.MemoryData aaa = + MemoryPluginResult.MemoryData.newBuilder().addProcessesinfo(processesInfoZero) + .addProcessesinfo(processesInfoOne).addProcessesinfo(processesInfoTwo).build(); + CommonTypes.ProfilerPluginData data = + CommonTypes.ProfilerPluginData.newBuilder().setName("memory-plugin").setStatus(0) + .setData(aaa.toByteString()).build(); + ProfilerServiceTypes.FetchDataResponse fetchDataResponse = + ProfilerServiceTypes.FetchDataResponse.newBuilder().setResponseId(123456789).setStatus(0) + .setHasMore(false).addPluginData(data).build(); + responseObserver.onNext(fetchDataResponse); + responseObserver.onCompleted(); + } + + /** + * init stopSession + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void stopSession(ProfilerServiceTypes.StopSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.StopSessionResponse reply = + ProfilerServiceTypes.StopSessionResponse.newBuilder().build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init destroySession + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void destroySession(ProfilerServiceTypes.DestroySessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.DestroySessionResponse reply = + ProfilerServiceTypes.DestroySessionResponse.newBuilder().setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + }; + channel = grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + } + + /** + * functional testing Instance + * + * @tc.name: get Instance + * @tc.number: OHOS_JAVA_session_SessionManager_getInstance_0001 + * @tc.desc: get Instance + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void getInstance01() { + SessionManager sessionInstance = SessionManager.getInstance(); + Assert.assertNotNull(sessionInstance); + } + + /** + * functional testing Instance + * + * @tc.name: get Instance + * @tc.number: OHOS_JAVA_session_SessionManager_getInstance_0002 + * @tc.desc: get Instance + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void getInstance02() { + SessionManager sessionOne = SessionManager.getInstance(); + SessionManager sessionTwo = SessionManager.getInstance(); + Assert.assertEquals(sessionOne, sessionTwo); + } + + /** + * functional testing create Session + * + * @tc.name: create Session + * @tc.number: OHOS_JAVA_session_SessionManager_createSession_0001 + * @tc.desc: create Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testCreateSessionREALTIME_SCENE() { + long num = session.createSession(null, process, Constant.REALTIME_SCENE, jsonObject); + Assert.assertNotNull(num); + } + + /** + * functional testing create Session + * + * @tc.name: create Session + * @tc.number: OHOS_JAVA_session_SessionManager_createSession_0002 + * @tc.desc: create Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testCreateSessionREALTIME_SCENE01() { + long num = session.createSession(device, null, Constant.REALTIME_SCENE, jsonObject); + Assert.assertNotNull(num); + } + + /** + * functional testing create Session + * + * @tc.name: create Session + * @tc.number: OHOS_JAVA_session_SessionManager_createSession_0003 + * @tc.desc: create Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testCreateSessionREALTIME_SCENE02() { + long num = session.createSession(device, process, Constant.REALTIME_SCENE, null); + Assert.assertNotNull(num); + } + + /** + * functional testing create Session + * + * @tc.name: create Session + * @tc.number: OHOS_JAVA_session_SessionManager_createSession_0004 + * @tc.desc: create Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testCreateSessionREALTIME_SCENE03() { + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient("", 3333, channel); + long num = session.createSession(device, process, Constant.REALTIME_SCENE, jsonObject); + Assert.assertNotNull(num); + } + + /** + * functional testing create Session + * + * @tc.name: create Session + * @tc.number: OHOS_JAVA_session_SessionManager_createSession_0005 + * @tc.desc: create Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testCreateSessionFILE_IMPORT_SCENE() { + long num = session.createSession(null, process, Constant.FILE_IMPORT_SCENE, jsonObject); + Assert.assertNotNull(num); + } + + /** + * functional testing create Session + * + * @tc.name: create Session + * @tc.number: OHOS_JAVA_session_SessionManager_createSession_0006 + * @tc.desc: create Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testCreateSessionFILE_IMPORT_SCENE01() { + long num = session.createSession(device, null, Constant.FILE_IMPORT_SCENE, jsonObject); + Assert.assertNotNull(num); + } + + /** + * functional testing create Session + * + * @tc.name: create Session + * @tc.number: OHOS_JAVA_session_SessionManager_createSession_0007 + * @tc.desc: create Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testCreateSessionFILE_IMPORT_SCENE02() { + long num = session.createSession(device, process, Constant.FILE_IMPORT_SCENE, null); + Assert.assertNotNull(num); + } + + /** + * functional testing create Session + * + * @tc.name: create Session + * @tc.number: OHOS_JAVA_session_SessionManager_createSession_0008 + * @tc.desc: create Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testCreateSessionOFFLINE() { + long num = session.createSession(null, process, 3, jsonObject); + Assert.assertNotNull(num); + } + + /** + * functional testing create Session + * + * @tc.name: create Session + * @tc.number: OHOS_JAVA_session_SessionManager_createSession_0009 + * @tc.desc: create Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testCreateSessionOFFLINE01() { + long num = session.createSession(device, null, 3, jsonObject); + Assert.assertNotNull(num); + } + + /** + * functional testing create Session + * + * @tc.name: create Session + * @tc.number: OHOS_JAVA_session_SessionManager_createSession_0010 + * @tc.desc: create Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testCreateSessionOFFLINE02() { + long num = session.createSession(device, process, 3, null); + Assert.assertNotNull(num); + } + + /** + * functional testing start Session + * + * @tc.name: start Session + * @tc.number: OHOS_JAVA_session_SessionManager_startSession_0001 + * @tc.desc: start Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testStart01() { + boolean flag = session.startSession(null, false); + Assert.assertFalse(flag); + } + + /** + * functional testing start Session + * + * @tc.name: start Session + * @tc.number: OHOS_JAVA_session_SessionManager_startSession_0002 + * @tc.desc: start Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testStart02() { + boolean flag = session.startSession(null, true); + Assert.assertFalse(flag); + } + + /** + * functional testing start Session + * + * @tc.name: start Session + * @tc.number: OHOS_JAVA_session_SessionManager_startSession_0003 + * @tc.desc: start Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testStart03() { + boolean flag = session.startSession(2L, false); + Assert.assertTrue(flag); + } + + /** + * functional testing start Session + * + * @tc.name: start Session + * @tc.number: OHOS_JAVA_session_SessionManager_startSession_0004 + * @tc.desc: start Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testStart04() { + boolean flag = session.startSession(2L, true); + Assert.assertTrue(flag); + } + + /** + * functional testing start Session + * + * @tc.name: start Session + * @tc.number: OHOS_JAVA_session_SessionManager_startSession_0005 + * @tc.desc: start Session + * @tc.type: functional testing + * @tc.require: AR000FK5S7 + */ + @Test + public void testStart05() { + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient("", 3333, channel); + long num = session.createSession(device, process, Constant.REALTIME_SCENE, jsonObject); + boolean flag = session.startSession(num, false); + Assert.assertTrue(flag); + } + + /** + * functional testing fetchData + * + * @tc.name: fetchData + * @tc.number: OHOS_JAVA_session_SessionManager_fetchData_0001 + * @tc.desc: fetchData + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testFetchData01() { + boolean flag = session.fetchData(null); + Assert.assertFalse(flag); + } + + /** + * functional testing fetchData + * + * @tc.name: fetchData + * @tc.number: OHOS_JAVA_session_SessionManager_fetchData_0002 + * @tc.desc: fetchData + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testFetchData02() { + boolean flag = session.fetchData(1L); + Assert.assertTrue(flag); + } + + /** + * functional testing fetchData + * + * @tc.name: fetchData + * @tc.number: OHOS_JAVA_session_SessionManager_fetchData_0003 + * @tc.desc: fetchData + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testFetchData03() { + boolean flag = session.fetchData(0L); + Assert.assertFalse(flag); + } + + /** + * functional testing fetchData + * + * @tc.name: fetchData + * @tc.number: OHOS_JAVA_session_SessionManager_fetchData_0004 + * @tc.desc: fetchData + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testFetchData04() { + boolean flag = session.fetchData(-1L); + Assert.assertFalse(flag); + } + + /** + * functional testing fetchData + * + * @tc.name: fetchData + * @tc.number: OHOS_JAVA_session_SessionManager_fetchData_0005 + * @tc.desc: fetchData + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testFetchData05() { + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient("", 3333, channel); + long num = session.createSession(device, process, Constant.REALTIME_SCENE, jsonObject); + session.startSession(num, false); + boolean flag = session.fetchData(num); + Assert.assertTrue(flag); + } + + /** + * functional testing end Session + * + * @tc.name: end Session + * @tc.number: OHOS_JAVA_session_SessionManager_endSession_0001 + * @tc.desc: end Session + * @tc.type: functional testing + * @tc.require: AR000FK5S8 + */ + @Test + public void testEndSession01() { + boolean flag = session.endSession(null); + Assert.assertFalse(flag); + } + + /** + * functional testing end Session + * + * @tc.name: end Session + * @tc.number: OHOS_JAVA_session_SessionManager_endSession_0002 + * @tc.desc: end Session + * @tc.type: functional testing + * @tc.require: AR000FK5S8 + */ + @Test + public void testEndSession02() { + boolean flag = session.endSession(1L); + Assert.assertTrue(flag); + } + + /** + * functional testing end Session + * + * @tc.name: end Session + * @tc.number: OHOS_JAVA_session_SessionManager_endSession_0003 + * @tc.desc: end Session + * @tc.type: functional testing + * @tc.require: AR000FK5S8 + */ + @Test + public void testEndSession03() { + boolean flag = session.endSession(0L); + Assert.assertFalse(flag); + } + + /** + * functional testing end Session + * + * @tc.name: end Session + * @tc.number: OHOS_JAVA_session_SessionManager_endSession_0004 + * @tc.desc: end Session + * @tc.type: functional testing + * @tc.require: AR000FK5S8 + */ + @Test + public void testEndSession04() { + boolean flag = session.endSession(-1L); + Assert.assertFalse(flag); + } + + /** + * functional testing end Session + * + * @tc.name: end Session + * @tc.number: OHOS_JAVA_session_SessionManager_endSession_0005 + * @tc.desc: end Session + * @tc.type: functional testing + * @tc.require: AR000FK5S8 + */ + @Test + public void testEndSession05() { + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient("", 3333, channel); + long num = session.createSession(device, process, Constant.REALTIME_SCENE, jsonObject); + boolean flag = session.endSession(num); + Assert.assertTrue(flag); + } + + /** + * functional testing delete Session + * + * @tc.name: delete Session + * @tc.number: OHOS_JAVA_session_SessionManager_deleteSession_0001 + * @tc.desc: delete Session + * @tc.type: functional testing + * @tc.require: AR000FK5SA + */ + @Test + public void testDeleteSession01() { + boolean flag = session.deleteSession(null); + Assert.assertFalse(flag); + } + + /** + * functional testing delete Session + * + * @tc.name: delete Session + * @tc.number: OHOS_JAVA_session_SessionManager_deleteSession_0002 + * @tc.desc: delete Session + * @tc.type: functional testing + * @tc.require: AR000FK5SA + */ + @Test + public void testDeleteSession02() { + boolean flag = session.deleteSession(1L); + Assert.assertFalse(flag); + } + + /** + * functional testing delete Session + * + * @tc.name: delete Session + * @tc.number: OHOS_JAVA_session_SessionManager_deleteSession_0003 + * @tc.desc: delete Session + * @tc.type: functional testing + * @tc.require: AR000FK5SA + */ + @Test + public void testDeleteSession03() { + boolean flag = session.deleteSession(0L); + Assert.assertFalse(flag); + } + + /** + * functional testing delete Session + * + * @tc.name: delete Session + * @tc.number: OHOS_JAVA_session_SessionManager_deleteSession_0004 + * @tc.desc: delete Session + * @tc.type: functional testing + * @tc.require: AR000FK5SA + */ + @Test + public void testDeleteSession04() { + boolean flag = session.deleteSession(-1L); + Assert.assertFalse(flag); + } + + /** + * functional testing delete Session + * + * @tc.name: delete Session + * @tc.number: OHOS_JAVA_session_SessionManager_deleteSession_0005 + * @tc.desc: delete Session + * @tc.type: functional testing + * @tc.require: AR000FK5SA + */ + @Test + public void testDeleteSession05() { + boolean flag1 = session.deleteSession(-1L); + boolean flag2 = session.deleteSession(0L); + Assert.assertEquals(flag1, flag2); + } + + /** + * functional testing delete Session + * + * @tc.name: delete Session + * @tc.number: OHOS_JAVA_session_SessionManager_deleteSession_0006 + * @tc.desc: delete Session + * @tc.type: functional testing + * @tc.require: AR000FK5SA + */ + @Test + public void testDelete05() { + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient("", 3333, channel); + long num = session.createSession(device, process, Constant.REALTIME_SCENE, jsonObject); + session.fetchData(num); + boolean flag = session.deleteSession(num); + Assert.assertTrue(flag); + } + + /** + * functional testing saveSessionDataToFile + * + * @tc.name: saveSessionDataToFile + * @tc.number: OHOS_JAVA_session_SessionManager_saveSessionDataToFile_0001 + * @tc.desc: save SessionData To File + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testSaveSessionDataToFile01() { + boolean flag = session.saveSessionDataToFile(0L, deviceProcessInfo, ""); + Assert.assertFalse(flag); + } + + /** + * functional testing saveSessionDataToFile + * + * @tc.name: saveSessionDataToFile + * @tc.number: OHOS_JAVA_session_SessionManager_saveSessionDataToFile_0002 + * @tc.desc: save SessionData To File + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testSaveSessionDataToFile02() { + boolean flag = session.saveSessionDataToFile(-1L, deviceProcessInfo, ""); + Assert.assertFalse(flag); + } + + /** + * functional testing saveSessionDataToFile + * + * @tc.name: saveSessionDataToFile + * @tc.number: OHOS_JAVA_session_SessionManager_saveSessionDataToFile_0003 + * @tc.desc: save SessionData To File + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testSaveSessionDataToFile03() { + boolean flag = session.saveSessionDataToFile(1L, deviceProcessInfo, ""); + Assert.assertFalse(flag); + } + + /** + * functional testing saveSessionDataToFile + * + * @tc.name: saveSessionDataToFile + * @tc.number: OHOS_JAVA_session_SessionManager_saveSessionDataToFile_0004 + * @tc.desc: save SessionData To File + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testSaveSessionDataToFile04() { + boolean flag = session.saveSessionDataToFile(1L, null, ""); + Assert.assertFalse(flag); + } + + /** + * functional testing saveSessionDataToFile + * + * @tc.name: saveSessionDataToFile + * @tc.number: OHOS_JAVA_session_SessionManager_saveSessionDataToFile_0005 + * @tc.desc: save SessionData To File + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testSaveSessionDataToFile05() { + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient("", 3333, channel); + long num = session.createSession(device, process, Constant.REALTIME_SCENE, jsonObject); + session.fetchData(num); + boolean flag = session.saveSessionDataToFile(num, deviceProcessInfo, "/"); + Assert.assertFalse(flag); + } + + /** + * functional testing saveSessionDataToFile + * + * @tc.name: saveSessionDataToFile + * @tc.number: OHOS_JAVA_session_SessionManager_saveSessionDataToFile_0006 + * @tc.desc: save SessionData To File + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testSaveSessionDataToFile06() { + boolean flag = session.saveSessionDataToFile(1L, deviceProcessInfo, null); + Assert.assertFalse(flag); + } + + /** + * functional testing localSessionDataFromFile + * + * @tc.name: localSessionDataFromFile + * @tc.number: OHOS_JAVA_session_SessionManager_localSessionDataFromFile_0001 + * @tc.desc: local SessionData From File + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testlocalSessionDataFromFile01() { + JProgressBar jProgressBar = new JProgressBar(); + Optional optional = session.localSessionDataFromFile(jProgressBar, null); + Assert.assertFalse(optional.isPresent()); + } + + /** + * functional testing localSessionDataFromFile + * + * @tc.name: localSessionDataFromFile + * @tc.number: OHOS_JAVA_session_SessionManager_localSessionDataFromFile_0002 + * @tc.desc: local SessionData From File + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testlocalSessionDataFromFile02() { + File file = new File(""); + Optional optional = session.localSessionDataFromFile(null, file); + Assert.assertFalse(optional.isPresent()); + } + + /** + * functional testing localSessionDataFromFile + * + * @tc.name: localSessionDataFromFile + * @tc.number: OHOS_JAVA_session_SessionManager_localSessionDataFromFile_0003 + * @tc.desc: local SessionData From File + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testlocalSessionDataFromFile03() { + Optional optional = session.localSessionDataFromFile(null, null); + Assert.assertFalse(optional.isPresent()); + } + + /** + * functional testing localSessionDataFromFile + * + * @tc.name: localSessionDataFromFile + * @tc.number: OHOS_JAVA_session_SessionManager_localSessionDataFromFile_0004 + * @tc.desc: local SessionData From File + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testlocalSessionDataFromFile05() { + JProgressBar jProgressBar = new JProgressBar(); + File rootPath = new File(this.getClass().getResource("/Demo.trace").getFile().toString()); + Optional deviceProcessInfoNew = session.localSessionDataFromFile(jProgressBar, rootPath); + Assert.assertNotNull(deviceProcessInfoNew); + } + + /** + * functional testing deleteSessionByOffLineDivece + * + * @tc.name: deleteSessionByOffLineDivece + * @tc.number: OHOS_JAVA_session_SessionManager_deleteSessionByOffLineDivece_0001 + * @tc.desc: delete Session By OffLineDivece + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testdeleteSessionByOffLineDivece() { + session.deleteSessionByOffLineDivece(device); + } + + /** + * functional testing deleteSessionByOffLineDivece + * + * @tc.name: deleteSessionByOffLineDivece + * @tc.number: OHOS_JAVA_session_SessionManager_deleteSessionByOffLineDivece_0002 + * @tc.desc: delete Session By OffLineDivece + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testdeleteSessionByOffLineDivece01() { + session.deleteSessionByOffLineDivece(null); + } + + /** + * functional testing deleteLocalSession + * + * @tc.name: deleteLocalSession + * @tc.number: OHOS_JAVA_session_SessionManager_deleteLocalSession_0001 + * @tc.desc: delete LocalSession + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testdeleteLocalSession() { + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient("", 3333, channel); + long num = session.createSession(device, process, Constant.REALTIME_SCENE, jsonObject); + session.deleteLocalSession(num); + } + + /** + * functional testing stop AllSession + * + * @tc.name: stop AllSession + * @tc.number: OHOS_JAVA_session_SessionManager_stopAllSession_0001 + * @tc.desc: stop AllSession + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void teststopAllSession() { + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient("", 3333, channel); + long num = session.createSession(device, process, Constant.REALTIME_SCENE, jsonObject); + session.startSession(num, false); + session.stopAllSession(); + } + + /** + * functional testing getPluginPath + * + * @tc.name: getPluginPath + * @tc.number: OHOS_JAVA_session_SessionManager_getPluginPath_0001 + * @tc.desc: getPluginPath + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testgetPluginPath() { + String pluginPath = session.getPluginPath(); + Assert.assertNotNull(pluginPath); + } + + /** + * functional testing getPluginPath + * + * @tc.name: getPluginPath + * @tc.number: OHOS_JAVA_session_SessionManager_getPluginPath_0002 + * @tc.desc: getPluginPath + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testgetPluginPathFalse() { + session.setDevelopMode(false); + String pluginPath = session.getPluginPath(); + Assert.assertNotNull(pluginPath); + } + + private int getIntData() { + requestId++; + if (requestId == Integer.MAX_VALUE) { + requestId = 0; + } + return requestId; + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/trace/service/TraceManagerTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/trace/service/TraceManagerTest.java new file mode 100644 index 000000000..5e2046054 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/datasources/utils/trace/service/TraceManagerTest.java @@ -0,0 +1,291 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.datasources.utils.trace.service; + +import io.grpc.ManagedChannel; +import io.grpc.inprocess.InProcessChannelBuilder; +import io.grpc.inprocess.InProcessServerBuilder; +import io.grpc.stub.StreamObserver; +import io.grpc.testing.GrpcCleanupRule; +import io.grpc.util.MutableHandlerRegistry; +import ohos.devtools.datasources.transport.grpc.HiProfilerClient; +import ohos.devtools.datasources.transport.grpc.MockProfilerServiceImplBase; +import ohos.devtools.datasources.transport.grpc.ProfilerClient; +import ohos.devtools.datasources.transport.grpc.service.CommonTypes; +import ohos.devtools.datasources.transport.grpc.service.MemoryPluginResult; +import ohos.devtools.datasources.transport.grpc.service.ProfilerServiceTypes; +import ohos.devtools.datasources.utils.common.GrpcException; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +/** + * get Trace Data Test Class + * + * @version 1.0 + * @date 2021/04/13 16:58 + **/ +public class TraceManagerTest { + private static volatile Integer requestId = 1; + + /** + * grpcCleanup + */ + public GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); + + /** + * DeviceIPPortInfo class + */ + private DeviceIPPortInfo deviceIPPortInfo; + private ManagedChannel channel; + private String serverName; + private MockProfilerServiceImplBase getFeatureImpl; + private MutableHandlerRegistry serviceRegistry = new MutableHandlerRegistry(); + + /** + * TraceManager init + * + * @tc.name: TraceManager init + * @tc.number: OHOS_JAVA_trace_TraceManager_init_0001 + * @tc.desc: TraceManager init + * @tc.type: functional testing + * @tc.require: SR-032 + * @throws IOException IOException + */ + @Before + public void initObj() throws IOException { + SessionManager.getInstance().setDevelopMode(true); + deviceIPPortInfo = new DeviceIPPortInfo(); + deviceIPPortInfo.setIp(""); + deviceIPPortInfo.setPort(5001); + deviceIPPortInfo.setForwardPort(5001); + serverName = InProcessServerBuilder.generateName(); + getFeatureImpl = new MockProfilerServiceImplBase() { + /** + * init getCapabilities + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void getCapabilities(ProfilerServiceTypes.GetCapabilitiesRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.ProfilerPluginCapability pluginCapability = + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder( + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder() + .setName("/data/local/tmp/libbytraceplugin.z.so") + .setPath("/data/local/tmp/libbytraceplugin.z.so").build()).build(); + + ProfilerServiceTypes.ProfilerPluginCapability pluginCapabilityPtrace = + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder( + ProfilerServiceTypes.ProfilerPluginCapability.newBuilder() + .setName("/data/local/tmp/libptrace_plugin.z.so") + .setPath("/data/local/tmp/libptrace_plugin.z.so").build()).build(); + + ProfilerServiceTypes.GetCapabilitiesResponse reply = + ProfilerServiceTypes.GetCapabilitiesResponse.newBuilder().addCapabilities(pluginCapability) + .addCapabilities(pluginCapabilityPtrace).setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init createSession + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void createSession(ProfilerServiceTypes.CreateSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.CreateSessionResponse reply = + ProfilerServiceTypes.CreateSessionResponse.newBuilder().setSessionId(1).setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init startSession + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void startSession(ProfilerServiceTypes.StartSessionRequest request, + StreamObserver responseObserver) { + CommonTypes.ProfilerPluginState profilerPluginState = + CommonTypes.ProfilerPluginState.newBuilder().build(); + ProfilerServiceTypes.StartSessionResponse reply = + ProfilerServiceTypes.StartSessionResponse.newBuilder().setStatus(0) + .addPluginStatus(profilerPluginState).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init fetchData + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void fetchData(ProfilerServiceTypes.FetchDataRequest request, + StreamObserver responseObserver) { + MemoryPluginResult.AppSummary sss = + MemoryPluginResult.AppSummary.newBuilder().setJavaHeap(getIntData()).setNativeHeap(getIntData()) + .setCode(getIntData()).setStack(getIntData()).setGraphics(getIntData()) + .setPrivateOther(getIntData()).setSystem(0).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfo0 = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31141).setName("rcu_gp").setRssShmemKb(1) + .setMemsummary(sss).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfo1 = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31142).setName("rcu_bh") + .setRssShmemKb(2222222).build(); + MemoryPluginResult.ProcessMemoryInfo processesInfo2 = + MemoryPluginResult.ProcessMemoryInfo.newBuilder().setPid(31144).setName("netns") + .setRssShmemKb(3333333).build(); + MemoryPluginResult.MemoryData aaa = + MemoryPluginResult.MemoryData.newBuilder().addProcessesinfo(processesInfo0) + .addProcessesinfo(processesInfo1).addProcessesinfo(processesInfo2).build(); + CommonTypes.ProfilerPluginData data = + CommonTypes.ProfilerPluginData.newBuilder().setName("memory-plugin").setStatus(0) + .setData(aaa.toByteString()).build(); + ProfilerServiceTypes.FetchDataResponse fetchDataResponse = + ProfilerServiceTypes.FetchDataResponse.newBuilder().setResponseId(123456789).setStatus(0) + .setHasMore(false).addPluginData(data).build(); + responseObserver.onNext(fetchDataResponse); + responseObserver.onCompleted(); + } + + /** + * init stopSession + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void stopSession(ProfilerServiceTypes.StopSessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.StopSessionResponse reply = + ProfilerServiceTypes.StopSessionResponse.newBuilder().build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + /** + * init destroySession + * + * @param request request + * @param responseObserver responseObserver + */ + @Override + public void destroySession(ProfilerServiceTypes.DestroySessionRequest request, + StreamObserver responseObserver) { + ProfilerServiceTypes.DestroySessionResponse reply = + ProfilerServiceTypes.DestroySessionResponse.newBuilder().setStatus(0).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + }; + grpcCleanup.register( + InProcessServerBuilder.forName(serverName).fallbackHandlerRegistry(serviceRegistry).directExecutor().build() + .start()); + channel = grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build()); + serviceRegistry.addService(getFeatureImpl); + } + + /** + * TraceManager get Singleton + * + * @tc.name: TraceManager getSingleton + * @tc.number: OHOS_JAVA_trace_TraceManager_getSingleton_0001 + * @tc.desc: TraceManager getSingleton + * @tc.type: functional testing + * @tc.require: SR-032 + */ + @Test + public void getSingletonTest() { + TraceManager traceManager = TraceManager.getSingleton(); + Assert.assertNotNull(traceManager); + } + + private int getIntData() { + requestId++; + if (requestId == Integer.MAX_VALUE) { + requestId = 0; + } + return requestId; + } + + /** + * TraceManager create Session By Trace Request + * + * @tc.name: TraceManager createSessionByTraceRequest + * @tc.number: OHOS_JAVA_trace_TraceManager_getSingleton_0001 + * @tc.desc: TraceManager createSessionByTraceRequest + * @tc.type: functional testing + * @tc.require: SR-032 + * @throws GrpcException GrpcException + */ + @Test + public void createSessionByTraceRequestTest() throws GrpcException { + TraceManager traceManager = TraceManager.getSingleton(); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient("", 5001, channel); + String sessionId = traceManager.createSessionByTraceRequest(deviceIPPortInfo, "idle", 5, 10, true); + Assert.assertNotNull(sessionId); + } + + /** + * TraceManager stop And Destroy Session + * + * @tc.name: TraceManager stopAndDestroySession + * @tc.number: OHOS_JAVA_trace_TraceManager_getSingleton_0001 + * @tc.desc: TraceManager stopAndDestroySession + * @tc.type: functional testing + * @tc.require: SR-032 + * @throws GrpcException GrpcException + */ + @Test + public void stopAndDestroySessionTest() throws GrpcException { + TraceManager traceManager = TraceManager.getSingleton(); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient("", 5001, channel); + String sessionId = traceManager.createSessionByTraceRequest(deviceIPPortInfo, "idle", 5, 10, true); + traceManager.stopAndDestroySession(deviceIPPortInfo, sessionId); + } + + /** + * TraceManager create Session Request Perfetto + * + * @tc.name: TraceManager createSessionRequestPerfetto + * @tc.number: OHOS_JAVA_trace_TraceManager_getSingleton_0001 + * @tc.desc: TraceManager createSessionRequestPerfetto + * @tc.type: functional testing + * @tc.require: SR-032 + * @throws GrpcException GrpcException + */ + @Test + public void createSessionRequestPerfettoTest() throws GrpcException { + TraceManager traceManager = TraceManager.getSingleton(); + ProfilerClient client = HiProfilerClient.getInstance().getProfilerClient("", 5001, channel); + String sessionId = traceManager.createSessionRequestPerfetto(deviceIPPortInfo, "idle", 5, true); + Assert.assertNotNull(sessionId); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/ChartDataCacheTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/ChartDataCacheTest.java new file mode 100644 index 000000000..0268a23b8 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/ChartDataCacheTest.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * ChartDataCacheTest + * + * @version 1.0 + * @date 2021/04/6 19:16 + **/ +public class ChartDataCacheTest { + private ChartDataCache chartDataCache; + + /** + * functional test + * + * @tc.name: getInstance + * @tc.number: OHOS_JAVA_Service_ChartDataCache_getInstance_0001 + * @tc.desc: getInstance + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Before + public void getInstance() { + chartDataCache = ChartDataCache.getInstance(); + Map dataCacheMap = chartDataCache.getDataCacheMap(); + LinkedHashMap longStringLinkedHashMap = new LinkedHashMap<>(); + longStringLinkedHashMap.put(100L, "test"); + dataCacheMap.put("test", longStringLinkedHashMap); + } + + /** + * functional test + * + * @tc.name: initCache + * @tc.number: OHOS_JAVA_Service_ChartDataCache_initCache_0001 + * @tc.desc: initCache + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void initCache() { + chartDataCache.initCache("test", 50); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: getDataCacheMap + * @tc.number: OHOS_JAVA_Service_ChartDataCache_getDataCacheMap_0001 + * @tc.desc: getDataCacheMap + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void getDataCacheMap() { + chartDataCache.getDataCacheMap(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: addCacheBlock + * @tc.number: OHOS_JAVA_Service_ChartDataCache_addCacheBlock_0001 + * @tc.desc: addCacheBlock + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void addCacheBlock() { + LinkedHashMap longStringLinkedHashMap = new LinkedHashMap<>(); + chartDataCache.addCacheBlock("test", longStringLinkedHashMap); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: getDataCache + * @tc.number: OHOS_JAVA_Service_ChartDataCache_getDataCache_0001 + * @tc.desc: getDataCache + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void getDataCache() { + LinkedHashMap test = chartDataCache.getDataCache("test", 10, 100, 2000L); + Assert.assertNotNull(test); + } + + /** + * functional test + * + * @tc.name: clearDataCache + * @tc.number: OHOS_JAVA_Service_ChartDataCache_clearDataCache_0001 + * @tc.desc: clearDataCache + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void clearDataCache() { + chartDataCache.clearDataCache("test"); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/ClassInfoDaoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/ClassInfoDaoTest.java new file mode 100644 index 000000000..9fad96320 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/ClassInfoDaoTest.java @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +/** + * ClassInfoDaoTest + * + * @version 1.0 + * @date 2021/04/26 15:56 + **/ +public class ClassInfoDaoTest { + /** + * ClassInfoDao + */ + private ClassInfoDao classInfoDao; + + /** + * ClassInfo + */ + private ClassInfo classInfo; + + /** + * functional testing init + * + * @tc.name: init + * @tc.number: OHOS_JAVA_memory_ClassInfoDao_init_0001 + * @tc.desc: init + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Before + public void init() { + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + classInfoDao = ClassInfoDao.getInstance(); + classInfoDao.createClassInfo(); + classInfo = new ClassInfo(); + classInfo.setClassName("className"); + classInfo.setcId(1); + classInfo.setId(1); + classInfoDao.insertClassInfo(classInfo); + } + + /** + * functional testing getInstance + * + * @tc.name: getInstance + * @tc.number: OHOS_JAVA_memory_ClassInfoDao_getInstance_0001 + * @tc.desc: getInstance + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testGetInstance() { + ClassInfoDao instance = ClassInfoDao.getInstance(); + Assert.assertNotNull(instance); + } + + /** + * functional testing insertClassInfo + * + * @tc.name: insertClassInfo + * @tc.number: OHOS_JAVA_memory_ClassInfoDao_insertClassInfo_0001 + * @tc.desc: insertClassInfo + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testinsertClassInfo() { + classInfoDao.insertClassInfo(classInfo); + } + + /** + * functional testing insertClassInfos + * + * @tc.name: insertClassInfos + * @tc.number: OHOS_JAVA_memory_ClassInfoDao_insertClassInfos_0001 + * @tc.desc: insertClassInfos + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testinsertClassInfos() { + List list = new ArrayList<>(); + list.add(classInfo); + classInfoDao.insertClassInfos(list); + } + + /** + * functional testing getAllClassInfoData + * + * @tc.name: getAllClassInfoData + * @tc.number: OHOS_JAVA_memory_ClassInfoDao_getAllClassInfoData_0001 + * @tc.desc: getAllClassInfoData + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetAllClassInfoData() { + List list = new ArrayList<>(); + list = classInfoDao.getAllClassInfoData(1L); + Assert.assertNotNull(list); + } + + /** + * functional testing getClassIdByClassName + * + * @tc.name: getClassIdByClassName + * @tc.number: OHOS_JAVA_memory_ClassInfoDao_getClassIdByClassName_0001 + * @tc.desc: getClassIdByClassName + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetClassIdByClassName() { + int num = classInfoDao.getClassIdByClassName("className"); + Assert.assertNotNull(num); + } + + /** + * functional testing deleteSessionData + * + * @tc.name: deleteSessionData + * @tc.number: OHOS_JAVA_memory_ClassInfoDao_deleteSessionData_0001 + * @tc.desc: deleteSessionData + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetdeleteSessionData() { + classInfoDao.deleteSessionData(1L); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryHeapDaoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryHeapDaoTest.java new file mode 100644 index 000000000..ba371280b --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryHeapDaoTest.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; +import org.apache.logging.log4j.Level; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +/** + * MemoryHeapDaoTest + * + * @version 1.0 + * @date 2021/04/26 15:56 + **/ +public class MemoryHeapDaoTest { + /** + * MemoryHeapInfo + */ + private MemoryHeapInfo memoryHeapInfo; + + /** + * MemoryHeapDao + */ + private MemoryHeapDao memoryHeapDao; + + /** + * MemoryHeapInfo + */ + private MemoryHeapInfo memoryHeap; + + /** + * functional testing init + * + * @tc.name: init + * @tc.number: OHOS_JAVA_memory_MemoryHeapDao_init_0001 + * @tc.desc: init + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Before + public void init() { + ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + memoryHeapDao = MemoryHeapDao.getInstance(); + + memoryHeapDao.createMemoryHeapInfo(); + memoryHeapInfo = new MemoryHeapInfo(); + memoryHeap = new MemoryHeapInfo(); + memoryHeapInfo.setcId(1); + memoryHeapInfo.setHeapId(1); + memoryHeapInfo.setSessionId(1L); + memoryHeapInfo.setArrangeStyle("name"); + memoryHeapInfo.setAllocations(10); + memoryHeapInfo.setDeallocations(0); + memoryHeapInfo.setTotalCount(22); + memoryHeapInfo.setShallowSize(22L); + memoryHeapInfo.setCreateTime(1L); + memoryHeapInfo.setInstanceId(2); + memoryHeap.setcId(2); + memoryHeap.setHeapId(2); + memoryHeap.setSessionId(1L); + memoryHeap.setArrangeStyle("name"); + memoryHeap.setAllocations(10); + memoryHeap.setDeallocations(0); + memoryHeap.setTotalCount(11); + memoryHeap.setShallowSize(11L); + memoryHeap.setCreateTime(2L); + memoryHeap.setInstanceId(2); + List list = new ArrayList<>(); + list.add(memoryHeap); + list.add(memoryHeapInfo); + + memoryHeapDao.insertMemoryHeapInfos(list); + } + + /** + * functional testing insertMemoryHeapInfos + * + * @tc.name: insertMemoryHeapInfos + * @tc.number: OHOS_JAVA_memory_MemoryHeapDao_insertMemoryHeapInfos_0001 + * @tc.desc: insertMemoryHeapInfos + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testinsertMemoryHeapInfos() { + List list = new ArrayList<>(); + list.add(memoryHeap); + memoryHeapDao.insertMemoryHeapInfos(list); + } + + /** + * functional testing getAllMemoryHeapInfos + * + * @tc.name: getAllMemoryHeapInfos + * @tc.number: OHOS_JAVA_memory_MemoryHeapDao_getAllMemoryHeapInfos_0001 + * @tc.desc: getAllMemoryHeapInfos + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetAllMemoryHeapInfos() { + List list = memoryHeapDao.getAllMemoryHeapInfos(1L); + Assert.assertNotNull(list); + } + + /** + * functional testing insertMemoryHeapInfos + * + * @tc.name: getMemoryHeapInfos + * @tc.number: OHOS_JAVA_memory_MemoryHeapDao_getMemoryHeapInfos_0001 + * @tc.desc: getMemoryHeapInfos + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetMemoryHeapInfos() { + List list = memoryHeapDao.getMemoryHeapInfos(1L, 0L, 4L); + Assert.assertNotNull(list); + } + + /** + * functional testing deleteSessionData + * + * @tc.name: deleteSessionData + * @tc.number: OHOS_JAVA_memory_MemoryHeapDao_deleteSessionData_0001 + * @tc.desc: deleteSessionData + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testdeleteSessionData() { + memoryHeapDao.deleteSessionData(1L); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryHeapInfoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryHeapInfoTest.java new file mode 100644 index 000000000..d08b8d22a --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryHeapInfoTest.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * @Description MemoryHeapInfoTest + * @Date 2021/4/3 12:22 + **/ +public class MemoryHeapInfoTest { + private MemoryHeapInfo memoryHeapInfo; + + /** + * functional test + * + * @tc.name: getMemoryHeapInfo + * @tc.number: OHOS_JAVA_Service_MemoryHeapInfo_getMemoryHeapInfo_0001 + * @tc.desc: getMemoryHeapInfo + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Before + public void getMemoryHeapInfoTest() { + memoryHeapInfo = new MemoryHeapInfo(); + Assert.assertNotNull(memoryHeapInfo); + } + + /** + * functional test + * + * @tc.name: setHeapId + * @tc.number: OHOS_JAVA_Service_MemoryHeapInfo_setHeapId_0001 + * @tc.desc: setHeapId + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void setHeapIdTest() { + memoryHeapInfo.setHeapId(1); + Assert.assertTrue(true); + memoryHeapInfo.getHeapId(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: setAllocations + * @tc.number: OHOS_JAVA_Service_MemoryHeapInfo_setAllocations_0001 + * @tc.desc: setAllocations + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void setAllocationsTest() { + memoryHeapInfo.setAllocations(2); + Assert.assertTrue(true); + memoryHeapInfo.getAllocations(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: setArrangeStyle + * @tc.number: OHOS_JAVA_Service_MemoryHeapInfo_setArrangeStyle_0001 + * @tc.desc: setArrangeStyle + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void setArrangeStyleTest() { + memoryHeapInfo.setArrangeStyle("xxxx"); + Assert.assertTrue(true); + memoryHeapInfo.getArrangeStyle(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: setCreateTime + * @tc.number: OHOS_JAVA_Service_MemoryHeapInfo_setCreateTime_0001 + * @tc.desc: setCreateTime + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void setCreateTimeTest() { + memoryHeapInfo.setCreateTime(7324L); + Assert.assertTrue(true); + memoryHeapInfo.getCreateTime(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: setSessionId + * @tc.number: OHOS_JAVA_Service_MemoryHeapInfo_setSessionId_0001 + * @tc.desc: setSessionId + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void setSessionIdTest() { + memoryHeapInfo.setSessionId(3243L); + Assert.assertTrue(true); + memoryHeapInfo.getSessionId(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: setClassName + * @tc.number: OHOS_JAVA_Service_MemoryHeapInfo_setClassName_0001 + * @tc.desc: setClassName + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void setClassNameTest() { + memoryHeapInfo.setClassName("test"); + Assert.assertTrue(true); + memoryHeapInfo.getClassName(); + Assert.assertTrue(true); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryHeapTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryHeapTest.java new file mode 100644 index 000000000..26c0f8d72 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryHeapTest.java @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; +import org.apache.logging.log4j.Level; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; + +/** + * 堆数据测试 + * + * @version 1.0 + * @date 2021/03/30 18:56 + **/ +public class MemoryHeapTest { + private MemoryHeapManager memoryHeapManager; + private MemoryInstanceManager memoryInstanceManager; + private MemoryInstanceDetailsManager memoryInstanceDetailsManager; + private ClassInfoManager classInfoManager; + private ClassInfo classInfo; + private MemoryInstanceInfo memoryInstanceInfo; + private MemoryInstanceDetailsInfo memoryInstanceDetailsInfo; + private MemoryHeapInfo memoryHeapInfo; + + /** + * functional test + * + * @tc.name: initObj + * @tc.number: OHOS_JAVA_Service_MemoryHeap_initObj_0001 + * @tc.desc: initObj + * @tc.type: functional testing + * @tc.require: SR000FK61Q + */ + @Before + public void initObj() { + // 应用初始化 Step1 初始化数据中心 + ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + + memoryHeapManager = new MemoryHeapManager(); + memoryInstanceManager = new MemoryInstanceManager(); + memoryInstanceDetailsManager = new MemoryInstanceDetailsManager(); + classInfoManager = new ClassInfoManager(); + classInfo = new ClassInfo(); + classInfo.setcId(2); + classInfo.setClassName("java/Lang/String"); + memoryInstanceInfo = new MemoryInstanceInfo(); + memoryInstanceInfo.setInstanceId(2); + memoryInstanceInfo.setcId(1); + memoryInstanceInfo.setInstance("java/Lang/String"); + memoryInstanceInfo.setCreateTime(20210326L); + memoryInstanceInfo.setAllocTime(20210326L); + memoryInstanceInfo.setDeallocTime(20210328L); + memoryInstanceDetailsInfo = new MemoryInstanceDetailsInfo(); + memoryInstanceDetailsInfo.setInstanceId(1); + memoryInstanceDetailsInfo.setFrameId(1); + memoryInstanceDetailsInfo.setClassName("java/Lang/String"); + memoryInstanceDetailsInfo.setMethodName("init"); + memoryInstanceDetailsInfo.setFieldName("name"); + memoryInstanceDetailsInfo.setLineNumber(2); + memoryHeapInfo = new MemoryHeapInfo(); + memoryHeapInfo.setcId(1); + memoryHeapInfo.setHeapId(1); + memoryHeapInfo.setSessionId(1L); + memoryHeapInfo.setArrangeStyle("name"); + memoryHeapInfo.setAllocations(10); + memoryHeapInfo.setDeallocations(0); + memoryHeapInfo.setTotalCount(79); + memoryHeapInfo.setShallowSize(348L); + memoryHeapInfo.setCreateTime(20210406L); + } + + /** + * functional test + * + * @tc.name: getMemoryHeap + * @tc.number: OHOS_JAVA_Service_MemoryHeap_getMemoryHeap_0001 + * @tc.desc: getMemoryHeap + * @tc.type: functional testing + * @tc.require: SR000FK61Q + */ + @Test + public void getMemoryHeap() { + ArrayList memoryHeapInfos = + memoryHeapManager.getMemoryHeapInfos(19354329L, 20210317L, 20210322L); + Assert.assertNotNull(memoryHeapInfos); + } + + /** + * functional test + * + * @tc.name: getMemoryInstance + * @tc.number: OHOS_JAVA_Service_MemoryHeap_getMemoryInstance_0001 + * @tc.desc: getMemoryInstance + * @tc.type: functional testing + * @tc.require: SR000FK61Q + */ + @Test + public void getMemoryInstance() { + ArrayList memoryInstanceInfos = + memoryInstanceManager.getMemoryInstanceInfos(2, 20210326L, 20210330L); + Assert.assertNotNull(memoryInstanceInfos); + } + + /** + * functional test + * + * @tc.name: getMemoryInstanceDetails + * @tc.number: OHOS_JAVA_Service_MemoryHeap_getMemoryInstanceDetails_0001 + * @tc.desc: getMemoryInstanceDetails + * @tc.type: functional testing + * @tc.require: SR000FK61Q + */ + @Test + public void getMemoryInstanceDetails() { + ArrayList memoryInstanceDetailsInfos = + memoryInstanceDetailsManager.getMemoryInstanceDetailsInfos(2); + Assert.assertNotNull(memoryInstanceDetailsInfos); + } + + /** + * functional test + * + * @tc.name: insertClassInfo + * @tc.number: OHOS_JAVA_Service_MemoryHeap_insertClassInfo_0001 + * @tc.desc: insertClassInfo + * @tc.type: functional testing + * @tc.require: SR000FK61Q + */ + @Test + public void insertClassInfo() { + classInfoManager.insertClassInfo(classInfo); + } + + /** + * functional test + * + * @tc.name: insertMemoryInstanceInfo + * @tc.number: OHOS_JAVA_Service_MemoryHeap_insertMemoryInstanceInfo_0001 + * @tc.desc: insertMemoryInstanceInfo + * @tc.type: functional testing + * @tc.require: SR000FK61Q + */ + @Test + public void insertMemoryInstanceInfo() { + memoryInstanceManager.insertMemoryInstanceInfo(memoryInstanceInfo); + } + + /** + * functional test + * + * @tc.name: insertMemoryInstanceDetailsInfo + * @tc.number: OHOS_JAVA_Service_MemoryHeap_insertMemoryInstanceDetailsInfo_0001 + * @tc.desc: insertMemoryInstanceDetailsInfo + * @tc.type: functional testing + * @tc.require: SR000FK61Q + */ + @Test + public void insertMemoryInstanceDetailsInfo() { + memoryInstanceDetailsManager.insertMemoryInstanceDetailsInfo(memoryInstanceDetailsInfo); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryInstanceDaoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryInstanceDaoTest.java new file mode 100644 index 000000000..54cdbf5df --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryInstanceDaoTest.java @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import ohos.devtools.datasources.utils.session.service.SessionManager; + +/** + * MemoryInstanceDaoTest + * + * @version 1.0 + * @date 2021/04/05 17:12 + **/ +public class MemoryInstanceDaoTest { + private MemoryInstanceDao memoryInstanceDao; + private MemoryInstanceInfo memoryInstanceInfo; + private MemoryInstanceInfo memoryInstance; + + /** + * functional testing getInstance + * + * @tc.name: getInstance + * @tc.number: OHOS_JAVA_Service_MemoryInstanceDao_getInstance_0001 + * @tc.desc: getInstance + * @tc.type: functional testing + * @tc.require: AR000FK61M + */ + @Before + public void getInstance() { + SessionManager.getInstance().setDevelopMode(true); + memoryInstanceDao = MemoryInstanceDao.getInstance(); + memoryInstanceInfo = new MemoryInstanceInfo(); + memoryInstanceInfo.setId(1); + memoryInstanceInfo.setcId(1); + memoryInstanceInfo.setInstance("String Lang"); + memoryInstanceInfo.setInstanceId(2); + memoryInstanceInfo.setAllocTime(1L); + memoryInstanceInfo.setCreateTime(2L); + memoryInstanceInfo.setAllocTime(3L); + memoryInstanceInfo.setDeallocTime(12L); + memoryInstance = new MemoryInstanceInfo(); + memoryInstance.setId(1); + memoryInstance.setcId(1); + memoryInstance.setInstance("god"); + memoryInstance.setInstanceId(3); + memoryInstance.setCreateTime(4L); + memoryInstance.setAllocTime(11L); + memoryInstance.setDeallocTime(22L); + } + + /** + * functional testing createMemoryInstance + * + * @tc.name: createMemoryInstance + * @tc.number: OHOS_JAVA_Service_MemoryInstanceDao_createMemoryInstance_0001 + * @tc.desc: createMemoryInstance + * @tc.type: functional testing + * @tc.require: AR000FK61M + */ + @Test + public void createMemoryInstance() { + SessionManager.getInstance().setDevelopMode(true); + boolean createMemoryResult = memoryInstanceDao.createMemoryInstance(); + Assert.assertTrue(createMemoryResult); + } + + /** + * functional testing insertMemoryInstanceInfo + * + * @tc.name: insertMemoryInstanceInfo + * @tc.number: OHOS_JAVA_Service_MemoryInstanceDao_insertMemoryInstanceInfo_0001 + * @tc.desc: insertMemoryInstanceInfo + * @tc.type: functional testing + * @tc.require: AR000FK61M + */ + @Test + public void testInsertMemoryInstanceInfo() { + memoryInstanceDao.insertMemoryInstanceInfo(memoryInstanceInfo); + } + + /** + * functional testing insertMemoryInstanceInfos + * + * @tc.name: insertMemoryInstanceInfos + * @tc.number: OHOS_JAVA_Service_MemoryInstanceDao_insertMemoryInstanceInfos_0001 + * @tc.desc: insertMemoryInstanceInfos + * @tc.type: functional testing + * @tc.require: AR000FK61M + */ + @Test + public void testInsertMemoryInstanceInfos() { + List list = new ArrayList<>(); + list.add(memoryInstanceInfo); + memoryInstanceDao.insertMemoryInstanceInfos(list); + } + + /** + * functional testing getMemoryInstanceInfos + * + * @tc.name: getMemoryInstanceInfos + * @tc.number: OHOS_JAVA_Service_MemoryInstanceDao_getMemoryInstanceInfos_0001 + * @tc.desc: getMemoryInstanceInfos + * @tc.type: functional testing + * @tc.require: AR000FK61M + */ + @Test + public void testGetMemoryInstanceInfos() { + List list = new ArrayList<>(); + list = memoryInstanceDao.getMemoryInstanceInfos(1, 0L, 5L); + Assert.assertEquals(1, list.size()); + } + + /** + * functional testing getAllMemoryInstanceInfos + * + * @tc.name: getAllMemoryInstanceInfos + * @tc.number: OHOS_JAVA_Service_MemoryInstanceDao_getAllMemoryInstanceInfos_0001 + * @tc.desc: getAllMemoryInstanceInfos + * @tc.type: functional testing + * @tc.require: AR000FK61M + */ + @Test + public void testGetAllMemoryInstanceInfos() { + ArrayList allMemoryInstanceInfos = memoryInstanceDao.getAllMemoryInstanceInfos(); + Assert.assertNotNull(allMemoryInstanceInfos); + } + + /** + * functional testing updateInstanceInfos + * + * @tc.name: updateInstanceInfos + * @tc.number: OHOS_JAVA_Service_MemoryInstanceDao_updateInstanceInfos_0001 + * @tc.desc: updateInstanceInfos + * @tc.type: functional testing + * @tc.require: AR000FK61M + */ + @Test + public void testUpdateInstanceInfos() { + memoryInstanceDao.updateInstanceInfos(13L, 2); + } + + /** + * functional testing deleteSessionData + * + * @tc.name: deleteSessionData + * @tc.number: OHOS_JAVA_Service_MemoryInstanceDao_deleteSessionData_0001 + * @tc.desc: deleteSessionData + * @tc.type: functional testing + * @tc.require: AR000FK61M + */ + @Test + public void testDeleteSessionData() { + memoryInstanceDao.deleteSessionData(1); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryInstanceDetailsDaoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryInstanceDetailsDaoTest.java new file mode 100644 index 000000000..933d551a6 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryInstanceDetailsDaoTest.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; +import org.apache.logging.log4j.Level; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +/** + * MemoryInstanceDetailsDaoTest + * + * @version 1.0 + * @date 2021/04/26 15:56 + **/ +public class MemoryInstanceDetailsDaoTest { + /** + * MemoryInstanceDetailsInfo + */ + private MemoryInstanceDetailsInfo memoryInstanceDetailsInfo; + + /** + * MemoryInstanceDetailsDao + */ + private MemoryInstanceDetailsDao memoryInstanceDetailsDao; + + /** + * functional testing init + * + * @tc.name: init + * @tc.number: OHOS_JAVA_memory_MemoryInstanceDetailsDao_init_0001 + * @tc.desc: init + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Before + public void init() { + // 应用初始化 Step1 初始化数据中心 + ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + memoryInstanceDetailsDao = MemoryInstanceDetailsDao.getInstance(); + memoryInstanceDetailsInfo = new MemoryInstanceDetailsInfo(); + memoryInstanceDetailsInfo.setInstanceId(1); + memoryInstanceDetailsInfo.setClassName("Class"); + memoryInstanceDetailsInfo.setFieldName("field"); + memoryInstanceDetailsInfo.setMethodName("method"); + memoryInstanceDetailsInfo.setFrameId(1); + memoryInstanceDetailsInfo.setLineNumber(1); + memoryInstanceDetailsInfo.setId(1); + } + + /** + * functional testing getInstance + * + * @tc.name: getInstance + * @tc.number: OHOS_JAVA_memory_MemoryInstanceDetailsDao_getInstance_0001 + * @tc.desc: getInstance + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testGetInstance() { + MemoryInstanceDetailsDao instance = MemoryInstanceDetailsDao.getInstance(); + Assert.assertNotNull(instance); + } + + /** + * functional testing insertMemoryInstanceDetailsInfo + * + * @tc.name: insertMemoryInstanceDetailsInfo + * @tc.number: OHOS_JAVA_memory_MemoryInstanceDetailsDao_insertMemoryInstanceDetailsInfo_0001 + * @tc.desc: insertMemoryInstanceDetailsInfo + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testinsertMemoryInstanceDetailsInfo() { + memoryInstanceDetailsDao.insertMemoryInstanceDetailsInfo(memoryInstanceDetailsInfo); + } + + /** + * functional testing insertMemoryInstanceDetailsInfo + * + * @tc.name: insertMemoryInstanceDetailsInfo + * @tc.number: OHOS_JAVA_memory_MemoryInstanceDetailsDao_insertMemoryInstanceDetailsInfo_0001 + * @tc.desc: insertMemoryInstanceDetailsInfo + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testinsertMemoryInstanceDetailsInfos() { + List list = new ArrayList<>(); + list.add(memoryInstanceDetailsInfo); + memoryInstanceDetailsDao.insertMemoryInstanceDetailsInfo(list); + } + + /** + * functional testing getMemoryInstanceDetails + * + * @tc.name: getMemoryInstanceDetails + * @tc.number: OHOS_JAVA_memory_MemoryInstanceDetailsDao_getMemoryInstanceDetails_0001 + * @tc.desc: getMemoryInstanceDetails + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetMemoryInstanceDetails() { + List list = memoryInstanceDetailsDao.getMemoryInstanceDetails(1); + Assert.assertNotNull(list); + } + + /** + * functional testing getAllMemoryInstanceDetails + * + * @tc.name: getAllMemoryInstanceDetails + * @tc.number: OHOS_JAVA_memory_MemoryInstanceDetailsDao_getAllMemoryInstanceDetails_0001 + * @tc.desc: getAllMemoryInstanceDetails + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testgetAllMemoryInstanceDetails() { + List list = memoryInstanceDetailsDao.getAllMemoryInstanceDetails(); + Assert.assertNotNull(list); + } + + /** + * functional testing deleteSessionData + * + * @tc.name: deleteSessionData + * @tc.number: OHOS_JAVA_memory_MemoryInstanceDetailsDao_deleteSessionData_0001 + * @tc.desc: deleteSessionData + * @tc.type: functional testing + * @tc.require: AR000FK61N + */ + @Test + public void testdeleteSessionData() { + memoryInstanceDetailsDao.deleteSessionData(1L); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryInstanceDetailsInfoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryInstanceDetailsInfoTest.java new file mode 100644 index 000000000..78e35f18a --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryInstanceDetailsInfoTest.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * @Description MemoryInstanceDetailsInfoTest + * @Date 2021/4/3 20:10 + **/ +public class MemoryInstanceDetailsInfoTest { + /** + * memoryInstanceDetailsInfo + */ + public MemoryInstanceDetailsInfo memoryInstanceDetailsInfo; + + /** + * functional test + * + * @tc.name: init + * @tc.number: OHOS_JAVA_Service_MemoryInstanceDetailsInfo_init_0001 + * @tc.desc: init + * @tc.type: functional testing + * @tc.require: AR000FK61P + */ + @Before + public void init() { + memoryInstanceDetailsInfo = new MemoryInstanceDetailsInfo(); + } + + /** + * functional test + * + * @tc.name: test + * @tc.number: OHOS_JAVA_Service_MemoryInstanceDetailsInfo_test_0001 + * @tc.desc: test + * @tc.type: functional testing + * @tc.require: AR000FK61P + */ + @Test + public void test() { + memoryInstanceDetailsInfo.setInstanceId(3); + memoryInstanceDetailsInfo.setClassName("test"); + memoryInstanceDetailsInfo.setFieldName("tste"); + memoryInstanceDetailsInfo.setMethodName("test"); + memoryInstanceDetailsInfo.setId(1); + memoryInstanceDetailsInfo.setLineNumber(2); + memoryInstanceDetailsInfo.getInstanceId(); + memoryInstanceDetailsInfo.getClassName(); + memoryInstanceDetailsInfo.getFieldName(); + memoryInstanceDetailsInfo.getMethodName(); + memoryInstanceDetailsInfo.getId(); + memoryInstanceDetailsInfo.getLineNumber(); + memoryInstanceDetailsInfo.toString(); + Assert.assertNotNull(memoryInstanceDetailsInfo); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryInstanceInfoTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryInstanceInfoTest.java new file mode 100644 index 000000000..00facad13 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryInstanceInfoTest.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +import org.junit.Test; + +/** + * @Description MemoryInstanceInfoTest + * @Date 2021/4/2 10:39 + **/ +public class MemoryInstanceInfoTest { + /** + * functional test + * + * @tc.name: getInstance + * @tc.number: OHOS_JAVA_Service_MemoryInstanceInfo_getInstance_0001 + * @tc.desc: getInstance + * @tc.type: functional testing + * @tc.require: AR000FK61R + */ + @Test + public void getInstance() { + MemoryInstanceInfo memoryInstanceInfo = new MemoryInstanceInfo(); + memoryInstanceInfo.setInstance("ddd"); + memoryInstanceInfo.setAllocTime(123712L); + memoryInstanceInfo.setDeallocTime(123412L); + memoryInstanceInfo.setId(32); + memoryInstanceInfo.getInstance(); + memoryInstanceInfo.getAllocTime(); + memoryInstanceInfo.getDeallocTime(); + memoryInstanceInfo.getId(); + memoryInstanceInfo.toString(); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryServiceTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryServiceTest.java new file mode 100644 index 000000000..7e691eb0f --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/services/memory/MemoryServiceTest.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.services.memory; + +/** + * @Description MemoryServiceTest + * @Date 2021/4/3 18:51 + **/ +public class MemoryServiceTest { +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/FilledLineChartTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/FilledLineChartTest.java new file mode 100644 index 000000000..bc72cedd9 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/FilledLineChartTest.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts; + +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * @Description FilledLineChartTest + * @Date 2021/4/2 13:48 + **/ +public class FilledLineChartTest { + private ProfilerChartsView profilerChartsView; + + private FilledLineChart filledLineChart; + + /** + * functional test + * + * @tc.name: getFilledLineChart + * @tc.number: OHOS_JAVA_View_FilledLineChart_getFilledLineChart_0001 + * @tc.desc: getFilledLineChart + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Before + public void getFilledLineChart() { + profilerChartsView = new ProfilerChartsView(39999, true, new TaskScenePanelChart()); + filledLineChart = new FilledLineChart(profilerChartsView); + Assert.assertNotNull(filledLineChart); + } + + /** + * functional test + * + * @tc.name: paintComponent + * @tc.number: OHOS_JAVA_View_FilledLineChart_paintComponent_0001 + * @tc.desc: paintComponent + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void paintComponentTest() { + filledLineChart.revalidate(); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/ProfilerChartTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/ProfilerChartTest.java new file mode 100644 index 000000000..e105074c7 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/ProfilerChartTest.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts; + +import ohos.devtools.views.charts.model.ChartDataModel; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.awt.Color; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; + +/** + * Chart的抽象父类的测试类 + * + * @since 2021/3/31 16:26 + */ +public class ProfilerChartTest { + private static final int TEST_START = 0; + + private static final int TEST_END = 1000; + + private static final int TEST_TIME1 = 333; + + private static final int TEST_TIME2 = 666; + + private static final int TEST_INDEX1 = 1; + + private static final int TEST_INDEX2 = 2; + + private static final int TEST_VALUE1 = 10; + + private static final int TEST_VALUE2 = 20; + + private ProfilerChartsView view; + + private LinkedHashMap> dataMap; + + /** + * init + * + * @tc.name: init + * @tc.number: OHOS_JAVA_View_ProfilerChart_init_0001 + * @tc.desc: init + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Before + public void init() { + initView(); + initDataMap(); + } + + private void initView() { + view = new ProfilerChartsView(LayoutConstants.NUM_L, true, new TaskScenePanelChart()); + view.getObserver().getStandard().updateDisplayTimeRange(TEST_START, TEST_END); + } + + private void initDataMap() { + dataMap = new LinkedHashMap<>(); + ChartDataModel model1 = new ChartDataModel(); + model1.setIndex(TEST_INDEX1); + model1.setName("Java"); + model1.setColor(Color.GRAY); + model1.setValue(TEST_VALUE1); + List list1 = Collections.singletonList(model1); + dataMap.put(TEST_TIME1, list1); + ChartDataModel model2 = new ChartDataModel(); + model2.setIndex(TEST_INDEX2); + model2.setName("Java"); + model2.setColor(Color.GRAY); + model2.setValue(TEST_VALUE2); + List list2 = Collections.singletonList(model2); + dataMap.put(TEST_TIME2, list2); + } + + /** + * refresh chart test + * + * @tc.name: refreshChart + * @tc.number: OHOS_JAVA_View_ProfilerChart_refreshChart_0001 + * @tc.desc: refreshChart + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void refreshChartTest() { + ProfilerChart chart = new FilledLineChart(view); + chart.refreshChart(TEST_START, TEST_END, dataMap); + Assert.assertTrue(true); + } + + /** + * get bottomPanel test + * + * @tc.name: getBottomPanel + * @tc.number: OHOS_JAVA_View_ProfilerChart_getBottomPanel_0001 + * @tc.desc: getBottomPanel + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void getBottomPanelTest() { + ProfilerChartsView profilerChartsView = new FilledLineChart(view).getBottomPanel(); + Assert.assertNotNull(profilerChartsView); + } + + /** + * functional test + * + * @tc.name: getEndTime + * @tc.number: OHOS_JAVA_View_ProfilerChart_getEndTime_0001 + * @tc.desc: getEndTime + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void getEndTimeTest() { + int endTime = new FilledLineChart(view).getEndTime(); + Assert.assertNotNull(endTime); + } + + /** + * functional test + * + * @tc.name: getStartTime + * @tc.number: OHOS_JAVA_View_ProfilerChart_getStartTime_0001 + * @tc.desc: getStartTime + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void getStartTimeTest() { + int startTime = new FilledLineChart(view).getStartTime(); + Assert.assertNotNull(startTime); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/tooltip/LegendTooltipTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/tooltip/LegendTooltipTest.java new file mode 100644 index 000000000..35b6cc343 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/tooltip/LegendTooltipTest.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.tooltip; + +import com.intellij.ui.JBColor; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.awt.event.MouseEvent; +import java.util.Collections; +import java.util.List; + +/** + * 自定义Tooltip的测试类 + * + * @since 2021/3/31 15:56 + */ +public class LegendTooltipTest { + private static final String TEST_TIME = "00:23:189"; + private static final String TEST_TEXT = "Java:123MB"; + private ProfilerChartsView view; + private List tooltipItems; + + /** + * functional test + * + * @tc.name: init + * @tc.number: OHOS_JAVA_View_LegendTooltip_init_0001 + * @tc.desc: init + * @tc.type: functional testing + * @tc.require: SR000FK5SL + */ + @Before + public void init() { + view = new ProfilerChartsView(LayoutConstants.NUM_L, true, new TaskScenePanelChart()); + tooltipItems = Collections.singletonList(new TooltipItem(JBColor.GRAY, TEST_TEXT)); + } + + /** + * functional test + * + * @tc.name: getInstance + * @tc.number: OHOS_JAVA_View_LegendTooltip_getInstance_0001 + * @tc.desc: getInstance + * @tc.type: functional testing + * @tc.require: SR000FK5SL + */ + @Test + public void getInstanceTest() { + Assert.assertNotNull(LegendTooltip.getInstance()); + } + + /** + * functional test + * + * @tc.name: hideTip + * @tc.number: OHOS_JAVA_View_LegendTooltip_hideTip_0001 + * @tc.desc: hideTip + * @tc.type: functional testing + * @tc.require: SR000FK5SL + */ + @Test + public void hideTipTest() { + LegendTooltip.getInstance().hideTip(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: showTip + * @tc.number: OHOS_JAVA_View_LegendTooltip_showTip_0001 + * @tc.desc: showTip + * @tc.type: functional testing + * @tc.require: SR000FK5SL + */ + @Test + public void showTipTest() { + LegendTooltip.getInstance().showTip(view, TEST_TIME, "0", tooltipItems, true); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: followWithMouse + * @tc.number: OHOS_JAVA_View_LegendTooltip_followWithMouse_0001 + * @tc.desc: followWithMouse + * @tc.type: functional testing + * @tc.require: SR000FK5SL + */ + @Test + public void followWithMouseTest() { + MouseEvent mouseEvent = new MouseEvent(view, 0, 1L, 0, 0, 0, 1, false); + LegendTooltip.getInstance().followWithMouse(mouseEvent); + Assert.assertTrue(true); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/tooltip/TooltipColorRectTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/tooltip/TooltipColorRectTest.java new file mode 100644 index 000000000..a3c12eadb --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/tooltip/TooltipColorRectTest.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.tooltip; + +import org.junit.Assert; +import org.junit.Test; + +import java.awt.Color; + +/** + * TooltipColorRectTest + * + * @version 1.0 + * @Date 2021/4/3 21:10 + **/ +public class TooltipColorRectTest { + /** + * functional test + * + * @tc.name: test + * @tc.number: OHOS_JAVA_View_TooltipColorRect_test_0001 + * @tc.desc: test + * @tc.type: functional testing + * @tc.require: AR000FK5SM + */ + @Test + public void test01() { + TooltipColorRect tooltipColorRect = new TooltipColorRect(new Color(255, 255, 255)); + Assert.assertNotNull(tooltipColorRect); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/utils/ChartConstantsTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/utils/ChartConstantsTest.java new file mode 100644 index 000000000..de5bee656 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/utils/ChartConstantsTest.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.utils; + +import org.junit.Assert; +import org.junit.Test; + +import java.awt.Color; + +/** + * @Description ChartConstantsTest + * @Date 2021/4/3 18:00 + **/ +public class ChartConstantsTest { + /** + * functional test + * + * @tc.name: init + * @tc.number: OHOS_JAVA_View_ChartConstants_init_0001 + * @tc.desc: init + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + public void init() { + } + + /** + * functional test + * + * @tc.name: test + * @tc.number: OHOS_JAVA_View_ChartConstants_test_0001 + * @tc.desc: test + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void test() { + int test01 = ChartConstants.INITIAL_VALUE; + Assert.assertEquals(-1, test01); + int test02 = ChartConstants.CHART_HEADER_HEIGHT; + Assert.assertEquals(20, test02); + int test03 = ChartConstants.SCALE_LINE_LEN; + Assert.assertEquals(4, test03); + int test04 = ChartConstants.UNIT; + Assert.assertEquals(1024, test04); + float test05 = ChartConstants.OPAQUE_VALUE; + Assert.assertNotNull(test05); + int test06 = ChartConstants.Y_AXIS_STR_OFFSET_X; + Assert.assertEquals(15, test06); + int test07 = ChartConstants.Y_AXIS_STR_OFFSET_Y; + Assert.assertEquals(5, test07); + float test08 = ChartConstants.TRANSLUCENT_VALUE; + Assert.assertNotNull(test08); + Color test09 = ChartConstants.DEFAULT_CHART_COLOR; + Assert.assertNotNull(test09); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/utils/ChartUtilsTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/utils/ChartUtilsTest.java new file mode 100644 index 000000000..c832a6c9d --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/utils/ChartUtilsTest.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.utils; + +import org.junit.Assert; +import org.junit.Test; + +import java.math.BigDecimal; + +/** + * Test class of Chart-related tool classes + * + * @since 2021/3/31 16:27 + */ +public class ChartUtilsTest { + private static final int[] TEST_ARRAY = {0, 10, 14, 24, 29, 32, 37, 40, 45}; + private static final int SEARCH_VALUE = 34; + private static final int EXPECT_VALUE = 5; + private static final double TEST_NUM1 = 23.51D; + private static final int TEST_NUM2 = 4; + private static final int MULTIPLY_RESULT_INT = 94; + private static final int DIVIDE_RESULT_INT = 5; + private static final long TEST_MS = 32349; + private static final String FORMAT_RESULT = "00:32:349 "; + + /** + * functional test + * + * @tc.name: searchClosestIndex + * @tc.number: OHOS_JAVA_View_ChartUtils_searchClosestIndex_0001 + * @tc.desc: searchClosestIndex + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void searchClosestIndexTest() { + int index = ChartUtils.searchClosestIndex(TEST_ARRAY, SEARCH_VALUE); + Assert.assertEquals(EXPECT_VALUE, index); + } + + /** + * functional test + * + * @tc.name: multiply + * @tc.number: OHOS_JAVA_View_ChartUtils_multiply_0001 + * @tc.desc: multiply + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void multiplyTest() { + BigDecimal num1 = new BigDecimal(TEST_NUM1); + int result = ChartUtils.multiply(num1, TEST_NUM2); + Assert.assertEquals(MULTIPLY_RESULT_INT, result); + } + + /** + * functional test + * + * @tc.name: divide + * @tc.number: OHOS_JAVA_View_ChartUtils_divide_0001 + * @tc.desc: divide + * @tc.type: functional testing + * @tc.require: AR000FK5SN + */ + @Test + public void divideTest1() { + int result = ChartUtils.divide(TEST_NUM1, TEST_NUM2).intValue(); + Assert.assertEquals(DIVIDE_RESULT_INT, result); + } + + /** + * functional test + * + * @tc.name: divideInt + * @tc.number: OHOS_JAVA_View_ChartUtils_divideInt_0001 + * @tc.desc: divideInt + * @tc.type: functional testing + * @tc.require: AR000FK5SN + */ + @Test + public void divideIntTest2() { + int result = ChartUtils.divideInt(TEST_NUM1, TEST_NUM2); + Assert.assertEquals(DIVIDE_RESULT_INT, result); + } + + /** + * functional test + * + * @tc.name: divide + * @tc.number: OHOS_JAVA_View_ChartUtils_divide_0001 + * @tc.desc: divide + * @tc.type: functional testing + * @tc.require: AR000FK5SN + */ + @Test + public void divideTest2() { + int result = ChartUtils.divide(TEST_NUM1, new BigDecimal(TEST_NUM2)); + Assert.assertEquals(DIVIDE_RESULT_INT, result); + } + + /** + * functional test + * + * @tc.name: formatTime + * @tc.number: OHOS_JAVA_View_ChartUtils_formatTime_0001 + * @tc.desc: formatTime + * @tc.type: functional testing + * @tc.require: AR000FK5SN + */ + @Test + public void formatTimeTest() { + String result = ChartUtils.formatTime(TEST_MS); + Assert.assertEquals(FORMAT_RESULT, result); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/utils/LineChartTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/utils/LineChartTest.java new file mode 100644 index 000000000..8c00a4e8d --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/charts/utils/LineChartTest.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.charts.utils; + +import ohos.devtools.views.charts.LineChart; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * Chart相关的工具类的测试类 + * + * @since 2021/4/25 14:02 + */ +public class LineChartTest { + /** + * ProfilerChartsView + */ + private ProfilerChartsView view; + + /** + * functional testing + * + * @tc.name: init + * @tc.number: OHOS_JAVA_View_LineChart_init_0001 + * @tc.desc: init + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Before + public void init() { + view = new ProfilerChartsView(LayoutConstants.NUM_L, true, new TaskScenePanelChart()); + } + + /** + * functional testing + * + * @tc.name: LineChartTest + * @tc.number: OHOS_JAVA_View_LineChart_LineChartTest_0001 + * @tc.desc: LineChartTest + * @tc.type: functional testing + * @tc.require: AR000FK5UI + */ + @Test + public void LineChartTest() { + LineChart lineChart = new LineChart(view); + Assert.assertNotNull(lineChart); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/common/CommonTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/CommonTest.java new file mode 100644 index 000000000..6f117b0b8 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/CommonTest.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common; + +import org.junit.Before; +import org.junit.Test; + +import javax.swing.JPanel; +import javax.swing.JTabbedPane; + +/** + * @Description CommonTest + * @Date 2021/4/5 13:15 + **/ +public class CommonTest { + private Common common; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_Common_init_0001 + * @tc.desc: chart util test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Before + public void init() { + common = new Common(); + } + + /** + * update number + * + * @tc.name: 主界面-chart页面 + * @tc.number: OHOS_JAVA_views_Common_updateNum_0001 + * @tc.desc: chart页面工具相关功能接口测试 + * @tc.type: 功能测试 + * @tc.require: SR-001-AR-003 + */ + @Test + public void updateNum() { + JPanel jPanel7 = new JPanel(); + JPanel jPanel4 = new JPanel(); + JPanel jPanel1 = new JPanel(); + jPanel1.add(jPanel4); + jPanel1.add(jPanel7); + JPanel jPanel5 = new JPanel(); + JPanel jPanel2 = new JPanel(); + jPanel2.add(jPanel5); + jPanel2.add(jPanel7); + JPanel jPanel3 = new JPanel(); + JPanel jPanel6 = new JPanel(); + jPanel3.add(jPanel6); + jPanel3.add(jPanel7); + JTabbedPane jTabbedPane = new JTabbedPane(); + jTabbedPane.addTab("test01", jPanel1); + jTabbedPane.addTab("test02", jPanel2); + jTabbedPane.addTab("test03", jPanel3); + common.updateNum(jTabbedPane); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/common/OperationUtilsTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/OperationUtilsTest.java new file mode 100644 index 000000000..1b2e5b303 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/OperationUtilsTest.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common; + +import org.junit.Assert; +import org.junit.Test; + +import java.math.BigDecimal; + +/** + * ViewUtils test + * + * @since 2021/3/31 14:13 + */ +public class OperationUtilsTest { + private static final int[] TEST_ARRAY = {0, 10, 14, 24, 29, 32, 37, 40, 45}; + + private static final double TEST_NUM1 = 23.51D; + + private static final int TEST_NUM2 = 4; + + private static final int MULTIPLY_RESULT_INT = 94; + + private static final int DIVIDE_RESULT_INT = 5; + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ViewUtils_multiply_0001 + * @tc.desc: chart Timeline test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Test + public void multiplyTest() { + BigDecimal num1 = new BigDecimal(TEST_NUM1); + int result = OperationUtils.multiply(num1, TEST_NUM2); + Assert.assertEquals(MULTIPLY_RESULT_INT, result); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ViewUtils_divide_0001 + * @tc.desc: chart Timeline test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Test + public void divideTest1() { + int result = OperationUtils.divide(TEST_NUM1, TEST_NUM2).intValue(); + Assert.assertEquals(DIVIDE_RESULT_INT, result); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ViewUtils_divideInt_0001 + * @tc.desc: chart Timeline test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Test + public void divideIntTest2() { + int result = OperationUtils.divideInt(TEST_NUM1, TEST_NUM2); + Assert.assertEquals(DIVIDE_RESULT_INT, result); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ViewUtils_divide_0001 + * @tc.desc: chart Timeline test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Test + public void divideTest2() { + int result = OperationUtils.divide(TEST_NUM1, new BigDecimal(TEST_NUM2)); + Assert.assertEquals(DIVIDE_RESULT_INT, result); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/common/chart/ProfilerScrollbarTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/chart/ProfilerScrollbarTest.java new file mode 100644 index 000000000..7234b2abd --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/chart/ProfilerScrollbarTest.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.chart; + +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.awt.Component; +import java.awt.AWTException; + +/** + * profiler scrollbar test + * + * @since 2021/3/31 15:44 + */ +public class ProfilerScrollbarTest { + private ProfilerScrollbar bar; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerTimeline_paint_0001 + * @tc.desc: chart Timeline functional test + * @tc.type: profiler scrollbar test + * @tc.require: SR-002-AR-001 + */ + @Before + public void init() { + ProfilerChartsView view = new ProfilerChartsView(LayoutConstants.NUM_L, true, new TaskScenePanelChart()); + view.initScrollbar(); + Component[] components = view.getComponents(); + for (Component comp : components) { + if (comp instanceof ProfilerScrollbar) { + bar = (ProfilerScrollbar) comp; + break; + } + } + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerTimeline_paint_0001 + * @tc.desc: chart Timeline functional test + * @tc.type: profiler scrollbar test + * @tc.require: SR-002-AR-001 + */ + @Test + public void resizeAndRepositionTest() { + ProfilerChartsView view = new ProfilerChartsView(LayoutConstants.NUM_L, true, new TaskScenePanelChart()); + new ProfilerScrollbar(view).resizeAndReposition(); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerTimeline_paint_0001 + * @tc.desc: chart Timeline functional test + * @tc.type: profiler scrollbar test + * @tc.require: SR-002-AR-001 + * @throws AWTException throw AWTException + */ + @Test + public void initDragPressTimeTest() throws AWTException { + ProfilerChartsView view = new ProfilerChartsView(LayoutConstants.NUM_L, true, new TaskScenePanelChart()); + ProfilerScrollbar profilerScrollbar = new ProfilerScrollbar(view); + Assert.assertTrue(true); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/common/chart/ProfilerTimelineTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/chart/ProfilerTimelineTest.java new file mode 100644 index 000000000..8e60ab97f --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/chart/ProfilerTimelineTest.java @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.chart; + +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.junit.Before; +import org.junit.Test; + +/** + * @Description profiler time line test + * @Date 2021/4/3 20:29 + **/ +public class ProfilerTimelineTest { + private ProfilerTimeline profilerTimeline; + + private ProfilerChartsView profilerChartsView; + + private TaskScenePanelChart taskScenePanelChart; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: DFX_DFT_Hilog_Java_views_0005 + * @tc.desc: chart Timeline functional test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Before + public void init() { + taskScenePanelChart = new TaskScenePanelChart(); + profilerChartsView = new ProfilerChartsView(23423L, true, new TaskScenePanelChart()); + profilerTimeline = new ProfilerTimeline(profilerChartsView, 200, 200, taskScenePanelChart); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerTimeline_addTablePanel_0001 + * @tc.desc: chart Timeline functional test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void addTablePanel01() { + profilerTimeline.addTablePanel(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerTimeline_removeTablePanel_0001 + * @tc.desc: chart Timeline functional test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void removeTablePanel01() { + profilerTimeline.removeTablePanel(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerTimeline_setEndTime_0001 + * @tc.desc: chart Timeline functional test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void setEndTime01() { + profilerTimeline.setEndTime(234); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerTimeline_setMaxDisplayTime_0001 + * @tc.desc: chart Timeline functional test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void setMaxDisplayTime01() { + profilerTimeline.setMaxDisplayTime(234); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerTimeline_setMinMarkInterval_0001 + * @tc.desc: chart Timeline functional test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void setMinMarkInterval01() { + profilerTimeline.setMinMarkInterval(234); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerTimeline_setStartTime_0001 + * @tc.desc: chart Timeline functional test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void setStartTime01() { + profilerTimeline.setStartTime(234); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerTimeline_getEndTime_0001 + * @tc.desc: chart Timeline functional test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void getEndTime01() { + profilerTimeline.getEndTime(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerTimeline_getStartTime_0001 + * @tc.desc: chart Timeline functional test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void getStartTime01() { + profilerTimeline.getStartTime(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerTimeline_paint_0001 + * @tc.desc: chart Timeline functional test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void paint01() { + profilerTimeline.revalidate(); + profilerTimeline.repaint(); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/common/chart/treetable/DataNodeComparesTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/chart/treetable/DataNodeComparesTest.java new file mode 100644 index 000000000..5e24fbacd --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/chart/treetable/DataNodeComparesTest.java @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.chart.treetable; + +import ohos.devtools.views.common.LayoutConstants; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; + +/** + * DataNodeCompares sorting test + * + * @Description DataNodeCompares sorting test + * @Date 2021/4/5 13:15 + **/ +public class DataNodeComparesTest { + private DataNodeCompares dataNodeCompares; + private Comparator comparator; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DataNodeCompares_init_0001 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Before + public void init() { + dataNodeCompares = new DataNodeCompares(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DataNodeCompares_init_0001 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @After + public void after() { + DataNode dataNode1 = new DataNode(); + DataNode dataNode2 = new DataNode(); + DataNode dataNode3 = new DataNode(); + DataNode dataNode4 = new DataNode(); + dataNode1.addChildren(dataNode2); + dataNode3.addChildren(dataNode4); + dataNode1.addChildren(dataNode3); + ArrayList dataNodes = new ArrayList<>(); + dataNodes.add(dataNode1); + Collections.sort(dataNodes, comparator); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DataNodeCompares_chooseCompare_0001 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void chooseCompare01() { + comparator = dataNodeCompares.chooseCompare(0, LayoutConstants.ASC); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DataNodeCompares_chooseCompare_0002 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void chooseCompare02() { + comparator = dataNodeCompares.chooseCompare(1, LayoutConstants.ASC); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DataNodeCompares_chooseCompare_0003 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void chooseCompare03() { + comparator = dataNodeCompares.chooseCompare(2, LayoutConstants.ASC); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DataNodeCompares_chooseCompare_0004 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void chooseCompare04() { + comparator = dataNodeCompares.chooseCompare(3, LayoutConstants.ASC); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DataNodeCompares_chooseCompare_0005 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void chooseCompare05() { + comparator = dataNodeCompares.chooseCompare(4, LayoutConstants.ASC); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DataNodeCompares_chooseCompare_0006 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void chooseCompare06() { + comparator = dataNodeCompares.chooseCompare(0, "test"); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DataNodeCompares_chooseCompare_0007 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void chooseCompare07() { + comparator = dataNodeCompares.chooseCompare(1, "test"); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DataNodeCompares_chooseCompare_0008 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void chooseCompare08() { + comparator = dataNodeCompares.chooseCompare(2, "test"); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DataNodeCompares_chooseCompare_0009 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void chooseCompare09() { + comparator = dataNodeCompares.chooseCompare(3, "test"); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DataNodeCompares_chooseCompare_0010 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void chooseCompare10() { + comparator = dataNodeCompares.chooseCompare(4, "test"); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/common/chart/treetable/JTreeTableTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/chart/treetable/JTreeTableTest.java new file mode 100644 index 000000000..2497757fa --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/chart/treetable/JTreeTableTest.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.chart.treetable; + +import org.junit.Before; +import org.junit.Test; + +import javax.swing.JPanel; +import java.util.Locale; + +/** + * @Description JTreeTable test + * @Date 2021/4/5 13:15 + **/ +public class JTreeTableTest { + /** + * JTreeTable + */ + private JTreeTable jTreeTable; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_JTreeTable_init_0001 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Before + public void init() { + jTreeTable = new JTreeTable(new AgentDataModel(new DataNode())); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_JTreeTable_getTreeTableModel_0001 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void getTreeTableModel() { + TreeTableModel treeTableModel = jTreeTable.getTreeTableModel(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_JTreeTable_setTreeTableModel_0001 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void setTreeTableModel() { + TreeTableModel treeTableModel = jTreeTable.getTreeTableModel(); + jTreeTable.setTreeTableModel(treeTableModel); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_JTreeTable_convertRowToText_0001 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void convertRowToText() { + Locale defaultLocale = JTreeTable.TreeTableCellRenderer.getDefaultLocale(); + JTreeTable.TreeTableCellRenderer.setDefaultLocale(defaultLocale); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_JTreeTable_setBounds_0001 + * @tc.desc: chart of Memory functional test + * @tc.type: functional testing + * @tc.require: SR-001-AR-003 + */ + @Test + public void setBounds() { + boolean lightweightComponent = JTreeTable.TreeTableCellRenderer.isLightweightComponent(new JPanel()); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/common/hoscomp/HosDialogTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/hoscomp/HosDialogTest.java new file mode 100644 index 000000000..7d7b5dea4 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/hoscomp/HosDialogTest.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.common.hoscomp; + +import ohos.devtools.datasources.utils.monitorconfig.service.MonitorConfigManager; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.swing.SampleDialogWrapper; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.apache.logging.log4j.LogManager; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PowerMockIgnore; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +import java.util.HashMap; +import java.util.LinkedList; + +/** + * @Description HosDialog test + * @Date 2021/4/3 20:29 + **/ +@RunWith(PowerMockRunner.class) +@PrepareForTest({SampleDialogWrapper.class, HosDialog.class, LogManager.class}) +@PowerMockIgnore({"javax.swing.*"}) +public class HosDialogTest { + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_HosDialog_getSessionInfo_0001 + * @tc.desc: chart HosDialog test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + * @throws Exception throw Exception + */ + @Test + public void getSessionInfo() throws Exception { + SampleDialogWrapper mock = PowerMockito.mock(SampleDialogWrapper.class); + PowerMockito.mockStatic(LogManager.class); + PowerMockito.whenNew(SampleDialogWrapper.class).withAnyArguments().thenReturn(mock); + Mockito.when(mock.showAndGet()).thenReturn(true); + HashMap> stringLinkedListHashMap = new HashMap<>(); + LinkedList strings = new LinkedList<>(); + strings.add("java"); + strings.add("native"); + stringLinkedListHashMap.put("Memory", strings); + MonitorConfigManager.dataMap.put(23478L, stringLinkedListHashMap); + HosDialog hosDialog = new HosDialog(23478L, new ProfilerChartsView(23478L, false, new TaskScenePanelChart())); + HosDialog hosDialog1 = new HosDialog(23478L, new ProfilerChartsView(23478L, true, new TaskScenePanelChart())); + hosDialog.getSessionInfo(); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/common/treetable/DataNodeComparesTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/treetable/DataNodeComparesTest.java new file mode 100644 index 000000000..d62ceb8d1 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/treetable/DataNodeComparesTest.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package ohos.devtools.views.common.treetable; + +import ohos.devtools.views.common.chart.treetable.DataNodeCompares; +import org.junit.Assert; +import org.junit.Test; + +import java.util.Comparator; + +/** + * DataNodeCompares test + * + * @Description DataNodeCompares test + * @Date 2021/4/3 20:29 + **/ +public class DataNodeComparesTest { + /** + * test int + */ + private DataNodeCompares dataNodeCompares = new DataNodeCompares(); + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNodeCompares_classNameString + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void testclassNameString() { + Comparator classNameCompareAsc = dataNodeCompares.chooseCompare(0, "ASCENDING"); + Comparator allocationsCompareAsc = dataNodeCompares.chooseCompare(1, "ASCENDING"); + Comparator deallocationsCompareAsc = dataNodeCompares.chooseCompare(2, "ASCENDING"); + Comparator totalCompareAsc = dataNodeCompares.chooseCompare(3, "ASCENDING"); + Comparator shallowSizeCompareAsc = dataNodeCompares.chooseCompare(4, "ASCENDING"); + Comparator classNameCompareDsc = dataNodeCompares.chooseCompare(0, "ASCENDING1"); + Comparator allocationsCompareDsc = dataNodeCompares.chooseCompare(1, "ASCENDING1"); + Comparator deallocationsCompareDsc = dataNodeCompares.chooseCompare(2, "ASCENDING1"); + Comparator totalCompareDsc = dataNodeCompares.chooseCompare(3, "ASCENDING1"); + Comparator shallowSizeCompareDsc = dataNodeCompares.chooseCompare(4, "ASCENDING1"); + Comparator classNameString = DataNodeCompares.classNameString; + Assert.assertNotNull(classNameCompareAsc); + Assert.assertNotNull(classNameCompareDsc); + Assert.assertNotNull(allocationsCompareAsc); + Assert.assertNotNull(allocationsCompareDsc); + Assert.assertNotNull(deallocationsCompareAsc); + Assert.assertNotNull(deallocationsCompareDsc); + Assert.assertNotNull(totalCompareAsc); + Assert.assertNotNull(totalCompareDsc); + Assert.assertNotNull(shallowSizeCompareAsc); + Assert.assertNotNull(shallowSizeCompareDsc); + Assert.assertNotNull(classNameString); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/common/treetable/DataNodeTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/treetable/DataNodeTest.java new file mode 100644 index 000000000..ad8e25855 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/common/treetable/DataNodeTest.java @@ -0,0 +1,347 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package ohos.devtools.views.common.treetable; + +import ohos.devtools.views.common.Constant; +import ohos.devtools.views.common.ViewConstants; +import ohos.devtools.views.common.chart.treetable.DataNode; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; + +/** + * DataNodeTest + * + * @Description DataNode test + * @Date 2021/4/3 20:29 + **/ +public class DataNodeTest { + /** + * id + */ + private Integer id = ViewConstants.NUM_2; + + /** + * cId + */ + private Integer cId = ViewConstants.NUM_3; + + /** + * heapId + */ + private Integer heapId = ViewConstants.NUM_4; + + /** + * sessionId + */ + private Long sessionId = Constant.ABNORMAL; + + /** + * className + */ + private String className = Constant.CPU_PLUG_NAME; + + /** + * allocations + */ + private Integer allocations = ViewConstants.NUM_5; + + /** + * deallocations + */ + private Integer deallocations = ViewConstants.NUM_6; + + /** + * totalCount + */ + private Integer totalCount = ViewConstants.NUM_7; + + /** + * shallowSize + */ + private Long shallowSize = Constant.ABNORMAL; + + /** + * dataNode + */ + private DataNode dataNode = new DataNode(); + + /** + * dataNodeOteher + */ + private DataNode dataNodeOteher = new DataNode(); + + /** + * children + */ + private ArrayList children = new ArrayList<>(); + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Before + public void initObj() { + dataNode.setId(id); + dataNode.setcId(cId); + dataNode.setHeapId(heapId); + dataNode.setSessionId(sessionId); + dataNode.setClassName(className); + dataNode.setAllocations(allocations); + dataNode.setDeallocations(deallocations); + dataNode.setTotalCount(totalCount); + dataNode.setShallowSize(shallowSize); + dataNode.setChildren(children); + dataNodeOteher.setId(2); + dataNodeOteher.setcId(2); + dataNodeOteher.setHeapId(2); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void getIdTest() { + int idTest = dataNode.getId(); + Assert.assertEquals(idTest, ViewConstants.NUM_2); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void getCIdTest() { + int cidTest = dataNode.getcId(); + Assert.assertEquals(cidTest, ViewConstants.NUM_3); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void getHeapIdTest() { + int heapIdTest = dataNode.getHeapId(); + Assert.assertEquals(heapIdTest, ViewConstants.NUM_4); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void getSessionIdTest() { + long num = dataNode.getSessionId(); + Assert.assertEquals(num, -1); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void getClassNameTest() { + String name = dataNode.getClassName(); + Assert.assertEquals(name, Constant.CPU_PLUG_NAME); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void getAllocationsTest() { + int num = dataNode.getAllocations(); + Assert.assertEquals(num, ViewConstants.NUM_5); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void getDeallocationsTest() { + int num = dataNode.getDeallocations(); + Assert.assertEquals(num, ViewConstants.NUM_6); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void getTotalCountTest() { + int num = dataNode.getTotalCount(); + Assert.assertEquals(num, ViewConstants.NUM_7); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void getShallowSizeTest() { + long num = dataNode.getShallowSize(); + Assert.assertEquals(num, -1); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void addChildrenTest() { + dataNode.addChildren(dataNode); + ArrayList childrenTest = dataNode.getChildren(); + Assert.assertNotNull(childrenTest); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void equalsTest() { + boolean flag = dataNode.equals(dataNodeOteher); + Assert.assertFalse(flag); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void equalsTest1() { + boolean flag = dataNode.equals(dataNode); + Assert.assertTrue(flag); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void hashCodeTest() { + int num = dataNode.hashCode(); + Assert.assertNotNull(num); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void toStrTest() { + String str = dataNode.toStr(); + Assert.assertNotNull(str); + } + + /** + * functional testing + * + * @tc.name: sort + * @tc.number: OHOS_JAVA_treetable_DataNode_initObj + * @tc.desc: sort + * @tc.type: functional testing + * @tc.require: SR000FK5S6 + */ + @Test + public void toStringTest() { + String str = dataNode.toString(); + Assert.assertNotNull(str); + } + +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/HomeWindowTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/HomeWindowTest.java new file mode 100644 index 000000000..943c3142c --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/HomeWindowTest.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; +import ohos.devtools.views.layout.swing.HomeWindow; +import org.apache.logging.log4j.Level; +import org.junit.Before; +import org.junit.Test; + +/** + * @Description frame test + * @Date 2021/4/2 11:25 + **/ +public class HomeWindowTest { + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_HomeWindow_data_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Before + public void data() { + // Application initialization Step1 Initialize the data center + ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_HomeWindow_getHomeWindow_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void getHomeWindow() { + new HomeWindow(); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/ProfilerChartsViewTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/ProfilerChartsViewTest.java new file mode 100644 index 000000000..b6755751e --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/ProfilerChartsViewTest.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview; + +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.ProfilerMonitorItem; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import javax.swing.JPanel; + +/** + * ProfilerChartsView test + * + * @since 2021/2/10 10:43 + */ +public class ProfilerChartsViewTest { + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_refreshView_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + private ProfilerChartsView view; + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_initObj_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Before + public void initObj() { + view = new ProfilerChartsView(LayoutConstants.NUM_L, true, new TaskScenePanelChart()); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_initScrollbar_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Test + public void initScrollbarTest() { + view.initScrollbar(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_removeScrollbar_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Test + public void removeScrollbarTest() { + view.initScrollbar(); + view.removeScrollbar(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_addMonitorItemView_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Test + public void addMonitorItemViewTest() { + view.addMonitorItemView(ProfilerMonitorItem.MEMORY); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_addMemoryStageView_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Test + public void addMemoryStageViewTest() { + MemoryStageView memoryStageView = view.addMemoryStageView(); + Assert.assertNotNull(memoryStageView); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_compRulerDrawn_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Test + public void compRulerDrawnTest() { + view.compRulerDrawn(new JPanel()); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_resetRulerDrawStatus_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Test + public void resetRulerDrawStatusTest() { + view.resetRulerDrawStatus(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_refreshCompRuler_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Test + public void refreshCompRulerTest() { + view.refreshCompRuler(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_getMainPanel_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Test + public void getMainPanelTest() { + JPanel jPanel = view.getMainPanel(); + Assert.assertNotNull(jPanel); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_getRulerXCoordinate_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-002-AR-001 + */ + @Test + public void getRulerXCoordinateTest() { + int number = view.getRulerXCoordinate(); + Assert.assertNotNull(number); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/CacheObserverTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/CacheObserverTest.java new file mode 100644 index 000000000..204157be8 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/CacheObserverTest.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview.observer; + +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; +import org.junit.Before; +import org.junit.Test; + +/** + * @Description CacheObserver test + * @Date 2021/4/2 11:25 + **/ +public class CacheObserverTest { + /** + * Cache observer + */ + public CacheObserver cacheObserver; + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_CacheObserver_init_0001 + * @tc.desc: chart CacheObserver test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Before + public void init() { + cacheObserver = new CacheObserver(37L); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_CacheObserver_refreshStandard_0001 + * @tc.desc: chart CacheObserver test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void refreshStandard() { + cacheObserver.refreshStandard(new ChartStandard(37L), 10, 50, 30); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_CacheObserver_refreshView_0001 + * @tc.desc: chart CacheObserver test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void refreshView01() { + cacheObserver.refreshView(new ChartDataRange(), 21L, true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_CacheObserver_refreshView_0002 + * @tc.desc: chart CacheObserver test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void refreshView02() { + ChartDataRange chartDataRange = new ChartDataRange(); + chartDataRange.setEndTime(-2); + cacheObserver.refreshView(chartDataRange, 21L, false); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_CacheObserver_refreshView_0003 + * @tc.desc: chart CacheObserver test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void refreshView03() { + ChartDataRange chartDataRange = new ChartDataRange(); + chartDataRange.setEndTime(510); + cacheObserver.refreshView(chartDataRange, 21L, true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_CacheObserver_refreshView_0004 + * @tc.desc: chart CacheObserver test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void refreshView04() { + ChartDataRange chartDataRange = new ChartDataRange(); + chartDataRange.setEndTime(510); + cacheObserver.refreshView(chartDataRange, 21L, false); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/MemoryChartObserverTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/MemoryChartObserverTest.java new file mode 100644 index 000000000..10749a7a0 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/MemoryChartObserverTest.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview.observer; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.ProfilerMonitorItem; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.chartview.event.IChartEventObserver; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.apache.logging.log4j.Level; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.List; + +/** + * MemoryChartObserver test + * + * @since 2021/3/31 20:03 + */ +public class MemoryChartObserverTest { + private static final int TEST_START = 0; + private static final int TEST_END = 9000; + private static final int TEST_DISPLAY = 10000; + private static final int TEST_MARK = 1000; + private MemoryChartObserver observer; + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_MemoryChartObserver_init_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Before + public void init() { + // 应用初始化 Step1 初始化数据中心 + ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + ProfilerChartsView view = new ProfilerChartsView(LayoutConstants.NUM_L, true, new TaskScenePanelChart()); + view.addMonitorItemView(ProfilerMonitorItem.MEMORY); + + List observers = view.getObserver().getListeners(); + for (IChartEventObserver event : observers) { + if (event instanceof MemoryChartObserver) { + observer = (MemoryChartObserver) event; + break; + } + } + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_MemoryChartObserver_init_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void refreshStandardTest() { + ChartStandard newStandard = new ChartStandard(0L); + newStandard.setMaxDisplayMillis(TEST_DISPLAY); + newStandard.setMinMarkInterval(TEST_MARK); + observer.refreshStandard(newStandard, TEST_START, TEST_END, TEST_DISPLAY); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_MemoryChartObserver_init_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void refreshViewTest() { + ChartDataRange range = new ChartDataRange(); + range.setStartTime(TEST_START); + range.setEndTime(TEST_END); + observer.refreshView(range, 0L, false); + Assert.assertTrue(true); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/MemoryStageObserverTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/MemoryStageObserverTest.java new file mode 100644 index 000000000..64763af25 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/MemoryStageObserverTest.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview.observer; + +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.ProfilerMonitorItem; +import ohos.devtools.views.layout.chartview.MemoryStageView; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.chartview.event.IChartEventObserver; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.List; + +/** + * MemoryStageObserver test + * + * @since 2021/3/31 20:16 + */ +public class MemoryStageObserverTest { + private static final int TEST_START = 0; + + private static final int TEST_END = 9000; + + private static final int TEST_DISPLAY = 10000; + + private static final int TEST_MARK = 1000; + + private MemoryStageObserver observer; + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_MemoryStageObserver_init_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Before + public void init() { + ProfilerChartsView view = new ProfilerChartsView(LayoutConstants.NUM_L, true, new TaskScenePanelChart()); + view.addMonitorItemView(ProfilerMonitorItem.MEMORY); + MemoryStageView memoryStageView = view.addMemoryStageView(); + memoryStageView.addChart(); + + List observers = view.getObserver().getListeners(); + for (IChartEventObserver event : observers) { + if (event instanceof MemoryStageObserver) { + observer = (MemoryStageObserver) event; + break; + } + } + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_MemoryStageObserver_refreshStandard_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void refreshStandardTest() { + ChartStandard newStandard = new ChartStandard(0L); + newStandard.setMaxDisplayMillis(TEST_DISPLAY); + newStandard.setMinMarkInterval(TEST_MARK); + observer.refreshStandard(newStandard, TEST_START, TEST_END, TEST_DISPLAY); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_MemoryStageObserver_refreshView_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void refreshViewTest() { + ChartDataRange range = new ChartDataRange(); + range.setStartTime(TEST_START); + range.setEndTime(TEST_END); + observer.refreshView(range, 0L, false); + Assert.assertTrue(true); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/ProfilerChartsViewObserverTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/ProfilerChartsViewObserverTest.java new file mode 100644 index 000000000..33a0cc8b8 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/ProfilerChartsViewObserverTest.java @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview.observer; + +import ohos.devtools.datasources.utils.common.util.DateTimeUtil; +import ohos.devtools.datasources.utils.quartzmanager.QuartzManager; +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.chartview.event.IChartEventObserver; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import static ohos.devtools.views.common.LayoutConstants.CHART_START_DELAY; + +/** + * ProfilerChartsViewObserver test + * + * @since 2021/3/31 18:46 + */ +public class ProfilerChartsViewObserverTest { + /** + * log + */ + private static final Logger LOGGER = LogManager.getLogger(ProfilerChartsViewObserverTest.class); + + /** + * Chart RUN_NAME + */ + private static final String RUN_NAME = "ProfilerChartsViewMonitorTimer"; + + /** + * Chart RUN_NAME_SCROLLBAR + */ + private static final String RUN_NAME_SCROLLBAR = "ScrollbarTimer"; + + private static final long TEST_START_LONG = 1617188313000L; + + private static final long TEST_END_LONG = 1617188323111L; + + private static final int TEST_START = 0; + + private static final int TEST_END = 9000; + + private static final int TEST_DISPLAY = 10000; + + private static final int TEST_MARK = 1000; + + private static final int TEST_NEW_START = 2000; + + private static final int TEST_NEW_END = 12000; + + private ProfilerChartsViewObserver observer; + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_init_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Before + public void init() { + ProfilerChartsView view = new ProfilerChartsView(LayoutConstants.NUM_L, true, new TaskScenePanelChart()); + observer = view.getObserver(); + boolean isScrollbarShow = false; + ChartStandard standard = new ChartStandard(324L); + standard.setFirstTimestamp(32478L); + standard.setLastTimestamp(3274973L); + standard.updateSelectedStart(3); + standard.updateSelectedEnd(34453); + QuartzManager.getInstance().addExecutor(RUN_NAME, () -> { + // 保存LastTimestamp,为当前时间戳减去Chart启动延迟 + standard.setLastTimestamp(DateTimeUtil.getNowTimeLong() - CHART_START_DELAY); + int end = (int) (standard.getLastTimestamp() - standard.getFirstTimestamp()); + int start = end > standard.getMaxDisplayMillis() ? end - standard.getMaxDisplayMillis() : 0; + }); + QuartzManager.getInstance().addExecutor(RUN_NAME_SCROLLBAR, () -> { + // 保存LastTimestamp,为当前时间戳减去Chart启动延迟 + standard.setLastTimestamp(DateTimeUtil.getNowTimeLong() - CHART_START_DELAY); + int end = (int) (standard.getLastTimestamp() - standard.getFirstTimestamp()); + int start = end > standard.getMaxDisplayMillis() ? end - standard.getMaxDisplayMillis() : 0; + }); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_showTraceResult_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void showTraceResultTest() { + observer.showTraceResult(TEST_START_LONG, TEST_END_LONG); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_startRefresh_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void startRefreshTest() { + observer.startRefresh(TEST_START_LONG); + destroy(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_pauseRefresh_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void pauseRefreshTest() { + observer.startRefresh(TEST_START_LONG); + observer.pauseRefresh(); + destroy(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_stopRefresh_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void stopRefreshTest() { + observer.startRefresh(TEST_START_LONG); + observer.stopRefresh(false); + destroy(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_restartRefresh_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void restartRefreshTest() { + observer.startRefresh(TEST_START_LONG); + observer.stopRefresh(false); + observer.restartRefresh(); + destroy(); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_attach_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void attachTest() { + IChartEventObserver ob = new IChartEventObserver() { + @Override + public void refreshStandard(ChartStandard standard, int startTime, int endTime, int maxDisplayTime) { + } + + @Override + public void refreshView(ChartDataRange range, long firstTimestamp, boolean isUseCache) { + } + }; + observer.attach(ob); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_detach_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void detachTest() { + IChartEventObserver ob = new IChartEventObserver() { + @Override + public void refreshStandard(ChartStandard standard, int startTime, int endTime, int maxDisplayTime) { + } + + @Override + public void refreshView(ChartDataRange range, long firstTimestamp, boolean isUseCache) { + } + }; + observer.attach(ob); + observer.detach(ob); + observer.detach(null); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_notifyRefresh_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void notifyRefreshTest() { + observer.notifyRefresh(TEST_START, TEST_END); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_charZoom_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void charZoomTest() { + observer.charZoom(TEST_START, TEST_END, TEST_DISPLAY); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_msTimeZoom_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void msTimeZoomTest() { + observer.msTimeZoom(TEST_DISPLAY, TEST_MARK, TEST_NEW_START, TEST_NEW_END); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ProfilerChartsView_destroy_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + private void destroy() { + QuartzManager.getInstance().endExecutor(RUN_NAME); + QuartzManager.getInstance().endExecutor(RUN_NAME_SCROLLBAR); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/TimelineObserverTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/TimelineObserverTest.java new file mode 100644 index 000000000..d55321a6b --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/chartview/observer/TimelineObserverTest.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.chartview.observer; + +import ohos.devtools.views.charts.model.ChartDataRange; +import ohos.devtools.views.charts.model.ChartStandard; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import ohos.devtools.views.layout.chartview.event.IChartEventObserver; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.List; + +/** + * TimelineObserver test + * + * @since 2021/3/31 19:51 + */ +public class TimelineObserverTest { + private static final int TEST_START = 0; + + private static final int TEST_END = 9000; + + private static final int TEST_DISPLAY = 10000; + + private static final int TEST_MARK = 1000; + + private TimelineObserver observer; + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TimelineObserver_init_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Before + public void init() { + ProfilerChartsView view = new ProfilerChartsView(LayoutConstants.NUM_L, true, new TaskScenePanelChart()); + List observers = view.getObserver().getListeners(); + for (IChartEventObserver event : observers) { + if (event instanceof TimelineObserver) { + observer = (TimelineObserver) event; + break; + } + } + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TimelineObserver_refreshStandard_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void refreshStandardTest() { + ChartStandard newStandard = new ChartStandard(0L); + newStandard.setMaxDisplayMillis(TEST_DISPLAY); + newStandard.setMinMarkInterval(TEST_MARK); + observer.refreshStandard(newStandard, TEST_START, TEST_END, TEST_DISPLAY); + Assert.assertTrue(true); + } + + /** + * functional test + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TimelineObserver_refreshView_0001 + * @tc.desc: chart Memory test + * @tc.type: functional test + * @tc.require: SR-001-AR-003 + */ + @Test + public void refreshViewTest() { + ChartDataRange range = new ChartDataRange(); + range.setStartTime(TEST_START); + range.setEndTime(TEST_END); + observer.refreshView(range, 0L, false); + Assert.assertTrue(true); + } +} diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/DeviceProcessJpanelEventTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/DeviceProcessJpanelEventTest.java new file mode 100644 index 000000000..8a045a87f --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/DeviceProcessJpanelEventTest.java @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.device.service.MultiDeviceManager; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; +import ohos.devtools.datasources.utils.quartzmanager.QuartzManager; +import ohos.devtools.datasources.utils.session.service.SessionManager; +import ohos.devtools.views.layout.swing.DeviceProcessJpanel; +import ohos.devtools.views.layout.swing.TaskScenePanel; +import org.apache.logging.log4j.Level; +import org.junit.Before; +import org.junit.Test; + +import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; + +import static ohos.devtools.views.common.Constant.DEVICEREFRESH; + +/** + * @Description DeviceProcessJpanelEventTest + * @Date 2021/4/3 16:14 + **/ +public class DeviceProcessJpanelEventTest { + private DeviceProcessJpanelEvent deviceProcessJpanelEvent; + private DeviceProcessJpanel deviceProcessJpanel; + private List processInfos; + private TaskScenePanel taskScenePanel; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DeviceProcessJpanelEvent_init_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-001-AR-001 + */ + @Before + public void init() { + SessionManager.getInstance().setDevelopMode(true); + ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + MultiDeviceManager.getInstance(); + processInfos = new ArrayList<>(); + ProcessInfo process = new ProcessInfo(); + process.setDeviceId("fffff"); + process.setProcessId(43543); + process.setProcessName("435gs"); + processInfos.add(process); + deviceProcessJpanel = new DeviceProcessJpanel(new TaskScenePanelEvent(), new JPanel(), new TaskScenePanel()); + deviceProcessJpanelEvent = new DeviceProcessJpanelEvent(); + deviceProcessJpanelEvent.searchJButtonSelect(deviceProcessJpanel, processInfos); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DeviceProcessJpanelEvent_devicesInfoJComboBoxUpdate_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-001-AR-001 + */ + @Test + public void devicesInfoJComboBoxUpdateTest01() { + deviceProcessJpanelEvent.devicesInfoJComboBoxUpdate(deviceProcessJpanel); + QuartzManager.getInstance().startExecutor(DEVICEREFRESH, 0, 5); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DeviceProcessJpanelEvent_searchJButtonSelect_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-001-AR-001 + */ + @Test + public void searchJButtonSelectTest() { + List processInfo = new ArrayList<>(); + deviceProcessJpanelEvent.searchJButtonSelect(deviceProcessJpanel, processInfo); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DeviceProcessJpanelEvent_itemStateChanged_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-001-AR-001 + */ + @Test + public void itemStateChangedTest01() { + deviceProcessJpanelEvent.itemStateChanged(deviceProcessJpanel, taskScenePanel, "test", new JPanel()); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DeviceProcessJpanelEvent_itemStateChanged_0002 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-001-AR-001 + */ + @Test + public void itemStateChangedTest02() { + deviceProcessJpanelEvent.itemStateChanged(deviceProcessJpanel, taskScenePanel, "", new JPanel()); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DeviceProcessJpanelEvent_itemStateChanged_0003 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-001-AR-001 + */ + @Test + public void itemStateChangedTest03() { + deviceProcessJpanelEvent.itemStateChanged(deviceProcessJpanel, taskScenePanel, "", null); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_DeviceProcessJpanelEvent_itemStateChanged_0004 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-001-AR-001 + */ + @Test + public void itemStateChangedTest04() { + deviceProcessJpanelEvent.itemStateChanged(deviceProcessJpanel, taskScenePanel, null, null); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/HomeWindowEventTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/HomeWindowEventTest.java new file mode 100644 index 000000000..4c93c55e9 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/HomeWindowEventTest.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import ohos.devtools.views.layout.swing.HomeWindow; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * @Description HomeWindowEventTest + * @Date 2021/4/3 16:10 + **/ +public class HomeWindowEventTest { + private HomeWindowEvent homeWindowEvent; + private HomeWindow homeWindow; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_HomeWindowEvent_init_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Before + public void init() { + homeWindowEvent = new HomeWindowEvent(); + homeWindow = new HomeWindow(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_HomeWindowEvent_clickAddTask_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void clickAddTaskTest() { + homeWindowEvent.clickAddTask(homeWindow); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_HomeWindowEvent_clickUpdateLogLevel_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void clickUpdateLogLevelTest() { + homeWindowEvent.clickUpdateLogLevel(homeWindow); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/TaskPanelEventTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/TaskPanelEventTest.java new file mode 100644 index 000000000..6689d0598 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/TaskPanelEventTest.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import ohos.devtools.views.layout.swing.TaskPanel; +import ohos.devtools.views.layout.swing.TaskScenePanel; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import javax.swing.JPanel; +import java.awt.Component; + +/** + * @Description TaskPanelEventTest + * @Date 2021/4/3 14:35 + **/ +public class TaskPanelEventTest { + private TaskScenePanelEvent taskScenePanelEvent; + private TaskScenePanel taskScenePanel; + private TaskPanel taskPanel; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskPanelEvent_getTaskScenePanel_0001 + * @tc.desc: chart Memory test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Before + public void getTaskScenePanelEvent() { + taskScenePanelEvent = new TaskScenePanelEvent(); + taskScenePanel = new TaskScenePanel(); + taskPanel = new TaskPanel(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskPanelEvent_clickClose_0001 + * @tc.desc: chart Memory test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void clickCloseTest() { + taskScenePanelEvent.clickAddDevice(taskScenePanel, taskScenePanelEvent); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskPanelEvent_checkBoxSelect_0001 + * @tc.desc: chart Memory test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void checkBoxSelectTest() { + taskScenePanelEvent.checkBoxSelect(taskScenePanel); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskPanelEvent_lastStep_0001 + * @tc.desc: chart Memory test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void lastStepTest() { + taskScenePanelEvent.lastStep(taskScenePanel, taskPanel); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskPanelEvent_listenerJPanelSouth_0001 + * @tc.desc: chart Memory test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void listenerJPanelSouthTest() { + taskScenePanelEvent.listenerJPanelSouth(taskScenePanel); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskPanelEvent_judgCompontent_0001 + * @tc.desc: chart Memory test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void judgCompontentTest() { + taskScenePanelEvent.judgCompontent(new Component[] {new JPanel()}, "error"); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskPanelEvent_startTask_0001 + * @tc.desc: chart Memory test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void startTaskTest() { + taskScenePanelEvent.startTask(taskScenePanel, taskPanel); + Assert.assertTrue(true); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/TaskScenePanelChartEventTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/TaskScenePanelChartEventTest.java new file mode 100644 index 000000000..7b0dab7ed --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/TaskScenePanelChartEventTest.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import ohos.devtools.views.common.hoscomp.HosJButton; +import ohos.devtools.views.layout.swing.TaskScenePanelChart; +import org.junit.Before; +import org.junit.Test; + +/** + * @Description TaskPanelEventTest + * @Date 2021/4/3 14:35 + **/ +public class TaskScenePanelChartEventTest { + private TaskScenePanelChartEvent taskScenePanelChartEvent; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanelChartEvent_getTaskScenePanelChartEvent_0001 + * @tc.desc: chart Memory test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Before + public void getTaskScenePanelChartEvent() { + taskScenePanelChartEvent = new TaskScenePanelChartEvent(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanelChartEvent_clickDelete_0001 + * @tc.desc: chart Memory test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void clickDelete() { + taskScenePanelChartEvent.clickDelete(new TaskScenePanelChart()); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanelChartEvent_getjButtonUp_0001 + * @tc.desc: chart Memory test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void getjButtonUp() { + TaskScenePanelChart taskScenePanelChart = new TaskScenePanelChart(); + taskScenePanelChartEvent.clickDelete(taskScenePanelChart); + HosJButton jButtonDelete = taskScenePanelChart.getJButtonDelete(); + jButtonDelete.doClick(); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/TaskScenePanelEventTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/TaskScenePanelEventTest.java new file mode 100644 index 000000000..465167074 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/event/TaskScenePanelEventTest.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.event; + +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo; +import ohos.devtools.datasources.utils.process.entity.ProcessInfo; +import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; +import ohos.devtools.views.common.Constant; +import ohos.devtools.views.common.hoscomp.HosJLabel; +import ohos.devtools.views.layout.swing.TaskPanel; +import ohos.devtools.views.layout.swing.TaskScenePanel; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.core.util.Assert; +import org.junit.Before; +import org.junit.Test; + +import javax.swing.JPanel; +import java.awt.Component; +import java.util.HashMap; +import java.util.List; + +/** + * @Description TaskPanelEventTest + * @Date 2021/4/3 14:35 + **/ +public class TaskScenePanelEventTest { + private TaskScenePanelEvent taskScenePanelEvent; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanelEvent_getTaskScenePanelEvent_0001 + * @tc.desc: chart scene test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Before + public void getTaskScenePanelEvent() { + ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + taskScenePanelEvent = new TaskScenePanelEvent(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanelEvent_obtainMap_0001 + * @tc.desc: chart scene test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void obtainMap() { + DeviceIPPortInfo deviceIPPortInfo = new DeviceIPPortInfo(); + deviceIPPortInfo.setPort(5555); + deviceIPPortInfo.setIp(""); + ProcessInfo processInfo = new ProcessInfo(); + HashMap deviceIPPortInfoProcessInfoHashMap = new HashMap<>(); + deviceIPPortInfoProcessInfoHashMap.put(deviceIPPortInfo, processInfo); + Constant.map.put("test", deviceIPPortInfoProcessInfoHashMap); + TaskScenePanel taskScenePanel = new TaskScenePanel(); + taskScenePanel.addCheckBox(); + TaskPanel taskPanel = new TaskPanel(); + List hosJLabels = taskScenePanelEvent.obtainMap(taskScenePanel, taskPanel); + Assert.isEmpty(hosJLabels); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanelEvent_gain_0001 + * @tc.desc: chart scene test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void gain() { + JPanel taskPanel = new JPanel(); + String gain = taskScenePanelEvent.gain(taskPanel); + org.junit.Assert.assertNotNull(gain); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanelEvent_judgCompontent_0001 + * @tc.desc: chart scene test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void judgCompontent() { + JPanel jPanel = new JPanel(); + JPanel jPanel2 = new JPanel(); + jPanel.add(jPanel2); + Component[] components = jPanel.getComponents(); + String test = taskScenePanelEvent.judgCompontent(components, "test"); + org.junit.Assert.assertNotNull(test); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanelEvent_lastStep_0001 + * @tc.desc: chart scene test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void lastStep() { + TaskScenePanel taskScenePanel = new TaskScenePanel(); + TaskPanel taskPanel = new TaskPanel(); + taskScenePanelEvent.lastStep(taskScenePanel, taskPanel); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanelEvent_listenerJPanelSouth_0001 + * @tc.desc: chart scene test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void listenerJPanelSouth() { + TaskScenePanel taskScenePanel = new TaskScenePanel(); + taskScenePanelEvent.listenerJPanelSouth(taskScenePanel); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/GraphicsJpanelTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/GraphicsJpanelTest.java new file mode 100644 index 000000000..15717be1f --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/GraphicsJpanelTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import org.junit.Test; + +/** + * @Description GraphicsJpanelTest + * @Date 2021/4/3 14:35 + **/ +public class GraphicsJpanelTest { + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_GraphicsJpanel_paint_0001 + * @tc.desc: chart scene test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void paint() { + GraphicsJpanel graphicsJpanel = new GraphicsJpanel(new TaskPanel()); + graphicsJpanel.repaint(); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/LevelTablePanelTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/LevelTablePanelTest.java new file mode 100644 index 000000000..62565e96a --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/LevelTablePanelTest.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.views.common.chart.treetable.DataNode; +import ohos.devtools.views.common.chart.treetable.JTreeTable; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import javax.swing.JPanel; + +/** + * @Description LevelTablePanelTest + * @Date 2021/4/2 12:57 + **/ +public class LevelTablePanelTest { + private JPanel jPanel = new JPanel(); + private LevelTablePanel LevelTablePanel; + private JTreeTable jTreeTable; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_LevelTablePanel_getLevelTablePanel_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-004 + */ + @Before + public void getLevelTablePanel() { + TaskScenePanelChart panel = new TaskScenePanelChart(); + ProfilerChartsView view = new ProfilerChartsView(0L, true, panel); + ProfilerChartsView.sessionMap.put(0L, view); + + view.getObserver().getStandard().updateSelectedStart(3); + view.getObserver().getStandard().updateSelectedEnd(34453); + LevelTablePanel = new LevelTablePanel(jPanel, 0L); + Assert.assertNotNull(LevelTablePanel); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_LevelTablePanel_createTable_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-004 + */ + @Test + public void createTableTest() { + LevelTablePanel.createTable(jPanel, 0L); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_LevelTablePanel_getSuspensionTable_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-004 + */ + @Test + public void getSuspensionTableTest() { + LevelTablePanel.getSuspensionTable(); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_LevelTablePanel_setSuspensionTable_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-004 + */ + @Test + public void setSuspensionTableTest() { + LevelTablePanel.setSuspensionTable(jPanel); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_LevelTablePanel_initData_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-004 + */ + @Test + public void initDataTest() { + LevelTablePanel.initData(0L); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_LevelTablePanel_buildClassNode_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-004 + */ + @Test + public void buildClassNodeTest() { + DataNode dataNode = LevelTablePanel.buildClassNode(null); + Assert.assertNotNull(dataNode); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_LevelTablePanel_buildClassNode_0002 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-004 + */ + @Test + public void buildClassNodeTest01() { + DataNode dataNode01 = LevelTablePanel.buildClassNode(null); + DataNode dataNode02 = LevelTablePanel.buildClassNode(null); + Assert.assertEquals(dataNode01, dataNode02); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_LevelTablePanel_selectData_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-004 + */ + @Test + public void selectDataTest() { + JPanel jPanels = LevelTablePanel.selectData(jTreeTable); + Assert.assertNotNull(jPanels); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/SaveTraceDialogTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/SaveTraceDialogTest.java new file mode 100644 index 000000000..fb3deb360 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/SaveTraceDialogTest.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.LayoutConstants; +import ohos.devtools.views.common.hoscomp.HosJButton; +import org.junit.Test; +import org.powermock.api.mockito.PowerMockito; + +import javax.swing.JPanel; +import java.awt.Dimension; + +/** + * Save Trace Dialog Test + * + * @version 1.0 + * @date 2021/4/2 13:00 + **/ +public class SaveTraceDialogTest { + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_SaveTraceDialog_getSaveTraceDialog_0001 + * @tc.desc: chart trace test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void getSaveTraceDialog() { + try { + JPanel fileJpanel = new JPanel(null); + fileJpanel.setPreferredSize(new Dimension(LayoutConstants.FOUR_HUNDRED, LayoutConstants.TWO_HUNDRED_SIXTY)); + fileJpanel.setBackground(ColorConstants.HOME_PANE); + SampleDialogWrapper mock = PowerMockito.mock(SampleDialogWrapper.class); + PowerMockito.whenNew(SampleDialogWrapper.class).withArguments("Save The Task", fileJpanel).thenReturn(mock); + SaveTraceDialog saveTraceDialog = new SaveTraceDialog(); + saveTraceDialog.showCustomDialog(new HosJButton("dd", "ddd")); + } catch (Exception exception) { + exception.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/SuspensionTablePanelTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/SuspensionTablePanelTest.java new file mode 100644 index 000000000..42d389012 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/SuspensionTablePanelTest.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.datasources.utils.session.service.SessionManager; +import ohos.devtools.views.layout.chartview.ProfilerChartsView; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import javax.swing.JLayeredPane; +import javax.swing.JPanel; +import javax.swing.table.DefaultTableModel; + +/** + * @Description SuspensionTablePanelTest + * @Date 2021/4/3 10:33 + **/ +public class SuspensionTablePanelTest { + /** + * SESSIONID + */ + private static final long SESSIONID = 0L; + + /** + * SuspensionTablePanel + */ + private SuspensionTablePanel suspensionTablePanel = new SuspensionTablePanel(); + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_SuspensionTablePanel_createSuspensionTableTest_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-005 + */ + @Before + public void createSuspensionTableTest() { + SessionManager.getInstance().setDevelopMode(true); + TaskScenePanelChart panel = new TaskScenePanelChart(); + ProfilerChartsView view = new ProfilerChartsView(SESSIONID, true, panel); + ProfilerChartsView.sessionMap.put(SESSIONID, view); + + view.getObserver().getStandard().updateSelectedStart(3); + view.getObserver().getStandard().updateSelectedEnd(34453); + JPanel suspensionTable = suspensionTablePanel.createSuspensionTable(new JPanel(), 1, SESSIONID, "test"); + Assert.assertNotNull(suspensionTable); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_SuspensionTablePanel_initData_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-005 + */ + @Test + public void initDataTest() { + suspensionTablePanel.initData(new DefaultTableModel(), 1, "test", SESSIONID); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_SuspensionTablePanel_createChildTable_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-005 + */ + @Test + public void createChildTableTrueTest() { + suspensionTablePanel.createChildTable(1, true, new JPanel(), new JLayeredPane()); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_SuspensionTablePanel_createChildTable_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-005 + */ + @Test + public void createChildTableFalseTest() { + suspensionTablePanel.createChildTable(1, false, new JPanel(), new JLayeredPane()); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_SuspensionTablePanel_selectData_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-005 + */ + @Test + public void selectDataTest() { + suspensionTablePanel.selectData(); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_SuspensionTablePanel_insertData_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-005 + */ + @Test + public void insertDataTest() { + suspensionTablePanel.insertData(new DefaultTableModel(), "2", ""); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_SuspensionTablePanel_selectData_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-001-AR-005 + */ + @Test + public void selectData() { + suspensionTablePanel.selectData(new DefaultTableModel()); + Assert.assertTrue(true); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/TaskPanelTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/TaskPanelTest.java new file mode 100644 index 000000000..e341ffec2 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/TaskPanelTest.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import com.intellij.ui.components.JBTabbedPane; +import ohos.devtools.views.common.ColorConstants; +import ohos.devtools.views.common.Constant; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import javax.swing.JLabel; +import javax.swing.JPanel; +import java.awt.Color; + +/** + * @Description TaskPanelTest + * @Date 2021/4/3 15:27 + **/ +public class TaskPanelTest { + private HomeWindow homeWindow; + private TaskPanel taskPanel; + private TaskPanelWelcome taskPanelWelcome; + private JPanel jPanel; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskPanel_init_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Before + public void init() { + homeWindow = new HomeWindow(); + taskPanelWelcome = new TaskPanelWelcome(); + jPanel = homeWindow.getTaskPanel(); + Constant.jtasksTab = new JBTabbedPane(); + taskPanel = new TaskPanel(jPanel, taskPanelWelcome); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskPanel_setAttributes_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void setAttributesTest01() { + taskPanel.setAttributes(jPanel); + JLabel chooseButton = taskPanel.getChooseButton(); + Assert.assertEquals(Color.WHITE, chooseButton.getForeground()); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskPanel_setAttributes_0002 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void setAttributesTest02() { + taskPanel.setAttributes(null); + JLabel chooseButton = taskPanel.getChooseButton(); + Assert.assertEquals(Color.WHITE, chooseButton.getForeground()); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskPanel_setAttributes_0003 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void setAttributesTest03() { + taskPanel.setAttributes(new JPanel()); + JLabel chooseButton = taskPanel.getChooseButton(); + Assert.assertEquals(Color.WHITE, chooseButton.getForeground()); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskPanel_taskLabel_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void taskLabelTest01() { + JLabel jLabel = new JLabel(); + taskPanel.taskLabel(jLabel, new JLabel(), new JLabel()); + Assert.assertEquals(ColorConstants.APPLYTUN_COLOR, jLabel.getBackground()); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskPanel_taskLabel_0002 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void taskLabelTest02() { + taskPanel.taskLabel(null, null, null); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/TaskScenePanelChartTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/TaskScenePanelChartTest.java new file mode 100644 index 000000000..e2b7d70dc --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/TaskScenePanelChartTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import ohos.devtools.views.common.hoscomp.HosJLabel; +import org.junit.Test; + +import java.util.ArrayList; + +/** + * @Description TaskScenePanelChartTest + * @Date 2021/4/2 13:07 + **/ +public class TaskScenePanelChartTest { + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanelChart_getTaskScenePanelChart_0001 + * @tc.desc: chart scene test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void getTaskScenePanelChart() { + ArrayList hosJLabels = new ArrayList<>(); + HosJLabel hosJLabel = new HosJLabel(); + hosJLabel.setFirstStamp(32445L); + hosJLabels.add(hosJLabel); + new TaskScenePanelChart(new TaskPanel(), hosJLabels); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/TaskScenePanelTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/TaskScenePanelTest.java new file mode 100644 index 000000000..fc0fee005 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/swing/TaskScenePanelTest.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.swing; + +import com.intellij.ui.components.JBTabbedPane; +import ohos.devtools.datasources.databases.databaseapi.DataBaseApi; +import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; +import ohos.devtools.views.common.Constant; +import org.apache.logging.log4j.Level; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import javax.swing.JPanel; + +/** + * @Description TaskScenePanelTest + * @Date 2021/4/3 10:40 + **/ +public class TaskScenePanelTest { + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanel_initObj_0001 + * @tc.desc: chart scene test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Before + public void initObj() { + // Application initialization Step1 Initialize the data center + ProfilerLogManager.getSingleton().updateLogLevel(Level.ERROR); + DataBaseApi apo = DataBaseApi.getInstance(); + apo.initDataSourceManager(); + Constant.jtasksTab = new JBTabbedPane(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanel_setBorderTopCenter_0001 + * @tc.desc: chart scene test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void setBorderTopCenterTest() { + TaskScenePanel taskScenePanel = new TaskScenePanel(new TaskPanel(new JPanel(), new TaskPanelWelcome())); + taskScenePanel.setBorderTopCenter(); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanel_addCheckBox_0001 + * @tc.desc: chart scene test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void addCheckBoxTest() { + TaskScenePanel taskScenePanel = new TaskScenePanel(new TaskPanel(new JPanel(), new TaskPanelWelcome())); + taskScenePanel.addCheckBox(); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanel_setJPanelCenterRight_0001 + * @tc.desc: chart scene test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void setJPanelCenterRightTest() { + TaskScenePanel taskScenePanel = new TaskScenePanel(new TaskPanel(new JPanel(), new TaskPanelWelcome())); + taskScenePanel.setJPanelCenterRight(); + Assert.assertTrue(true); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_TaskScenePanel_setAttributes_0001 + * @tc.desc: chart scene test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void setAttributesTest() { + TaskScenePanel taskScenePanel = new TaskScenePanel(new TaskPanel(new JPanel(), new TaskPanelWelcome())); + taskScenePanel.setAttributes(); + Assert.assertTrue(true); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/util/ColorTableCellRendererTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/util/ColorTableCellRendererTest.java new file mode 100644 index 000000000..8e11e3192 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/util/ColorTableCellRendererTest.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.util; + +import com.intellij.ui.table.JBTable; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import javax.swing.table.DefaultTableModel; +import java.awt.Component; +import java.util.Vector; + +/** + * @Description FileUtil test + * @Date 2021/4/2 11:25 + **/ +public class ColorTableCellRendererTest { + private ColorTableCellRenderer colorTableCellRenderer; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ColorTableCellRenderer_getColorTableCellRenderer_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Before + public void getColorTableCellRenderer() { + colorTableCellRenderer = new ColorTableCellRenderer(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_ColorTableCellRenderer_getTableCellRendererComponent_0001 + * @tc.desc: chart table test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void getTableCellRendererComponent() { + JBTable jbTable = new JBTable(); + Vector vector = new Vector(3); + vector.add(0, "周杰伦"); + vector.add(1, "蔡依林"); + vector.add(2, "费玉清"); + Object obj = jbTable.getModel(); + DefaultTableModel tableModel = null; + String[] columnNames = {"列名1", "列名2", "列名3"}; + if (obj instanceof DefaultTableModel) { + tableModel = (DefaultTableModel)obj; + tableModel.setColumnIdentifiers(columnNames); + tableModel.addRow(vector); + tableModel.setValueAt("Edfs", 0, 0); + tableModel.setValueAt("Dewr", 0, 1); + tableModel.setValueAt("Iewer", 0, 2); + jbTable.setModel(tableModel); + } + String str = "sjkdlf"; + Component tableCellRendererComponent = + colorTableCellRenderer.getTableCellRendererComponent(jbTable, str, true, true, 0, 0); + Component tableCellRendererComponent1 = + colorTableCellRenderer.getTableCellRendererComponent(jbTable, str, true, true, 0, 1); + Component tableCellRendererComponent2 = + colorTableCellRenderer.getTableCellRendererComponent(jbTable, str, true, true, 0, 2); + Assert.assertNotNull(tableCellRendererComponent); + Assert.assertNotNull(tableCellRendererComponent1); + Assert.assertNotNull(tableCellRendererComponent2); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/util/FileUtilTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/util/FileUtilTest.java new file mode 100644 index 000000000..688997f3e --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/util/FileUtilTest.java @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.util; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * @Description FileUtil test + * @Date 2021/4/2 11:25 + **/ +public class FileUtilTest { + private FileUtil fileUtil; + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_FileUtil_getFileUtil_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Before + public void getFileUtil() { + fileUtil = new FileUtil(); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_FileUtil_writeFile_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void writeFile() { + fileUtil.writeFile("E:\\", "test"); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_FileUtil_writeFile_0002 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void writeFileTest01() { + fileUtil.writeFile("E:\\", ""); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_FileUtil_writeFile_0003 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void writeFileTest02() { + fileUtil.writeFile("", "test"); + } + + /** + * functional testing + * + * @tc.name: view chart + * @tc.number: OHOS_JAVA_views_FileUtil_readTxtFile_0001 + * @tc.desc: chart test + * @tc.type: functional testing + * @tc.require: SR-002-AR-001 + */ + @Test + public void readTxtFileTest01() { + String txtStr = "D:\\"; + try { + txtStr = fileUtil.readTxtFile("E:\\"); + Assert.assertNotNull(txtStr); + } catch (Exception exception) { + Assert.assertNotNull(txtStr); + } + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/util/SvgIconTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/util/SvgIconTest.java new file mode 100644 index 000000000..39aedd2d7 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/layout/util/SvgIconTest.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.layout.util; + +/** + * @Description SvgIcon test + * @Date 2021/4/3 17:07 + **/ +public class SvgIconTest { +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CPUProcessBeanTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CPUProcessBeanTest.java new file mode 100644 index 000000000..6c1f55389 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CPUProcessBeanTest.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test CPUProcessBean class + * + * @version 1.0 + * @date 2021/4/24 18:04 + **/ +class CPUProcessBeanTest { + /** + * test get the AvgDuration . + */ + @Test + void getAvgDuration() { + assertEquals(3L, new CPUProcessBean(0, 0, "", "", "") {{ + setAvgDuration(3L); + }}.getAvgDuration()); + } + + /** + * test set the AvgDuration . + */ + @Test + void setAvgDuration() { + assertEquals(3L, new CPUProcessBean(0, 0, "", "", "") {{ + setAvgDuration(3L); + }}.getAvgDuration()); + } + + /** + * test get the WallDuration . + */ + @Test + void getWallDuration() { + assertEquals(3L, new CPUProcessBean(0, 0, "", "", "") {{ + setWallDuration(3L); + }}.getWallDuration()); + } + + /** + * test set the WallDuration . + */ + @Test + void setWallDuration() { + assertEquals(3L, new CPUProcessBean(0, 0, "", "", "") {{ + setWallDuration(3L); + }}.getWallDuration()); + } + + /** + * test get the Pid . + */ + @Test + void getPid() { + assertEquals("pid", new CPUProcessBean(0, 0, "", "", "") {{ + setPid("pid"); + }}.getPid()); + } + + /** + * test set the Pid . + */ + @Test + void setPid() { + assertEquals("pid", new CPUProcessBean(0, 0, "", "", "") {{ + setPid("pid"); + }}.getPid()); + } + + /** + * test get the Occurrences . + */ + @Test + void getOccurrences() { + assertEquals("Occurrences", new CPUProcessBean(0, 0, "", "", "") {{ + setOccurrences("Occurrences"); + }}.getOccurrences()); + } + + /** + * test set the Occurrences . + */ + @Test + void setOccurrences() { + assertEquals("Occurrences", new CPUProcessBean(0, 0, "", "", "") {{ + setOccurrences("Occurrences"); + }}.getOccurrences()); + } + + /** + * test get the Process . + */ + @Test + void getProcess() { + assertEquals("Process", new CPUProcessBean(0, 0, "", "", "") {{ + setProcess("Process"); + }}.getProcess()); + } + + /** + * test set the Process . + */ + @Test + void setProcess() { + assertEquals("Process", new CPUProcessBean(0, 0, "", "", "") {{ + setProcess("Process"); + }}.getProcess()); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CPUThreadBeanTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CPUThreadBeanTest.java new file mode 100644 index 000000000..4ed235528 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CPUThreadBeanTest.java @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test CPUThreadBean class + * + * @version 1.0 + * @date 2021/4/24 18:04 + **/ +class CPUThreadBeanTest { + /** + * test get the avgDuration . + */ + @Test + void getAvgDuration() { + assertEquals(3L, new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setAvgDuration(3L); + }}.getAvgDuration()); + } + + /** + * test set the avgDuration . + */ + @Test + void setAvgDuration() { + assertEquals(3L, new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setAvgDuration(3L); + }}.getAvgDuration()); + } + + /** + * test get the WallDuration . + */ + @Test + void getWallDuration() { + assertEquals(3L, new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setWallDuration(3L); + }}.getWallDuration()); + } + + /** + * test set the WallDuration . + */ + @Test + void setWallDuration() { + assertEquals(3L, new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setWallDuration(3L); + }}.getWallDuration()); + } + + /** + * test get the Pid . + */ + @Test + void getPid() { + assertEquals("Pid", new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setPid("Pid"); + }}.getPid()); + } + + /** + * test set the Pid . + */ + @Test + void setPid() { + assertEquals("Pid", new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setPid("Pid"); + }}.getPid()); + } + + /** + * test get the Tid . + */ + @Test + void getTid() { + assertEquals("Tid", new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setTid("Tid"); + }}.getTid()); + } + + /** + * test set the Tid . + */ + @Test + void setTid() { + assertEquals("Tid", new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setTid("Tid"); + }}.getTid()); + } + + /** + * test get the Occurrences . + */ + @Test + void getOccurrences() { + assertEquals("Occurrences", new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setOccurrences("Occurrences"); + }}.getOccurrences()); + } + + /** + * test set the Occurrences . + */ + @Test + void setOccurrences() { + assertEquals("Occurrences", new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setOccurrences("Occurrences"); + }}.getOccurrences()); + } + + /** + * test get the Process . + */ + @Test + void getProcess() { + assertEquals("Process", new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setProcess("Process"); + }}.getProcess()); + } + + /** + * test set the Process . + */ + @Test + void setProcess() { + assertEquals("Process", new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setProcess("Process"); + }}.getProcess()); + } + + /** + * test get the Thread . + */ + @Test + void getThread() { + assertEquals("Thread", new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setThread("Thread"); + }}.getThread()); + } + + /** + * test set the Thread . + */ + @Test + void setThread() { + assertEquals("Thread", new CPUThreadBean(0, 0, "", "", "", "", "") {{ + setThread("Thread"); + }}.getThread()); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CpuDataTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CpuDataTest.java new file mode 100644 index 000000000..d58515378 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CpuDataTest.java @@ -0,0 +1,483 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import org.junit.jupiter.api.Test; + +import java.lang.reflect.Field; +import java.util.ArrayList; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test cpuData class + * + * @version 1.0 + * @date 2021/4/24 18:04 + **/ +class CpuDataTest { + /** + * test get the number of cpu . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getCpu() throws NoSuchFieldException, IllegalAccessException { + int random = (int) (Math.random() * 100); + CpuData cpuData = new CpuData(); + final Field field = cpuData.getClass().getDeclaredField("cpu"); + field.setAccessible(true); + field.set(cpuData, random); + assertEquals(random, cpuData.getCpu()); + } + + /** + * test set the number of cpu . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void setCpu() throws NoSuchFieldException, IllegalAccessException { + int random = (int) (Math.random() * 100); + CpuData cpuData = new CpuData(); + cpuData.setCpu(random); + final Field field = cpuData.getClass().getDeclaredField("cpu"); + field.setAccessible(true); + assertEquals(random, field.get(cpuData)); + } + + /** + * test set the name . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getName() throws NoSuchFieldException, IllegalAccessException { + String name = "name"; + CpuData cpuData = new CpuData(); + final Field field = cpuData.getClass().getDeclaredField("name"); + field.setAccessible(true); + field.set(cpuData, name); + assertEquals(name, cpuData.getName()); + } + + /** + * test set the name . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void setName() throws NoSuchFieldException, IllegalAccessException { + String name = "name"; + CpuData cpuData = new CpuData(); + cpuData.setName(name); + final Field field = cpuData.getClass().getDeclaredField("name"); + field.setAccessible(true); + assertEquals(name, field.get(cpuData)); + } + + /** + * test set the stats . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getStats() throws NoSuchFieldException, IllegalAccessException { + ArrayList stats = new ArrayList<>() {{ + add(1); + }}; + CpuData cpuData = new CpuData(); + final Field field = cpuData.getClass().getDeclaredField("stats"); + field.setAccessible(true); + field.set(cpuData, stats); + assertEquals(stats, cpuData.getStats()); + } + + /** + * test set the stats . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void setStats() throws NoSuchFieldException, IllegalAccessException { + ArrayList stats = new ArrayList<>() {{ + add(1); + }}; + CpuData cpuData = new CpuData(); + cpuData.setStats(stats); + final Field field = cpuData.getClass().getDeclaredField("stats"); + field.setAccessible(true); + assertEquals(stats, field.get(cpuData)); + } + + /** + * test set the endState . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getEndState() throws NoSuchFieldException, IllegalAccessException { + String endState = "endState"; + CpuData cpuData = new CpuData(); + final Field field = cpuData.getClass().getDeclaredField("endState"); + field.setAccessible(true); + field.set(cpuData, endState); + assertEquals(endState, cpuData.getEndState()); + } + + /** + * test set the endState . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void setEndState() throws NoSuchFieldException, IllegalAccessException { + String endState = "endState"; + CpuData cpuData = new CpuData(); + cpuData.setEndState(endState); + final Field field = cpuData.getClass().getDeclaredField("endState"); + field.setAccessible(true); + assertEquals(endState, field.get(cpuData)); + } + + /** + * test get the priority . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getPriority() throws NoSuchFieldException, IllegalAccessException { + int priority = (int) (Math.random() * 100); + CpuData cpuData = new CpuData(); + final Field field = cpuData.getClass().getDeclaredField("priority"); + field.setAccessible(true); + field.set(cpuData, priority); + assertEquals(priority, cpuData.getPriority()); + } + + /** + * test set the priority . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void setPriority() throws NoSuchFieldException, IllegalAccessException { + int priority = (int) (Math.random() * 100); + CpuData cpuData = new CpuData(); + cpuData.setPriority(priority); + final Field field = cpuData.getClass().getDeclaredField("priority"); + field.setAccessible(true); + assertEquals(priority, field.get(cpuData)); + } + + /** + * test get the schedId . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getSchedId() throws NoSuchFieldException, IllegalAccessException { + int schedId = (int) (Math.random() * 100); + CpuData cpuData = new CpuData(); + final Field field = cpuData.getClass().getDeclaredField("schedId"); + field.setAccessible(true); + field.set(cpuData, schedId); + assertEquals(schedId, cpuData.getSchedId()); + } + + /** + * test set the schedId . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void setSchedId() throws NoSuchFieldException, IllegalAccessException { + int schedId = (int) (Math.random() * 100); + CpuData cpuData = new CpuData(); + cpuData.setPriority(schedId); + assertEquals(schedId, cpuData.getPriority()); + } + + /** + * test get the startTime . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getStartTime() throws NoSuchFieldException, IllegalAccessException { + long startTime = Double.doubleToLongBits((Math.random() * 100)); + CpuData cpuData = new CpuData(); + final Field field = cpuData.getClass().getDeclaredField("startTime"); + field.setAccessible(true); + field.set(cpuData, startTime); + assertEquals(startTime, cpuData.getStartTime()); + } + + /** + * test set the startTime . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void setStartTime() throws NoSuchFieldException, IllegalAccessException { + long startTime = Double.doubleToLongBits((Math.random() * 100)); + CpuData cpuData = new CpuData(); + cpuData.setStartTime(startTime); + final Field field = cpuData.getClass().getDeclaredField("startTime"); + field.setAccessible(true); + assertEquals(startTime, field.get(cpuData)); + } + + /** + * test get the duration . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getDuration() throws NoSuchFieldException, IllegalAccessException { + long duration = Double.doubleToLongBits((Math.random() * 100)); + CpuData cpuData = new CpuData(); + final Field field = cpuData.getClass().getDeclaredField("duration"); + field.setAccessible(true); + field.set(cpuData, duration); + assertEquals(duration, cpuData.getDuration()); + } + + /** + * test set the duration . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void setDuration() throws NoSuchFieldException, IllegalAccessException { + long duration = Double.doubleToLongBits((Math.random() * 100)); + CpuData cpuData = new CpuData(); + cpuData.setDuration(duration); + final Field field = cpuData.getClass().getDeclaredField("duration"); + field.setAccessible(true); + assertEquals(duration, field.get(cpuData)); + } + + /** + * test get the type . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getType() throws NoSuchFieldException, IllegalAccessException { + String type = "type"; + CpuData cpuData = new CpuData(); + final Field field = cpuData.getClass().getDeclaredField("type"); + field.setAccessible(true); + field.set(cpuData, type); + assertEquals(type, cpuData.getType()); + } + + /** + * test set the type . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void setType() throws NoSuchFieldException, IllegalAccessException { + String type = "type"; + CpuData cpuData = new CpuData(); + cpuData.setType(type); + final Field field = cpuData.getClass().getDeclaredField("type"); + field.setAccessible(true); + assertEquals(type, field.get(cpuData)); + } + + /** + * test get the id . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getId() throws NoSuchFieldException, IllegalAccessException { + int id = 1; + CpuData cpuData = new CpuData(); + final Field field = cpuData.getClass().getDeclaredField("id"); + field.setAccessible(true); + field.set(cpuData, id); + assertEquals(id, cpuData.getId()); + } + + /** + * test set the id . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void setId() throws NoSuchFieldException, IllegalAccessException { + int id = 1; + CpuData cpuData = new CpuData(); + cpuData.setId(id); + final Field field = cpuData.getClass().getDeclaredField("id"); + field.setAccessible(true); + assertEquals(id, field.get(cpuData)); + } + + /** + * test get the tid . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getTid() throws NoSuchFieldException, IllegalAccessException { + int tid = 1; + CpuData cpuData = new CpuData(); + final Field field = cpuData.getClass().getDeclaredField("tid"); + field.setAccessible(true); + field.set(cpuData, tid); + assertEquals(tid, cpuData.getTid()); + } + + /** + * test set the tid . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void setTid() throws NoSuchFieldException, IllegalAccessException { + CpuData cpuData = new CpuData(); + cpuData.setId(1); + assertEquals(1, cpuData.getId()); + } + + /** + * test get the ProcessCmdLine . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getProcessCmdLine() throws NoSuchFieldException, IllegalAccessException { + String processCmdLine = "processCmdLine"; + CpuData cpuData = new CpuData(); + final Field field = cpuData.getClass().getDeclaredField("processCmdLine"); + field.setAccessible(true); + field.set(cpuData, processCmdLine); + assertEquals(processCmdLine, cpuData.getProcessCmdLine()); + } + + /** + * test set the ProcessCmdLine . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void setProcessCmdLine() throws NoSuchFieldException, IllegalAccessException { + String processCmdLine = "processCmdLine"; + CpuData cpuData = new CpuData(); + cpuData.setProcessCmdLine(processCmdLine); + final Field field = cpuData.getClass().getDeclaredField("processCmdLine"); + field.setAccessible(true); + assertEquals(processCmdLine, field.get(cpuData)); + } + + /** + * test get the ProcessName . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getProcessName() throws NoSuchFieldException, IllegalAccessException { + String processName = "processName"; + CpuData cpuData = new CpuData(); + final Field field = cpuData.getClass().getDeclaredField("processName"); + field.setAccessible(true); + field.set(cpuData, processName); + assertEquals(processName, cpuData.getProcessName()); + } + + /** + * test set the ProcessName . + */ + @Test + void setProcessName() { + String processName = "processName"; + CpuData cpuData = new CpuData(); + cpuData.setProcessCmdLine(processName); + assertEquals(processName, cpuData.getProcessCmdLine()); + } + + /** + * test get the ProcessId . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void getProcessId() throws NoSuchFieldException, IllegalAccessException { + CpuData cpuData = new CpuData(); + cpuData.setProcessId(1); + assertEquals(1, cpuData.getProcessId()); + } + + /** + * test set the ProcessName . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void setProcessId() throws NoSuchFieldException, IllegalAccessException { + CpuData cpuData = new CpuData(); + cpuData.setProcessId(1); + assertEquals(1, cpuData.getProcessId()); + } + + /** + * test set the select . + * + * @throws NoSuchFieldException throw NoSuchFieldException + * @throws IllegalAccessException throw IllegalAccessException + */ + @Test + void select() throws NoSuchFieldException, IllegalAccessException { + CpuData cpuData = new CpuData(); + cpuData.select(true); + final Field field = cpuData.getClass().getDeclaredField("isSelected"); + field.setAccessible(true); + assertEquals(true, field.get(cpuData)); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CpuFreqDataTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CpuFreqDataTest.java new file mode 100644 index 000000000..0d6a3c1ee --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CpuFreqDataTest.java @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import org.junit.jupiter.api.Test; + +import javax.swing.JButton; +import javax.swing.JComponent; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test CpuFreqData class + * + * @version 1.0 + * @date 2021/4/24 18:04 + **/ +class CpuFreqDataTest { + /** + * test get the number of cpu . + */ + @Test + void getCpu() { + assertEquals(3, new CpuFreqData() {{ + setCpu(3); + }}.getCpu()); + } + + /** + * test set the number of cpu . + */ + @Test + void setCpu() { + assertEquals(3, new CpuFreqData() {{ + setCpu(3); + }}.getCpu()); + } + + /** + * test set the number . + */ + @Test + void getValue() { + assertEquals(3L, new CpuFreqData() {{ + setValue(3L); + }}.getValue()); + } + + /** + * test set the value . + */ + @Test + void setValue() { + assertEquals(3L, new CpuFreqData() {{ + setValue(3L); + }}.getValue()); + } + + /** + * test get the StartTime . + */ + @Test + void getStartTime() { + assertEquals(3L, new CpuFreqData() {{ + setStartTime(3L); + }}.getStartTime()); + } + + /** + * test set the StartTime . + */ + @Test + void setStartTime() { + assertEquals(3L, new CpuFreqData() {{ + setStartTime(3L); + }}.getStartTime()); + } + + /** + * test get the Duration . + */ + @Test + void getDuration() { + assertEquals(3L, new CpuFreqData() {{ + setDuration(3L); + }}.getDuration()); + } + + /** + * test set the Duration . + */ + @Test + void setDuration() { + assertEquals(3L, new CpuFreqData() {{ + setDuration(3L); + }}.getDuration()); + } + + /** + * test get the root . + */ + @Test + void getRoot() { + JComponent jComponent = new JButton(); + assertEquals(jComponent, new CpuFreqData() {{ + setRoot(jComponent); + }}.getRoot()); + } + + /** + * test set the root . + */ + @Test + void setRoot() { + JComponent jComponent = new JButton(); + assertEquals(jComponent, new CpuFreqData() {{ + setRoot(jComponent); + }}.getRoot()); + } + + /** + * test get the FlagFocus . + */ + @Test + void isFlagFocus() { + boolean flagFocus = true; + assertEquals(flagFocus, new CpuFreqData() {{ + setFlagFocus(flagFocus); + }}.isFlagFocus()); + } + + /** + * test set the FlagFocus . + */ + @Test + void setFlagFocus() { + boolean flagFocus = true; + assertEquals(flagFocus, new CpuFreqData() {{ + setFlagFocus(flagFocus); + }}.isFlagFocus()); + } + + /** + * test get the max . + */ + @Test + void getMax() { + assertEquals(10.0D, new CpuFreqData() {{ + setMax(10.0D); + }}.getMax()); + } + + /** + * test set the max . + */ + @Test + void setMax() { + assertEquals(10.0D, new CpuFreqData() {{ + setMax(10.0D); + }}.getMax()); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CpuRateBeanTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CpuRateBeanTest.java new file mode 100644 index 000000000..c5aff89bb --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/CpuRateBeanTest.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test CpuRateBean class + * + * @version 1.0 + * @date 2021/4/24 18:04 + **/ +class CpuRateBeanTest { + /** + * test get the number of cpu . + */ + @Test + void getCpu() { + assertEquals(3, new CpuRateBean() {{ + setCpu(3); + }}.getCpu()); + } + + /** + * test set the number of cpu . + */ + @Test + void setCpu() { + assertEquals(3, new CpuRateBean() {{ + setCpu(3); + }}.getCpu()); + } + + /** + * test get the index . + */ + @Test + void getIndex() { + assertEquals(3, new CpuRateBean() {{ + setIndex(3); + }}.getIndex()); + } + + /** + * test set the index . + */ + @Test + void setIndex() { + assertEquals(3, new CpuRateBean() {{ + setIndex(3); + }}.getIndex()); + } + + /** + * test get the rate . + */ + @Test + void getRate() { + assertEquals(3.0D, new CpuRateBean() {{ + setRate(3.0D); + }}.getRate()); + } + + /** + * test set the rate . + */ + @Test + void setRate() { + assertEquals(3.0D, new CpuRateBean() {{ + setRate(3.0D); + }}.getRate()); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/FlagBeanTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/FlagBeanTest.java new file mode 100644 index 000000000..648378606 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/FlagBeanTest.java @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import org.junit.jupiter.api.Test; + +import java.awt.Color; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test FlagBean class + * + * @version 1.0 + * @date 2021/4/24 18:05 + **/ +class FlagBeanTest { + /** + * test get the ns . + */ + @Test + void getNs() { + assertEquals(3L, new FlagBean() {{ + setNs(3L); + }}.getNs()); + } + + /** + * test set the ns . + */ + @Test + void setNs() { + assertEquals(3L, new FlagBean() {{ + setNs(3L); + }}.getNs()); + } + + /** + * test get the Visible . + */ + @Test + void isVisible() { + boolean visiable = true; + assertEquals(visiable, new FlagBean() {{ + setVisible(visiable); + }}.isVisible()); + } + + /** + * test set the Visible . + */ + @Test + void setVisible() { + boolean visiable = true; + assertEquals(visiable, new FlagBean() {{ + setVisible(visiable); + }}.isVisible()); + } + + /** + * test get the name . + */ + @Test + void getName() { + assertEquals("name", new FlagBean() {{ + setName("name"); + }}.getName()); + } + + /** + * test set the name . + */ + @Test + void setName() { + assertEquals("name", new FlagBean() {{ + setName("name"); + }}.getName()); + } + + /** + * test get the time . + */ + @Test + void getTime() { + assertEquals(3L, new FlagBean() {{ + setTime(3L); + }}.getTime()); + } + + /** + * test set the time . + */ + @Test + void setTime() { + assertEquals(3L, new FlagBean() {{ + setTime(3L); + }}.getTime()); + } + + /** + * test get the time . + */ + @Test + void getColor() { + Color black = Color.BLACK; + assertEquals(black, new FlagBean() {{ + setColor(black); + }}.getColor()); + } + + /** + * test set the time . + */ + @Test + void setColor() { + Color black = Color.BLACK; + assertEquals(black, new FlagBean() {{ + setColor(black); + }}.getColor()); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/FunctionBeanTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/FunctionBeanTest.java new file mode 100644 index 000000000..41848ab26 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/FunctionBeanTest.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test FunctionBean class + * + * @version 1.0 + * @date 2021/4/24 18:05 + **/ +class FunctionBeanTest { + /** + * test get the tid . + */ + @Test + void getTid() { + assertEquals(3, new FunctionBean() {{ + setTid(3); + }}.getTid()); + } + + /** + * test set the tid . + */ + @Test + void setTid() { + assertEquals(3, new FunctionBean() {{ + setTid(3); + }}.getTid()); + } + + /** + * test get the ThreadName . + */ + @Test + void getThreadName() { + assertEquals("ThreadName", new FunctionBean() {{ + setThreadName("ThreadName"); + }}.getThreadName()); + } + + /** + * test set the ThreadName . + */ + @Test + void setThreadName() { + assertEquals("ThreadName", new FunctionBean() {{ + setThreadName("ThreadName"); + }}.getThreadName()); + } + + /** + * test get the IsMainThread . + */ + @Test + void getIsMainThread() { + assertEquals(1, new FunctionBean() {{ + setIsMainThread(1); + }}.getIsMainThread()); + } + + /** + * test set the IsMainThread . + */ + @Test + void setIsMainThread() { + assertEquals(1, new FunctionBean() {{ + setIsMainThread(1); + }}.getIsMainThread()); + } + + /** + * test get the TrackId . + */ + @Test + void getTrackId() { + assertEquals(1, new FunctionBean() {{ + setTrackId(1); + }}.getTrackId()); + } + + /** + * test set the TrackId . + */ + @Test + void setTrackId() { + assertEquals(1, new FunctionBean() {{ + setTrackId(1); + }}.getTrackId()); + } + + /** + * test get the StartTime . + */ + @Test + void getStartTime() { + assertEquals(1L, new FunctionBean() {{ + setStartTime(1L); + }}.getStartTime()); + } + + /** + * test set the StartTime . + */ + @Test + void setStartTime() { + assertEquals(1L, new FunctionBean() {{ + setStartTime(1L); + }}.getStartTime()); + } + + /** + * test get the Duration . + */ + @Test + void getDuration() { + assertEquals(1L, new FunctionBean() {{ + setDuration(1L); + }}.getDuration()); + } + + /** + * test set the Duration . + */ + @Test + void setDuration() { + assertEquals(1L, new FunctionBean() {{ + setDuration(1L); + }}.getDuration()); + } + + /** + * test get the FunName . + */ + @Test + void getFunName() { + assertEquals("FunName", new FunctionBean() {{ + setFunName("FunName"); + }}.getFunName()); + } + + /** + * test set the FunName . + */ + @Test + void setFunName() { + assertEquals("FunName", new FunctionBean() {{ + setFunName("FunName"); + }}.getFunName()); + } + + /** + * test get the Depth . + */ + @Test + void getDepth() { + assertEquals(3, new FunctionBean() {{ + setDepth(3); + }}.getDepth()); + } + + /** + * test set the Depth . + */ + @Test + void setDepth() { + assertEquals(3, new FunctionBean() {{ + setDepth(3); + }}.getDepth()); + } + + /** + * test get the Category . + */ + @Test + void getCategory() { + assertEquals("Category", new FunctionBean() {{ + setCategory("Category"); + }}.getCategory()); + } + + /** + * test set the Category . + */ + @Test + void setCategory() { + assertEquals("Category", new FunctionBean() {{ + setCategory("Category"); + }}.getCategory()); + } + + /** + * test get the Selected . + */ + @Test + void isSelected() { + boolean selected = true; + assertEquals(selected, new FunctionBean() {{ + setSelected(selected); + }}.isSelected()); + } + + /** + * test set the Selected . + */ + @Test + void setSelected() { + boolean selected = true; + assertEquals(selected, new FunctionBean() {{ + setSelected(selected); + }}.isSelected()); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ProcessDataTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ProcessDataTest.java new file mode 100644 index 000000000..da7f86f97 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ProcessDataTest.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test ProcessData class + * + * @version 1.0 + * @date 2021/4/24 18:05 + **/ +class ProcessDataTest { + /** + * test get the id . + */ + @Test + void getId() { + assertEquals(3, new ProcessData() {{ + setId(3); + }}.getId()); + } + + /** + * test set the id . + */ + @Test + void setId() { + assertEquals(3, new ProcessData() {{ + setId(3); + }}.getId()); + } + + /** + * test get the utid . + */ + @Test + void getUtid() { + assertEquals(3, new ProcessData() {{ + setUtid(3); + }}.getUtid()); + } + + /** + * test set the utid . + */ + @Test + void setUtid() { + assertEquals(3, new ProcessData() {{ + setUtid(3); + }}.getUtid()); + } + + /** + * test et the cpu . + */ + @Test + void getCpu() { + assertEquals(3, new ProcessData() {{ + setCpu(3); + }}.getCpu()); + } + + /** + * test set the cpu . + */ + @Test + void setCpu() { + assertEquals(3, new ProcessData() {{ + setCpu(3); + }}.getCpu()); + } + + /** + * test get the StartTime . + */ + @Test + void getStartTime() { + assertEquals(3L, new ProcessData() {{ + setStartTime(3L); + }}.getStartTime()); + } + + /** + * test set the StartTime . + */ + @Test + void setStartTime() { + assertEquals(3L, new ProcessData() {{ + setStartTime(3L); + }}.getStartTime()); + } + + /** + * test get the Duration . + */ + @Test + void getDuration() { + assertEquals(3L, new ProcessData() {{ + setDuration(3L); + }}.getDuration()); + } + + /** + * test set the Duration . + */ + @Test + void setDuration() { + assertEquals(3L, new ProcessData() {{ + setDuration(3L); + }}.getDuration()); + } + + /** + * test get the State . + */ + @Test + void getState() { + assertEquals("state", new ProcessData() {{ + setState("state"); + }}.getState()); + } + + /** + * test set the State . + */ + @Test + void setState() { + assertEquals("state", new ProcessData() {{ + setState("state"); + }}.getState()); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ProcessMemDataTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ProcessMemDataTest.java new file mode 100644 index 000000000..64d69b88b --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ProcessMemDataTest.java @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test ProcessMemData class + * + * @version 1.0 + * @date 2021/4/24 18:05 + **/ +class ProcessMemDataTest { + /** + * test get the MaxValue . + */ + @Test + void getMaxValue() { + assertEquals(3, new ProcessMemData() {{ + setMaxValue(3); + }}.getMaxValue()); + } + + /** + * test set the MaxValue . + */ + @Test + void setMaxValue() { + assertEquals(3, new ProcessMemData() {{ + setMaxValue(3); + }}.getMaxValue()); + } + + /** + * test get the id . + */ + @Test + void getId() { + assertEquals(3, new ProcessMemData() {{ + setId(3); + }}.getId()); + } + + /** + * test set the id . + */ + @Test + void setId() { + assertEquals(3, new ProcessMemData() {{ + setId(3); + }}.getId()); + } + + /** + * test get the type . + */ + @Test + void getType() { + assertEquals("type", new ProcessMemData() {{ + setType("type"); + }}.getType()); + } + + /** + * test set the type . + */ + @Test + void setType() { + assertEquals("type", new ProcessMemData() {{ + setType("type"); + }}.getType()); + } + + /** + * test get the TrackId . + */ + @Test + void getTrackId() { + assertEquals(3, new ProcessMemData() {{ + setTrackId(3); + }}.getTrackId()); + } + + /** + * test set the TrackId . + */ + @Test + void setTrackId() { + assertEquals(3, new ProcessMemData() {{ + setTrackId(3); + }}.getTrackId()); + } + + /** + * test get the Value . + */ + @Test + void getValue() { + assertEquals(3, new ProcessMemData() {{ + setValue(3); + }}.getValue()); + } + + /** + * test set the Value . + */ + @Test + void setValue() { + assertEquals(3, new ProcessMemData() {{ + setValue(3); + }}.getValue()); + } + + /** + * test get the StartTime . + */ + @Test + void getStartTime() { + assertEquals(3L, new ProcessMemData() {{ + setStartTime(3L); + }}.getStartTime()); + } + + /** + * test set the StartTime . + */ + @Test + void setStartTime() { + assertEquals(3L, new ProcessMemData() {{ + setStartTime(3L); + }}.getStartTime()); + } + + /** + * test get the Duration . + */ + @Test + void getDuration() { + assertEquals(3L, new ProcessMemData() {{ + setDuration(3L); + }}.getDuration()); + } + + /** + * test set the Duration . + */ + @Test + void setDuration() { + assertEquals(3L, new ProcessMemData() {{ + setDuration(3L); + }}.getDuration()); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ProcessMemTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ProcessMemTest.java new file mode 100644 index 000000000..629965b80 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ProcessMemTest.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test ProcessMem class + * + * @version 1.0 + * @date 2021/4/24 18:05 + **/ +class ProcessMemTest { + /** + * test get the TrackId . + */ + @Test + void getTrackId() { + assertEquals(3, new ProcessMem() {{ + setTrackId(3); + }}.getTrackId()); + } + + /** + * test set the TrackId . + */ + @Test + void setTrackId() { + assertEquals(3, new ProcessMem() {{ + setTrackId(3); + }}.getTrackId()); + } + + /** + * test get the ProcessName . + */ + @Test + void getProcessName() { + assertEquals("ProcessName", new ProcessMem() {{ + setProcessName("ProcessName"); + }}.getProcessName()); + } + + /** + * test set the ProcessName . + */ + @Test + void setProcessName() { + assertEquals("ProcessName", new ProcessMem() {{ + setProcessName("ProcessName"); + }}.getProcessName()); + } + + /** + * test get the Pid . + */ + @Test + void getPid() { + assertEquals(1, new ProcessMem() {{ + setPid(1); + }}.getPid()); + } + + /** + * test set the Pid . + */ + @Test + void setPid() { + assertEquals(1, new ProcessMem() {{ + setPid(1); + }}.getPid()); + } + + /** + * test get the Upid . + */ + @Test + void getUpid() { + assertEquals(1, new ProcessMem() {{ + setUpid(1); + }}.getUpid()); + } + + /** + * test set the Upid . + */ + @Test + void setUpid() { + assertEquals(1, new ProcessMem() {{ + setUpid(1); + }}.getUpid()); + } + + /** + * test get the TrackName . + */ + @Test + void getTrackName() { + assertEquals("TrackName", new ProcessMem() {{ + setTrackName("TrackName"); + }}.getTrackName()); + } + + /** + * test get the TrackName . + */ + @Test + void setTrackName() { + assertEquals("TrackName", new ProcessMem() {{ + setTrackName("TrackName"); + }}.getTrackName()); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ProcessTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ProcessTest.java new file mode 100644 index 000000000..6a41babf5 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ProcessTest.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test Process class + * + * @version 1.0 + * @date 2021/4/24 18:05 + **/ +class ProcessTest { + /** + * test get the Pid . + */ + @Test + void getPid() { + assertEquals(3, new Process() {{ + setPid(3); + }}.getPid()); + } + + /** + * test set the Pid . + */ + @Test + void setPid() { + assertEquals(3, new Process() {{ + setPid(3); + }}.getPid()); + } + + /** + * test get the Name . + */ + @Test + void getName() { + assertEquals("Process", new Process() {{ + setName("Process"); + }}.getName()); + } + + /** + * test set the Name . + */ + @Test + void setName() { + assertEquals("Process", new Process() {{ + setName("Process"); + }}.getName()); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ThreadDataTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ThreadDataTest.java new file mode 100644 index 000000000..b16123758 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/ThreadDataTest.java @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test ThreadData class + * + * @version 1.0 + * @date 2021/4/24 18:05 + **/ +class ThreadDataTest { + /** + * test get the uPid . + */ + @Test + void getuPid() { + assertEquals(3, new ThreadData() {{ + setuPid(3); + }}.getuPid()); + } + + /** + * test set the uPid . + */ + @Test + void setuPid() { + assertEquals(3, new ThreadData() {{ + setuPid(3); + }}.getuPid()); + } + + /** + * test set the uTid . + */ + @Test + void getuTid() { + assertEquals(3, new ThreadData() {{ + setuTid(3); + }}.getuTid()); + } + + /** + * test set the uTid . + */ + @Test + void setuTid() { + assertEquals(3, new ThreadData() {{ + setuTid(3); + }}.getuTid()); + } + + /** + * test get the Pid . + */ + @Test + void getPid() { + assertEquals(3, new ThreadData() {{ + setPid(3); + }}.getPid()); + } + + /** + * test set the Pid . + */ + @Test + void setPid() { + assertEquals(3, new ThreadData() {{ + setPid(3); + }}.getPid()); + } + + /** + * test get the Tid . + */ + @Test + void getTid() { + assertEquals(3, new ThreadData() {{ + setTid(3); + }}.getTid()); + } + + /** + * test set the Tid . + */ + @Test + void setTid() { + assertEquals(3, new ThreadData() {{ + setTid(3); + }}.getTid()); + } + + /** + * test get the ProcessName . + */ + @Test + void getProcessName() { + assertEquals("ProcessName", new ThreadData() {{ + setProcessName("ProcessName"); + }}.getProcessName()); + } + + /** + * test set the ProcessName . + */ + @Test + void setProcessName() { + assertEquals("ProcessName", new ThreadData() {{ + setProcessName("ProcessName"); + }}.getProcessName()); + } + + /** + * test get the ThreadName . + */ + @Test + void getThreadName() { + assertEquals("ThreadName", new ThreadData() {{ + setThreadName("ThreadName"); + }}.getThreadName()); + } + + /** + * test set the ThreadName . + */ + @Test + void setThreadName() { + assertEquals("ThreadName", new ThreadData() {{ + setThreadName("ThreadName"); + }}.getThreadName()); + } + + /** + * test get the State . + */ + @Test + void getState() { + assertEquals("State", new ThreadData() {{ + setState("State"); + }}.getState()); + } + + /** + * test set the State . + */ + @Test + void setState() { + assertEquals("State", new ThreadData() {{ + setState("State"); + }}.getState()); + } + + /** + * test get the StartTime . + */ + @Test + void getStartTime() { + assertEquals(3L, new ThreadData() {{ + setStartTime(3L); + }}.getStartTime()); + } + + /** + * test set the StartTime . + */ + @Test + void setStartTime() { + assertEquals(3L, new ThreadData() {{ + setStartTime(3L); + }}.getStartTime()); + } + + /** + * test get the Duration . + */ + @Test + void getDuration() { + assertEquals(3L, new ThreadData() {{ + setDuration(3L); + }}.getDuration()); + } + + /** + * test set the Duration . + */ + @Test + void setDuration() { + assertEquals(3L, new ThreadData() {{ + setDuration(3L); + }}.getDuration()); + } + + /** + * test get the number of Cpu . + */ + @Test + void getCpu() { + assertEquals(3, new ThreadData() {{ + setCpu(3); + }}.getCpu()); + } + + /** + * test set the number of Cpu . + */ + @Test + void setCpu() { + assertEquals(3, new ThreadData() {{ + setCpu(3); + }}.getCpu()); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/WakeupBeanTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/WakeupBeanTest.java new file mode 100644 index 000000000..1b7c9493c --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/bean/WakeupBeanTest.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.bean; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test WakeupBean class + * + * @version 1.0 + * @date 2021/4/24 18:05 + **/ +class WakeupBeanTest { + /** + * test get the WakeupTime . + */ + @Test + void getWakeupTime() { + assertEquals(3L, new WakeupBean() {{ + setWakeupTime(3L); + }}.getWakeupTime()); + } + + /** + * test set the WakeupTime . + */ + @Test + void setWakeupTime() { + assertEquals(3L, new WakeupBean() {{ + setWakeupTime(3L); + }}.getWakeupTime()); + } + + /** + * test get the WakeupCpu . + */ + @Test + void getWakeupCpu() { + assertEquals(3, new WakeupBean() {{ + setWakeupCpu(3); + }}.getWakeupCpu()); + } + + /** + * test set the WakeupCpu . + */ + @Test + void setWakeupCpu() { + assertEquals(3, new WakeupBean() {{ + setWakeupCpu(3); + }}.getWakeupCpu()); + } + + /** + * test get the WakeupProcess . + */ + @Test + void getWakeupProcess() { + assertEquals("WakeupProcess", new WakeupBean() {{ + setWakeupProcess("WakeupProcess"); + }}.getWakeupProcess()); + } + + /** + * test set the WakeupProcess . + */ + @Test + void setWakeupProcess() { + assertEquals("WakeupProcess", new WakeupBean() {{ + setWakeupProcess("WakeupProcess"); + }}.getWakeupProcess()); + } + + /** + * test get the WakeupPid . + */ + @Test + void getWakeupPid() { + assertEquals("WakeupPid", new WakeupBean() {{ + setWakeupPid("WakeupPid"); + }}.getWakeupPid()); + } + + /** + * test set the WakeupPid . + */ + @Test + void setWakeupPid() { + assertEquals("WakeupPid", new WakeupBean() {{ + setWakeupPid("WakeupPid"); + }}.getWakeupPid()); + } + + /** + * test get the WakeupThread . + */ + @Test + void getWakeupThread() { + assertEquals("WakeupThread", new WakeupBean() {{ + setWakeupThread("WakeupThread"); + }}.getWakeupThread()); + } + + /** + * test set the WakeupThread . + */ + @Test + void setWakeupThread() { + assertEquals("WakeupThread", new WakeupBean() {{ + setWakeupThread("WakeupThread"); + }}.getWakeupThread()); + } + + /** + * test get the WakeupTid . + */ + @Test + void getWakeupTid() { + assertEquals("WakeupTid", new WakeupBean() {{ + setWakeupTid("WakeupTid"); + }}.getWakeupTid()); + } + + /** + * test set the WakeupTid . + */ + @Test + void setWakeupTid() { + assertEquals("WakeupTid", new WakeupBean() {{ + setWakeupTid("WakeupTid"); + }}.getWakeupTid()); + } + + /** + * test get the SchedulingLatency . + */ + @Test + void getSchedulingLatency() { + assertEquals(3L, new WakeupBean() {{ + setSchedulingLatency(3L); + }}.getSchedulingLatency()); + } + + /** + * test set the SchedulingLatency . + */ + @Test + void setSchedulingLatency() { + assertEquals(3L, new WakeupBean() {{ + setSchedulingLatency(3L); + }}.getSchedulingLatency()); + } + + /** + * test get the SchedulingDesc . + */ + @Test + void getSchedulingDesc() { + assertEquals("SchedulingDesc", new WakeupBean() {{ + setSchedulingDesc("SchedulingDesc"); + }}.getSchedulingDesc()); + } + + /** + * test set the SchedulingDesc . + */ + @Test + void setSchedulingDesc() { + assertEquals("SchedulingDesc", new WakeupBean() {{ + setSchedulingDesc("SchedulingDesc"); + }}.getSchedulingDesc()); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/AnalystPanelTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/AnalystPanelTest.java new file mode 100644 index 000000000..5d7264687 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/AnalystPanelTest.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import ohos.devtools.views.trace.bean.CpuData; +import ohos.devtools.views.trace.bean.CpuFreqData; +import ohos.devtools.views.trace.bean.FlagBean; +import ohos.devtools.views.trace.bean.FunctionBean; +import ohos.devtools.views.trace.bean.ProcessMem; +import ohos.devtools.views.trace.bean.ThreadData; +import ohos.devtools.views.trace.util.Db; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test AnalystPanel class + * + * @version 1.0 + * @date 2021/4/24 18:05 + **/ +class AnalystPanelTest { + /** + * test init setUp . + */ + @BeforeEach + void setUp() { + Db.getInstance(); + Db.setDbName("trace.db"); + Db.load(false); + } + + /** + * test add the CpuList . + */ + @Test + void addCpuList() { + AnalystPanel analystPanel = new AnalystPanel(); + ArrayList> lists = new ArrayList<>(); + analystPanel.addCpuList(lists); + assertEquals(lists, AnalystPanel.cpuList); + } + + /** + * test add the ThreadsList . + */ + @Test + void addThreadsList() { + AnalystPanel analystPanel = new AnalystPanel(); + List lists = new ArrayList<>(); + List processMem = new ArrayList<>(); + analystPanel.addThreadsList(lists, processMem); + assertEquals(lists, AnalystPanel.threadsList); + } + + /** + * test add the CpuFreqList . + */ + @Test + void addCpuFreqList() { + AnalystPanel analystPanel = new AnalystPanel(); + ArrayList> lists = new ArrayList<>(); + Map cpuMaxFreq = new HashMap<>(); + analystPanel.addCpuFreqList(lists, cpuMaxFreq); + assertEquals(lists, AnalystPanel.cpuFreqList); + } + + /** + * test add the ThreadsList . + */ + @Test + void clickFunctionData() { + FunctionBean functionBean = new FunctionBean(); + functionBean.setSelected(false); + functionBean.setCategory("cate"); + functionBean.setDepth(1); + functionBean.setFunName("functionBean"); + functionBean.setTid(1); + functionBean.setDepth(1); + functionBean.setTrackId(1); + AnalystPanel analystPanel = new AnalystPanel(); + analystPanel.clickFunctionData(functionBean); + } + + /** + * test function clickThreadData . + */ + @Test + void clickThreadData() { + AnalystPanel analystPanel = new AnalystPanel(); + analystPanel.clickThreadData(new ThreadData()); + assertEquals(10_000_000_000L, AnalystPanel.DURATION); + } + + /** + * test function clickCpuData . + */ + @Test + void clickCpuData() { + AnalystPanel analystPanel = new AnalystPanel(); + analystPanel.clickCpuData(new CpuData()); + assertEquals(10_000_000_000L, AnalystPanel.DURATION); + } + + /** + * test function clickTimeFlag . + */ + @Test + void clickTimeFlag() { + AnalystPanel analystPanel = new AnalystPanel(); + analystPanel.clickTimeFlag(new FlagBean()); + assertEquals(10_000_000_000L, AnalystPanel.DURATION); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/BottomScrollPanelTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/BottomScrollPanelTest.java new file mode 100644 index 000000000..803fc9b59 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/BottomScrollPanelTest.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +/** + * test the BottomScrollPanel class + * + * @version 1.0 + * @date 2021/4/24 18:02 + **/ +class BottomScrollPanelTest { +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/ContentPanelTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/ContentPanelTest.java new file mode 100644 index 000000000..5fee9b0f1 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/ContentPanelTest.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import java.awt.Graphics; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +/** + * test the ContentPanel class + * + * @version 1.0 + * @date: 2021/4/24 18:03 + **/ +class ContentPanelTest { + private JFrame testFrame; + + /** + * test function the refreshTab . + */ + @Test + void refreshTab() { + ContentPanel contentPanel = new ContentPanel(new AnalystPanel()); + contentPanel.refreshTab(); + assertNotNull(contentPanel); + } + + /** + * test function the refresh . + */ + @Test + void refresh() { + ContentPanel contentPanel = new ContentPanel(new AnalystPanel()); + contentPanel.refresh(); + assertNotNull(contentPanel); + } + + /** + * test function the rangeChange . + */ + @Test + void rangeChange() { + ContentPanel contentPanel = new ContentPanel(new AnalystPanel()); + contentPanel.rangeChange(0L, 1000L); + assertNotNull(contentPanel); + } + + /** + * test function the paintComponent . + */ + @Test + void paintComponent() { + JPanel panel = new JPanel() { + ContentPanel contentPanel = new ContentPanel(new AnalystPanel()); + + @Override + protected void paintComponent(Graphics graphics) { + super.paintComponent(graphics); + contentPanel.paintComponent(graphics); + } + }; + this.testFrame.add(panel); + this.testFrame.setVisible(true); + this.testFrame.repaint(); + assertNotNull(this.testFrame); + } + + /** + * init . + */ + @BeforeEach + void setUp() { + if (this.testFrame == null) { + this.testFrame = new JFrame(); + } + } + + /** + * destroy . + */ + @AfterEach + void tearDown() { + if (this.testFrame != null) { + this.testFrame.dispose(); + this.testFrame = null; + } + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/ScrollFlagPanelTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/ScrollFlagPanelTest.java new file mode 100644 index 000000000..574baca3c --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/ScrollFlagPanelTest.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import ohos.devtools.views.trace.bean.FlagBean; +import ohos.devtools.views.trace.listener.IFlagListener; +import org.junit.jupiter.api.Test; + +import java.lang.reflect.Field; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test ScrollFlagPanel class . + * + * @version 1.0 + * @date 2021/4/24 18:03 + **/ +class ScrollFlagPanelTest { + /** + * test set the BeanData . + */ + @Test + void setData() { + FlagBean flagBean = new FlagBean(); + ScrollFlagPanel scrollFlagPanel = new ScrollFlagPanel(flagBean); + scrollFlagPanel.setData(flagBean); + final Field field; + try { + field = scrollFlagPanel.getClass().getDeclaredField("flag"); + field.setAccessible(true); + assertEquals(flagBean, field.get(scrollFlagPanel)); + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } + } + + /** + * test set the listener . + */ + @Test + void setFlagListener() { + FlagBean flagBean = new FlagBean(); + ScrollFlagPanel scrollFlagPanel = new ScrollFlagPanel(flagBean); + IFlagListener listener = new IFlagListener() { + @Override + public void flagRemove(FlagBean flag) { + } + + @Override + public void flagChange(FlagBean flag) { + } + }; + scrollFlagPanel.setFlagListener(listener); + final Field field; + try { + field = scrollFlagPanel.getClass().getDeclaredField("flagListener"); + field.setAccessible(true); + assertEquals(listener, field.get(scrollFlagPanel)); + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/ScrollSlicePanelTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/ScrollSlicePanelTest.java new file mode 100644 index 000000000..c437a76ab --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/ScrollSlicePanelTest.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import ohos.devtools.views.trace.bean.WakeupBean; +import ohos.devtools.views.trace.listener.IScrollSliceLinkListener; +import org.junit.jupiter.api.Test; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test ScrollSlicePanel class . + * + * @version 1.0 + * @date: 2021/4/24 18:03 + **/ +class ScrollSlicePanelTest { + /** + * test set the Data . + */ + @Test + void setData() { + ScrollSlicePanel scrollSlicePanel = new ScrollSlicePanel(); + List dataSource = new ArrayList<>(); + WakeupBean wakeupBean = new WakeupBean(); + scrollSlicePanel.setData("title", dataSource, wakeupBean); + final Field dataSourceField; + final Field wakeupBeanField; + try { + dataSourceField = scrollSlicePanel.getClass().getDeclaredField("dataSource"); + wakeupBeanField = scrollSlicePanel.getClass().getDeclaredField("wakeupBean"); + dataSourceField.setAccessible(true); + wakeupBeanField.setAccessible(true); + assertEquals(dataSource, dataSourceField.get(scrollSlicePanel)); + assertEquals(wakeupBean, wakeupBeanField.get(scrollSlicePanel)); + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } + } + + /** + * test set the ScrollSliceLinkListener . + */ + @Test + void setScrollSliceLinkListener() { + ScrollSlicePanel scrollSlicePanel = new ScrollSlicePanel(); + IScrollSliceLinkListener listener = new IScrollSliceLinkListener() { + @Override + public void linkClick(Object bean) { + } + }; + scrollSlicePanel.setScrollSliceLinkListener(listener); + final Field field; + try { + field = scrollSlicePanel.getClass().getDeclaredField("listener"); + field.setAccessible(true); + assertEquals(listener, field.get(scrollSlicePanel)); + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } + } + + /** + * test create the SliceData . + */ + @Test + void createSliceData() { + String key = "key"; + String value = "value"; + boolean linkable = true; + ScrollSlicePanel.SliceData sliceData = ScrollSlicePanel.createSliceData(key, value, linkable); + assertEquals(key, sliceData.key); + assertEquals(value, sliceData.value); + assertEquals(linkable, sliceData.linkable); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/ScrollTablePanelTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/ScrollTablePanelTest.java new file mode 100644 index 000000000..e000fac4d --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/ScrollTablePanelTest.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import org.junit.jupiter.api.Test; + +import java.lang.reflect.Field; +import java.util.ArrayList; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test ScrollTablePanel class . + * + * @version 1.0 + * @date 2021/4/24 18:03 + **/ +class ScrollTablePanelTest { + /** + * test set the ColumnsAndData . + */ + @Test + void setColumnsAndData() { + String[] columns = new String[] {}; + ArrayList dataSource = new ArrayList<>(); + ScrollTablePanel scrollTablePanel = new ScrollTablePanel(columns, dataSource); + scrollTablePanel.setColumnsAndData(columns, dataSource); + final Field columnsField; + final Field dataSourceField; + try { + columnsField = scrollTablePanel.getClass().getDeclaredField("columns"); + dataSourceField = scrollTablePanel.getClass().getDeclaredField("dataSource"); + columnsField.setAccessible(true); + dataSourceField.setAccessible(true); + assertEquals(columns, columnsField.get(scrollTablePanel)); + assertEquals(dataSource, dataSourceField.get(scrollTablePanel)); + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/TabPanelTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/TabPanelTest.java new file mode 100644 index 000000000..2fb1f88a3 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/TabPanelTest.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import org.junit.jupiter.api.Test; + +import java.awt.event.MouseEvent; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test TabPanel class . + * + * @version 1.0 + * @date 2021/4/24 18:03 + **/ +class TabPanelTest { + /** + * test function the mouseDragged . + */ + @Test + void mouseDragged() { + TabPanel tabPanel = new TabPanel(); + MouseEvent mouseEvent = new MouseEvent(tabPanel, 1, 1, 1, 1, 1, 1, true, 1); + tabPanel.mouseDragged(mouseEvent); + assertEquals(300, tabPanel.getMHeight()); + } + + /** + * test function the mouseMoved . + */ + @Test + void mouseMoved() { + TabPanel tabPanel = new TabPanel(); + MouseEvent mouseEvent = new MouseEvent(tabPanel, 1, 1, 1, 1, 1, 1, true, 1); + tabPanel.mouseMoved(mouseEvent); + assertEquals(300, tabPanel.getMHeight()); + } + + /** + * test function the hideInBottom . + */ + @Test + void hideInBottom() { + TabPanel tabPanel = new TabPanel(); + tabPanel.hideInBottom(); + assertEquals(300, tabPanel.getMHeight()); + } + + /** + * test get the MHeight . + */ + @Test + void getMHeight() { + TabPanel tabPanel = new TabPanel(); + assertEquals(300, tabPanel.getMHeight()); + } + + /** + * test get the MyHeight . + */ + @Test + void getMyHeight() { + assertEquals(0, TabPanel.getMyHeight()); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/TimeViewPortTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/TimeViewPortTest.java new file mode 100644 index 000000000..7f5b33f4e --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/component/TimeViewPortTest.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.component; + +import org.junit.jupiter.api.Test; + +import java.awt.event.MouseEvent; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test TimeViewPort class . + * + * @version 1.0 + * @date 2021/4/24 18:04 + **/ +class TimeViewPortTest { + /** + * test set the mousePressed . + */ + @Test + void mousePressed() { + TimeViewPort timeViewPort = new TimeViewPort(height -> { + }, (startNS, endNS) -> { + }); + MouseEvent mouseEvent = new MouseEvent(timeViewPort, 1, 1, 1, 1, 1, 1, true, 1); + timeViewPort.mousePressed(mouseEvent); + assertEquals(0, timeViewPort.getHeight()); + } + + /** + * test set the mouseDragged . + */ + @Test + void mouseDragged() { + TimeViewPort timeViewPort = new TimeViewPort(height -> { + }, (startNS, endNS) -> { + }); + MouseEvent mouseEvent = new MouseEvent(timeViewPort, 1, 1, 1, 1, 1, 1, true, 1); + timeViewPort.mouseDragged(mouseEvent); + assertEquals(0, timeViewPort.getHeight()); + } + + /** + * test set the mouseMoved . + */ + @Test + void mouseMoved() { + TimeViewPort timeViewPort = new TimeViewPort(height -> { + }, (startNS, endNS) -> { + }); + MouseEvent mouseEvent = new MouseEvent(timeViewPort, 1, 1, 1, 1, 1, 1, true, 1); + timeViewPort.mouseMoved(mouseEvent); + assertEquals(0, timeViewPort.getHeight()); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/AbstractDataFragmentTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/AbstractDataFragmentTest.java new file mode 100644 index 000000000..d09f8a8b9 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/AbstractDataFragmentTest.java @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.awt.Rectangle; +import java.awt.event.MouseEvent; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +/** + * test AbstractDataFragment class . + * + * @version 1.0 + * @date 2021/4/24 18:04 + **/ +class AbstractDataFragmentTest { + private AbstractDataFragment abstractDataFragment; + + /** + * init the setUp . + */ + @BeforeEach + void setUp() { + abstractDataFragment = new AbstractDataFragment() { + @Override + public void mouseClicked(MouseEvent event) { + } + + @Override + public void mousePressed(MouseEvent event) { + } + + @Override + public void mouseExited(MouseEvent event) { + } + + @Override + public void mouseEntered(MouseEvent event) { + } + + @Override + public void mouseMoved(MouseEvent event) { + } + + @Override + public void mouseReleased(MouseEvent event) { + } + }; + } + + /** + * test set the Visible . + */ + @Test + void setVisible() { + boolean currentVis = true; + abstractDataFragment.setVisible(currentVis); + assertEquals(abstractDataFragment.visible, currentVis); + } + + /** + * test the range function . + */ + @Test + void range() { + long startNs = 1L; + long endNs = 5L; + abstractDataFragment.range(startNs, endNs); + assertEquals(startNs, abstractDataFragment.startNS); + assertEquals(endNs, abstractDataFragment.endNS); + } + + /** + * test the getX function . + */ + @Test + void getX() { + abstractDataFragment.range(100L, 1000000L); + Rectangle rectangle = new Rectangle(); + rectangle.width = 1000; + abstractDataFragment.setDataRect(rectangle); + assertEquals(9, abstractDataFragment.getX(10000L)); + } + + /** + * test the getXDouble function . + */ + @Test + void getXDouble() { + abstractDataFragment.range(100L, 1000000L); + Rectangle rectangle = new Rectangle(); + rectangle.width = 1000; + abstractDataFragment.setDataRect(rectangle); + assertEquals(9, abstractDataFragment.getXDouble(10000L)); + } + + /** + * test set the clearSelected . + */ + @Test + void clearSelected() { + abstractDataFragment.clearSelected(); + assertNotEquals(abstractDataFragment, null); + } + + /** + * test set the setRect . + */ + @Test + void setRect() { + Rectangle rectangle = new Rectangle(); + rectangle.width = 1000; + rectangle.height = 100; + rectangle.x = 10; + rectangle.y = 10; + abstractDataFragment.setRect(rectangle); + abstractDataFragment.setRect(100, 100, 100, 100); + assertEquals(100, abstractDataFragment.getRect().x); + assertEquals(100, abstractDataFragment.getRect().y); + assertEquals(100, abstractDataFragment.getRect().height); + assertEquals(100, abstractDataFragment.getRect().width); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/CpuDataFragmentTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/CpuDataFragmentTest.java new file mode 100644 index 000000000..7ddf5bbb2 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/CpuDataFragmentTest.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import com.intellij.util.ui.UIUtil; +import ohos.devtools.views.trace.bean.CpuData; +import ohos.devtools.views.trace.util.Final; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * test CpuDataFragment class . + * + * @version 1.0 + * @date 2021/4/24 17:57 + **/ +class CpuDataFragmentTest { + private CpuDataFragment cpuDataFragment; + private JPanel jPanel; + private JFrame testFrame; + + /** + * test function the draw . + */ + @Test + void draw() { + BufferedImage image = UIUtil.createImage(new JPanel(), 1, 1, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics2D = image.createGraphics(); + cpuDataFragment.draw(graphics2D); + Assertions.assertNotNull(cpuDataFragment.favoriteGraph); + } + + /** + * test function the mouseClicked . + */ + @Test + void mouseClicked() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + cpuDataFragment.mouseClicked(mouseEvent); + Assertions.assertNotNull(cpuDataFragment.favoriteGraph); + } + + /** + * test function the mousePressed . + */ + @Test + void mousePressed() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + cpuDataFragment.mousePressed(mouseEvent); + Assertions.assertNotNull(cpuDataFragment.favoriteGraph); + } + + /** + * test function the mouseExited . + */ + @Test + void mouseExited() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + cpuDataFragment.mouseExited(mouseEvent); + Assertions.assertNotNull(cpuDataFragment.favoriteGraph); + } + + /** + * test function the mouseEntered . + */ + @Test + void mouseEntered() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + cpuDataFragment.mouseEntered(mouseEvent); + Assertions.assertNotNull(cpuDataFragment.favoriteGraph); + } + + /** + * test function the mouseMoved . + */ + @Test + void mouseMoved() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + cpuDataFragment.mouseMoved(mouseEvent); + Assertions.assertNotNull(cpuDataFragment.favoriteGraph); + } + + /** + * test function the mouseReleased . + */ + @Test + void mouseReleased() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + cpuDataFragment.mouseReleased(mouseEvent); + Assertions.assertNotNull(cpuDataFragment.favoriteGraph); + } + + /** + * test function the click . + */ + @Test + void click() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + cpuDataFragment.click(mouseEvent, new CpuData()); + Assertions.assertNotNull(cpuDataFragment.favoriteGraph); + } + + /** + * test function the blur . + */ + @Test + void blur() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + cpuDataFragment.blur(mouseEvent, new CpuData()); + Assertions.assertNotNull(cpuDataFragment.favoriteGraph); + } + + /** + * test function the focus . + */ + @Test + void focus() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + cpuDataFragment.focus(mouseEvent, new CpuData()); + Assertions.assertNotNull(cpuDataFragment.favoriteGraph); + } + + /** + * init the setUp . + */ + @BeforeEach + void setUp() { + if (this.testFrame == null) { + this.testFrame = new JFrame(); + } + List list = new ArrayList<>(); + jPanel = new JPanel(); + cpuDataFragment = new CpuDataFragment(jPanel, 1, list); + } + + /** + * on the tearDown . + */ + @AfterEach + void tearDown() { + if (this.testFrame != null) { + this.testFrame.dispose(); + this.testFrame = null; + } + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/CpuFreqDataFragmentTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/CpuFreqDataFragmentTest.java new file mode 100644 index 000000000..15f98315d --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/CpuFreqDataFragmentTest.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import com.intellij.util.ui.UIUtil; +import ohos.devtools.views.trace.bean.CpuData; +import ohos.devtools.views.trace.bean.CpuFreqData; +import ohos.devtools.views.trace.util.Final; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * test CpuFreqDataFragment class . + * + * @version 1.0 + * @date: 2021/4/24 17:57 + **/ +class CpuFreqDataFragmentTest { + private CpuFreqDataFragment cpuFreqDataFragment; + private JPanel jPanel; + + /** + * init the setUp . + */ + @BeforeEach + void setUp() { + List list = new ArrayList<>(); + Map map = new HashMap<>() {{ + put("name", "100"); + put("value", "2.5GHZ"); + }}; + jPanel = new JPanel(); + cpuFreqDataFragment = new CpuFreqDataFragment(jPanel, "name", map, list); + } + + /** + * test function the draw . + */ + @Test + void draw() { + BufferedImage image = UIUtil.createImage(new JPanel(), 1, 1, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics2D = image.createGraphics(); + cpuFreqDataFragment.draw(graphics2D); + Assertions.assertNotNull(cpuFreqDataFragment.favoriteGraph); + } + + /** + * test function the mouseClicked . + */ + @Test + void mouseClicked() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + cpuFreqDataFragment.mouseClicked(mouseEvent); + Assertions.assertNotNull(cpuFreqDataFragment.favoriteGraph); + } + + /** + * test function the mouseMoved . + */ + @Test + void mouseMoved() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + cpuFreqDataFragment.mouseMoved(mouseEvent); + Assertions.assertNotNull(cpuFreqDataFragment.favoriteGraph); + } + + /** + * test function the click . + */ + @Test + void click() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + cpuFreqDataFragment.click(mouseEvent, new CpuData()); + Assertions.assertNotNull(cpuFreqDataFragment.favoriteGraph); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/FunctionDataFragmentTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/FunctionDataFragmentTest.java new file mode 100644 index 000000000..88ecc8751 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/FunctionDataFragmentTest.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import com.intellij.util.ui.UIUtil; +import ohos.devtools.views.trace.bean.FunctionBean; +import ohos.devtools.views.trace.bean.ThreadData; +import ohos.devtools.views.trace.util.Final; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.ArrayList; +import java.util.Map; + +/** + * test FunctionDataFragment class . + * + * @version 1.0 + * @date: 2021/4/24 17:57 + **/ +class FunctionDataFragmentTest { + private FunctionDataFragment functionDataFragment; + private JPanel jPanel; + + /** + * init the setUp . + */ + @BeforeEach + void setUp() { + ArrayList list = new ArrayList<>(); + jPanel = new JPanel(); + functionDataFragment = new FunctionDataFragment(jPanel, list); + functionDataFragment.thread = new ThreadData(); + } + + /** + * test function the draw . + */ + @Test + void draw() { + BufferedImage image = UIUtil.createImage(new JPanel(), 1, 1, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics2D = image.createGraphics(); + functionDataFragment.draw(graphics2D); + Assertions.assertNotNull(functionDataFragment); + } + + /** + * test function the mouseClicked . + */ + @Test + void mouseClicked() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + functionDataFragment.mouseClicked(mouseEvent); + Assertions.assertNotNull(functionDataFragment); + } + + /** + * test function the mouseMoved . + */ + @Test + void mouseMoved() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + functionDataFragment.mouseMoved(mouseEvent); + Assertions.assertNotNull(functionDataFragment); + } + + /** + * test function the click . + */ + @Test + void click() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + functionDataFragment.click(mouseEvent, new FunctionBean()); + Assertions.assertNotNull(functionDataFragment); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/MemDataFragmentTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/MemDataFragmentTest.java new file mode 100644 index 000000000..dded3173e --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/MemDataFragmentTest.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import ohos.devtools.views.trace.bean.ProcessMem; +import ohos.devtools.views.trace.bean.ThreadData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import javax.swing.JPanel; +import java.awt.event.MouseEvent; + +/** + * test MemDataFragment class . + * + * @version 1.0 + * @date 2021/4/24 17:57 + **/ +class MemDataFragmentTest { + private MemDataFragment memDataFragment; + private JPanel jPanel; + + /** + * init the memDataFragment . + */ + @BeforeEach + void setUp() { + ProcessMem processMem = new ProcessMem(); + processMem.setProcessName("title"); + jPanel = new JPanel(); + memDataFragment = new MemDataFragment(jPanel, processMem); + } + + /** + * test function the mouseClicked . + */ + @Test + void mouseClicked() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + memDataFragment.mouseClicked(mouseEvent); + Assertions.assertNotNull(memDataFragment); + } + + /** + * test function the mouseMoved . + */ + @Test + void mouseMoved() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + memDataFragment.mouseMoved(mouseEvent); + Assertions.assertNotNull(memDataFragment); + } + + /** + * test function the click . + */ + @Test + void click() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + memDataFragment.click(mouseEvent, new ThreadData()); + Assertions.assertNotNull(memDataFragment); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ProcessDataFragmentTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ProcessDataFragmentTest.java new file mode 100644 index 000000000..291239426 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ProcessDataFragmentTest.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import com.intellij.util.ui.UIUtil; +import ohos.devtools.views.trace.bean.Process; +import ohos.devtools.views.trace.util.Final; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.Map; + +/** + * test ProcessDataFragment class . + * + * @version 1.0 + * @date 2021/4/24 17:57 + **/ +class ProcessDataFragmentTest { + private ProcessDataFragment processDataFragment; + private JPanel jPanel; + + /** + * init the memDataFragment . + */ + @BeforeEach + void setUp() { + Process process = new Process(); + jPanel = new JPanel(); + processDataFragment = new ProcessDataFragment(jPanel, process); + } + + /** + * test function the draw . + */ + @Test + void draw() { + BufferedImage image = UIUtil.createImage(new JPanel(), 1, 1, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics2D = image.createGraphics(); + processDataFragment.draw(graphics2D); + Assertions.assertNotNull(processDataFragment); + } + + /** + * test function the mouseClicked . + */ + @Test + void mouseClicked() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + processDataFragment.mouseClicked(mouseEvent); + Assertions.assertNotNull(processDataFragment); + } + + /** + * test function the mouseMoved . + */ + @Test + void mouseMoved() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + processDataFragment.mouseMoved(mouseEvent); + Assertions.assertNotNull(processDataFragment); + } + + /** + * test function the click . + */ + @Test + void click() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + processDataFragment.click(mouseEvent); + Assertions.assertNotNull(processDataFragment); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ThreadDataFragmentTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ThreadDataFragmentTest.java new file mode 100644 index 000000000..8f6f7459e --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ThreadDataFragmentTest.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment; + +import com.intellij.util.ui.UIUtil; +import ohos.devtools.views.trace.bean.ThreadData; +import ohos.devtools.views.trace.util.Final; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.Map; + +/** + * test ThreadDataFragment class . + * + * @version 1.0 + * @date 2021/4/24 17:58 + **/ +class ThreadDataFragmentTest { + private ThreadDataFragment threadDataFragment; + private JPanel jPanel; + + /** + * init the threadDataFragment . + */ + @BeforeEach + void setUp() { + ThreadData process = new ThreadData(); + jPanel = new JPanel(); + threadDataFragment = new ThreadDataFragment(jPanel, process); + } + + /** + * test function the draw . + */ + @Test + void draw() { + BufferedImage image = UIUtil.createImage(new JPanel(), 1, 1, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics2D = image.createGraphics(); + threadDataFragment.draw(graphics2D); + Assertions.assertNotNull(threadDataFragment); + } + + /** + * test function the mouseClicked . + */ + @Test + void mouseClicked() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + threadDataFragment.mouseClicked(mouseEvent); + Assertions.assertNotNull(threadDataFragment); + } + + /** + * test function the mouseMoved . + */ + @Test + void mouseMoved() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + threadDataFragment.mouseMoved(mouseEvent); + Assertions.assertNotNull(threadDataFragment); + } + + /** + * test function the click . + */ + @Test + void click() { + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + threadDataFragment.click(mouseEvent, new ThreadData()); + Assertions.assertNotNull(threadDataFragment); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/graph/AbstractGraphTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/graph/AbstractGraphTest.java new file mode 100644 index 000000000..c6f420fa9 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/graph/AbstractGraphTest.java @@ -0,0 +1,328 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.graph; + +import com.intellij.util.ui.UIUtil; +import ohos.devtools.views.trace.util.Final; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.Map; + +/** + * test AbstractGraph class . + * + * @version 1.0 + * @date: 2021/4/24 17:55 + **/ +class AbstractGraphTest { + /** + * test function the draw . + */ + @Test + void draw() { + AbstractGraph graph = new AbstractGraph() { + @Override + public void draw(Graphics2D graphics) { + } + + @Override + public void onFocus(MouseEvent event) { + } + + @Override + public void onBlur(MouseEvent event) { + } + + @Override + public void onClick(MouseEvent event) { + } + + @Override + public void onMouseMove(MouseEvent event) { + } + }; + BufferedImage image = UIUtil.createImage(new JPanel(), 1, 1, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics2D = image.createGraphics(); + graph.draw(graphics2D); + Assertions.assertNotNull(graph); + } + + /** + * test function the onFocus . + */ + @Test + void onFocus() { + AbstractGraph graph = new AbstractGraph() { + @Override + public void draw(Graphics2D graphics) { + } + + @Override + public void onFocus(MouseEvent event) { + } + + @Override + public void onBlur(MouseEvent event) { + } + + @Override + public void onClick(MouseEvent event) { + } + + @Override + public void onMouseMove(MouseEvent event) { + } + }; + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the onBlur . + */ + @Test + void onBlur() { + AbstractGraph graph = new AbstractGraph() { + @Override + public void draw(Graphics2D graphics) { + } + + @Override + public void onFocus(MouseEvent event) { + } + + @Override + public void onBlur(MouseEvent event) { + } + + @Override + public void onClick(MouseEvent event) { + } + + @Override + public void onMouseMove(MouseEvent event) { + } + }; + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the onClick . + */ + @Test + void onClick() { + AbstractGraph graph = new AbstractGraph() { + @Override + public void draw(Graphics2D graphics) { + } + + @Override + public void onFocus(MouseEvent event) { + } + + @Override + public void onBlur(MouseEvent event) { + } + + @Override + public void onClick(MouseEvent event) { + } + + @Override + public void onMouseMove(MouseEvent event) { + } + }; + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the onMouseMove . + */ + @Test + void onMouseMove() { + AbstractGraph graph = new AbstractGraph() { + @Override + public void draw(Graphics2D graphics) { + } + + @Override + public void onFocus(MouseEvent event) { + } + + @Override + public void onBlur(MouseEvent event) { + } + + @Override + public void onClick(MouseEvent event) { + } + + @Override + public void onMouseMove(MouseEvent event) { + } + }; + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the edgeInspect . + */ + @Test + void edgeInspect() { + AbstractGraph graph = new AbstractGraph() { + @Override + public void draw(Graphics2D graphics) { + } + + @Override + public void onFocus(MouseEvent event) { + } + + @Override + public void onBlur(MouseEvent event) { + } + + @Override + public void onClick(MouseEvent event) { + } + + @Override + public void onMouseMove(MouseEvent event) { + } + }; + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the repaint . + */ + @Test + void repaint() { + AbstractGraph graph = new AbstractGraph() { + @Override + public void draw(Graphics2D graphics) { + } + + @Override + public void onFocus(MouseEvent event) { + } + + @Override + public void onBlur(MouseEvent event) { + } + + @Override + public void onClick(MouseEvent event) { + } + + @Override + public void onMouseMove(MouseEvent event) { + } + }; + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the setRect . + */ + @Test + void setRect() { + AbstractGraph graph = new AbstractGraph() { + @Override + public void draw(Graphics2D graphics) { + } + + @Override + public void onFocus(MouseEvent event) { + } + + @Override + public void onBlur(MouseEvent event) { + } + + @Override + public void onClick(MouseEvent event) { + } + + @Override + public void onMouseMove(MouseEvent event) { + } + }; + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the drawString . + */ + @Test + void drawString() { + AbstractGraph graph = new AbstractGraph() { + @Override + public void draw(Graphics2D graphics) { + } + + @Override + public void onFocus(MouseEvent event) { + } + + @Override + public void onBlur(MouseEvent event) { + } + + @Override + public void onClick(MouseEvent event) { + } + + @Override + public void onMouseMove(MouseEvent event) { + } + }; + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/graph/CheckGraphTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/graph/CheckGraphTest.java new file mode 100644 index 000000000..b316b2fd8 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/graph/CheckGraphTest.java @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.graph; + +import com.intellij.util.ui.UIUtil; +import ohos.devtools.views.trace.util.Final; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.Map; + +/** + * test CheckGraph class . + * + * @version 1.0 + * @date 2021/4/24 17:55 + **/ +class CheckGraphTest { + /** + * test function the edgeInspect . + */ + @Test + void edgeInspect() { + CheckGraph graph = new CheckGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the repaint . + */ + @Test + void repaint() { + CheckGraph graph = new CheckGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the setRect . + */ + @Test + void setRect() { + CheckGraph graph = new CheckGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the drawString . + */ + @Test + void drawString() { + CheckGraph graph = new CheckGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the getChecked . + */ + @Test + void getChecked() { + CheckGraph graph = new CheckGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the setChecked . + */ + @Test + void setChecked() { + CheckGraph graph = new CheckGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the draw . + */ + @Test + void draw() { + CheckGraph graph = new CheckGraph(null, null); + BufferedImage image = UIUtil.createImage(new JPanel(), 1, 1, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics2D = image.createGraphics(); + graph.draw(graphics2D); + Assertions.assertNotNull(graph); + } + + /** + * test function the onFocus . + */ + @Test + void onFocus() { + CheckGraph graph = new CheckGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the onBlur . + */ + @Test + void onBlur() { + CheckGraph graph = new CheckGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the onClick . + */ + @Test + void onClick() { + CheckGraph graph = new CheckGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the onMouseMove . + */ + @Test + void onMouseMove() { + CheckGraph graph = new CheckGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/graph/ExpandGraphTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/graph/ExpandGraphTest.java new file mode 100644 index 000000000..475d4b96f --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/graph/ExpandGraphTest.java @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.graph; + +import com.intellij.util.ui.UIUtil; +import ohos.devtools.views.trace.util.Final; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.Map; + +/** + * test ExpandGraph class . + * + * @version 1.0 + * @date: 2021/4/24 17:56 + **/ +class ExpandGraphTest { + /** + * test function the edgeInspect . + */ + @Test + void edgeInspect() { + ExpandGraph graph = new ExpandGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the repaint . + */ + @Test + void repaint() { + ExpandGraph graph = new ExpandGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the setRect . + */ + @Test + void setRect() { + ExpandGraph graph = new ExpandGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the drawString . + */ + @Test + void drawString() { + ExpandGraph graph = new ExpandGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the getImage . + */ + @Test + void getImage() { + ExpandGraph graph = new ExpandGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the setImage . + */ + @Test + void setImage() { + ExpandGraph graph = new ExpandGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the isExpand . + */ + @Test + void isExpand() { + ExpandGraph graph = new ExpandGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the setExpand . + */ + @Test + void setExpand() { + ExpandGraph graph = new ExpandGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the draw . + */ + @Test + void draw() { + ExpandGraph graph = new ExpandGraph(null, null); + BufferedImage image = UIUtil.createImage(new JPanel(), 1, 1, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics2D = image.createGraphics(); + graph.draw(graphics2D); + Assertions.assertNotNull(graph); + } + + /** + * test function the onFocus . + */ + @Test + void onFocus() { + ExpandGraph graph = new ExpandGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the onBlur . + */ + @Test + void onBlur() { + ExpandGraph graph = new ExpandGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the onClick . + */ + @Test + void onClick() { + ExpandGraph graph = new ExpandGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the onMouseMove . + */ + @Test + void onMouseMove() { + ExpandGraph graph = new ExpandGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the setOnClickListener . + */ + @Test + void setOnClickListener() { + ExpandGraph graph = new ExpandGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/graph/FavoriteGraphTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/graph/FavoriteGraphTest.java new file mode 100644 index 000000000..515688673 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/graph/FavoriteGraphTest.java @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.graph; + +import com.intellij.util.ui.UIUtil; +import ohos.devtools.views.trace.fragment.AbstractDataFragment; +import ohos.devtools.views.trace.util.Final; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.Map; + +/** + * test FavoriteGraph class . + * + * @version 1.0 + * @date 2021/4/24 17:56 + **/ +class FavoriteGraphTest { + /** + * test function the edgeInspect . + */ + @Test + void edgeInspect() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the repaint . + */ + @Test + void repaint() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the setRect . + */ + @Test + void setRect() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the drawString . + */ + @Test + void drawString() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the getRightGraph . + */ + @Test + void getRightGraph() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the setRightGraph . + */ + @Test + void setRightGraph() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the isDisplay . + */ + @Test + void isDisplay() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the display . + */ + @Test + void display() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the isFavorite . + */ + @Test + void isFavorite() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the favorite . + */ + @Test + void favorite() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the draw . + */ + @Test + void draw() { + FavoriteGraph graph = new FavoriteGraph(new AbstractDataFragment() { + @Override + public void mouseClicked(MouseEvent event) { + } + + @Override + public void mousePressed(MouseEvent event) { + } + + @Override + public void mouseExited(MouseEvent event) { + } + + @Override + public void mouseEntered(MouseEvent event) { + } + + @Override + public void mouseMoved(MouseEvent event) { + } + + @Override + public void mouseReleased(MouseEvent event) { + } + }, null); + BufferedImage image = UIUtil.createImage(new JPanel(), 1, 1, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics2D = image.createGraphics(); + graph.draw(graphics2D); + Assertions.assertNotNull(graph); + } + + /** + * test function the onFocus . + */ + @Test + void onFocus() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the onBlur . + */ + @Test + void onBlur() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the onClick . + */ + @Test + void onClick() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } + + /** + * test function the onMouseMove . + */ + @Test + void onMouseMove() { + FavoriteGraph graph = new FavoriteGraph(null, null); + graph.setRect(0.0F, 0.0F, 100.0F, 100.0F); + Assertions.assertEquals(100, graph.rect.width); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/AbstractFragmentTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/AbstractFragmentTest.java new file mode 100644 index 000000000..f92d7c593 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/AbstractFragmentTest.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.ruler; + +import org.junit.jupiter.api.Test; + +import javax.swing.JPanel; +import java.awt.Graphics2D; +import java.awt.Rectangle; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertEquals; + +/** + * test AbstractFragment class . + * + * @version 1.0 + * @date 2021/4/24 17:53 + **/ +class AbstractFragmentTest { + /** + * test function the getRect . + */ + @Test + void getRect() { + AbstractFragment fragment = new AbstractFragment() { + @Override + public void draw(Graphics2D graphics) { + } + }; + Rectangle rect = fragment.getRect(); + assertEquals(true, rect != null); + } + + /** + * test function the setRect . + */ + @Test + void setRect() { + AbstractFragment fragment = new AbstractFragment() { + @Override + public void draw(Graphics2D graphics) { + } + }; + fragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, fragment.getRect().width); + } + + /** + * test function the getDescRect . + */ + @Test + void getDescRect() { + AbstractFragment fragment = new AbstractFragment() { + @Override + public void draw(Graphics2D graphics) { + } + }; + fragment.setDescRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, fragment.getDescRect().width); + } + + /** + * test function the setDescRect . + */ + @Test + void setDescRect() { + AbstractFragment fragment = new AbstractFragment() { + @Override + public void draw(Graphics2D graphics) { + } + }; + fragment.setDescRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, fragment.getDescRect().width); + } + + /** + * test function the getDataRect . + */ + @Test + void getDataRect() { + AbstractFragment fragment = new AbstractFragment() { + @Override + public void draw(Graphics2D graphics) { + } + }; + fragment.setDataRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, fragment.getDataRect().width); + } + + /** + * test function the setDataRect . + */ + @Test + void setDataRect() { + AbstractFragment fragment = new AbstractFragment() { + @Override + public void draw(Graphics2D graphics) { + } + }; + fragment.setDataRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, fragment.getDataRect().width); + } + + /** + * test function the getRoot . + */ + @Test + void getRoot() { + AbstractFragment fragment = new AbstractFragment() { + @Override + public void draw(Graphics2D graphics) { + } + }; + JPanel jPanel = new JPanel(); + fragment.setRoot(jPanel); + assertEquals(jPanel, fragment.getRoot()); + } + + /** + * test function the setRoot . + */ + @Test + void setRoot() { + AbstractFragment fragment = new AbstractFragment() { + @Override + public void draw(Graphics2D graphics) { + } + }; + JPanel jPanel = new JPanel(); + fragment.setRoot(jPanel); + assertEquals(jPanel, fragment.getRoot()); + } + + /** + * test function the getLineColor . + */ + @Test + void getLineColor() { + AbstractFragment fragment = new AbstractFragment() { + @Override + public void draw(Graphics2D graphics) { + } + }; + assertNotNull(fragment.getLineColor()); + } + + /** + * test function the getTextColor . + */ + @Test + void getTextColor() { + AbstractFragment fragment = new AbstractFragment() { + @Override + public void draw(Graphics2D graphics) { + } + }; + assertNotNull(fragment.getTextColor()); + } + + /** + * test function the repaint . + */ + @Test + void repaint() { + AbstractFragment fragment = new AbstractFragment() { + @Override + public void draw(Graphics2D graphics) { + } + }; + fragment.repaint(); + assertNotNull(fragment); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/CpuFragmentTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/CpuFragmentTest.java new file mode 100644 index 000000000..9b433cb06 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/CpuFragmentTest.java @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.ruler; + +import com.intellij.util.ui.UIUtil; +import ohos.devtools.views.trace.util.Final; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import javax.swing.JPanel; + +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.Map; + +import static org.junit.Assert.assertEquals; + +/** + * test CpuFragment class . + * + * @version 1.0 + * @date 2021/4/24 17:54 + **/ +class CpuFragmentTest { + /** + * test function the draw . + */ + @Test + void draw() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + BufferedImage image = UIUtil.createImage(new JPanel(), 1, 1, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics2D = image.createGraphics(); + cpuFragment.draw(graphics2D); + Assertions.assertNotNull(cpuFragment); + } + + /** + * test function the getRect . + */ + @Test + void getRect() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + assertEquals(true, cpuFragment.getRect() != null); + } + + /** + * test function the setRect . + */ + @Test + void setRect() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, cpuFragment.getRect().width); + } + + /** + * test function the getDescRect . + */ + @Test + void getDescRect() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, cpuFragment.getRect().width); + } + + /** + * test function the setDescRect . + */ + @Test + void setDescRect() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, cpuFragment.getRect().width); + } + + /** + * test function the getDataRect . + */ + @Test + void getDataRect() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, cpuFragment.getRect().width); + } + + /** + * test function the setDataRect . + */ + @Test + void setDataRect() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, cpuFragment.getRect().width); + } + + /** + * test function the getRoot . + */ + @Test + void getRoot() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, cpuFragment.getRect().width); + } + + /** + * test function the setRoot . + */ + @Test + void setRoot() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, cpuFragment.getRect().width); + } + + /** + * test function the getLineColor . + */ + @Test + void getLineColor() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, cpuFragment.getRect().width); + } + + /** + * test function the getTextColor . + */ + @Test + void getTextColor() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, cpuFragment.getRect().width); + } + + /** + * test function the repaint . + */ + @Test + void repaint() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, cpuFragment.getRect().width); + } + + /** + * test function the getSelectX . + */ + @Test + void getSelectX() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setSelectX(100); + assertEquals(100, cpuFragment.getSelectX()); + } + + /** + * test function the setSelectX . + */ + @Test + void setSelectX() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setSelectX(100); + assertEquals(100, cpuFragment.getSelectX()); + } + + /** + * test function the getSelectY . + */ + @Test + void getSelectY() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setSelectY(100); + assertEquals(100, cpuFragment.getSelectY()); + } + + /** + * test function the setSelectY . + */ + @Test + void setSelectY() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setSelectY(100); + assertEquals(100, cpuFragment.getSelectY()); + } + + /** + * test function the setRangeChangeListener . + */ + @Test + void setRangeChangeListener() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, cpuFragment.getRect().width); + } + + /** + * test function the mouseDragged . + */ + @Test + void mouseDragged() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, cpuFragment.getRect().width); + } + + /** + * test function the setRange . + */ + @Test + void setRange() { + CpuFragment cpuFragment = new CpuFragment(new JPanel(), (leftX, rightX, leftNS, rightNS, centerNS) -> { + }); + cpuFragment.setRect(new Rectangle(0, 0, 100, 100)); + assertEquals(100, cpuFragment.getRect().width); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/IFragmentTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/IFragmentTest.java new file mode 100644 index 000000000..23e5b3ca4 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/IFragmentTest.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.ruler; + +/** + * test IFragment class . + * + * @version 1.0 + * @date: 2021/4/25 22:29 + **/ +class IFragmentTest { +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/LeftFragmentTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/LeftFragmentTest.java new file mode 100644 index 000000000..bd51dd0e5 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/LeftFragmentTest.java @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.ruler; + +import com.intellij.util.ui.UIUtil; +import ohos.devtools.views.trace.util.Final; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.Map; + +/** + * test LeftFragment class . + * + * @version 1.0 + * @date 2021/4/24 17:54 + **/ +class LeftFragmentTest { + /** + * test function the draw . + */ + @Test + void draw() { + LeftFragment fragment = new LeftFragment(new JPanel()); + BufferedImage image = UIUtil.createImage(new JPanel(), 1, 1, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics2D = image.createGraphics(); + fragment.draw(graphics2D); + Assertions.assertNotNull(fragment); + } + + /** + * test function the getRect . + */ + @Test + void getRect() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setRect(new Rectangle(0, 0, 100, 100)); + Assertions.assertEquals(100, fragment.getRect().width); + } + + /** + * test function the setRect . + */ + @Test + void setRect() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setRect(new Rectangle(0, 0, 100, 100)); + Assertions.assertEquals(100, fragment.getRect().width); + } + + /** + * test function the getDescRect . + */ + @Test + void getDescRect() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setDescRect(new Rectangle(0, 0, 100, 100)); + Assertions.assertEquals(100, fragment.getDescRect().width); + } + + /** + * test function the setDescRect . + */ + @Test + void setDescRect() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setDescRect(new Rectangle(0, 0, 100, 100)); + Assertions.assertEquals(100, fragment.getDescRect().width); + } + + /** + * test function the getDataRect . + */ + @Test + void getDataRect() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setDataRect(new Rectangle(0, 0, 100, 100)); + Assertions.assertEquals(100, fragment.getDataRect().width); + } + + /** + * test function the setDataRect . + */ + @Test + void setDataRect() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setDataRect(new Rectangle(0, 0, 100, 100)); + Assertions.assertEquals(100, fragment.getDataRect().width); + } + + /** + * test function the getLineColor . + */ + @Test + void getLineColor() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.getLineColor(); + Assertions.assertEquals(200, fragment.getRect().width); + } + + /** + * test function the getTextColor . + */ + @Test + void getTextColor() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.getTextColor(); + Assertions.assertEquals(200, fragment.getRect().width); + } + + /** + * test function the getStartTimeS . + */ + @Test + void getStartTimeS() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setStartTimeS("StartTimeS"); + Assertions.assertEquals("StartTimeS", fragment.getStartTimeS()); + } + + /** + * test function the setStartTimeS . + */ + @Test + void setStartTimeS() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setStartTimeS("StartTimeS"); + Assertions.assertEquals("StartTimeS", fragment.getStartTimeS()); + } + + /** + * test function the setStartNS . + */ + @Test + void setStartNS() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setStartNS(100L); + Assertions.assertEquals(100L, fragment.getStartNS()); + } + + /** + * test function the getStartNS . + */ + @Test + void getStartNS() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setStartNS(100L); + Assertions.assertEquals(100L, fragment.getStartNS()); + } + + /** + * test function the getExtendHeight . + */ + @Test + void getExtendHeight() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setExtendHeight(100); + Assertions.assertEquals(100, fragment.getExtendHeight()); + } + + /** + * test function the setExtendHeight . + */ + @Test + void setExtendHeight() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setExtendHeight(100); + Assertions.assertEquals(100, fragment.getExtendHeight()); + } + + /** + * test function the getLogString . + */ + @Test + void getLogString() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setLogString("logString"); + Assertions.assertEquals("logString", fragment.getLogString()); + } + + /** + * test function the setLogString . + */ + @Test + void setLogString() { + LeftFragment fragment = new LeftFragment(new JPanel()); + fragment.setLogString("logString"); + Assertions.assertEquals("logString", fragment.getLogString()); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/RulerFragmentTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/RulerFragmentTest.java new file mode 100644 index 000000000..4f1990833 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/RulerFragmentTest.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.ruler; + +import com.intellij.util.ui.UIUtil; +import ohos.devtools.views.trace.util.Final; +import org.junit.Test; + +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.Map; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +/** + * test RulerFragment class . + * + * @version 1.0 + * @date 2021/4/24 17:55 + **/ +class RulerFragmentTest { + /** + * test function the draw . + */ + @Test + void draw() { + RulerFragment fragment = new RulerFragment(new JPanel(), (startNS, endNS) -> { + }); + BufferedImage image = UIUtil.createImage(new JPanel(), 1, 1, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics2D = image.createGraphics(); + fragment.draw(graphics2D); + assertNotNull(fragment); + } + + /** + * test function the mouseMoved . + */ + @Test + void mouseMoved() { + RulerFragment fragment = new RulerFragment(new JPanel(), (startNS, endNS) -> { + }); + JPanel jPanel = new JPanel(); + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + fragment.mouseMoved(mouseEvent); + assertEquals(0, fragment.getRect().width); + } + + /** + * test function the mousePressed . + */ + @Test + void mousePressed() { + RulerFragment fragment = new RulerFragment(new JPanel(), (startNS, endNS) -> { + }); + JPanel jPanel = new JPanel(); + MouseEvent mouseEvent = new MouseEvent(jPanel, 1, 1, 1, 1, 1, 1, true, 1); + fragment.mousePressed(mouseEvent); + assertEquals(0, fragment.getRect().width); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/TopFragmentTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/TopFragmentTest.java new file mode 100644 index 000000000..ac5592dcd --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/fragment/ruler/TopFragmentTest.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.fragment.ruler; + +import com.intellij.util.ui.UIUtil; +import ohos.devtools.views.trace.util.Final; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.Map; + +/** + * test TopFragment class . + * + * @version 1.0 + * @date 2021/4/24 17:55 + **/ +class TopFragmentTest { + /** + * test function the draw . + */ + @Test + void draw() { + TopFragment fragment = new TopFragment(new JPanel()); + BufferedImage image = UIUtil.createImage(new JPanel(), 1, 1, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics2D = image.createGraphics(); + fragment.draw(graphics2D); + Assertions.assertNotNull(fragment); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/ColorUtilsTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/ColorUtilsTest.java new file mode 100644 index 000000000..6c0819791 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/ColorUtilsTest.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.util; + +import ohos.devtools.views.trace.bean.CpuData; +import org.junit.jupiter.api.Test; + +import java.awt.Color; + +import static org.junit.Assert.assertEquals; + +/** + * test ColorUtils class . + * + * @version 1.0 + * @date 2021/4/24 17:01 + **/ +class ColorUtilsTest { + /** + * test function the testGetColor . + */ + @Test + void testGetColor() { + Color color = ColorUtils.getColor(1); + assertEquals(152, color.getRed()); + assertEquals(150, color.getGreen()); + assertEquals(128, color.getBlue()); + } + + /** + * test function the testHash . + */ + @Test + void testHash() { + assertEquals(16, ColorUtils.hash("1", ColorUtils.MD_PALETTE.length)); + } + + /** + * test function the testColorForThread . + */ + @Test + void testColorForThread() { + CpuData cpuData = new CpuData(); + cpuData.setProcessId(1); + assertEquals(ColorUtils.MD_PALETTE[16], ColorUtils.colorForThread(cpuData)); + } + + /** + * test function the testColorForTid . + */ + @Test + void testColorForTid() { + assertEquals(ColorUtils.MD_PALETTE[16], ColorUtils.colorForTid(1)); + } + +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/DbTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/DbTest.java new file mode 100644 index 000000000..39b52fe2d --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/DbTest.java @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.util; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.sql.Connection; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test Db class . + * + * @version 1.0 + * @date: 2021/4/24 17:52 + **/ +class DbTest { + /** + * test function the getDbName . + */ + @Test + void getDbName() { + assertEquals("trace.db", Db.getDbName()); + } + + /** + * test function the setDbName . + */ + @Test + void setDbName() { + Db.setDbName("trace.db"); + assertEquals("trace.db", Db.getDbName()); + } + + /** + * test function the getConn . + */ + @Test + void getConn() { + Connection conn = Db.getInstance().getConn(); + assertEquals(true, conn != null); + } + + /** + * test function the free . + */ + @Test + void free() { + Connection conn = Db.getInstance().getConn(); + Db.getInstance().free(conn); + assertEquals(true, conn != null); + } + + /** + * test function the load . + */ + @Test + void load() { + Db.load(false); + assertEquals(true, Db.getInstance() != null); + } + + /** + * test function the getInstance . + */ + @Test + void getInstance() { + assertEquals(true, Db.getInstance() != null); + } + + /** + * test function the getSql . + */ + @Test + void getSql() { + assertEquals(true, Db.getSql("QueryTotalTime") != null); + } + + /** + * test function the queryTotalTime . + */ + @Test + void queryTotalTime() { + long queryTotalTime = Db.getInstance().queryTotalTime(); + assertEquals(true, queryTotalTime > 0); + } + + /** + * test function the queryCpu . + */ + @Test + void queryCpu() { + assertEquals(true, Db.getInstance().queryCpu() != null); + } + + /** + * test function the queryCpuFreq . + */ + @Test + void queryCpuFreq() { + assertEquals(true, Db.getInstance().queryCpuFreq() != null); + } + + /** + * test function the queryCpuMax . + */ + @Test + void queryCpuMax() { + assertEquals(true, Db.getInstance().queryCpuMax() >= 0); + } + + /** + * test function the queryCpuData . + */ + @Test + void queryCpuData() { + assertEquals(true, Db.getInstance().queryCpuData(0) != null); + } + + /** + * test function the queryCpuMaxFreq . + */ + @Test + void queryCpuMaxFreq() { + assertEquals(true, Db.getInstance().queryCpuMaxFreq() != null); + } + + /** + * test function the queryCpuFreqData . + */ + @Test + void queryCpuFreqData() { + assertEquals(true, Db.getInstance().queryCpuFreqData(0) != null); + } + + /** + * test function the queryProcess . + */ + @Test + void queryProcess() { + assertEquals(true, Db.getInstance().queryProcess() != null); + } + + /** + * test function the queryProcessThreads . + */ + @Test + void queryProcessThreads() { + assertEquals(true, Db.getInstance().queryProcessThreads() != null); + } + + /** + * test function the queryProcessData . + */ + @Test + void queryProcessData() { + assertEquals(true, Db.getInstance().queryProcessData(0) != null); + } + + /** + * test function the queryThreadData . + */ + @Test + void queryThreadData() { + assertEquals(true, Db.getInstance().queryThreadData(0) != null); + } + + /** + * test function the queryWakeupThread . + */ + @Test + void queryWakeupThread() { + assertEquals(null, Db.getInstance().queryWakeupThread(null)); + } + + /** + * test function the getCpuUtilizationRate . + */ + @Test + void getCpuUtilizationRate() { + assertEquals(true, Db.getInstance().getCpuUtilizationRate() != null); + } + + /** + * test function the getProcessMem . + */ + @Test + void getProcessMem() { + assertEquals(true, Db.getInstance().getProcessMem() != null); + } + + /** + * test function the getProcessMemData . + */ + @Test + void getProcessMemData() { + assertEquals(true, Db.getInstance().getProcessMemData(0) != null); + } + + /** + * test function the getFunDataByTid . + */ + @Test + void getFunDataByTid() { + assertEquals(true, Db.getInstance().getFunDataByTid(0) != null); + } + + /** + * init the db setup . + */ + @BeforeEach + void setUp() { + Db.getInstance(); + Db.setDbName("trace.db"); + Db.load(false); + } + + /** + * set down . + */ + @AfterEach + void tearDown() { + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/FinalTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/FinalTest.java new file mode 100644 index 000000000..9793d88a3 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/FinalTest.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.util; + +/** + * test Final class . + * + * @version 1.0 + * @date 2021/4/24 17:51 + **/ +class FinalTest { +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/ImageUtilsTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/ImageUtilsTest.java new file mode 100644 index 000000000..ff65a5795 --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/ImageUtilsTest.java @@ -0,0 +1,264 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.util; + +import org.junit.jupiter.api.Test; + +import javax.imageio.ImageIO; +import java.awt.Image; +import java.io.IOException; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test ImageUtils class . + * + * @version 1.0 + * @date 2021/4/24 17:53 + **/ +class ImageUtilsTest { + /** + * test function the getStarFill . + */ + @Test + void getStarFill() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setStarFill(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getStarFill() != null); + } + + /** + * test function the setStarFill . + */ + @Test + void setStarFill() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setStarFill(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getStarFill() != null); + } + + /** + * test function the getStar . + */ + @Test + void getStar() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setStar(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getStar() != null); + } + + /** + * test function the setStar . + */ + @Test + void setStar() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setStar(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getStar() != null); + } + + /** + * test function the getCheckYes . + */ + @Test + void getCheckYes() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setCheckYes(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getCheckYes() != null); + } + + /** + * test function the setCheckYes . + */ + @Test + void setCheckYes() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setCheckYes(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getCheckYes() != null); + } + + /** + * test function the getCheckNo . + */ + @Test + void getCheckNo() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setCheckNo(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getCheckNo() != null); + } + + /** + * test function the setCheckNo . + */ + @Test + void setCheckNo() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setCheckNo(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getCheckNo() != null); + } + + /** + * test function the getArrowDown . + */ + @Test + void getArrowDown() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setArrowDown(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getArrowDown() != null); + } + + /** + * test function the setArrowDown . + */ + @Test + void setArrowDown() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setArrowDown(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getArrowDown() != null); + } + + /** + * test function the getArrowDownFocus . + */ + @Test + void getArrowDownFocus() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setArrowDownFocus(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getArrowDownFocus() != null); + } + + /** + * test function the setArrowDownFocus . + */ + @Test + void setArrowDownFocus() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setArrowDownFocus(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getArrowDownFocus() != null); + } + + /** + * test function the getArrowUp . + */ + @Test + void getArrowUp() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setArrowUpFocus(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getArrowUpFocus() != null); + } + + /** + * test function the setArrowUp . + */ + @Test + void setArrowUp() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setArrowUpFocus(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getArrowUpFocus() != null); + } + + /** + * test function the getArrowUpFocus . + */ + @Test + void getArrowUpFocus() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setArrowUpFocus(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getArrowUpFocus() != null); + } + + /** + * test function the setArrowUpFocus . + */ + @Test + void setArrowUpFocus() { + try { + Image image = ImageIO.read(ImageUtils.class.getResourceAsStream("/assets/top_star_fill.png")); + ImageUtils.getInstance().setArrowUpFocus(image); + } catch (IOException e) { + e.printStackTrace(); + } + assertEquals(true, ImageUtils.getInstance().getArrowUpFocus() != null); + } + + /** + * test function the getInstance . + */ + @Test + void getInstance() { + assertEquals(true, ImageUtils.getInstance() != null); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/TimeUtilsTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/TimeUtilsTest.java new file mode 100644 index 000000000..0f2a7411c --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/TimeUtilsTest.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.util; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * test TimeUtils class . + * + * @version 1.0 + * @date 2021/4/24 17:03 + **/ +class TimeUtilsTest { + /** + * test function the getSecondFromNSecond . + */ + @Test + void getSecondFromNSecond() { + String str = TimeUtils.getSecondFromNSecond(1000L); + assertEquals("1.0us", str); + } + + /** + * test function the getTimeString . + */ + @Test + void getTimeString() { + String timeString = TimeUtils.getTimeString(1000L); + assertEquals("1us", timeString); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/UtilsTest.java b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/UtilsTest.java new file mode 100644 index 000000000..e82ad3bbd --- /dev/null +++ b/host/ohosprofiler/src/test/java/ohos/devtools/views/trace/util/UtilsTest.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.devtools.views.trace.util; + +import org.junit.jupiter.api.Test; + +import java.awt.Rectangle; +import java.util.Map; + +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +/** + * test Utils class . + * + * @version 1.0 + * @date 2021/4/24 17:51 + **/ +class UtilsTest { + /** + * test function the getStatusMap . + */ + @Test + void getStatusMap() { + Map statusMap = Utils.getInstance().getStatusMap(); + assertNotNull(statusMap); + assertEquals("Sleeping", statusMap.get("S")); + } + + /** + * test function the getInstance . + */ + @Test + void getInstance() { + Utils instance = Utils.getInstance(); + assertNotEquals(null, instance); + } + + /** + * test function the pointInRect . + */ + @Test + void pointInRect() { + boolean pointInRect = Utils.pointInRect(new Rectangle(0, 0, 100, 100), 50, 50); + assertTrue(pointInRect); + } + + /** + * test function the getEndState . + */ + @Test + void getEndState() { + String endState = Utils.getEndState("S"); + assertEquals("Sleeping", endState); + } +} \ No newline at end of file diff --git a/host/ohosprofiler/src/test/resources/Demo.trace b/host/ohosprofiler/src/test/resources/Demo.trace new file mode 100644 index 000000000..dff1c979b Binary files /dev/null and b/host/ohosprofiler/src/test/resources/Demo.trace differ diff --git a/interfaces/innerkits/share_memory_allocator.h b/interfaces/innerkits/share_memory_allocator.h new file mode 100755 index 000000000..d048d41b7 --- /dev/null +++ b/interfaces/innerkits/share_memory_allocator.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SHARE_MEMORY_ALLOCATOR_H +#define SHARE_MEMORY_ALLOCATOR_H + +#include "share_memory_block.h" +#include + +class ShareMemoryAllocator { +public: + static ShareMemoryAllocator& GetInstance(); + + std::shared_ptr CreateMemoryBlockLocal(std::string name, uint32_t size); + std::shared_ptr CreateMemoryBlockRemote(std::string name, uint32_t size, int fd); + + bool ReleaseMemoryBlockLocal(std::string name); + bool ReleaseMemoryBlockRemote(std::string name); + + std::shared_ptr FindMBByName(std::string name); + +private: + ShareMemoryAllocator(); + ~ShareMemoryAllocator(); + + std::map> memoryBlocks; +}; + +#endif \ No newline at end of file diff --git a/interfaces/innerkits/share_memory_block.h b/interfaces/innerkits/share_memory_block.h new file mode 100755 index 000000000..d3da03fba --- /dev/null +++ b/interfaces/innerkits/share_memory_block.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SHARE_MEMORY_BLOCK_H +#define SHARE_MEMORY_BLOCK_H + +#include "google/protobuf/message.h" +#include +#include + +#define SHARE_MEMORY_HEAD_SIZE 64 + +struct ShareMemoryStruct { + struct alignas(SHARE_MEMORY_HEAD_SIZE) { + uint32_t writeOffset; + uint32_t readOffset; + uint32_t memorySize_; + } head; + int8_t data[0]; +}; + +class ShareMemoryBlock { +public: + ShareMemoryBlock(); + + bool CreateBlock(std::string name, uint32_t size); + bool ReleaseBlock(); + bool CreateBlockByFd(std::string name, uint32_t size, int fd); + bool ReleaseBlockRemote(); + + int8_t* GetFreeMemory(uint32_t size); + bool UseFreeMemory(int8_t* pmem, uint32_t size); + bool PutRaw(const int8_t* data, uint32_t size); + bool PutProtobuf(google::protobuf::Message& pmsg); + + uint32_t GetDataSize(); + int8_t* GetDataPoint(); + bool Next(); + + std::string GetName(); + uint32_t GetSize(); + int GetfileDescriptor(); + + enum DropType { + DROP_OLD, // buffer满时,丢弃最老的数据 + DROP_NONE, // buffer满时,不丢弃老数据,不放入新数据 + }; + void SetDropType(enum DropType dt) + { + dropType_ = dt; + } + +private: + int8_t* GetCurrentFreeMemory(uint32_t size); + + std::string memoryName_; + uint32_t memorySize_; + int fileDescriptor_; + + void* memoryPoint_; + struct ShareMemoryStruct* pMemory_; + + DropType dropType_; +}; + +#endif \ No newline at end of file diff --git a/interfaces/kits/plugin_module_api.h b/interfaces/kits/plugin_module_api.h new file mode 100755 index 000000000..59070575c --- /dev/null +++ b/interfaces/kits/plugin_module_api.h @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PLUGIN_MODULE_API_H +#define PLUGIN_MODULE_API_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief interface type of plug-in session starting + * + * It will be called when the plug-in session starts, and the binary data pointed + * by the parameter is the protobuffer binary data filled by the IDE side; + * + * The implementation part —— need to call the deserialization code generated by + * protobuffer to restore it to the data type generated by proto; + * + * For the third-party developers, you can also not use the protobuffer as a + * serialization tool, only need to adapt to the Java code; + * + * @param ConfigData configure the starting address of information memory block + * @param ConfigSize configure the byte counts of information memory block + * @return Return 0 for success and - 1 for failure + */ +typedef int (*PluginSessionStartCallback)(const uint8_t* configData, uint32_t configSize); + +/** + * @brief interface type of Plug-in result reporting interface type + * The incoming memory block is a large memory pre allocated by the plug-in management module, + * The implementation part —— need to define the specific result type object of proto and serialize it to this memory, + * The framework will transfer the original data to the PC as it is; + * @param bufferData: the starting address of the memory buffer where the result is stored + * @param bufferSize: The byte counts in the memory buffer where the result is stored + * @return The return value greater than 0 indicates the number of bytes filled in memory, + * and 0 indicates that nothing is filled, + * return value less than 0 indicates failure, and - 1 is a general error; + * If the absolute value of the return value is greater than buffersize, the number of bytes in the buffer + * is insufficient to store the result. The framework will try to get the result again with a larger cache; + */ +typedef int (*PluginReportResultCallback)(uint8_t* bufferData, uint32_t bufferSize); + +/** + * @brief interface type of plug-in session stop, + * Called when stopping plug-in sessions + * @return Return 0 for success and - 1 for failure; + */ +typedef int (*PluginSessionStopCallback)(); + +/** + * WriterStruct type forward declaration + */ +typedef struct WriterStruct WriterStruct; + +/** + * @brief write : interface type + * @param writer : pointer + * @param data : the first byte pointer of data buffer + * @param size : The byte counts in the data buffer + * @return : Return the number of bytes written for success, and returns - 1 for failure + */ +typedef long (*WriteFuncPtr)(WriterStruct* writer, const void* data, size_t size); + +/** + * @brief flush : interface type + * @return Return true for success and false for failure; + */ +typedef bool (*FlushFuncPtr)(WriterStruct* writer); + +/** + * WriterStruct : type definition, containing two function pointers; + */ +struct WriterStruct { + /** + * write : function pointer,point to the actual write function; + */ + WriteFuncPtr write; + + /** + * flush function pointer,point to the actual flush function; + */ + FlushFuncPtr flush; +}; + +/** + * @brief : register writer interface type + * @param : writer, writer pointer + * @return : Return 0 for success and - 1 for failure + */ +typedef int (*RegisterWriterStructCallback)(const WriterStruct* writer); + +/** + * PluginModuleCallbacks : type forward declaration + */ +typedef struct PluginModuleCallbacks PluginModuleCallbacks; + +/** + * @brief Plug-in callback function table + */ +struct PluginModuleCallbacks { + /** + * Session start callback + */ + PluginSessionStartCallback onPluginSessionStart; + + /** + * Data reporting callback and it is used to connect the + * polling reporting results of plug-in management framework, + */ + PluginReportResultCallback onPluginReportResult; + + /** + * Session stop callback + */ + PluginSessionStopCallback onPluginSessionStop; + + /** + * Register the writer callback, which is used to connect the + * flow reporting results of plug-in management framework + */ + RegisterWriterStructCallback onRegisterWriterStruct; +}; + +/** + * @brief The maximum length of the plug-in name and it does not contain the ending character(\0) + */ +#define PLUGIN_MODULE_NAME_MAX 127 + +/** + * PluginModuleStruct type forward declaration + */ +typedef struct PluginModuleStruct PluginModuleStruct; + +struct PluginModuleStruct { + /** + * Callback function table + */ + PluginModuleCallbacks* callbacks; + + /** + * Plug-in name + */ + char name[PLUGIN_MODULE_NAME_MAX + 1]; + + /** + * (polling type needed)result buffer byte number prompt, used to prompt the plug-in management + * module to call the data reporting interface to use the memory buffer byte number + */ + uint32_t resultBufferSizeHint; +}; + +/** + * Plug-in module registration information; + + * The plug-in management module will search the symbol from the dynamic object file according to the name, + * and then retrieve the basic information and callback function table; + * + * If Callback function table of onPluginReportResult is filled with non null values, + * the plug-in will be regarded as a "polling" plug-in by the plug-in management framework, + * and the management framework will call this interface in the module regularly。 + + * If Callback function table of onRegisterWriterStruct is filled with non null values, + * The plug-in will be regarded as a "streaming" plug-in by the plug-in management framework, + * and the management framework will not call this interface in the module regularly。 + + * The plug-in module needs to save the writer pointer when the onregisterwriterstruct interface is called, + * and create a thread when the onpluginsessionstart interface is called; + + * At the right time, the thread calls the writer's write() interface to write data to + * the shared memory area, and calls the writer's flush (); + + * The interface notifies the service process to take the data from the shared memory area; + */ +extern PluginModuleStruct g_pluginModule; + +#ifdef __cplusplus +} +#endif + +#endif // PLUGIN_MODULE_API_H diff --git a/interfaces/kits/test/BUILD.gn b/interfaces/kits/test/BUILD.gn new file mode 100755 index 000000000..c45d5961e --- /dev/null +++ b/interfaces/kits/test/BUILD.gn @@ -0,0 +1,61 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/test.gni") +import("../../../device/base/config.gni") + +module_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/interfaces/kits" +config("module_private_config") { + visibility = [":*"] + if (current_toolchain != host_toolchain) { + defines = [ "HAVE_HILOG" ] + } +} + +ohos_unittest("plugin_module_api_ut") { + module_out_path = module_output_path + deps = [ + "//third_party/googletest:gtest", + "${OHOS_PROFILER_DIR}/protos/types/plugins/memory_data:memory_data_cpp", + "${OHOS_PROFILER_DIR}/device/plugins/memory_plugin:memdataplugin", + ] + include_dirs = [ + "../", + "${OHOS_PROFILER_DIR}/device/plugins/memory_plugin/include", + "${OHOS_PROFILER_DIR}/device/plugins/api/include", + "${OHOS_PROFILER_DIR}/device/plugins/api/src", + "${OHOS_PROFILER_DIR}/device/base/include/", + "//third_party/googletest/googletest/include/gtest", + ] + sources = [ + "unittest/plugin_module_api_test.cpp", + ] + cflags = [ + "-pthread", + "-Wno-inconsistent-missing-override", + "-Dprivate=public", #allow test code access private members + ] + external_deps = [ + "hiviewdfx_hilog_native:libhilog", + ] + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + configs = [ ":module_private_config" ] + resource_config_file = get_path_info("unittest/ohos_test.xml", "abspath") +} + +group("unittest") { + testonly = true + deps = [ + ":plugin_module_api_ut", + ] +} diff --git a/interfaces/kits/test/unittest/ohos_test.xml b/interfaces/kits/test/unittest/ohos_test.xml new file mode 100644 index 000000000..fcc958464 --- /dev/null +++ b/interfaces/kits/test/unittest/ohos_test.xml @@ -0,0 +1,23 @@ + + + + + + + + diff --git a/interfaces/kits/test/unittest/plugin_module_api_test.cpp b/interfaces/kits/test/unittest/plugin_module_api_test.cpp new file mode 100644 index 000000000..cf3123f19 --- /dev/null +++ b/interfaces/kits/test/unittest/plugin_module_api_test.cpp @@ -0,0 +1,243 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "logging.h" +#include "memory_plugin_config.pb.h" +#include "memory_plugin_result.pb.h" +#include "plugin_module_api.h" + +using namespace testing::ext; + +#if defined(__i386__) || defined(__x86_64__) +const std::string LIB_PATH = "./hos/out/hos-arm/clang_x64/devtools/devtools/libmemdataplugin.z.so"; +#else +const std::string LIB_PATH = "/system/lib/libmemdataplugin.z.so"; +#endif + +namespace { +enum NumType { + BIT_WIDTH = 35, + MS_S = 1000000, + ERR_PARAM = 1, + ERR_ADDR, + ERR_START, +}; + +class PluginModuleApiTest : public ::testing::Test { +protected: + static void SetUpTestCase() {} + static void TearDownTestCase() {} + + void SetUp() override {} + void TearDown() override {} + + bool MatchTail(const std::string& name, std::string str) + { + int index = name.size() - str.size(); + if (index < 0) { + return false; + } + return (name.substr(index) == str); + } + + bool ProcessErr(int errNum, void *handle, uint8_t* dataBuffer) + { + switch (errNum) { + case ERR_ADDR: + dlclose(handle); + HILOG_DEBUG(LOG_CORE, "test:check addr err."); + break; + case ERR_START: + dlclose(handle); + free(dataBuffer); + HILOG_DEBUG(LOG_CORE, "test:start err."); + break; + default: + HILOG_DEBUG(LOG_CORE, "test:check param err."); + break; + } + return false; + } + + bool MemoryPluginTest(MemoryConfig& protoConfig, const std::string libPath) + { + MemoryData memoryData; + if (!MatchTail(libPath, ".so")) { + return ProcessErr(ERR_PARAM, nullptr, nullptr); + } + + void* handle = dlopen(libPath.c_str(), RTLD_LAZY); + if (handle == nullptr) { + return ProcessErr(ERR_PARAM, nullptr, nullptr); + } + + PluginModuleStruct* memPlugin = (PluginModuleStruct*)dlsym(handle, "g_pluginModule"); + if (memPlugin == nullptr) { + return ProcessErr(ERR_ADDR, handle, nullptr); + } + uint8_t* dataBuffer = (uint8_t*)malloc(memPlugin->resultBufferSizeHint); + if (dataBuffer == nullptr) { + return ProcessErr(ERR_ADDR, handle, nullptr); + } + + int configlength = protoConfig.ByteSizeLong(); + std::vector config(configlength); + protoConfig.SerializeToArray(config.data(), config.size()); + + if (memPlugin->callbacks->onPluginSessionStart(config.data(), config.size()) < 0) { + return ProcessErr(ERR_START, handle, dataBuffer); + } + + int len = memPlugin->callbacks->onPluginReportResult(dataBuffer, memPlugin->resultBufferSizeHint); + if (len > 0) { + memoryData.ParseFromArray(dataBuffer, len); + } + + memPlugin->callbacks->onPluginSessionStop(); + memPlugin->callbacks->onRegisterWriterStruct(nullptr); + + dlclose(handle); + free(dataBuffer); + return true; + } +}; + +HWTEST_F(PluginModuleApiTest, ProtoConfigNullAndInvalidSo, TestSize.Level1) +{ + MemoryConfig protoConfig; + EXPECT_FALSE(PluginModuleApiTest::MemoryPluginTest(protoConfig, "1111")); +} + +HWTEST_F(PluginModuleApiTest, ProtoConfigNullAndEffectiveSo, TestSize.Level1) +{ + MemoryConfig protoConfig; + EXPECT_TRUE(PluginModuleApiTest::MemoryPluginTest(protoConfig, LIB_PATH)); +} + +HWTEST_F(PluginModuleApiTest, ProtoConfigMemAndInvalidSo, TestSize.Level1) +{ + MemoryConfig protoConfig; + protoConfig.set_report_process_mem_info(true); + EXPECT_FALSE(PluginModuleApiTest::MemoryPluginTest(protoConfig, "1111")); +} + +HWTEST_F(PluginModuleApiTest, ProtoConfigMemAndEffectiveSo, TestSize.Level1) +{ + MemoryConfig protoConfig; + protoConfig.set_report_process_mem_info(true); + EXPECT_TRUE(PluginModuleApiTest::MemoryPluginTest(protoConfig, LIB_PATH)); +} + +HWTEST_F(PluginModuleApiTest, ProtoConfigPidAndInvalidSo, TestSize.Level1) +{ + MemoryConfig protoConfig; + protoConfig.set_report_app_mem_info(true); + protoConfig.add_pid(1); + EXPECT_FALSE(PluginModuleApiTest::MemoryPluginTest(protoConfig, "1111")); +} + +HWTEST_F(PluginModuleApiTest, ProtoConfigPidAndEffectiveSo, TestSize.Level1) +{ + MemoryConfig protoConfig; + protoConfig.set_report_app_mem_info(true); + protoConfig.add_pid(1); + EXPECT_TRUE(PluginModuleApiTest::MemoryPluginTest(protoConfig, LIB_PATH)); +} + +HWTEST_F(PluginModuleApiTest, MemoryPluginTreeAndInvalidSo, TestSize.Level1) +{ + MemoryConfig protoConfig; + protoConfig.set_report_process_tree(true); + EXPECT_FALSE(PluginModuleApiTest::MemoryPluginTest(protoConfig, "1111")); +} + +HWTEST_F(PluginModuleApiTest, MemoryPluginTreeAndEffectiveSo, TestSize.Level1) +{ + MemoryConfig protoConfig; + protoConfig.set_report_process_tree(true); + EXPECT_TRUE(PluginModuleApiTest::MemoryPluginTest(protoConfig, LIB_PATH)); +} + +HWTEST_F(PluginModuleApiTest, ApiCallInvalidSoAndInvalidStruct, TestSize.Level1) +{ + PluginModuleStruct* memPlugin = nullptr; + void* handle = dlopen(LIB_PATH.c_str(), RTLD_LAZY); + ASSERT_NE(handle, nullptr); + + memPlugin = (PluginModuleStruct*)dlsym(handle, "g_pluginModule"); + ASSERT_NE(memPlugin, nullptr); + + ASSERT_EQ(memPlugin->callbacks->onPluginSessionStart(nullptr, 0), 0); + ASSERT_EQ(memPlugin->callbacks->onPluginReportResult(nullptr, 0), 0); + ASSERT_EQ(memPlugin->callbacks->onPluginSessionStop(), 0); + ASSERT_EQ(memPlugin->callbacks->onRegisterWriterStruct(nullptr), 0); +} + +HWTEST_F(PluginModuleApiTest, ApiCallEffectiveSoAndInvalidStruct, TestSize.Level1) +{ + PluginModuleStruct* memPlugin = nullptr; + void* handle = dlopen(LIB_PATH.c_str(), RTLD_LAZY); + ASSERT_NE(handle, nullptr); + + memPlugin = (PluginModuleStruct*)dlsym(handle, "g_pluginModule"); + ASSERT_NE(memPlugin, nullptr); + + ASSERT_EQ(memPlugin->callbacks->onPluginSessionStart(nullptr, 0), 0); + ASSERT_EQ(memPlugin->callbacks->onPluginReportResult(nullptr, 0), 0); + ASSERT_EQ(memPlugin->callbacks->onPluginSessionStop(), 0); + ASSERT_EQ(memPlugin->callbacks->onRegisterWriterStruct(nullptr), 0); +} + +HWTEST_F(PluginModuleApiTest, ApiCallInvalidSoAndEffectiveStruct, TestSize.Level1) +{ + PluginModuleStruct* memPlugin = nullptr; + void* handle = dlopen(LIB_PATH.c_str(), RTLD_LAZY); + ASSERT_NE(handle, nullptr); + + memPlugin = (PluginModuleStruct*)dlsym(handle, "g_pluginModule"); + ASSERT_NE(memPlugin, nullptr); + + WriterStruct writer; + + ASSERT_EQ(memPlugin->callbacks->onPluginSessionStart(nullptr, 0), 0); + ASSERT_EQ(memPlugin->callbacks->onPluginSessionStop(), 0); + ASSERT_EQ(memPlugin->callbacks->onRegisterWriterStruct(&writer), 0); +} + +HWTEST_F(PluginModuleApiTest, ApiCallEffectiveSoAndEffectiveStruct, TestSize.Level1) +{ + PluginModuleStruct* memPlugin = nullptr; + void* handle = dlopen(LIB_PATH.c_str(), RTLD_LAZY); + ASSERT_NE(handle, nullptr); + + memPlugin = (PluginModuleStruct*)dlsym(handle, "g_pluginModule"); + ASSERT_NE(memPlugin, nullptr); + + WriterStruct writer; + ASSERT_EQ(memPlugin->callbacks->onPluginSessionStart(nullptr, 0), 0); + ASSERT_EQ(memPlugin->callbacks->onPluginSessionStop(), 0); + ASSERT_EQ(memPlugin->callbacks->onRegisterWriterStruct(&writer), 0); +} +} // namespace diff --git a/ohos.build b/ohos.build new file mode 100755 index 000000000..05a5dc10a --- /dev/null +++ b/ohos.build @@ -0,0 +1,14 @@ +{ + "subsystem": "developtools", + "parts": { + "profiler": { + "module_list": [ + "//developtools/profiler/device:hiprofiler_targets" + ], + "test_list": [ + "//developtools/profiler/device:unittest", + "//developtools/profiler/interfaces/kits/test:unittest" + ] + } + } +} \ No newline at end of file diff --git a/protos/README_zh.md b/protos/README_zh.md new file mode 100644 index 000000000..112aca9fd --- /dev/null +++ b/protos/README_zh.md @@ -0,0 +1,10 @@ +# protos 代码仓 + + + +`services` 目录下存放的是 服务接口定义, + +`types` 目录下存放的是 具体插件业务相关的类型定义,主要为配置类型和结果类型定义; + +例如,`types/plugins/cpu_data/` 目录存放CPU数据插件的配置类型和结果类型; + diff --git a/protos/protos.gni b/protos/protos.gni new file mode 100644 index 000000000..a3522f586 --- /dev/null +++ b/protos/protos.gni @@ -0,0 +1,24 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("../build/config.gni") + +subsys_name = OHOS_PROFILER_SUBSYS_NAME +subsys_x64_out = "clang_x64/$subsys_name/$subsys_name" +libc_dir_proto = rebase_path("$asdk_libs_dir", "//") +root_output_dir_proto = rebase_path("$root_out_dir", "//") +# print("grpc_cpp_plugin = ", grpc_cpp_plugin) +# print("ipc_cpp_plugin = ", ipc_cpp_plugin) +# print("root_build_dir = ", root_build_dir) +# print("root_out_dir = ", root_out_dir) +# print("root_gen_dir = ", root_gen_dir) diff --git a/protos/services/BUILD.gn b/protos/services/BUILD.gn new file mode 100755 index 000000000..81abebbbd --- /dev/null +++ b/protos/services/BUILD.gn @@ -0,0 +1,225 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("../protos.gni") + +proto_types_defines = [ + "./common_types.proto", + "./plugin_service_types.proto", + "./profiler_service_types.proto", +] + +plugin_services_defines = [ "./plugin_service.proto" ] + +profiler_services_defines = [ "./profiler_service.proto" ] + +####################################################### +proto_out_dir = "$root_gen_dir/cpp/" + rebase_path(".", "//") +proto_rel_out_dir = rebase_path(proto_out_dir, root_build_dir) +print("proto_out_dir", proto_out_dir, proto_rel_out_dir) + +grpc_cpp_plugin = "$subsys_x64_out/grpc_cpp_plugin" +ipc_cpp_plugin = "$subsys_x64_out/protoc_gen_ipc" + +####################################################### +proto_types_codegen = [] +foreach(proto, proto_types_defines) { + name = get_path_info(proto, "name") + proto_types_codegen += [ + "$proto_out_dir/$name.pb.h", + "$proto_out_dir/$name.pb.cc", + ] +} + +action("service_types_proto_gen") { + script = "${OHOS_PROFILER_DIR}/build/protoc.sh" + sources = proto_types_defines + outputs = proto_types_codegen + args = [ + "$libc_dir_proto", + "$root_output_dir_proto", + "--cpp_out", + "$proto_rel_out_dir", + "--proto_path", + rebase_path(".", root_build_dir), + ] + args += rebase_path(sources, root_build_dir) + deps = [ + "${OHOS_PROFILER_3RDPARTY_GRPC_DIR}:grpc_cpp_plugin(${host_toolchain})", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + ] +} + +config("service_types_proto_config") { + include_dirs = [ "$proto_out_dir" ] +} + +ohos_source_set("service_types_proto") { + deps = [ ":service_types_proto_gen" ] + public_deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + ] + include_dirs = [ "$proto_out_dir" ] + public_configs = [ ":service_types_proto_config" ] + sources = proto_types_codegen +} + +ohos_source_set("service_types_proto_static") { + deps = [ ":service_types_proto_gen" ] + public_deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite_static", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_static", + ] + include_dirs = [ "$proto_out_dir" ] + public_configs = [ ":service_types_proto_config" ] + sources = proto_types_codegen +} + +####################################################### +profiler_services_codegen = [] +foreach(proto, profiler_services_defines) { + name = get_path_info(proto, "name") + profiler_services_codegen += [ + "$proto_out_dir/$name.pb.h", + "$proto_out_dir/$name.pb.cc", + "$proto_out_dir/$name.grpc.pb.h", + "$proto_out_dir/$name.grpc.pb.cc", + ] +} + +action("profiler_services_proto_gen") { + script = "${OHOS_PROFILER_DIR}/build/protoc.sh" + sources = profiler_services_defines + outputs = profiler_services_codegen + args = [ + "$libc_dir_proto", + "$root_output_dir_proto", + "--plugin=protoc-gen-grpc=$grpc_cpp_plugin", + "--grpc_out", + "$proto_rel_out_dir", + "--cpp_out", + "$proto_rel_out_dir", + "--proto_path", + rebase_path(".", root_build_dir), + ] + args += rebase_path(sources, root_build_dir) + deps = [ + "${OHOS_PROFILER_3RDPARTY_GRPC_DIR}:grpc_cpp_plugin(${host_toolchain})", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + ] +} + +config("profiler_services_proto_config") { + include_dirs = [ "$proto_out_dir" ] +} + +ohos_source_set("profiler_services_proto") { + deps = [ + ":profiler_services_proto_gen", + ":service_types_proto", + ] + public_deps = [ + "${OHOS_PROFILER_3RDPARTY_GRPC_DIR}:grpc", + "${OHOS_PROFILER_3RDPARTY_GRPC_DIR}:grpcxx", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + ] + include_dirs = [ "$proto_out_dir" ] + public_configs = [ ":profiler_services_proto_config" ] + sources = profiler_services_codegen +} + +####################################################### +plugin_services_codegen = [] +foreach(proto, plugin_services_defines) { + name = get_path_info(proto, "name") + plugin_services_codegen += [ + "$proto_out_dir/$name.pb.h", + "$proto_out_dir/$name.pb.cc", + "$proto_out_dir/$name.ipc.h", + "$proto_out_dir/$name.ipc.cc", + ] +} + +action("plugin_services_proto_gen") { + script = "${OHOS_PROFILER_DIR}/build/protoc.sh" + sources = plugin_services_defines + outputs = plugin_services_codegen + args = [ + "$libc_dir_proto", + "$root_output_dir_proto", + "--plugin=protoc-gen-ipc=$ipc_cpp_plugin", + "--ipc_out", + "$proto_rel_out_dir", + "--cpp_out", + "$proto_rel_out_dir", + "--proto_path", + rebase_path(".", root_build_dir), + ] + args += rebase_path(sources, root_build_dir) + deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${OHOS_PROFILER_DIR}/device/services/ipc:protoc_gen_ipc(${host_toolchain})", + ] +} + +config("plugin_services_proto_config") { + include_dirs = [ "$proto_out_dir" ] +} + +ohos_source_set("plugin_services_proto") { + deps = [ + ":plugin_services_proto_gen", + ":service_types_proto", + ] + public_deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + "${OHOS_PROFILER_DIR}/device/services/ipc:ipc", + ] + include_dirs = [ + "$proto_out_dir", + "${OHOS_PROFILER_DIR}/device/services/ipc/include", + ] + public_configs = [ ":plugin_services_proto_config" ] + sources = plugin_services_codegen +} + +ohos_source_set("plugin_services_proto_static") { + deps = [ + ":plugin_services_proto_gen", + ":service_types_proto_static", + ] + public_deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite_static", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_static", + "${OHOS_PROFILER_DIR}/device/services/ipc:ipc", + ] + include_dirs = [ + "$proto_out_dir", + "${OHOS_PROFILER_DIR}/device/services/ipc/include", + ] + public_configs = [ ":plugin_services_proto_config" ] + sources = plugin_services_codegen +} + +####################################################### +ohos_source_set("proto_services_cpp") { + public_deps = [ + ":plugin_services_proto", + ":profiler_services_proto", + ":service_types_proto", + ] +} diff --git a/protos/services/common_types.proto b/protos/services/common_types.proto new file mode 100755 index 000000000..fa67090ed --- /dev/null +++ b/protos/services/common_types.proto @@ -0,0 +1,58 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; + +// Common message define for profiler tools, imported by profiler and plugin proto file. +message ProfilerPluginConfig { + string name = 1; + string plugin_sha256 = 2; + uint32 sample_interval = 3; + bytes config_data = 4; +} + +message ProfilerPluginState { + string name = 1; + enum State { + INITED = 0; + REGISTERED = 1; // registered to plugin service. + LOADED = 2; // have created session. + IN_SESSION = 3; // have started session. + }; + State state = 2; +} + +// for FetchDataResponse +message ProfilerPluginData { + string name = 1; + uint32 status = 2; + bytes data = 3; + enum ClockId { + CLOCKID_REALTIME = 0; + CLOCKID_REALTIME_ALARM = 1; // since Linux 3.0; Linux-specific + CLOCKID_REALTIME_COARSE = 2; // since Linux 2.6.32; Linux-specific + CLOCKID_TAI = 3; // since Linux 3.10; Linux-specific + CLOCKID_MONOTONIC = 4; + CLOCKID_MONOTONIC_COARSE = 5; // since Linux 2.6.32; Linux-specific + CLOCKID_MONOTONIC_RAW = 6; // since Linux 2.6.28; Linux-specific + CLOCKID_BOOTTIME = 7; // since Linux 2.6.39; Linux-specific + CLOCKID_BOOTTIME_ALARM = 8; // since Linux 3.0; Linux-specific + CLOCKID_PROCESS_CPUTIME_ID = 9; // since Linux 2.6.12 + CLOCKID_THREAD_CPUTIME_ID = 10; // since Linux 2.6.12 + }; + ClockId clock_id = 4; + uint64 tv_sec = 5; + uint64 tv_nsec = 6; +} diff --git a/protos/services/plugin_service.proto b/protos/services/plugin_service.proto new file mode 100755 index 000000000..ab8583d21 --- /dev/null +++ b/protos/services/plugin_service.proto @@ -0,0 +1,31 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "plugin_service_types.proto"; + +// IPC interface between profiler service and plugin service. +// Use protobuf plug-ins to convert proto define to +// source and header files during the build process. +service IPluginService { + + rpc RegisterPlugin(RegisterPluginRequest) returns (RegisterPluginResponse); + + rpc UnregisterPlugin(UnregisterPluginRequest) returns (UnregisterPluginResponse); + + // service will use this interface to push commands with streamed return channel. + rpc GetCommand(GetCommandRequest) returns (stream GetCommandResponse); + + rpc NotifyResult(NotifyResultRequest) returns (NotifyResultResponse); +}; diff --git a/protos/services/plugin_service_types.proto b/protos/services/plugin_service_types.proto new file mode 100755 index 000000000..3f54f2306 --- /dev/null +++ b/protos/services/plugin_service_types.proto @@ -0,0 +1,103 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "common_types.proto"; + +// Message define for IPC interface, imported by plugin service proto file. +// for RegisterPlugin API +message RegisterPluginRequest { + uint32 request_id = 1; + string path = 2; + string sha256 = 3; + + string name = 4; + uint32 buffer_size_hint = 5; +} + +message RegisterPluginResponse { + uint32 status = 1; + uint32 plugin_id = 2; +} + +// for UnregisterPlugin API +message UnregisterPluginRequest { + uint32 request_id = 1; + uint32 plugin_id = 2; +} + +message UnregisterPluginResponse { + uint32 status = 1; +} + +// for GetCommand API +message GetCommandRequest { + uint32 request_id = 1; +} + +message CreateSessionCmd { + repeated uint32 buffer_sizes = 1; + repeated ProfilerPluginConfig plugin_configs = 2; +} + +message DestroySessionCmd { + repeated uint32 plugin_ids = 1; +} + +message StartSessionCmd { + repeated uint32 plugin_ids = 1; + repeated ProfilerPluginConfig plugin_configs = 2; +} + +message StopSessionCmd { + repeated uint32 plugin_ids = 1; +} + +message GetCommandResponse { + uint32 status = 1; + bool has_more = 2; + uint32 command_id = 3; + oneof command { + CreateSessionCmd create_session_cmd = 10; + DestroySessionCmd destroy_session_cmd = 11; + StartSessionCmd start_session_cmd = 12; + StopSessionCmd stop_session_cmd = 13; + } +} + +// for NotifyResult API +message BufferDescriptor { + int32 buffer_id = 1; + uint32 offset = 2; + uint32 length = 3; +} + +message PluginResult { + uint32 plugin_id = 1; + oneof descriptor { + bytes data = 2; + BufferDescriptor buffer = 3; + }; + ProfilerPluginState status = 10; +} + +message NotifyResultRequest { + uint32 request_id = 1; + uint32 command_id = 2; + repeated PluginResult result = 3; +} + +message NotifyResultResponse { + uint32 status = 1; +} diff --git a/protos/services/profiler_service.proto b/protos/services/profiler_service.proto new file mode 100755 index 000000000..dcbe26902 --- /dev/null +++ b/protos/services/profiler_service.proto @@ -0,0 +1,41 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; + +import "profiler_service_types.proto"; + +// RPC interface between profiler service and host service +// Use protobuf plug-ins to convert proto define to +// source and header files during the build process. +service IProfilerService { + // get all plugin infos and capabilities. + rpc GetCapabilities(GetCapabilitiesRequest) returns (GetCapabilitiesResponse); + + // create tracing sesion and pass tracing config to plugins. + rpc CreateSession(CreateSessionRequest) returns (CreateSessionResponse); + + // start tracing session, active server side tracing triggers. + rpc StartSession(StartSessionRequest) returns (StartSessionResponse); + + // get server-side cached tracing data since current session started. + rpc FetchData(FetchDataRequest) returns (stream FetchDataResponse); + + // stop tracing session, deactivate server side tracing triggers. + rpc StopSession(StopSessionRequest) returns (StopSessionResponse); + + // destroy tracing session. + rpc DestroySession(DestroySessionRequest) returns (DestroySessionResponse); +} diff --git a/protos/services/profiler_service_types.proto b/protos/services/profiler_service_types.proto new file mode 100755 index 000000000..f64776bcc --- /dev/null +++ b/protos/services/profiler_service_types.proto @@ -0,0 +1,119 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; + +import "common_types.proto"; + +// Message define for profiler service, imported by profiler service proto file. +// for GetCapabilities +message GetCapabilitiesRequest { + uint32 request_id = 1; +} + +message ProfilerPluginCapability { + string path = 1; + string name = 2; +} + +message GetCapabilitiesResponse { + uint32 status = 1; + repeated ProfilerPluginCapability capabilities = 2; +} + + +// for CreateSessionRequest +message ProfilerSessionConfig { + message BufferConfig { + enum Policy { + RECYCLE = 0; + FLATTEN = 1; + }; + uint32 pages = 1; + Policy policy = 2; + } + repeated BufferConfig buffers = 1; + + enum Mode { + OFFLINE = 0; // save all plugin results to result file. + ONLINE = 1; // push all plugin results to host PC with streamed FetchDataResponse. + }; + Mode session_mode = 2; + string result_file = 3; // for OFFLINE mode, result file path + uint32 result_max_size = 4; // for OFFLINE mode, result file max size in KB + uint32 sample_duration = 5; // for OFFLINE mode, sample duration in ms +} + +message CreateSessionRequest { + uint32 request_id = 1; + ProfilerSessionConfig session_config = 2; + repeated ProfilerPluginConfig plugin_configs = 3; +} + +message CreateSessionResponse { + uint32 status = 1; + uint32 session_id = 2; + repeated ProfilerPluginState plugin_status = 3; +} + +// for StartSession +message StartSessionRequest { + uint32 request_id = 1; + uint32 session_id = 2; + repeated ProfilerPluginConfig update_configs = 3; +} + +message StartSessionResponse { + uint32 status = 1; + repeated ProfilerPluginState plugin_status = 3; +} + +// for FetchData +message FetchDataRequest { + uint32 request_id = 1; + uint32 session_id = 2; + bytes addtion_data = 3; +} + +message FetchDataResponse { + uint32 status = 1; + uint32 response_id = 2; + bool has_more = 3; + repeated ProfilerPluginData plugin_data = 4; +} + +// for StopSession +message StopSessionRequest { + uint32 request_id = 1; + uint32 session_id = 2; +} + +message StopSessionResponse { + uint32 status = 1; + repeated ProfilerPluginState plugin_status = 3; +} + +// for DestroySession +message DestroySessionRequest { + uint32 request_id = 1; + uint32 session_id = 2; +} + +message DestroySessionResponse { + uint32 status = 1; + repeated ProfilerPluginState plugin_status = 3; +} + + diff --git a/protos/types/plugins/agent_data/BUILD.gn b/protos/types/plugins/agent_data/BUILD.gn new file mode 100755 index 000000000..d0999b723 --- /dev/null +++ b/protos/types/plugins/agent_data/BUILD.gn @@ -0,0 +1,65 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("../../../protos.gni") + +agent_sources = [ + "./agent_plugin_config.proto", + "./agent_plugin_result.proto", +] + +####################################################### +proto_out_dir = "$root_gen_dir/cpp/" + rebase_path(".", "//") +proto_rel_out_dir = rebase_path(proto_out_dir, root_build_dir) + +agent_data_codegen = [] +foreach(proto, agent_sources) { + name = get_path_info(proto, "name") + agent_data_codegen += [ + "$proto_out_dir/$name.pb.h", + "$proto_out_dir/$name.pb.cc", + ] +} + +config("agent_include_config") { + include_dirs = [ "$proto_out_dir" ] +} + +####################################################### +action("agent_data_cpp_gen") { + script = "${OHOS_PROFILER_DIR}/build/protoc.sh" + sources = agent_sources + outputs = agent_data_codegen + args = [ + "$libc_dir_proto", + "$root_output_dir_proto", + "--cpp_out", + "$proto_rel_out_dir", + "--proto_path", + rebase_path(".", root_build_dir), + ] + args += rebase_path(sources, root_build_dir) + deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})" ] +} + +ohos_source_set("agent_data_cpp") { + deps = [ ":agent_data_cpp_gen" ] + public_deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + ] + include_dirs = [ "$proto_out_dir" ] + public_configs = [ ":agent_include_config" ] + sources = agent_data_codegen +} diff --git a/protos/types/plugins/agent_data/agent_plugin_config.proto b/protos/types/plugins/agent_data/agent_plugin_config.proto new file mode 100755 index 000000000..049ffa4e6 --- /dev/null +++ b/protos/types/plugins/agent_data/agent_plugin_config.proto @@ -0,0 +1,22 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; +option optimize_for = LITE_RUNTIME; + + +message AgentConfig { + int32 pid = 1; +} diff --git a/protos/types/plugins/agent_data/agent_plugin_result.proto b/protos/types/plugins/agent_data/agent_plugin_result.proto new file mode 100755 index 000000000..149eb55be --- /dev/null +++ b/protos/types/plugins/agent_data/agent_plugin_result.proto @@ -0,0 +1,60 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; +option optimize_for = LITE_RUNTIME; + +// Java heap memory event from jvmti interface. +message ClassInfo { + int32 class_id = 1; + string class_name = 2; +} + +message AllocationInfo { + int32 object_id = 1; + int32 class_id = 2; + int32 object_size = 3; + int32 array_length = 4; + int32 heap_id = 5; + string thread_name = 6; + + message StackFrameInfo { + int32 frame_id = 1; + string class_name = 2; + string method_name = 3; + string file_name = 4; + int32 line_number = 5; + } + // First element means stack top. + repeated StackFrameInfo frame_info = 7; +} + +message DeallocationInfo { + int32 object_id = 1; +} + +message AgentMemoryEvent { + int64 timestamp = 1; + + oneof event { + ClassInfo class_data = 2; + AllocationInfo alloc_data = 3; + DeallocationInfo free_data = 4; + } +} + +message BatchAgentMemoryEvent { + repeated AgentMemoryEvent events = 1; +} diff --git a/protos/types/plugins/bytrace_plugin/BUILD.gn b/protos/types/plugins/bytrace_plugin/BUILD.gn new file mode 100644 index 000000000..c2f3dc33d --- /dev/null +++ b/protos/types/plugins/bytrace_plugin/BUILD.gn @@ -0,0 +1,63 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("../../../protos.gni") + +bytrace_plugin_protos_defines = [ "./bytrace_plugin_config.proto" ] + +####################################################### +proto_out_dir = "$root_gen_dir/cpp/" + rebase_path(".", "//") +proto_rel_out_dir = rebase_path(proto_out_dir, root_build_dir) +print("proto_out_dir", proto_out_dir, proto_rel_out_dir) + +####################################################### +bytrace_plugin_protos_codegen = [] +foreach(proto, bytrace_plugin_protos_defines) { + name = get_path_info(proto, "name") + bytrace_plugin_protos_codegen += [ + "$proto_out_dir/$name.pb.h", + "$proto_out_dir/$name.pb.cc", + ] +} + +action("bytrace_plugin_protos_protoc") { + script = "${OHOS_PROFILER_DIR}/build/protoc.sh" + sources = bytrace_plugin_protos_defines + outputs = bytrace_plugin_protos_codegen + args = [ + "$libc_dir_proto", + "$root_output_dir_proto", + "--cpp_out", + "$proto_rel_out_dir", + "--proto_path", + rebase_path(".", root_build_dir), + ] + args += rebase_path(sources, root_build_dir) + deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})" ] +} + +config("bytrace_plugin_protos_config") { + include_dirs = [ "$proto_out_dir" ] +} + +ohos_source_set("bytrace_plugin_protos_cpp") { + deps = [ ":bytrace_plugin_protos_protoc" ] + public_deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + ] + include_dirs = [ "$proto_out_dir" ] + public_configs = [ ":bytrace_plugin_protos_config" ] + sources = bytrace_plugin_protos_codegen +} diff --git a/protos/types/plugins/bytrace_plugin/bytrace_plugin_config.proto b/protos/types/plugins/bytrace_plugin/bytrace_plugin_config.proto new file mode 100755 index 000000000..9a2d41e9b --- /dev/null +++ b/protos/types/plugins/bytrace_plugin/bytrace_plugin_config.proto @@ -0,0 +1,23 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; +option optimize_for = LITE_RUNTIME; + +message BytracePluginConfig { + uint32 buffe_size = 1; // Sets the size of the buffer (KB) for storing and reading traces. + repeated string categories = 2; // Lists available bytrace categories. + uint32 time = 3; // Sets the bytrace running duration in seconds (5s by default) + string clock = 4; // Sets the clock, which can be boot (default), global, mono, uptime, or perf. + string outfile_name = 5; // Sets the name of the target file (stdout by default). +} \ No newline at end of file diff --git a/protos/types/plugins/memory_data/BUILD.gn b/protos/types/plugins/memory_data/BUILD.gn new file mode 100755 index 000000000..a1b679a22 --- /dev/null +++ b/protos/types/plugins/memory_data/BUILD.gn @@ -0,0 +1,66 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("../../../protos.gni") + +memory_data_sources = [ + "./memory_plugin_common.proto", + "./memory_plugin_config.proto", + "./memory_plugin_result.proto", +] + +####################################################### +proto_out_dir = "$root_gen_dir/cpp/" + rebase_path(".", "//") +proto_rel_out_dir = rebase_path(proto_out_dir, root_build_dir) + +memory_data_codegen = [] +foreach(proto, memory_data_sources) { + name = get_path_info(proto, "name") + memory_data_codegen += [ + "$proto_out_dir/$name.pb.h", + "$proto_out_dir/$name.pb.cc", + ] +} + +config("memory_include_config") { + include_dirs = [ "$proto_out_dir" ] +} + +####################################################### +action("memory_data_cpp_gen") { + script = "${OHOS_PROFILER_DIR}/build/protoc.sh" + sources = memory_data_sources + outputs = memory_data_codegen + args = [ + "$libc_dir_proto", + "$root_output_dir_proto", + "--cpp_out", + "$proto_rel_out_dir", + "--proto_path", + rebase_path(".", root_build_dir), + ] + args += rebase_path(sources, root_build_dir) + deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})" ] +} + +ohos_source_set("memory_data_cpp") { + deps = [ ":memory_data_cpp_gen" ] + public_deps = [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", + ] + include_dirs = [ "$proto_out_dir" ] + public_configs = [ ":memory_include_config" ] + sources = memory_data_codegen +} diff --git a/protos/types/plugins/memory_data/memory_plugin_common.proto b/protos/types/plugins/memory_data/memory_plugin_common.proto new file mode 100755 index 000000000..afdf89e0f --- /dev/null +++ b/protos/types/plugins/memory_data/memory_plugin_common.proto @@ -0,0 +1,187 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; +option optimize_for = LITE_RUNTIME; + +// Common define for memory plug-in, imported by memory data and config proto file. +enum SysMeminfoType { + MEMINFO_UNSPECIFIED = 0; + MEMINFO_MEM_TOTAL = 1; + MEMINFO_MEM_FREE = 2; + MEMINFO_MEM_AVAILABLE = 3; + MEMINFO_BUFFERS = 4; + MEMINFO_CACHED = 5; + MEMINFO_SWAP_CACHED = 6; + MEMINFO_ACTIVE = 7; + MEMINFO_INACTIVE = 8; + MEMINFO_ACTIVE_ANON = 9; + MEMINFO_INACTIVE_ANON = 10; + MEMINFO_ACTIVE_FILE = 11; + MEMINFO_INACTIVE_FILE = 12; + MEMINFO_UNEVICTABLE = 13; + MEMINFO_MLOCKED = 14; + MEMINFO_SWAP_TOTAL = 15; + MEMINFO_SWAP_FREE = 16; + MEMINFO_DIRTY = 17; + MEMINFO_WRITEBACK = 18; + MEMINFO_ANON_PAGES = 19; + MEMINFO_MAPPED = 20; + MEMINFO_SHMEM = 21; + MEMINFO_SLAB = 22; + MEMINFO_SLAB_RECLAIMABLE = 23; + MEMINFO_SLAB_UNRECLAIMABLE = 24; + MEMINFO_KERNEL_STACK = 25; + MEMINFO_PAGE_TABLES = 26; + MEMINFO_COMMIT_LIMIT = 27; + MEMINFO_COMMITED_AS = 28; + MEMINFO_VMALLOC_TOTAL = 29; + MEMINFO_VMALLOC_USED = 30; + MEMINFO_VMALLOC_CHUNK = 31; + MEMINFO_CMA_TOTAL = 32; + MEMINFO_CMA_FREE = 33; +} + +enum SysVMeminfoType { + VMEMINFO_UNSPECIFIED = 0; + VMEMINFO_NR_FREE_PAGES = 1; + VMEMINFO_NR_ALLOC_BATCH = 2; + VMEMINFO_NR_INACTIVE_ANON = 3; + VMEMINFO_NR_ACTIVE_ANON = 4; + VMEMINFO_NR_INACTIVE_FILE = 5; + VMEMINFO_NR_ACTIVE_FILE = 6; + VMEMINFO_NR_UNEVICTABLE = 7; + VMEMINFO_NR_MLOCK = 8; + VMEMINFO_NR_ANON_PAGES = 9; + VMEMINFO_NR_MAPPED = 10; + VMEMINFO_NR_FILE_PAGES = 11; + VMEMINFO_NR_DIRTY = 12; + VMEMINFO_NR_WRITEBACK = 13; + VMEMINFO_NR_SLAB_RECLAIMABLE = 14; + VMEMINFO_NR_SLAB_UNRECLAIMABLE = 15; + VMEMINFO_NR_PAGE_TABLE_PAGES = 16; + VMEMINFO_NR_KERNEL_STACK = 17; + VMEMINFO_NR_OVERHEAD = 18; + VMEMINFO_NR_UNSTABLE = 19; + VMEMINFO_NR_BOUNCE = 20; + VMEMINFO_NR_VMSCAN_WRITE = 21; + VMEMINFO_NR_VMSCAN_IMMEDIATE_RECLAIM = 22; + VMEMINFO_NR_WRITEBACK_TEMP = 23; + VMEMINFO_NR_ISOLATED_ANON = 24; + VMEMINFO_NR_ISOLATED_FILE = 25; + VMEMINFO_NR_SHMEM = 26; + VMEMINFO_NR_DIRTIED = 27; + VMEMINFO_NR_WRITTEN = 28; + VMEMINFO_NR_PAGES_SCANNED = 29; + VMEMINFO_WORKINGSET_REFAULT = 30; + VMEMINFO_WORKINGSET_ACTIVATE = 31; + VMEMINFO_WORKINGSET_NODERECLAIM = 32; + VMEMINFO_NR_ANON_TRANSPARENT_HUGEPAGES = 33; + VMEMINFO_NR_FREE_CMA = 34; + VMEMINFO_NR_SWAPCACHE = 35; + VMEMINFO_NR_DIRTY_THRESHOLD = 36; + VMEMINFO_NR_DIRTY_BACKGROUND_THRESHOLD = 37; + VMEMINFO_PGPGIN = 38; + VMEMINFO_PGPGOUT = 39; + VMEMINFO_PGPGOUTCLEAN = 40; + VMEMINFO_PSWPIN = 41; + VMEMINFO_PSWPOUT = 42; + VMEMINFO_PGALLOC_DMA = 43; + VMEMINFO_PGALLOC_NORMAL = 44; + VMEMINFO_PGALLOC_MOVABLE = 45; + VMEMINFO_PGFREE = 46; + VMEMINFO_PGACTIVATE = 47; + VMEMINFO_PGDEACTIVATE = 48; + VMEMINFO_PGFAULT = 49; + VMEMINFO_PGMAJFAULT = 50; + VMEMINFO_PGREFILL_DMA = 51; + VMEMINFO_PGREFILL_NORMAL = 52; + VMEMINFO_PGREFILL_MOVABLE = 53; + VMEMINFO_PGSTEAL_KSWAPD_DMA = 54; + VMEMINFO_PGSTEAL_KSWAPD_NORMAL = 55; + VMEMINFO_PGSTEAL_KSWAPD_MOVABLE = 56; + VMEMINFO_PGSTEAL_DIRECT_DMA = 57; + VMEMINFO_PGSTEAL_DIRECT_NORMAL = 58; + VMEMINFO_PGSTEAL_DIRECT_MOVABLE = 59; + VMEMINFO_PGSCAN_KSWAPD_DMA = 60; + VMEMINFO_PGSCAN_KSWAPD_NORMAL = 61; + VMEMINFO_PGSCAN_KSWAPD_MOVABLE = 62; + VMEMINFO_PGSCAN_DIRECT_DMA = 63; + VMEMINFO_PGSCAN_DIRECT_NORMAL = 64; + VMEMINFO_PGSCAN_DIRECT_MOVABLE = 65; + VMEMINFO_PGSCAN_DIRECT_THROTTLE = 66; + VMEMINFO_PGINODESTEAL = 67; + VMEMINFO_SLABS_SCANNED = 68; + VMEMINFO_KSWAPD_INODESTEAL = 69; + VMEMINFO_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70; + VMEMINFO_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71; + VMEMINFO_PAGEOUTRUN = 72; + VMEMINFO_ALLOCSTALL = 73; + VMEMINFO_PGROTATED = 74; + VMEMINFO_DROP_PAGECACHE = 75; + VMEMINFO_DROP_SLAB = 76; + VMEMINFO_PGMIGRATE_SUCCESS = 77; + VMEMINFO_PGMIGRATE_FAIL = 78; + VMEMINFO_COMPACT_MIGRATE_SCANNED = 79; + VMEMINFO_COMPACT_FREE_SCANNED = 80; + VMEMINFO_COMPACT_ISOLATED = 81; + VMEMINFO_COMPACT_STALL = 82; + VMEMINFO_COMPACT_FAIL = 83; + VMEMINFO_COMPACT_SUCCESS = 84; + VMEMINFO_COMPACT_DAEMON_WAKE = 85; + VMEMINFO_UNEVICTABLE_PGS_CULLED = 86; + VMEMINFO_UNEVICTABLE_PGS_SCANNED = 87; + VMEMINFO_UNEVICTABLE_PGS_RESCUED = 88; + VMEMINFO_UNEVICTABLE_PGS_MLOCKED = 89; + VMEMINFO_UNEVICTABLE_PGS_MUNLOCKED = 90; + VMEMINFO_UNEVICTABLE_PGS_CLEARED = 91; + VMEMINFO_UNEVICTABLE_PGS_STRANDED = 92; + VMEMINFO_NR_ZSPAGES = 93; + VMEMINFO_NR_ION_HEAP = 94; + VMEMINFO_NR_GPU_HEAP = 95; + VMEMINFO_ALLOCSTALL_DMA = 96; + VMEMINFO_ALLOCSTALL_MOVABLE = 97; + VMEMINFO_ALLOCSTALL_NORMAL = 98; + VMEMINFO_COMPACT_DAEMON_FREE_SCANNED = 99; + VMEMINFO_COMPACT_DAEMON_MIGRATE_SCANNED = 100; + VMEMINFO_NR_FASTRPC = 101; + VMEMINFO_NR_INDIRECTLY_RECLAIMABLE = 102; + VMEMINFO_NR_ION_HEAP_POOL = 103; + VMEMINFO_NR_KERNEL_MISC_RECLAIMABLE = 104; + VMEMINFO_NR_SHADOW_CALL_STACK_BYTES = 105; + VMEMINFO_NR_SHMEM_HUGEPAGES = 106; + VMEMINFO_NR_SHMEM_PMDMAPPED = 107; + VMEMINFO_NR_UNRECLAIMABLE_PAGES = 108; + VMEMINFO_NR_ZONE_ACTIVE_ANON = 109; + VMEMINFO_NR_ZONE_ACTIVE_FILE = 110; + VMEMINFO_NR_ZONE_INACTIVE_ANON = 111; + VMEMINFO_NR_ZONE_INACTIVE_FILE = 112; + VMEMINFO_NR_ZONE_UNEVICTABLE = 113; + VMEMINFO_NR_ZONE_WRITE_PENDING = 114; + VMEMINFO_OOM_KILL = 115; + VMEMINFO_PGLAZYFREE = 116; + VMEMINFO_PGLAZYFREED = 117; + VMEMINFO_PGREFILL = 118; + VMEMINFO_PGSCAN_DIRECT = 119; + VMEMINFO_PGSCAN_KSWAPD = 120; + VMEMINFO_PGSKIP_DMA = 121; + VMEMINFO_PGSKIP_MOVABLE = 122; + VMEMINFO_PGSKIP_NORMAL = 123; + VMEMINFO_PGSTEAL_DIRECT = 124; + VMEMINFO_PGSTEAL_KSWAPD = 125; + VMEMINFO_SWAP_RA = 126; + VMEMINFO_SWAP_RA_HIT = 127; + VMEMINFO_WORKINGSET_RESTORE = 128; +} diff --git a/protos/types/plugins/memory_data/memory_plugin_config.proto b/protos/types/plugins/memory_data/memory_plugin_config.proto new file mode 100755 index 000000000..c81ea0a7b --- /dev/null +++ b/protos/types/plugins/memory_data/memory_plugin_config.proto @@ -0,0 +1,33 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; +option optimize_for = LITE_RUNTIME; + +import "memory_plugin_common.proto"; + +// Memory plug-in configuration, passed to plug-in by plug-in service. +message MemoryConfig { + // set true to report process list + bool report_process_tree = 1; + bool report_sysmem_mem_info = 2; + repeated SysMeminfoType sys_meminfo_counters = 3; + bool report_sysmem_vmem_info = 4; + repeated SysVMeminfoType sys_vmeminfo_counters = 5; + bool report_process_mem_info = 6; + bool report_app_mem_info = 7; + bool report_app_mem_by_dumpsys = 8; + repeated int32 pid = 9; +} diff --git a/protos/types/plugins/memory_data/memory_plugin_result.proto b/protos/types/plugins/memory_data/memory_plugin_result.proto new file mode 100755 index 000000000..c0e622762 --- /dev/null +++ b/protos/types/plugins/memory_data/memory_plugin_result.proto @@ -0,0 +1,73 @@ +// Copyright (c) 2021 Huawei Device Co., Ltd. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +option java_package = "ohos.devtools.datasources.transport.grpc.service"; +option optimize_for = LITE_RUNTIME; + +import "memory_plugin_common.proto"; + +// Data format of memory collect plug-in. +// Various memory data count, including system level and application level. +// Obtained from the proc file system or system service. +message SysMeminfo { + SysMeminfoType key = 1; + uint64 value = 2; +}; +message SysVMeminfo { + SysVMeminfoType key = 1; + uint64 value = 2; +}; + +message SmapsInfo { + string mapinfo = 1; + int32 size = 2; + int32 rss = 3; + int32 pss = 4; + int32 anonymous = 5; +}; + +message AppSummary { + uint64 java_heap = 1; + uint64 native_heap = 2; + uint64 code = 3; + uint64 stack = 4; + uint64 graphics = 5; + uint64 private_other = 6; + uint64 system = 7; +}; + +message ProcessMemoryInfo { + int32 pid = 1; + string name = 2; + // data from /proc/$pid/stat + uint64 vm_size_kb = 3; + uint64 vm_rss_kb = 4; + uint64 rss_anon_kb = 5; + uint64 rss_file_kb = 6; + uint64 rss_shmem_kb = 7; + uint64 vm_swap_kb = 8; + uint64 vm_locked_kb = 9; + uint64 vm_hwm_kb = 10; + int64 oom_score_adj = 11; + // data from /proc/$pid/smaps + repeated SmapsInfo smapinfo = 12; + AppSummary memsummary = 13; +} + +message MemoryData { + repeated ProcessMemoryInfo processesinfo = 1; + repeated SysMeminfo meminfo = 2; + repeated SysVMeminfo vmeminfo = 3; +} diff --git a/trace_analyzer/.gitignore b/trace_analyzer/.gitignore new file mode 100755 index 000000000..5cfddf403 --- /dev/null +++ b/trace_analyzer/.gitignore @@ -0,0 +1,7 @@ +/buildtools/clang +/buildtools/linux64 +.vscode/settings.json +/buildtools/third_party_sqlite +/out +/.vscode +.vscode diff --git a/trace_analyzer/.gn b/trace_analyzer/.gn new file mode 100644 index 000000000..92df8f964 --- /dev/null +++ b/trace_analyzer/.gn @@ -0,0 +1,14 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +buildconfig = "//gn/BUILDCONFIG.gn" diff --git a/trace_analyzer/BUILD.gn b/trace_analyzer/BUILD.gn new file mode 100644 index 000000000..e0071c487 --- /dev/null +++ b/trace_analyzer/BUILD.gn @@ -0,0 +1,16 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +group("trace_streamer") { + deps = [ "src:trace_streamer" ] +} diff --git a/trace_analyzer/README.md b/trace_analyzer/README.md new file mode 100644 index 000000000..b468aaa36 --- /dev/null +++ b/trace_analyzer/README.md @@ -0,0 +1,54 @@ +# trace_streamer开发环境搭建和编译运行指引 + +本应用使用gn作为构建工具,支持在linux环境同时编译linux,windows环境的应用,后期会根据开发者需求添加更多的支持。 +## 1、开发环境 +需要Ubuntu20.04,或者将gcc升级到9.3.0版本(后续会降低版本要求) +## 2、编译 +编译前,需搭建本地gn编译环境 +```sh +# gn 和 ninja 工具包 +buildtools/linux64/ +gn 555198版本 +ninja 1.10.0版本 +clang-format version 10.0.0-4ubuntu1版本 +buildtools/clang/bin +buildtools/clang/lib +sqlite文件位于 +buildtools/sqlite +``` +### 2.1、 编译linux版应用 +无需前置操作 + +### 2.2、编译Windows版应用 + +需下载MinGW编译工具链 +```sh +# 安装 mingw-w64 包,用于在 Linux主机上生成 Windows 目标文件: +sudo apt install mingw-w64 +``` + +### 2.3、开始编译 + +```sh +# 生成各平台的ninja编译规则文件 +tools/build_all_configs.py + +# 编译Windows系统的目标文件,windows运行依赖的库在tools/trace_win32_lib +tools/ninja -C out/win_mingw trace_streamer -j 5 + +# 编译Linux系统的目标文件 +tools/ninja -C out/linux_clang trace_streamer -j 5 +tools/ninja -C out/debug_linux_clang trace_streamer -j 5 +``` + +### 3、运行程序 +#### 3.1 linux系统 + +```sh +# Linux 主机可以直接执行: +out/linux_clang/trace_streamer +``` +#### 3.2 windows系统 +``` +Windows环境执行,需下载mingw环境,或者使用 wine 执行 +``` diff --git a/trace_analyzer/buildtools/BUILD.gn b/trace_analyzer/buildtools/BUILD.gn new file mode 100644 index 000000000..120a7a9f6 --- /dev/null +++ b/trace_analyzer/buildtools/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +config("sqlite_config") { + include_dirs = [ "third_party_sqlite/include" ] + cflags = [ + "-DSQLITE_THREADSAFE=0", + "-DQLITE_DEFAULT_MEMSTATUS=0", + "-DSQLITE_LIKE_DOESNT_MATCH_BLOBS", + "-DSQLITE_OMIT_DEPRECATED", + "-DSQLITE_OMIT_SHARED_CACHE", + "-DHAVE_USLEEP", + "-DHAVE_UTIME", + "-DSQLITE_BYTEORDER=1234", + "-DSQLITE_DEFAULT_AUTOVACUUM=0", + "-DSQLITE_DEFAULT_MMAP_SIZE=0", + "-DSQLITE_CORE", + "-DSQLITE_TEMP_STORE=3", + "-DSQLITE_OMIT_LOAD_EXTENSION", + "-DSQLITE_OMIT_RANDOMNESS", + ] +} + +source_set("third_party_sqlite") { + sources = [ + "./third_party_sqlite/src/sqlite3.c", + ] + configs -= [ "//gn:extra_warnings" ] + public_configs = [ ":sqlite_config" ] +} + + diff --git a/trace_analyzer/changelog.txt b/trace_analyzer/changelog.txt new file mode 100644 index 000000000..7ed89132a --- /dev/null +++ b/trace_analyzer/changelog.txt @@ -0,0 +1,14 @@ +date:2021/4/25 22:00 version 0.1.100 +first commit + +date:2021/4/26 16:46 version 0.1.101 +fix bytrace sched waking event + +date:2021/4/26 21:28 version 0.1.102 +fix call stack function name + +date:2021/4/27 13:59 version 0.1.104 +write status into file only when parse finished + +date:2021/4/29 13:59 version 0.1.104 +no feature changed, just fix coding style diff --git a/trace_analyzer/gn/BUILD.gn b/trace_analyzer/gn/BUILD.gn new file mode 100644 index 000000000..dce336fcf --- /dev/null +++ b/trace_analyzer/gn/BUILD.gn @@ -0,0 +1,153 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +group("default_deps") { + public_configs = [ ":default_config" ] + public_deps = [] +} + +config("default_config") { + defines = [] + include_dirs = [ + "..", + "../include", + ] +} + +config("extra_warnings") { + cflags = [ + "-Wall", + "-Wextra", + ] + if (is_clang) { + cflags += [ + "-Wall", + "-Werror", + "-Weverything", + "-Wno-c++98-compat-pedantic", + "-Wno-gnu-statement-expression", + "-Wno-gnu-zero-variadic-macro-arguments", + "-Wno-padded", + "-Wno-reserved-id-macro", + ] + } +} + +config("no_exceptions") { + cflags_cc = [ "-fno-exceptions" ] +} + +config("no_rtti") { + cflags_cc = [ "-fno-rtti" ] +} + +config("c++11") { + cflags_cc = [ "-std=c++11" ] +} + +config("c++17") { + cflags_cc = [ "-std=c++17" ] +} + +config("visibility_hidden") { + cflags = [ "-fvisibility=hidden" ] +} + +config("default") { + asmflags = [] + cflags = [] + cflags_c = [] + cflags_cc = [] + defines = [] + ldflags = [] + libs = [] + + cflags += [ + "-fstrict-aliasing", + "-fstack-protector", + "-fPIC", + "-g", + "-Wformat", + ] + + if (is_linux) { + cflags += [ "-Wa,--noexecstack" ] + } + + if (is_clang) { + cflags += [ + "-fcolor-diagnostics", + "-fdiagnostics-show-template-tree", + ] + } + + if (is_linux) { + libs += [ + "pthread", + "rt", + ] + } + + if (is_debug && is_linux) { + libs += [ "dl" ] + } +} + +config("debug_symbols") { + cflags = [ "-O0" ] + if (is_linux) { + cflags += [ "-funwind-tables" ] + } +} + +config("release") { + cflags = [ + "-fdata-sections", + "-ffunction-sections", + ] + + cflags += [ "-O3" ] + ldflags = [ + "-fuse-ld=gold", + "-fstack-protector", + "-Wl,--gc-sections", + "-Wl,-O1", + ] + if (is_linux) { + ldflags += [ "-Wl,--icf=all" ] + } + defines = [ "NDEBUG" ] +} + +config("shared_library") { + ldflags = [ "-fPIC" ] +} + +config("executable") { + ldflags = [] + + if (is_linux) { + ldflags += [ + "-Wl,-rpath=\$ORIGIN/.", + "-Wl,-rpath-link=.", + ] + } + + if (is_linux) { + ldflags += [ + "-Wl,-rpath=\$ORIGIN/.", + "-Wl,-rpath-link=.", + "-lrt", + ] + } +} diff --git a/trace_analyzer/gn/BUILDCONFIG.gn b/trace_analyzer/gn/BUILDCONFIG.gn new file mode 100644 index 000000000..81c4385c2 --- /dev/null +++ b/trace_analyzer/gn/BUILDCONFIG.gn @@ -0,0 +1,58 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +declare_args() { + is_debug = true + is_clang = true +} + +declare_args() { + ar = "ar" +} + +is_win = false +is_linux = false + +if (target_os == "linux") { + is_win = false + is_linux = true +} else if (target_os == "win"){ + is_win = true + is_linux = false +} + +default_configs = [ + "//gn:debug_symbols", + "//gn:default", + "//gn:c++17", + "//gn:extra_warnings", + "//gn:no_exceptions", + "//gn:no_rtti", + "//gn:visibility_hidden", +] + +if (!is_debug) { + default_configs -= [ "//gn:debug_symbols" ] + default_configs += [ "//gn:release" ] +} + +set_defaults("source_set") { + configs = default_configs +} + +set_defaults("executable") { + configs = default_configs + configs += [ "//gn:executable" ] +} + +set_default_toolchain("//gn/toolchain:gcc_like") diff --git a/trace_analyzer/gn/toolchain/BUILD.gn b/trace_analyzer/gn/toolchain/BUILD.gn new file mode 100644 index 000000000..cb8c173d1 --- /dev/null +++ b/trace_analyzer/gn/toolchain/BUILD.gn @@ -0,0 +1,70 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +declare_args() { + if (is_clang) { + cc = "../../buildtools/clang/bin/clang" + cxx = "../../buildtools/clang/bin/clang++" + } else { + cc = "x86_64-w64-mingw32-gcc" + cxx = "x86_64-w64-mingw32-g++" + } +} + +toolchain("gcc_like") { + lib_switch = "-l" + lib_dir_switch = "-L" + + tool("cxx") { + depfile = "{{output}}.d" + command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}" + depsformat = "gcc" + outputs = [ + "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + ] + description = "compile {{source}}" + } + + tool("cc") { + depfile = "{{output}}.d" + command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" + depsformat = "gcc" + outputs = [ + "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + ] + description = "compile {{source}}" + } + + tool("link") { + command = "$cxx {{ldflags}} {{inputs}} {{solibs}} {{libs}} -o {{output}}" + outputs = [ + "{{root_out_dir}}/{{target_output_name}}{{output_extension}}", + ] + description = "link {{output}}" + } + + tool("stamp") { + command = "touch {{output}}" + description = "touch {{output}}" + } + + tool("copy") { + if (is_win) { + command = "cp -af {{source}}* {{output}}.exe" + description = "COPY {{source}}.exe {{output}}.exe" + } else { + command = "cp -af {{source}} {{output}}" + description = "COPY {{source}} {{output}}" + } + } + } diff --git a/trace_analyzer/include/BUILD.gn b/trace_analyzer/include/BUILD.gn new file mode 100755 index 000000000..1f52b697d --- /dev/null +++ b/trace_analyzer/include/BUILD.gn @@ -0,0 +1,22 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +source_set("base") { + sources = [ + "file.h", + "log.h", + "parting_string.h", + "string_to_numerical.h", + ] + sources += [ "/usr/x86_64-w64-mingw32/include/windows.h" ] +} diff --git a/trace_analyzer/include/file.h b/trace_analyzer/include/file.h new file mode 100755 index 000000000..0db3e439d --- /dev/null +++ b/trace_analyzer/include/file.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INCLUDE_TUNING_BASE_FILE_UTILS_H_ +#define INCLUDE_TUNING_BASE_FILE_UTILS_H_ + +#include +#include + +namespace SysTuning { +namespace base { +constexpr uint32_t kFileModeInvalid = 0xFFFFFFFF; +enum ErrStatus { NORMAL = 0, FILE_TYPE_ERROR = 1, PARSE_ERROR = 2, ABNORMAL = 3 }; + +void SetAnalysisResult(ErrStatus stat); + +ErrStatus GetAnalysisResult(); + +ssize_t Read(int fd, uint8_t* dst, size_t dst_size); + +int OpenFile(const std::string& path, int flags, uint32_t mode = kFileModeInvalid); + +std::string GetExecutionDirectoryPath(); +} // namespace base +} // namespace SysTuning +#endif // INCLUDE_TUNING_BASE_FILE_UTILS_H_ diff --git a/trace_analyzer/include/log.h b/trace_analyzer/include/log.h new file mode 100755 index 000000000..a13179fbc --- /dev/null +++ b/trace_analyzer/include/log.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INCLUDE_TUNING_BASE_LOGGING_H_ +#define INCLUDE_TUNING_BASE_LOGGING_H_ + +#include +#include + +namespace SysTuning { +namespace base { +#define TUNING_LOGI(format, ...) fprintf(stderr, "[%s][%d]: " format "\n", __FILE__, __LINE__, ##__VA_ARGS__) + +#ifdef NDEBUG +#define TUNING_LOGD(format, ...) +#define TUNING_LOGF(format, ...) +#define TUNING_ASSERT(x) +#else +#define TUNING_CRASH \ + do { \ + __builtin_trap(); \ + __builtin_unreachable(); \ + } while (0) + + +#define TUNING_LOGD(format, ...) fprintf(stderr, "[%s][%s][%d]: " format "\n", __FILE__, __FUNCTION__, \ + __LINE__, ##__VA_ARGS__) + +#define TUNING_LOGF(format, ...) \ + do { \ + TUNING_CRASH; \ + } while (0) + +#define TUNING_ASSERT(x) \ + do { \ + if (!(x)) { \ + TUNING_CRASH; \ + } \ + } while (0) + +#endif +} // namespace base +} // namespace SysTuning + +#endif // INCLUDE_TUNING_BASE_LOGGING_H_ diff --git a/trace_analyzer/include/parting_string.h b/trace_analyzer/include/parting_string.h new file mode 100755 index 000000000..b07989a57 --- /dev/null +++ b/trace_analyzer/include/parting_string.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INCLUDE_BASE_STRING_SPLITTER_H_ +#define INCLUDE_BASE_STRING_SPLITTER_H_ + +#include + +namespace SysTuning { +namespace base { +class PartingString { +public: + PartingString(std::string, char delimiter); + + bool Next(); + + char* GetCur() + { + return cur_; + } + +private: + PartingString(const PartingString&) = delete; + PartingString& operator=(const PartingString&) = delete; + + std::string str_; + char* cur_; + std::string::iterator begin_; + std::string::iterator end_; + const char delimiter_; +}; +} // namespace base +} // namespace SysTuning + +#endif diff --git a/trace_analyzer/include/string_to_numerical.h b/trace_analyzer/include/string_to_numerical.h new file mode 100755 index 000000000..cde00fbc3 --- /dev/null +++ b/trace_analyzer/include/string_to_numerical.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INCLUDE_BASE_STRING_TO_NUMERICAL_H_ +#define INCLUDE_BASE_STRING_TO_NUMERICAL_H_ + +#include +#include + +namespace SysTuning { +namespace base { +inline std::optional StrToUInt32(const std::string& str, int base = 10) +{ + if (!str.empty()) { + uint32_t value = static_cast(std::stoul(str, nullptr, base)); + return std::make_optional(value); + } + + return std::nullopt; +} + +inline std::optional StrToInt32(const std::string& str, int base = 10) +{ + if (!str.empty()) { + int32_t value = static_cast(std::stol(str, nullptr, base)); + return std::make_optional(value); + } + + return std::nullopt; +} + +inline std::optional StrToUInt64(const std::string& str, int base = 10) +{ + if (!str.empty()) { + uint64_t value = static_cast(std::stoull(str, nullptr, base)); + return std::make_optional(value); + } + + return std::nullopt; +} + +inline std::optional StrToInt64(const std::string& str, int base = 10) +{ + if (!str.empty()) { + int64_t value = static_cast(std::stoll(str, nullptr, base)); + return std::make_optional(value); + } + return std::nullopt; +} + +inline std::optional StrToDouble(const std::string& str) +{ + if (!str.empty()) { + double value = std::stod(str); + return std::make_optional(value); + } + + return std::nullopt; +} +} // namespace base +} // namespace SysTuning + +#endif // INCLUDE_TUNING_EXT_BASE_STRING_UTILS_H_ diff --git a/trace_analyzer/src/BUILD.gn b/trace_analyzer/src/BUILD.gn new file mode 100755 index 000000000..7babfd66d --- /dev/null +++ b/trace_analyzer/src/BUILD.gn @@ -0,0 +1,112 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +source_set("lib") { + sources = [ + "filter/clock_filter.cpp", + "filter/clock_filter.h", + "filter/cpu_filter.cpp", + "filter/event_filter.cpp", + "filter/event_filter.h", + "filter/filter_base.cpp", + "filter/filter_base.h", + "filter/filter_filter.cpp", + "filter/filter_filter.h", + "filter/measure_filter.cpp", + "filter/measure_filter.h", + "filter/process_filter.cpp", + "filter/process_filter.h", + "filter/slice_filter.cpp", + "filter/slice_filter.h", + "parser/bytrace_parser.cpp", + "parser/bytrace_parser.h", + "parser/common_types.h", + "parser/event_parser.cpp", + "parser/event_parser.h", + "parser/thread_state.cpp", + "parser/thread_state.h", + "table/bound_table.cpp", + "table/cpu_measure_filter_table.cpp", + "table/cpu_measure_filter_table.h", + "table/data_dict_table.cpp", + "table/data_dict_table.h", + "table/filter_table.cpp", + "table/filter_table.h", + "table/instants_table.cpp", + "table/instants_table.h", + "table/internal_slice_table.cpp", + "table/internal_slice_table.h", + "table/internal_thread.cpp", + "table/measure_filter_table.cpp", + "table/measure_filter_table.h", + "table/measure_table.cpp", + "table/measure_table.h", + "table/process_filter_table.cpp", + "table/process_filter_table.h", + "table/process_measure_filter_table.cpp", + "table/process_measure_filter_table.h", + "table/process_table.cpp", + "table/process_table.h", + "table/raw_table.cpp", + "table/raw_table.h", + "table/sched_slice_table.cpp", + "table/sched_slice_table.h", + "table/table_base.cpp", + "table/table_base.h", + "table/thread_filter_table.cpp", + "table/thread_filter_table.h", + "table/thread_state_table.cpp", + "table/thread_state_table.h", + "table/thread_table.cpp", + "table/thread_table.h", + "trace_data/trace_data_cache.cpp", + "trace_data/trace_data_cache.h", + "trace_data/trace_data_cache_base.cpp", + "trace_data/trace_data_cache_base.h", + "trace_data/trace_data_cache_reader.cpp", + "trace_data/trace_data_cache_reader.h", + "trace_data/trace_data_cache_writer.cpp", + "trace_data/trace_data_cache_writer.h", + "trace_data/trace_data_db.cpp", + "trace_data/trace_data_db.h", + "trace_data/trace_stdtype.cpp", + "trace_data/trace_stdtype.h", + "trace_streamer.cpp", + "trace_streamer.h", + "trace_streamer_filters.cpp", + "trace_streamer_filters.h", + ] + include_dirs = [ + "//src/base", + "//src", + "//src/filter", + "//src/table", + "//src/trace_data", + ] + deps = [ + "../../buildtools:third_party_sqlite", + "../../gn:default_deps", + "base", + ] + public_deps = [ "//src/base:base" ] +} + +executable("trace_streamer") { + deps = [ + ":lib", + "../../gn:default_deps", + "base", + "//src/base:base", + ] + sources = [ "main.cpp" ] +} diff --git a/trace_analyzer/src/base/BUILD.gn b/trace_analyzer/src/base/BUILD.gn new file mode 100644 index 000000000..994467384 --- /dev/null +++ b/trace_analyzer/src/base/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +source_set("base") { + deps = [ + "../../gn:default_deps", + ] + public_deps = [ + "../../include:base", + ] + sources = [ + "file.cpp", + "parting_string.cpp", + ] +} + diff --git a/trace_analyzer/src/base/common.h b/trace_analyzer/src/base/common.h new file mode 100644 index 000000000..eaf056511 --- /dev/null +++ b/trace_analyzer/src/base/common.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SRC_TRACE_BASE_COMMON_H +#define SRC_TRACE_BASE_COMMON_H + +#include +#include +#include +#include + +const uint64_t INVALID_UTID = std::numeric_limits::max(); +const uint64_t INVALID_UINT64 = std::numeric_limits::max(); +const uint64_t MAX_UINT32 = std::numeric_limits::max(); +const uint64_t MAX_UINT64 = std::numeric_limits::max(); +const uint32_t INVALID_UINT32 = std::numeric_limits::max(); +const size_t MAX_SIZE_T = std::numeric_limits::max(); + +enum RefType { + K_REF_NO_REF = 0, + K_REF_UTID = 1, + K_REF_CPUID = 2, + K_REF_IRQ = 3, + K_REF_SOFT_IRQ = 4, + K_REF_UPID = 5, + K_REF_UTID_LOOKUP_UPID = 6, + K_REF_MAX +}; + +enum EndState { + TASK_RUNNABLE = 0, // R 就绪态或者运行态,进程就绪可以运行,但是不一定正在占有CPU + TASK_INTERRUPTIBLE = 1, // S 浅度睡眠,等待资源,可以响应信号,一般是进程主动sleep进入的状态 + TASK_UNINTERRUPTIBLE = 2, // D 深度睡眠,等待资源,不响应信号,典型场景是进程获取信号量阻塞 + TASK_RUNNING = 3, // Running 线程处于运行状态 + TASK_INTERRUPTED = 4, // I 线程处于中断状态 + TASK_EXIT_DEAD = 16, // X 退出状态,进程即将被销毁。 + TASK_ZOMBIE = 32, // Z 僵尸态,进程已退出或者结束,但是父进程还不知道,没有回收时的状态 + TASK_CLONE = 64, // I 多线程,克隆线程 + TASK_KILLED = 128, // K TASK DEAD 进程被杀死 + TASK_DK = 130, // DK + TASK_WAKEKILL = 256, // W TASK_WAKEKILL 深度睡眠进程,唤醒后直接杀死 + TASK_FOREGROUND = 2048, // R+ 位于后台的进程组 + TASK_INVALID = 9999 +}; + +enum SchedWakeType { + SCHED_WAKING = 0, // sched_waking + SCHED_WAKEUP = 1, // sched_wakeup +}; + +using DataIndex = size_t; +using TableRowId = uint64_t; +using InternalPid = uint32_t; +using InternalTid = uint32_t; +using InternalTime = uint64_t; + +#define STACK_HASK_COUNT 2 + +#endif diff --git a/trace_analyzer/src/base/double_map.h b/trace_analyzer/src/base/double_map.h new file mode 100644 index 000000000..bc5f1b679 --- /dev/null +++ b/trace_analyzer/src/base/double_map.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SRC_TRACE_BASE_DOUBLEMAP_H +#define SRC_TRACE_BASE_DOUBLEMAP_H + +#include + +template +class DoubleMap { +public: + DoubleMap(T3 invalidValue) + { + invalidValue_ = invalidValue; + } + void SetInvalidRet(T3 invalidValue) + { + invalidValue_ = invalidValue; + } + void Insert(T1 t1, T2 t2, T3 t3) + { + auto streamIdHookidMap = internamMap_.find(t1); + if (streamIdHookidMap != internamMap_.end()) { + auto hookId = (*streamIdHookidMap).second.find(t2); + if (hookId == (*streamIdHookidMap).second.end()) { + (*streamIdHookidMap).second.insert(std::make_pair(t2, t3)); + } else { + (*streamIdHookidMap).second.at(t2) = t3; + } + } else { + std::map mm = { + {t2, t3} + }; + internamMap_.insert(std::make_pair(t1, mm)); + } + } + T3 Find(T1 t1, T2 t2) + { + auto streamIdHookidMap = internamMap_.find(t1); + if (streamIdHookidMap != internamMap_.end()) { + auto hookId = (*streamIdHookidMap).second.find(t2); + if (hookId == (*streamIdHookidMap).second.end()) { + return invalidValue_; + } else { + return hookId->second; + } + } else { + return invalidValue_; + } + } + +private: + std::map> internamMap_; + T3 invalidValue_; +}; + +#endif // DOUBLEMAP_H diff --git a/trace_analyzer/src/base/file.cpp b/trace_analyzer/src/base/file.cpp new file mode 100644 index 000000000..058bea59d --- /dev/null +++ b/trace_analyzer/src/base/file.cpp @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "file.h" +#include +#include +#include +#include +#include + +#include "log.h" +#if defined(_WIN32) +#include +#include +#include +#endif + +namespace SysTuning { +namespace base { +static ErrStatus g_status = ABNORMAL; + +void SetAnalysisResult(ErrStatus stat) +{ + g_status = stat; +} +ErrStatus GetAnalysisResult() +{ + return g_status; +} + +ssize_t Read(int fd, uint8_t* dst, size_t dstSize) +{ +#if defined(_WIN32) + return _read(fd, dst, static_cast(dstSize)); +#else + ssize_t ret = -1; + do { + ret = read(fd, dst, dstSize); + } while (ret == -1 && errno == EINTR); + return ret; +#endif +} +int OpenFile(const std::string& path, int flags, uint32_t mode) +{ + TUNING_ASSERT((flags & O_CREAT) == 0 || mode != kFileModeInvalid); +#if defined(_WIN32) + int fd(_open(path.c_str(), flags | O_BINARY, mode)); +#else + int fd(open(path.c_str(), flags | O_CLOEXEC, mode)); +#endif + return fd; +} + +std::string GetExecutionDirectoryPath() +{ + char currPath[1024] = {0}; +#if defined(_WIN32) + ::GetModuleFileName(NULL, currPath, MAX_PATH); + (strrchr(currPath, '\\'))[1] = 0; +#else + readlink("/proc/self/exe", currPath, sizeof(currPath) - 1); +#endif + std::string str(currPath); + str = str.substr(0, str.find_last_of('/')); + return str; +} +} // namespace base +} // namespace SysTuning diff --git a/trace_analyzer/src/base/parting_string.cpp b/trace_analyzer/src/base/parting_string.cpp new file mode 100755 index 000000000..21b94bf29 --- /dev/null +++ b/trace_analyzer/src/base/parting_string.cpp @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "parting_string.h" +#include + +namespace SysTuning { +namespace base { +PartingString::PartingString(std::string str, char delimiter) : str_(std::move(str)), delimiter_(delimiter) +{ + begin_ = str_.begin(); + end_ = str_.end(); + cur_ = nullptr; +} + +bool PartingString::Next() +{ + while (begin_ != end_) { + if (*begin_ == delimiter_) { + begin_++; + continue; + } + + cur_ = begin_.base(); + do { + if (*begin_ == delimiter_) { + *(begin_++) = '\0'; + break; + } + if (*begin_ == '\0') { + begin_ = end_; + break; + } + } while (begin_++ != end_); + + if (*cur_) { + return true; + } + + begin_++; + } + + cur_ = nullptr; + return false; +} +} // namespace base +} // namespace SysTuning diff --git a/trace_analyzer/src/filter/clock_filter.cpp b/trace_analyzer/src/filter/clock_filter.cpp new file mode 100644 index 000000000..456e22719 --- /dev/null +++ b/trace_analyzer/src/filter/clock_filter.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "clock_filter.h" +#include +#include + +namespace SysTuning { +namespace TraceStreamer { +ClockFilter::ClockFilter(TraceDataCache* dataCache, const TraceStreamerFilters* filter) + : FilterBase(dataCache, filter), primaryClock_(BuiltinClocks::BOOTTIME) +{ +} + +ClockFilter::~ClockFilter() {} + +std::string ClockFilter::GenClockKey(ClockId srcClockId, ClockId desClockId) const +{ + std::string ret; + ret += std::to_string(srcClockId); + ret += ","; + ret += std::to_string(desClockId); + return ret; +} + +uint64_t ClockFilter::ToPrimaryTraceTime(ClockId srcClockId, uint64_t srcTs) const +{ + return Convert(srcClockId, srcTs, primaryClock_); +} + +uint64_t ClockFilter::Convert(ClockId srcClockId, uint64_t srcTs, ClockId desClockId) const +{ + std::string&& clockKey = GenClockKey(srcClockId, desClockId); + auto keyIt = clockMaps_.find(clockKey); + if (keyIt == clockMaps_.end()) { + return srcTs; + } + + auto tsIt = keyIt->second.upper_bound(srcTs); + if (tsIt != keyIt->second.begin()) { + tsIt--; + } + + if (tsIt->second >= 0) { + return srcTs + static_cast(tsIt->second); + } else { + return srcTs - static_cast(0 - tsIt->second); + } +} + +void ClockFilter::AddConvertClockMap(ClockId srcClockId, ClockId dstClockId, uint64_t srcTs, uint64_t dstTs) +{ + std::string&& clockKey = GenClockKey(srcClockId, dstClockId); + auto keyIt = clockMaps_.find(clockKey); + if (keyIt == clockMaps_.end()) { + ConvertClockMap newConvertMap = {{srcTs, dstTs - srcTs}}; + clockMaps_[clockKey] = newConvertMap; + } else { + clockMaps_[clockKey].insert(std::make_pair(srcTs, dstTs - srcTs)); + } +} + +void ClockFilter::AddClockSnapshot(const std::vector& snapShot) +{ + ClockId srcId, desId; + for (srcId = 0; srcId < snapShot.size() - 1; srcId++) { + for (desId = srcId + 1; desId < snapShot.size(); desId++) { + ClockId srcClockId = snapShot[srcId].clockId; + ClockId desClockId = snapShot[desId].clockId; + uint64_t srcTs = snapShot[srcId].ts; + uint64_t desTs = snapShot[desId].ts; + + AddConvertClockMap(srcClockId, desClockId, srcTs, desTs); + AddConvertClockMap(desClockId, srcClockId, desTs, srcTs); + } + } +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/filter/clock_filter.h b/trace_analyzer/src/filter/clock_filter.h new file mode 100644 index 000000000..3cefeccda --- /dev/null +++ b/trace_analyzer/src/filter/clock_filter.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CLOCK_FILTER_H +#define CLOCK_FILTER_H + +#include +#include +#include +#include +#include "filter_base.h" +#include "trace_data_cache.h" +#include "trace_streamer_filters.h" + +namespace SysTuning { +namespace TraceStreamer { +enum BuiltinClocks { + REALTIME = 1, + REALTIME_COARSE = 2, + MONOTONIC = 3, + MONOTONIC_COARSE = 4, + MONOTONIC_RAW = 5, + BOOTTIME = 6, +}; + +class ClockFilter : private FilterBase { +public: + using ClockId = uint32_t; + using ConvertClockMap = std::map; + + class SnapShot { + public: + ClockId clockId; + uint64_t ts; + }; + + explicit ClockFilter(TraceDataCache*, const TraceStreamerFilters*); + ~ClockFilter() override; + + uint64_t ToPrimaryTraceTime(ClockId srcClockId, uint64_t srcTs) const; + uint64_t Convert(ClockId srcClockId, uint64_t srcTs, ClockId desClockId) const; + + void SetPrimaryClock(ClockId primary) + { + primaryClock_ = primary; + } + + void AddClockSnapshot(const std::vector& snapShot); + +private: + std::string GenClockKey(ClockId srcClockId, ClockId desClockId) const; + void AddConvertClockMap(ClockId srcClockId, ClockId dstClockId, uint64_t srcTs, uint64_t dstTs); + +private: + std::unordered_map clockMaps_ = {}; + + ClockId primaryClock_; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // CLOCK_FILTER_H diff --git a/trace_analyzer/src/filter/cpu_filter.cpp b/trace_analyzer/src/filter/cpu_filter.cpp new file mode 100644 index 000000000..ef784f4ef --- /dev/null +++ b/trace_analyzer/src/filter/cpu_filter.cpp @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "cpu_filter.h" + +namespace SysTuning { +namespace TraceStreamer { +CpuFilter::CpuFilter(TraceDataCache* dataCache, const TraceStreamerFilters* filter) : FilterBase(dataCache, filter) {} +CpuFilter::~CpuFilter() = default; +uint64_t CpuFilter::InsertSwitchEvent(uint64_t ts, uint64_t cpu, uint64_t prevPid, uint64_t prevPior, + uint64_t prevState, uint64_t nextPid, uint64_t nextPior) +{ + auto index = traceDataCache_->GetSchedSliceData()->AppendSchedSlice(ts, 0, cpu, nextPid, 0, nextPior); + + auto prevTidOnCpu = cpuToRowSched_.find(cpu); + if (prevTidOnCpu != cpuToRowSched_.end()) { + traceDataCache_->GetSchedSliceData()->Update(prevTidOnCpu->second, ts, prevState, prevPior); + cpuToRowSched_.at(cpu) = index; + } else { + cpuToRowSched_.insert(std::make_pair(cpu, index)); + } + + if (nextPid) { + auto lastRow = RowOfUidUThreadState(nextPid); + if (lastRow != INVALID_UINT64) { + traceDataCache_->GetThreadStateData()->UpdateDuration(lastRow, ts); + } + index = traceDataCache_->GetThreadStateData()->AppendThreadState(ts, 0, cpu, nextPid, TASK_RUNNING); + FilterUidRow(nextPid, index, TASK_RUNNING); + if (cpuToRowThreadState_.find(cpu) == cpuToRowThreadState_.end()) { + cpuToRowThreadState_.insert(std::make_pair(cpu, index)); + cpuToUtidThreadState_.insert(std::make_pair(cpu, nextPid)); + } else { + cpuToRowThreadState_.at(cpu) = index; + cpuToUtidThreadState_.at(cpu) = nextPid; + } + } + + if (prevPid) { + auto lastRow = RowOfUidUThreadState(prevPid); + auto lastState = StateOfUidThreadState(prevPid); + if (lastRow != INVALID_UINT64) { + traceDataCache_->GetThreadStateData()->UpdateDuration(lastRow, ts); + auto temp = traceDataCache_->GetThreadStateData()->AppendThreadState( + ts, static_cast(-1), static_cast(-1), prevPid, prevState); + FilterUidRow(prevPid, temp, prevState); + } + UNUSED(lastState); + } + return 0; +} +uint64_t CpuFilter::FilterUidRow(uint64_t uid, uint64_t row, uint64_t state) +{ + if (uidToRowThreadState_.find(uid) != uidToRowThreadState_.end()) { + uidToRowThreadState_.at(uid) = TPthread {row, state}; + } else { + uidToRowThreadState_.insert(std::make_pair(uid, TPthread {row, state})); + } + return 0; +} + +uint64_t CpuFilter::RowOfUidUThreadState(uint64_t uid) const +{ + auto row = uidToRowThreadState_.find(uid); + if (row != uidToRowThreadState_.end()) { + return (*row).second.row_; + } + return INVALID_UINT64; +} + +uint64_t CpuFilter::StateOfUidThreadState(uint64_t uid) const +{ + auto row = uidToRowThreadState_.find(uid); + if (row != uidToRowThreadState_.end()) { + return (*row).second.state_; + } + return TASK_INVALID; +} + +uint64_t CpuFilter::InsertWakeingEvent(uint64_t ts, uint64_t internalTid) +{ + uint64_t lastrow = RowOfUidUThreadState(internalTid); + auto lastState = StateOfUidThreadState(internalTid); + if (lastrow != INVALID_UINT64) { + if (lastState != TASK_RUNNING) { + traceDataCache_->GetThreadStateData()->UpdateDuration(lastrow, ts); + } + } + if (lastState != TASK_RUNNING) { + auto index = traceDataCache_->GetThreadStateData()->AppendThreadState( + ts, static_cast(-1), static_cast(-1), internalTid, TASK_RUNNABLE); + FilterUidRow(internalTid, index, TASK_RUNNABLE); + } + return 0; +} + +uint64_t CpuFilter::FindUtidInThreadStateTableByCpu(uint64_t cpu) const +{ + auto row = cpuToUtidThreadState_.find(cpu); + if (row != cpuToUtidThreadState_.end()) { + return (*row).second; + } + return INVALID_UINT64; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/filter/cpu_filter.h b/trace_analyzer/src/filter/cpu_filter.h new file mode 100644 index 000000000..6ca7aca9a --- /dev/null +++ b/trace_analyzer/src/filter/cpu_filter.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CPU_FILTER_H +#define CPU_FILTER_H + +#include +#include +#include +#include +#include + +#include "common.h" +#include "filter_base.h" +#include "trace_data_cache.h" +#include "trace_streamer_filters.h" + +namespace SysTuning { +namespace TraceStreamer { +class TraceStreamerFilters; +class CpuFilter : private FilterBase { +public: + explicit CpuFilter(TraceDataCache*, const TraceStreamerFilters*); + CpuFilter(const CpuFilter&) = delete; + CpuFilter& operator=(const CpuFilter&) = delete; + ~CpuFilter() override; + +public: + uint64_t FindUtidInThreadStateTableByCpu(uint64_t cpu) const; + uint64_t InsertSwitchEvent(uint64_t ts, + uint64_t cpu, + uint64_t prevPid, + uint64_t prevPior, + uint64_t prevState, + uint64_t nextPid, + uint64_t nextPior); + uint64_t InsertWakeingEvent(uint64_t ts, uint64_t internalTid); + +private: + uint64_t FilterUidRow(uint64_t uid, uint64_t row, uint64_t state = TASK_INVALID); + uint64_t RowOfUidUThreadState(uint64_t uid) const; + uint64_t StateOfUidThreadState(uint64_t uid) const; + + std::map cpuToRowThreadState_ = {}; + std::map cpuToUtidThreadState_ = {}; + std::map cpuToRowSched_ = {}; + + struct TPthread { + uint64_t row_; + uint64_t state_; + }; + std::map uidToRowThreadState_ = {}; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // CPU_FILTER_H diff --git a/trace_analyzer/src/filter/event_filter.cpp b/trace_analyzer/src/filter/event_filter.cpp new file mode 100755 index 000000000..eafec5a01 --- /dev/null +++ b/trace_analyzer/src/filter/event_filter.cpp @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "event_filter.h" + +#include "filter_filter.h" +#include "process_filter.h" +#include "trace_data_cache.h" +#include "trace_streamer_filters.h" + +namespace SysTuning { +namespace TraceStreamer { +EventFilter::EventFilter(TraceDataCache* dataCache, const TraceStreamerFilters* filter) + : FilterBase(dataCache, filter), + prevTimestamp_(0), + idleStringId_(traceDataCache_->GetDataIndex("idle")), + filterTypeStringId_(traceDataCache_->GetDataIndex("cpu_measure_filter")) +{ +} + +EventFilter::~EventFilter() = default; + +void EventFilter::UpdateSchedSwitch(uint32_t cpu, + uint64_t timestamp, + uint32_t prevPid, + uint32_t nextPid, + std::string_view nextComm) +{ + UNUSED(prevPid); + if (!UpdateTimestamp(timestamp)) { + TUNING_LOGD("sched_switch event out of order by %.4f ms, skipping", (prevTimestamp_ - timestamp) / 1e6); + return; + } + + TUNING_ASSERT(cpu < MAX_CPUS); + + UpdateDuration(cpu, timestamp); + + DataIndex nameIndex; + if (nextPid == 0) { + nameIndex = idleStringId_; + } else { + nameIndex = traceDataCache_->GetDataIndex(nextComm); + } + + auto internaltid = streamFilters_->processFilter_->SetThreadPid(timestamp, nextPid, nameIndex); + + auto* slices = traceDataCache_->GetSlicesData(); + auto* pendingSlice = &pendingSchedPerCpu_[cpu]; + pendingSlice->storageIndex = slices->AppendSliceData(cpu, timestamp, 0, internaltid); + pendingSlice->pid = nextPid; +} + +uint32_t EventFilter::GetOrCreatCpuCounterFilter(DataIndex name, uint32_t cpu) +{ + auto cpuCounter = traceDataCache_->GetCpuCountersData(); + auto filterId = FindFilterId(name, cpu); + if (filterId == INVALID_UINT32) { + std::string nameStr = traceDataCache_->GetDataFromDict(name); + filterId = streamFilters_->filterFilter_->AddFilter("cpu_counter_track", nameStr); + cpuCounter->AppendCpuCounter(filterId, filterTypeStringId_, name, cpu); + AddFilterId(name, cpu, filterId); + } + + return filterId; +} + +void EventFilter::AddFilterId(DataIndex name, uint32_t cpu, uint32_t filterId) +{ + cpuNameFilters_[std::make_pair(cpu, name)] = filterId; +} + +uint32_t EventFilter::FindFilterId(DataIndex name, uint32_t cpu) const +{ + auto it = cpuNameFilters_.find(std::make_pair(cpu, name)); + if (it != cpuNameFilters_.end()) { + return it->second; + } + + return INVALID_UINT32; +} + +void EventFilter::BinderTransaction(const BinderParamter& binderParamter) const +{ + UNUSED(binderParamter); +} + +void EventFilter::BinderTransactionReceived(uint64_t ts, uint32_t tid, int32_t transactionId) const +{ + UNUSED(ts); + UNUSED(tid); + UNUSED(transactionId); +} + +void EventFilter::UpdateDuration(uint32_t cpu, uint64_t timestamp) +{ + auto* pendingSlice = &pendingSchedPerCpu_[cpu]; + if (pendingSlice->storageIndex >= std::numeric_limits::max()) { + return; + } + + auto* slices = traceDataCache_->GetSchedSliceData(); + size_t idx = pendingSlice->storageIndex; + uint64_t duration = timestamp - slices->TimeStamData()[idx]; + slices->SetDuration(idx, duration); +} + +bool EventFilter::UpdateTimestamp(uint64_t timestamp) +{ + if (timestamp < prevTimestamp_) { + return false; + } + + prevTimestamp_ = timestamp; + return true; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/filter/event_filter.h b/trace_analyzer/src/filter/event_filter.h new file mode 100755 index 000000000..005b02c9b --- /dev/null +++ b/trace_analyzer/src/filter/event_filter.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef EVENT_FILTER_H +#define EVENT_FILTER_H + +#include +#include +#include +#include "filter_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class TraceStreamerFilters; +constexpr size_t MAX_CPUS = 64; +constexpr uint32_t INVALID_UINT32 = std::numeric_limits::max(); + +struct BinderParamter { + uint64_t ts; + uint32_t tid; + int32_t transactionId; + int32_t destNode; + int32_t destTgid; + int32_t destTid; + bool isReply; + uint32_t flags; + DataIndex code; + DataIndex nameIndex; +}; + +class EventFilter : private FilterBase { +public: + explicit EventFilter(TraceDataCache*, const TraceStreamerFilters*); + ~EventFilter() override; + + virtual void UpdateSchedSwitch(uint32_t cpu, + uint64_t timestamp, + uint32_t prevPid, + uint32_t nextPid, + std::string_view nextComm); + + uint32_t GetOrCreatCpuCounterFilter(DataIndex name, uint32_t cpu); + void BinderTransaction(const BinderParamter& binderParamter) const; + void BinderTransactionReceived(uint64_t ts, uint32_t tid, int32_t transactionId) const; + +private: + void AddFilterId(DataIndex name, uint32_t cpu, uint32_t filterId); + uint32_t FindFilterId(DataIndex name, uint32_t cpu) const; + void UpdateDuration(uint32_t cpu, uint64_t timeStamp); + bool UpdateTimestamp(uint64_t timeStamp); + + struct PendingSchedSlice { + size_t storageIndex = std::numeric_limits::max(); + uint32_t pid = 0; + }; + + uint64_t prevTimestamp_; + DataIndex const idleStringId_; + DataIndex const filterTypeStringId_; + std::array pendingSchedPerCpu_ {}; + std::map, uint32_t> cpuNameFilters_ {}; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // EVENT_FILTER_H diff --git a/trace_analyzer/src/filter/filter_base.cpp b/trace_analyzer/src/filter/filter_base.cpp new file mode 100644 index 000000000..d3bbcd5b4 --- /dev/null +++ b/trace_analyzer/src/filter/filter_base.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "filter_base.h" +#include "trace_streamer_filters.h" + +namespace SysTuning { +namespace TraceStreamer { +FilterBase::FilterBase(TraceDataCache* dataCache, const TraceStreamerFilters* filter) + : streamFilters_(filter), traceDataCache_(dataCache) +{ +} +FilterBase::~FilterBase() = default; +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/filter/filter_base.h b/trace_analyzer/src/filter/filter_base.h new file mode 100644 index 000000000..06c6d607e --- /dev/null +++ b/trace_analyzer/src/filter/filter_base.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FILTER_BASE_H +#define FILTER_BASE_H +#include +#include "trace_data_cache.h" +#include "trace_streamer_filters.h" + +#define UNUSED(expr) \ + do { \ + static_cast(expr); \ + } while (0) + +namespace SysTuning { +namespace TraceStreamer { +class FilterBase { +public: + explicit FilterBase(TraceDataCache*, const TraceStreamerFilters*); + FilterBase(const FilterBase&) = delete; + FilterBase& operator=(const FilterBase&) = delete; + virtual ~FilterBase(); + +public: + const TraceStreamerFilters *streamFilters_; + TraceDataCache *traceDataCache_; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // FILTER_BASE_H diff --git a/trace_analyzer/src/filter/filter_filter.cpp b/trace_analyzer/src/filter/filter_filter.cpp new file mode 100644 index 000000000..400ab9a23 --- /dev/null +++ b/trace_analyzer/src/filter/filter_filter.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "filter_filter.h" + +#include "process_filter.h" +#include "trace_data_cache.h" +#include "trace_streamer_filters.h" + +namespace SysTuning { +namespace TraceStreamer { +FilterFilter::FilterFilter(TraceDataCache* dataCache, const TraceStreamerFilters* filter) + : FilterBase(dataCache, filter) {} + +FilterFilter::~FilterFilter() = default; + +uint32_t FilterFilter::AddFilter(std::string type, std::string name) +{ + uint32_t sourceArgSetId = 0; + auto* hook = traceDataCache_->GetFilterData(); + size_t id = hook->AppendNewFilterData(type, name, sourceArgSetId); + return static_cast(id); +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/filter/filter_filter.h b/trace_analyzer/src/filter/filter_filter.h new file mode 100644 index 000000000..f7abf62ec --- /dev/null +++ b/trace_analyzer/src/filter/filter_filter.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FILTER_FILTER_H +#define FILTER_FILTER_H + +#include "filter_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class TraceStreamerFilters; +class FilterFilter : private FilterBase { +public: + explicit FilterFilter(TraceDataCache*, const TraceStreamerFilters*); + FilterFilter(const FilterFilter&) = delete; + FilterFilter& operator=(const FilterFilter&) = delete; + ~FilterFilter() override; + + uint32_t AddFilter(std::string type, std::string name); +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // FILTER_FILTER_H diff --git a/trace_analyzer/src/filter/measure_filter.cpp b/trace_analyzer/src/filter/measure_filter.cpp new file mode 100644 index 000000000..6d0846f5a --- /dev/null +++ b/trace_analyzer/src/filter/measure_filter.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "measure_filter.h" +#include "common.h" +#include "filter_filter.h" +#include "log.h" + +namespace SysTuning { +namespace TraceStreamer { +MeasureFilter::MeasureFilter(TraceDataCache* dataCache, const TraceStreamerFilters* filter, FilterType e) + : FilterBase(dataCache, filter), + tidStreamIdFilterIdMap_(INVALID_UINT64), + cookieFilterIdMap_(INVALID_UINT64), + filterType_(e) +{ +} + +MeasureFilter::~MeasureFilter() +{ +} + +void MeasureFilter::Init(FilterType e) +{ + filterType_ = e; +} + +uint32_t MeasureFilter::GetOrCreateCertainFilterId(uint64_t internalTid, DataIndex nameIndex) +{ + auto filterId = tidStreamIdFilterIdMap_.Find(internalTid, nameIndex); + if (filterId != INVALID_UINT64) { + return static_cast(filterId); + } + + uint32_t newFilterId = + streamFilters_->filterFilter_->AddFilter(filterTypeValue.at(filterType_), + traceDataCache_->GetDataFromDict(nameIndex)); + AddCertainFilterId(internalTid, nameIndex, newFilterId); + return newFilterId; +} + +uint32_t MeasureFilter::GetOrCreateCertainFilterIdByCookie(uint64_t internalTid, DataIndex nameIndex, int64_t cookie) +{ + auto filterId = cookieFilterIdMap_.Find(static_cast(cookie), nameIndex); + if (filterId != INVALID_UINT64) { + return static_cast(filterId); + } + + uint32_t newFilterId = + streamFilters_->filterFilter_->AddFilter(filterTypeValue.at(filterType_), + traceDataCache_->GetDataFromDict(nameIndex)); + cookieFilterIdMap_.Insert(static_cast(cookie), nameIndex, newFilterId); + traceDataCache_->GetProcessFilterData()->AppendProcessFilterData(static_cast(newFilterId), + nameIndex, static_cast(internalTid)); + return newFilterId; +} + +void MeasureFilter::AddCertainFilterId(uint64_t internalTid, DataIndex nameIndex, uint64_t filterId) +{ + tidStreamIdFilterIdMap_.Insert(internalTid, nameIndex, filterId); + + if (filterType_ == E_THREADMEASURE_FILTER) { + traceDataCache_->GetThreadCounterFilterData()->AppendNewData(filterId, + static_cast(nameIndex), internalTid); + } else if (filterType_ == E_THREAD_FILTER) { + traceDataCache_->GetThreadFilterData()->AppendNewData(filterId, static_cast(nameIndex), internalTid); + } else if (filterType_ == E_PROCESS_MEASURE_FILTER) { + traceDataCache_->GetProcessCounterFilterData()->AppendProcessCounterFilterData(static_cast(filterId), + static_cast(nameIndex), static_cast(internalTid)); + } else if (filterType_ == E_PROCESS_FILTER_FILTER) { + traceDataCache_->GetProcessFilterData()->AppendProcessFilterData(static_cast(filterId), + static_cast(nameIndex), static_cast(internalTid)); + } else if (filterType_ == E_CPU_MEASURE_FILTER) { + traceDataCache_->GetCpuCountersData()->AppendCpuCounter(filterId, + static_cast(nameIndex), internalTid); + } +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/filter/measure_filter.h b/trace_analyzer/src/filter/measure_filter.h new file mode 100644 index 000000000..1e3613959 --- /dev/null +++ b/trace_analyzer/src/filter/measure_filter.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef THREAD_MEASURE_FILTER_H +#define THREAD_MEASURE_FILTER_H + +#include +#include +#include + +#include "double_map.h" +#include "filter_base.h" +#include "trace_data_cache.h" +#include "trace_streamer_filters.h" + +namespace SysTuning { +namespace TraceStreamer { +enum FilterType { + E_THREADMEASURE_FILTER, + E_THREAD_FILTER, + E_PROCESS_MEASURE_FILTER, + E_PROCESS_FILTER_FILTER, + E_CPU_MEASURE_FILTER +}; + +class MeasureFilter : private FilterBase { +public: + explicit MeasureFilter(TraceDataCache*, const TraceStreamerFilters*, FilterType); + void Init(FilterType); + MeasureFilter(const MeasureFilter&) = delete; + MeasureFilter& operator=(const MeasureFilter&) = delete; + ~MeasureFilter() override; + uint32_t GetOrCreateCertainFilterId(uint64_t internalTid, DataIndex nameIndex); + uint32_t GetOrCreateCertainFilterIdByCookie(uint64_t internalTid, DataIndex nameIndex, int64_t cookie); + +private: + void AddCertainFilterId(uint64_t internalTid, DataIndex nameIndex, uint64_t filterId); + DoubleMap tidStreamIdFilterIdMap_; + DoubleMap cookieFilterIdMap_; + FilterType filterType_; + + const std::map filterTypeValue = { + { E_THREADMEASURE_FILTER, "thread_counter_track" }, + { E_THREAD_FILTER, "thread_track" }, + { E_PROCESS_MEASURE_FILTER, "process_counter_track" }, + { E_PROCESS_FILTER_FILTER, "process_track" }, + { E_CPU_MEASURE_FILTER, "cpu_counter_track" } + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // THREAD_MEASURE_FILTER_H diff --git a/trace_analyzer/src/filter/process_filter.cpp b/trace_analyzer/src/filter/process_filter.cpp new file mode 100644 index 000000000..34858a459 --- /dev/null +++ b/trace_analyzer/src/filter/process_filter.cpp @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "process_filter.h" +#include +#include +#include +#include + +using CustomPair = std::pair; +namespace SysTuning { +namespace TraceStreamer { +namespace { + const uint32_t INVALID_ID = std::numeric_limits::max(); +} +ProcessFilter::ProcessFilter(TraceDataCache* dataCache, const TraceStreamerFilters* filter) + :FilterBase(dataCache, filter) +{ + tidMappingSet_.insert(CustomPair(0, 0)); + pidMappingSet_.insert(CustomPair(0, 0)); +} + +ProcessFilter::~ProcessFilter() {} + +uint32_t ProcessFilter::UpdateThreadByName(uint64_t timeStamp, uint32_t tid, std::string_view name) +{ + DataIndex nameIndex = traceDataCache_->GetDataIndex(name); + return SetThreadPid(timeStamp, tid, nameIndex); +} + +uint32_t ProcessFilter::SetThreadPid(uint64_t timeStamp, uint32_t tid, size_t threadNameIndex) +{ + TraceStdtype::Thread* thread = nullptr; + uint32_t internalTid = GetInternalTid(tid); + if (internalTid != INVALID_ID) { + if (threadNameIndex) { + thread = traceDataCache_->GetThreadData(internalTid); + thread->nameIndex_ = threadNameIndex; + } + } else { + std::tie(internalTid, thread) = NewThread(tid); + thread->nameIndex_ = threadNameIndex; + if (timeStamp) { + thread->startT_ = timeStamp; + } + } + + return internalTid; +} + +void ProcessFilter::SetThreadName(uint32_t tid, uint32_t pid, std::string_view name) +{ + uint32_t internalTid = SetThreadPid(tid, pid); + auto* thread = traceDataCache_->GetThreadData(internalTid); + auto nameIndex = traceDataCache_->GetDataIndex(name); + thread->nameIndex_ = nameIndex; +} + +uint32_t ProcessFilter::SetThreadPid(uint32_t tid, uint32_t pid) +{ + TraceStdtype::Thread* thread = nullptr; + uint32_t internalTid = GetItidExact(tid, pid); + if (internalTid != INVALID_ID) { + thread = traceDataCache_->GetThreadData(internalTid); + } else { + std::tie(internalTid, thread) = NewThread(tid); + } + + if (!thread->internalPid_) { + std::tie(thread->internalPid_, std::ignore) = CreateProcessMaybe(pid, thread->startT_); + } + + return internalTid; +} + +uint32_t ProcessFilter::UpdateProcess(uint32_t pid, std::string_view name) +{ + uint32_t internalPid = 0; + TraceStdtype::Process* process = nullptr; + std::tie(internalPid, process) = CreateProcessMaybe(pid, 0); + if (process) { + process->cmdLine_ = std::string(name); + } + SetThreadPid(pid, pid); + return internalPid; +} + +uint32_t ProcessFilter::GetItidExact(uint32_t tid, uint32_t pid) const +{ + uint32_t internalTid = INVALID_ID; + auto tidsPair = tidMappingSet_.equal_range(tid); + for (auto it = tidsPair.first; it != tidsPair.second; it++) { + uint32_t iterUtid = it->second; + auto* iterThread = traceDataCache_->GetThreadData(iterUtid); + if (!iterThread->internalPid_) { + internalTid = iterUtid; + break; + } + + const auto& iterProcess = traceDataCache_->GetConstProcessData(iterThread->internalPid_); + if (iterProcess.pid_ == pid) { + internalTid = iterUtid; + break; + } + } + + return internalTid; +} + +uint32_t ProcessFilter::GetInternalTid(uint32_t tid) const +{ + auto itRange = tidMappingSet_.equal_range(tid); + if (itRange.first != itRange.second) { + auto internalTid = std::prev(itRange.second)->second; + return internalTid; + } + return INVALID_ID; +} + +uint32_t ProcessFilter::GetInternalPid(uint32_t pid) const +{ + auto it = pidMappingSet_.find(pid); + if (it != pidMappingSet_.end()) { + return it->second; + } + return INVALID_ID; +} + +std::tuple ProcessFilter::NewThread(uint32_t tid) +{ + uint32_t internalTid = traceDataCache_->GetInternalThread(tid); + tidMappingSet_.emplace(tid, internalTid); + auto* thread = traceDataCache_->GetThreadData(internalTid); + + return std::make_tuple(internalTid, thread); +} + +std::tuple ProcessFilter::NewProcess(uint32_t pid) +{ + uint32_t internalPid = traceDataCache_->GetProcessInternalPid(pid); + pidMappingSet_.emplace(pid, internalPid); + auto* process = traceDataCache_->GetProcessData(internalPid); + + return std::make_tuple(internalPid, process); +} + +std::tuple ProcessFilter::CreateProcessMaybe(uint32_t pid, uint64_t startT) +{ + uint32_t internalPid = INVALID_ID; + TraceStdtype::Process* process = nullptr; + auto it = pidMappingSet_.find(pid); + if (it != pidMappingSet_.end()) { + internalPid = it->second; + process = traceDataCache_->GetProcessData(internalPid); + } else { + std::tie(internalPid, process) = NewProcess(pid); + } + + if (process->startT_ == 0) { + process->startT_ = startT; + } + + return std::make_tuple(internalPid, process); +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/filter/process_filter.h b/trace_analyzer/src/filter/process_filter.h new file mode 100644 index 000000000..d9087a86f --- /dev/null +++ b/trace_analyzer/src/filter/process_filter.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PROCESS_FILTER_H +#define PROCESS_FILTER_H + +#include + +#include "filter_base.h" +#include "trace_data_cache.h" +#include "trace_streamer_filters.h" + +namespace SysTuning { +namespace TraceStreamer { +class ProcessFilter : private FilterBase { +public: + explicit ProcessFilter(TraceDataCache*, const TraceStreamerFilters*); + ~ProcessFilter() override; + + uint32_t SetThreadPid(uint64_t timestamp, uint32_t tid, DataIndex threadNameIndex); + uint32_t UpdateThreadByName(uint64_t timestamp, uint32_t tid, std::string_view name); + + uint32_t SetThreadPid(uint32_t tid, uint32_t tgid); + void SetThreadName(uint32_t tid, uint32_t pid, std::string_view name); + uint32_t UpdateProcess(uint32_t pid, std::string_view name); + std::tuple CreateProcessMaybe(uint32_t pid, uint64_t start_ns); + +private: + std::tuple NewThread(uint32_t tid); + std::tuple NewProcess(uint32_t pid); + + InternalTid GetInternalTid(uint32_t tid) const; + InternalTid GetInternalPid(uint32_t pid) const; + InternalTid GetItidExact(uint32_t tid, uint32_t pid) const; + std::multimap tidMappingSet_ = {}; + std::map pidMappingSet_ = {}; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // PROCESS_FILTER_H diff --git a/trace_analyzer/src/filter/slice_filter.cpp b/trace_analyzer/src/filter/slice_filter.cpp new file mode 100755 index 000000000..28ae42ae7 --- /dev/null +++ b/trace_analyzer/src/filter/slice_filter.cpp @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "slice_filter.h" +#include +#include +#include + +#include "common.h" +#include "measure_filter.h" +#include "process_filter.h" +#include "trace_data_cache.h" +#include "trace_streamer_filters.h" + +namespace SysTuning { +namespace TraceStreamer { +SliceFilter::SliceFilter(TraceDataCache* dataCache, const TraceStreamerFilters* filter) + : FilterBase(dataCache, filter) {} + +SliceFilter::~SliceFilter() = default; + +void SliceFilter::BeginSlice(uint64_t timestamp, uint32_t pid, uint32_t threadGroupId, DataIndex cat, DataIndex name) +{ + InternalTid internalTid = streamFilters_->processFilter_->SetThreadPid(pid, threadGroupId); + pidTothreadGroupId_[pid] = threadGroupId; + uint32_t filterId = streamFilters_->threadFilter_->GetOrCreateCertainFilterId(internalTid, 0); + struct SliceData sliceData = {timestamp, 0, internalTid, filterId, cat, name}; + FinishedSliceStack(sliceData.timestamp, sliceStackMap_[sliceData.internalTid]); + BeginSliceInternal(sliceData); +} + +void SliceFilter::AsyncBeginSlice(uint64_t timestamp, uint32_t pid, + uint32_t threadGroupId, int64_t cookie, DataIndex name) +{ + UNUSED(timestamp); + + InternalTid internalTid = streamFilters_->processFilter_->SetThreadPid(pid, threadGroupId); + auto filterId = streamFilters_->processFilterFilter_->GetOrCreateCertainFilterIdByCookie(internalTid, name, cookie); + UNUSED(filterId); +} + +void SliceFilter::AsyncEndSlice(uint64_t timestamp, uint32_t pid, int64_t cookie) +{ + UNUSED(timestamp); + UNUSED(pid); + UNUSED(cookie); +} + +void SliceFilter::BeginSliceInternal(const SliceData& sliceData) +{ + auto* sliceStack = &sliceStackMap_[sliceData.internalTid]; + auto* slices = traceDataCache_->GetInternalSlicesData(); + const uint8_t depth = static_cast(sliceStack->size()); + if (depth >= std::numeric_limits::max()) { + TUNING_LOGF("stack depth out of range."); + return; + } + + uint64_t parentStackId = 0; + std::optional parentId = std::nullopt; + if (depth != 0) { + size_t lastDepth = sliceStack->back(); + parentStackId = slices->StackIdsData()[lastDepth]; + parentId = std::make_optional(slices->IdsData()[lastDepth]); + } + + size_t index = slices->AppendInternalSlice(sliceData.timestamp, sliceData.duration, sliceData.internalTid, + sliceData.filterId, sliceData.cat, sliceData.name, depth, 0, parentStackId, parentId); + sliceStack->push_back(index); + slices->SetStackId(index, GenHashByStack(*sliceStack)); +} + +void SliceFilter::EndSlice(uint64_t timestamp, uint32_t pid, uint32_t threadGroupId) +{ + auto actThreadGroupIdIter = pidTothreadGroupId_.find(pid); + if (actThreadGroupIdIter == pidTothreadGroupId_.end()) { + return; + } + + uint32_t actThreadGroupId = actThreadGroupIdIter->second; + if (threadGroupId != 0 && threadGroupId != actThreadGroupId) { + TUNING_LOGD("pid %u mismatched thread group id %u", pid, actThreadGroupId); + } + + InternalTid internalTid = streamFilters_->processFilter_->SetThreadPid(pid, actThreadGroupId); + + FinishedSliceStack(timestamp, sliceStackMap_[internalTid]); + + const auto& stack = sliceStackMap_[internalTid]; + if (stack.empty()) { + return; + } + + auto* slices = traceDataCache_->GetInternalSlicesData(); + size_t index = stack.back(); + slices->SetDuration(index, timestamp - slices->TimeStamData()[index]); + + sliceStackMap_[internalTid].pop_back(); +} + +void SliceFilter::FinishedSliceStack(uint64_t timestamp, StackOfSlices& sliceStack) +{ + const auto& slices = traceDataCache_->GetConstInternalSlicesData(); + for (int i = static_cast(sliceStack.size()) - 1; i >= 0; i--) { + size_t index = sliceStack[static_cast(i)]; + uint64_t during = slices.DursData()[index]; + if (during == 0) { + continue; + } + + uint64_t endT = slices.TimeStamData()[index] + during; + if (timestamp >= endT) { + sliceStack.pop_back(); + } + } +} + +uint64_t SliceFilter::GenHashByStack(const StackOfSlices& sliceStack) const +{ + std::string hashStr; + const auto& sliceSet = traceDataCache_->GetConstInternalSlicesData(); + for (size_t i = 0; i < sliceStack.size(); i++) { + size_t index = sliceStack[i]; + hashStr += "cat"; + hashStr += std::to_string(sliceSet.CatsData()[index]); + hashStr += "name"; + hashStr += std::to_string(sliceSet.NamesData()[index]); + } + + const uint64_t stackHashMask = uint64_t(-1) >> 1; + return (std::hash {}(hashStr)) & stackHashMask; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/filter/slice_filter.h b/trace_analyzer/src/filter/slice_filter.h new file mode 100755 index 000000000..e935593bb --- /dev/null +++ b/trace_analyzer/src/filter/slice_filter.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SLICE_FILTER_H +#define SLICE_FILTER_H + +#include + +#include "filter_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class TraceDataCache; +class TraceStreamerFilters; + +struct SliceData { + uint64_t timestamp; + uint64_t duration; + InternalTid internalTid; + uint32_t filterId; + DataIndex cat; + DataIndex name; +}; + +class SliceFilter : private FilterBase { +public: + explicit SliceFilter(TraceDataCache*, const TraceStreamerFilters*); + ~SliceFilter() override; + + void BeginSlice(uint64_t timestamp, uint32_t ftraceTid, uint32_t atraceTid, DataIndex cat, DataIndex name); + void EndSlice(uint64_t timestamp, uint32_t ftraceTid, uint32_t atraceTid); + void AsyncBeginSlice(uint64_t timestamp, uint32_t ftraceTid, uint32_t atraceTid, int64_t cookie, DataIndex name); + void AsyncEndSlice(uint64_t timestamp, uint32_t pid, int64_t cookie); + +private: + using StackOfSlices = std::vector; + + uint64_t GenHashByStack(const StackOfSlices&) const; + void BeginSliceInternal(const SliceData& sliceData); + void FinishedSliceStack(uint64_t endTs, StackOfSlices&); + + std::unordered_map sliceStackMap_ = {}; + std::unordered_map pidTothreadGroupId_ = {}; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // SLICE_FILTER_H diff --git a/trace_analyzer/src/main.cpp b/trace_analyzer/src/main.cpp new file mode 100644 index 000000000..8ffa346dd --- /dev/null +++ b/trace_analyzer/src/main.cpp @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "file.h" +#include "log.h" +#include "trace_streamer.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +constexpr size_t G_CHUNK_SIZE = 1024 * 1024; +TraceStreamer* g_traceStreamer; + +void ExportStatusToLog(base::ErrStatus stauts) +{ + std::string path = base::GetExecutionDirectoryPath() + "/trace_streamer.log"; + std::ofstream out(path, std::ios_base::trunc); + out << (std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch())) + .count() + << ":" << stauts << std::endl; + out.close(); +} + + +int ExportDatabase(const std::string& outputName) +{ + return g_traceStreamer->ExportDatabase(outputName); +} + +void ShowHelpInfo(char** argv) +{ + TUNING_LOGI( + "trace analyse tool, it can transfer a bytrace file into a " + "SQLite database and save result to a local file trace_streamer.log.\n" + "Usage: %s FILE -e sqlite_out.pb\n" + "Options:\n" + " -e transfer a bytrace file into a SQLiteBased DB.\n" + " -v show version.", + argv[0]); +} + +void PrintVersion() +{ + printf("version 0.1.106\n"); +} + +int FileRead(TraceStreamer& ta, int fd) +{ + ssize_t loadSize = 0; + while (true) { + std::unique_ptr buf = std::make_unique(std::move(G_CHUNK_SIZE)); + auto rsize = base::Read(fd, buf.get(), G_CHUNK_SIZE); + if (rsize == 0) { + break; + } + + if (rsize < 0) { + TUNING_LOGI("Reading trace file failed (errno: %d, %s)", errno, strerror(errno)); + return 1; + } + loadSize += rsize; + if (!ta.Parse(std::move(buf), static_cast(rsize))) { + return 1; + }; + fprintf(stdout, "\rLoading file: %.2f MB\r", static_cast(loadSize) / 1E6); + } + + return 0; +} + +int EnterTraceStreamer(int argc, char** argv) +{ + if (argc < G_MIN_PARAM_NUM) { + ShowHelpInfo(argv); + return 1; + } + + std::string traceFilePath; + std::string sqliteFilePath; + for (int i = 1; i < argc; i++) { + if (!strcmp(argv[i], "-e")) { + if (++i == argc) { + ShowHelpInfo(argv); + return 1; + } + sqliteFilePath = std::string(argv[i]); + continue; + } else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--v") + || !strcmp(argv[i], "-version") || !strcmp(argv[i], "--version")) { + PrintVersion(); + return 0; + } + traceFilePath = std::string(argv[i]); + } + if (traceFilePath.empty()) { + ShowHelpInfo(argv); + return 1; + } + + std::unique_ptr ta = std::make_unique(); + int fd(base::OpenFile(traceFilePath, O_RDONLY, G_FILE_PERMISSION)); + if (fd < 0) { + TUNING_LOGI("%s does not exist", traceFilePath.c_str()); + return 1; + } + if (FileRead(*ta, fd)) { + close(fd); + return 1; + } + + close(fd); + + g_traceStreamer = ta.get(); + + if (!sqliteFilePath.empty()) { + return ExportDatabase(sqliteFilePath); + } + + return 0; +} +} // namespace +} // namespace TraceStreamer +} // namespace SysTuning + +int main(int argc, char** argv) +{ + int result = SysTuning::TraceStreamer::EnterTraceStreamer(argc, argv); + SysTuning::TraceStreamer::ExportStatusToLog(SysTuning::base::GetAnalysisResult()); + return result; +} diff --git a/trace_analyzer/src/parser/bytrace_parser.cpp b/trace_analyzer/src/parser/bytrace_parser.cpp new file mode 100755 index 000000000..d31c91191 --- /dev/null +++ b/trace_analyzer/src/parser/bytrace_parser.cpp @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "bytrace_parser.h" + +namespace SysTuning { +namespace TraceStreamer { +BytraceParser::BytraceParser(TraceDataCache* dataCache, const TraceStreamerFilters* ctx) + : eventParser_(std::make_unique(dataCache, ctx)) +{ +} + +BytraceParser::~BytraceParser() = default; + +bool BytraceParser::Parse(std::unique_ptr bufferStr, size_t size) +{ + if (parserState_ == END) { + return true; + } + + parserState_ = RUNNING; + packagesBuffer_.insert(packagesBuffer_.end(), &bufferStr[0], &bufferStr[size]); + auto packagesBegin = packagesBuffer_.begin(); + + while (1) { + auto packagesLine = std::find(packagesBegin, packagesBuffer_.end(), '\n'); + if (packagesLine == packagesBuffer_.end()) { + break; + } + + std::string bufferLine(packagesBegin, packagesLine); + + if (IsTraceData(bufferLine)) { + isByTrace_ = true; + goto NEXT_LINE; + } + + if (isByTrace_) { + if (bufferLine.find(script_.c_str()) != std::string::npos) { + parserState_ = END; + break; + } else if (!bufferLine.empty() && (bufferLine.compare(0, std::string("#").length(), "#") != 0)) { + BytraceLine line; + if (LineParser(bufferLine, line) == SUCCESS) { + eventParser_->ParseLine(std::move(line)); + } + } + } + + NEXT_LINE: + packagesBegin = packagesLine + 1; + continue; + } + + if (parserState_ == END) { + packagesBuffer_.clear(); + } else { + packagesBuffer_.erase(packagesBuffer_.begin(), packagesBegin); + } + return true; +} + +ParseResult BytraceParser::LineParser(const std::string& buffer, BytraceLine& line) const +{ + std::smatch matcheLine; + bool matched = std::regex_search(buffer, matcheLine, bytraceMatcher_); + if (!matched) { + TUNING_LOGD("Not support this event (line: %s)", buffer.c_str()); + return ERROR; + } + + size_t index = 0; + std::string pidStr = matcheLine[++index].str(); + std::optional optionalPid = base::StrToUInt32(pidStr); + if (!optionalPid.has_value()) { + TUNING_LOGD("Illegal pid: %s", pidStr.c_str()); + return ERROR; + } + + std::string tGidStr = matcheLine[++index].str(); + std::string cpuStr = matcheLine[++index].str(); + std::optional optionalCpu = base::StrToUInt32(cpuStr); + if (!optionalCpu.has_value()) { + TUNING_LOGD("Illegal cpu %s", cpuStr.c_str()); + return ERROR; + } + std::string timeStr = matcheLine[++index].str(); + std::optional optionalTime = base::StrToDouble(timeStr); + if (!optionalTime.has_value()) { + TUNING_LOGD("Illegal ts %s", timeStr.c_str()); + return ERROR; + } + std::string eventName = matcheLine[++index].str(); + + line.pid = optionalPid.value(); + line.cpu = optionalCpu.value(); + line.ts = static_cast(optionalTime.value() * 1e9); + line.task = StrTrim(matcheLine.prefix()); + line.tGidStr = tGidStr; + line.eventName = eventName; + line.argsStr = StrTrim(matcheLine.suffix()); + + return SUCCESS; +} + +// Remove space at the beginning and end of the string +std::string BytraceParser::StrTrim(const std::string& input) const +{ + std::string str = input; + auto posBegin = std::find_if(str.begin(), str.end(), IsNotSpace); + str.erase(str.begin(), posBegin); + + auto posEnd = std::find_if(str.rbegin(), str.rend(), IsNotSpace); + str.erase(posEnd.base(), str.end()); + + return str; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/parser/bytrace_parser.h b/trace_analyzer/src/parser/bytrace_parser.h new file mode 100755 index 000000000..e336d5a2e --- /dev/null +++ b/trace_analyzer/src/parser/bytrace_parser.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BYTRACE_PARSER_H +#define BYTRACE_PARSER_H + +#include + +#include "event_parser.h" +#include "log.h" +#include "string_to_numerical.h" +#include "trace_data/trace_data_cache.h" +#include "trace_streamer_filters.h" + +namespace SysTuning { +namespace TraceStreamer { +class BytraceParser { +public: + explicit BytraceParser(TraceDataCache*, const TraceStreamerFilters*); + ~BytraceParser(); + + bool Parse(std::unique_ptr, size_t size); + +private: + enum BytraceParserState { IDLE, RUNNING, END }; + + BytraceParserState parserState_ = IDLE; + bool isByTrace_ = false; + std::deque packagesBuffer_ = {0}; + std::unique_ptr eventParser_; + const std::regex bytraceMatcher_ = + std::regex(R"(-(\d+)\s+\(?\s*(\d+|-+)?\)?\s?\[(\d+)\]\s*)" + R"([a-zA-Z0-9.]{0,5}\s+(\d+\.\d+):\s+(\S+):)"); + + const std::string script_ = R"()"; + + inline static bool IsNotSpace(char c) + { + return !std::isspace(c); + } + inline static bool IsTraceData(const std::string& buffer) + { + return ((buffer.compare(0, std::string("#").length(), "#") == 0) || + buffer.find("TASK-PID") != std::string::npos); + } + + ParseResult LineParser(const std::string& buffer, BytraceLine& line) const; + std::string StrTrim(const std::string& input) const; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // _BYTRACE_PARSER_H_ diff --git a/trace_analyzer/src/parser/common_types.h b/trace_analyzer/src/parser/common_types.h new file mode 100755 index 000000000..d48a2effd --- /dev/null +++ b/trace_analyzer/src/parser/common_types.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BYTRACE_COMMON_TYPES_H +#define BYTRACE_COMMON_TYPES_H + +#include + +namespace SysTuning { +namespace TraceStreamer { +enum ParseResult { ERROR = 0, SUCCESS }; +enum RawType { RAW_CPU_IDLE = 1, RAW_SCHED_WAKEUP = 2, RAW_SCHED_WAKING = 3 }; + +enum Stat : uint32_t { + RUNNABLE = 0, + INTERRUPTABLESLEEP = 1, + UNINTERRUPTIBLESLEEP = 2, + STOPPED = 4, + TRACED = 8, + EXITDEAD = 16, + EXITZOMBIE = 32, + TASKDEAD = 64, + WAKEKILL = 128, + WAKING = 256, + PARKED = 512, + NOLOAD = 1024, + TASKNEW = 2048, + MAXSTAT = 2048, + VALID = 0X8000, +}; + +struct BytraceLine { + uint64_t ts = 0; + uint32_t pid = 0; + uint32_t cpu = 0; + + std::string task; // thread name + std::string pidStr; // thread str + std::string tGidStr; // process thread_group + std::string eventName; + std::string argsStr; +}; + +struct TracePoint { + char phase_ = '\0'; + uint32_t tgid_ = 0; + std::string name_; + double value_ = 0; + std::string categoryGroup_; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // _BYTRACE_COMMON_TYPES_H_ diff --git a/trace_analyzer/src/parser/event_parser.cpp b/trace_analyzer/src/parser/event_parser.cpp new file mode 100755 index 000000000..3b3d3bab6 --- /dev/null +++ b/trace_analyzer/src/parser/event_parser.cpp @@ -0,0 +1,612 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "event_parser.h" +#include +#include + +#include "cpu_filter.h" +#include "event_filter.h" +#include "filter_filter.h" +#include "measure_filter.h" +#include "parting_string.h" +#include "process_filter.h" +#include "slice_filter.h" +#include "string_to_numerical.h" +#include "thread_state.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +std::string GetFunctionName(const std::string_view& text, const std::string_view& delimiter) +{ + std::string str(""); + if (delimiter.empty()) { + return str; + } + + std::size_t foundIndex = text.find(delimiter); + if (foundIndex != std::string::npos) { + std::size_t funIndex = foundIndex + delimiter.size(); + str = std::string(text.substr(funIndex, text.size() - funIndex)); + } + return str; +} +} // namespace + +EventParser::EventParser(TraceDataCache* dataCache, const TraceStreamerFilters* filter) + : streamFilters_(filter), + ioWaitId_(dataCache->GetDataIndex("io_wait")), + workQueueId_(dataCache->GetDataIndex("workqueue")), + schedWakeupId_(dataCache->GetDataIndex("sched_wakeup")), + schedBlockedReasonId_(dataCache->GetDataIndex("sched_blocked_reason")), + binderId_(dataCache->GetDataIndex("binder")), + pointLength_(1), + maxPointLength_(2), + byHex_(16), + traceDataCache_(dataCache) +{ + eventToFunction_ = { + {"binder_transaction", + bind(&EventParser::BinderTransactionEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"binder_transaction_received", + bind(&EventParser::BinderTransactionReceivedEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"binder_lock", bind(&EventParser::BinderLockEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"binder_locked", bind(&EventParser::BinderLockedEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"binder_unlock", bind(&EventParser::BinderUnLockEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"binder_transaction_alloc_buf", + bind(&EventParser::BinderTransactionAllocBufEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"sched_switch", bind(&EventParser::SchedSwitchEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"task_rename", bind(&EventParser::TaskRenameEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"task_newtask", bind(&EventParser::TaskNewtaskEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"tracing_mark_write", + bind(&EventParser::TracingMarkWriteEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"0", bind(&EventParser::TracingMarkWriteEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"print", bind(&EventParser::TracingMarkWriteEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"sched_wakeup", bind(&EventParser::SchedWakeupEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"sched_waking", bind(&EventParser::SchedWakingEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"cpu_idle", bind(&EventParser::CpuIdleEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"cpu_frequency", bind(&EventParser::CpuFrequencyEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"workqueue_execute_start", + bind(&EventParser::WorkqueueExecuteStartEvent, this, std::placeholders::_1, std::placeholders::_2)}, + {"workqueue_execute_end", + bind(&EventParser::WorkqueueExecuteEndEvent, this, std::placeholders::_1, std::placeholders::_2)} + }; +} + +bool EventParser::BinderTransactionEvent(ArgsMap args, const BytraceLine line) const +{ + auto transId = base::StrToInt32(args["transaction"]); + if (!transId.has_value()) { + TUNING_LOGD("Failed to convert transaction id"); + return false; + } + auto destNode = base::StrToInt32(args["dest_node"]); + if (!destNode.has_value()) { + TUNING_LOGD("Failed to convert dest_node"); + return false; + } + auto destTgid = base::StrToInt32(args["dest_proc"]); + if (!destTgid.has_value()) { + TUNING_LOGD("Failed to convert dest_tgid"); + return false; + } + auto destTid = base::StrToInt32(args["dest_thread"]); + if (!destTid.has_value()) { + TUNING_LOGD("Failed to convert dest_tid"); + return false; + } + + auto isReply = (base::StrToInt32(args["reply"]).value() == 1); + uint32_t flags = base::StrToUInt32(args["flags"], byHex_).value(); + + std::string codeStr = args["code"] + " Java Layer Dependent"; + DataIndex code = traceDataCache_->GetDataIndex(std::string_view(codeStr)); + + struct BinderParamter binderParamter; + binderParamter.ts = line.ts; + binderParamter.tid = line.pid; + binderParamter.transactionId = transId.value(); + binderParamter.destNode = destNode.value(); + binderParamter.destTgid = destTgid.value(); + binderParamter.destTid = destTid.value(); + binderParamter.isReply = isReply; + binderParamter.flags = flags; + binderParamter.code = code; + binderParamter.nameIndex = traceDataCache_->GetDataIndex(line.eventName.c_str()); + + streamFilters_->eventFilter_->BinderTransaction(binderParamter); + return true; +} + +bool EventParser::BinderTransactionReceivedEvent(ArgsMap args, const BytraceLine line) const +{ + auto transId = base::StrToInt32(args["transaction"]); + if (!transId.has_value()) { + TUNING_LOGD("Failed to convert transaction id"); + return false; + } + + streamFilters_->eventFilter_->BinderTransactionReceived(line.ts, line.pid, transId.value()); + return true; +} + +bool EventParser::BinderLockEvent(ArgsMap args, const BytraceLine line) const +{ + UNUSED(args); + UNUSED(line); + return true; +} + +bool EventParser::BinderLockedEvent(ArgsMap args, const BytraceLine line) const +{ + UNUSED(args); + UNUSED(line); + return true; +} + +bool EventParser::BinderUnLockEvent(ArgsMap args, const BytraceLine line) const +{ + UNUSED(args); + UNUSED(line); + return true; +} + +bool EventParser::BinderTransactionAllocBufEvent(ArgsMap args, const BytraceLine line) const +{ + auto dataSize = base::StrToUInt64(args["data_size"]); + if (!dataSize.has_value()) { + TUNING_LOGD("Failed to parse data_size"); + return false; + } + auto offsetsSize = base::StrToUInt64(args["offsets_size"]); + if (!offsetsSize.has_value()) { + TUNING_LOGD("Failed to parse offsets_size"); + return false; + } + + UNUSED(line); + return true; +} + +bool EventParser::SchedSwitchEvent(ArgsMap args, const BytraceLine line) const +{ + auto prevCommStr = std::string_view(args["prev_comm"]); + auto nextCommStr = std::string_view(args["next_comm"]); + auto prevPrioValue = base::StrToInt32(args["prev_prio"]); + auto nextPrioValue = base::StrToInt32(args["next_prio"]); + auto prevPidValue = base::StrToUInt32(args["prev_pid"]); + auto nextPidValue = base::StrToUInt32(args["next_pid"]); + if (!(prevPidValue.has_value() && prevPrioValue.has_value() && nextPidValue.has_value() && + nextPrioValue.has_value())) { + TUNING_LOGD("Failed to parse sched_switch event"); + return false; + } + + auto prevStateStr = args["prev_state"]; + uint64_t prevState = ThreadState(prevStateStr.c_str()).State(); + streamFilters_->eventFilter_->UpdateSchedSwitch(line.cpu, line.ts, prevPidValue.value(), + nextPidValue.value(), nextCommStr); + auto unexttid = streamFilters_->processFilter_->UpdateThreadByName(line.ts, nextPidValue.value(), nextCommStr); + auto uprevtid = streamFilters_->processFilter_->UpdateThreadByName(line.ts, prevPidValue.value(), prevCommStr); + streamFilters_->cpuFilter_->InsertSwitchEvent(line.ts, line.cpu, uprevtid, + static_cast(prevPrioValue.value()), prevState, unexttid, + static_cast(nextPrioValue.value())); + return true; +} + +bool EventParser::TaskRenameEvent(ArgsMap args, const BytraceLine line) const +{ + UNUSED(line); + auto prevCommStr = std::string_view(args["newcomm"]); + auto pidValue = base::StrToUInt32(args["pid"]); + streamFilters_->processFilter_->UpdateProcess(pidValue.value(), prevCommStr); + return true; +} + +bool EventParser::TaskNewtaskEvent(ArgsMap args, const BytraceLine line) const +{ + auto commonStr = std::string_view(args["comm"]); + auto pidValue = base::StrToUInt32(args["pid"]); + + uint32_t ftracePid = 0; + if (!line.tGidStr.empty() && line.tGidStr != "-----") { + std::optional tgid = base::StrToUInt32(line.tGidStr); + if (tgid) { + ftracePid = tgid.value(); + } + } + + static const uint32_t threadPid = 2; + static const uint32_t cloneThread = 0x00010000; + auto cloneFlags = base::StrToUInt64(args["clone_flags"], byHex_).value(); + if ((cloneFlags & cloneThread) == 0 && ftracePid != threadPid) { + streamFilters_->processFilter_->UpdateProcess(static_cast(pidValue.value()), commonStr); + } else if (ftracePid == threadPid) { + streamFilters_->processFilter_->SetThreadPid(static_cast(pidValue.value()), threadPid); + } + return true; +} + +bool EventParser::TracingMarkWriteEvent(ArgsMap args, const BytraceLine line) const +{ + UNUSED(args); + ParsePrintEvent(line.ts, line.pid, line.argsStr.c_str()); + return true; +} + +bool EventParser::SchedWakeupEvent(ArgsMap args, const BytraceLine line) const +{ + std::optional wakePidValue = base::StrToUInt32(args["pid"]); + if (!wakePidValue.has_value()) { + TUNING_LOGD("Failed to convert wake_pid"); + return false; + } + DataIndex name = traceDataCache_->GetDataIndex(std::string_view("sched_wakeup")); + auto* instants = traceDataCache_->GetInstantsData(); + InternalTid internalTid = streamFilters_->processFilter_->SetThreadPid(line.ts, line.pid, 0); + instants->AppendInstantEventData(line.ts, name, internalTid); + std::optional targetCpu = base::StrToUInt32(args["target_cpu"]); + if (targetCpu.has_value()) { + traceDataCache_->GetRawData()->AppendRawData(0, line.ts, RAW_SCHED_WAKEUP, targetCpu.value(), internalTid); + } + return true; +} + +bool EventParser::SchedWakingEvent(ArgsMap args, const BytraceLine line) const +{ + std::optional wakePidValue = base::StrToUInt32(args["pid"]); + if (!wakePidValue.has_value()) { + TUNING_LOGD("Failed to convert wake_pid"); + return false; + } + DataIndex name = traceDataCache_->GetDataIndex(std::string_view("sched_waking")); + auto* instants = traceDataCache_->GetInstantsData(); + InternalTid internalTid = streamFilters_->processFilter_->SetThreadPid(line.ts, line.pid, 0); + instants->AppendInstantEventData(line.ts, name, internalTid); + streamFilters_->cpuFilter_->InsertWakeingEvent(line.ts, internalTid); + std::optional targetCpu = base::StrToUInt32(args["target_cpu"]); + if (targetCpu.has_value()) { + traceDataCache_->GetRawData()->AppendRawData(0, line.ts, RAW_SCHED_WAKING, targetCpu.value(), internalTid); + } + return true; +} + +bool EventParser::CpuIdleEvent(ArgsMap args, const BytraceLine line) const +{ + std::optional eventCpuValue = base::StrToUInt32(args["cpu_id"]); + std::optional newStateValue = base::StrToDouble(args["state"]); + if (!eventCpuValue.has_value()) { + TUNING_LOGD("Failed to convert event cpu"); + return false; + } + if (!newStateValue.has_value()) { + TUNING_LOGD("Failed to convert state"); + return false; + } + auto cpuIdleNameIndex = traceDataCache_->GetDataIndex(line.eventName.c_str()); + uint32_t filterId = + streamFilters_->cpuCounterFilter_->GetOrCreateCertainFilterId(eventCpuValue.value(), cpuIdleNameIndex); + traceDataCache_->GetCounterData()->AppendCounterData(0, line.ts, newStateValue.value(), filterId); + traceDataCache_->GetRawData()->AppendRawData(0, line.ts, RAW_CPU_IDLE, eventCpuValue.value(), 0); + return true; +} + +bool EventParser::CpuFrequencyEvent(ArgsMap args, const BytraceLine line) const +{ + std::optional newStateValue = base::StrToDouble(args["state"]); + std::optional eventCpuValue = base::StrToUInt32(args["cpu_id"]); + + if (!newStateValue.has_value()) { + TUNING_LOGD("Failed to convert state"); + return false; + } + if (!eventCpuValue.has_value()) { + TUNING_LOGD("Failed to convert event cpu"); + return false; + } + + auto cpuidleNameIndex = traceDataCache_->GetDataIndex(line.eventName.c_str()); + uint32_t filterId = + streamFilters_->cpuCounterFilter_->GetOrCreateCertainFilterId(eventCpuValue.value(), cpuidleNameIndex); + traceDataCache_->GetCounterData()->AppendCounterData(0, line.ts, newStateValue.value(), filterId); + return true; +} + +bool EventParser::WorkqueueExecuteStartEvent(ArgsMap args, const BytraceLine line) const +{ + UNUSED(args); + auto splitStr = GetFunctionName(line.argsStr, "function "); + DataIndex nameIndex = traceDataCache_->GetDataIndex(std::string_view(splitStr)); + streamFilters_->sliceFilter_->BeginSlice(line.ts, line.pid, line.pid, workQueueId_, nameIndex); + return true; +} + +bool EventParser::WorkqueueExecuteEndEvent(ArgsMap args, const BytraceLine line) const +{ + UNUSED(args); + streamFilters_->sliceFilter_->EndSlice(line.ts, line.pid, line.pid); + return true; +} + +bool EventParser::ParseLine(const BytraceLine& line) const +{ + ArgsMap args; + traceDataCache_->UpdateBoundTime(line.ts); + if (!line.tGidStr.empty() && line.tGidStr != "-----") { + std::optional tgid = base::StrToUInt32(line.tGidStr); + if (tgid) { + streamFilters_->processFilter_->SetThreadPid(line.pid, tgid.value()); + streamFilters_->processFilter_->SetThreadName(line.pid, tgid.value_or(0), std::string_view(line.task)); + } + } + + for (base::PartingString ss(line.argsStr, ' '); ss.Next();) { + std::string key; + std::string value; + if (!(std::string(ss.GetCur()).find("=") != std::string::npos)) { + key = "name"; + value = ss.GetCur(); + args.emplace(std::move(key), std::move(value)); + continue; + } + for (base::PartingString inner(ss.GetCur(), '='); inner.Next();) { + if (key.empty()) { + key = inner.GetCur(); + } else { + value = inner.GetCur(); + } + } + args.emplace(std::move(key), std::move(value)); + } + + auto it = eventToFunction_.find(line.eventName); + if (it != eventToFunction_.end()) { + return it->second(args, line); + } + return true; +} + +void EventParser::ParsePrintEvent(uint64_t ts, uint32_t pid, std::string_view event) const +{ + TracePoint point; + if (GetTracePoint(event, point) == SUCCESS) { + ParseTracePoint(ts, pid, point); + } +} + +void EventParser::ParseTracePoint(uint64_t ts, uint32_t pid, TracePoint point) const +{ + switch (point.phase_) { + case 'B': { + DataIndex nameIndex = traceDataCache_->GetDataIndex(point.name_); + streamFilters_->sliceFilter_->BeginSlice(ts, pid, point.tgid_, 0, nameIndex); + break; + } + case 'E': { + streamFilters_->sliceFilter_->EndSlice(ts, pid, point.tgid_); + break; + } + case 'S': { + DataIndex nameIndex = traceDataCache_->GetDataIndex(point.name_); + auto cookie = static_cast(point.value_); + streamFilters_->sliceFilter_->AsyncBeginSlice(ts, pid, point.tgid_, cookie, nameIndex); + break; + } + case 'F': { + auto cookie = static_cast(point.value_); + streamFilters_->sliceFilter_->AsyncEndSlice(ts, pid, cookie); + break; + } + case 'C': { + if (point.name_ == "ScreenState") { + return; + } + + DataIndex nameIndex = traceDataCache_->GetDataIndex(point.name_); + uint32_t internalPid = streamFilters_->processFilter_->UpdateProcess(point.tgid_, point.name_); + auto filterId = streamFilters_->processCounterFilter_->GetOrCreateCertainFilterId(internalPid, nameIndex); + traceDataCache_->GetCounterData()->AppendCounterData(0, ts, point.value_, filterId); + break; + } + default: + TUNING_LOGD("point missing!"); + break; + } +} + +ParseResult EventParser::CheckTracePoint(std::string_view pointStr) const +{ + if (pointStr.size() == 0) { + TUNING_LOGD("get trace point data size is 0!"); + return ERROR; + } + + std::string clockSyncSts = "trace_event_clock_sync"; + if (pointStr.compare(0, clockSyncSts.length(), clockSyncSts.c_str()) == 0) { + TUNING_LOGD("skip trace point :%s!", clockSyncSts.c_str()); + return ERROR; + } + + if (pointStr.find_first_of('B') != 0 && pointStr.find_first_of('E') != 0 && pointStr.find_first_of('C') != 0 && + pointStr.find_first_of('S') != 0 && pointStr.find_first_of('F') != 0) { + TUNING_LOGD("trace point not supported : [%c] !", pointStr[0]); + return ERROR; + } + + if (pointStr.find_first_of('E') != 0 && pointStr.size() == 1) { + TUNING_LOGD("point string size error!"); + return ERROR; + } + + if (pointStr.size() >= maxPointLength_) { + if ((pointStr[1] != '|') && (pointStr[1] != '\n')) { + TUNING_LOGD("not support data formart!"); + return ERROR; + } + } + + return SUCCESS; +} + +uint32_t EventParser::GetThreadGroupId(std::string_view pointStr, size_t& length) const +{ + for (size_t i = maxPointLength_; i < pointStr.size(); i++) { + if (pointStr[i] == '|' || pointStr[i] == '\n') { + break; + } + + if (pointStr[i] < '0' || pointStr[i] > '9') { + return ERROR; + } + + length++; + } + + std::string str(pointStr.data() + maxPointLength_, length); + return base::StrToUInt32(str).value_or(0); +} + +std::string_view EventParser::GetPointNameForBegin(std::string_view pointStr, size_t tGidlength) const +{ + size_t index = maxPointLength_ + tGidlength + pointLength_; + size_t length = pointStr.size() - index - ((pointStr.back() == '\n') ? 1 : 0); + std::string_view name = std::string_view(pointStr.data() + index, length); + return name; +} + +ParseResult EventParser::HandlerB(std::string_view pointStr, TracePoint& outPoint, size_t tGidlength) const +{ + outPoint.name_ = GetPointNameForBegin(pointStr, tGidlength); + if (outPoint.name_.empty()) { + TUNING_LOGD("point name is empty!"); + return ERROR; + } + return SUCCESS; +} + +ParseResult EventParser::HandlerE(void) const +{ + return SUCCESS; +} + +size_t EventParser::GetNameLength(std::string_view pointStr, size_t nameIndex) const +{ + size_t namelength = 0; + for (size_t i = nameIndex; i < pointStr.size(); i++) { + if (pointStr[i] == '|') { + namelength = i - nameIndex; + break; + } + } + return namelength; +} + +size_t EventParser::GetValueLength(std::string_view pointStr, size_t valueIndex) const +{ + size_t valuePipe = pointStr.find('|', valueIndex); + size_t valueLen = pointStr.size() - valueIndex; + if (valuePipe != std::string_view::npos) { + valueLen = valuePipe - valueIndex; + } + + if (valueLen == 0) { + return 0; + } + + if (pointStr[valueIndex + valueLen - pointLength_] == '\n') { + valueLen--; + } + + return valueLen; +} + +ParseResult EventParser::HandlerCSF(std::string_view pointStr, TracePoint& outPoint, size_t tGidlength) const +{ + // point name + size_t nameIndex = maxPointLength_ + tGidlength + pointLength_; + size_t namelength = GetNameLength(pointStr, nameIndex); + if (namelength == 0) { + TUNING_LOGD("point name length is error!"); + return ERROR; + } + outPoint.name_ = std::string_view(pointStr.data() + nameIndex, namelength); + + // point value + size_t valueIndex = nameIndex + namelength + pointLength_; + size_t valueLen = GetValueLength(pointStr, valueIndex); + if (valueLen == 0) { + TUNING_LOGD("point value length is error!"); + return ERROR; + } + + std::string valueStr(pointStr.data() + valueIndex, valueLen); + if (!base::StrToDouble(valueStr).has_value()) { + TUNING_LOGD("point value is error!"); + return ERROR; + } + outPoint.value_ = base::StrToDouble(valueStr).value(); + + size_t valuePipe = pointStr.find('|', valueIndex); + if (valuePipe != std::string_view::npos) { + size_t groupLen = pointStr.size() - valuePipe - pointLength_; + if (groupLen == 0) { + return ERROR; + } + + if (pointStr[pointStr.size() - pointLength_] == '\n') { + groupLen--; + } + + outPoint.categoryGroup_ = std::string_view(pointStr.data() + valuePipe + 1, groupLen); + } + + return SUCCESS; +} + +ParseResult EventParser::GetTracePoint(std::string_view pointStr, TracePoint& outPoint) const +{ + if (CheckTracePoint(pointStr) != SUCCESS) { + return ERROR; + } + + size_t tGidlength = 0; + + outPoint.phase_ = pointStr.front(); + outPoint.tgid_ = GetThreadGroupId(pointStr, tGidlength); + + ParseResult ret = ERROR; + switch (outPoint.phase_) { + case 'B': { + ret = HandlerB(pointStr, outPoint, tGidlength); + break; + } + case 'E': { + ret = HandlerE(); + break; + } + case 'S': + case 'F': + case 'C': { + ret = HandlerCSF(pointStr, outPoint, tGidlength); + break; + } + default: + return ERROR; + } + return ret; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/parser/event_parser.h b/trace_analyzer/src/parser/event_parser.h new file mode 100755 index 000000000..82f29cdf8 --- /dev/null +++ b/trace_analyzer/src/parser/event_parser.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SRC_EVENT_PARSER_H +#define SRC_EVENT_PARSER_H + +#include + +#include "common_types.h" +#include "trace_data_cache.h" +#include "trace_streamer_filters.h" + +namespace SysTuning { +namespace TraceStreamer { +class EventParser { +public: + explicit EventParser(TraceDataCache*, const TraceStreamerFilters*); + bool ParseLine(const BytraceLine&) const; + +private: + const TraceStreamerFilters *streamFilters_; + const DataIndex ioWaitId_; + const DataIndex workQueueId_; + const DataIndex schedWakeupId_; + const DataIndex schedBlockedReasonId_; + const DataIndex binderId_; + const uint32_t pointLength_; + const uint32_t maxPointLength_; + const int byHex_; + + using ArgsMap = std::unordered_map; + using FuncCall = std::function; + std::map eventToFunction_ {}; + + bool BinderTransactionEvent(ArgsMap args, const BytraceLine line) const; + bool BinderTransactionReceivedEvent(ArgsMap args, const BytraceLine line) const; + bool BinderLockEvent(ArgsMap args, const BytraceLine line) const; + bool BinderLockedEvent(ArgsMap args, const BytraceLine line) const; + bool BinderUnLockEvent(ArgsMap args, const BytraceLine line) const; + bool BinderTransactionAllocBufEvent(ArgsMap args, const BytraceLine line) const; + bool SchedSwitchEvent(ArgsMap args, const BytraceLine line) const; + bool TaskRenameEvent(ArgsMap args, const BytraceLine line) const; + bool TaskNewtaskEvent(ArgsMap args, const BytraceLine line) const; + bool TracingMarkWriteEvent(ArgsMap args, const BytraceLine line) const; + bool SchedWakeupEvent(ArgsMap args, const BytraceLine line) const; + bool SchedWakingEvent(ArgsMap args, const BytraceLine line) const; + bool CpuIdleEvent(ArgsMap args, const BytraceLine line) const; + bool CpuFrequencyEvent(ArgsMap args, const BytraceLine line) const; + bool WorkqueueExecuteStartEvent(ArgsMap args, const BytraceLine line) const; + bool WorkqueueExecuteEndEvent(ArgsMap args, const BytraceLine line) const; + + void ParsePrintEvent(uint64_t ts, uint32_t pid, std::string_view event) const; + void ParseTracePoint(uint64_t ts, uint32_t pid, TracePoint point) const; + ParseResult GetTracePoint(std::string_view str, TracePoint& out) const; + ParseResult CheckTracePoint(std::string_view pointStr) const; + uint32_t GetThreadGroupId(std::string_view pointStr, size_t& length) const; + std::string_view GetPointNameForBegin(std::string_view pointStr, size_t tGidlength) const; + ParseResult HandlerB(std::string_view pointStr, TracePoint& outPoint, size_t tGidlength) const; + ParseResult HandlerE(void) const; + ParseResult HandlerCSF(std::string_view pointStr, TracePoint& outPoint, size_t tGidlength) const; + size_t GetNameLength(std::string_view pointStr, size_t nameIndex) const; + size_t GetValueLength(std::string_view pointStr, size_t valueIndex) const; +private: + TraceDataCache *traceDataCache_; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // _EVENT_PARSER_H_ diff --git a/trace_analyzer/src/parser/thread_state.cpp b/trace_analyzer/src/parser/thread_state.cpp new file mode 100755 index 000000000..fc6ba028d --- /dev/null +++ b/trace_analyzer/src/parser/thread_state.cpp @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "thread_state.h" + +namespace SysTuning { +namespace TraceStreamer { +Direction ThreadState::SetStatByChar(char ch) +{ + if (ch == 'R') { + if (state_ == 0) { + SetIsRunnable(true); + return NEED_CONTINUE; + } + + SetInvalidChar(true); + return NEED_BREAK; + } + + if (ch == '|') { + return NEED_CONTINUE; + } + + if (statMap_.find(ch) == statMap_.end()) { + return NEED_BREAK; + } + + state_ |= statMap_[ch]; + return NEED_GO; +} + +void ThreadState::ProcessSate(const std::string& stateStr) +{ + for (size_t i = 0; i < stateStr.size(); i++) { + if (state_ & MAXSTAT) { + SetInvalidChar(true); + break; + } else if (stateStr[i] == '+') { + SetStat(MAXSTAT); + continue; + } + + if (isRunnable_) { + SetInvalidChar(true); + break; + } + + Direction ret = SetStatByChar(stateStr[i]); + if (ret == NEED_CONTINUE) { + continue; + } else if (ret == NEED_BREAK) { + SetInvalidChar(true); + break; + } + } +} + +ThreadState::ThreadState(const std::string stateStr) +{ + ProcessSate(stateStr); + + bool noState = ((!isRunnable_) && (state_ == 0)); + if (invalidChar_ || noState || state_ > MAXSTAT) { + SetStatZero(); + } else { + SetStat(VALID); + } +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/parser/thread_state.h b/trace_analyzer/src/parser/thread_state.h new file mode 100644 index 000000000..f2119af0c --- /dev/null +++ b/trace_analyzer/src/parser/thread_state.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BYTRACE_THREAD_STATES_H +#define BYTRACE_THREAD_STATES_H + +#include +#include "common_types.h" +#include "log.h" + +namespace SysTuning { +namespace TraceStreamer { +enum Direction { NEED_GO = 0, NEED_CONTINUE, NEED_BREAK }; + +class ThreadState { +public: + explicit ThreadState(const std::string stateStr); + ~ThreadState() {} + + uint32_t State() const + { + TUNING_ASSERT(state_ & VALID); + return state_ & ~VALID; + } + +private: + uint32_t state_ = 0; + bool invalidChar_ = false; + bool isRunnable_ = false; + std::map statMap_ = { + {'R', RUNNABLE}, + {'S', INTERRUPTABLESLEEP}, + {'D', UNINTERRUPTIBLESLEEP}, + {'T', STOPPED}, + {'t', TRACED}, + {'X', EXITDEAD}, + {'Z', EXITZOMBIE}, + {'x', TASKDEAD}, + {'I', TASKDEAD}, + {'K', WAKEKILL}, + {'P', PARKED}, + {'N', NOLOAD}, + {'|', VALID}, + }; + + void SetStatZero() + { + state_ = 0; + } + void SetStat(Stat value) + { + state_ |= value; + } + void SetInvalidChar(bool value) + { + invalidChar_ = value; + } + void SetIsRunnable(bool value) + { + isRunnable_ = value; + } + + void ProcessSate(const std::string& stateStr); + Direction SetStatByChar(char ch); +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // _BYTRACE_THREAD_STATES_H_ diff --git a/trace_analyzer/src/table/bound_table.cpp b/trace_analyzer/src/table/bound_table.cpp new file mode 100644 index 000000000..90e3b7320 --- /dev/null +++ b/trace_analyzer/src/table/bound_table.cpp @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "bound_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { START_TS = 0, END_TS }; +} +BoundTable::BoundTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("start_ts", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("end_ts", "INT")); + tablePriKey_.push_back("start_ts"); +} + +BoundTable::~BoundTable() {} + +void BoundTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +BoundTable::Cursor::Cursor(const TraceDataCache* dataCache) : TableBase::Cursor(dataCache, 0, 1) {} + +BoundTable::Cursor::~Cursor() {} + +int BoundTable::Cursor::Column(int column) const +{ + switch (column) { + case START_TS: + sqlite3_result_int64(context_, static_cast(dataCache_->BoundStartTime())); + break; + case END_TS: + sqlite3_result_int64(context_, static_cast(dataCache_->BoundEndTime())); + break; + default: + TUNING_LOGF("Unregistered column : %d", column); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/bound_table.h b/trace_analyzer/src/table/bound_table.h new file mode 100644 index 000000000..ab3da9da5 --- /dev/null +++ b/trace_analyzer/src/table/bound_table.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BOUND_TABLE_H +#define BOUND_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class BoundTable : public TableBase { +public: + explicit BoundTable(const TraceDataCache*); + ~BoundTable() override; + void CreateCursor() override; +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // BOUND_TABLE_H diff --git a/trace_analyzer/src/table/cpu_measure_filter_table.cpp b/trace_analyzer/src/table/cpu_measure_filter_table.cpp new file mode 100755 index 000000000..7cf1a940e --- /dev/null +++ b/trace_analyzer/src/table/cpu_measure_filter_table.cpp @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "cpu_measure_filter_table.h" +#include "log.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { ID = 0, TYPE, NAME, UNIT, CPU }; +} +CpuMeasureFilterTable::CpuMeasureFilterTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("id", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("type", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("name", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("unit", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("cpu", "UNSIGNED INT")); + tablePriKey_.push_back("id"); +} + +CpuMeasureFilterTable::~CpuMeasureFilterTable() {} + +void CpuMeasureFilterTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +CpuMeasureFilterTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->GetConstCpuCounterData().Size())), + cpuCounterObj_(dataCache->GetConstCpuCounterData()) +{ +} + +CpuMeasureFilterTable::Cursor::~Cursor() {} + +int CpuMeasureFilterTable::Cursor::Column(int column) const +{ + switch (column) { + case ID: + sqlite3_result_int64(context_, static_cast(cpuCounterObj_.IdsData()[CurrentRow()])); + break; + case TYPE: + sqlite3_result_text(context_, "cpu_counter_track", STR_DEFAULT_LEN, nullptr); + break; + case NAME: { + const std::string& str = + dataCache_->GetDataFromDict(static_cast(cpuCounterObj_.NameData()[CurrentRow()])); + sqlite3_result_text(context_, str.c_str(), STR_DEFAULT_LEN, nullptr); + break; + } + case UNIT: + sqlite3_result_int64(context_, static_cast(cpuCounterObj_.UnitData()[CurrentRow()])); + break; + case CPU: + sqlite3_result_int64(context_, static_cast(cpuCounterObj_.CpuData()[CurrentRow()])); + break; + default: + TUNING_LOGF("Unregistered column : %d", column); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/cpu_measure_filter_table.h b/trace_analyzer/src/table/cpu_measure_filter_table.h new file mode 100755 index 000000000..95956209e --- /dev/null +++ b/trace_analyzer/src/table/cpu_measure_filter_table.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CPU_MEASURE_FILTER_TABLE_H +#define CPU_MEASURE_FILTER_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class CpuMeasureFilterTable : public TableBase { +public: + explicit CpuMeasureFilterTable(const TraceDataCache*); + ~CpuMeasureFilterTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + + private: + const CpuCounter& cpuCounterObj_; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // CPU_MEASURE_FILTER_TABLE_H diff --git a/trace_analyzer/src/table/data_dict_table.cpp b/trace_analyzer/src/table/data_dict_table.cpp new file mode 100644 index 000000000..f9eed5301 --- /dev/null +++ b/trace_analyzer/src/table/data_dict_table.cpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "data_dict_table.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { ID = 0, STR }; +} +DataDictTable::DataDictTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("id", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("data", "STRING")); + tablePriKey_.push_back("id"); +} + +DataDictTable::~DataDictTable() {} + +void DataDictTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +DataDictTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->DataDictSize())) +{ +} + +DataDictTable::Cursor::~Cursor() {} + +int DataDictTable::Cursor::Column(int col) const +{ + DataIndex index = static_cast(CurrentRow()); + switch (col) { + case ID: + sqlite3_result_int64(context_, static_cast(CurrentRow())); + break; + case STR: + sqlite3_result_text(context_, dataCache_->GetDataFromDict(index).c_str(), STR_DEFAULT_LEN, nullptr); + break; + default: + TUNING_LOGF("Unknown column %d", col); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/data_dict_table.h b/trace_analyzer/src/table/data_dict_table.h new file mode 100644 index 000000000..afbc8dfd5 --- /dev/null +++ b/trace_analyzer/src/table/data_dict_table.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef DATA_DICT_TABLE_H +#define DATA_DICT_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class DataDictTable : public TableBase { +public: + explicit DataDictTable(const TraceDataCache*); + ~DataDictTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // DATA_DICT_TABLE_H diff --git a/trace_analyzer/src/table/filter_table.cpp b/trace_analyzer/src/table/filter_table.cpp new file mode 100644 index 000000000..98c612bcc --- /dev/null +++ b/trace_analyzer/src/table/filter_table.cpp @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "filter_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { ID = 0, TYPE, NAME, SOURCE_ARG_SET_ID }; +} +FilterTable::FilterTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("id", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("type", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("name", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("source_arg_set_id", "UNSIGNED INT")); + tablePriKey_.push_back("id"); +} + +FilterTable::~FilterTable() {} + +void FilterTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +FilterTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->GetConstFilterData().Size())), + filterObj_(dataCache->GetConstFilterData()) +{ +} + +FilterTable::Cursor::~Cursor() {} + +int FilterTable::Cursor::Column(int column) const +{ + switch (column) { + case ID: + sqlite3_result_int64(context_, static_cast(filterObj_.IdsData()[CurrentRow()])); + break; + case TYPE: + sqlite3_result_text(context_, filterObj_.TypeData()[CurrentRow()].c_str(), STR_DEFAULT_LEN, nullptr); + break; + case NAME: + sqlite3_result_text(context_, filterObj_.NameData()[CurrentRow()].c_str(), STR_DEFAULT_LEN, nullptr); + break; + case SOURCE_ARG_SET_ID: + sqlite3_result_int64(context_, static_cast(filterObj_.SourceArgSetIdData()[CurrentRow()])); + break; + default: + TUNING_LOGF("Unregistered column : %d", column); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/filter_table.h b/trace_analyzer/src/table/filter_table.h new file mode 100755 index 000000000..7f3e30027 --- /dev/null +++ b/trace_analyzer/src/table/filter_table.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FILTER_TABLE_H +#define FILTER_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class FilterTable : public TableBase { +public: + enum Column { ID = 0, TYPE = 1, NAME = 2, ARG_ID = 3 }; + explicit FilterTable(const TraceDataCache* storage); + ~FilterTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + + private: + const Filter& filterObj_; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // FILTER_TABLE_H diff --git a/trace_analyzer/src/table/instants_table.cpp b/trace_analyzer/src/table/instants_table.cpp new file mode 100644 index 000000000..e54c8c015 --- /dev/null +++ b/trace_analyzer/src/table/instants_table.cpp @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "instants_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { TS = 0, NAME, REF, REF_TYPE }; +} +InstantsTable::InstantsTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("ts", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("name", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("ref", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("ref_type", "STRING")); + tablePriKey_.push_back("ts"); + tablePriKey_.push_back("ref"); +} + +InstantsTable::~InstantsTable() {} + +void InstantsTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +InstantsTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->GetConstInstantsData().Size())), + InstantsObj_(dataCache->GetConstInstantsData()) +{ +} + +InstantsTable::Cursor::~Cursor() {} + +int InstantsTable::Cursor::Column(int column) const +{ + size_t stringIdentity = static_cast(InstantsObj_.NameIndexsData()[CurrentRow()]); + switch (column) { + case TS: + sqlite3_result_int64(context_, static_cast(InstantsObj_.TimeStamData()[CurrentRow()])); + break; + case NAME: { + sqlite3_result_text(context_, dataCache_->GetDataFromDict(stringIdentity).c_str(), + STR_DEFAULT_LEN, nullptr); + break; + } + case REF: + sqlite3_result_int64(context_, static_cast(InstantsObj_.InternalTidsData()[CurrentRow()])); + break; + case REF_TYPE: { + sqlite3_result_text(context_, "utid", STR_DEFAULT_LEN, nullptr); + break; + } + default: + TUNING_LOGF("Unregistered column : %d", column); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/instants_table.h b/trace_analyzer/src/table/instants_table.h new file mode 100644 index 000000000..6048828d8 --- /dev/null +++ b/trace_analyzer/src/table/instants_table.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INSTANTS_TABLE_H +#define INSTANTS_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class InstantsTable : public TableBase { +public: + explicit InstantsTable(const TraceDataCache*); + ~InstantsTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + + private: + const Instants& InstantsObj_; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // INSTANTS_TABLE_H diff --git a/trace_analyzer/src/table/internal_slice_table.cpp b/trace_analyzer/src/table/internal_slice_table.cpp new file mode 100644 index 000000000..fa059ce4d --- /dev/null +++ b/trace_analyzer/src/table/internal_slice_table.cpp @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "internal_slice_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { ID = 0, TS, DUR, INTERNAL_TID, FILTER_ID, CAT, NAME, DEPTH, STACK_ID, PARENT_STACK_ID, PARENT_ID }; +} +InternalSliceTable::InternalSliceTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("id", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("ts", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("dur", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("utid", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("track_id", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("cat", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("name", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("depth", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("stack_id", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("parent_stack_id", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("parent_id", "UNSIGNED INT")); + tablePriKey_.push_back("utid"); + tablePriKey_.push_back("ts"); + tablePriKey_.push_back("depth"); +} + +InternalSliceTable::~InternalSliceTable() {} + +void InternalSliceTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +InternalSliceTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->GetConstInternalSlicesData().Size())), + slicesObj_(dataCache->GetConstInternalSlicesData()) +{ +} + +InternalSliceTable::Cursor::~Cursor() {} + +int InternalSliceTable::Cursor::Column(int column) const +{ + switch (column) { + case ID: + sqlite3_result_int64(context_, CurrentRow()); + break; + case TS: + sqlite3_result_int64(context_, static_cast(slicesObj_.TimeStamData()[CurrentRow()])); + break; + case DUR: + sqlite3_result_int64(context_, static_cast(slicesObj_.DursData()[CurrentRow()])); + break; + case INTERNAL_TID: + sqlite3_result_int64(context_, static_cast(slicesObj_.InternalTidsData()[CurrentRow()])); + break; + case FILTER_ID: + sqlite3_result_int64(context_, static_cast(slicesObj_.FilterIdData()[CurrentRow()])); + break; + case CAT: { + size_t stringIdentity = static_cast(slicesObj_.CatsData()[CurrentRow()]); + sqlite3_result_text(context_, dataCache_->GetDataFromDict(stringIdentity).c_str(), + STR_DEFAULT_LEN, nullptr); + break; + } + case NAME: { + size_t stringIdentity = static_cast(slicesObj_.NamesData()[CurrentRow()]); + sqlite3_result_text(context_, dataCache_->GetDataFromDict(stringIdentity).c_str(), + STR_DEFAULT_LEN, nullptr); + break; + } + case DEPTH: + sqlite3_result_int64(context_, static_cast(slicesObj_.Depths()[CurrentRow()])); + break; + case STACK_ID: + sqlite3_result_int64(context_, static_cast(slicesObj_.StackIdsData()[CurrentRow()])); + break; + case PARENT_STACK_ID: + sqlite3_result_int64(context_, static_cast(slicesObj_.ParentStackIds()[CurrentRow()])); + break; + case PARENT_ID: { + if (slicesObj_.ParentIdData()[CurrentRow()].has_value()) { + sqlite3_result_int64(context_, static_cast(slicesObj_.ParentIdData()[CurrentRow()].value())); + } + break; + } + default: + TUNING_LOGF("Unregistered column : %d", column); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/internal_slice_table.h b/trace_analyzer/src/table/internal_slice_table.h new file mode 100755 index 000000000..ae0c208e8 --- /dev/null +++ b/trace_analyzer/src/table/internal_slice_table.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INTERNAL_SLICE_TABLE_H +#define INTERNAL_SLICE_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class InternalSliceTable : public TableBase { +public: + explicit InternalSliceTable(const TraceDataCache*); + ~InternalSliceTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + + private: + const InternalSlices& slicesObj_; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // INTERNAL_SLICE_TABLE_H diff --git a/trace_analyzer/src/table/internal_thread.cpp b/trace_analyzer/src/table/internal_thread.cpp new file mode 100644 index 000000000..766c5df53 --- /dev/null +++ b/trace_analyzer/src/table/internal_thread.cpp @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "internal_thread.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { ID = 0, TYPE, TID, NAME, START_TS, END_TS, INTERNAL_PID, IS_MAIN_THREAD }; +} +InternalThread::InternalThread(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("id", "INT")); + tableColumn_.push_back(TableBase::ColumnInfo("type", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("tid", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("name", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("start_ts", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("end_ts", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("upid", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("is_main_thread", "UNSIGNED INT")); + tablePriKey_.push_back("id"); +} + +InternalThread::~InternalThread() {} + +void InternalThread::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +InternalThread::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->ThreadSize())) +{ +} + +InternalThread::Cursor::~Cursor() {} + +int InternalThread::Cursor::Column(int column) const +{ + switch (column) { + case ID: { + sqlite3_result_int64(context_, CurrentRow()); + break; + } + case TYPE: { + sqlite3_result_text(context_, "internal_thread", strlen("internal_thread"), nullptr); + break; + } + case TID: { + const auto& process = dataCache_->GetConstThreadData(CurrentRow()); + sqlite3_result_int64(context_, static_cast(process.tid_)); + break; + } + case NAME: { + const auto& thread = dataCache_->GetConstThreadData(CurrentRow()); + const auto& name = dataCache_->GetDataFromDict(thread.nameIndex_); + sqlite3_result_text(context_, name.c_str(), static_cast(name.length()), nullptr); + break; + } + case START_TS: { + const auto& thread = dataCache_->GetConstThreadData(CurrentRow()); + sqlite3_result_int64(context_, static_cast(thread.startT_)); + break; + } + case END_TS: { + const auto& thread = dataCache_->GetConstThreadData(CurrentRow()); + sqlite3_result_int64(context_, static_cast(thread.endT_)); + break; + } + case INTERNAL_PID: { + const auto& thread = dataCache_->GetConstThreadData(CurrentRow()); + sqlite3_result_int(context_, static_cast(thread.internalPid_)); + break; + } + case IS_MAIN_THREAD: { + const auto& thread = dataCache_->GetConstThreadData(CurrentRow()); + const auto& process = dataCache_->GetConstProcessData(thread.internalPid_); + sqlite3_result_int(context_, thread.tid_ == process.pid_); + break; + } + default: + TUNING_LOGF("Unregistered column : %d", column); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/internal_thread.h b/trace_analyzer/src/table/internal_thread.h new file mode 100644 index 000000000..9729e25a4 --- /dev/null +++ b/trace_analyzer/src/table/internal_thread.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SRC_INTERNAL_THREAD_H +#define SRC_INTERNAL_THREAD_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class InternalThread : public TableBase { +public: + explicit InternalThread(const TraceDataCache*); + ~InternalThread() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // _INTERNAL_THREAD_H_ diff --git a/trace_analyzer/src/table/measure_filter_table.cpp b/trace_analyzer/src/table/measure_filter_table.cpp new file mode 100644 index 000000000..29a944f3b --- /dev/null +++ b/trace_analyzer/src/table/measure_filter_table.cpp @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "measure_filter_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { ID = 0, TYPE, NAME, INTERNAL_TID }; +} +MeasureFilterTable::MeasureFilterTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("id", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("type", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("name", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("utid", "UNSIGNED INT")); + tablePriKey_.push_back("id"); +} + +MeasureFilterTable::~MeasureFilterTable() {} + +void MeasureFilterTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +MeasureFilterTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->ThreadCounterFilterData()->Size())) +{ +} + +MeasureFilterTable::Cursor::~Cursor() {} + +int MeasureFilterTable::Cursor::Column(int column) const +{ + switch (column) { + case ID: + sqlite3_result_int64(context_, + static_cast(dataCache_->ThreadCounterFilterData()->FilterIdData()[CurrentRow()])); + break; + case TYPE: + sqlite3_result_text(context_, "thread_counter_track", STR_DEFAULT_LEN, nullptr); + break; + case NAME: { + const std::string& str = + dataCache_->GetDataFromDict(dataCache_->ThreadCounterFilterData()->NameIndexData()[CurrentRow()]); + sqlite3_result_text(context_, str.c_str(), STR_DEFAULT_LEN, nullptr); + break; + } + case INTERNAL_TID: + sqlite3_result_int64(context_, + static_cast(dataCache_->ThreadCounterFilterData()->InternalTidData()[CurrentRow()])); + break; + default: + TUNING_LOGF("Unregistered column : %d", column); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/measure_filter_table.h b/trace_analyzer/src/table/measure_filter_table.h new file mode 100644 index 000000000..39df53ce3 --- /dev/null +++ b/trace_analyzer/src/table/measure_filter_table.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef THREAD_MEASURE_FILTER_H +#define THREAD_MEASURE_FILTER_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class MeasureFilterTable : public TableBase { +public: + explicit MeasureFilterTable(const TraceDataCache*); + ~MeasureFilterTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // THREAD_MEASURE_FILTER_H diff --git a/trace_analyzer/src/table/measure_table.cpp b/trace_analyzer/src/table/measure_table.cpp new file mode 100644 index 000000000..24b4c5c46 --- /dev/null +++ b/trace_analyzer/src/table/measure_table.cpp @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "measure_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { TYPE = 0, TS, VALUE, FILTER_ID }; +} +MeasureTable::MeasureTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("type", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("ts", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("value", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("track_id", "UNSIGNED INT")); + tablePriKey_.push_back("ts"); + tablePriKey_.push_back("track_id"); +} + +MeasureTable::~MeasureTable() {} + +void MeasureTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +MeasureTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->GetConstCounterData().Size())), + counterObj(dataCache->GetConstCounterData()) +{ +} + +MeasureTable::Cursor::~Cursor() {} + +int MeasureTable::Cursor::Column(int column) const +{ + switch (column) { + case TYPE: + sqlite3_result_text(context_, "counter", STR_DEFAULT_LEN, nullptr); + break; + case TS: + sqlite3_result_int64(context_, static_cast(counterObj.TimeStamData()[CurrentRow()])); + break; + case VALUE: + sqlite3_result_int64(context_, static_cast(counterObj.ValuesData()[CurrentRow()])); + break; + case FILTER_ID: + sqlite3_result_int64(context_, static_cast(counterObj.FilterIdData()[CurrentRow()])); + break; + default: + TUNING_LOGF("Unregistered column : %d", column); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/measure_table.h b/trace_analyzer/src/table/measure_table.h new file mode 100644 index 000000000..3b3f604fb --- /dev/null +++ b/trace_analyzer/src/table/measure_table.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MEASURE_TABLE_H +#define MEASURE_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class MeasureTable : public TableBase { +public: + explicit MeasureTable(const TraceDataCache*); + ~MeasureTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + + private: + const Counter& counterObj; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // MEASURE_TABLE_H diff --git a/trace_analyzer/src/table/process_filter_table.cpp b/trace_analyzer/src/table/process_filter_table.cpp new file mode 100644 index 000000000..9dd03efa0 --- /dev/null +++ b/trace_analyzer/src/table/process_filter_table.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "process_filter_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { ID = 0, TYPE, NAME, INTERNAL_PID}; +} +ProcessFilterTable::ProcessFilterTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("id", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("type", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("name", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("upid", "UNSIGNED INT")); + tablePriKey_.push_back("id"); +} + +ProcessFilterTable::~ProcessFilterTable() {} + +void ProcessFilterTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +ProcessFilterTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->GetConstProcessFilterData().Size())), + processFilterObj_(dataCache->GetConstProcessFilterData()) +{ +} + +ProcessFilterTable::Cursor::~Cursor() {} + +int ProcessFilterTable::Cursor::Column(int col) const +{ + switch (col) { + case ID: + sqlite3_result_int64(context_, static_cast(processFilterObj_.IdsData()[CurrentRow()])); + break; + case TYPE: + sqlite3_result_text(context_, "process_track", STR_DEFAULT_LEN, nullptr); + break; + case NAME: { + DataIndex stringIdentity = static_cast(processFilterObj_.NamesData()[CurrentRow()]); + sqlite3_result_text(context_, dataCache_->GetDataFromDict(stringIdentity).c_str(), + STR_DEFAULT_LEN, nullptr); + break; + } + case INTERNAL_PID: + sqlite3_result_int64(context_, static_cast(processFilterObj_.UpidsData()[CurrentRow()])); + break; + default: + TUNING_LOGF("Unregistered column : %d", col); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/process_filter_table.h b/trace_analyzer/src/table/process_filter_table.h new file mode 100644 index 000000000..a898b61fc --- /dev/null +++ b/trace_analyzer/src/table/process_filter_table.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PROCESS_FILTER_TABLE_H +#define PROCESS_FILTER_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" +#include "trace_streamer_filters.h" + +namespace SysTuning { +namespace TraceStreamer { +class ProcessFilterTable : public TableBase { +public: + explicit ProcessFilterTable(const TraceDataCache*); + ~ProcessFilterTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + + private: + const ProcessCounterFilter& processFilterObj_; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // PROCESS_FILTER_TABLE_H diff --git a/trace_analyzer/src/table/process_measure_filter_table.cpp b/trace_analyzer/src/table/process_measure_filter_table.cpp new file mode 100644 index 000000000..56f4f0ba3 --- /dev/null +++ b/trace_analyzer/src/table/process_measure_filter_table.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "process_measure_filter_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { ID = 0, TYPE, NAME, INTERNAL_PID }; +} +ProcessMeasureFilterTable::ProcessMeasureFilterTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("id", "INT")); + tableColumn_.push_back(TableBase::ColumnInfo("type", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("name", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("upid", "INT")); + tablePriKey_.push_back("id"); +} + +ProcessMeasureFilterTable::~ProcessMeasureFilterTable() {} + +void ProcessMeasureFilterTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +ProcessMeasureFilterTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->ProcessCounterFilterData().Size())) +{ +} + +ProcessMeasureFilterTable::Cursor::~Cursor() {} + +int ProcessMeasureFilterTable::Cursor::Column(int col) const +{ + switch (col) { + case ID: + sqlite3_result_int64(context_, + static_cast(dataCache_->ProcessCounterFilterData().IdsData()[CurrentRow()])); + break; + case TYPE: + sqlite3_result_text(context_, "process_counter_track", STR_DEFAULT_LEN, nullptr); + break; + case NAME: { + size_t strId = static_cast(dataCache_->ProcessCounterFilterData().NamesData()[CurrentRow()]); + sqlite3_result_text(context_, dataCache_->GetDataFromDict(strId).c_str(), STR_DEFAULT_LEN, nullptr); + break; + } + case INTERNAL_PID: + sqlite3_result_int64(context_, + static_cast(dataCache_->ProcessCounterFilterData().UpidsData()[CurrentRow()])); + break; + default: + TUNING_LOGF("Unregistered column : %d", col); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/process_measure_filter_table.h b/trace_analyzer/src/table/process_measure_filter_table.h new file mode 100644 index 000000000..3ebe61ec5 --- /dev/null +++ b/trace_analyzer/src/table/process_measure_filter_table.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SRC_PROCESS_MEASURE_FILTER_TABLE_H +#define SRC_PROCESS_MEASURE_FILTER_TABLE_H + + +#include "table_base.h" +#include "trace_data_cache.h" +#include "trace_streamer_filters.h" + +namespace SysTuning { +namespace TraceStreamer { +class ProcessMeasureFilterTable : public TableBase { +public: + explicit ProcessMeasureFilterTable(const TraceDataCache*); + ~ProcessMeasureFilterTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // SRC_PROCESS_MEASURE_FILTER_TABLE_H diff --git a/trace_analyzer/src/table/process_table.cpp b/trace_analyzer/src/table/process_table.cpp new file mode 100644 index 000000000..73c19bcc9 --- /dev/null +++ b/trace_analyzer/src/table/process_table.cpp @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "process_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { ID = 0, TYPE, PID, NAME, START_TS, END_TS, PARENT_ID, UID, APP_ID }; +} +ProcessTable::ProcessTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("id", "INT")); + tableColumn_.push_back(TableBase::ColumnInfo("type", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("pid", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("name", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("start_ts", "UNSIGNED INT")); + tablePriKey_.push_back("id"); +} + +ProcessTable::~ProcessTable() {} + +void ProcessTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +ProcessTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->ProcessSize())) +{ +} + +ProcessTable::Cursor::~Cursor() {} + +int ProcessTable::Cursor::Column(int column) const +{ + const auto& process = dataCache_->GetConstProcessData(CurrentRow()); + switch (column) { + case ID: + sqlite3_result_int64(context_, CurrentRow()); + break; + case TYPE: + sqlite3_result_text(context_, "internal_process", STR_DEFAULT_LEN, nullptr); + break; + case PID: + sqlite3_result_int64(context_, process.pid_); + break; + case NAME: + sqlite3_result_text(context_, process.cmdLine_.c_str(), + static_cast(process.cmdLine_.length()), nullptr); + break; + case START_TS: + sqlite3_result_int64(context_, static_cast(process.startT_)); + break; + default: + TUNING_LOGF("Unregistered column : %d", column); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/process_table.h b/trace_analyzer/src/table/process_table.h new file mode 100644 index 000000000..bc0d9b056 --- /dev/null +++ b/trace_analyzer/src/table/process_table.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PROCESS_TABLE_H +#define PROCESS_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class ProcessTable : public TableBase { +public: + explicit ProcessTable(const TraceDataCache*); + ~ProcessTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // PROCESS_TABLE_H diff --git a/trace_analyzer/src/table/raw_table.cpp b/trace_analyzer/src/table/raw_table.cpp new file mode 100644 index 000000000..8c20f7134 --- /dev/null +++ b/trace_analyzer/src/table/raw_table.cpp @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "raw_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { ID = 0, TYPE, TS, NAME, CPU, INTERNAL_TID }; +} +RawTable::RawTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("id", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("type", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("ts", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("name", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("cpu", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("utid", "UNSIGNED INT")); + tablePriKey_.push_back("id"); +} + +RawTable::~RawTable() {} + +void RawTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +RawTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->GetConstRawTableData().Size())), + rawObj_(dataCache->GetConstRawTableData()) +{ +} + +RawTable::Cursor::~Cursor() {} + +int RawTable::Cursor::Column(int column) const +{ + switch (column) { + case ID: + sqlite3_result_int64(context_, static_cast(CurrentRow())); + break; + case TYPE: + sqlite3_result_text(context_, "raw", STR_DEFAULT_LEN, nullptr); + break; + case TS: + sqlite3_result_int64(context_, static_cast(rawObj_.TimeStamData()[CurrentRow()])); + break; + case NAME: { + if (rawObj_.NameData()[CurrentRow()] == CPU_IDLE) { + sqlite3_result_text(context_, "cpu_idle", STR_DEFAULT_LEN, nullptr); + } else if (rawObj_.NameData()[CurrentRow()] == SCHED_WAKEUP) { + sqlite3_result_text(context_, "sched_wakeup", STR_DEFAULT_LEN, nullptr); + } else { + sqlite3_result_text(context_, "sched_waking", STR_DEFAULT_LEN, nullptr); + } + break; + } + case CPU: + sqlite3_result_int64(context_, static_cast(rawObj_.CpuData()[CurrentRow()])); + break; + case INTERNAL_TID: + sqlite3_result_int64(context_, static_cast(rawObj_.InternalTidData()[CurrentRow()])); + break; + default: + TUNING_LOGF("Unregistered column : %d", column); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/raw_table.h b/trace_analyzer/src/table/raw_table.h new file mode 100644 index 000000000..fbb60affd --- /dev/null +++ b/trace_analyzer/src/table/raw_table.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef RAW_TABLE_H +#define RAW_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class RawTable : public TableBase { +public: + enum EventName : uint32_t { CPU_IDLE = 1, SCHED_WAKEUP = 2, SCHED_WAKING = 3 }; + explicit RawTable(const TraceDataCache*); + ~RawTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + + private: + const Raw& rawObj_; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // RAW_TABLE_H diff --git a/trace_analyzer/src/table/sched_slice_table.cpp b/trace_analyzer/src/table/sched_slice_table.cpp new file mode 100644 index 000000000..9ce0f9837 --- /dev/null +++ b/trace_analyzer/src/table/sched_slice_table.cpp @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "sched_slice_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { ID = 0, TYPE, TS, DUR, CPU, INTERNAL_TID, END_STATE, PRIORITY }; +} +SchedSliceTable::SchedSliceTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("id", "INT")); + tableColumn_.push_back(TableBase::ColumnInfo("type", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("ts", "INT")); + tableColumn_.push_back(TableBase::ColumnInfo("dur", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("cpu", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("utid", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("end_state", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("priority", "INT")); + tablePriKey_.push_back("id"); +} + +SchedSliceTable::~SchedSliceTable() {} + +void SchedSliceTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +SchedSliceTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->GetConstSchedSliceData().Size())), + schedSliceObj_(dataCache->GetConstSchedSliceData()) +{ +} + +SchedSliceTable::Cursor::~Cursor() {} + +int SchedSliceTable::Cursor::Column(int col) const +{ + switch (col) { + case ID: + sqlite3_result_int64(context_, static_cast(CurrentRow())); + break; + case TYPE: + sqlite3_result_text(context_, "sched_slice", STR_DEFAULT_LEN, nullptr); + break; + case TS: + sqlite3_result_int64(context_, static_cast(schedSliceObj_.TimeStamData()[CurrentRow()])); + break; + case DUR: + sqlite3_result_int64(context_, static_cast(schedSliceObj_.DursData()[CurrentRow()])); + break; + case CPU: + sqlite3_result_int64(context_, static_cast(schedSliceObj_.CpusData()[CurrentRow()])); + break; + case INTERNAL_TID: + sqlite3_result_int64(context_, static_cast(schedSliceObj_.InternalTidsData()[CurrentRow()])); + break; + case END_STATE: { + const std::string& str = dataCache_->GetConstSchedStateData(schedSliceObj_.EndStatesData()[CurrentRow()]); + sqlite3_result_text(context_, str.c_str(), STR_DEFAULT_LEN, nullptr); + break; + } + case PRIORITY: + sqlite3_result_int64(context_, static_cast(schedSliceObj_.PriorityData()[CurrentRow()])); + break; + default: + TUNING_LOGF("Unregistered column : %d", col); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/sched_slice_table.h b/trace_analyzer/src/table/sched_slice_table.h new file mode 100644 index 000000000..2a36050e0 --- /dev/null +++ b/trace_analyzer/src/table/sched_slice_table.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SCHED_SLICE_TABLE_H +#define SCHED_SLICE_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class SchedSliceTable : public TableBase { +public: + explicit SchedSliceTable(const TraceDataCache*); + ~SchedSliceTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + + private: + const SchedSlice& schedSliceObj_; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // SCHED_SLICE_TABLE_H diff --git a/trace_analyzer/src/table/table_base.cpp b/trace_analyzer/src/table/table_base.cpp new file mode 100755 index 000000000..c6e44e9bd --- /dev/null +++ b/trace_analyzer/src/table/table_base.cpp @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "table_base.h" +#include +#include +#include "log.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +struct TableContext { + TabTemplate tmplate; + const TraceDataCache* dataCache; + sqlite3_module module; +}; +} // namespace + +TableBase::~TableBase() = default; + +void TableBase::TableRegister(sqlite3& db, const TraceDataCache* cache, + const std::string& tableName, TabTemplate tmplate) +{ + std::unique_ptr context(std::make_unique()); + context->dataCache = cache; + context->tmplate = tmplate; + sqlite3_module& module = context->module; + + auto createFn = [](sqlite3* xdb, void* arg, int, const char* const*, sqlite3_vtab** tab, char**) { + auto xdesc = static_cast(arg); + auto table = xdesc->tmplate(xdesc->dataCache); + std::string createStmt = table->CreateTableSql(); + int res = sqlite3_declare_vtab(xdb, createStmt.c_str()); + if (res != SQLITE_OK) { + return res; + } + *tab = table.release(); + return SQLITE_OK; + }; + + auto destroyFn = [](sqlite3_vtab* t) { + delete static_cast(t); + return SQLITE_OK; + }; + + module.xCreate = createFn; + module.xConnect = createFn; + module.xBestIndex = [](sqlite3_vtab*, sqlite3_index_info*) { + return SQLITE_OK; + }; + module.xDisconnect = destroyFn; + module.xDestroy = destroyFn; + module.xOpen = [](sqlite3_vtab* t, sqlite3_vtab_cursor** c) { + return (static_cast(t))->Open(c); + }; + module.xClose = [](sqlite3_vtab_cursor*) { + return SQLITE_OK; + }; + module.xFilter = [](sqlite3_vtab_cursor*, int, const char*, int, sqlite3_value**) { + return SQLITE_OK; + }; + module.xNext = [](sqlite3_vtab_cursor* c) { + return static_cast(c)->Next(); + }; + module.xEof = [](sqlite3_vtab_cursor* c) { + return static_cast(c)->Eof(); + }; + module.xColumn = [](sqlite3_vtab_cursor* c, sqlite3_context* a, int b) { + static_cast(c)->context_ = a; + return static_cast(c)->Column(b); + }; + + sqlite3_create_module_v2(&db, tableName.c_str(), &module, context.release(), + [](void* arg) { delete static_cast(arg); }); +} + +std::string TableBase::CreateTableSql() const +{ + std::string stmt = "CREATE TABLE x("; + for (const auto& col : tableColumn_) { + stmt += " " + col.name_ + " " + col.type_; + stmt += ","; + } + stmt += " PRIMARY KEY("; + for (size_t i = 0; i < tablePriKey_.size(); i++) { + if (i != 0) + stmt += ", "; + stmt += tablePriKey_.at(i); + } + stmt += ")) WITHOUT ROWID;"; + return stmt; +} + +int TableBase::Open(sqlite3_vtab_cursor** ppCursor) +{ + CreateCursor(); + *ppCursor = static_cast(cursor_.get()); + return SQLITE_OK; +} + +TableBase::Cursor::Cursor(const TraceDataCache* dataCache, uint32_t row, uint32_t totalRows) + : context_(nullptr), dataCache_(dataCache), currentRow_(row), rowsTotalNum_(totalRows) +{ +} + +TableBase::Cursor::~Cursor() +{ + context_ = nullptr; +} + +int TableBase::Cursor::Next() +{ + currentRow_++; + return SQLITE_OK; +} + +int TableBase::Cursor::Eof() +{ + return currentRow_ >= rowsTotalNum_; +} + +uint32_t TableBase::Cursor::CurrentRow() const +{ + return currentRow_; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/table_base.h b/trace_analyzer/src/table/table_base.h new file mode 100755 index 000000000..a5949ee0e --- /dev/null +++ b/trace_analyzer/src/table/table_base.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TABLE_H +#define TABLE_H + +#include +#include +#include +#include +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class TableBase; +constexpr int STR_DEFAULT_LEN = -1; +using TabTemplate = std::unique_ptr(*)(const TraceDataCache*); +class TableBase : public sqlite3_vtab { +public: + virtual ~TableBase(); + TableBase(const TableBase&) = delete; + TableBase& operator=(const TableBase&) = delete; + + template + static void TableDeclare(sqlite3& db, TraceDataCache* dataCache, const std::string& name) + { + TableRegister(db, dataCache, name, + [](const TraceDataCache* cache) { + return std::unique_ptr(std::make_unique(cache)); + }); + dataCache->AppendNewTable(name); + } + + std::string CreateTableSql() const; + + class Cursor : public sqlite3_vtab_cursor { + public: + Cursor(const TraceDataCache*, uint32_t, uint32_t); + virtual ~Cursor(); + virtual int Next(); + virtual int Eof(); + virtual int Column(int) const = 0; + sqlite3_context* context_; + protected: + uint32_t CurrentRow() const; + const TraceDataCache* dataCache_; + private: + uint32_t currentRow_; + uint32_t rowsTotalNum_; + }; + + struct ColumnInfo { + ColumnInfo(const std::string& name, const std::string& type) : name_(name), type_(type) {} + std::string name_; + std::string type_; + }; + +protected: + explicit TableBase(const TraceDataCache* dataCache) : dataCache_(dataCache), cursor_(nullptr) {} + virtual void CreateCursor() = 0; + std::vector tableColumn_ {}; + std::vector tablePriKey_ {}; + const TraceDataCache* dataCache_; + std::unique_ptr cursor_; +private: + static void TableRegister(sqlite3& db, const TraceDataCache*, const std::string& name, TabTemplate); + int Open(sqlite3_vtab_cursor**); +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // TABLE_H diff --git a/trace_analyzer/src/table/thread_filter_table.cpp b/trace_analyzer/src/table/thread_filter_table.cpp new file mode 100644 index 000000000..12da1dc67 --- /dev/null +++ b/trace_analyzer/src/table/thread_filter_table.cpp @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "thread_filter_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { ID = 0, TYPE, NAME, INTERNAL_TID }; +} +ThreadFilterTable::ThreadFilterTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("id", "UNSIGNED INT")); + tableColumn_.push_back(TableBase::ColumnInfo("type", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("name", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("utid", "UNSIGNED INT")); + tablePriKey_.push_back("id"); +} + +ThreadFilterTable::~ThreadFilterTable() {} + +void ThreadFilterTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +ThreadFilterTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->GetConstThreadFilterData().Size())) +{ +} + +ThreadFilterTable::Cursor::~Cursor() {} + +int ThreadFilterTable::Cursor::Column(int column) const +{ + switch (column) { + case ID: + sqlite3_result_int64(context_, + static_cast(dataCache_->GetConstThreadFilterData().FilterIdData()[CurrentRow()])); + break; + case TYPE: + sqlite3_result_text(context_, "thread_track", STR_DEFAULT_LEN, nullptr); + break; + case NAME: { + std::string str = + dataCache_->GetDataFromDict(dataCache_->GetConstThreadFilterData().NameIndexData()[CurrentRow()]); + sqlite3_result_text(context_, str.c_str(), STR_DEFAULT_LEN, nullptr); + break; + } + case INTERNAL_TID: + sqlite3_result_int64(context_, + static_cast(dataCache_->GetConstThreadFilterData().InternalTidData()[CurrentRow()])); + break; + default: + TUNING_LOGF("Unregistered column : %d", column); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/thread_filter_table.h b/trace_analyzer/src/table/thread_filter_table.h new file mode 100644 index 000000000..491d8e7fb --- /dev/null +++ b/trace_analyzer/src/table/thread_filter_table.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef THREAD_FILTER_TABLE_H +#define THREAD_FILTER_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class ThreadFilterTable : public TableBase { +public: + explicit ThreadFilterTable(const TraceDataCache*); + ~ThreadFilterTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // THREAD_FILTER_TABLE_H diff --git a/trace_analyzer/src/table/thread_state_table.cpp b/trace_analyzer/src/table/thread_state_table.cpp new file mode 100644 index 000000000..142888766 --- /dev/null +++ b/trace_analyzer/src/table/thread_state_table.cpp @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "thread_state_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { ID = 0, TYPE, TS, DUR, CPU, INTERNAL_TID, STATE }; +} +ThreadStateTable::ThreadStateTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("id", "INT")); + tableColumn_.push_back(TableBase::ColumnInfo("type", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("ts", "INT")); + tableColumn_.push_back(TableBase::ColumnInfo("dur", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("cpu", "UNSIGNED BIG INT")); + tableColumn_.push_back(TableBase::ColumnInfo("utid", "INT")); + tableColumn_.push_back(TableBase::ColumnInfo("state", "STRING")); + tablePriKey_.push_back("id"); +} + +ThreadStateTable::~ThreadStateTable() {} + +void ThreadStateTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +ThreadStateTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->GetConstThreadStateData().Size())), + threadStateObj_(dataCache->GetConstThreadStateData()) +{ +} + +ThreadStateTable::Cursor::~Cursor() {} + +int ThreadStateTable::Cursor::Column(int col) const +{ + switch (col) { + case ID: + sqlite3_result_int64(context_, static_cast(CurrentRow())); + break; + case TYPE: + sqlite3_result_text(context_, "thread_state", STR_DEFAULT_LEN, nullptr); + break; + case TS: + sqlite3_result_int64(context_, static_cast(threadStateObj_.TimeStamData()[CurrentRow()])); + break; + case DUR: + sqlite3_result_int64(context_, static_cast(threadStateObj_.DursData()[CurrentRow()])); + break; + case CPU: + if (static_cast(threadStateObj_.CpusData()[CurrentRow()]) >= 0) { + sqlite3_result_int64(context_, static_cast(threadStateObj_.CpusData()[CurrentRow()])); + } + break; + case INTERNAL_TID: + sqlite3_result_int64(context_, + static_cast(threadStateObj_.InternalTidsData()[CurrentRow()])); + break; + case STATE: { + const std::string& str = dataCache_->GetConstSchedStateData(threadStateObj_.StatesData()[CurrentRow()]); + sqlite3_result_text(context_, str.c_str(), STR_DEFAULT_LEN, nullptr); + break; + } + default: + TUNING_LOGF("Unregistered column : %d", col); + break; + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/thread_state_table.h b/trace_analyzer/src/table/thread_state_table.h new file mode 100644 index 000000000..7ebf2137c --- /dev/null +++ b/trace_analyzer/src/table/thread_state_table.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef THREAD_STATE_TABLE_H +#define THREAD_STATE_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class ThreadStateTable : public TableBase { +public: + explicit ThreadStateTable(const TraceDataCache*); + ~ThreadStateTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + + private: + const ThreadState& threadStateObj_; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning +#endif // THREAD_STATE_TABLE_H diff --git a/trace_analyzer/src/table/thread_table.cpp b/trace_analyzer/src/table/thread_table.cpp new file mode 100644 index 000000000..06524bec4 --- /dev/null +++ b/trace_analyzer/src/table/thread_table.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "thread_table.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +enum Index { INTERNAL_TID = 0, INTERNAL_PID, NAME, TID }; +} +ThreadTable::ThreadTable(const TraceDataCache* dataCache) : TableBase(dataCache) +{ + tableColumn_.push_back(TableBase::ColumnInfo("utid", "INT")); + tableColumn_.push_back(TableBase::ColumnInfo("upid", "INT")); + tableColumn_.push_back(TableBase::ColumnInfo("name", "STRING")); + tableColumn_.push_back(TableBase::ColumnInfo("tid", "INT")); + tablePriKey_.push_back("utid"); +} + +ThreadTable::~ThreadTable() {} + +void ThreadTable::CreateCursor() +{ + cursor_ = std::make_unique(dataCache_); +} + +ThreadTable::Cursor::Cursor(const TraceDataCache* dataCache) + : TableBase::Cursor(dataCache, 0, static_cast(dataCache->ThreadSize())) +{ +} + +ThreadTable::Cursor::~Cursor() {} + +int ThreadTable::Cursor::Column(int column) const +{ + const auto& thread = dataCache_->GetConstThreadData(CurrentRow()); + switch (column) { + case INTERNAL_TID: { + sqlite3_result_int64(context_, CurrentRow()); + break; + } + case INTERNAL_PID: { + sqlite3_result_int64(context_, thread.internalPid_); + break; + } + case NAME: { + const auto& name = dataCache_->GetDataFromDict(thread.nameIndex_); + sqlite3_result_text(context_, name.c_str(), static_cast(name.length()), nullptr); + break; + } + case TID: { + sqlite3_result_int64(context_, thread.tid_); + break; + } + default: { + TUNING_LOGF("Unregistered column : %d", column); + break; + } + } + return SQLITE_OK; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/table/thread_table.h b/trace_analyzer/src/table/thread_table.h new file mode 100644 index 000000000..0a0cc2692 --- /dev/null +++ b/trace_analyzer/src/table/thread_table.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef THREAD_TABLE_H +#define THREAD_TABLE_H + +#include "table_base.h" +#include "trace_data_cache.h" + +namespace SysTuning { +namespace TraceStreamer { +class ThreadTable : public TableBase { +public: + explicit ThreadTable(const TraceDataCache*); + ~ThreadTable() override; + void CreateCursor() override; + +private: + class Cursor : public TableBase::Cursor { + public: + explicit Cursor(const TraceDataCache*); + ~Cursor() override; + int Column(int) const override; + }; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // THREAD_TABLE_H diff --git a/trace_analyzer/src/trace_data/trace_data_cache.cpp b/trace_analyzer/src/trace_data/trace_data_cache.cpp new file mode 100644 index 000000000..36fb94a4a --- /dev/null +++ b/trace_analyzer/src/trace_data/trace_data_cache.cpp @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "trace_data_cache.h" + +#include +#include "bound_table.h" +#include "cpu_measure_filter_table.h" +#include "data_dict_table.h" +#include "filter_table.h" +#include "instants_table.h" +#include "internal_slice_table.h" +#include "internal_thread.h" +#include "measure_filter_table.h" +#include "measure_table.h" +#include "process_filter_table.h" +#include "process_measure_filter_table.h" +#include "process_table.h" +#include "raw_table.h" +#include "sched_slice_table.h" +#include "table_base.h" +#include "thread_filter_table.h" +#include "thread_state_table.h" +#include "thread_table.h" + +namespace SysTuning { +namespace TraceStreamer { +TraceDataCache::TraceDataCache() +{ + InitDB(); +} + +TraceDataCache::~TraceDataCache() +{ +} + +void TraceDataCache::InitDB() +{ + TableBase::TableDeclare(*db_, this, "internal_process"); + TableBase::TableDeclare(*db_, this, "sched_slice"); + TableBase::TableDeclare(*db_, this, "internal_slice"); + TableBase::TableDeclare(*db_, this, "strings"); + TableBase::TableDeclare(*db_, this, "thread_state"); + TableBase::TableDeclare(*db_, this, "instant"); + TableBase::TableDeclare(*db_, this, "counter"); + TableBase::TableDeclare(*db_, this, "trace_bounds"); + TableBase::TableDeclare(*db_, this, "internal_thread"); + TableBase::TableDeclare(*db_, this, "raw"); + TableBase::TableDeclare(*db_, this, "cpu_counter_track"); + TableBase::TableDeclare(*db_, this, "track"); + TableBase::TableDeclare(*db_, this, "thread_track"); + TableBase::TableDeclare(*db_, this, "thread_counter_track"); + TableBase::TableDeclare(*db_, this, "process_counter_track"); + TableBase::TableDeclare(*db_, this, "process_track"); +} +} // namespace trace_streamer +} // namespace SysTuning diff --git a/trace_analyzer/src/trace_data/trace_data_cache.h b/trace_analyzer/src/trace_data/trace_data_cache.h new file mode 100644 index 000000000..57c3e2113 --- /dev/null +++ b/trace_analyzer/src/trace_data/trace_data_cache.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TRACE_DATA_CACHE_H +#define TRACE_DATA_CACHE_H + +#include "trace_data_cache_writer.h" +#include "trace_data_db.h" + +namespace SysTuning { +namespace TraceStreamer { +using namespace TraceStdtype; +class TraceDataCache : public TraceDataCacheWriter, public TraceDataDB { +public: + TraceDataCache(); + TraceDataCache(const TraceDataCache*) = delete; + TraceDataCache* operator=(const TraceDataCache*) = delete; + ~TraceDataCache() override; +private: + void InitDB(); +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // TRACE_DATA_CACHE_H diff --git a/trace_analyzer/src/trace_data/trace_data_cache_base.cpp b/trace_analyzer/src/trace_data/trace_data_cache_base.cpp new file mode 100644 index 000000000..0bdf3b97a --- /dev/null +++ b/trace_analyzer/src/trace_data/trace_data_cache_base.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "trace_data_cache_base.h" +#include + +namespace SysTuning { +namespace TraceStreamer { +TraceDataCacheBase::TraceDataCacheBase() +{ + internalProcessesData_.emplace_back(0); + internalThreadsData_.emplace_back(0); + + GetDataIndex(""); +} +TraceDataCacheBase::~TraceDataCacheBase() {} +DataIndex TraceDataCacheBase::GetDataIndex(std::string_view str) +{ + return dataDict_.GetStringIndex(str); +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/trace_data/trace_data_cache_base.h b/trace_analyzer/src/trace_data/trace_data_cache_base.h new file mode 100644 index 000000000..1234f035b --- /dev/null +++ b/trace_analyzer/src/trace_data/trace_data_cache_base.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TRACE_DATA_CACHE_BASE_H +#define TRACE_DATA_CACHE_BASE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "trace_stdtype.h" + +namespace SysTuning { +namespace TraceStreamer { +using namespace TraceStdtype; +class TraceDataCacheBase { +public: + TraceDataCacheBase(); + TraceDataCacheBase(const TraceDataCacheBase&) = delete; + TraceDataCacheBase& operator=(const TraceDataCacheBase&) = delete; + virtual ~TraceDataCacheBase(); +public: + size_t ThreadSize() const + { + return internalThreadsData_.size() - 1; + } + size_t ProcessSize() const + { + return internalProcessesData_.size() - 1; + } + + size_t DataDictSize() const + { + return dataDict_.Size(); + } + DataIndex GetDataIndex(std::string_view str); + std::map statusString_ = { + {TASK_RUNNABLE, "R"}, {TASK_INTERRUPTIBLE, "S"}, {TASK_UNINTERRUPTIBLE, "D"}, {TASK_RUNNING, "Running"}, + {TASK_INTERRUPTED, "I"}, {TASK_EXIT_DEAD, "X"}, {TASK_ZOMBIE, "Z"}, {TASK_KILLED, "I"}, + {TASK_WAKEKILL, "R"}, {TASK_INVALID, "U"}, {TASK_CLONE, "I"}, {TASK_DK, "DK"}, + {TASK_FOREGROUND, "R+"} + }; + + uint64_t boundtimeStart_ = std::numeric_limits::max(); + uint64_t boundtimeEnd_ = 0; + + Raw rawData_; + ThreadState threadStateData_; + Instants instantsData_; + + Filter filterData_; + ProcessCounterFilter processCounterFilterData_; + ProcessCounterFilter processFilterData_; + ThreadCounterFilter threadCounterFilterData_; + ThreadCounterFilter threadFilterData_; + DataDict dataDict_; + + Slices slicesData_; + SchedSlice schedSliceData_; + InternalSlices internalSlicesData_; + + std::deque internalProcessesData_ {}; + std::deque internalThreadsData_ {}; + + Counter counterData_; + CpuCounter cpuCounterData_; +}; +} // namespace trace_data_cache_base +} // namespace SysTuning + +#endif // TRACE_DATA_CACHE_BASE_H diff --git a/trace_analyzer/src/trace_data/trace_data_cache_reader.cpp b/trace_analyzer/src/trace_data/trace_data_cache_reader.cpp new file mode 100644 index 000000000..1e491e415 --- /dev/null +++ b/trace_analyzer/src/trace_data/trace_data_cache_reader.cpp @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "trace_data_cache_reader.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "log.h" +#include "trace_stdtype.h" + +namespace SysTuning { +namespace TraceStreamer { +using namespace TraceStdtype; +TraceDataCacheReader::~TraceDataCacheReader() {} +const std::string& TraceDataCacheReader::GetDataFromDict(DataIndex id) const +{ + return dataDict_.GetDataFromDict(id); +} +const Process& TraceDataCacheReader::GetConstProcessData(InternalPid internalPid) const +{ + TUNING_ASSERT(internalPid < internalProcessesData_.size()); + return internalProcessesData_[internalPid]; +} +const Thread& TraceDataCacheReader::GetConstThreadData(InternalTid internalTid) const +{ + TUNING_ASSERT(internalTid < internalThreadsData_.size()); + return internalThreadsData_[internalTid]; +} +const InternalSlices& TraceDataCacheReader::GetConstInternalSlicesData() const +{ + return internalSlicesData_; +} +const Filter& TraceDataCacheReader::GetConstFilterData() const +{ + return filterData_; +} +const Raw& TraceDataCacheReader::GetConstRawTableData() const +{ + return rawData_; +} +const Counter& TraceDataCacheReader::GetConstCounterData() const +{ + return counterData_; +} + +const ThreadCounterFilter* TraceDataCacheReader::ThreadCounterFilterData() const +{ + return &threadCounterFilterData_; +} +const ThreadState& TraceDataCacheReader::GetConstThreadStateData() const +{ + return threadStateData_; +} +const SchedSlice& TraceDataCacheReader::GetConstSchedSliceData() const +{ + return schedSliceData_; +} +const CpuCounter& TraceDataCacheReader::GetConstCpuCounterData() const +{ + return cpuCounterData_; +} +const ThreadCounterFilter& TraceDataCacheReader::GetConstThreadFilterData() const +{ + return threadFilterData_; +} +const Instants& TraceDataCacheReader::GetConstInstantsData() const +{ + return instantsData_; +} +const ProcessCounterFilter& TraceDataCacheReader::GetConstProcessFilterData() const +{ + return processFilterData_; +} +const ProcessCounterFilter& TraceDataCacheReader::ProcessCounterFilterData() const +{ + return processCounterFilterData_; +} +const std::string& TraceDataCacheReader::GetConstSchedStateData(uint64_t rowId) const +{ + TUNING_ASSERT(statusString_.find(rowId) != statusString_.end()); + return statusString_.at(rowId); +} +uint64_t TraceDataCacheReader::BoundStartTime() const +{ + return boundtimeStart_; +} +uint64_t TraceDataCacheReader::BoundEndTime() const +{ + return boundtimeEnd_; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/trace_data/trace_data_cache_reader.h b/trace_analyzer/src/trace_data/trace_data_cache_reader.h new file mode 100644 index 000000000..c81bed6e3 --- /dev/null +++ b/trace_analyzer/src/trace_data/trace_data_cache_reader.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TRACE_DATA_CACHE_READER_H +#define TRACE_DATA_CACHE_READER_H + +#include "log.h" +#include "trace_data_cache_base.h" +#include "trace_stdtype.h" + +namespace SysTuning { +namespace TraceStreamer { +using namespace TraceStdtype; +class TraceDataCacheReader : public TraceDataCacheBase { +public: + TraceDataCacheReader() = default; + TraceDataCacheReader(const TraceDataCacheReader&) = delete; + TraceDataCacheReader& operator=(const TraceDataCacheReader&) = delete; + ~TraceDataCacheReader() override; +public: + const std::string& GetDataFromDict(DataIndex id) const; + const Process& GetConstProcessData(InternalPid internalPid) const; + const Thread& GetConstThreadData(InternalTid internalTid) const; + const InternalSlices& GetConstInternalSlicesData() const; + const Filter& GetConstFilterData() const; + const Raw& GetConstRawTableData() const; + const Counter& GetConstCounterData() const; + const ThreadCounterFilter* ThreadCounterFilterData() const; + const ThreadState& GetConstThreadStateData() const; + const SchedSlice& GetConstSchedSliceData() const; + const CpuCounter& GetConstCpuCounterData() const; + const ThreadCounterFilter& GetConstThreadFilterData() const; + const Instants& GetConstInstantsData() const; + const ProcessCounterFilter& GetConstProcessFilterData() const; + const ProcessCounterFilter& ProcessCounterFilterData() const; + const std::string& GetConstSchedStateData(uint64_t rowId) const; + uint64_t BoundStartTime() const; + uint64_t BoundEndTime() const; +}; +} +} +#endif diff --git a/trace_analyzer/src/trace_data/trace_data_cache_writer.cpp b/trace_analyzer/src/trace_data/trace_data_cache_writer.cpp new file mode 100644 index 000000000..84ef72eb3 --- /dev/null +++ b/trace_analyzer/src/trace_data/trace_data_cache_writer.cpp @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "trace_data_cache_writer.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "log.h" + +namespace SysTuning { +namespace TraceStreamer { +using namespace TraceStdtype; +TraceDataCacheWriter::~TraceDataCacheWriter() {} +InternalPid TraceDataCacheWriter::GetProcessInternalPid(uint32_t pid) +{ + internalProcessesData_.emplace_back(pid); + return static_cast(internalProcessesData_.size() - 1); +} +Process* TraceDataCacheWriter::GetProcessData(InternalPid internalPid) +{ + TUNING_ASSERT(internalPid < internalProcessesData_.size()); + return &internalProcessesData_[internalPid]; +} + +InternalTid TraceDataCacheWriter::GetInternalThread(uint32_t tid) +{ + internalThreadsData_.emplace_back(tid); + return static_cast(internalThreadsData_.size() - 1); +} +Thread* TraceDataCacheWriter::GetThreadData(InternalTid internalTid) +{ + TUNING_ASSERT(internalTid < internalThreadsData_.size()); + return &internalThreadsData_[internalTid]; +} + +void TraceDataCacheWriter::UpdateBoundTime(uint64_t timestamp) +{ + boundtimeStart_ = std::min(boundtimeStart_, timestamp); + boundtimeEnd_ = std::max(boundtimeEnd_, timestamp); +} + +Slices* TraceDataCacheWriter::GetSlicesData() +{ + return &slicesData_; +} +InternalSlices* TraceDataCacheWriter::GetInternalSlicesData() +{ + return &internalSlicesData_; +} + +Filter* TraceDataCacheWriter::GetFilterData() +{ + return &filterData_; +} + +Raw* TraceDataCacheWriter::GetRawData() +{ + return &rawData_; +} + +Counter* TraceDataCacheWriter::GetCounterData() +{ + return &counterData_; +} + +ThreadState* TraceDataCacheWriter::GetThreadStateData() +{ + return &threadStateData_; +} + +SchedSlice* TraceDataCacheWriter::GetSchedSliceData() +{ + return &schedSliceData_; +} + +CpuCounter* TraceDataCacheWriter::GetCpuCountersData() +{ + return &cpuCounterData_; +} + +ThreadCounterFilter* TraceDataCacheWriter::GetThreadCounterFilterData() +{ + return &threadCounterFilterData_; +} + +ThreadCounterFilter* TraceDataCacheWriter::GetThreadFilterData() +{ + return &threadFilterData_; +} + +Instants* TraceDataCacheWriter::GetInstantsData() +{ + return &instantsData_; +} + +ProcessCounterFilter* TraceDataCacheWriter::GetProcessFilterData() +{ + return &processFilterData_; +} + +ProcessCounterFilter* TraceDataCacheWriter::GetProcessCounterFilterData() +{ + return &processCounterFilterData_; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/trace_data/trace_data_cache_writer.h b/trace_analyzer/src/trace_data/trace_data_cache_writer.h new file mode 100644 index 000000000..ad0503fe0 --- /dev/null +++ b/trace_analyzer/src/trace_data/trace_data_cache_writer.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TRACE_DATA_CACHE_WRITER_H +#define TRACE_DATA_CACHE_WRITER_H + +#include "trace_data_cache_reader.h" + +namespace SysTuning { +namespace TraceStreamer { +using namespace TraceStdtype; +class TraceDataCacheWriter : public TraceDataCacheReader { +public: + TraceDataCacheWriter() = default; + TraceDataCacheWriter(const TraceDataCacheWriter&) = delete; + TraceDataCacheWriter& operator=(const TraceDataCacheWriter&) = delete; + ~TraceDataCacheWriter() override; +public: + InternalPid GetProcessInternalPid(uint32_t pid); + Process* GetProcessData(InternalPid internalPid); + InternalTid GetInternalThread(uint32_t tid); + Thread* GetThreadData(InternalTid internalTid); + void UpdateBoundTime(uint64_t timestamp); + Slices* GetSlicesData(); + InternalSlices* GetInternalSlicesData(); + Filter* GetFilterData(); + Raw* GetRawData(); + Counter* GetCounterData(); + ThreadState* GetThreadStateData(); + SchedSlice* GetSchedSliceData(); + CpuCounter* GetCpuCountersData(); + ThreadCounterFilter* GetThreadCounterFilterData(); + ThreadCounterFilter* GetThreadFilterData(); + Instants* GetInstantsData(); + ProcessCounterFilter* GetProcessFilterData(); + ProcessCounterFilter* GetProcessCounterFilterData(); +}; +} // namespace TraceStreamer +} // namespace trace_data_cache +#endif diff --git a/trace_analyzer/src/trace_data/trace_data_db.cpp b/trace_analyzer/src/trace_data/trace_data_db.cpp new file mode 100644 index 000000000..f8e7f408e --- /dev/null +++ b/trace_analyzer/src/trace_data/trace_data_db.cpp @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "trace_data_db.h" +#include +#include +#include +#include +#include +#include + +#include "file.h" +#include "log.h" + +namespace SysTuning { +namespace TraceStreamer { +TraceDataDB::TraceDataDB() : db_(nullptr) +{ + sqlite3_open(":memory:", &db_); +} +TraceDataDB::~TraceDataDB() +{ + sqlite3_close(db_); +} + +void TraceDataDB::AppendNewTable(std::string tableName) +{ + internalTables_.push_back(tableName); +} +int TraceDataDB::ExportDatabase(const std::string& outputName) +{ + { + int fd(base::OpenFile(outputName, O_CREAT | O_RDWR, 0600)); + if (!fd) { + fprintf(stdout, "Failed to create file: %s", outputName.c_str()); + return 1; + } + ftruncate(fd, 0); + close(fd); + } + + std::string attachSql("ATTACH DATABASE '" + outputName + "' AS systuning_export"); + ExecuteSql(attachSql); + + for (auto itor = internalTables_.begin(); itor != internalTables_.end(); itor++) { + std::string exportSql("CREATE TABLE systuning_export." + *itor + " AS SELECT * FROM " + *itor); + ExecuteSql(exportSql); + } + + std::string detachSql("DETACH DATABASE systuning_export"); + ExecuteSql(detachSql); + return 0; +} +void TraceDataDB::ExecuteSql(const std::string_view& sql) +{ + sqlite3_stmt* stmt = nullptr; + int ret = sqlite3_prepare_v2(db_, sql.data(), static_cast(sql.size()), &stmt, nullptr); + + while (!ret) { + int err = sqlite3_step(stmt); + if (err == SQLITE_ROW) { + continue; + } + if (err == SQLITE_DONE) { + break; + } + ret = err; + } + + sqlite3_finalize(stmt); +} +} +} diff --git a/trace_analyzer/src/trace_data/trace_data_db.h b/trace_analyzer/src/trace_data/trace_data_db.h new file mode 100644 index 000000000..6cf4e7699 --- /dev/null +++ b/trace_analyzer/src/trace_data/trace_data_db.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TRACE_DATA_DB_H +#define TRACE_DATA_DB_H + +#include +#include + +extern "C" { +struct sqlite3; +struct sqlite3_stmt; +extern int sqlite3_close(sqlite3*); +extern int sqlite3_finalize(sqlite3_stmt* pStmt); +} + +namespace SysTuning { +namespace TraceStreamer { +class TraceDataDB { +public: + TraceDataDB(); + TraceDataDB(const TraceDataDB&) = delete; + TraceDataDB& operator=(const TraceDataDB&) = delete; + virtual ~TraceDataDB(); +public: + int ExportDatabase(const std::string& outputName); + void AppendNewTable(std::string tableName); + sqlite3* db_; +private: + void ExecuteSql(const std::string_view&); + std::list internalTables_ {}; +}; +} +} +#endif diff --git a/trace_analyzer/src/trace_data/trace_stdtype.cpp b/trace_analyzer/src/trace_data/trace_stdtype.cpp new file mode 100644 index 000000000..236525a49 --- /dev/null +++ b/trace_analyzer/src/trace_data/trace_stdtype.cpp @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "trace_stdtype.h" + +namespace SysTuning { +namespace TraceStdtype { +size_t ThreadState::AppendThreadState(uint64_t ts, uint64_t dur, + uint64_t cpu, uint64_t internalTid, uint64_t state) +{ + internalTids_.emplace_back(internalTid); + states_.emplace_back(state); + timeStamps_.emplace_back(ts); + durs_.emplace_back(dur); + cpus_.emplace_back(cpu); + return Size() - 1; +} + +void ThreadState::SetDuration(size_t index, uint64_t duration) +{ + durs_[index] = duration; +} + +uint64_t ThreadState::UpdateDuration(size_t index, uint64_t timestamp) +{ + durs_[index] = timestamp - timeStamps_[index]; + return internalTids_[index]; +} + +void ThreadState::UpdateState(size_t index, uint64_t state) +{ + states_[index] = state; +} +void ThreadState::UpdateDuration(size_t index, uint64_t timestamp, uint64_t state) +{ + durs_[index] = timestamp - timeStamps_[index]; + states_[index] = state; +} + +uint64_t ThreadState::UpdateDuration(size_t index, uint64_t timestamp, uint64_t cpu, uint64_t state) +{ + cpus_[index] = cpu; + durs_[index] = timestamp - timeStamps_[index]; + states_[index] = state; + return internalTids_[index]; +} + +size_t SchedSlice::AppendSchedSlice(uint64_t ts, uint64_t dur, uint64_t cpu, + uint64_t internalTid, uint64_t endState, uint64_t priority) +{ + internalTids_.emplace_back(internalTid); + endStates_.emplace_back(endState); + priority_.emplace_back(priority); + timeStamps_.emplace_back(ts); + durs_.emplace_back(dur); + cpus_.emplace_back(cpu); + return Size() - 1; +} + +void SchedSlice::SetDuration(size_t index, uint64_t duration) +{ + durs_[index] = duration; +} + +void SchedSlice::Update(uint64_t index, uint64_t ts, uint64_t state, uint64_t pior) +{ + durs_[index] = ts - timeStamps_[index]; + endStates_[index] = state; + priority_[index] = pior; +} + + +size_t Slices::AppendSliceData(uint32_t cpu, uint64_t startT, uint64_t durationNs, InternalTid internalTid) +{ + durs_.emplace_back(durationNs); + internalTids_.emplace_back(internalTid); + cpus_.emplace_back(cpu); + timeStamps_.emplace_back(startT); + return Size() - 1; +} + +size_t InternalSlices::AppendInternalSlice(uint64_t startT, uint64_t durationNs, + InternalTid internalTid, uint32_t filterId, DataIndex cat, DataIndex name, + uint8_t depth, uint64_t stackId, uint64_t parentStackId, std::optional parentId) +{ + AppendCommonInfo(startT, durationNs, internalTid, filterId); + AppendCallStack(cat, name, depth, stackId, + parentStackId, parentId); + ids_.emplace_back(ids_.size()); + return Size() - 1; +} + +void InternalSlices::AppendCommonInfo(uint64_t startT, uint64_t durationNs, InternalTid internalTid, uint32_t filterId) +{ + timeStamps_.emplace_back(startT); + durs_.emplace_back(durationNs); + internalTids_.emplace_back(internalTid); + filterIds_.emplace_back(filterId); +} +void InternalSlices::AppendCallStack(DataIndex cat, DataIndex name, uint8_t depth, uint64_t stackId, + uint64_t parentStackId, std::optional parentId) +{ + stackIds_.emplace_back(stackId); + parentStackIds_.emplace_back(parentStackId); + parentIds_.emplace_back(parentId); + cats_.emplace_back(cat); + names_.emplace_back(name); + depths_.emplace_back(depth); +} +size_t Filter::AppendNewFilterData(std::string type, std::string name, uint32_t sourceArgSetId) +{ + nameDeque_.emplace_back(name); + sourceArgSetId_.emplace_back(sourceArgSetId); + ids_.emplace_back(Size()); + typeDeque_.emplace_back(type); + return Size() - 1; +} + +size_t Counter::AppendCounterData(uint32_t type, uint64_t timestamp, double value, uint32_t filterId) +{ + valuesDeque_.emplace_back(value); + filterIdDeque_.emplace_back(filterId); + typeDeque_.emplace_back(type); + timeStamps_.emplace_back(timestamp); + return Size() - 1; +} + +size_t Raw::AppendRawData(uint32_t id, uint64_t timestamp, uint32_t name, uint32_t cpu, uint32_t internalTid) +{ + ids_.emplace_back(id); + timeStamps_.emplace_back(timestamp); + nameDeque_.emplace_back(name); + cpuDeque_.emplace_back(cpu); + utidDeque_.emplace_back(internalTid); + return Size() - 1; +} + +size_t ThreadCounterFilter::AppendNewData(uint64_t filterId, uint32_t nameIndex, uint64_t internalTid) +{ + filterId_.emplace_back(filterId); + nameIndex_.emplace_back(nameIndex); + internalTids_.emplace_back(internalTid); + return Size() - 1; +} + +size_t Instants::AppendInstantEventData(uint64_t timestamp, DataIndex nameIndex, int64_t internalTid) +{ + internalTids_.emplace_back(internalTid); + timeStamps_.emplace_back(timestamp); + NameIndexs_.emplace_back(nameIndex); + return Size() - 1; +} + +size_t ProcessCounterFilter::AppendProcessCounterFilterData(uint32_t id, DataIndex name, uint32_t internalPid) +{ + internalPids_.emplace_back(internalPid); + ids_.emplace_back(id); + names_.emplace_back(name); + return Size() - 1; +} + +size_t ProcessCounterFilter::AppendProcessFilterData(uint32_t id, DataIndex name, uint32_t internalPid) +{ + internalPids_.emplace_back(internalPid); + ids_.emplace_back(id); + names_.emplace_back(name); + return Size() - 1; +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/trace_data/trace_stdtype.h b/trace_analyzer/src/trace_data/trace_stdtype.h new file mode 100644 index 000000000..82e1dc9ba --- /dev/null +++ b/trace_analyzer/src/trace_data/trace_stdtype.h @@ -0,0 +1,425 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TRACE_STDTYPE_H +#define TRACE_STDTYPE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "log.h" +#include "src/base/common.h" + +namespace SysTuning { +namespace TraceStdtype { +enum EndState { + TASK_RUNNABLE = 0, // R + TASK_INTERRUPTIBLE = 1, // S + TASK_UNINTERRUPTIBLE = 2, // D + TASK_RUNNING = 3, // Running + TASK_INTERRUPTED = 4, // I + TASK_EXIT_DEAD = 16, // X + TASK_ZOMBIE = 32, // Z + TASK_CLONE = 64, // I + TASK_KILLED = 128, // K + TASK_DK = 130, // DK + TASK_WAKEKILL = 256, // W + TASK_INVALID = 9999, + TASK_FOREGROUND = 2048 // R+ +}; + +class CacheBase { +public: + size_t Size() const + { + return std::max(timeStamps_.size(), ids_.size()); + } + const std::deque& IdsData() const + { + return ids_; + } + const std::deque& TimeStamData() const + { + return timeStamps_; + } + const std::deque& InternalTidsData() const + { + return internalTids_; + } +public: + std::deque internalTids_; + std::deque timeStamps_; + std::deque ids_; +}; + +class CpuCacheBase { +public: + const std::deque& DursData() const + { + return durs_; + } + + const std::deque& CpusData() const + { + return cpus_; + } +public: + std::deque durs_; + std::deque cpus_; +}; +class Thread { +public: + explicit Thread(uint32_t t) : tid_(t) {} + InternalPid internalPid_ = 0; + uint32_t tid_ = 0; + DataIndex nameIndex_ = 0; + InternalTime startT_ = 0; + InternalTime endT_ = 0; +}; + +class Process { +public: + explicit Process(uint32_t p) : pid_(p) {} + std::string cmdLine_ = ""; + InternalTime startT_ = 0; + uint32_t pid_ = 0; +}; + +class ThreadState : public CacheBase, public CpuCacheBase { +public: + size_t AppendThreadState(uint64_t ts, uint64_t dur, uint64_t cpu, uint64_t internalTid, uint64_t state); + void SetDuration(size_t index, uint64_t duration); + uint64_t UpdateDuration(size_t index, uint64_t timestamp); + void UpdateState(size_t index, uint64_t state); + void UpdateDuration(size_t index, uint64_t timestamp, uint64_t state); + uint64_t UpdateDuration(size_t index, uint64_t timestamp, uint64_t cpu, uint64_t state); + const std::deque& StatesData() const +{ + return states_; + } + +private: + std::deque states_; +}; + +class SchedSlice : public CacheBase, public CpuCacheBase { +public: + size_t AppendSchedSlice(uint64_t ts, uint64_t dur, uint64_t cpu, + uint64_t internalTid, uint64_t endState, uint64_t priority); + void SetDuration(size_t index, uint64_t duration); + void Update(uint64_t index, uint64_t ts, uint64_t state, uint64_t pior); + + const std::deque& EndStatesData() const + { + return endStates_; + } + + const std::deque& PriorityData() const + { + return priority_; + } + +private: + std::deque endStates_; + std::deque priority_; +}; + +class Slices : public CacheBase, public CpuCacheBase { +public: + size_t AppendSliceData(uint32_t cpu, uint64_t startT, uint64_t durationNs, InternalTid internalTid); + + void SetDuration(size_t index, uint64_t durationNs) + { + durs_[index] = durationNs; + } +}; + +class InternalSlices : public CacheBase, public CpuCacheBase { +public: + size_t AppendInternalSlice(uint64_t startT, + uint64_t durationNs, + InternalTid internalTid, + uint32_t filterId, + DataIndex cat, + DataIndex name, + uint8_t depth, + uint64_t stackId, + uint64_t parentStackId, + std::optional parentId); + void SetDuration(size_t index, uint64_t durationNs) + { + durs_[index] = durationNs; + } + + void SetStackId(size_t index, uint64_t stackId) + { + stackIds_[index] = stackId; + } + const std::deque>& ParentIdData() const + { + return parentIds_; + } + const std::deque& FilterIdData() const + { + return filterIds_; + } + const std::deque& CatsData() const + { + return cats_; + } + const std::deque& StackIdsData() const + { + return stackIds_; + } + const std::deque& ParentStackIds() const + { + return parentStackIds_; + } + const std::deque& NamesData() const + { + return names_; + } + const std::deque& Depths() const + { + return depths_; + } +private: + void AppendCommonInfo(uint64_t startT, uint64_t durationNs, InternalTid internalTid, uint32_t filterId); + void AppendCallStack(DataIndex cat, DataIndex name, uint8_t depth, uint64_t stackId, + uint64_t parentStackId, std::optional parentId); +private: + std::deque> parentIds_; + std::deque filterIds_; + std::deque cats_; + std::deque stackIds_; + std::deque parentStackIds_; + std::deque names_; + std::deque depths_; +}; + +class Filter : public CacheBase { +public: + size_t AppendNewFilterData(std::string type, std::string name, uint32_t sourceArgSetId); + const std::deque& NameData() const + { + return nameDeque_; + } + const std::deque& TypeData() const + { + return typeDeque_; + } + const std::deque& SourceArgSetIdData() const + { + return sourceArgSetId_; + } + +private: + std::deque nameDeque_; + std::deque typeDeque_; + std::deque sourceArgSetId_; +}; + +class Counter : public CacheBase { +public: + size_t AppendCounterData(uint32_t type, uint64_t timestamp, double value, uint32_t filterId); + const std::deque& TypeData() const + { + return typeDeque_; + } + const std::deque& ValuesData() const + { + return valuesDeque_; + } + const std::deque& FilterIdData() const + { + return filterIdDeque_; + } + +private: + std::deque typeDeque_; + std::deque valuesDeque_; + std::deque filterIdDeque_; +}; + +class Raw : public CacheBase { +public: + size_t AppendRawData(uint32_t id, uint64_t timestamp, uint32_t name, uint32_t cpu, uint32_t internalTid); + const std::deque& NameData() const + { + return nameDeque_; + } + const std::deque& CpuData() const + { + return cpuDeque_; + } + const std::deque& InternalTidData() const + { + return utidDeque_; + } + +private: + std::deque nameDeque_; + std::deque cpuDeque_; + std::deque utidDeque_; +}; + +class ThreadCounterFilter { +public: + size_t AppendNewData(uint64_t filterId, uint32_t nameIndex, uint64_t internalTid); + size_t Size() const + { + return filterId_.size(); + } + const std::deque& FilterIdData() const + { + return filterId_; + } + const std::deque& InternalTidData() const + { + return internalTids_; + } + const std::deque& NameIndexData() const + { + return nameIndex_; + } + +private: + std::deque filterId_; + std::deque internalTids_; + std::deque nameIndex_; +}; + +class CpuCounter : public CacheBase { +public: + inline size_t AppendCpuCounter(uint64_t filterId, + DataIndex name, + uint64_t cpu, + uint64_t sourceArgSetId = 0, + DataIndex unit = 0) + { + ids_.emplace_back(filterId); + unit_.emplace_back(unit); + cpu_.emplace_back(cpu); + name_.emplace_back(name); + sourceArgSetId_.emplace_back(sourceArgSetId); + return Size() - 1; + } + + const std::deque& CpuData() const + { + return cpu_; + } + + const std::deque& TypeData() const + { + return type_; + } + + const std::deque& UnitData() const + { + return unit_; + } + + const std::deque& NameData() const + { + return name_; + } + + const std::deque& SourceArgSetIdData() const + { + return sourceArgSetId_; + } + +private: + std::deque cpu_; + std::deque type_; + std::deque unit_; + std::deque name_; + std::deque sourceArgSetId_; +}; + +class Instants : public CacheBase { +public: + size_t AppendInstantEventData(uint64_t timestamp, DataIndex nameIndex, int64_t internalTid); + + const std::deque& NameIndexsData() const + { + return NameIndexs_; + } + +private: + std::deque NameIndexs_; +}; + +class ProcessCounterFilter : public CacheBase { +public: + size_t AppendProcessCounterFilterData(uint32_t id, DataIndex name, uint32_t internalPid); + size_t AppendProcessFilterData(uint32_t id, DataIndex name, uint32_t internalPid); + + const std::deque& UpidsData() const + { + return internalPids_; + } + + const std::deque& NamesData() const + { + return names_; + } + +private: + std::deque internalPids_; + std::deque names_; +}; +class DataDict { +public: + std::deque dataDict_; + std::unordered_map dataDictInnerMap_; +public: + size_t Size() const + { + return dataDict_.size(); + } + DataIndex GetStringIndex(std::string_view str) + { + auto hashValue = hashFun(str); + auto itor = dataDictInnerMap_.find(hashValue); + if (itor != dataDictInnerMap_.end()) { + TUNING_ASSERT(std::string_view(dataDict_[itor->second]) == str); + return itor->second; + } + dataDict_.emplace_back(std::string(str)); + DataIndex stringIdentity = dataDict_.size() - 1; + dataDictInnerMap_.emplace(hashValue, stringIdentity); + return stringIdentity; + } + const std::string& GetDataFromDict(DataIndex id) const + { + TUNING_ASSERT(id < dataDict_.size()); + return dataDict_[id]; + } +private: + std::hash hashFun; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // TRACE_STDTYPE_H diff --git a/trace_analyzer/src/trace_streamer.cpp b/trace_analyzer/src/trace_streamer.cpp new file mode 100644 index 000000000..023a1471e --- /dev/null +++ b/trace_analyzer/src/trace_streamer.cpp @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "trace_streamer.h" + +#include +#include +#include + +#include "clock_filter.h" +#include "cpu_filter.h" +#include "event_filter.h" +#include "file.h" +#include "filter_filter.h" +#include "measure_filter.h" +#include "parser/bytrace_parser.h" +#include "process_filter.h" +#include "slice_filter.h" + +namespace SysTuning { +namespace TraceStreamer { +namespace { +FileType ParseFileType(const uint8_t* data, size_t size) +{ + if (size == 0) { + return UN_KNOW; + } + std::string start(reinterpret_cast(data), std::min(size, 20)); + if (start.find("# tracer") != std::string::npos) { + return BY_TRACE; + } + if ((start.compare(0, std::string("").length(), "") == 0) || + (start.compare(0, std::string("").length(), "") == 0)) { + return BY_TRACE; + } + if (start.compare(0, std::string("\x0a").length(), "\x0a") == 0) { + return PROTO; + } + return UN_KNOW; +} +} // namespace + +TraceStreamer::TraceStreamer() : fileType_(UN_KNOW), bytraceParser_(nullptr) +{ + InitFilter(); + InitParser(); +} +TraceStreamer::~TraceStreamer() +{ +} + +void TraceStreamer::InitFilter() +{ + streamFilters_ = std::make_unique(); + traceDataCache_ = std::make_unique(); + streamFilters_ = std::make_unique(); + traceDataCache_ = std::make_unique(); + streamFilters_->sliceFilter_ = std::make_unique(traceDataCache_.get(), streamFilters_.get()); + streamFilters_->cpuFilter_ = std::make_unique(traceDataCache_.get(), streamFilters_.get()); + streamFilters_->eventFilter_ = std::make_unique(traceDataCache_.get(), streamFilters_.get()); + + streamFilters_->processFilter_ = std::make_unique(traceDataCache_.get(), streamFilters_.get()); + streamFilters_->clockFilter_ = std::make_unique(traceDataCache_.get(), streamFilters_.get()); + streamFilters_->filterFilter_ = std::make_unique(traceDataCache_.get(), streamFilters_.get()); + + streamFilters_->threadCounterFilter_ = + std::make_unique(traceDataCache_.get(), streamFilters_.get(), E_THREADMEASURE_FILTER); + streamFilters_->threadFilter_ = + std::make_unique(traceDataCache_.get(), streamFilters_.get(), E_THREAD_FILTER); + streamFilters_->cpuCounterFilter_ = + std::make_unique(traceDataCache_.get(), streamFilters_.get(), E_CPU_MEASURE_FILTER); + streamFilters_->processCounterFilter_ = + std::make_unique(traceDataCache_.get(), streamFilters_.get(), E_PROCESS_MEASURE_FILTER); + streamFilters_->processFilterFilter_ = + std::make_unique(traceDataCache_.get(), streamFilters_.get(), E_PROCESS_FILTER_FILTER); +} +void TraceStreamer::InitParser() +{ + bytraceParser_ = std::make_unique(traceDataCache_.get(), streamFilters_.get()); +} +bool TraceStreamer::Parse(std::unique_ptr data, size_t size) +{ + if (size == 0) { + return true; + } + if (fileType_ == UN_KNOW) { + fileType_ = ParseFileType(data.get(), size); + if (fileType_ == UN_KNOW) { + base::SetAnalysisResult(base::FILE_TYPE_ERROR); + fprintf(stdout, "File type is not supported!"); + return false; + } + } + if (fileType_ == PROTO) { + base::SetAnalysisResult(base::FILE_TYPE_ERROR); + fprintf(stdout, "File type is not supported!"); + return false; + } + if (fileType_ == BY_TRACE) { + if (!bytraceParser_->Parse(std::move(data), size)) { + base::SetAnalysisResult(base::PARSE_ERROR); + return false; + } + } + base::SetAnalysisResult(base::NORMAL); + return true; +} + +int TraceStreamer::ExportDatabase(const std::string& outputName) +{ + return traceDataCache_->ExportDatabase(outputName); +} +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/trace_streamer.h b/trace_analyzer/src/trace_streamer.h new file mode 100644 index 000000000..5e1dfef2e --- /dev/null +++ b/trace_analyzer/src/trace_streamer.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TRACE_STREAMER_H +#define TRACE_STREAMER_H + +#include +#include +#include "trace_data/trace_data_cache.h" +#include "trace_streamer_filters.h" + +namespace SysTuning { +namespace TraceStreamer { +class BytraceParser; +constexpr size_t G_FILE_PERMISSION = 664; +constexpr int G_MIN_PARAM_NUM = 2; +enum FileType { BY_TRACE, PROTO, UN_KNOW }; +class TraceStreamer { +public: + TraceStreamer(); + ~TraceStreamer(); + + bool Parse(std::unique_ptr, size_t); + int ExportDatabase(const std::string& outputName); +private: + void InitFilter(); + void InitParser(); + FileType fileType_; + + std::unique_ptr streamFilters_; + std::unique_ptr traceDataCache_; + + std::unique_ptr bytraceParser_; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // TRACE_STREAMER_H diff --git a/trace_analyzer/src/trace_streamer_filters.cpp b/trace_analyzer/src/trace_streamer_filters.cpp new file mode 100755 index 000000000..16f3b6d6a --- /dev/null +++ b/trace_analyzer/src/trace_streamer_filters.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "trace_streamer_filters.h" + +#include "clock_filter.h" +#include "cpu_filter.h" +#include "event_filter.h" +#include "filter_filter.h" +#include "measure_filter.h" +#include "process_filter.h" +#include "slice_filter.h" + +namespace SysTuning { +namespace TraceStreamer { +TraceStreamerFilters::TraceStreamerFilters() = default; +TraceStreamerFilters::~TraceStreamerFilters() = default; +} // namespace TraceStreamer +} // namespace SysTuning diff --git a/trace_analyzer/src/trace_streamer_filters.h b/trace_analyzer/src/trace_streamer_filters.h new file mode 100755 index 000000000..dc1294770 --- /dev/null +++ b/trace_analyzer/src/trace_streamer_filters.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TRACE_STREAMERTOKEN_H +#define TRACE_STREAMERTOKEN_H + +#include + +namespace SysTuning { +namespace TraceStreamer { +class SliceFilter; +class ProcessFilter; +class EventFilter; +class CpuFilter; +class MeasureFilter; +class FilterFilter; +class ClockFilter; + +class TraceStreamerFilters { +public: + TraceStreamerFilters(); + ~TraceStreamerFilters(); + + std::unique_ptr clockFilter_; + std::unique_ptr filterFilter_; + std::unique_ptr sliceFilter_; + std::unique_ptr processFilter_; + std::unique_ptr cpuFilter_; + std::unique_ptr eventFilter_; + std::unique_ptr cpuCounterFilter_; + std::unique_ptr threadCounterFilter_; + std::unique_ptr threadFilter_; + std::unique_ptr processCounterFilter_; + std::unique_ptr processFilterFilter_; +}; +} // namespace TraceStreamer +} // namespace SysTuning + +#endif // TRACE_STREAMERTOKEN_H diff --git a/trace_analyzer/test/bytrace/bytrace_parser_test.cpp b/trace_analyzer/test/bytrace/bytrace_parser_test.cpp new file mode 100755 index 000000000..ddc81ed1a --- /dev/null +++ b/trace_analyzer/test/bytrace/bytrace_parser_test.cpp @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include + +#include "bytrace_parser.h" + +static std::string g_str = "TRACE: + #tracer : nop + # + #entries - in - buffer / entries - written : 1585855 / 1585855 #P : 4 + # + #_-- -- -= > irqs - off + #/ _ -- -- => need - resched + #| / _ -- -=> hardirq / softirq + #|| / _ -- => preempt - depth + #|| | / delay + #TASK - PID TGID CPU # || || TIMESTAMP FUNCTION + #| | | | || || | | + atrace - 12728(12728)[003]... 1 174330.280300 : tracing_mark_write : trace_event_clock_sync + : parent_ts = 23139.998047 atrace - 12728(12728)[003]... 1 174330.280316 : tracing_mark_write + : trace_event_clock_sync : realtime_ts = 1616439852302 ACCS0 - 2716(2519)[000] d.h1 174330.280362 + : irq_handler_entry : irq = 19 name = 408000.qcom, cpu - bwmon ACCS0 - + 2716(2519)[000] d.h1 174330.280382 : irq_handler_exit + : irq = 19 ret = handled atrace - 12728(12728)[003] d..3 174330.280387 : sched_switch + : prev_comm = atrace prev_pid = 12728 prev_prio = 120 prev_state = + S == > next_comm = swapper / 3 next_pid = 0 next_prio = 120 < idle > -0(-----)[003] d..4 174330.280435 + : sched_waking : comm = rcu_preempt pid = 7 prio = 98 target_cpu = 000 ACCS0 - + 2716(2519)[000] d..1 174330.280449 : ipi_entry + : (Rescheduling interrupts) - 0(-----)[003] d..2 174330.280450 : softirq_raise + : vec = 9 [action = RCU] - 0(-----)[003] d..3 174330.280453 : sched_waking + : comm = ksoftirqd / 3 pid = 29 prio = 120 target_cpu = 003 ACCS0 - 2716(2519)[000] dnh2 174330.280459 + : sched_wakeup : comm = rcu_preempt pid = 7 prio = 98 target_cpu = 000 ACCS0 - + 2716(2519)[000] dn .1 174330.280461 : ipi_exit + : (Rescheduling interrupts) - 0(-----)[003] dn .4 174330.280468 : sched_wakeup + : comm = ksoftirqd / 3 pid = 29 prio = 120 target_cpu = 003 ACCS0 - 2716(2519)[000] d..3 174330.280472 + : sched_switch + : prev_comm = ACCS0 prev_pid = 2716 prev_prio = 120 prev_state = R == + > next_comm = rcu_preempt next_pid = 7 next_prio = 98 rcu_preempt - 7(7)[000] d..3 174330.280485 + : sched_switch + : prev_comm = rcu_preempt prev_pid = 7 prev_prio = 98 prev_state = S == + > next_comm = ACCS0 next_pid = 2716 next_prio = 120 < idle > -0(-----)[003] d..3 174330.280494 + : sched_switch + : prev_comm = swapper / 3 prev_pid = 0 prev_prio = 120 prev_state = + R == > next_comm = ksoftirqd / 3 next_pid = 29 next_prio = 120 ksoftirqd / 3 - 29(29)[003]..s1 174330.280504 + : softirq_entry : vec = 9 [action = RCU] ksoftirqd / 3 - 29(29)[003] d.s3 174330.280510 : sched_waking + : comm = rcu_preempt pid = 7 prio = 98 target_cpu = 000 ACCS0 - 2716(2519)[000] d..1 174330.280519 : ipi_entry + : (Rescheduling interrupts)ksoftirqd / 3 - 29(29)[003]..s1 174330.280521 : softirq_exit + : vec = 9 [action = RCU] ACCS0 - 2716(2519)[000] dnh2 174330.280523 : sched_wakeup + : comm = rcu_preempt pid = 7 prio = 98 target_cpu = 000 ACCS0 - 2716(2519)[000] dn .1 174330.280524 : ipi_exit + : (Rescheduling interrupts) "; + +namespace SysTuning { +namespace trace_analyzer { +// TestSuite: +class BytraceParserTest : public ::testing::Test { +public: + static void SetUpTestCase() {} + static void TearDownTestCase() {} + void SetUp() override {} + + void TearDown() override {} +}; + +HWTEST_F(BytraceParserTest, Parse) +{ + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(g_str.c_str(), g_str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(BytraceParserTest, Parse_no_data1) +{ + std::string str; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(BytraceParserTest, Parse_no_data2) +{ + std::string str = " "; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(BytraceParserTest, Parse_error_data) +{ + std::string str = "1111111111111111111111111111111111111111111111"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(BytraceParserTest, Parse_error_data1) +{ + std::string str = + "TRACE: + # tracer: nop + # "; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(BytraceParserTest, Parse_error_data2) +{ + std::string str = "\nafafda "; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} +} // namespace trace_analyzer +} diff --git a/trace_analyzer/test/bytrace/event_parser_test.cpp b/trace_analyzer/test/bytrace/event_parser_test.cpp new file mode 100755 index 000000000..21afebc4b --- /dev/null +++ b/trace_analyzer/test/bytrace/event_parser_test.cpp @@ -0,0 +1,458 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include + +#include "bytrace_parser.h" +#include "event_parser.h" + +namespace SysTuning { +namespace trace_analyzer { +// TestSuite: +class EventParserTest : public ::testing::Test { +public: + static void SetUpTestCase() {} + static void TearDownTestCase() {} + void SetUp() override {} + + void TearDown() override {} +}; + +HWTEST_F(EventParserTest, ParseLine) +{ + BytraceLine bytraceLine; + bytraceLine.ts = 1616439852302; + bytraceLine.pid = 1; + bytraceLine.cpu = 0; + bytraceLine.task = "ACCS0-2716"; + bytraceLine.pidStr = "12"; + bytraceLine.tGidStr = "12"; + bytraceLine.tGidStr = "softirq_raise"; + bytraceLine.argsStr = "vec=9 [action=RCU]"; + + TraceAnalyzerContext ctx; + EventParser eventParser(ctx); + + int result = eventParser.ParseLine(bytraceLine); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, ParseLine_error) +{ + BytraceLine bytraceLine; + TraceAnalyzerContext ctx; + EventParser eventParser(ctx); + + int result = eventParser.ParseLine(bytraceLine); + + EXPECT_EQ(result, false); +} + +HWTEST_F(EventParserTest, trace_event_clock_sync) +{ + std::string str = + "atrace-12728 (12728) [003] ...1 174330.280300: tracing_mark_write: trace_event_clock_sync: " + "parent_ts=23139.998047 "; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(EventParserTest, trace_event_clock_sync) +{ + std::string str = + "atrace-12728 (12728) [003] ...1 174330.280300: tracing_mark_write: trace_event_clock_sync: " + "parent_ts=23139.998047 "; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(EventParserTest, tracing_mark_write_C) +{ + std::string str = "ACCS0-2716 ( 2519) [000] ...1 174330.284808: tracing_mark_write: C|2519|Heap size (KB)|2906"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, tracing_mark_write_BE) +{ + std::string str = "system-1298 ( 1298) [001] ...1 174330.287420: tracing_mark_write: B|1298|Choreographer#doFrame + system - 1298(1298)[001]... 1 174330.287622 : tracing_mark_write : E | 1298 "; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, tracing_mark_write_SF) +{ + std::string str = + "system-1298 ( 1298) [001] ...1 174330.287478: tracing_mark_write: S|1298|animator:translateX|18888109 + system - + 1298(1298)[001]... 1 174330.287514 : tracing_mark_write : F | 1298 | animator : translateX | 18888109 "; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, tracing_mark_write_error_point) +{ + std::string str = + "system-1298 ( 1298) [001] ...1 174330.287478: tracing_mark_write: G|1298|animator:translateX|18888109 + system - + 1298(1298)[001]... 1 174330.287514 : tracing_mark_write : F | 1298 | animator : translateX | 18888109 "; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(EventParserTest, tracing_mark_write_error_length) +{ + std::string str = "system-1298 ( 1298) [001] ...1 174330.287478: tracing_mark_write: B|2"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(EventParserTest, tracing_mark_write_error_formart) +{ + std::string str = "system-1298 ( 1298) [001] ...1 174330.287478: tracing_mark_write: B2ggg"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(EventParserTest, tracing_mark_write_error_formart1) +{ + std::string str = "system-1298 ( 1298) [001] ...1 174330.287478: tracing_mark_write:aaaaffff B2ggg"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(EventParserTest, cpu_idle) +{ + std::string str = "-0 (-----) [003] d..2 174330.280761: cpu_idle: state=2 cpu_id=3 "; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, irq_handler_entry) +{ + std::string str = + "ACCS0-2716 ( 2519) [000] d.h1 174330.280362: irq_handler_entry: irq=19 name=408000.qcom,cpu-bwmon"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, irq_handler_exit) +{ + std::string str = "ACCS0-2716 ( 2519) [000] d.h1 174330.280382: irq_handler_exit: irq=19 ret=handled"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, sched_waking) +{ + std::string str = + "ACCS0-2716 ( 2519) [000] d..5 174330.280567: sched_waking: comm=Binder:924_6 pid=1332 prio=120 " + "target_cpu=000"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, sched_wakeup) +{ + std::string str = + "ACCS0-2716 ( 2519) [000] d..6 174330.280575: sched_wakeup: comm=Binder:924_6 pid=1332 prio=120 " + "target_cpu=000"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, trace_event_clock_sync) +{ + std::string str = + " atrace-12728 (12728) [003] ...1 174330.280300: tracing_mark_write: trace_event_clock_sync: " + "parent_ts=23139.998047 "; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(EventParserTest, tracing_mark_write_C) +{ + std::string str = " ACCS0-2716 ( 2519) [000] ...1 174330.284808: tracing_mark_write: C|2519|Heap size (KB)|2906"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, tracing_mark_write_BE) +{ + std::string str = + "system-1298 ( 1298) [001] ...1 174330.287420: tracing_mark_write: B|1298|Choreographer#doFrame + system - 1298(1298)[001]... 1 174330.287622 : tracing_mark_write : E | 1298 "; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, tracing_mark_write_SF) +{ + std::string str = + "system-1298 ( 1298) [001] ...1 174330.287478: tracing_mark_write: S|1298|animator:translateX|18888109 + system - 1298(1298)[001]... 1 174330.287514 : tracing_mark_write : F | 1298 | animator : translateX | + 18888109 "; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, tracing_mark_write_error_point) +{ + std::string str = + "system-1298 ( 1298) [001] ...1 174330.287478: tracing_mark_write: G|1298|animator:translateX|18888109 + system - 1298(1298)[001]... 1 174330.287514 : tracing_mark_write : F | + 1298 | animator : translateX | 18888109 "; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(EventParserTest, tracing_mark_write_error_length) +{ + std::string str = " system-1298 ( 1298) [001] ...1 174330.287478: tracing_mark_write: B|2"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(EventParserTest, tracing_mark_write_error_formart) +{ + std::string str = " system-1298 ( 1298) [001] ...1 174330.287478: tracing_mark_write: B2ggg"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(EventParserTest, tracing_mark_write_error_formart1) +{ + std::string str = " system-1298 ( 1298) [001] ...1 174330.287478: tracing_mark_write:aaaaffff B2ggg"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, false); +} + +HWTEST_F(EventParserTest, binder_transaction) +{ + std::string str = + " ACCS0-2716 ( 2519) [000] ...1 174330.280558: binder_transaction: transaction=28562407 dest_node=4336 " + "dest_proc=924 dest_thread=0 reply=0 flags=0x10 code=0x3"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, binder_lock) +{ + std::string str = " <...>-1332 (-----) [000] ...1 174330.289231: binder_lock: transaction=28562426"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, binder_locked) +{ + std::string str = " <...>-1332 (-----) [000] ...1 174330.289232: binder_locked: transaction=28562426"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, binder_unlock) +{ + std::string str = " <...>-1332 (-----) [000] ...1 174330.289233: binder_unlock: transaction=28562426"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, binder_transaction_alloc_buf) +{ + std::string str = + " ACCS0-2716 ( 2519) [000] ...1 174330.290071: binder_transaction_alloc_buf: transaction=28562428 " + "data_size=80 offsets_size=0"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, sched_switch) +{ + std::string str = + " ACCS0-2716 ( 2519) [000] d..3 174330.289220: sched_switch: prev_comm=ACCS0 prev_pid=2716 prev_prio=120 " + "prev_state=R+ ==> next_comm=Binder:924_6 next_pid=1332 next_prio=120"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, task_rename) +{ + std::string str = + "<...>-2093 (-----) [001] ...2 174332.792290: task_rename: pid=12729 oldcomm=perfd newcomm=POSIX timer 249" + "oom_score_adj=-1000"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, task_newtask) +{ + std::string str = + "<...>-2 (-----) [003] ...1 174332.825588: task_newtask: pid=12730 comm=kthreadd clone_flags=800711" + "oom_score_adj=0"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, workqueue_execute_start) +{ + std::string str = + " <...>-12180 (-----) [001] ...1 174332.827595: workqueue_execute_start: work struct 0000000000000000: " + "function pm_runtime_work"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(EventParserTest, workqueue_execute_end) +{ + std::string str = + " <...>-12180 (-----) [001] ...1 174332.828056: workqueue_execute_end: work struct 0000000000000000"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} +} // namespace trace_analyzer +} // namespace SysTuning diff --git a/trace_analyzer/test/bytrace/thread_state_test.cpp b/trace_analyzer/test/bytrace/thread_state_test.cpp new file mode 100755 index 000000000..806fb6cb7 --- /dev/null +++ b/trace_analyzer/test/bytrace/thread_state_test.cpp @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include + +#include "bytrace_parser.h" + +namespace SysTuning { +namespace trace_analyzer { +// TestSuite: +class ThreadStateTest : public ::testing::Test { +public: + static void SetUpTestCase() {} + static void TearDownTestCase() {} + void SetUp() override {} + + void TearDown() override {} +}; + +HWTEST_F(ThreadStateTest, ThreadState) +{ + std::string str = + "<...>-968 (-----) [003] d..3 174332.828058: sched_switch: prev_comm=anim prev_pid=968 prev_prio=116 " + "prev_state=S ==> next_comm=display next_pid=966 next_prio=117"; + ThreadState threadState(str); + + uint32_t result = threadState.State(); + + EXPECT_EQ(result, 0x10); +} + +HWTEST_F(ThreadStateTest, ThreadState1) +{ + std::string str = + "<...>-968 (-----) [003] d..3 174332.828058: sched_switch: prev_comm=anim prev_pid=968 prev_prio=116 " + "prev_state=S ==> next_comm=display next_pid=966 next_prio=117"; + TraceAnalyzerContext ctx; + BytraceParser bytraceParser(ctx); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} + +HWTEST_F(ThreadStateTest, ThreadState2) +{ + std::string str = + "< ... > -968(-----)[003] d..3 174332.828058 : sched_switch + : prev_comm = anim prev_pid = 968 prev_prio = 116 prev_state = + S == > next_comm = display next_pid = 966 next_prio = + 117 < ... > -1823(-----)[002] dn .4 174332.828061 : sched_wakeup : comm = system pid = + 1298 prio = 110 target_cpu = + 002 < ... > -966(-----)[003]... 1 174332.828062 : tracing_mark_write : B | 924 | + com.server.wm.RootWindowContainer$MyHandler : #1 < ... > -1823(-----)[002] dn .2 174332.828064 + : ipi_entry : (Rescheduling interrupts)<...> - 966(-----)[003] d..3 174332.828064 : sched_waking : comm = + Binder : 924_11 pid = 3672 prio = 120 target_cpu = + 002 < ... > -12180(-----)[001] d..3 174332.828065 : sched_switch : prev_comm = + kworker / 1 : 0 prev_pid = 12180 prev_prio = 120 prev_state = + S == > next_comm = Binder : 924_C next_pid = 2183 next_prio = + 120 < ... > -1823(-----)[002] dnh3 174332.828067 : sched_blocked_reason + : pid = 569 iowait = 0 caller = rpm_resume + 0x138 / 0x63c < ... > -1823(-----)[002] dnh3 174332.828069 + : sched_wakeup : comm = HwBinder : 508_1 pid = 569 prio = 112 target_cpu = + 002 < ... > -1823(-----)[002] dn .2 174332.828070 : ipi_exit + : (Rescheduling interrupts)<...> - 1823(-----)[002] dn .2 174332.828073 : ipi_entry + : (Single function call interrupts)<...> - + 1823(-----)[002] dnh3 174332.828074 : sched_waking : comm = kschedfreq : 2 pid = 12391 prio = 49 target_cpu = + 002 < ... > -964(-----)[000] d..1 174332.828075 : ipi_entry + : (Rescheduling interrupts)<...> - 2183(-----)[001] d..3 174332.828080 : sched_waking : comm = + PowerManagerSer pid = 987 prio = 116 target_cpu = + 001 < ... > -1823(-----)[002] dnh4 174332.828080 : sched_wakeup + : comm = kschedfreq : 2 pid = 12391 prio = 49 target_cpu = 002 < ... > -964(-----)[000] d.h2 174332.828082 + : sched_blocked_reason + : pid = 3672 iowait = 0 caller = __fdget_pos + 0x5c / 0x9c < ... > -1823(-----)[002] dn .2 174332.828082 + : ipi_exit : (Single function call interrupts)<...> - 2183(-----)[001] dn .4 174332.828086 : sched_wakeup + : comm = PowerManagerSer pid = 987 prio = 116 target_cpu = 001 < ... > -1823(-----)[002] d..3 174332.828086 + : sched_switch : prev_comm = Binder : 924_A prev_pid = 1823 prev_prio = 110 prev_state = + R + == > next_comm = kschedfreq : 2 next_pid = 12391 next_prio = 49 "; + TraceAnalyzerContext context; + BytraceParser bytraceParser(context); + + int result = bytraceParser.Parse(str.c_str(), str.size()); + + EXPECT_EQ(result, true); +} +} // namespace trace_analyzer +} // namespace SysTuning diff --git a/trace_analyzer/test/clock_tracker_test.cpp b/trace_analyzer/test/clock_tracker_test.cpp new file mode 100644 index 000000000..9a63e554c --- /dev/null +++ b/trace_analyzer/test/clock_tracker_test.cpp @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include + +#include "src/trace_analyzer/tracker/clock_tracker.h" + +using namespace testing::ext; + +class ClockTrackerTest : public ::testing::Test { +protected: + void SetUp() override + { + context_.storage = std::make_unique(); + context_.clockTracker_ = std::make_unique(&context_); + } + + void TearDown() override {} + +private: + SysTuning::trace_analyzer::TraceAnalyzerContext context_; +}; + +HWTEST_F(ClockTrackerTest, ConvertTimestamp, TestSize.Level1) +{ + std::vector snapShot0; + SysTuning::trace_analyzer::SnapShot a{1, 100}; + SysTuning::trace_analyzer::SnapShot b{2, 200}; + SysTuning::trace_analyzer::SnapShot c{3, 300}; + SysTuning::trace_analyzer::SnapShot d{4, 400}; + snapShot0.push_back(a); + snapShot0.push_back(b); + snapShot0.push_back(c); + snapShot0.push_back(d); + context_.clockTracker_->AddClockSnapshot(snapShot0); + + std::vector snapShot1; + SysTuning::trace_analyzer::SnapShot a1{1, 200}; + SysTuning::trace_analyzer::SnapShot b1{2, 350}; + SysTuning::trace_analyzer::SnapShot c1{3, 400}; + SysTuning::trace_analyzer::SnapShot d1{4, 800}; + snapShot1.push_back(a1); + snapShot1.push_back(b1); + snapShot1.push_back(c1); + snapShot1.push_back(d1); + context_.clockTracker_->AddClockSnapshot(snapShot1); + + EXPECT_EQ(context_.clockTracker_->Convert(1, 150, 2), 250); + EXPECT_EQ(context_.clockTracker_->Convert(1, 200, 2), 350); + EXPECT_EQ(context_.clockTracker_->Convert(1, 101, 3), 301); + EXPECT_EQ(context_.clockTracker_->Convert(1, 102, 4), 402); + EXPECT_EQ(context_.clockTracker_->Convert(2, 101, 3), 201); + + EXPECT_EQ(context_.clockTracker_->Convert(3, 351, 2), 251); + EXPECT_EQ(context_.clockTracker_->Convert(3, 401, 2), 351); + EXPECT_EQ(context_.clockTracker_->Convert(2, 150, 1), 50); + EXPECT_EQ(context_.clockTracker_->Convert(2, 250, 1), 150); + EXPECT_EQ(context_.clockTracker_->Convert(2, 351, 1), 201); +} + +HWTEST_F(ClockTrackerTest, ConvertToPrimary, TestSize.Level1) +{ + std::vector snapShot0; + SysTuning::trace_analyzer::SnapShot a{1, 100}; + SysTuning::trace_analyzer::SnapShot b{2, 200}; + SysTuning::trace_analyzer::SnapShot c{3, 300}; + SysTuning::trace_analyzer::SnapShot d{4, 400}; + snapShot0.push_back(a); + snapShot0.push_back(b); + snapShot0.push_back(c); + snapShot0.push_back(d); + context_.clockTracker_->AddClockSnapshot(snapShot0); + + std::vector snapShot1; + SysTuning::trace_analyzer::SnapShot a1{1, 200}; + SysTuning::trace_analyzer::SnapShot b1{2, 350}; + SysTuning::trace_analyzer::SnapShot c1{3, 400}; + SysTuning::trace_analyzer::SnapShot d1{4, 800}; + snapShot1.push_back(a1); + snapShot1.push_back(b1); + snapShot1.push_back(c1); + snapShot1.push_back(d1); + context_.clockTracker_->AddClockSnapshot(snapShot1); + + context_.clockTracker_->SetPrimaryClock(3); + + EXPECT_EQ(context_.clockTracker_->ToPrimaryTraceTime(1, 150), 350); + EXPECT_EQ(context_.clockTracker_->ToPrimaryTraceTime(1, 101), 301); + EXPECT_EQ(context_.clockTracker_->ToPrimaryTraceTime(2, 101), 201); + EXPECT_EQ(context_.clockTracker_->ToPrimaryTraceTime(2, 351), 401); + EXPECT_EQ(context_.clockTracker_->ToPrimaryTraceTime(4, 350), 250); + EXPECT_EQ(context_.clockTracker_->ToPrimaryTraceTime(4, 420), 320); + EXPECT_EQ(context_.clockTracker_->ToPrimaryTraceTime(4, 801), 401); +} diff --git a/trace_analyzer/test/counter_tracker_test.cpp b/trace_analyzer/test/counter_tracker_test.cpp new file mode 100644 index 000000000..42bdff60f --- /dev/null +++ b/trace_analyzer/test/counter_tracker_test.cpp @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "src/trace_analyzer/tracker/counter_tracker.h" +#include "src/trace_analyzer/tracker/track_tracker.h" + +using namespace testing::ext; + +class CounterTrackerTest : public ::testing::Test { +protected: + void SetUp() override + { + context_.storage = std::make_unique(); + context_.storage->InternString("test0"); + context_.storage->InternString("test1"); + context_.storage->InternString("test2"); + context_.storage->InternString("test3"); + + context_.trackTracker_ = std::make_unique(&context_); + context_.threadCounterTracker_ = std::make_unique( + &context_, SysTuning::trace_analyzer::TrackType::E_THREADCOUNTER_TRACK); + context_.threadTracker_ = std::make_unique( + &context_, SysTuning::trace_analyzer::TrackType::E_THREAD_TRACK); + context_.cpuCounterTracker_ = std::make_unique( + &context_, SysTuning::trace_analyzer::TrackType::E_CPU_COUNTER_TRACK); + context_.processCounterTracker_ = std::make_unique( + &context_, SysTuning::trace_analyzer::TrackType::E_PROCESS_COUNTER_TRACK); + context_.processTrackTracker_ = std::make_unique( + &context_, SysTuning::trace_analyzer::TrackType::E_PROCESS_TRACK_TRACK); + } + + void TearDown() override {} + +private: + SysTuning::trace_analyzer::TraceAnalyzerContext context_; +}; + +HWTEST_F(CounterTrackerTest, ThreadCounterTracker, TestSize.Level1) +{ + uint32_t trackId = context_.threadCounterTracker_->GetOrCreateCertainTrackId(100, 0); + EXPECT_EQ(trackId, 0); + + trackId = context_.threadCounterTracker_->GetOrCreateCertainTrackId(101, 2); + EXPECT_EQ(trackId, 1); + + SysTuning::trace_analyzer::Track* trackTable = context_->storage->mutable_track_table(); + EXPECT_EQ(trackTable->count(), 2); + + SysTuning::trace_analyzer::ThreaCounterTrack* threadCounterTable = + context_->storage->mutable_thread_counter_track(); + EXPECT_EQ(threadCounterTable->count(), 2); + EXPECT_EQ(threadCounterTable->trackId(0), 0); + EXPECT_EQ(threadCounterTable->trackId(1), 1); + EXPECT_EQ(threadCounterTable->utid(0), 100); + EXPECT_EQ(threadCounterTable->utid(1), 101); + EXPECT_EQ(threadCounterTable->nameId(0), 0); + EXPECT_EQ(threadCounterTable->nameId(1), 2); +} + +HWTEST_F(CounterTrackerTest, ThreadTracker, TestSize.Level1) +{ + uint32_t trackId = context_.threadTracker_->GetOrCreateCertainTrackId(201, 2); + EXPECT_EQ(trackId, 0); + + trackId = context_.threadTracker_->GetOrCreateCertainTrackId(202, 3); + EXPECT_EQ(trackId, 1); + + SysTuning::trace_analyzer::Track* trackTable = context_->storage->mutable_track_table(); + EXPECT_EQ(trackTable->count(), 2); + + SysTuning::trace_analyzer::ThreaCounterTrack* threadTable = context_->storage->mutable_thread_track(); + EXPECT_EQ(threadTable->count(), 2); + EXPECT_EQ(threadTable->trackId(0), 0); + EXPECT_EQ(threadTable->trackId(1), 1); + EXPECT_EQ(threadTable->utid(0), 201); + EXPECT_EQ(threadTable->utid(1), 202); + EXPECT_EQ(threadTable->nameId(0), 2); + EXPECT_EQ(threadTable->nameId(1), 3); +} + +HWTEST_F(CounterTrackerTest, CpuTracker, TestSize.Level1) +{ + uint32_t trackId = context_.cpuCounterTracker_->GetOrCreateCertainTrackId(0, 0); + EXPECT_EQ(trackId, 0); + + trackId = context_.cpuCounterTracker_->GetOrCreateCertainTrackId(1, 1); + EXPECT_EQ(trackId, 1); + + SysTuning::trace_analyzer::Track* trackTable = context_->storage->mutable_track_table(); + EXPECT_EQ(trackTable->count(), 2); + + SysTuning::trace_analyzer::CpuCounter* cpuCounterTable = context_->storage->mutable_cpu_counters(); + EXPECT_EQ(cpuCounterTable->cpu_counter_count(), 2); + EXPECT_EQ(cpuCounterTable->id(0), 0); + EXPECT_EQ(cpuCounterTable->id(1), 1); + EXPECT_EQ(cpuCounterTable->cpu(0), 201); + EXPECT_EQ(cpuCounterTable->cpu(1), 202); +} + +HWTEST_F(CounterTrackerTest, ProcessCounterTracker, TestSize.Level1) +{ + uint32_t trackId = context_.process_counter_track->GetOrCreateCertainTrackId(300, 0); + EXPECT_EQ(trackId, 0); + + trackId = context_.process_counter_track->GetOrCreateCertainTrackId(301, 1); + EXPECT_EQ(trackId, 1); + + SysTuning::trace_analyzer::Track* trackTable = context_->storage->mutable_track_table(); + EXPECT_EQ(trackTable->count(), 2); + + SysTuning::trace_analyzer::ProcessCounterTrack* processCounterTable = + context_->storage->mutable_process_counter_track(); + EXPECT_EQ(processCounterTable->process_counter_track_count(), 2); + EXPECT_EQ(processCounterTable->id(0), 0); + EXPECT_EQ(processCounterTable->id(1), 1); + EXPECT_EQ(processCounterTable->upids(0), 300); + EXPECT_EQ(processCounterTable->upids(1), 301); +} + +HWTEST_F(CounterTrackerTest, ProcessTracker, TestSize.Level1) +{ + uint32_t trackId = context_.processTrackTracker_->GetOrCreateCertainTrackId(400, 0); + EXPECT_EQ(trackId, 0); + + trackId = context_.processTrackTracker_->GetOrCreateCertainTrackId(401, 1); + EXPECT_EQ(trackId, 1); + + SysTuning::trace_analyzer::Track* trackTable = context_->storage->mutable_track_table(); + EXPECT_EQ(trackTable->count(), 2); + + SysTuning::trace_analyzer::ProcessCounterTrack* processTrackTable = context_->storage->mutable_process_track(); + EXPECT_EQ(processTrackTable->process_track_count(), 2); +} diff --git a/trace_analyzer/test/cpu_tracker_test.cpp b/trace_analyzer/test/cpu_tracker_test.cpp new file mode 100644 index 000000000..2d2693ce3 --- /dev/null +++ b/trace_analyzer/test/cpu_tracker_test.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "src/trace_analyzer/tracker/cpu_tracker.h" + +using namespace testing::ext; + +class CpuTrackerTest : public ::testing::Test { +protected: + void SetUp() override + { + context_.storage = std::make_unique(); + context_.cpuTracker_ = std::make_unique(&context_); + } + + void TearDown() override {} + +private: + SysTuning::trace_analyzer::TraceAnalyzerContext context_; +}; + +HWTEST_F(CpuTrackerTest, GenThreadStateTable, TestSize.Level1) +{ + context_.cpuTracker_->InsertWakeingEvent(10000, 200); + context_.cpuTracker_->InsertSwitchEvent(10500, 0, 105, 120, 1, 200, 120); + context_.cpuTracker_->InsertSwitchEvent(10700, 0, 200, 120, 1, 210, 120); + context_.cpuTracker_->InsertWakeingEvent(11000, 200); + context_.cpuTracker_->InsertSwitchEvent(11100, 0, 110, 120, 1, 200, 120); + context_.cpuTracker_->InsertSwitchEvent(11500, 0, 200, 120, 1, 210, 120); + context_.cpuTracker_->InsertWakeingEvent(12000, 200); + context_.cpuTracker_->InsertSwitchEvent(12600, 0, 120, 120, 1, 200, 120); + context_.cpuTracker_->InsertSwitchEvent(12800, 0, 200, 120, 16, 210, 120); + + SysTuning::trace_analyzer::ThreadStateStorage* threadStateTable = context_->storage->mutable_ThreadStateObj(); + + EXPECT_GT(threadStateTable->thread_state_count(), 6); + EXPECT_EQ(context_.cpuTracker_->FindUtidInThreadStateTableByCpu(0), 210); +} diff --git a/trace_analyzer/test/event_tracker_test.cpp b/trace_analyzer/test/event_tracker_test.cpp new file mode 100644 index 000000000..b2025cebe --- /dev/null +++ b/trace_analyzer/test/event_tracker_test.cpp @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "src/trace_analyzer/tracker/cpu_tracker.h" + +using namespace testing::ext; + +class EventTrackerTest : public ::testing::Test { +protected: + void SetUp() override + { + context_.storage = std::make_unique(); + context_.storage->InternString("process0"); + context_.storage->InternString("process1"); + context_.storage->InternString("process2"); + context_.storage->InternString("process3"); + context_.storage->InternString("thread4"); + context_.storage->InternString("thread5"); + context_.storage->InternString("thread6"); + + context_.trackTracker_ = std::make_unique(&context_); + context_.process_tracker = std::make_unique(&context_); + context_.eventTracker_ = std::make_unique(&context_); + } + + void TearDown() override {} + +private: + SysTuning::trace_analyzer::TraceAnalyzerContext context_; +}; + +HWTEST_F(EventTrackerTest, PushSchedSwitch, TestSize.Level1) +{ + context_.eventTracker_->PushSchedSwitch(0, 100000, 101, 200, "threadTest0"); + context_.eventTracker_->PushSchedSwitch(0, 110000, 200, 201, "threadTest1"); + context_.eventTracker_->PushSchedSwitch(0, 120000, 201, 203, "threadTest2"); + context_.eventTracker_->PushSchedSwitch(0, 140000, 203, 205, "threadTest3"); + context_.eventTracker_->PushSchedSwitch(0, 170000, 205, 207, "threadTest4"); + context_.eventTracker_->PushSchedSwitch(0, 200000, 207, 209, "threadTest5"); + + SysTuning::trace_analyzer::Slices* slices = context_->storage->mutable_slices(); + + EXPECT_GT(slices->slice_count(), 6); +} diff --git a/trace_analyzer/test/process_tracker_test.cpp b/trace_analyzer/test/process_tracker_test.cpp new file mode 100644 index 000000000..3e653e219 --- /dev/null +++ b/trace_analyzer/test/process_tracker_test.cpp @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include + +#include "src/trace_analyzer/tracker/process_tracker.h" + +using namespace testing::ext; + +class ProcessTrackerTest : public ::testing::Test { +protected: + void SetUp() override + { + context_.storage = std::make_unique(); + context_.storage->InternString("process0"); + context_.storage->InternString("process1"); + context_.storage->InternString("process2"); + context_.storage->InternString("process3"); + context_.storage->InternString("thread4"); + context_.storage->InternString("thread5"); + context_.storage->InternString("thread6"); + + context_.processTracker_ = std::make_unique(&context_); + } + + void TearDown() override {} + +private: + SysTuning::trace_analyzer::TraceAnalyzerContext context_; +}; + +HWTEST_F(ProcessTrackerTest, UpdateThread, TestSize.Level1) +{ + uint32_t utid0 = context_.processTracker_->UpdateThread(1000, 101, 4); + EXPECT_EQ(utid0, 1); + + uint32_t utid1 = context_.processTracker_->UpdateThread(100, 95); + EXPECT_EQ(utid1, 2); + + SysTuning::trace_analyzer::Thread* thread = context_->storage->GetMutableThread(utid0); + EXPECT_EQ(thread->tid, 101); + EXPECT_EQ(thread->start_ns, 10000); + + thread = context_->storage->GetMutableThread(utid0); + EXPECT_EQ(thread->tid, 100); + EXPECT_EQ(thread->upid, 1); +} + +HWTEST_F(ProcessTrackerTest, UpdateProcess, TestSize.Level1) +{ + uint32_t upid0 = context_.processTracker_->UpdateProcess(1000); + EXPECT_EQ(upid0, 1); + + SysTuning::trace_analyzer::Process* process = context_->storage->GetMutableProcess(upid0); + EXPECT_EQ(process->pid, 1000); + + process = context_->storage->GetMutableProcess(upid1); + EXPECT_EQ(process->pid, 1001); +} + +HWTEST_F(ProcessTrackerTest, Update, TestSize.Level1) +{ + uint32_t upid0 = context_.processTracker_->UpdateProcess(2000); + EXPECT_EQ(upid0, 1); + + SysTuning::trace_analyzer::Process* process = context_->storage->GetMutableProcess(upid0); + EXPECT_EQ(process->pid, 2000); + + SysTuning::trace_analyzer::Thread* thread = context_->storage->GetMutableThread(1); + EXPECT_EQ(thread->tid, 2000); + + SysTuning::trace_analyzer::Thread* thread = context_->storage->GetMutableThread(2); + EXPECT_EQ(thread->tid, 2001); +} diff --git a/trace_analyzer/test/slice_tracker_test.cpp b/trace_analyzer/test/slice_tracker_test.cpp new file mode 100644 index 000000000..301ece1f3 --- /dev/null +++ b/trace_analyzer/test/slice_tracker_test.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "src/trace_analyzer/tracker/counter_tracker.h" +#include "src/trace_analyzer/tracker/process_tracker.h" +#include "src/trace_analyzer/tracker/slice_tracker.h" +#include "src/trace_analyzer/tracker/track_tracker.h" + +using namespace testing::ext; + +class SliceTrackerTest : public ::testing::Test { +protected: + void SetUp() override + { + context_.storage = std::make_unique(); + context_.storage->InternString("category0"); + context_.storage->InternString("category1"); + context_.storage->InternString("name0"); + context_.storage->InternString("name1"); + + context_.trackTracker_ = std::make_unique(&context_); + context_.processTracker_ = std::make_unique(&context_); + context_.threadCounterTracker_ = std::make_unique( + &context_, SysTuning::trace_analyzer::TrackType::E_THREADCOUNTER_TRACK); + context_.threadTracker_ = std::make_unique( + &context_, SysTuning::trace_analyzer::TrackType::E_THREAD_TRACK); + context_.cpuCounterTracker_ = std::make_unique( + &context_, SysTuning::trace_analyzer::TrackType::E_CPU_COUNTER_TRACK); + context_.processCounterTracker_ = std::make_unique( + &context_, SysTuning::trace_analyzer::TrackType::E_PROCESS_COUNTER_TRACK); + context_.processTrackTracker_ = std::make_unique( + &context_, SysTuning::trace_analyzer::TrackType::E_PROCESS_TRACK_TRACK); + context_.sliceTracker_ = std::make_unique(&context_); + } + + void TearDown() override {} + +private: + SysTuning::trace_analyzer::TraceAnalyzerContext context_; +}; + +HWTEST_F(SliceTrackerTest, SliceTest, TestSize.Level1) +{ + context_.sliceTracker_->BeginSlice(100000, 200, 200, 0, 2); + context_.sliceTracker_->EndSlice(105000, 200, 200); + + SysTuning::trace_analyzer::Slices* slices = context_->storage->mutable_slices(); + EXPECT_GT(slices->slice_count(), 0); +} diff --git a/trace_analyzer/test/trace_analyzer_test.cpp b/trace_analyzer/test/trace_analyzer_test.cpp new file mode 100755 index 000000000..ef6432a7d --- /dev/null +++ b/trace_analyzer/test/trace_analyzer_test.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include + +#include "file.h" +#include "log.h" +#include "trace_analyzer.h" + +static char g_argv[3][100] = {"./test.systrace.txt", "-e", "./test.db"}; + +using namespace SysTuning; +using namespace base; +using namespace trace_analyzer; + +// TestSuite: +class TraceAnalyzerTest : public ::testing::Test { +public: + static void SetUpTestCase() {} + static void TearDownTestCase() {} + void SetUp() override {} + + void TearDown() override {} +}; + +HWTEST_F(TraceAnalyzerTest, EnterTraceAnalyzer) +{ + int argc = 3; + ExportStatusToLog(ABNORMAL); + int result = SysTuning::trace_analyzer::EnterTraceAnalyzer(argc, &g_argv); + ExportStatusToLog(GetAnalysisResult()); + EXPECT_EQ(result, 1); +} + +HWTEST_F(TraceAnalyzerTest, EnterTraceAnalyzer_args_too_short) +{ + int argc = 1; + int result = SysTuning::trace_analyzer::EnterTraceAnalyzer(argc, &argv); + EXPECT_EQ(result, 0); +} + +HWTEST_F(TraceAnalyzerTest, EnterTraceAnalyzer_version) +{ + int argc = 1; + char argv[3][100] = {"-v"}; + int result = SysTuning::trace_analyzer::EnterTraceAnalyzer(argc, &argv); + EXPECT_EQ(result, 1); + + char argv1[3][100] = {"--v"}; + int result = SysTuning::trace_analyzer::EnterTraceAnalyzer(argc, &1argv); + EXPECT_EQ(result, 1); + + char argv2[3][100] = {"--version"}; + int result = SysTuning::trace_analyzer::EnterTraceAnalyzer(argc, &2argv); + EXPECT_EQ(result, 1); + + char argv3[3][100] = {"-version"}; + int result = SysTuning::trace_analyzer::EnterTraceAnalyzer(argc, &3argv); + EXPECT_EQ(result, 1); +} diff --git a/trace_analyzer/test/track_tracker_test.cpp b/trace_analyzer/test/track_tracker_test.cpp new file mode 100644 index 000000000..444a92342 --- /dev/null +++ b/trace_analyzer/test/track_tracker_test.cpp @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "src/trace_analyzer/tracker/track_tracker.h" + +using namespace testing::ext; + +class TrackTrackerTest : public ::testing::Test { +protected: + void SetUp() override + { + context_.storage = std::make_unique(); + context_.trackTracker_ = std::make_unique(&context_); + } + + void TearDown() override {} + +private: + SysTuning::trace_analyzer::TraceAnalyzerContext context_; +}; + +HWTEST_F(TrackTrackerTest, AddCpuCounterTrack, TestSize.Level1) +{ + uint32_t trackId = context_.trackTracker_->AddTrack("cpu_counter_track", "cpu1"); + EXPECT_EQ(trackId, 0); + + trackId = context_.trackTracker_->AddTrack("cpu_counter_track", "cpu2"); + EXPECT_EQ(trackId, 1); + + SysTuning::trace_analyzer::Track* trackTable = context_->storage->mutable_track_table(); + EXPECT_EQ(trackTable->count(), 2); +} + +HWTEST_F(TrackTrackerTest, AddThreadTrack, TestSize.Level1) +{ + uint32_t threadTrackId = context_.trackTracker_->AddTrack("thread_counter_track", "threadCount1"); + EXPECT_EQ(threadTrackId, 0); + + threadTrackId = context_.trackTracker_->AddTrack("thread_counter_track", "threadCount2"); + EXPECT_EQ(threadTrackId, 1); + + SysTuning::trace_analyzer::Track* trackTable = context_->storage->mutable_track_table(); + EXPECT_EQ(trackTable->count(), 2); + + threadTrackId = context_.trackTracker_->AddTrack("thread_track", "thread1"); + EXPECT_EQ(threadTrackId, 2); + + threadTrackId = context_.trackTracker_->AddTrack("thread_track", "thread2"); + EXPECT_EQ(threadTrackId, 3); + + EXPECT_EQ(trackTable->count(), 4); +} diff --git a/trace_analyzer/tools/gn b/trace_analyzer/tools/gn new file mode 100755 index 000000000..6bb4745c5 --- /dev/null +++ b/trace_analyzer/tools/gn @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CMD="gn" +source "$(dirname "${BASH_SOURCE[0]}")/run-buildtools-binary.sh" diff --git a/trace_analyzer/tools/ninja b/trace_analyzer/tools/ninja new file mode 100755 index 000000000..4b5f42629 --- /dev/null +++ b/trace_analyzer/tools/ninja @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CMD="ninja" +source "$(dirname "${BASH_SOURCE[0]}")/run-buildtools-binary.sh" diff --git a/trace_analyzer/tools/run-buildtools-binary.sh b/trace_analyzer/tools/run-buildtools-binary.sh new file mode 100644 index 000000000..79eb4cd0a --- /dev/null +++ b/trace_analyzer/tools/run-buildtools-binary.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +PROJECT_ROOT="$(cd -P ${BASH_SOURCE[0]%/*}/..; pwd)" + +if [[ -n "$BASH_VERSION" && "${BASH_SOURCE:-$0}" == "$0" ]]; then + echo "ERROR: ${BASH_SOURCE:-$0} must be sourced" + exit 1 +fi + +case "$(uname -s | tr '[A-Z]' '[a-z]')" in + linux) + OS="linux64";; + *) + echo "Unsupported platform" + exit 1 + ;; +esac + +BIN_PATH="$PROJECT_ROOT/buildtools/$OS/$CMD" +if [ ! -x "$BIN_PATH" ]; then + echo "Cannot find $BIN_PATH. Run tools/install-build-deps first." + exit 1 +fi + +exec "$BIN_PATH" "$@"