-
Notifications
You must be signed in to change notification settings - Fork 5
/
ksm_scans
61 lines (49 loc) · 1.38 KB
/
ksm_scans
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Copyright(c) 2010.
# * Jonas Forsberg
# * Jimmy Hedman
#
# This file may be licensed under the terms of of the
# GNU General Public License Version 2 (the ``GPL'').
#
# Software distributed under the License is distributed
# on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
# express or implied. See the GPL for the specific language
# governing rights and limitations.
#
# You should have received a copy of the GPL along with this
# program. If not, go to http://www.gnu.org/licenses/gpl.html
# or write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#%# family=test
#%# capabilities=autoconf
SYSPATH="/sys/kernel/mm/ksm/"
do_ () {
# Test if sys-files for KSM are present
if [ ! -f "${SYSPATH}full_scans" ]; then
echo "Unable to find file: ${SYSPATH}full_scans" >&2
else
echo scans.value $(cat ${SYSPATH}full_scans)
fi
}
do_autoconf () {
if [ ! -f "${SYSPATH}full_scans" ]; then
echo "no (Unable to find file: ${SYSPATH}full_scans)"
exit 0
fi
echo "yes"
}
do_config () {
cat <<EOF
graph_title KSM Full Scans
graph_info Number of full scans made by KSM
graph_category system
graph_args --base 1000 -l 0
graph_scale yes
scans.label Number of full scans
scans.info Number of full scans made by KSM
scans.type COUNTER
scans.draw LINE2
EOF
}
do_$1