Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jan 2011 20:33:47 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/kern kern_exec.c kern_exit.c kern_fork.c kern_ktrace.c kern_proc.c src/sys/sys ktrace.h
Message-ID:  <201101252034.p0PKYFMn046298@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
jhb         2011-01-25 20:33:47 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_7)
    sys/kern             kern_exec.c kern_exit.c kern_fork.c 
                         kern_ktrace.c kern_proc.c 
    sys/sys              ktrace.h 
  Log:
  SVN rev 217839 on 2011-01-25 20:33:47Z by jhb
  
  MFC 211514,214158:
  - There isn't really a need to hold the ktrace mutex just to read the
    value of p_traceflag that is stored in the kinfo_proc structure.
  - When disabling ktracing on a process, free any pending requests that
    may be left.  This fixes a memory leak that can occur when tracing is
    disabled on a process via disabling tracing of a specific file (or if
    an I/O error occurs with the tracefile) if the process's next system
    call is exit().  The trace disabling code clears p_traceflag, so exit1()
    doesn't do any KTRACE-related cleanup leading to the leak.  I chose to
    make the free'ing of pending records synchronous rather than patching
    exit1().
  - Move KTRACE-specific logic out of kern_(exec|exit|fork).c and into
    kern_ktrace.c instead.  Make ktrace_mtx private to kern_ktrace.c as a
    result.
  
  Revision    Changes    Path
  1.308.2.15  +2 -10     src/sys/kern/kern_exec.c
  1.304.2.7   +1 -31     src/sys/kern/kern_exit.c
  1.282.2.11  +1 -15     src/sys/kern/kern_fork.c
  1.121.2.5   +102 -24   src/sys/kern/kern_ktrace.c
  1.252.2.27  +0 -6      src/sys/kern/kern_proc.c
  1.33.2.3    +2 -2      src/sys/sys/ktrace.h



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