Coverage Report

Created: 2024-06-18 07:03

/src/server/include/mysql/psi/mysql_memory.h
Line
Count
Source (jump to first uncovered line)
1
/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
2
3
  This program is free software; you can redistribute it and/or modify
4
  it under the terms of the GNU General Public License, version 2.0,
5
  as published by the Free Software Foundation.
6
7
  This program is also distributed with certain software (including
8
  but not limited to OpenSSL) that is licensed under separate terms,
9
  as designated in a particular file or component or in included license
10
  documentation.  The authors of MySQL hereby grant you an additional
11
  permission to link the program and your derivative works with the
12
  separately licensed software that they have included with MySQL.
13
14
  This program is distributed in the hope that it will be useful,
15
  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
  GNU General Public License, version 2.0, for more details.
18
19
  You should have received a copy of the GNU General Public License
20
  along with this program; if not, write to the Free Software Foundation,
21
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
22
23
#ifndef MYSQL_MEMORY_H
24
#define MYSQL_MEMORY_H
25
26
/**
27
  @file mysql/psi/mysql_memory.h
28
  Instrumentation helpers for memory allocation.
29
*/
30
31
#include "mysql/psi/psi.h"
32
33
#ifdef HAVE_PSI_MEMORY_INTERFACE
34
0
#define PSI_CALL_memory_alloc(A1,A2,A3) PSI_MEMORY_CALL(memory_alloc)(A1,A2,A3)
35
0
#define PSI_CALL_memory_free(A1,A2,A3) PSI_MEMORY_CALL(memory_free)(A1,A2,A3)
36
0
#define PSI_CALL_memory_realloc(A1,A2,A3,A4) PSI_MEMORY_CALL(memory_realloc)(A1,A2,A3,A4)
37
#define PSI_CALL_register_memory(A1,A2,A3) PSI_MEMORY_CALL(register_memory)(A1,A2,A3)
38
#else
39
#define PSI_CALL_memory_alloc(A1,A2,A3) 0
40
#define PSI_CALL_memory_free(A1,A2,A3) do { } while(0)
41
#define PSI_CALL_memory_realloc(A1,A2,A3,A4) 0
42
#define PSI_CALL_register_memory(A1,A2,A3) do { } while(0)
43
#endif
44
45
#ifndef PSI_MEMORY_CALL
46
0
#define PSI_MEMORY_CALL(M) PSI_DYNAMIC_CALL(M)
47
#endif
48
49
/**
50
  @defgroup Memory_instrumentation Memory Instrumentation
51
  @ingroup Instrumentation_interface
52
  @{
53
*/
54
55
/**
56
  @def mysql_memory_register(P1, P2, P3)
57
  Memory registration.
58
*/
59
#define mysql_memory_register(P1, P2, P3) \
60
  inline_mysql_memory_register(P1, P2, P3)
61
62
static inline void inline_mysql_memory_register(
63
#ifdef HAVE_PSI_MEMORY_INTERFACE
64
  const char *category,
65
  PSI_memory_info *info,
66
  int count)
67
#else
68
  const char *category __attribute__((unused)),
69
  void *info __attribute__((unused)),
70
  int count __attribute__((unused)))
71
#endif
72
0
{
73
0
  PSI_CALL_register_memory(category, info, count);
74
0
}
Unexecuted instantiation: fuzz_json.c:inline_mysql_memory_register
Unexecuted instantiation: json_lib.c:inline_mysql_memory_register
Unexecuted instantiation: ctype-ucs2.c:inline_mysql_memory_register
Unexecuted instantiation: dtoa.c:inline_mysql_memory_register
Unexecuted instantiation: xml.c:inline_mysql_memory_register
Unexecuted instantiation: ctype-simple.c:inline_mysql_memory_register
Unexecuted instantiation: my_strtoll10.c:inline_mysql_memory_register
Unexecuted instantiation: my_vsnprintf.c:inline_mysql_memory_register
Unexecuted instantiation: my_malloc.c:inline_mysql_memory_register
Unexecuted instantiation: my_static.c:inline_mysql_memory_register
Unexecuted instantiation: my_thr_init.c:inline_mysql_memory_register
Unexecuted instantiation: thr_mutex.c:inline_mysql_memory_register
Unexecuted instantiation: thr_rwlock.c:inline_mysql_memory_register
Unexecuted instantiation: psi_noop.c:inline_mysql_memory_register
Unexecuted instantiation: my_error.c:inline_mysql_memory_register
Unexecuted instantiation: my_getsystime.c:inline_mysql_memory_register
Unexecuted instantiation: my_init.c:inline_mysql_memory_register
Unexecuted instantiation: my_mess.c:inline_mysql_memory_register
Unexecuted instantiation: my_once.c:inline_mysql_memory_register
Unexecuted instantiation: my_symlink.c:inline_mysql_memory_register
Unexecuted instantiation: my_sync.c:inline_mysql_memory_register
Unexecuted instantiation: charset.c:inline_mysql_memory_register
Unexecuted instantiation: errors.c:inline_mysql_memory_register
Unexecuted instantiation: hash.c:inline_mysql_memory_register
Unexecuted instantiation: mf_dirname.c:inline_mysql_memory_register
Unexecuted instantiation: mf_loadpath.c:inline_mysql_memory_register
Unexecuted instantiation: mf_pack.c:inline_mysql_memory_register
Unexecuted instantiation: my_div.c:inline_mysql_memory_register
Unexecuted instantiation: my_getwd.c:inline_mysql_memory_register
Unexecuted instantiation: my_lib.c:inline_mysql_memory_register
Unexecuted instantiation: my_open.c:inline_mysql_memory_register
Unexecuted instantiation: my_read.c:inline_mysql_memory_register
Unexecuted instantiation: array.c:inline_mysql_memory_register
Unexecuted instantiation: charset-def.c:inline_mysql_memory_register
Unexecuted instantiation: mf_qsort.c:inline_mysql_memory_register
Unexecuted instantiation: my_alloc.c:inline_mysql_memory_register
Unexecuted instantiation: ctype-tis620.c:inline_mysql_memory_register
Unexecuted instantiation: str2int.c:inline_mysql_memory_register
75
76
/** @} (end of group Memory_instrumentation) */
77
78
#endif
79