ntpq -- wish list

Hal Murray hmurray at megapathdsl.net
Fri May 29 09:59:33 UTC 2020


In case anybody is looking for things to work on...

There are several clumps of statistics that ntpq can print that get reset 
every hour because foostats prints them out and clears the counters.  I think 
we should not reset the counters but update a copy when they currently get 
reset.  foostats can print the difference between current and saved counters.  
I'd like ntpq to print out both the since-reset and the totals.

--------

I'd like mrulist to be able to list a single slot specified by IP Address.  
The idea is that we can find the IP Addresses of really nasty clients using 
mru mindrop=nnn.   Then we can get fine grained info to make graphs without 
having to scan the whole list.

---------

There are 2 nasty bugs.

The mru list retry logic is broken.  We know where the bug is.  Fixing it 
takes some API changes.

Sometimes, mrulist in direct mode gets a bunch of duplicate info.  I don't 
have any ideas.  It's rare.

----------

I want to make it easy to add new slots to the list of things that ntpq can 
print out.  This enables debug by printf with a printf that doesn't impact 
performance.  It's the sort of thing I use to work on bugs when I don't have 
any better ideas.

The current code has things like this:
#define CS_PROCESSOR            15
        { CS_PROCESSOR,         RO|DEF, "processor" },
and
        case CS_PROCESSOR:
                ctl_putstr(sys_var[CS_PROCESSOR].text,
                           utsnamebuf.machine, strlen(utsnamebuf.machine));
                break;

That "15" is assigned manually.  It's part of a big long table where that 
number gets bumped every slot.  The second chunk is one branch of a big 
select.  I want to get rid of that manual assignment step so I can add/insert 
new slots without renumbering the rest of the big table.

I think we could do that by having a preprocessor that assigned those numbers.

Or we could make each slot in the table have an entry specifying how to print 
the info for that slot.  This would get rid of the #define my moving the print 
arm of the select into the table.  There are only a small handful of types of 
things to print.  The table would need type and where.

This is the sort of thing I'm not good at.  I tried to get Eric to do it.  I 
think he made it less bad, but not much.  (That was a year or two ago.)



-- 
These are my opinions.  I hate spam.





More information about the devel mailing list