summaryrefslogtreecommitdiffstats
path: root/storage/perfschema/pfs_builtin_memory.h
blob: 956b31c5dcf35d7d4eedcf4ca1c276323ce8800c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/* Copyright (c) 2014, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License, version 2.0, for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef PFS_BUILTIN_MEMORY_H
#define PFS_BUILTIN_MEMORY_H

#include "my_global.h"
#include "pfs_global.h"
#include "pfs_instr_class.h"

/**
  @file storage/perfschema/pfs_builtin_memory.h
  Performance schema instruments meta data (declarations).
*/

typedef uint PFS_builtin_memory_key;

struct PFS_builtin_memory_class
{
  PFS_memory_class m_class;
  PFS_memory_stat m_stat;

  inline void count_alloc(size_t size)
  {
    m_stat.count_builtin_alloc(size);
  }

  inline void count_free(size_t size)
  {
    m_stat.count_builtin_free(size);
  }
};

void init_all_builtin_memory_class();

PFS_builtin_memory_class *find_builtin_memory_class(PFS_builtin_memory_key);

extern PFS_builtin_memory_class builtin_memory_mutex;
extern PFS_builtin_memory_class builtin_memory_rwlock;
extern PFS_builtin_memory_class builtin_memory_cond;
extern PFS_builtin_memory_class builtin_memory_file;
extern PFS_builtin_memory_class builtin_memory_socket;
extern PFS_builtin_memory_class builtin_memory_mdl;
extern PFS_builtin_memory_class builtin_memory_file_handle;

extern PFS_builtin_memory_class builtin_memory_account;
extern PFS_builtin_memory_class builtin_memory_account_waits;
extern PFS_builtin_memory_class builtin_memory_account_stages;
extern PFS_builtin_memory_class builtin_memory_account_statements;
extern PFS_builtin_memory_class builtin_memory_account_transactions;
extern PFS_builtin_memory_class builtin_memory_account_memory;

extern PFS_builtin_memory_class builtin_memory_global_stages;
extern PFS_builtin_memory_class builtin_memory_global_statements;
extern PFS_builtin_memory_class builtin_memory_global_memory;

extern PFS_builtin_memory_class builtin_memory_host;
extern PFS_builtin_memory_class builtin_memory_host_waits;
extern PFS_builtin_memory_class builtin_memory_host_stages;
extern PFS_builtin_memory_class builtin_memory_host_statements;
extern PFS_builtin_memory_class builtin_memory_host_transactions;
extern PFS_builtin_memory_class builtin_memory_host_memory;

extern PFS_builtin_memory_class builtin_memory_thread;
extern PFS_builtin_memory_class builtin_memory_thread_waits;
extern PFS_builtin_memory_class builtin_memory_thread_stages;
extern PFS_builtin_memory_class builtin_memory_thread_statements;
extern PFS_builtin_memory_class builtin_memory_thread_transactions;
extern PFS_builtin_memory_class builtin_memory_thread_memory;

extern PFS_builtin_memory_class builtin_memory_thread_waits_history;
extern PFS_builtin_memory_class builtin_memory_thread_stages_history;
extern PFS_builtin_memory_class builtin_memory_thread_statements_history;
extern PFS_builtin_memory_class builtin_memory_thread_statements_history_tokens;
extern PFS_builtin_memory_class builtin_memory_thread_statements_history_sqltext;
extern PFS_builtin_memory_class builtin_memory_thread_statements_stack;
extern PFS_builtin_memory_class builtin_memory_thread_statements_stack_tokens;
extern PFS_builtin_memory_class builtin_memory_thread_statements_stack_sqltext;
extern PFS_builtin_memory_class builtin_memory_thread_transaction_history;
extern PFS_builtin_memory_class builtin_memory_thread_session_connect_attrs;

extern PFS_builtin_memory_class builtin_memory_user;
extern PFS_builtin_memory_class builtin_memory_user_waits;
extern PFS_builtin_memory_class builtin_memory_user_stages;
extern PFS_builtin_memory_class builtin_memory_user_statements;
extern PFS_builtin_memory_class builtin_memory_user_transactions;
extern PFS_builtin_memory_class builtin_memory_user_memory;

extern PFS_builtin_memory_class builtin_memory_mutex_class;
extern PFS_builtin_memory_class builtin_memory_rwlock_class;
extern PFS_builtin_memory_class builtin_memory_cond_class;
extern PFS_builtin_memory_class builtin_memory_thread_class;
extern PFS_builtin_memory_class builtin_memory_file_class;
extern PFS_builtin_memory_class builtin_memory_socket_class;
extern PFS_builtin_memory_class builtin_memory_stage_class;
extern PFS_builtin_memory_class builtin_memory_statement_class;
extern PFS_builtin_memory_class builtin_memory_memory_class;

extern PFS_builtin_memory_class builtin_memory_setup_actor;
extern PFS_builtin_memory_class builtin_memory_setup_object;

extern PFS_builtin_memory_class builtin_memory_digest;
extern PFS_builtin_memory_class builtin_memory_digest_tokens;

extern PFS_builtin_memory_class builtin_memory_stages_history_long;
extern PFS_builtin_memory_class builtin_memory_statements_history_long;
extern PFS_builtin_memory_class builtin_memory_statements_history_long_tokens;
extern PFS_builtin_memory_class builtin_memory_statements_history_long_sqltext;
extern PFS_builtin_memory_class builtin_memory_transactions_history_long;
extern PFS_builtin_memory_class builtin_memory_waits_history_long;

extern PFS_builtin_memory_class builtin_memory_table;
extern PFS_builtin_memory_class builtin_memory_table_share;
extern PFS_builtin_memory_class builtin_memory_table_share_index;
extern PFS_builtin_memory_class builtin_memory_table_share_lock;

extern PFS_builtin_memory_class builtin_memory_program;
extern PFS_builtin_memory_class builtin_memory_prepared_stmt;

extern PFS_builtin_memory_class builtin_memory_scalable_buffer;

/** @} */
#endif