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