24#ifndef PFS_BUFFER_CONTAINER_H
25#define PFS_BUFFER_CONTAINER_H
51class PFS_opaque_container_page;
52class PFS_opaque_container;
62template <
class T,
class U,
class V>
65template <
class T,
int PFS_PAGE_SIZE,
int PFS_PAGE_COUNT,
class U,
class V>
74template <
class T,
class U,
class V>
77template <
class T,
int PFS_PAGE_SIZE,
int PFS_PAGE_COUNT,
class U,
class V>
80template <
class B,
int COUNT>
83template <
class B,
int COUNT>
102 size_t max =
m_max.load();
104 T *ptr =
m_ptr.load();
107 monotonic_max = monotonic + max;
109 if (
unlikely(monotonic >= monotonic_max)) {
120 while (monotonic < monotonic_max) {
121 index = monotonic % max;
124 if (
pfs->m_lock.free_to_dirty(dirty_state)) {
135 pfs->m_lock.allocated_to_free();
203 array->
m_ptr =
nullptr;
207 if (array->
m_max > 0) {
210 if (array->
m_ptr ==
nullptr) {
219 assert(array->
m_max > 0);
222 array->
m_ptr =
nullptr;
229template <
class T,
class U = PFS_buffer_default_array<T>,
230 class V = PFS_buffer_default_allocator<T>>
247 m_array.m_monotonic.m_size_t = 0;
291 assert(index <=
m_max);
299 while (
pfs < pfs_last) {
300 if (
pfs->m_lock.is_populated()) {
311 while (
pfs < pfs_last) {
321 while (
pfs < pfs_last) {
322 if (
pfs->m_lock.is_populated()) {
333 while (
pfs < pfs_last) {
340 assert(index <
m_max);
343 if (
pfs->m_lock.is_populated()) {
351 if (index >=
m_max) {
365 if ((
pfs <= unsafe) && (unsafe < pfs_last)) {
379 assert(index <=
m_max);
385 while (
pfs < pfs_last) {
386 if (
pfs->m_lock.is_populated()) {
387 uint found =
pfs - pfs_first;
388 *found_index = found;
404template <
class T,
int PFS_PAGE_SIZE,
int PFS_PAGE_COUNT,
435 static const size_t MAX_SIZE = PFS_PAGE_SIZE * PFS_PAGE_COUNT;
447 m_max = PFS_PAGE_COUNT * PFS_PAGE_SIZE;
454 for (i = 0; i < PFS_PAGE_COUNT; i++) {
461 }
else if (max_size > 0) {
462 if (max_size % PFS_PAGE_SIZE == 0) {
500 for (i = 0; i < PFS_PAGE_COUNT; i++) {
502 if (
page !=
nullptr) {
503 allocator->free_array(
page);
517 size_t result = page_count * PFS_PAGE_SIZE;
538 size_t monotonic_max;
539 size_t current_page_count;
548 if (current_page_count != 0) {
550 monotonic_max = monotonic + current_page_count;
552 if (
unlikely(monotonic >= monotonic_max)) {
560 monotonic_max = current_page_count;
563 while (monotonic < monotonic_max) {
568 index = monotonic % current_page_count;
573 if (array !=
nullptr) {
574 pfs = array->allocate(dirty_state);
575 if (
pfs !=
nullptr) {
577 pfs->m_page =
reinterpret_cast<PFS_opaque_container_page *
>(array);
609 array =
m_pages[current_page_count].load();
611 if (array ==
nullptr) {
645 array =
m_pages[current_page_count].load();
647 if (array ==
nullptr) {
656 int rc = allocator->alloc_array(array);
658 allocator->free_array(array);
667 array->m_container =
reinterpret_cast<PFS_opaque_container *
>(
this);
670 m_pages[current_page_count].store(array);
683 assert(array !=
nullptr);
684 pfs = array->allocate(dirty_state);
685 if (
pfs !=
nullptr) {
687 pfs->m_page =
reinterpret_cast<PFS_opaque_container_page *
>(array);
691 current_page_count++;
701 PFS_opaque_container_page *opaque_page = safe_pfs->m_page;
705 safe_pfs->m_lock.dirty_to_free(dirty_state);
708 if (
page->m_full.load()) {
709 page->m_full.store(
false);
720 PFS_opaque_container_page *opaque_page = safe_pfs->m_page;
724 safe_pfs->m_lock.allocated_to_free();
727 if (
page->m_full.load()) {
728 page->m_full.store(
false);
739 PFS_opaque_container_page *opaque_page = safe_pfs->m_page;
743 safe_pfs->m_lock.allocated_to_free();
746 if (
page->m_full.load()) {
747 page->m_full.store(
false);
751 PFS_opaque_container *opaque_container =
page->m_container;
767 assert(index <=
m_max);
778 for (i = 0; i < PFS_PAGE_COUNT; i++) {
780 if (
page !=
nullptr) {
782 pfs_last =
page->get_last();
784 while (
pfs < pfs_last) {
785 if (
pfs->m_lock.is_populated()) {
800 for (i = 0; i < PFS_PAGE_COUNT; i++) {
802 if (
page !=
nullptr) {
804 pfs_last =
page->get_last();
806 while (
pfs < pfs_last) {
820 for (i = 0; i < PFS_PAGE_COUNT; i++) {
822 if (
page !=
nullptr) {
824 pfs_last =
page->get_last();
826 while (
pfs < pfs_last) {
827 if (
pfs->m_lock.is_populated()) {
842 for (i = 0; i < PFS_PAGE_COUNT; i++) {
846 pfs_last =
page->get_last();
848 while (
pfs < pfs_last) {
857 assert(index <
m_max);
859 uint index_1 = index / PFS_PAGE_SIZE;
861 if (
page !=
nullptr) {
862 uint index_2 = index % PFS_PAGE_SIZE;
864 if (index_2 >=
page->m_max) {
870 if (
pfs->m_lock.is_populated()) {
879 if (index >=
m_max) {
884 uint index_1 = index / PFS_PAGE_SIZE;
887 if (
page ==
nullptr) {
892 uint index_2 = index % PFS_PAGE_SIZE;
894 if (index_2 >=
page->m_max) {
902 if (
pfs->m_lock.is_populated()) {
916 for (i = 0; i < PFS_PAGE_COUNT; i++) {
918 if (
page !=
nullptr) {
920 pfs_last =
page->get_last();
922 if ((
pfs <= unsafe) && (unsafe < pfs_last)) {
939 return PFS_PAGE_SIZE;
946 assert(index <=
m_max);
948 uint index_1 = index / PFS_PAGE_SIZE;
949 uint index_2 = index % PFS_PAGE_SIZE;
955 while (index_1 < PFS_PAGE_COUNT) {
958 if (
page ==
nullptr) {
959 index =
static_cast<uint
>(
m_max);
963 pfs_first =
page->get_first();
964 pfs = pfs_first + index_2;
965 pfs_last =
page->get_last();
967 while (
pfs < pfs_last) {
968 if (
pfs->m_lock.is_populated()) {
970 index_1 * PFS_PAGE_SIZE +
static_cast<uint
>(
pfs - pfs_first);
971 *found_index = found;
982 index =
static_cast<uint
>(
m_max);
1058 std::atomic<array_type *>
m_pages[PFS_PAGE_COUNT];
1072template <
class T,
class U,
class V>
1097template <
class T,
int page_size,
int page_count,
class U,
class V>
1130template <
class B,
int PFS_PARTITION_COUNT>
1145 for (
int i = 0; i < PFS_PARTITION_COUNT; i++) {
1151 for (
int i = 0; i < PFS_PARTITION_COUNT; i++) {
1159 for (
int i = 0; i < PFS_PARTITION_COUNT; i++) {
1166 for (
int i = 0; i < PFS_PARTITION_COUNT; i++) {
1174 for (
int i = 0; i < PFS_PARTITION_COUNT; i++) {
1186 for (
int i = 0; i < PFS_PARTITION_COUNT; i++) {
1196 for (
int i = 0; i < PFS_PARTITION_COUNT; i++) {
1204 assert(partition < PFS_PARTITION_COUNT);
1218 B::static_deallocate(safe_pfs);
1224 uint partition_index;
1226 unpack_index(user_index, &partition_index, &sub_index);
1231 for (
int i = 0; i < PFS_PARTITION_COUNT; i++) {
1237 for (
int i = 0; i < PFS_PARTITION_COUNT; i++) {
1243 for (
int i = 0; i < PFS_PARTITION_COUNT; i++) {
1249 for (
int i = 0; i < PFS_PARTITION_COUNT; i++) {
1255 uint partition_index;
1257 unpack_index(user_index, &partition_index, &sub_index);
1259 if (partition_index >= PFS_PARTITION_COUNT) {
1267 uint partition_index;
1269 unpack_index(user_index, &partition_index, &sub_index);
1271 if (partition_index >= PFS_PARTITION_COUNT) {
1283 for (
int i = 0; i < PFS_PARTITION_COUNT; i++) {
1285 if (safe !=
nullptr) {
1296 static_assert(PFS_PARTITION_COUNT <= (1 << 8),
"2^8 = 256 partitions max.");
1298 "2^24 = 16777216 max per partitioned buffer.");
1300 *user_index = (partition_index << 24) + sub_index;
1305 *partition_index = user_index >> 24;
1306 *sub_index = user_index & 0x00FFFFFF;
1310 uint *found_partition, uint *found_sub_index) {
1312 assert(partition_index < PFS_PARTITION_COUNT);
1314 while (partition_index < PFS_PARTITION_COUNT) {
1317 record = sub_iterator.scan_next(found_sub_index);
1319 *found_partition = partition_index;
1320 sub_index = *found_sub_index + 1;
1328 *found_partition = PFS_PARTITION_COUNT;
1329 *found_sub_index = 0;
1337template <
class B,
int PFS_PARTITION_COUNT>
1341 PFS_PARTITION_COUNT>;
1348 uint unused_partition;
1349 uint unused_sub_index;
1355 uint found_partition;
1356 uint found_sub_index;
1367 uint partition, uint sub_index)
Definition: pfs_buffer_container.h:1519
void free_array(PFS_account_array *array)
Definition: pfs_buffer_container.cc:235
int alloc_array(PFS_account_array *array)
Definition: pfs_buffer_container.cc:102
Definition: pfs_buffer_container.h:1509
PFS_stage_stat * m_instr_class_stages_array
Definition: pfs_buffer_container.h:1512
PFS_memory_shared_stat * m_instr_class_memory_array
Definition: pfs_buffer_container.h:1516
PFS_error_stat * m_instr_class_errors_array
Definition: pfs_buffer_container.h:1515
PFS_single_stat * m_instr_class_waits_array
Definition: pfs_buffer_container.h:1511
PFS_transaction_stat * m_instr_class_transactions_array
Definition: pfs_buffer_container.h:1514
PFS_statement_stat * m_instr_class_statements_array
Definition: pfs_buffer_container.h:1513
Definition: pfs_buffer_container.h:57
Definition: pfs_buffer_container.h:231
PFS_buffer_processor< T > processor_type
Definition: pfs_buffer_container.h:240
void apply(function_type fct)
Definition: pfs_buffer_container.h:295
void cleanup()
Definition: pfs_buffer_container.h:267
size_t get_memory() const
Definition: pfs_buffer_container.h:273
size_t get_row_count() const
Definition: pfs_buffer_container.h:269
size_t m_max
Definition: pfs_buffer_container.h:399
value_type * get(uint index)
Definition: pfs_buffer_container.h:339
size_t get_row_size() const
Definition: pfs_buffer_container.h:271
U array_type
Definition: pfs_buffer_container.h:236
int init(size_t max_size)
Definition: pfs_buffer_container.h:253
void apply(processor_type &proc)
Definition: pfs_buffer_container.h:317
value_type * get(uint index, bool *has_more)
Definition: pfs_buffer_container.h:350
PFS_buffer_const_iterator< T > const_iterator_type
Definition: pfs_buffer_container.h:238
void apply_all(function_type fct)
Definition: pfs_buffer_container.h:307
void(* function_type)(value_type *)
Definition: pfs_buffer_container.h:241
iterator_type iterate()
Definition: pfs_buffer_container.h:288
ulong m_lost
Definition: pfs_buffer_container.h:375
value_type * allocate(pfs_dirty_state *dirty_state)
Definition: pfs_buffer_container.h:275
void apply_all(processor_type &proc)
Definition: pfs_buffer_container.h:329
value_type * sanitize(value_type *unsafe)
Definition: pfs_buffer_container.h:360
V allocator_type
Definition: pfs_buffer_container.h:237
PFS_buffer_container(allocator_type *allocator)
Definition: pfs_buffer_container.h:243
PFS_buffer_iterator< T, U, V > iterator_type
Definition: pfs_buffer_container.h:239
void deallocate(value_type *pfs)
Definition: pfs_buffer_container.h:286
iterator_type iterate(uint index)
Definition: pfs_buffer_container.h:290
friend class PFS_buffer_iterator< T, U, V >
Definition: pfs_buffer_container.h:233
value_type * scan_next(uint &index, uint *found_index)
Definition: pfs_buffer_container.h:378
allocator_type * m_allocator
Definition: pfs_buffer_container.h:401
array_type m_array
Definition: pfs_buffer_container.h:400
T value_type
Definition: pfs_buffer_container.h:235
Definition: pfs_buffer_container.h:195
PFS_buffer_default_array< T > array_type
Definition: pfs_buffer_container.h:197
PFS_buffer_default_allocator(PFS_builtin_memory_class *klass)
Definition: pfs_buffer_container.h:199
int alloc_array(array_type *array)
Definition: pfs_buffer_container.h:202
void free_array(array_type *array)
Definition: pfs_buffer_container.h:218
PFS_builtin_memory_class * m_builtin_class
Definition: pfs_buffer_container.h:226
Definition: pfs_buffer_container.h:87
std::atomic< bool > m_full
Page full flag.
Definition: pfs_buffer_container.h:155
T * get_last()
Definition: pfs_buffer_container.h:144
std::atomic< T * > m_ptr
Array of values.
Definition: pfs_buffer_container.h:173
PFS_cacheline_atomic_size_t m_monotonic
Monotonic counter.
Definition: pfs_buffer_container.h:164
std::atomic< PFS_opaque_container * > m_container
Container.
Definition: pfs_buffer_container.h:191
std::atomic< size_t > m_max
Max number of items in the page.
Definition: pfs_buffer_container.h:182
value_type * allocate(pfs_dirty_state *dirty_state)
Definition: pfs_buffer_container.h:91
T value_type
Definition: pfs_buffer_container.h:89
T * get_first()
Definition: pfs_buffer_container.h:142
void deallocate(value_type *pfs)
Definition: pfs_buffer_container.h:134
Definition: pfs_buffer_container.h:1073
T value_type
Definition: pfs_buffer_container.h:1076
PFS_buffer_container< T, U, V > container_type
Definition: pfs_buffer_container.h:1077
container_type * m_container
Definition: pfs_buffer_container.h:1093
value_type * scan_next()
Definition: pfs_buffer_container.h:1080
value_type * scan_next(uint *found_index)
Definition: pfs_buffer_container.h:1085
PFS_buffer_iterator(container_type *container, uint index)
Definition: pfs_buffer_container.h:1090
uint m_index
Definition: pfs_buffer_container.h:1094
Definition: pfs_buffer_container.h:1124
virtual void operator()(T *element)=0
virtual ~PFS_buffer_processor()=default
Definition: pfs_buffer_container.h:407
void(* function_type)(value_type *)
Definition: pfs_buffer_container.h:433
static const size_t MAX_SIZE
Definition: pfs_buffer_container.h:435
int init(long max_size)
Definition: pfs_buffer_container.h:442
size_t get_row_size() const
Definition: pfs_buffer_container.h:526
std::atomic< size_t > m_last_page_size
Size of the last page.
Definition: pfs_buffer_container.h:1049
friend class PFS_buffer_scalable_iterator< T, PFS_PAGE_SIZE, PFS_PAGE_COUNT, U, V >
Definition: pfs_buffer_container.h:410
void apply(processor_type &proc)
Definition: pfs_buffer_container.h:814
void apply_all(function_type fct)
Definition: pfs_buffer_container.h:794
void apply_all(processor_type &proc)
Definition: pfs_buffer_container.h:836
void dirty_to_free(pfs_dirty_state *dirty_state, value_type *safe_pfs)
Definition: pfs_buffer_container.h:699
PFS_buffer_scalable_container< T, PFS_PAGE_SIZE, PFS_PAGE_COUNT, U, V > container_type
This container type.
Definition: pfs_buffer_container.h:428
value_type * sanitize(value_type *unsafe)
Definition: pfs_buffer_container.h:909
PFS_buffer_scalable_iterator< T, PFS_PAGE_SIZE, PFS_PAGE_COUNT, U, V > iterator_type
Definition: pfs_buffer_container.h:431
value_type * allocate(pfs_dirty_state *dirty_state)
Definition: pfs_buffer_container.h:530
native_mutex_t m_critical_section
Definition: pfs_buffer_container.h:1069
std::atomic< size_t > m_max
Max number of items in the buffer.
Definition: pfs_buffer_container.h:1013
PFS_cacheline_atomic_size_t m_max_page_index
Current page index.
Definition: pfs_buffer_container.h:1031
size_t get_memory()
Definition: pfs_buffer_container.h:528
iterator_type iterate()
Definition: pfs_buffer_container.h:761
uint get_page_logical_size(uint page_index)
Definition: pfs_buffer_container.h:937
void apply(function_type fct)
Definition: pfs_buffer_container.h:772
iterator_type iterate(uint index)
Definition: pfs_buffer_container.h:766
V allocator_type
Definition: pfs_buffer_container.h:425
U array_type
Type of pages in the buffer.
Definition: pfs_buffer_container.h:424
PFS_buffer_processor< T > processor_type
Definition: pfs_buffer_container.h:432
value_type * get(uint index, bool *has_more)
Definition: pfs_buffer_container.h:878
PFS_cacheline_atomic_size_t m_monotonic
Monotonic page counter.
Definition: pfs_buffer_container.h:1022
std::atomic< size_t > m_max_page_count
Max number of pages.
Definition: pfs_buffer_container.h:1040
void cleanup()
Definition: pfs_buffer_container.h:488
size_t get_row_count()
Definition: pfs_buffer_container.h:515
std::atomic< bool > m_initialized
Initialized full flag.
Definition: pfs_buffer_container.h:993
PFS_buffer_const_iterator< T > const_iterator_type
Definition: pfs_buffer_container.h:429
value_type * get(uint index)
Definition: pfs_buffer_container.h:856
static void static_deallocate(value_type *safe_pfs)
Definition: pfs_buffer_container.h:737
std::atomic< bool > m_full
Buffer full flag.
Definition: pfs_buffer_container.h:1004
T value_type
Type of elements in the buffer.
Definition: pfs_buffer_container.h:418
PFS_buffer_scalable_container(allocator_type *allocator)
Definition: pfs_buffer_container.h:437
value_type * scan_next(uint &index, uint *found_index)
Definition: pfs_buffer_container.h:945
std::atomic< allocator_type * > m_allocator
Buffer allocator.
Definition: pfs_buffer_container.h:1067
void deallocate(value_type *safe_pfs)
Definition: pfs_buffer_container.h:718
ulong m_lost
Definition: pfs_buffer_container.h:934
std::atomic< array_type * > m_pages[PFS_PAGE_COUNT]
Array of pages.
Definition: pfs_buffer_container.h:1058
Definition: pfs_buffer_container.h:1098
T value_type
Definition: pfs_buffer_container.h:1101
uint m_index
Definition: pfs_buffer_container.h:1120
value_type * scan_next(uint *found_index)
Definition: pfs_buffer_container.h:1111
value_type * scan_next()
Definition: pfs_buffer_container.h:1106
PFS_buffer_scalable_container< T, page_size, page_count, U, V > container_type
Definition: pfs_buffer_container.h:1103
PFS_buffer_scalable_iterator(container_type *container, uint index)
Definition: pfs_buffer_container.h:1116
container_type * m_container
Definition: pfs_buffer_container.h:1119
Definition: pfs_buffer_container.h:1547
int alloc_array(PFS_host_array *array)
Definition: pfs_buffer_container.cc:285
void free_array(PFS_host_array *array)
Definition: pfs_buffer_container.cc:418
Definition: pfs_buffer_container.h:1537
PFS_transaction_stat * m_instr_class_transactions_array
Definition: pfs_buffer_container.h:1542
PFS_memory_shared_stat * m_instr_class_memory_array
Definition: pfs_buffer_container.h:1544
PFS_error_stat * m_instr_class_errors_array
Definition: pfs_buffer_container.h:1543
PFS_single_stat * m_instr_class_waits_array
Definition: pfs_buffer_container.h:1539
PFS_stage_stat * m_instr_class_stages_array
Definition: pfs_buffer_container.h:1540
PFS_statement_stat * m_instr_class_statements_array
Definition: pfs_buffer_container.h:1541
Definition: pfs_buffer_container.h:1131
B::function_type function_type
Definition: pfs_buffer_container.h:1141
value_type * get(uint user_index, bool *has_more)
Definition: pfs_buffer_container.h:1266
B::allocator_type allocator_type
Definition: pfs_buffer_container.h:1136
void apply(processor_type &proc)
Definition: pfs_buffer_container.h:1242
void apply(function_type fct)
Definition: pfs_buffer_container.h:1230
B * m_partitions[PFS_PARTITION_COUNT]
Definition: pfs_buffer_container.h:1334
value_type * scan_next(uint &partition_index, uint &sub_index, uint *found_partition, uint *found_sub_index)
Definition: pfs_buffer_container.h:1309
iterator_type iterate()
Definition: pfs_buffer_container.h:1221
PFS_partitioned_buffer_scalable_iterator< B, PFS_PARTITION_COUNT > iterator_type
Definition: pfs_buffer_container.h:1138
size_t get_row_count() const
Definition: pfs_buffer_container.h:1171
void apply_all(function_type fct)
Definition: pfs_buffer_container.h:1236
value_type * sanitize(value_type *unsafe)
Definition: pfs_buffer_container.h:1280
B::value_type value_type
Definition: pfs_buffer_container.h:1135
static void unpack_index(uint user_index, uint *partition_index, uint *sub_index)
Definition: pfs_buffer_container.h:1303
PFS_partitioned_buffer_scalable_container(allocator_type *allocator)
Definition: pfs_buffer_container.h:1143
void deallocate(value_type *safe_pfs)
Definition: pfs_buffer_container.h:1209
int init(long max_size)
Definition: pfs_buffer_container.h:1156
~PFS_partitioned_buffer_scalable_container()
Definition: pfs_buffer_container.h:1150
B::iterator_type sub_iterator_type
Definition: pfs_buffer_container.h:1139
size_t get_memory() const
Definition: pfs_buffer_container.h:1183
iterator_type iterate(uint user_index)
Definition: pfs_buffer_container.h:1223
size_t get_row_size() const
Definition: pfs_buffer_container.h:1181
B::processor_type processor_type
Definition: pfs_buffer_container.h:1140
void apply_all(processor_type &proc)
Definition: pfs_buffer_container.h:1248
value_type * get(uint user_index)
Definition: pfs_buffer_container.h:1254
value_type * allocate(pfs_dirty_state *dirty_state, uint partition)
Definition: pfs_buffer_container.h:1203
void cleanup()
Definition: pfs_buffer_container.h:1165
long get_lost_counter()
Definition: pfs_buffer_container.h:1193
static void pack_index(uint partition_index, uint sub_index, uint *user_index)
Definition: pfs_buffer_container.h:1294
Definition: pfs_buffer_container.h:1338
uint m_sub_index
Definition: pfs_buffer_container.h:1374
PFS_partitioned_buffer_scalable_container< B, PFS_PARTITION_COUNT > container_type
Definition: pfs_buffer_container.h:1345
container_type * m_container
Definition: pfs_buffer_container.h:1372
B::value_type value_type
Definition: pfs_buffer_container.h:1343
value_type * scan_next(uint *found_user_index)
Definition: pfs_buffer_container.h:1354
value_type * scan_next()
Definition: pfs_buffer_container.h:1347
PFS_partitioned_buffer_scalable_iterator(container_type *container, uint partition, uint sub_index)
Definition: pfs_buffer_container.h:1366
uint m_partition
Definition: pfs_buffer_container.h:1373
Definition: pfs_buffer_container.h:1586
void free_array(PFS_thread_array *array)
Definition: pfs_buffer_container.cc:766
int alloc_array(PFS_thread_array *array)
Definition: pfs_buffer_container.cc:467
Definition: pfs_buffer_container.h:1564
PFS_statement_stat * m_instr_class_statements_array
Definition: pfs_buffer_container.h:1568
PFS_single_stat * m_instr_class_waits_array
Definition: pfs_buffer_container.h:1566
PFS_error_stat * m_instr_class_errors_array
Definition: pfs_buffer_container.h:1570
PFS_events_statements * m_statements_stack_array
Definition: pfs_buffer_container.h:1576
PFS_events_statements * m_statements_history_array
Definition: pfs_buffer_container.h:1575
PFS_stage_stat * m_instr_class_stages_array
Definition: pfs_buffer_container.h:1567
unsigned char * m_current_stmts_digest_token_array
Definition: pfs_buffer_container.h:1582
PFS_events_stages * m_stages_history_array
Definition: pfs_buffer_container.h:1574
char * m_current_stmts_text_array
Definition: pfs_buffer_container.h:1580
PFS_memory_safe_stat * m_instr_class_memory_array
Definition: pfs_buffer_container.h:1571
unsigned char * m_history_stmts_digest_token_array
Definition: pfs_buffer_container.h:1583
PFS_transaction_stat * m_instr_class_transactions_array
Definition: pfs_buffer_container.h:1569
char * m_session_connect_attrs_array
Definition: pfs_buffer_container.h:1578
PFS_events_waits * m_waits_history_array
Definition: pfs_buffer_container.h:1573
PFS_events_transactions * m_transactions_history_array
Definition: pfs_buffer_container.h:1577
char * m_history_stmts_text_array
Definition: pfs_buffer_container.h:1581
Definition: pfs_buffer_container.h:1613
void free_array(PFS_user_array *array)
Definition: pfs_buffer_container.cc:1013
int alloc_array(PFS_user_array *array)
Definition: pfs_buffer_container.cc:880
Definition: pfs_buffer_container.h:1603
PFS_statement_stat * m_instr_class_statements_array
Definition: pfs_buffer_container.h:1607
PFS_transaction_stat * m_instr_class_transactions_array
Definition: pfs_buffer_container.h:1608
PFS_stage_stat * m_instr_class_stages_array
Definition: pfs_buffer_container.h:1606
PFS_single_stat * m_instr_class_waits_array
Definition: pfs_buffer_container.h:1605
PFS_error_stat * m_instr_class_errors_array
Definition: pfs_buffer_container.h:1609
PFS_memory_shared_stat * m_instr_class_memory_array
Definition: pfs_buffer_container.h:1610
int page
Definition: ctype-mb.cc:1234
#define MY_ZEROFILL
Definition: my_sys.h:141
constexpr bool unlikely(bool expr)
Definition: my_compiler.h:58
Some integer typedefs for easier portability.
intptr_t intptr
Definition: my_inttypes.h:70
#define MYF(v)
Definition: my_inttypes.h:97
static int record
Definition: mysqltest.cc:195
uint16_t value_type
Definition: vt100.h:184
Definition: atomics_array.h:39
const ulint MAX_SIZE
The maximum size possible for an LOB.
Definition: lob0lob.h:84
Performance schema account (declarations).
PFS_file_container global_file_container
PFS_buffer_scalable_container< PFS_mutex, 1024, 1024 > PFS_mutex_basic_container
Definition: pfs_buffer_container.h:1379
PFS_host_container global_host_container
PFS_buffer_scalable_container< PFS_socket, 256, 256 > PFS_socket_container
Definition: pfs_buffer_container.h:1417
PFS_thread_container global_thread_container
PFS_table_share_index_container global_table_share_index_container
PFS_cond_container::iterator_type PFS_cond_iterator
Definition: pfs_buffer_container.h:1403
PFS_buffer_scalable_container< PFS_table, 1024, 1024 > PFS_table_container
Definition: pfs_buffer_container.h:1453
PFS_file_container::iterator_type PFS_file_iterator
Definition: pfs_buffer_container.h:1412
PFS_user_container::iterator_type PFS_user_iterator
Definition: pfs_buffer_container.h:1627
PFS_mutex_container::iterator_type PFS_mutex_iterator
Definition: pfs_buffer_container.h:1386
PFS_prepared_stmt_container::iterator_type PFS_prepared_stmt_iterator
Definition: pfs_buffer_container.h:1506
PFS_buffer_scalable_container< PFS_table_share, 4 *1024, 4 *1024 > PFS_table_share_container
Definition: pfs_buffer_container.h:1462
PFS_setup_object_container::iterator_type PFS_setup_object_iterator
Definition: pfs_buffer_container.h:1448
PFS_cond_container global_cond_container
PFS_buffer_scalable_container< PFS_prepared_stmt, 1024, 1024 > PFS_prepared_stmt_container
Definition: pfs_buffer_container.h:1502
PFS_buffer_scalable_container< PFS_table_share_lock, 4 *1024, 4 *1024 > PFS_table_share_lock_container
Definition: pfs_buffer_container.h:1482
PFS_socket_container::iterator_type PFS_socket_iterator
Definition: pfs_buffer_container.h:1421
PFS_table_share_container global_table_share_container
PFS_rwlock_container::iterator_type PFS_rwlock_iterator
Definition: pfs_buffer_container.h:1395
PFS_program_container global_program_container
PFS_buffer_scalable_container< PFS_thread, 256, 256, PFS_thread_array, PFS_thread_allocator > PFS_thread_container
Definition: pfs_buffer_container.h:1595
PFS_host_container::iterator_type PFS_host_iterator
Definition: pfs_buffer_container.h:1561
PFS_socket_container global_socket_container
PFS_partitioned_buffer_scalable_container< PFS_mutex_basic_container, PFS_MUTEX_PARTITIONS > PFS_mutex_container
Definition: pfs_buffer_container.h:1382
PFS_table_share_lock_container::iterator_type PFS_table_share_lock_iterator
Definition: pfs_buffer_container.h:1488
PFS_buffer_scalable_container< PFS_program, 1024, 1024 > PFS_program_container
Definition: pfs_buffer_container.h:1493
PFS_account_container::iterator_type PFS_account_iterator
Definition: pfs_buffer_container.h:1534
PFS_buffer_scalable_container< PFS_file, 4 *1024, 4 *1024 > PFS_file_container
Definition: pfs_buffer_container.h:1408
PFS_setup_object_container global_setup_object_container
PFS_table_share_index_container::iterator_type PFS_table_share_index_iterator
Definition: pfs_buffer_container.h:1477
PFS_mdl_container global_mdl_container
PFS_buffer_scalable_container< PFS_setup_actor, 128, 1024 > PFS_setup_actor_container
Definition: pfs_buffer_container.h:1435
PFS_rwlock_container global_rwlock_container
PFS_thread_container::iterator_type PFS_thread_iterator
Definition: pfs_buffer_container.h:1600
PFS_mdl_container::iterator_type PFS_mdl_iterator
Definition: pfs_buffer_container.h:1430
PFS_table_share_lock_container global_table_share_lock_container
PFS_table_container global_table_container
PFS_table_container::iterator_type PFS_table_iterator
Definition: pfs_buffer_container.h:1457
PFS_buffer_scalable_container< PFS_host, 128, 128, PFS_host_array, PFS_host_allocator > PFS_host_container
Definition: pfs_buffer_container.h:1556
PFS_account_container global_account_container
PFS_buffer_scalable_container< PFS_cond, 256, 256 > PFS_cond_container
Definition: pfs_buffer_container.h:1399
PFS_setup_actor_container::iterator_type PFS_setup_actor_iterator
Definition: pfs_buffer_container.h:1439
PFS_program_container::iterator_type PFS_program_iterator
Definition: pfs_buffer_container.h:1497
PFS_prepared_stmt_container global_prepared_stmt_container
PFS_buffer_scalable_container< PFS_user, 128, 128, PFS_user_array, PFS_user_allocator > PFS_user_container
Definition: pfs_buffer_container.h:1622
PFS_buffer_scalable_container< PFS_table_share_index, 8 *1024, 8 *1024 > PFS_table_share_index_container
Definition: pfs_buffer_container.h:1471
PFS_buffer_scalable_container< PFS_setup_object, 128, 1024 > PFS_setup_object_container
Definition: pfs_buffer_container.h:1444
PFS_table_share_container::iterator_type PFS_table_share_iterator
Definition: pfs_buffer_container.h:1466
PFS_setup_actor_container global_setup_actor_container
PFS_mutex_container global_mutex_container
PFS_buffer_scalable_container< PFS_metadata_lock, 1024, 1024 > PFS_mdl_container
Definition: pfs_buffer_container.h:1426
PFS_buffer_scalable_container< PFS_rwlock, 1024, 1024 > PFS_rwlock_container
Definition: pfs_buffer_container.h:1391
PFS_user_container global_user_container
PFS_buffer_scalable_container< PFS_account, 128, 128, PFS_account_array, PFS_account_allocator > PFS_account_container
Definition: pfs_buffer_container.h:1528
PFS_builtin_memory_class builtin_memory_scalable_buffer
Definition: pfs_builtin_memory.cc:128
Performance schema instruments metadata (declarations).
#define PFS_MALLOC_ARRAY(k, n, s, T, f)
Helper, to allocate an array of structures.
Definition: pfs_global.h:135
#define PFS_FREE_ARRAY(k, n, s, p)
Helper, to free an array of structures.
Definition: pfs_global.h:152
Performance schema host (declarations).
Performance schema instruments (declarations).
Performance schema internal locks (declarations).
Stored Program data structures (declarations).
Stored Program data structures (declarations).
Performance schema setup actors (declarations).
Performance schema setup object (declarations).
Performance schema user (declarations).
struct result result
Definition: result.h:34
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:66
Per account statistics.
Definition: pfs_account.h:67
Definition: pfs_builtin_memory.h:39
void count_alloc(size_t size)
Definition: pfs_builtin_memory.h:43
void count_free(size_t size)
Definition: pfs_builtin_memory.h:45
An atomic size_t variable, guaranteed to be alone in a CPU cache line.
Definition: pfs_global.h:99
std::atomic< size_t > m_size_t
Definition: pfs_global.h:100
Statistics for all server errors.
Definition: pfs_stat.h:557
A stage record.
Definition: pfs_events_stages.h:45
A statement record.
Definition: pfs_events_statements.h:47
A transaction record.
Definition: pfs_events_transactions.h:86
A wait event record.
Definition: pfs_events_waits.h:69
Per host statistics.
Definition: pfs_host.h:64
Memory statistics.
Definition: pfs_stat.h:913
Definition: pfs_stat.h:937
Single statistic.
Definition: pfs_stat.h:52
Statistics for stage usage.
Definition: pfs_stat.h:323
Statistics for statement usage.
Definition: pfs_stat.h:376
Instrumented thread implementation.
Definition: pfs_instr.h:375
Statistics for transaction usage.
Definition: pfs_stat.h:459
Per user statistics.
Definition: pfs_user.h:63
Definition: pfs_lock.h:77
static int native_mutex_unlock(native_mutex_t *mutex)
Definition: thr_mutex.h:115
static int native_mutex_destroy(native_mutex_t *mutex)
Definition: thr_mutex.h:124
static int native_mutex_lock(native_mutex_t *mutex)
Definition: thr_mutex.h:90
static int native_mutex_init(native_mutex_t *mutex, const native_mutexattr_t *attr)
Definition: thr_mutex.h:79
pthread_mutex_t native_mutex_t
Definition: thr_mutex_bits.h:55
#define NULL
Definition: types.h:55