1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

P_S 5.7.28

This commit is contained in:
Sergei Golubchik
2019-12-10 15:35:00 +01:00
parent dfe6e914e5
commit 0ea717f51a
942 changed files with 174739 additions and 20780 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
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,
@@ -48,6 +48,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
@@ -295,7 +299,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)
@@ -828,7 +832,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
@@ -1052,20 +1057,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;
}
@@ -1355,12 +1367,13 @@ inline_mysql_file_rename(
{
struct PSI_file_locker *locker;
PSI_file_locker_state state;
locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_RENAME, to, &locker);
locker= PSI_FILE_CALL(get_thread_file_name_locker)
(&state, key, PSI_FILE_RENAME, from, &locker);
if (likely(locker != NULL))
{
PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
result= my_rename(from, to, flags);
PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
PSI_FILE_CALL(end_file_rename_wait)(locker, from, to, result);
return result;
}
}
@@ -1449,12 +1462,13 @@ inline_mysql_file_rename_with_symlink(
{
struct PSI_file_locker *locker;
PSI_file_locker_state state;
locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_RENAME, to, &locker);
locker= PSI_FILE_CALL(get_thread_file_name_locker)
(&state, key, PSI_FILE_RENAME, from, &locker);
if (likely(locker != NULL))
{
PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
result= my_rename_with_symlink(from, to, flags);
PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
PSI_FILE_CALL(end_file_rename_wait)(locker, from, to, result);
return result;
}
}