@@ -899,19 +899,30 @@ static inline int mysql_mutex_lock(...)
899
899
@ingroup Performance_schema_implementation
900
900
*/
901
901
902
+ /* * TIMED bit in the state flags bitfield. */
902
903
#define STATE_FLAG_TIMED (1 <<0 )
904
+ /* * THREAD bit in the state flags bitfield. */
903
905
#define STATE_FLAG_THREAD (1 <<1 )
906
+ /* * EVENT bit in the state flags bitfield. */
904
907
#define STATE_FLAG_WAIT (1 <<2 )
905
908
906
909
pthread_key (PFS_thread*, THR_PFS);
907
910
bool THR_PFS_initialized= false ;
908
911
912
+ /* *
913
+ Conversion map from PSI_mutex_operation to enum_operation_type.
914
+ Indexed by enum PSI_mutex_operation.
915
+ */
909
916
static enum_operation_type mutex_operation_map[]=
910
917
{
911
918
OPERATION_TYPE_LOCK,
912
919
OPERATION_TYPE_TRYLOCK
913
920
};
914
921
922
+ /* *
923
+ Conversion map from PSI_rwlock_operation to enum_operation_type.
924
+ Indexed by enum PSI_rwlock_operation.
925
+ */
915
926
static enum_operation_type rwlock_operation_map[]=
916
927
{
917
928
OPERATION_TYPE_READLOCK,
@@ -920,6 +931,10 @@ static enum_operation_type rwlock_operation_map[]=
920
931
OPERATION_TYPE_TRYWRITELOCK
921
932
};
922
933
934
+ /* *
935
+ Conversion map from PSI_cond_operation to enum_operation_type.
936
+ Indexed by enum PSI_cond_operation.
937
+ */
923
938
static enum_operation_type cond_operation_map[]=
924
939
{
925
940
OPERATION_TYPE_WAIT,
@@ -1072,6 +1087,10 @@ static int build_prefix(const LEX_STRING *prefix, const char *category,
1072
1087
1073
1088
C_MODE_START
1074
1089
1090
+ /* *
1091
+ Implementation of the mutex instrumentation interface.
1092
+ @sa PSI_v1::register_mutex.
1093
+ */
1075
1094
static void register_mutex_v1 (const char *category,
1076
1095
PSI_mutex_info_v1 *info,
1077
1096
int count)
@@ -1081,6 +1100,10 @@ static void register_mutex_v1(const char *category,
1081
1100
register_mutex_class)
1082
1101
}
1083
1102
1103
+ /* *
1104
+ Implementation of the rwlock instrumentation interface.
1105
+ @sa PSI_v1::register_rwlock.
1106
+ */
1084
1107
static void register_rwlock_v1 (const char *category,
1085
1108
PSI_rwlock_info_v1 *info,
1086
1109
int count)
@@ -1090,6 +1113,10 @@ static void register_rwlock_v1(const char *category,
1090
1113
register_rwlock_class)
1091
1114
}
1092
1115
1116
+ /* *
1117
+ Implementation of the cond instrumentation interface.
1118
+ @sa PSI_v1::register_cond.
1119
+ */
1093
1120
static void register_cond_v1 (const char *category,
1094
1121
PSI_cond_info_v1 *info,
1095
1122
int count)
@@ -1099,6 +1126,10 @@ static void register_cond_v1(const char *category,
1099
1126
register_cond_class)
1100
1127
}
1101
1128
1129
+ /* *
1130
+ Implementation of the thread instrumentation interface.
1131
+ @sa PSI_v1::register_thread.
1132
+ */
1102
1133
static void register_thread_v1 (const char *category,
1103
1134
PSI_thread_info_v1 *info,
1104
1135
int count)
@@ -1108,6 +1139,10 @@ static void register_thread_v1(const char *category,
1108
1139
register_thread_class)
1109
1140
}
1110
1141
1142
+ /* *
1143
+ Implementation of the file instrumentation interface.
1144
+ @sa PSI_v1::register_file.
1145
+ */
1111
1146
static void register_file_v1 (const char *category,
1112
1147
PSI_file_info_v1 *info,
1113
1148
int count)
@@ -1304,6 +1339,11 @@ static void create_file_v1(PSI_file_key key, const char *name, File file)
1304
1339
file_handle_array[index ]= pfs_file;
1305
1340
}
1306
1341
1342
+ /* *
1343
+ Arguments given from a parent to a child thread, packaged in one structure.
1344
+ This data is used when spawning a new instrumented thread.
1345
+ @sa pfs_spawn_thread.
1346
+ */
1307
1347
struct PFS_spawn_thread_arg
1308
1348
{
1309
1349
PFS_thread *m_parent_thread;
@@ -1619,12 +1659,20 @@ static void set_thread_info_v1(const char* info, int info_len)
1619
1659
}
1620
1660
}
1621
1661
1662
+ /* *
1663
+ Implementation of the thread instrumentation interface.
1664
+ @sa PSI_v1::set_thread.
1665
+ */
1622
1666
static void set_thread_v1 (PSI_thread* thread)
1623
1667
{
1624
1668
PFS_thread *pfs= reinterpret_cast <PFS_thread*> (thread);
1625
1669
my_pthread_setspecific_ptr (THR_PFS, pfs);
1626
1670
}
1627
1671
1672
+ /* *
1673
+ Implementation of the thread instrumentation interface.
1674
+ @sa PSI_v1::delete_current_thread.
1675
+ */
1628
1676
static void delete_current_thread_v1 (void )
1629
1677
{
1630
1678
PFS_thread *thread= my_pthread_getspecific_ptr (PFS_thread*, THR_PFS);
@@ -1636,6 +1684,10 @@ static void delete_current_thread_v1(void)
1636
1684
}
1637
1685
}
1638
1686
1687
+ /* *
1688
+ Implementation of the thread instrumentation interface.
1689
+ @sa PSI_v1::delete_thread.
1690
+ */
1639
1691
static void delete_thread_v1 (PSI_thread *thread)
1640
1692
{
1641
1693
PFS_thread *pfs= reinterpret_cast <PFS_thread*> (thread);
@@ -2471,6 +2523,10 @@ get_thread_file_descriptor_locker_v1(PSI_file_locker_state *state,
2471
2523
return reinterpret_cast <PSI_file_locker*> (state);
2472
2524
}
2473
2525
2526
+ /* *
2527
+ Implementation of the mutex instrumentation interface.
2528
+ @sa PSI_v1::unlock_mutex.
2529
+ */
2474
2530
static void unlock_mutex_v1 (PSI_mutex *mutex)
2475
2531
{
2476
2532
PFS_mutex *pfs_mutex= reinterpret_cast <PFS_mutex*> (mutex);
@@ -2510,6 +2566,10 @@ static void unlock_mutex_v1(PSI_mutex *mutex)
2510
2566
#endif
2511
2567
}
2512
2568
2569
+ /* *
2570
+ Implementation of the rwlock instrumentation interface.
2571
+ @sa PSI_v1::unlock_rwlock.
2572
+ */
2513
2573
static void unlock_rwlock_v1 (PSI_rwlock *rwlock)
2514
2574
{
2515
2575
PFS_rwlock *pfs_rwlock= reinterpret_cast <PFS_rwlock*> (rwlock);
@@ -2586,6 +2646,10 @@ static void unlock_rwlock_v1(PSI_rwlock *rwlock)
2586
2646
#endif
2587
2647
}
2588
2648
2649
+ /* *
2650
+ Implementation of the cond instrumentation interface.
2651
+ @sa PSI_v1::signal_cond.
2652
+ */
2589
2653
static void signal_cond_v1 (PSI_cond* cond)
2590
2654
{
2591
2655
PFS_cond *pfs_cond= reinterpret_cast <PFS_cond*> (cond);
@@ -2594,6 +2658,10 @@ static void signal_cond_v1(PSI_cond* cond)
2594
2658
pfs_cond->m_cond_stat .m_signal_count ++;
2595
2659
}
2596
2660
2661
+ /* *
2662
+ Implementation of the cond instrumentation interface.
2663
+ @sa PSI_v1::broadcast_cond.
2664
+ */
2597
2665
static void broadcast_cond_v1 (PSI_cond* cond)
2598
2666
{
2599
2667
PFS_cond *pfs_cond= reinterpret_cast <PFS_cond*> (cond);
0 commit comments