Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Dec 2008 06:50:26 +0000 (UTC)
From:      Peter Wemm <peter@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/lib/libutil Makefile kinfo_getfile.c kinfo_getvmmap.c libutil.h src/sys/kern kern_descrip.c kern_proc.c src/sys/sys sysctl.h user.h src/usr.bin/procstat Makefile procstat_files.c procstat_vm.c
Message-ID:  <200812020656.mB26uSFY000560@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
peter       2008-12-02 06:50:26 UTC

  FreeBSD src repository

  Modified files:
    lib/libutil          Makefile libutil.h 
    sys/kern             kern_descrip.c kern_proc.c 
    sys/sys              sysctl.h user.h 
    usr.bin/procstat     Makefile procstat_files.c procstat_vm.c 
  Added files:
    lib/libutil          kinfo_getfile.c kinfo_getvmmap.c 
  Log:
  SVN rev 185548 on 2008-12-02 06:50:26Z by peter
  
  Merge user/peter/kinfo branch as of r185547 into head.
  
  This changes struct kinfo_filedesc and kinfo_vmentry such that they are
  same on both 32 and 64 bit platforms like i386/amd64 and won't require
  sysctl wrapping.
  
  Two new OIDs are assigned.  The old ones are available under
  COMPAT_FREEBSD7 - but it isn't that simple.  The superceded interface
  was never actually released on 7.x.
  
  The other main change is to pack the data passed to userland via the
  sysctl.  kf_structsize and kve_structsize are reduced for the copyout.
  If you have a process with 100,000+ sockets open, the unpacked records
  require a 132MB+ copyout.  With packing, it is "only" ~35MB.  (Still
  seriously unpleasant, but not quite as devastating).  A similar problem
  exists for the vmentry structure - have lots and lots of shared libraries
  and small mmaps and its copyout gets expensive too.
  
  My immediate problem is valgrind.  It traditionally achieves this
  functionality by parsing procfs output, in a packed format.  Secondly, when
  tracing 32 bit binaries on amd64 under valgrind, it uses a cross compiled
  32 bit binary which ran directly into the differing data structures in 32
  vs 64 bit mode.  (valgrind uses this to track file descriptor operations
  and this therefore affected every single 32 bit binary)
  
  I've added two utility functions to libutil to unpack the structures into
  a fixed record length and to make it a little more convenient to use.
  
  Revision  Changes    Path
  1.73      +2 -1      src/lib/libutil/Makefile
  1.1       +72 -0     src/lib/libutil/kinfo_getfile.c (new)
  1.1       +72 -0     src/lib/libutil/kinfo_getvmmap.c (new)
  1.49      +6 -0      src/lib/libutil/libutil.h
  1.343     +264 -4    src/sys/kern/kern_descrip.c
  1.273     +183 -2    src/sys/kern/kern_proc.c
  1.163     +5 -2      src/sys/sys/sysctl.h
  1.79      +77 -8     src/sys/sys/user.h
  1.2       +4 -0      src/usr.bin/procstat/Makefile
  1.8       +6 -29     src/usr.bin/procstat/procstat_files.c
  1.3       +6 -35     src/usr.bin/procstat/procstat_vm.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812020656.mB26uSFY000560>