socsvn commit: r236904 -
soc2012/gmiller/locking-head/lib/libthr/thread
gmiller at FreeBSD.org
gmiller at FreeBSD.org
Fri Jun 1 23:56:09 UTC 2012
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 <fcntl.h> */
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)
+{
+}
More information about the svn-soc-all
mailing list