psi_abi_v1.h.pp 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. C_MODE_START
  2. struct TABLE_SHARE;
  3. struct sql_digest_storage;
  4. struct PSI_mutex;
  5. typedef struct PSI_mutex PSI_mutex;
  6. struct PSI_rwlock;
  7. typedef struct PSI_rwlock PSI_rwlock;
  8. struct PSI_cond;
  9. typedef struct PSI_cond PSI_cond;
  10. struct PSI_table_share;
  11. typedef struct PSI_table_share PSI_table_share;
  12. struct PSI_table;
  13. typedef struct PSI_table PSI_table;
  14. struct PSI_thread;
  15. typedef struct PSI_thread PSI_thread;
  16. struct PSI_file;
  17. typedef struct PSI_file PSI_file;
  18. struct PSI_socket;
  19. typedef struct PSI_socket PSI_socket;
  20. struct PSI_table_locker;
  21. typedef struct PSI_table_locker PSI_table_locker;
  22. struct PSI_statement_locker;
  23. typedef struct PSI_statement_locker PSI_statement_locker;
  24. struct PSI_idle_locker;
  25. typedef struct PSI_idle_locker PSI_idle_locker;
  26. struct PSI_digest_locker;
  27. typedef struct PSI_digest_locker PSI_digest_locker;
  28. struct PSI_bootstrap
  29. {
  30. void* (*get_interface)(int version);
  31. };
  32. typedef struct PSI_bootstrap PSI_bootstrap;
  33. struct PSI_mutex_locker;
  34. typedef struct PSI_mutex_locker PSI_mutex_locker;
  35. struct PSI_rwlock_locker;
  36. typedef struct PSI_rwlock_locker PSI_rwlock_locker;
  37. struct PSI_cond_locker;
  38. typedef struct PSI_cond_locker PSI_cond_locker;
  39. struct PSI_file_locker;
  40. typedef struct PSI_file_locker PSI_file_locker;
  41. struct PSI_socket_locker;
  42. typedef struct PSI_socket_locker PSI_socket_locker;
  43. enum PSI_mutex_operation
  44. {
  45. PSI_MUTEX_LOCK= 0,
  46. PSI_MUTEX_TRYLOCK= 1
  47. };
  48. typedef enum PSI_mutex_operation PSI_mutex_operation;
  49. enum PSI_rwlock_operation
  50. {
  51. PSI_RWLOCK_READLOCK= 0,
  52. PSI_RWLOCK_WRITELOCK= 1,
  53. PSI_RWLOCK_TRYREADLOCK= 2,
  54. PSI_RWLOCK_TRYWRITELOCK= 3
  55. };
  56. typedef enum PSI_rwlock_operation PSI_rwlock_operation;
  57. enum PSI_cond_operation
  58. {
  59. PSI_COND_WAIT= 0,
  60. PSI_COND_TIMEDWAIT= 1
  61. };
  62. typedef enum PSI_cond_operation PSI_cond_operation;
  63. enum PSI_file_operation
  64. {
  65. PSI_FILE_CREATE= 0,
  66. PSI_FILE_CREATE_TMP= 1,
  67. PSI_FILE_OPEN= 2,
  68. PSI_FILE_STREAM_OPEN= 3,
  69. PSI_FILE_CLOSE= 4,
  70. PSI_FILE_STREAM_CLOSE= 5,
  71. PSI_FILE_READ= 6,
  72. PSI_FILE_WRITE= 7,
  73. PSI_FILE_SEEK= 8,
  74. PSI_FILE_TELL= 9,
  75. PSI_FILE_FLUSH= 10,
  76. PSI_FILE_STAT= 11,
  77. PSI_FILE_FSTAT= 12,
  78. PSI_FILE_CHSIZE= 13,
  79. PSI_FILE_DELETE= 14,
  80. PSI_FILE_RENAME= 15,
  81. PSI_FILE_SYNC= 16
  82. };
  83. typedef enum PSI_file_operation PSI_file_operation;
  84. enum PSI_table_io_operation
  85. {
  86. PSI_TABLE_FETCH_ROW= 0,
  87. PSI_TABLE_WRITE_ROW= 1,
  88. PSI_TABLE_UPDATE_ROW= 2,
  89. PSI_TABLE_DELETE_ROW= 3
  90. };
  91. typedef enum PSI_table_io_operation PSI_table_io_operation;
  92. enum PSI_table_lock_operation
  93. {
  94. PSI_TABLE_LOCK= 0,
  95. PSI_TABLE_EXTERNAL_LOCK= 1
  96. };
  97. typedef enum PSI_table_lock_operation PSI_table_lock_operation;
  98. enum PSI_socket_state
  99. {
  100. PSI_SOCKET_STATE_IDLE= 1,
  101. PSI_SOCKET_STATE_ACTIVE= 2
  102. };
  103. typedef enum PSI_socket_state PSI_socket_state;
  104. enum PSI_socket_operation
  105. {
  106. PSI_SOCKET_CREATE= 0,
  107. PSI_SOCKET_CONNECT= 1,
  108. PSI_SOCKET_BIND= 2,
  109. PSI_SOCKET_CLOSE= 3,
  110. PSI_SOCKET_SEND= 4,
  111. PSI_SOCKET_RECV= 5,
  112. PSI_SOCKET_SENDTO= 6,
  113. PSI_SOCKET_RECVFROM= 7,
  114. PSI_SOCKET_SENDMSG= 8,
  115. PSI_SOCKET_RECVMSG= 9,
  116. PSI_SOCKET_SEEK= 10,
  117. PSI_SOCKET_OPT= 11,
  118. PSI_SOCKET_STAT= 12,
  119. PSI_SOCKET_SHUTDOWN= 13,
  120. PSI_SOCKET_SELECT= 14
  121. };
  122. typedef enum PSI_socket_operation PSI_socket_operation;
  123. typedef unsigned int PSI_mutex_key;
  124. typedef unsigned int PSI_rwlock_key;
  125. typedef unsigned int PSI_cond_key;
  126. typedef unsigned int PSI_thread_key;
  127. typedef unsigned int PSI_file_key;
  128. typedef unsigned int PSI_stage_key;
  129. typedef unsigned int PSI_statement_key;
  130. typedef unsigned int PSI_socket_key;
  131. struct PSI_mutex_info_v1
  132. {
  133. PSI_mutex_key *m_key;
  134. const char *m_name;
  135. int m_flags;
  136. };
  137. struct PSI_rwlock_info_v1
  138. {
  139. PSI_rwlock_key *m_key;
  140. const char *m_name;
  141. int m_flags;
  142. };
  143. struct PSI_cond_info_v1
  144. {
  145. PSI_cond_key *m_key;
  146. const char *m_name;
  147. int m_flags;
  148. };
  149. struct PSI_thread_info_v1
  150. {
  151. PSI_thread_key *m_key;
  152. const char *m_name;
  153. int m_flags;
  154. };
  155. struct PSI_file_info_v1
  156. {
  157. PSI_file_key *m_key;
  158. const char *m_name;
  159. int m_flags;
  160. };
  161. struct PSI_stage_info_v1
  162. {
  163. PSI_stage_key m_key;
  164. const char *m_name;
  165. int m_flags;
  166. };
  167. struct PSI_statement_info_v1
  168. {
  169. PSI_statement_key m_key;
  170. const char *m_name;
  171. int m_flags;
  172. };
  173. struct PSI_socket_info_v1
  174. {
  175. PSI_socket_key *m_key;
  176. const char *m_name;
  177. int m_flags;
  178. };
  179. struct PSI_idle_locker_state_v1
  180. {
  181. uint m_flags;
  182. struct PSI_thread *m_thread;
  183. ulonglong m_timer_start;
  184. ulonglong (*m_timer)(void);
  185. void *m_wait;
  186. };
  187. struct PSI_mutex_locker_state_v1
  188. {
  189. uint m_flags;
  190. enum PSI_mutex_operation m_operation;
  191. struct PSI_mutex *m_mutex;
  192. struct PSI_thread *m_thread;
  193. ulonglong m_timer_start;
  194. ulonglong (*m_timer)(void);
  195. void *m_wait;
  196. };
  197. struct PSI_rwlock_locker_state_v1
  198. {
  199. uint m_flags;
  200. enum PSI_rwlock_operation m_operation;
  201. struct PSI_rwlock *m_rwlock;
  202. struct PSI_thread *m_thread;
  203. ulonglong m_timer_start;
  204. ulonglong (*m_timer)(void);
  205. void *m_wait;
  206. };
  207. struct PSI_cond_locker_state_v1
  208. {
  209. uint m_flags;
  210. enum PSI_cond_operation m_operation;
  211. struct PSI_cond *m_cond;
  212. struct PSI_mutex *m_mutex;
  213. struct PSI_thread *m_thread;
  214. ulonglong m_timer_start;
  215. ulonglong (*m_timer)(void);
  216. void *m_wait;
  217. };
  218. struct PSI_file_locker_state_v1
  219. {
  220. uint m_flags;
  221. enum PSI_file_operation m_operation;
  222. struct PSI_file *m_file;
  223. const char *m_name;
  224. void *m_class;
  225. struct PSI_thread *m_thread;
  226. size_t m_number_of_bytes;
  227. ulonglong m_timer_start;
  228. ulonglong (*m_timer)(void);
  229. void *m_wait;
  230. };
  231. struct PSI_table_locker_state_v1
  232. {
  233. uint m_flags;
  234. enum PSI_table_io_operation m_io_operation;
  235. struct PSI_table *m_table;
  236. struct PSI_table_share *m_table_share;
  237. struct PSI_thread *m_thread;
  238. ulonglong m_timer_start;
  239. ulonglong (*m_timer)(void);
  240. void *m_wait;
  241. uint m_index;
  242. };
  243. struct PSI_statement_locker_state_v1
  244. {
  245. my_bool m_discarded;
  246. uchar m_no_index_used;
  247. uchar m_no_good_index_used;
  248. uint m_flags;
  249. void *m_class;
  250. struct PSI_thread *m_thread;
  251. ulonglong m_timer_start;
  252. ulonglong (*m_timer)(void);
  253. void *m_statement;
  254. ulonglong m_lock_time;
  255. ulonglong m_rows_sent;
  256. ulonglong m_rows_examined;
  257. ulong m_created_tmp_disk_tables;
  258. ulong m_created_tmp_tables;
  259. ulong m_select_full_join;
  260. ulong m_select_full_range_join;
  261. ulong m_select_range;
  262. ulong m_select_range_check;
  263. ulong m_select_scan;
  264. ulong m_sort_merge_passes;
  265. ulong m_sort_range;
  266. ulong m_sort_rows;
  267. ulong m_sort_scan;
  268. const struct sql_digest_storage *m_digest;
  269. char m_schema_name[(64 * 3)];
  270. uint m_schema_name_length;
  271. uint m_cs_number;
  272. };
  273. struct PSI_socket_locker_state_v1
  274. {
  275. uint m_flags;
  276. struct PSI_socket *m_socket;
  277. struct PSI_thread *m_thread;
  278. size_t m_number_of_bytes;
  279. ulonglong m_timer_start;
  280. ulonglong (*m_timer)(void);
  281. enum PSI_socket_operation m_operation;
  282. const char* m_src_file;
  283. int m_src_line;
  284. void *m_wait;
  285. };
  286. typedef void (*register_mutex_v1_t)
  287. (const char *category, struct PSI_mutex_info_v1 *info, int count);
  288. typedef void (*register_rwlock_v1_t)
  289. (const char *category, struct PSI_rwlock_info_v1 *info, int count);
  290. typedef void (*register_cond_v1_t)
  291. (const char *category, struct PSI_cond_info_v1 *info, int count);
  292. typedef void (*register_thread_v1_t)
  293. (const char *category, struct PSI_thread_info_v1 *info, int count);
  294. typedef void (*register_file_v1_t)
  295. (const char *category, struct PSI_file_info_v1 *info, int count);
  296. typedef void (*register_stage_v1_t)
  297. (const char *category, struct PSI_stage_info_v1 **info, int count);
  298. typedef void (*register_statement_v1_t)
  299. (const char *category, struct PSI_statement_info_v1 *info, int count);
  300. typedef void (*register_socket_v1_t)
  301. (const char *category, struct PSI_socket_info_v1 *info, int count);
  302. typedef struct PSI_mutex* (*init_mutex_v1_t)
  303. (PSI_mutex_key key, const void *identity);
  304. typedef void (*destroy_mutex_v1_t)(struct PSI_mutex *mutex);
  305. typedef struct PSI_rwlock* (*init_rwlock_v1_t)
  306. (PSI_rwlock_key key, const void *identity);
  307. typedef void (*destroy_rwlock_v1_t)(struct PSI_rwlock *rwlock);
  308. typedef struct PSI_cond* (*init_cond_v1_t)
  309. (PSI_cond_key key, const void *identity);
  310. typedef void (*destroy_cond_v1_t)(struct PSI_cond *cond);
  311. typedef struct PSI_socket* (*init_socket_v1_t)
  312. (PSI_socket_key key, const my_socket *fd,
  313. const struct sockaddr *addr, socklen_t addr_len);
  314. typedef void (*destroy_socket_v1_t)(struct PSI_socket *socket);
  315. typedef struct PSI_table_share* (*get_table_share_v1_t)
  316. (my_bool temporary, struct TABLE_SHARE *share);
  317. typedef void (*release_table_share_v1_t)(struct PSI_table_share *share);
  318. typedef void (*drop_table_share_v1_t)
  319. (my_bool temporary, const char *schema_name, int schema_name_length,
  320. const char *table_name, int table_name_length);
  321. typedef struct PSI_table* (*open_table_v1_t)
  322. (struct PSI_table_share *share, const void *identity);
  323. typedef void (*unbind_table_v1_t)
  324. (struct PSI_table *table);
  325. typedef PSI_table* (*rebind_table_v1_t)
  326. (PSI_table_share *share, const void *identity, PSI_table *table);
  327. typedef void (*close_table_v1_t)(struct PSI_table *table);
  328. typedef void (*create_file_v1_t)(PSI_file_key key, const char *name,
  329. File file);
  330. typedef int (*spawn_thread_v1_t)(PSI_thread_key key,
  331. pthread_t *thread,
  332. const pthread_attr_t *attr,
  333. void *(*start_routine)(void*), void *arg);
  334. typedef struct PSI_thread* (*new_thread_v1_t)
  335. (PSI_thread_key key, const void *identity, ulonglong thread_id);
  336. typedef void (*set_thread_id_v1_t)(struct PSI_thread *thread,
  337. ulonglong id);
  338. typedef struct PSI_thread* (*get_thread_v1_t)(void);
  339. typedef void (*set_thread_user_v1_t)(const char *user, int user_len);
  340. typedef void (*set_thread_user_host_v1_t)(const char *user, int user_len,
  341. const char *host, int host_len);
  342. typedef void (*set_thread_db_v1_t)(const char* db, int db_len);
  343. typedef void (*set_thread_command_v1_t)(int command);
  344. typedef void (*set_thread_start_time_v1_t)(time_t start_time);
  345. typedef void (*set_thread_state_v1_t)(const char* state);
  346. typedef void (*set_thread_info_v1_t)(const char* info, uint info_len);
  347. typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
  348. typedef void (*delete_current_thread_v1_t)(void);
  349. typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
  350. typedef struct PSI_file_locker* (*get_thread_file_name_locker_v1_t)
  351. (struct PSI_file_locker_state_v1 *state,
  352. PSI_file_key key, enum PSI_file_operation op, const char *name,
  353. const void *identity);
  354. typedef struct PSI_file_locker* (*get_thread_file_stream_locker_v1_t)
  355. (struct PSI_file_locker_state_v1 *state,
  356. struct PSI_file *file, enum PSI_file_operation op);
  357. typedef struct PSI_file_locker* (*get_thread_file_descriptor_locker_v1_t)
  358. (struct PSI_file_locker_state_v1 *state,
  359. File file, enum PSI_file_operation op);
  360. typedef void (*unlock_mutex_v1_t)
  361. (struct PSI_mutex *mutex);
  362. typedef void (*unlock_rwlock_v1_t)
  363. (struct PSI_rwlock *rwlock);
  364. typedef void (*signal_cond_v1_t)
  365. (struct PSI_cond *cond);
  366. typedef void (*broadcast_cond_v1_t)
  367. (struct PSI_cond *cond);
  368. typedef struct PSI_idle_locker* (*start_idle_wait_v1_t)
  369. (struct PSI_idle_locker_state_v1 *state, const char *src_file, uint src_line);
  370. typedef void (*end_idle_wait_v1_t)
  371. (struct PSI_idle_locker *locker);
  372. typedef struct PSI_mutex_locker* (*start_mutex_wait_v1_t)
  373. (struct PSI_mutex_locker_state_v1 *state,
  374. struct PSI_mutex *mutex,
  375. enum PSI_mutex_operation op,
  376. const char *src_file, uint src_line);
  377. typedef void (*end_mutex_wait_v1_t)
  378. (struct PSI_mutex_locker *locker, int rc);
  379. typedef struct PSI_rwlock_locker* (*start_rwlock_rdwait_v1_t)
  380. (struct PSI_rwlock_locker_state_v1 *state,
  381. struct PSI_rwlock *rwlock,
  382. enum PSI_rwlock_operation op,
  383. const char *src_file, uint src_line);
  384. typedef void (*end_rwlock_rdwait_v1_t)
  385. (struct PSI_rwlock_locker *locker, int rc);
  386. typedef struct PSI_rwlock_locker* (*start_rwlock_wrwait_v1_t)
  387. (struct PSI_rwlock_locker_state_v1 *state,
  388. struct PSI_rwlock *rwlock,
  389. enum PSI_rwlock_operation op,
  390. const char *src_file, uint src_line);
  391. typedef void (*end_rwlock_wrwait_v1_t)
  392. (struct PSI_rwlock_locker *locker, int rc);
  393. typedef struct PSI_cond_locker* (*start_cond_wait_v1_t)
  394. (struct PSI_cond_locker_state_v1 *state,
  395. struct PSI_cond *cond,
  396. struct PSI_mutex *mutex,
  397. enum PSI_cond_operation op,
  398. const char *src_file, uint src_line);
  399. typedef void (*end_cond_wait_v1_t)
  400. (struct PSI_cond_locker *locker, int rc);
  401. typedef struct PSI_table_locker* (*start_table_io_wait_v1_t)
  402. (struct PSI_table_locker_state_v1 *state,
  403. struct PSI_table *table,
  404. enum PSI_table_io_operation op,
  405. uint index,
  406. const char *src_file, uint src_line);
  407. typedef void (*end_table_io_wait_v1_t)(struct PSI_table_locker *locker);
  408. typedef struct PSI_table_locker* (*start_table_lock_wait_v1_t)
  409. (struct PSI_table_locker_state_v1 *state,
  410. struct PSI_table *table,
  411. enum PSI_table_lock_operation op,
  412. ulong flags,
  413. const char *src_file, uint src_line);
  414. typedef void (*end_table_lock_wait_v1_t)(struct PSI_table_locker *locker);
  415. typedef void (*start_file_open_wait_v1_t)
  416. (struct PSI_file_locker *locker, const char *src_file, uint src_line);
  417. typedef struct PSI_file* (*end_file_open_wait_v1_t)
  418. (struct PSI_file_locker *locker, void *result);
  419. typedef void (*end_file_open_wait_and_bind_to_descriptor_v1_t)
  420. (struct PSI_file_locker *locker, File file);
  421. typedef void (*start_file_wait_v1_t)
  422. (struct PSI_file_locker *locker, size_t count,
  423. const char *src_file, uint src_line);
  424. typedef void (*end_file_wait_v1_t)
  425. (struct PSI_file_locker *locker, size_t count);
  426. typedef void (*start_file_close_wait_v1_t)
  427. (struct PSI_file_locker *locker, const char *src_file, uint src_line);
  428. typedef void (*end_file_close_wait_v1_t)
  429. (struct PSI_file_locker *locker, int rc);
  430. typedef void (*start_stage_v1_t)
  431. (PSI_stage_key key, const char *src_file, int src_line);
  432. typedef void (*end_stage_v1_t) (void);
  433. typedef struct PSI_statement_locker* (*get_thread_statement_locker_v1_t)
  434. (struct PSI_statement_locker_state_v1 *state,
  435. PSI_statement_key key, const void *charset);
  436. typedef struct PSI_statement_locker* (*refine_statement_v1_t)
  437. (struct PSI_statement_locker *locker,
  438. PSI_statement_key key);
  439. typedef void (*start_statement_v1_t)
  440. (struct PSI_statement_locker *locker,
  441. const char *db, uint db_length,
  442. const char *src_file, uint src_line);
  443. typedef void (*set_statement_text_v1_t)
  444. (struct PSI_statement_locker *locker,
  445. const char *text, uint text_len);
  446. typedef void (*set_statement_lock_time_t)
  447. (struct PSI_statement_locker *locker, ulonglong lock_time);
  448. typedef void (*set_statement_rows_sent_t)
  449. (struct PSI_statement_locker *locker, ulonglong count);
  450. typedef void (*set_statement_rows_examined_t)
  451. (struct PSI_statement_locker *locker, ulonglong count);
  452. typedef void (*inc_statement_created_tmp_disk_tables_t)
  453. (struct PSI_statement_locker *locker, ulong count);
  454. typedef void (*inc_statement_created_tmp_tables_t)
  455. (struct PSI_statement_locker *locker, ulong count);
  456. typedef void (*inc_statement_select_full_join_t)
  457. (struct PSI_statement_locker *locker, ulong count);
  458. typedef void (*inc_statement_select_full_range_join_t)
  459. (struct PSI_statement_locker *locker, ulong count);
  460. typedef void (*inc_statement_select_range_t)
  461. (struct PSI_statement_locker *locker, ulong count);
  462. typedef void (*inc_statement_select_range_check_t)
  463. (struct PSI_statement_locker *locker, ulong count);
  464. typedef void (*inc_statement_select_scan_t)
  465. (struct PSI_statement_locker *locker, ulong count);
  466. typedef void (*inc_statement_sort_merge_passes_t)
  467. (struct PSI_statement_locker *locker, ulong count);
  468. typedef void (*inc_statement_sort_range_t)
  469. (struct PSI_statement_locker *locker, ulong count);
  470. typedef void (*inc_statement_sort_rows_t)
  471. (struct PSI_statement_locker *locker, ulong count);
  472. typedef void (*inc_statement_sort_scan_t)
  473. (struct PSI_statement_locker *locker, ulong count);
  474. typedef void (*set_statement_no_index_used_t)
  475. (struct PSI_statement_locker *locker);
  476. typedef void (*set_statement_no_good_index_used_t)
  477. (struct PSI_statement_locker *locker);
  478. typedef void (*end_statement_v1_t)
  479. (struct PSI_statement_locker *locker, void *stmt_da);
  480. typedef struct PSI_socket_locker* (*start_socket_wait_v1_t)
  481. (struct PSI_socket_locker_state_v1 *state,
  482. struct PSI_socket *socket,
  483. enum PSI_socket_operation op,
  484. size_t count,
  485. const char *src_file, uint src_line);
  486. typedef void (*end_socket_wait_v1_t)
  487. (struct PSI_socket_locker *locker, size_t count);
  488. typedef void (*set_socket_state_v1_t)(struct PSI_socket *socket,
  489. enum PSI_socket_state state);
  490. typedef void (*set_socket_info_v1_t)(struct PSI_socket *socket,
  491. const my_socket *fd,
  492. const struct sockaddr *addr,
  493. socklen_t addr_len);
  494. typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket);
  495. typedef struct PSI_digest_locker * (*digest_start_v1_t)
  496. (struct PSI_statement_locker *locker);
  497. typedef void (*digest_end_v1_t)
  498. (struct PSI_digest_locker *locker, const struct sql_digest_storage *digest);
  499. typedef int (*set_thread_connect_attrs_v1_t)(const char *buffer, uint length,
  500. const void *from_cs);
  501. struct PSI_v1
  502. {
  503. register_mutex_v1_t register_mutex;
  504. register_rwlock_v1_t register_rwlock;
  505. register_cond_v1_t register_cond;
  506. register_thread_v1_t register_thread;
  507. register_file_v1_t register_file;
  508. register_stage_v1_t register_stage;
  509. register_statement_v1_t register_statement;
  510. register_socket_v1_t register_socket;
  511. init_mutex_v1_t init_mutex;
  512. destroy_mutex_v1_t destroy_mutex;
  513. init_rwlock_v1_t init_rwlock;
  514. destroy_rwlock_v1_t destroy_rwlock;
  515. init_cond_v1_t init_cond;
  516. destroy_cond_v1_t destroy_cond;
  517. init_socket_v1_t init_socket;
  518. destroy_socket_v1_t destroy_socket;
  519. get_table_share_v1_t get_table_share;
  520. release_table_share_v1_t release_table_share;
  521. drop_table_share_v1_t drop_table_share;
  522. open_table_v1_t open_table;
  523. unbind_table_v1_t unbind_table;
  524. rebind_table_v1_t rebind_table;
  525. close_table_v1_t close_table;
  526. create_file_v1_t create_file;
  527. spawn_thread_v1_t spawn_thread;
  528. new_thread_v1_t new_thread;
  529. set_thread_id_v1_t set_thread_id;
  530. get_thread_v1_t get_thread;
  531. set_thread_user_v1_t set_thread_user;
  532. set_thread_user_host_v1_t set_thread_user_host;
  533. set_thread_db_v1_t set_thread_db;
  534. set_thread_command_v1_t set_thread_command;
  535. set_thread_start_time_v1_t set_thread_start_time;
  536. set_thread_state_v1_t set_thread_state;
  537. set_thread_info_v1_t set_thread_info;
  538. set_thread_v1_t set_thread;
  539. delete_current_thread_v1_t delete_current_thread;
  540. delete_thread_v1_t delete_thread;
  541. get_thread_file_name_locker_v1_t get_thread_file_name_locker;
  542. get_thread_file_stream_locker_v1_t get_thread_file_stream_locker;
  543. get_thread_file_descriptor_locker_v1_t get_thread_file_descriptor_locker;
  544. unlock_mutex_v1_t unlock_mutex;
  545. unlock_rwlock_v1_t unlock_rwlock;
  546. signal_cond_v1_t signal_cond;
  547. broadcast_cond_v1_t broadcast_cond;
  548. start_idle_wait_v1_t start_idle_wait;
  549. end_idle_wait_v1_t end_idle_wait;
  550. start_mutex_wait_v1_t start_mutex_wait;
  551. end_mutex_wait_v1_t end_mutex_wait;
  552. start_rwlock_rdwait_v1_t start_rwlock_rdwait;
  553. end_rwlock_rdwait_v1_t end_rwlock_rdwait;
  554. start_rwlock_wrwait_v1_t start_rwlock_wrwait;
  555. end_rwlock_wrwait_v1_t end_rwlock_wrwait;
  556. start_cond_wait_v1_t start_cond_wait;
  557. end_cond_wait_v1_t end_cond_wait;
  558. start_table_io_wait_v1_t start_table_io_wait;
  559. end_table_io_wait_v1_t end_table_io_wait;
  560. start_table_lock_wait_v1_t start_table_lock_wait;
  561. end_table_lock_wait_v1_t end_table_lock_wait;
  562. start_file_open_wait_v1_t start_file_open_wait;
  563. end_file_open_wait_v1_t end_file_open_wait;
  564. end_file_open_wait_and_bind_to_descriptor_v1_t
  565. end_file_open_wait_and_bind_to_descriptor;
  566. start_file_wait_v1_t start_file_wait;
  567. end_file_wait_v1_t end_file_wait;
  568. start_file_close_wait_v1_t start_file_close_wait;
  569. end_file_close_wait_v1_t end_file_close_wait;
  570. start_stage_v1_t start_stage;
  571. end_stage_v1_t end_stage;
  572. get_thread_statement_locker_v1_t get_thread_statement_locker;
  573. refine_statement_v1_t refine_statement;
  574. start_statement_v1_t start_statement;
  575. set_statement_text_v1_t set_statement_text;
  576. set_statement_lock_time_t set_statement_lock_time;
  577. set_statement_rows_sent_t set_statement_rows_sent;
  578. set_statement_rows_examined_t set_statement_rows_examined;
  579. inc_statement_created_tmp_disk_tables_t inc_statement_created_tmp_disk_tables;
  580. inc_statement_created_tmp_tables_t inc_statement_created_tmp_tables;
  581. inc_statement_select_full_join_t inc_statement_select_full_join;
  582. inc_statement_select_full_range_join_t inc_statement_select_full_range_join;
  583. inc_statement_select_range_t inc_statement_select_range;
  584. inc_statement_select_range_check_t inc_statement_select_range_check;
  585. inc_statement_select_scan_t inc_statement_select_scan;
  586. inc_statement_sort_merge_passes_t inc_statement_sort_merge_passes;
  587. inc_statement_sort_range_t inc_statement_sort_range;
  588. inc_statement_sort_rows_t inc_statement_sort_rows;
  589. inc_statement_sort_scan_t inc_statement_sort_scan;
  590. set_statement_no_index_used_t set_statement_no_index_used;
  591. set_statement_no_good_index_used_t set_statement_no_good_index_used;
  592. end_statement_v1_t end_statement;
  593. start_socket_wait_v1_t start_socket_wait;
  594. end_socket_wait_v1_t end_socket_wait;
  595. set_socket_state_v1_t set_socket_state;
  596. set_socket_info_v1_t set_socket_info;
  597. set_socket_thread_owner_v1_t set_socket_thread_owner;
  598. digest_start_v1_t digest_start;
  599. digest_end_v1_t digest_end;
  600. set_thread_connect_attrs_v1_t set_thread_connect_attrs;
  601. };
  602. typedef struct PSI_v1 PSI;
  603. typedef struct PSI_mutex_info_v1 PSI_mutex_info;
  604. typedef struct PSI_rwlock_info_v1 PSI_rwlock_info;
  605. typedef struct PSI_cond_info_v1 PSI_cond_info;
  606. typedef struct PSI_thread_info_v1 PSI_thread_info;
  607. typedef struct PSI_file_info_v1 PSI_file_info;
  608. typedef struct PSI_stage_info_v1 PSI_stage_info;
  609. typedef struct PSI_statement_info_v1 PSI_statement_info;
  610. typedef struct PSI_socket_info_v1 PSI_socket_info;
  611. typedef struct PSI_idle_locker_state_v1 PSI_idle_locker_state;
  612. typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state;
  613. typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state;
  614. typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state;
  615. typedef struct PSI_file_locker_state_v1 PSI_file_locker_state;
  616. typedef struct PSI_table_locker_state_v1 PSI_table_locker_state;
  617. typedef struct PSI_statement_locker_state_v1 PSI_statement_locker_state;
  618. typedef struct PSI_socket_locker_state_v1 PSI_socket_locker_state;
  619. extern MYSQL_PLUGIN_IMPORT PSI *PSI_server;
  620. C_MODE_END