I think we need something like this. Documenting it will be a challenge.
I really don't like the name as is too generic, when the control is only for a narrow set of "current time" system calls. Ted Unangst <t...@tedunangst.com> wrote: > Not sure how useful this will be, but I think it could be helpful to still > see section (2) functions in ktrace, even if there's magic to avoid that. > > As proof of concept, if env LIBC_NOSYSWRAPPERS is set, the libc timecounters > are turned off. Now I see lots of gettimeofday syscalls in ktrace again. > > Is this better than switching to ltrace? Combined ktrace and ltrace output > is fairly messy, but it seems to work. Setting it up to trace just a few > functions and all the system calls is a bit more involved. > > > Index: init.c > =================================================================== > RCS file: /home/cvs/src/lib/libc/dlfcn/init.c,v > retrieving revision 1.8 > diff -u -p -r1.8 init.c > --- init.c 6 Jul 2020 13:33:05 -0000 1.8 > +++ init.c 8 Jul 2020 08:13:07 -0000 > @@ -114,6 +114,8 @@ _libc_preinit(int argc, char **argv, cha > _timekeep->tk_version != TK_VERSION) > _timekeep = NULL; > } > + if (issetugid() == 0 && getenv("LIBC_NOSYSWRAPPERS")) > + _timekeep = NULL; > break; > } > } >