DragonFlyBSD/src e7126f0lib/libc/upmap ukp_setname.c Makefile.inc, lib/libkvm kvm_proc.c

kernel and libc - Reimplement lwp_setname*() using /dev/lpmap

* Generally speaking we are implementing the features necessary
  to allow per-thread titling set via pthread_set_name_np() to
  show up in 'ps' output, and to use lpmap to make it fast.

* The lwp_setname() system call now stores the title in
  lpmap->thread_title[].

* Implement a libc fast-path for lwp_setname() using lpmap.
  If called more than 10 times, libc will use lpmap for any
  further calls, which omits the need to make any system calls.

* setproctitle() now stores the title in upmap->proc_title[]
  instead of replacing proc->p_args.  proc->p_args is now no
  longer modified from its original contents.

* The kernel now includes lpmap->thread_title[] in the following
  priority order when retrieving the process command line:

  lpmap->thread_title[]         User-supplied thread title, if not empty
  upmap->proc_title[]           User-supplied process title, if not empty
  proc->p_args                  Original process arguments (no longer modified)

* Put the TID in /dev/lpmap for convenient access

* Enhance the KERN_PROC_ARGS sysctl to allow the TID to be specified.
  The sysctl now accepts { KERN_PROC, KERN_PROC_ARGS, pid, tid }
  in addition to the existing { KERN_PROC, KERN_PROC_ARGS, pid }
  mechanism.

  Enhance libkvm to use the new feature.  libkvm will fall-back to
  the old version if necessary.
DeltaFile
+111-19sys/kern/kern_proc.c
+88-0lib/libc/upmap/ukp_setname.c
+17-12sys/kern/kern_prot.c
+19-4lib/libkvm/kvm_proc.c
+19-1sys/vfs/procfs/procfs_status.c
+2-1sys/sys/upmap.h
+1-1lib/libc/upmap/Makefile.inc
+1-0sys/sys/proc.h
+258-388 files

UnifiedSplitRaw