Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37402814
en ru br
Репозитории ALT
S:1.5-alt3
5.1: 0.1-alt1
www.altlinux.org/Changes

Группа :: Мониторинг
Пакет: smem

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: smem-0.1-4320ad746bcc-kervercheck.patch
Скачать


# HG changeset patch
# User Jeff Schroeder <jeffschroed@gmail.com>
# Date 1241139860 18000
# Node ID 4320ad746bcceca5e1d2e00af63d4e7ce8738586
# Parent  741bd2646ebf4c56eb45194e6194de3f1d47bb43
Kernel version >= 2.6.27 check
Awesome tool! I learned about this from the LWN article and
immediately (stupidly) tried it out on a centos 5 host. Here is a
patch to add a kernel version check.
--- a/smem	Thu Apr 30 11:57:52 2009 -0500
+++ b/smem	Thu Apr 30 20:04:20 2009 -0500
@@ -548,6 +548,13 @@
     pylab.legend([p[0] for p in pl], key)
     pylab.show()
 
+def kernel_version_check():
+    kernel_release = os.uname()[2].split('-')[0]
+    if kernel_release < "2.6.27":
+        name = os.path.basename(sys.argv[0])
+        sys.stderr.write(name + " requires a kernel >= 2.6.27\n")
+        sys.exit(-1)
+
 parser = optparse.OptionParser("%prog [options]")
 parser.add_option("-H", "--no-header", action="store_true",
                   help="disable header line")
@@ -596,6 +603,7 @@
                   help="/proc data source")
 
 
+kernel_version_check()
 defaults = {}
 parser.set_defaults(**defaults)
 (options, args) = parser.parse_args()
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin