MySQL 8.0.40
Source Code Documentation
mysql_file.h File Reference

Instrumentation helpers for mysys file io. More...

#include <assert.h>
#include <string.h>
#include "my_psi_config.h"
#include "my_dir.h"
#include "my_sys.h"
#include "mysql/psi/psi_file.h"
#include "mysql/service_mysql_alloc.h"
#include "pfs_file_provider.h"

Go to the source code of this file.

Classes

struct  MYSQL_FILE
 An instrumented FILE structure. More...
 

Macros

#define mysql_file_register(P1, P2, P3)   inline_mysql_file_register(P1, P2, P3)
 File registration. More...
 
#define mysql_file_fgets(P1, P2, F)    inline_mysql_file_fgets(__FILE__, __LINE__, P1, P2, F)
 Instrumented fgets. More...
 
#define mysql_file_fgetc(F)   inline_mysql_file_fgetc(__FILE__, __LINE__, F)
 Instrumented fgetc. More...
 
#define mysql_file_fputs(P1, F)    inline_mysql_file_fputs(__FILE__, __LINE__, P1, F)
 Instrumented fputs. More...
 
#define mysql_file_fputc(P1, F)    inline_mysql_file_fputc(__FILE__, __LINE__, P1, F)
 Instrumented fputc. More...
 
#define mysql_file_fprintf   inline_mysql_file_fprintf
 Instrumented fprintf. More...
 
#define mysql_file_vfprintf(F, P1, P2)    inline_mysql_file_vfprintf(__FILE__, __LINE__, F, P1, P2)
 Instrumented vfprintf. More...
 
#define mysql_file_fflush(F)   inline_mysql_file_fflush(__FILE__, __LINE__, F)
 Instrumented fflush. More...
 
#define mysql_file_feof(F)   inline_mysql_file_feof(F)
 Instrumented feof. More...
 
#define mysql_file_fstat(FN, S)    inline_mysql_file_fstat(__FILE__, __LINE__, FN, S)
 Instrumented fstat. More...
 
#define mysql_file_stat(K, FN, S, FL)    inline_mysql_file_stat(K, __FILE__, __LINE__, FN, S, FL)
 Instrumented stat. More...
 
#define mysql_file_chsize(F, P1, P2, P3)    inline_mysql_file_chsize(__FILE__, __LINE__, F, P1, P2, P3)
 Instrumented chsize. More...
 
#define mysql_file_fopen(K, N, F1, F2)    inline_mysql_file_fopen(K, __FILE__, __LINE__, N, F1, F2)
 Instrumented fopen. More...
 
#define mysql_file_fclose(FD, FL)    inline_mysql_file_fclose(__FILE__, __LINE__, FD, FL)
 Instrumented fclose. More...
 
#define mysql_file_fread(FD, P1, P2, P3)    inline_mysql_file_fread(__FILE__, __LINE__, FD, P1, P2, P3)
 Instrumented fread. More...
 
#define mysql_file_fwrite(FD, P1, P2, P3)    inline_mysql_file_fwrite(__FILE__, __LINE__, FD, P1, P2, P3)
 Instrumented fwrite. More...
 
#define mysql_file_fseek(FD, P, W)    inline_mysql_file_fseek(__FILE__, __LINE__, FD, P, W)
 Instrumented fseek. More...
 
#define mysql_file_ftell(FD)   inline_mysql_file_ftell(__FILE__, __LINE__, FD)
 Instrumented ftell. More...
 
#define mysql_file_create(K, N, F1, F2, F3)    inline_mysql_file_create(K, __FILE__, __LINE__, N, F1, F2, F3)
 Instrumented create. More...
 
#define mysql_file_create_temp(K, T, D, P, M, U, F)    inline_mysql_file_create_temp(K, __FILE__, __LINE__, T, D, P, M, U, F)
 Instrumented create_temp_file. More...
 
#define mysql_file_open(K, N, F1, F2)    inline_mysql_file_open(K, __FILE__, __LINE__, N, F1, F2)
 Instrumented open. More...
 
#define mysql_file_close(FD, F)    inline_mysql_file_close(__FILE__, __LINE__, FD, F)
 Instrumented close. More...
 
#define mysql_file_read(FD, B, S, F)    inline_mysql_file_read(__FILE__, __LINE__, FD, B, S, F)
 Instrumented read. More...
 
#define mysql_file_write(FD, B, S, F)    inline_mysql_file_write(__FILE__, __LINE__, FD, B, S, F)
 Instrumented write. More...
 
#define mysql_file_pread(FD, B, S, O, F)    inline_mysql_file_pread(__FILE__, __LINE__, FD, B, S, O, F)
 Instrumented pread. More...
 
#define mysql_file_pwrite(FD, B, S, O, F)    inline_mysql_file_pwrite(__FILE__, __LINE__, FD, B, S, O, F)
 Instrumented pwrite. More...
 
#define mysql_file_seek(FD, P, W, F)    inline_mysql_file_seek(__FILE__, __LINE__, FD, P, W, F)
 Instrumented seek. More...
 
#define mysql_file_tell(FD, F)   inline_mysql_file_tell(__FILE__, __LINE__, FD, F)
 Instrumented tell. More...
 
#define mysql_file_delete(K, P1, P2)    inline_mysql_file_delete(K, __FILE__, __LINE__, P1, P2)
 Instrumented delete. More...
 
#define mysql_file_rename(K, P1, P2, P3)    inline_mysql_file_rename(K, __FILE__, __LINE__, P1, P2, P3)
 Instrumented rename. More...
 
#define mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5)
 Instrumented create with symbolic link. More...
 
#define mysql_file_delete_with_symlink(K, P1, P2)    inline_mysql_file_delete_with_symlink(K, __FILE__, __LINE__, P1, P2)
 Instrumented delete with symbolic link. More...
 
#define mysql_file_rename_with_symlink(K, P1, P2, P3)    inline_mysql_file_rename_with_symlink(K, __FILE__, __LINE__, P1, P2, P3)
 Instrumented rename with symbolic link. More...
 
#define mysql_file_sync(P1, P2)    inline_mysql_file_sync(__FILE__, __LINE__, P1, P2)
 Instrumented file sync. More...
 

Functions

static void inline_mysql_file_register (const char *category, PSI_file_info *info, int count)
 
static char * inline_mysql_file_fgets (const char *src_file, uint src_line, char *str, int size, MYSQL_FILE *file)
 
static int inline_mysql_file_fgetc (const char *src_file, uint src_line, MYSQL_FILE *file)
 
static int inline_mysql_file_fputs (const char *src_file, uint src_line, const char *str, MYSQL_FILE *file)
 
static int inline_mysql_file_fputc (const char *src_file, uint src_line, char c, MYSQL_FILE *file)
 
static int inline_mysql_file_fprintf (MYSQL_FILE *file, const char *format,...)
 
static int inline_mysql_file_vfprintf (const char *src_file, uint src_line, MYSQL_FILE *file, const char *format, va_list args)
 
static int inline_mysql_file_fflush (const char *src_file, uint src_line, MYSQL_FILE *file)
 
static int inline_mysql_file_feof (MYSQL_FILE *file)
 
static int inline_mysql_file_fstat (const char *src_file, uint src_line, int filenr, MY_STAT *stat_area)
 
static MY_STATinline_mysql_file_stat (PSI_file_key key, const char *src_file, uint src_line, const char *path, MY_STAT *stat_area, myf flags)
 
static int inline_mysql_file_chsize (const char *src_file, uint src_line, File file, my_off_t newlength, int filler, myf flags)
 
static MYSQL_FILEinline_mysql_file_fopen (PSI_file_key key, const char *src_file, uint src_line, const char *filename, int flags, myf myFlags)
 
static int inline_mysql_file_fclose (const char *src_file, uint src_line, MYSQL_FILE *file, myf flags)
 
static size_t inline_mysql_file_fread (const char *src_file, uint src_line, MYSQL_FILE *file, uchar *buffer, size_t count, myf flags)
 
static size_t inline_mysql_file_fwrite (const char *src_file, uint src_line, MYSQL_FILE *file, const uchar *buffer, size_t count, myf flags)
 
static my_off_t inline_mysql_file_fseek (const char *src_file, uint src_line, MYSQL_FILE *file, my_off_t pos, int whence)
 
static my_off_t inline_mysql_file_ftell (const char *src_file, uint src_line, MYSQL_FILE *file)
 
static File inline_mysql_file_create (PSI_file_key key, const char *src_file, uint src_line, const char *filename, int create_flags, int access_flags, myf myFlags)
 
static File inline_mysql_file_create_temp (PSI_file_key key, const char *src_file, uint src_line, char *to, const char *dir, const char *pfx, int mode, UnlinkOrKeepFile unlink_or_keep, myf myFlags)
 
static File inline_mysql_file_open (PSI_file_key key, const char *src_file, uint src_line, const char *filename, int flags, myf myFlags)
 
static int inline_mysql_file_close (const char *src_file, uint src_line, File file, myf flags)
 
static size_t inline_mysql_file_read (const char *src_file, uint src_line, File file, uchar *buffer, size_t count, myf flags)
 
static size_t inline_mysql_file_write (const char *src_file, uint src_line, File file, const uchar *buffer, size_t count, myf flags)
 
static size_t inline_mysql_file_pread (const char *src_file, uint src_line, File file, uchar *buffer, size_t count, my_off_t offset, myf flags)
 
static size_t inline_mysql_file_pwrite (const char *src_file, uint src_line, File file, const uchar *buffer, size_t count, my_off_t offset, myf flags)
 
static my_off_t inline_mysql_file_seek (const char *src_file, uint src_line, File file, my_off_t pos, int whence, myf flags)
 
static my_off_t inline_mysql_file_tell (const char *src_file, uint src_line, File file, myf flags)
 
static int inline_mysql_file_delete (PSI_file_key key, const char *src_file, uint src_line, const char *name, myf flags)
 
static int inline_mysql_file_rename (PSI_file_key key, const char *src_file, uint src_line, const char *from, const char *to, myf flags)
 
static File inline_mysql_file_create_with_symlink (PSI_file_key key, const char *src_file, uint src_line, const char *linkname, const char *filename, int create_flags, int access_flags, myf flags)
 
static int inline_mysql_file_delete_with_symlink (PSI_file_key key, const char *src_file, uint src_line, const char *name, myf flags)
 
static int inline_mysql_file_rename_with_symlink (PSI_file_key key, const char *src_file, uint src_line, const char *from, const char *to, myf flags)
 
static int inline_mysql_file_sync (const char *src_file, uint src_line, File fd, myf flags)
 

Detailed Description

Instrumentation helpers for mysys file io.

This header file provides the necessary declarations to use the mysys file API with the performance schema instrumentation. In some compilers (SunStudio), 'static inline' functions, when declared but not used, are not optimized away (because they are unused) by default, so that including a static inline function from a header file does create unwanted dependencies, causing unresolved symbols at link time. Other compilers, like gcc, optimize these dependencies by default.

Since the instrumented APIs declared here are wrapper on top of mysys file io APIs, including mysql/psi/mysql_file.h assumes that the dependency on my_sys already exists.