• 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_debug06.sh
18#
19# Description: Default information of lowmem killer debug display 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_LOWMEM=y || tst_res TCONF "CONFIG_LOWMEM=y & CONFIG_LMKD_DBG=y not satisfied!"
31    zcat /proc/config.gz | grep CONFIG_LMKD_DBG=y || tst_res TCONF "CONFIG_LOWMEM=y & CONFIG_LMKD_DBG=y not satisfied!"
32}
33
34do_test()
35{
36    local lmkd_oom_score_adj=$(cat /proc/lmkd_dbg_trigger | awk 'BEGIN{FS=":"} $1=="lmkd_oom_score_adj"{print $2}')
37    local lmkd_no_cma_cnt=$(cat /proc/lmkd_dbg_trigger | awk 'BEGIN{FS=":"} $1=="lmkd_no_cma_cnt"{print $2}')
38
39    if [ $lmkd_oom_score_adj -ne 0 ] && [ $lmkd_no_cma_cnt -ne 0 ]; then
40        tst_res TFAIL "Default information of lowmem killer debug display test failed!"
41    else
42        tst_res TPASS "Default information of lowmem killer debug display test pass."
43    fi
44}
45
46do_clean()
47{
48
49}
50
51do_setup
52do_test
53do_clean
54tst_exit