Commits (2)
......@@ -20,6 +20,20 @@ bison::
Fedora: bison
Debian: bison
libcap::
Required on Linux, to support dropping root.
Fedora: libcap and libcap-devel
Debian: libcap2 and libcap-dev
gnuplot::
Required for ntpviz.
Fedora: gnuplot
Debian: gnuplot
psutils::
Optional for ntpviz. Allows running with ionice()
Gentoo: dev-python/psutil
libevent 2.x::
Optional. Without it, ntpdig won't build.
Fedora: libevent and libevent-devel
......@@ -30,11 +44,6 @@ libevent 2.x::
# cd /usr/lib
# ln -s /usr/pkg/lib/libevent_core-2.0.so.5
libcap::
Required on Linux, to support dropping root.
Fedora: libcap and libcap-devel
Debian: libcap2 and libcap-dev
seccomp::
Optional on Linux to support restricting syscalls
Fedora: libseccomp-devel
......@@ -73,11 +82,6 @@ asciidoc, a2x::
Fedora: asciidoc (Stock CentOS/RHEL has only 8.4.5, you must upgrade)
Debian: asciidoc
gnuplot::
Required for ntpviz.
Fedora: gnuplot
Debian: gnuplot
liberation::
Optional, improves font quality in ntpviz renderings.
Fedora: liberation
......
......@@ -42,7 +42,8 @@ is the default, quiet except for all ERRORs and some WARNINGs. 9 is
painfully verbose.
The -N option will force ntpviz to run "nice"ly. This is appropriate
when you run ntpvizz as a cron job.
when you run ntpviz as a cron job. If the Python library psutils is
installed then ntpviz will also be run at ionice(IDLE).
The plot options choose what graph is generated; invoke only one. By
default, the GNUPLOT for the graph is reported; with -g you get the
......
......@@ -23,10 +23,6 @@ from __future__ import print_function, division
import os, sys, getopt, socket, binascii, datetime, collections, time
from ntp.statfiles import *
#import cProfile, pstats
#pr = cProfile.Profile()
#pr.enable()
# RMS frequency jitter - Deviation from a root-mean-square linear approximation?
# Investigate.
#
......@@ -362,8 +358,25 @@ if __name__ == '__main__':
if 0 < debug:
sys.stderr.write("ntpviz: INFO: now running at debug: %s\n" % \
debug)
if 9 == debug:
# crazy debug, also profile
import cProfile, pstats
pr = cProfile.Profile()
pr.enable()
if 0 != nice:
try:
import psutil
# set ionice() to idle
p = psutil.Process(os.getpid())
p.ionice(psutil.IOPRIO_CLASS_IDLE)
except ImportError:
if 0 < debug:
sys.stderr.write("ntpviz: INFO: psutils not found\n")
pass
# set nice()
nice = os.nice( nice )
if 2 < debug:
sys.stderr.write("ntpviz: INFO: now running at nice: %s\n" % \
......@@ -545,7 +558,9 @@ ntpviz</a>, part of the <a href="https://www.ntpsec.org/">NTPsec project</a>
ifile.close()
#pr.disable()
#pr.print_stats('tottime')
if 9 == debug:
# finish the profile
pr.disable()
pr.print_stats('tottime')
# end