功能概述
hbmem api使用说明,包括com buffer、graphic buffer、graphic buffer group、queue、pool、share pool的创建使用,多进程共享等。
软件架构说明
本文基于libhbmem API实现,调用libhbmem提供的API,实现不同buffer类型的内存申请和进程间共享。

代码位置及目录结构
1. 代码位置:/test/samples/platform_samples/source/S83_Sample/S83E02_Communication/libhbmem_sample
2. 目录结构:
./
├── Kconfig
├── Makefile
├── Makefile.in
└── src
├── Makefile
├── sample_alloc.c
├── sample.c
├── sample_common.c
├── sample_common.h
├── sample_pool.c
├── sample_queue.c
├── sample_share.c
└── sample_share_pool.c
根目录包含Kconfig和外部接口的makefile;
Kconfig用于控制该demo是否加入整体编译;
src目录下的makefile用于src目录下的编译;
src目录下的sample.c是main入口的所在文件。
API流程说明
libhbmem库调用ion进行buffer分配

com buffer、graph buffer、graphic buffer group 分配流程图

queue使用流程图

pool使用流程图

share pool 使用流程图

编译环境
本文的编译环境使用SDK中的build工具,请参考: :doc:`Build环境建立 `。
编译说明
本文主要依赖libhbmem提供的头文件:
#include
#include
编译依赖的库有如下:
LIBS += -lhbmem -lpthread -lalog -ldl -lstdc++
编译命令
# 进入SDK所有目录{sdk_dir},并source构建环境(参见上)。
# 编译本sample:
bdm libhbmem-sample
# 输出文件:
{sdk_dir}/out/debug-gcc_{gcc_version}/build/test/samples/platform_samples/source/S83_Sample/S83E02_Communication/libhbmem_sample
运行
支持平台
- Matrix 6E/M
运行方法
创建com buffer
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 1
创建cache,noncached com buffer,赋值,比较耗时
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 2
在各个heaps里,创建com buffer
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 3
创建graph buffer
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 4
在各个heaps里,创建graph buffer
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 5
创建graph buffer group
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 6
在各个heaps里,创建graph buffer group
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 7
进程内common buffer共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 8
进程内common buffer共享,consume_cnt
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 9
进程间common buffer共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 10
进程内graphic buffer共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 11
进程内graphic buffer共享,consume_cnt
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 12
进程间graphic buffer共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 13
进程内graphic buffer group共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 14
进程内graphic buffer group共享,consume_cnt
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 15
进程间graphic buffer group共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 16
进程间share pool 共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 17
share pool使用
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 18
buffer queue 使用
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 19
pool使用
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 20
在graphic buffer与common buffer之间实现buffer转换
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 21
增加common buffer用户态引用计数
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 22
增加graphic buffer用户态引用计数
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 23
运行参数说明
- -m 指定sample用例,具体见运行结果展示
测试结果说明
- 如果log最后以xxxx done结尾,则表示sample执行成功
运行结果展示
创建com buffer
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 1
sample_mode = 1
=================================================
Ready to sample_alloc_com_buf
alloc com buf, share_id: 16
[1752:1752] Do system command cat /sys/kernel/debug/ion/clients/1752*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 400000 : 1 : 1 : fd48e1ab : 3: 16 : 1
[1752:1752] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 1752 | grep -w libhbmem_sample.
libhbmem_sample 1752 4194304
libhbmem_sample 1752 other 4194304 0
[1752:1752] Result 0.
free com buf
[1752:1752] Do system command cat /sys/kernel/debug/ion/clients/1752*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
[1752:1752] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 1752 | grep -w libhbmem_sample.
[1752:1752] Result 256.
sample_alloc_com_buf done
=================================================
创建cache,noncached com buffer,赋值,比较耗时
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 2
sample_mode = 2
=================================================
Ready to sample_alloc_com_buf_with_cache
memset uncached buf(size:4194304) use time: 820751
memset cached buf(size:4194304) use time: 578361
sample_alloc_com_buf_with_cache done
=================================================
在各个heaps里,创建com buffer
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 3
sample_mode = 3
=================================================
Ready to sample_alloc_com_buf_with_heapmask
alloc com buf form ion_cma, size: 1048576
[1794:1794] Do system command cat /sys/kernel/debug/ion/clients/1794*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 100000 : 1 : 1 : 8a533f1b : 3: 16 : 1
[1794:1794] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 1794 | grep -w libhbmem_sample.
libhbmem_sample 1794 1048576
libhbmem_sample 1794 other 1048576 0
[1794:1794] Result 0.
free com buf
alloc com buf form carveout, size: 1048576
[1794:1794] Do system command cat /sys/kernel/debug/ion/clients/1794*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
carveout: 100000 : 1 : 1 : 8a533f1b : 3: 16 : 1
[1794:1794] Do system command cat /sys/kernel/debug/ion/heaps/carveout | grep -w 1794 | grep -w libhbmem_sample.
libhbmem_sample 1794 1048576
libhbmem_sample 1794 other 1048576 0
[1794:1794] Result 0.
free com buf
alloc com buf form custom, size: 1048576
[1794:1794] Do system command cat /sys/kernel/debug/ion/clients/1794*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
custom: 100000 : 1 : 1 : 8a533f1b : 3: 16 : 1
[1794:1794] Do system command cat /sys/kernel/debug/ion/heaps/custom | grep -w 1794 | grep -w libhbmem_sample.
libhbmem_sample 1794 1048576
libhbmem_sample 1794 other 1048576 0
[1794:1794] Result 0.
free com buf
alloc com buf form cma_reserved, size: 1048576
[1794:1794] Do system command cat /sys/kernel/debug/ion/clients/1794*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
cma_reserved: 100000 : 1 : 1 : 8a533f1b : 3: 16 : 1
[1794:1794] Do system command cat /sys/kernel/debug/ion/heaps/cma_reserved | grep -w 1794 | grep -w libhbmem_sample.
libhbmem_sample 1794 1048576
libhbmem_sample 1794 other 1048576 0
[1794:1794] Result 0.
free com buf
sample_alloc_com_buf_with_heapmask done
=================================================
创建graph buffer
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 4
sample_mode = 4
=================================================
Ready to sample_alloc_graph_buf
graph_buf.plane_cnt: 2, graph_buf.format: 8, graph_buf.width: 1280, graph_buf.height: 720, graph_buf.stride: 0, graph_buf.vstride: 0, graph_buf.stride: 0, graph_buf.flags: 17
[1095435:1095435] Do system command cat /sys/kernel/debug/ion/clients/1095435*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: f0000 : 1 : 1 : ffff0003a8385800 : 3: 9 : 1
ion_cma: 80000 : 1 : 1 : ffff0003a8385b00 : 3: 10 : 1
-------------------------------------------------------------------------
total 170000
-------------------------------------------------------------------------
[1095435:1095435] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 1095435 | grep -w libhbmem_sample.
[1095435:1095435] Result 256.
sample_alloc_graph_buf done
=================================================
在各个heaps里,创建graph buffer
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 5
sample_mode = 5
=================================================
Ready to sample_alloc_graph_buf_with_heapmask
alloc graph buf form ion_cma
graph_buf.plane_cnt: 2, graph_buf.format: 8, graph_buf.width: 1280, graph_buf.height: 720, graph_buf.stride: 0, graph_buf.vstride: 0, graph_buf.stride: 0, graph_buf.flags: 17
[1095441:1095441] Do system command cat /sys/kernel/debug/ion/clients/1095441*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 80000 : 1 : 1 : ffff0003aad52800 : 3: 10 : 1
ion_cma: f0000 : 1 : 1 : ffff0003aad56400 : 3: 9 : 1
-------------------------------------------------------------------------
total 170000
-------------------------------------------------------------------------
[1095441:1095441] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 1095441 | grep -w libhbmem_sample.
[1095441:1095441] Result 256.
alloc graph buf form carveout
graph_buf.plane_cnt: 2, graph_buf.format: 8, graph_buf.width: 1280, graph_buf.height: 720, graph_buf.stride: 0, graph_buf.vstride: 0, graph_buf.stride: 0, graph_buf.flags: 4294967313
[1095441:1095441] Do system command cat /sys/kernel/debug/ion/clients/1095441*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
carveout: 80000 : 1 : 1 : ffff0003aad5b200 : 3: 10 : 1
carveout: f0000 : 1 : 1 : ffff0003aad5ca00 : 3: 9 : 1
-------------------------------------------------------------------------
total 170000
-------------------------------------------------------------------------
[1095441:1095441] Do system command cat /sys/kernel/debug/ion/heaps/carveout | grep -w 1095441 | grep -w libhbmem_sample.
[1095441:1095441] Result 256.
alloc graph buf form cma_reserved
graph_buf.plane_cnt: 2, graph_buf.format: 8, graph_buf.width: 1280, graph_buf.height: 720, graph_buf.stride: 0, graph_buf.vstride: 0, graph_buf.stride: 0, graph_buf.flags: 17179869201
[1095441:1095441] Do system command cat /sys/kernel/debug/ion/clients/1095441*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
cma_reserved: f0000 : 1 : 1 : ffff0003aad53100 : 3: 9 : 1
cma_reserved: 80000 : 1 : 1 : ffff0003aad5f100 : 3: 10 : 1
-------------------------------------------------------------------------
total 170000
-------------------------------------------------------------------------
[1095441:1095441] Do system command cat /sys/kernel/debug/ion/heaps/cma_reserved | grep -w 1095441 | grep -w libhbmem_sample.
[1095441:1095441] Result 256.
sample_alloc_graph_buf_with_heapmask done
=================================================
创建graph buffer group
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 6
sample_mode = 6
=================================================
Ready to sample_alloc_graph_buf_with_heapmask
[35896:35896] Do system command cat /sys/kernel/debug/ion/clients/35896*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 80000 : 1 : 1 : ffff0003be590a00 : 3: 15 : 1
ion_cma: 80000 : 1 : 1 : ffff0003be591000 : 3: 13 : 1
ion_cma: f0000 : 1 : 1 : ffff0003be591300 : 3: 8 : 1
ion_cma: 80000 : 1 : 1 : ffff0003be591600 : 3: 19 : 1
ion_cma: 80000 : 1 : 1 : ffff0003be592500 : 3: 11 : 1
ion_cma: 80000 : 1 : 1 : ffff0003be593700 : 3: 17 : 1
ion_cma: f0000 : 1 : 1 : ffff0003be593d00 : 3: 18 : 1
ion_cma: 80000 : 1 : 1 : ffff0003be594000 : 3: 9 : 1
ion_cma: f0000 : 1 : 1 : ffff0003be594300 : 3: 12 : 1
ion_cma: f0000 : 1 : 1 : ffff0003be594600 : 3: 14 : 1
ion_cma: f0000 : 1 : 1 : ffff0003be594900 : 3: 20 : 1
ion_cma: 80000 : 1 : 1 : ffff0003be594c00 : 3: 21 : 1
ion_cma: f0000 : 1 : 1 : ffff0003be595500 : 3: 10 : 1
ion_cma: f0000 : 1 : 1 : ffff0003be596100 : 3: 22 : 1
ion_cma: f0000 : 1 : 1 : ffff0003be597300 : 3: 16 : 1
ion_cma: 80000 : 1 : 1 : ffff0003be59df00 : 3: 23 : 1
-------------------------------------------------------------------------
total b80000
-------------------------------------------------------------------------
[35896:35896] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 35896 | grep -w libhbmem_sample.
[35896:35896] Result 256.
sample_alloc_graph_buf_group done
=================================================
在各个heaps里,创建graph buffer group
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 7
sample_mode = 7
=================================================
Ready to sample_alloc_graph_buf_group_heapmask
alloc graph buf group form ion_cma
[35907:35907] Do system command cat /sys/kernel/debug/ion/clients/35907*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 80000 : 1 : 1 : ffff0003be594f00 : 3: 17 : 1
ion_cma: 80000 : 1 : 1 : ffff0003be596700 : 3: 11 : 1
ion_cma: f0000 : 1 : 1 : ffff0003be596d00 : 3: 14 : 1
ion_cma: 80000 : 1 : 1 : ffff0003be597900 : 3: 13 : 1
ion_cma: f0000 : 1 : 1 : ffff0003be598800 : 3: 12 : 1
ion_cma: 80000 : 1 : 1 : ffff0003be59c400 : 3: 9 : 1
ion_cma: f0000 : 1 : 1 : ffff0003be59d600 : 3: 10 : 1
ion_cma: 80000 : 1 : 1 : ffff0003be59e500 : 3: 15 : 1
ion_cma: f0000 : 1 : 1 : ffff0003be59e800 : 3: 8 : 1
ion_cma: f0000 : 1 : 1 : ffff0003be59f400 : 3: 16 : 1
ion_cma: 80000 : 1 : 1 : ffff0003f0a23a00 : 3: 21 : 1
ion_cma: f0000 : 1 : 1 : ffff0003f0a26d00 : 3: 20 : 1
ion_cma: 80000 : 1 : 1 : ffff0003f0a2a000 : 3: 23 : 1
ion_cma: f0000 : 1 : 1 : ffff0003f0a2d300 : 3: 18 : 1
ion_cma: f0000 : 1 : 1 : ffff0003f0a2d600 : 3: 22 : 1
ion_cma: 80000 : 1 : 1 : ffff0003f0a2df00 : 3: 19 : 1
-------------------------------------------------------------------------
total b80000
-------------------------------------------------------------------------
[35907:35907] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 35907 | grep -w libhbmem_sample.
[35907:35907] Result 256.
alloc graph buf group form carveout
[35907:35907] Do system command cat /sys/kernel/debug/ion/clients/35907*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
carveout: f0000 : 1 : 1 : ffff0003f0a20400 : 3: 22 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a21900 : 3: 18 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a21c00 : 3: 20 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a24c00 : 3: 11 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a25200 : 3: 12 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a25e00 : 3: 17 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a26700 : 3: 8 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a26a00 : 3: 19 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a27000 : 3: 16 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a27f00 : 3: 21 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a29100 : 3: 15 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a2a900 : 3: 13 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a2ac00 : 3: 14 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a2d900 : 3: 9 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a2f100 : 3: 10 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a2fa00 : 3: 23 : 1
-------------------------------------------------------------------------
total b80000
-------------------------------------------------------------------------
[35907:35907] Do system command cat /sys/kernel/debug/ion/heaps/carveout | grep -w 35907 | grep -w libhbmem_sample.
[35907:35907] Result 256.
alloc graph buf group form cma_reserved
[35907:35907] Do system command cat /sys/kernel/debug/ion/clients/35907*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
carveout: 80000 : 1 : 1 : ffff0003f0a20100 : 3: 19 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a20700 : 3: 22 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a21600 : 3: 21 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a22e00 : 3: 16 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a23400 : 3: 23 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a24300 : 3: 8 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a2be00 : 3: 10 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a2ca00 : 3: 18 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a2dc00 : 3: 20 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a2e200 : 3: 11 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a2e500 : 3: 13 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a2e800 : 3: 12 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a2eb00 : 3: 17 : 1
carveout: f0000 : 1 : 1 : ffff0003f0a2f400 : 3: 14 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a2f700 : 3: 9 : 1
carveout: 80000 : 1 : 1 : ffff0003f0a2fd00 : 3: 15 : 1
-------------------------------------------------------------------------
total b80000
-------------------------------------------------------------------------
[35907:35907] Do system command cat /sys/kernel/debug/ion/heaps/* | grep -w 35907 | grep -w libhbmem_sample.
[35907:35907] Result 256.
sample_alloc_graph_buf_group_heapmask done
=================================================
进程内common buffer共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 8
sample_mode = 8
=================================================
Ready to sample_share_com_buffer
alloc com buf, share_id: 9
import com buf, share_id: 9
[1095457:1095457] Do system command cat /sys/kernel/debug/ion/clients/1095457*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 10000 : 2 : 2 : ffff0003aad55b00 : 4: 9 : 2
-------------------------------------------------------------------------
total 10000
-------------------------------------------------------------------------
[1095457:1095457] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 1095457 | grep -w libhbmem_sample.
[1095457:1095457] Result 256.
free com buf
[1095457:1095457] Do system command cat /sys/kernel/debug/ion/clients/1095457*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 10000 : 1 : 1 : ffff0003aad55b00 : 3: 9 : 1
-------------------------------------------------------------------------
total 10000
-------------------------------------------------------------------------
[1095457:1095457] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 1095457 | grep -w libhbmem_sample.
[1095457:1095457] Result 256.
free import buf
[1095457:1095457] Do system command cat /sys/kernel/debug/ion/clients/1095457*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
-------------------------------------------------------------------------
total 0
-------------------------------------------------------------------------
[1095457:1095457] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 1095457 | grep -w libhbmem_sample.
[1095457:1095457] Result 256.
sample_share_com_buffer done
=================================================
进程内common buffer共享,consume_cnt
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 9
sample_mode = 9
=================================================
Ready to sample_share_com_buffer_use_consume_cnt
in_buf used by process[1095474]
share_consume_cnt: 1
hb_mem_wait_consume_status timeout
sample_share_com_buffer_use_consume_cnt done
=================================================
进程间common buffer共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 10
sample_mode = 10
=================================================
Ready to sample_share_com_buffer_fork_process_scenario
alloc graph buf form ion_cma
socketpair: 0
[30594:317] In parent process.
[30595:30594] In child process.
parent write share buf: parent test common buf share.
share_consume_cnt: 0
[30594:317] parent send msg 1
[30595:30594] child recv msg 1
child read share buf: parent test common buf share.
share_consume_cnt: 1
child write share buf: child test common buf share.
[30595:30594] child send msg 2
[30594:317] parent recv msg 2
parent read share buf: child test common buf share.
[30594:317] parent send msg 3
[30595:30594] child recv msg 3
share_consume_cnt: 0
[30594:317] parent quit
[30595:30594] child quit
alloc graph buf form carveout
socketpair: 0
[30594:317] In parent process.
[30596:30594] In child process.
parent write share buf: parent test common buf share.
share_consume_cnt: 0
[30594:317] parent send msg 1
[30596:30594] child recv msg 1
child read share buf: parent test common buf share.
share_consume_cnt: 1
child write share buf: child test common buf share.
[30596:30594] child send msg 2
[30594:317] parent recv msg 2
parent read share buf: child test common buf share.
[30594:317] parent send msg 3
[30596:30594] child recv msg 3
share_consume_cnt: 0
[30594:317] parent quit
[30596:30594] child quit
alloc graph buf form cma_reserved
socketpair: 0
[30594:317] In parent process.
[30597:30594] In child process.
parent write share buf: parent test common buf share.
share_consume_cnt: 0
[30594:317] parent send msg 1
[30597:30594] child recv msg 1
child read share buf: parent test common buf share.
share_consume_cnt: 1
child write share buf: child test common buf share.
[30597:30594] child send msg 2
[30594:317] parent recv msg 2
parent read share buf: child test common buf share.
[30594:317] parent send msg 3
[30597:30594] child recv msg 3
share_consume_cnt: 0
[30594:317] parent quit
[30597:30594] child quit
sample_share_com_buffer_fork_process_scenario done
=================================================
进程内graphic buffer共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 11
sample_mode = 11
=================================================
Ready to sample_share_graph_buffer
alloc graph buf, share_id0: 8, share_id1: 9, share_id2: 9
import graph buf, share_id0: 8, share_id1: 9, share_id2: 9
[35929:35929] Do system command cat /sys/kernel/debug/ion/clients/35929*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 80000 : 2 : 2 : ffff0003f0a25500 : 4: 9 : 2
ion_cma: f0000 : 2 : 2 : ffff0003f0a2d000 : 4: 8 : 2
-------------------------------------------------------------------------
total 170000
-------------------------------------------------------------------------
[35929:35929] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 35929 | grep -w libhbmem_sample.
[35929:35929] Result 256.
free graph buf
[35929:35929] Do system command cat /sys/kernel/debug/ion/clients/35929*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 80000 : 1 : 1 : ffff0003f0a25500 : 3: 9 : 1
ion_cma: f0000 : 1 : 1 : ffff0003f0a2d000 : 3: 8 : 1
-------------------------------------------------------------------------
total 170000
-------------------------------------------------------------------------
[35929:35929] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 35929 | grep -w libhbmem_sample.
[35929:35929] Result 256.
free import buf
[35929:35929] Do system command cat /sys/kernel/debug/ion/clients/35929*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
-------------------------------------------------------------------------
total 0
-------------------------------------------------------------------------
[35929:35929] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 35929 | grep -w libhbmem_sample.
[35929:35929] Result 256.
sample_share_graph_buffer done
=================================================
进程内graphic buffer共享,consume_cnt
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 12
sample_mode = 12
=================================================
Ready to sample_share_graph_buffer_use_consume_cnt
in_buf used by process[35947]
share_consume_cnt: 1
hb_mem_wait_consume_status timeout
sample_share_graph_buffer_use_consume_cnt done
=================================================
进程间graphic buffer共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 13
sample_mode = 13
=================================================
Ready to sample_share_graph_buffer_fork_process_scenario
alloc graph buf form ion_cma
socketpair: 0
[30599:317] In parent process.
[30600:30599] In child process.
parent write share buf: parent test graph buf share.
share_consume_cnt: 0
[30599:317] parent send msg 1
[30600:30599] child recv msg 1
child read share buf: parent test graph buf share.
share_consume_cnt: 1
child write share buf: child test common buf share.
[30600:30599] child send msg 2
[30599:317] parent recv msg 2
parent read share buf: child test common buf share.
[30599:317] parent send msg 3
[30600:30599] child recv msg 3
share_consume_cnt: 0
[30599:317] parent quit
[30600:30599] child quit
alloc graph buf form carveout
socketpair: 0
[30599:317] In parent process.
[30601:30599] In child process.
parent write share buf: parent test graph buf share.
share_consume_cnt: 0
[30599:317] parent send msg 1
[30601:30599] child recv msg 1
child read share buf: parent test graph buf share.
share_consume_cnt: 1
child write share buf: child test common buf share.
[30601:30599] child send msg 2
[30599:317] parent recv msg 2
parent read share buf: child test common buf share.
[30599:317] parent send msg 3
[30601:30599] child recv msg 3
share_consume_cnt: 0
[30599:317] parent quit
[30601:30599] child quit
alloc graph buf form cma_reserved
socketpair: 0
[30599:317] In parent process.
[30602:30599] In child process.
parent write share buf: parent test graph buf share.
share_consume_cnt: 0
[30599:317] parent send msg 1
[30602:30599] child recv msg 1
child read share buf: parent test graph buf share.
share_consume_cnt: 1
child write share buf: child test common buf share.
[30602:30599] child send msg 2
[30599:317] parent recv msg 2
parent read share buf: child test common buf share.
[30599:317] parent send msg 3
[30602:30599] child recv msg 3
share_consume_cnt: 0
[30599:317] parent quit
[30602:30599] child quit
sample_share_graph_buffer_fork_process_scenario done
=================================================
进程内graphic buffer group共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 14
sample_mode = 14
=================================================
Ready to sample_share_graph_buffer_group
[48474:48474] Do system command cat /sys/kernel/debug/ion/clients/48474*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 80000 : 2 : 2 : ffff0003ac940700 : 3: 12 : 2
ion_cma: f0000 : 2 : 2 : ffff0003ac942500 : 3: 11 : 2
ion_cma: f0000 : 2 : 2 : ffff0003ac942800 : 3: 21 : 2
ion_cma: 80000 : 2 : 2 : ffff0003ac942b00 : 3: 18 : 2
ion_cma: 80000 : 2 : 2 : ffff0003ac943d00 : 3: 24 : 2
ion_cma: 80000 : 2 : 2 : ffff0003ac944300 : 3: 14 : 2
ion_cma: f0000 : 2 : 2 : ffff0003ac944600 : 3: 23 : 2
ion_cma: f0000 : 2 : 2 : ffff0003ac946a00 : 3: 9 : 2
ion_cma: 80000 : 2 : 2 : ffff0003ac947600 : 3: 20 : 2
ion_cma: 80000 : 2 : 2 : ffff0003ac949700 : 3: 10 : 2
ion_cma: f0000 : 2 : 2 : ffff0003ac94a000 : 3: 17 : 2
ion_cma: f0000 : 2 : 2 : ffff0003ac94c400 : 3: 19 : 2
ion_cma: f0000 : 2 : 2 : ffff0003ac94cd00 : 3: 13 : 2
ion_cma: 80000 : 2 : 2 : ffff0003ac94d600 : 3: 22 : 2
ion_cma: f0000 : 2 : 2 : ffff0003ac94df00 : 3: 15 : 2
ion_cma: 80000 : 2 : 2 : ffff0003ac94f400 : 3: 16 : 2
-------------------------------------------------------------------------
total b80000
-------------------------------------------------------------------------
[48474:48474] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 48474 | grep -w libhbmem_sample.
[48474:48474] Result 256.
free graph buf group
[48474:48474] Do system command cat /sys/kernel/debug/ion/clients/48474*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 80000 : 1 : 1 : ffff0003ac940700 : 3: 12 : 1
ion_cma: f0000 : 1 : 1 : ffff0003ac942500 : 3: 11 : 1
ion_cma: f0000 : 1 : 1 : ffff0003ac942800 : 3: 21 : 1
ion_cma: 80000 : 1 : 1 : ffff0003ac942b00 : 3: 18 : 1
ion_cma: 80000 : 1 : 1 : ffff0003ac943d00 : 3: 24 : 1
ion_cma: 80000 : 1 : 1 : ffff0003ac944300 : 3: 14 : 1
ion_cma: f0000 : 1 : 1 : ffff0003ac944600 : 3: 23 : 1
ion_cma: f0000 : 1 : 1 : ffff0003ac946a00 : 3: 9 : 1
ion_cma: 80000 : 1 : 1 : ffff0003ac947600 : 3: 20 : 1
ion_cma: 80000 : 1 : 1 : ffff0003ac949700 : 3: 10 : 1
ion_cma: f0000 : 1 : 1 : ffff0003ac94a000 : 3: 17 : 1
ion_cma: f0000 : 1 : 1 : ffff0003ac94c400 : 3: 19 : 1
ion_cma: f0000 : 1 : 1 : ffff0003ac94cd00 : 3: 13 : 1
ion_cma: 80000 : 1 : 1 : ffff0003ac94d600 : 3: 22 : 1
ion_cma: f0000 : 1 : 1 : ffff0003ac94df00 : 3: 15 : 1
ion_cma: 80000 : 1 : 1 : ffff0003ac94f400 : 3: 16 : 1
-------------------------------------------------------------------------
total b80000
-------------------------------------------------------------------------
[48474:48474] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 48474 | grep -w libhbmem_sample.
[48474:48474] Result 256.
free import buf
[48474:48474] Do system command cat /sys/kernel/debug/ion/clients/48474*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
-------------------------------------------------------------------------
total 0
-------------------------------------------------------------------------
[48474:48474] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 48474 | grep -w libhbmem_sample.
[48474:48474] Result 256.
sample_share_graph_buffer_group done
=================================================
进程内graphic buffer group共享,consume_cnt
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 15
sample_mode = 15
=================================================
Ready to sample_share_graph_buffer_group_use_consume_cnt
in_buf used by process[48659]
share_consume_cnt: 1
hb_mem_wait_consume_status timeout
sample_share_graph_buffer_group_use_consume_cnt done
=================================================
进程间graphic buffer group共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 16
sample_mode = 16
=================================================
Ready to sample_share_graph_buffer_group_fork_process_scenario
socketpair: 0
[48662:35245] In parent process.
[48663:48662] In child process.
parent write share buf: parent test graph buf share.
share_consume_cnt: 0
[48662:35245] parent send msg 1
[48663:48662] child recv msg 1
child read share buf: parent test graph buf share.
share_consume_cnt: 1
child write share buf: child test common buf share.
[48663:48662] child send msg 2
[48662:35245] parent recv msg 2
parent read share buf: child test common buf share.
[48662:35245] parent send msg 3
[48663:48662] child recv msg 3
share_consume_cnt: 0
[48662:35245] parent quit
[48663:48662] child quit
sample_share_graph_buffer_group_fork_process_scenario done
=================================================
进程间share pool 共享
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 17
sample_mode = 17
=================================================
Ready to sample_share_pool_fork_process_scenario
[1095477:816] In parent process.
[1095478:1095477] In child process.
[1095477:1095477] Do system command cat /sys/kernel/debug/ion/clients/1095477*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 20000 : 1 : 1 : ffff0003aad50400 : 3: 12 : 1
ion_cma: 20000 : 1 : 1 : ffff0003aad50a00 : 3: 11 : 1
ion_cma: 20000 : 1 : 1 : ffff0003aad54c00 : 3: 9 : 1
ion_cma: 20000 : 1 : 1 : ffff0003aad56700 : 3: 10 : 1
ion_cma: 20000 : 1 : 1 : ffff0003aad5ac00 : 3: 13 : 1
-------------------------------------------------------------------------
total a0000
-------------------------------------------------------------------------
[1095477:1095477] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 1095477 | grep -w libhbmem_sample.
[1095477:1095477] Result 256.
hb_mem_share_pool_alloc_buf 0 0xffffafa10000
hb_mem_share_pool_alloc_buf 1 0xffffafa30000
hb_mem_share_pool_alloc_buf 2 0xffffafa50000
hb_mem_share_pool_alloc_buf 3 0xffffafa70000
hb_mem_share_pool_alloc_buf 4 0xffffafa90000
[1095477:816] parent send msg 1
[1095478:1095477] child recv msg 1
[1095478:1095477] child send msg 2
[1095477:816] parent recv msg 2
free 0 0xffffafa10000
[1095477:816] parent pool.avail_buf_cnt: 0
free 1 0xffffafa30000
[1095477:816] parent pool.avail_buf_cnt: 1
free 2 0xffffafa50000
[1095477:816] parent pool.avail_buf_cnt: 2
free 3 0xffffafa70000
[1095477:816] parent pool.avail_buf_cnt: 3
free 4 0xffffafa90000
[1095477:816] parent pool.avail_buf_cnt: 4
[1095477:816] parent send msg 3
[1095478:1095477] child recv msg 3
[1095478:1095477] child send msg 4
[1095477:816] parent recv msg 4
[1095477:816] parent pool.avail_buf_cnt: 5
[1095478:1095477] child quit
[1095477:816] parent quit
sample_share_pool_fork_process_scenario done
=================================================
share pool使用
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 18
sample_mode = 18
=================================================
Ready to sample_share_pool
pool.avail_buf_cnt: 9
pool.avail_buf_cnt: 8
pool.avail_buf_cnt: 7
pool.avail_buf_cnt: 6
pool.avail_buf_cnt: 5
pool.avail_buf_cnt: 4
pool.avail_buf_cnt: 3
pool.avail_buf_cnt: 2
pool.avail_buf_cnt: 1
pool.avail_buf_cnt: 0
pool.avail_buf_cnt: 1
pool.avail_buf_cnt: 2
pool.avail_buf_cnt: 3
pool.avail_buf_cnt: 4
pool.avail_buf_cnt: 5
pool.avail_buf_cnt: 6
pool.avail_buf_cnt: 7
pool.avail_buf_cnt: 8
pool.avail_buf_cnt: 9
pool.avail_buf_cnt: 10
sample_share_pool done
=================================================
buffer queue 使用
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 19
sample_mode = 19
=================================================
Ready to sample_queue_producer_consumer
[1095487:1095487] Queue test case.
[1095487:1095488] Start test 37775453715.
[1095487:1095488] out buffer share id 9.
[1095487:1095488] out buffer share id 10.
[1095487:1095488] out buffer share id 11.
[1095487:1095488] out buffer share id 12.
[1095487:1095488] out buffer share id 13.
[1095487:1095488] out buffer share id 14.
[1095487:1095488] out buffer share id 15.
[1095487:1095488] out buffer share id 16.
[1095487:1095488] out buffer share id 17.
[1095487:1095488] out buffer share id 18.
[1095487:1095488] out buffer share id 19.
[1095487:1095488] out buffer share id 20.
[1095487:1095488] out buffer share id 21.
[1095487:1095488] out buffer share id 22.
[1095487:1095488] out buffer share id 23.
[1095487:1095488] out buffer share id 24.
[1095487:1095488] out buffer share id 9.
[1095487:1095488] out buffer share id 10.
[1095487:1095488] out buffer share id 11.
[1095487:1095488] out buffer share id 12.
[1095487:1095488] out buffer share id 13.
[1095487:1095488] out buffer share id 14.
[1095487:1095488] out buffer share id 15.
[1095487:1095488] out buffer share id 16.
[1095487:1095488] out buffer share id 17.
[1095487:1095488] out buffer share id 18.
[1095487:1095488] out buffer share id 19.
[1095487:1095488] out buffer share id 20.
[1095487:1095488] out buffer share id 21.
[1095487:1095488] out buffer share id 22.
[1095487:1095488] out buffer share id 23.
[1095487:1095488] out buffer share id 24.
[1095487:1095488] out buffer share id 9.
[1095487:1095488] out buffer share id 10.
[1095487:1095488] out buffer share id 11.
[1095487:1095488] out buffer share id 12.
[1095487:1095488] out buffer share id 13.
[1095487:1095488] out buffer share id 14.
[1095487:1095488] out buffer share id 15.
[1095487:1095488] out buffer share id 16.
[1095487:1095488] out buffer share id 17.
[1095487:1095488] out buffer share id 18.
[1095487:1095488] out buffer share id 19.
[1095487:1095488] out buffer share id 20.
[1095487:1095488] out buffer share id 21.
[1095487:1095488] out buffer share id 22.
[1095487:1095488] out buffer share id 23.
[1095487:1095488] out buffer share id 24.
[1095487:1095488] out buffer share id 9.
[1095487:1095488] out buffer share id 10.
[1095487:1095488] out buffer share id 11.
[1095487:1095488] out buffer share id 12.
[1095487:1095488] out buffer share id 13.
[1095487:1095488] out buffer share id 14.
[1095487:1095488] out buffer share id 15.
[1095487:1095488] out buffer share id 16.
[1095487:1095488] out buffer share id 17.
[1095487:1095488] out buffer share id 18.
[1095487:1095488] out buffer share id 19.
[1095487:1095488] out buffer share id 20.
[1095487:1095488] out buffer share id 21.
[1095487:1095488] out buffer share id 22.
[1095487:1095488] out buffer share id 23.
[1095487:1095488] out buffer share id 24.
[1095487:1095488] out buffer share id 9.
[1095487:1095488] out buffer share id 10.
[1095487:1095488] out buffer share id 11.
[1095487:1095488] out buffer share id 12.
[1095487:1095488] out buffer share id 13.
[1095487:1095488] out buffer share id 14.
[1095487:1095488] out buffer share id 15.
[1095487:1095488] out buffer share id 16.
[1095487:1095488] out buffer share id 17.
[1095487:1095488] out buffer share id 18.
[1095487:1095488] out buffer share id 19.
[1095487:1095488] out buffer share id 20.
[1095487:1095488] out buffer share id 21.
[1095487:1095488] out buffer share id 22.
[1095487:1095488] out buffer share id 23.
[1095487:1095488] out buffer share id 24.
[1095487:1095488] out buffer share id 9.
[1095487:1095488] out buffer share id 10.
[1095487:1095488] out buffer share id 11.
[1095487:1095488] out buffer share id 12.
[1095487:1095488] out buffer share id 13.
[1095487:1095488] out buffer share id 14.
[1095487:1095488] out buffer share id 15.
[1095487:1095488] out buffer share id 16.
[1095487:1095488] out buffer share id 17.
[1095487:1095488] out buffer share id 18.
[1095487:1095488] out buffer share id 19.
[1095487:1095488] out buffer share id 20.
[1095487:1095488] out buffer share id 21.
[1095487:1095488] out buffer share id 22.
[1095487:1095488] out buffer share id 23.
[1095487:1095488] out buffer share id 24.
[1095487:1095488] out buffer share id 9.
[1095487:1095488] out buffer share id 10.
[1095487:1095488] out buffer share id 11.
[1095487:1095488] out buffer share id 12.
[1095487:1095488] End test 37776461140, interval 1007425.
[1095487:1095488] thread quits.
[1095487:1095487] thread return = 281472846730960
sample_queue_producer_consumer done
=================================================
pool使用
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 20
sample_mode = 20
=================================================
Ready to sample_pool
[1095489:1095489] Do system command cat /sys/kernel/debug/ion/clients/1095489*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: a00000 : 1 : 1 : ffff0003e02b4c00 : 3: 9 : 1
-------------------------------------------------------------------------
total a00000
-------------------------------------------------------------------------
[1095489:1095489] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 1095489 | grep -w libhbmem_sample.
[1095489:1095489] Result 256.
[ERROR][][mem_log.c:115] [ERROR][37801.70295][1095489:1095489][MEM_POOL] Fail to destroy memory pool(ret=-16777199).
hb_mem_pool_destroy HB_MEM_ERR_POOL_BUSY, need free first.
sample_pool done
=================================================
在graphic buffer与common buffer之间实现buffer转换
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 21
sample_mode = 21
=================================================
Ready to sample_alloc_graph_buf_group_heapmask
----alloc graphic buffer done!----
the data in graphic buffer:
size: 0x1fa400
flags: 0x8000011
fd: 4
share id: 16
virt_addr: 0x0xffff8d800000
paddr: 0xc0000000
----change graphic buffer to common buffer done!----
the data in new common buffer:
size: 0x1fa400
flags: 0x8000011
fd: 4
share id: 16
virt_addr: 0x0xffff8d800000
paddr: 0xc0000000
----alloc common buffer done!----
the data in common buffer:
size: 0x10000
flags: 0x8000011
fd: 5
share id: 17
virt_addr: 0x0xffff8d7f0000
paddr: 0xc0300000
----change common buffer to graphic buffer done!----
the data in new graphic buffer:
size: 0x10000
flags: 0x8000011
fd: 5
share id: 17
virt_addr: 0x0xffff8d7f0000
paddr: 0xc0300000
sample_alloc_graph_buf_group_heapmask done
=================================================
增加common buffer用户态引用计数
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 22
sample_mode = 22
=================================================
Ready to sample_com_buf_user_consume_cnt
alloc com buf, share_id: 10
[2342:2342] Do system command cat /sys/kernel/debug/ion/clients/2342*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 400000 : 1 : 1 : 40c01861 : 3: 10 : 1
-------------------------------------------------------------------------
total 400000
-------------------------------------------------------------------------
[2342:2342] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 2342 | grep -w sample_hbmem.
[2342:2342] Result 256.
free com buf
[2342:2342] Do system command cat /sys/kernel/debug/ion/clients/2342*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
-------------------------------------------------------------------------
total 0
-------------------------------------------------------------------------
[2342:2342] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 2342 | grep -w sample_hbmem.
[2342:2342] Result 256.
sample_com_buf_user_consume_cnt done
=================================================
增加graphic buffer用户态引用计数
/app/sample/S83_Sample/S83E02_Communication/libhbmem_sample/bin/libhbmem_sample -m 23
sample_mode = 23
=================================================
Ready to sample_graph_buf_user_consume_cnt
graph_buf.plane_cnt: 2, graph_buf.format: 8, graph_buf.width: 1280, graph_buf.height: 720, graph_buf.stride: 0, graph_buf.vstride: 0, graph_buf.stride: 0, graph_buf.flags: 17
[2355:2355] Do system command cat /sys/kernel/debug/ion/clients/2355*.
heap_name: size_in_bytes : handle refcount : handle import : buffer ptr : buffer refcount : buffer share id : buffer share count
ion_cma: 80000 : 1 : 1 : d5f2e0cd : 3: 11 : 1
ion_cma: f0000 : 1 : 1 : 3ff45cd5 : 3: 10 : 1
-------------------------------------------------------------------------
total 170000
-------------------------------------------------------------------------
[2355:2355] Do system command cat /sys/kernel/debug/ion/heaps/ion_cma | grep -w 2355 | grep -w sample_hbmem.
[2355:2355] Result 256.
sample_graph_buf_user_consume_cnt done
=================================================
