From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 23:56:09 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id E99E0106566B for ; Fri, 1 Jun 2012 23:56:06 +0000 (UTC) (envelope-from gmiller@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 23:56:06 +0000 Date: Fri, 01 Jun 2012 23:56:06 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601235606.E99E0106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236904 - soc2012/gmiller/locking-head/lib/libthr/thread X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 23:56:09 -0000 Author: gmiller Date: Fri Jun 1 23:56:06 2012 New Revision: 236904 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236904 Log: Add thread exit lock profiling calls. Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_exit.c soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_exit.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_exit.c Fri Jun 1 21:33:33 2012 (r236903) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_exit.c Fri Jun 1 23:56:06 2012 (r236904) @@ -263,6 +263,8 @@ { struct pthread *curthread = _get_curthread(); + LOCK_PROFILE_EXIT_THREAD(curthread); + /* Check if there is thread specific data: */ if (curthread->specific != NULL) { /* Run the thread-specific data destructors: */ Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Fri Jun 1 21:33:33 2012 (r236903) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Fri Jun 1 23:56:06 2012 (r236904) @@ -747,6 +747,7 @@ __hidden; void _mutex_obtain_success(struct pthread_mutex *, const char *, int) __hidden; +void _lock_profile_exit_thread(struct pthread *curthread) __hidden; void _mutex_release(struct pthread_mutex *) __hidden; void _libpthread_init(struct pthread *) __hidden; struct pthread *_thr_alloc(struct pthread *) __hidden; @@ -807,15 +808,22 @@ void _pthread_cancel_leave(int maycancel); #ifdef LOCK_PROFILING + +#define LOCK_PROFILE_EXIT_THREAD(t) \ + _lock_profile_exit_thread(t) #define MUTEX_OBTAIN_SUCCESS(m) \ _mutex_obtain_success(m, file, line) #define MUTEX_OBTAIN_FAILED(m) \ _mutex_obtain_failed(m, file, line) #define MUTEX_RELEASE(m) _mutex_release(m) + #else + +#define LOCK_PROFILE_EXIT_THREAD(t) do { } while (0) #define MUTEX_OBTAIN_SUCCESS(m) do { } while (0) #define MUTEX_OBTAIN_FAILED(m) do { } while (0) #define MUTEX_RELEASE(m) do { } while (0) + #endif /* #include */ Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c Fri Jun 1 21:33:33 2012 (r236903) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c Fri Jun 1 23:56:06 2012 (r236904) @@ -41,3 +41,8 @@ _mutex_release(struct pthread_mutex *m) { } + +void +_lock_profile_exit_thread(struct pthread *t) +{ +}