[Openmp-commits] [openmp] r263967 - [STATS] Add OMP_critical and OMP_critical_wait timers

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Mon Mar 21 11:32:26 PDT 2016


Author: jlpeyton
Date: Mon Mar 21 13:32:26 2016
New Revision: 263967

URL: http://llvm.org/viewvc/llvm-project?rev=263967&view=rev
Log:
[STATS] Add OMP_critical and OMP_critical_wait timers

OMP_critical - time spent in critical section
OMP_critical_wait - time spent waiting to enter a critical section

Modified:
    openmp/trunk/runtime/src/kmp_csupport.c
    openmp/trunk/runtime/src/kmp_stats.h

Modified: openmp/trunk/runtime/src/kmp_csupport.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_csupport.c?rev=263967&r1=263966&r2=263967&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_csupport.c (original)
+++ openmp/trunk/runtime/src/kmp_csupport.c Mon Mar 21 13:32:26 2016
@@ -1114,6 +1114,7 @@ __kmpc_critical( ident_t * loc, kmp_int3
     __kmpc_critical_with_hint(loc, global_tid, crit, omp_lock_hint_none);
 #else
     KMP_COUNT_BLOCK(OMP_CRITICAL);
+    KMP_TIME_BLOCK(OMP_critical_wait);        /* Time spent waiting to enter the critical section */
     kmp_user_lock_p lck;
 
     KC_TRACE( 10, ("__kmpc_critical: called T#%d\n", global_tid ) );
@@ -1155,6 +1156,7 @@ __kmpc_critical( ident_t * loc, kmp_int3
     __kmp_itt_critical_acquired( lck );
 #endif /* USE_ITT_BUILD */
 
+    KMP_START_EXPLICIT_TIMER(OMP_critical);
     KA_TRACE( 15, ("__kmpc_critical: done T#%d\n", global_tid ));
 #endif // KMP_USE_DYNAMIC_LOCK
 }
@@ -1359,7 +1361,7 @@ __kmpc_end_critical(ident_t *loc, kmp_in
 #endif
 
 #endif // KMP_USE_DYNAMIC_LOCK
-
+    KMP_STOP_EXPLICIT_TIMER(OMP_critical);
     KA_TRACE( 15, ("__kmpc_end_critical: done T#%d\n", global_tid ));
 }
 

Modified: openmp/trunk/runtime/src/kmp_stats.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_stats.h?rev=263967&r1=263966&r2=263967&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_stats.h (original)
+++ openmp/trunk/runtime/src/kmp_stats.h Mon Mar 21 13:32:26 2016
@@ -111,6 +111,8 @@ enum stats_flags_e {
     macro (FOR_static_scheduling, 0, arg)                               \
     macro (FOR_dynamic_scheduling, 0, arg)                              \
     macro (OMP_task,      0, arg)                                       \
+    macro (OMP_critical,  0, arg)                                       \
+    macro (OMP_critical_wait,  0, arg)                                  \
     macro (OMP_single,    0, arg)                                       \
     macro (OMP_master,    0, arg)                                       \
     macro (OMP_set_numthreads,    stats_flags_e::noUnits | stats_flags_e::noTotal, arg) \
@@ -198,6 +200,7 @@ enum stats_flags_e {
 #define KMP_FOREACH_EXPLICIT_TIMER(macro, arg)          \
     macro(OMP_serial, 0, arg)                           \
     macro(OMP_start_end, 0, arg)                        \
+    macro(OMP_critical, 0, arg)                         \
     macro(OMP_single, 0, arg)                           \
     macro(OMP_master, 0, arg)                           \
     KMP_FOREACH_EXPLICIT_DEVELOPER_TIMER(macro,arg)     \




More information about the Openmp-commits mailing list