1#!/bin/sh 2################################################################################ 3# 4# Copyright (C) 2022 Huawei Device Co., Ltd. 5# SPDX-License-Identifier: GPL-2.0 6# 7# Unless required by applicable law or agreed to in writing, software 8# distributed under the License is distributed on an "AS IS" BASIS, 9# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10# See the License for the specific language governing permissions and 11# limitations under the License. 12# 13################################################################################ 14# File: mem_debug03.sh 15# 16# Description: Dmabuf usage of process query test 17# 18# Authors: Wangyuting - wangyuting36@huawei.com 19# 20# History: Mar 20 2022 - init scripts 21# 22################################################################################ 23source tst_oh.sh 24 25do_setup() 26{ 27 zcat /proc/config.gz | grep CONFIG_DMABUF_PROCESS_INFO=y || \ 28 tst_res TCONF "CONFIG_DMABUF_PROCESS_INFO=y not satisfied!" 29} 30 31do_test() 32{ 33 local result=$(cat /proc/process_dmabuf_info | grep Process | grep pid \ 34 | grep fd | grep size_bytes | grep ino | grep exp_pid | grep exp_task_comm \ 35 | grep buf_name | grep exp_name) 36 37 if [ "$result" == "" ]; then 38 tst_res TFAIL "Dmabuf usage of process query test failed!" 39 else 40 tst_res TPASS "Dmabuf usage of process query test pass." 41 fi 42} 43 44do_clean() 45{ 46 47} 48 49do_setup 50do_test 51do_clean 52tst_exit