1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00
This commit is contained in:
Sergei Golubchik
2016-07-28 15:52:12 +02:00
parent 51ed64a520
commit 15f60c1a73
976 changed files with 148320 additions and 35656 deletions

View File

@@ -43,6 +43,10 @@
#include "mysql/psi/psi.h"
#ifndef PSI_FILE_CALL
#define PSI_FILE_CALL(M) PSI_DYNAMIC_CALL(M)
#endif
/**
@defgroup File_instrumentation File Instrumentation
@ingroup Instrumentation_interface
@@ -290,7 +294,7 @@
*/
#ifdef HAVE_PSI_FILE_INTERFACE
#define mysql_file_create_temp(K, T, D, P, M, F) \
inline_mysql_file_create_temp(K, T, D, P, M, F)
inline_mysql_file_create_temp(K, __FILE__, __LINE__, T, D, P, M, F)
#else
#define mysql_file_create_temp(K, T, D, P, M, F) \
inline_mysql_file_create_temp(T, D, P, M, F)
@@ -803,7 +807,8 @@ inline_mysql_file_fopen(
const char *filename, int flags, myf myFlags)
{
MYSQL_FILE *that;
that= (MYSQL_FILE*) my_malloc(sizeof(MYSQL_FILE), MYF(MY_WME));
that= (MYSQL_FILE*) my_malloc(PSI_NOT_INSTRUMENTED,
sizeof(MYSQL_FILE), MYF(MY_WME));
if (likely(that != NULL))
{
#ifdef HAVE_PSI_FILE_INTERFACE
@@ -1011,20 +1016,27 @@ inline_mysql_file_create(
static inline File
inline_mysql_file_create_temp(
#ifdef HAVE_PSI_FILE_INTERFACE
PSI_file_key key,
PSI_file_key key, const char *src_file, uint src_line,
#endif
char *to, const char *dir, const char *pfx, int mode, myf myFlags)
{
File file;
/*
TODO: This event is instrumented, but not timed.
The problem is that the file name is now known
before the create_temp_file call.
*/
file= create_temp_file(to, dir, pfx, mode, myFlags);
#ifdef HAVE_PSI_FILE_INTERFACE
PSI_FILE_CALL(create_file)(key, to, file);
struct PSI_file_locker *locker;
PSI_file_locker_state state;
locker= PSI_FILE_CALL(get_thread_file_name_locker)
(&state, key, PSI_FILE_CREATE, NULL, &locker);
if (likely(locker != NULL))
{
PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line);
/* The file name is generated by create_temp_file(). */
file= create_temp_file(to, dir, pfx, mode, myFlags);
PSI_FILE_CALL(end_temp_file_open_wait_and_bind_to_descriptor)(locker, file, (const char*)to);
return file;
}
#endif
file= create_temp_file(to, dir, pfx, mode, myFlags);
return file;
}