• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## 背景
2当前系统需要获取进程的CPU维测数据,支持开发者性能问题分析,通过遍例所有进程的结点虽然可以获取所有进程的CPU使用率,但是该方法性能相对较差,为了提升获取效率,因此开僻了内核的设备结点,通过结点可能快速获取CPU的数据。
3
4## ucollection(unified collection)模块
5通过ioctl的方式向设备结点/dev/uncollection发送命令,内核根据不同的命令做不同的处理,返回相应的维测数据。
6![framework](figures/collector_framework.png)
7
8## 目录
9统一采集设备的主要代码目录结构如下:
10
11```
12# 代码路径 /kernel/linux/common_modules/xpm
13├── apply_ucollection.sh          # XPM 头文件
14├── figures                       # ReadMe 内嵌图例
15├── Konfig
16├── Makefile
17├── README_zh.md
18├── ucollection_process_cpu.c     # 获取进程CPU数据
19├── ucollection_process_cpu.h
20├── unified_collection_data.h
21├── unified_collection_driver.c   # 注册/dev/ucollection设备
22```
23
24## 相关仓
25
26[内核子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/%E5%86%85%E6%A0%B8%E5%AD%90%E7%B3%BB%E7%BB%9F.md)
27
28[kernel_linux_5.10](https://gitee.com/openharmony/kernel_linux_5.10)
29
30[kernel_linux_config](https://gitee.com/openharmony/kernel_linux_config)
31
32[kernel_linux_build](https://gitee.com/openharmony/kernel_linux_build)
33