root / plugins / system / kernel_same_page_merging @ ca8ce743
Historique | Voir | Annoter | Télécharger (1,68 ko)
| 1 | adcc2f54 | Michael Grote | #!/bin/bash |
|---|---|---|---|
| 2 | #%# family=auto |
||
| 3 | |||
| 4 | : << EOF |
||
| 5 | =head1 NAME |
||
| 6 | kernel_same_page_merging - Outputs various metrics about same page merging. |
||
| 7 | |||
| 8 | =head1 AUTHOR |
||
| 9 | =over 4 |
||
| 10 | =item * Michael Grote |
||
| 11 | =back |
||
| 12 | |||
| 13 | =head1 LICENSE |
||
| 14 | GPLv3 or later |
||
| 15 | |||
| 16 | SPDX-License-Identifier: GPL-3.0-or-later |
||
| 17 | |||
| 18 | =head1 MAGIC MARKERS |
||
| 19 | =begin comment |
||
| 20 | These magic markers are used by munin-node-configure when installing |
||
| 21 | munin-node. |
||
| 22 | =end comment |
||
| 23 | #%# family=auto |
||
| 24 | =cut |
||
| 25 | EOF |
||
| 26 | # |
||
| 27 | |||
| 28 | # Variablen |
||
| 29 | ksm_dir_run="/sys/kernel/mm/ksm/run" |
||
| 30 | |||
| 31 | function print_labels {
|
||
| 32 | cat << EOF |
||
| 33 | graph_title kernel same page merging |
||
| 34 | graph_category system |
||
| 35 | graph_order pages_unshared pages_volatile pages_shared pages_sharing |
||
| 36 | pages_shared.info how many shared pages are being used |
||
| 37 | pages_sharing.info how many more sites are sharing them i.e. how much saved |
||
| 38 | pages_unshared.info how many pages unique but repeatedly checked for merging |
||
| 39 | pages_volatile.info how many pages changing too fast to be placed in a tree |
||
| 40 | pages_shared.label pages shared |
||
| 41 | pages_sharing.label pages sharing |
||
| 42 | pages_unshared.label pages unshared |
||
| 43 | pages_volatile.label pages volatile |
||
| 44 | pages_shared.draw AREASTACK |
||
| 45 | pages_sharing.draw AREASTACK |
||
| 46 | pages_unshared.draw AREASTACK |
||
| 47 | pages_volatile.draw AREASTACK |
||
| 48 | EOF |
||
| 49 | } |
||
| 50 | |||
| 51 | |||
| 52 | |||
| 53 | # wenn parameter = ... |
||
| 54 | if [ "$1" = "autoconf" ]; then |
||
| 55 | # prüfe ob ksm aktiviert ist |
||
| 56 | if [ ! -f "$ksm_dir_run" ]; then |
||
| 57 | echo "no ($ksm_dir_run not found)" |
||
| 58 | exit 0 |
||
| 59 | fi |
||
| 60 | echo yes |
||
| 61 | exit 0 |
||
| 62 | fi |
||
| 63 | |||
| 64 | if [ "$1" = "config" ]; then |
||
| 65 | # setze label |
||
| 66 | print_labels |
||
| 67 | exit 0 |
||
| 68 | fi |
||
| 69 | |||
| 70 | echo pages_shared.value $(cat "/sys/kernel/mm/ksm/pages_shared") |
||
| 71 | echo pages_sharing.value $(cat "/sys/kernel/mm/ksm/pages_sharing") |
||
| 72 | echo pages_unshared.value $(cat "/sys/kernel/mm/ksm/pages_unshared") |
||
| 73 | echo pages_volatile.value $(cat "/sys/kernel/mm/ksm/pages_volatile") |
