MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
my_rdtsc.h
1 /* Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
2  Use is subject to license terms.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
16 
17 /*
18  rdtsc3 -- multi-platform timer code
19  pgulutzan@mysql.com, 2005-08-29
20  modified 2008-11-02
21 */
22 
23 #ifndef MY_RDTSC_H
24 #define MY_RDTSC_H
25 
30 {
32  ulonglong routine;
34  ulonglong overhead;
36  ulonglong frequency;
38  ulonglong resolution;
39 };
40 
46 {
57 };
58 
59 typedef struct my_timer_info MY_TIMER_INFO;
60 
61 C_MODE_START
62 
67 ulonglong my_timer_cycles(void);
68 
73 ulonglong my_timer_nanoseconds(void);
74 
79 ulonglong my_timer_microseconds(void);
80 
85 ulonglong my_timer_milliseconds(void);
86 
91 ulonglong my_timer_ticks(void);
92 
97 void my_timer_init(MY_TIMER_INFO *mti);
98 
99 C_MODE_END
100 
101 #define MY_TIMER_ROUTINE_ASM_X86 1
102 #define MY_TIMER_ROUTINE_ASM_X86_64 2
103 #define MY_TIMER_ROUTINE_RDTSCLL 3
104 #define MY_TIMER_ROUTINE_ASM_X86_WIN 4
105 #define MY_TIMER_ROUTINE_RDTSC 5
106 #define MY_TIMER_ROUTINE_ASM_IA64 6
107 #define MY_TIMER_ROUTINE_ASM_PPC 7
108 #define MY_TIMER_ROUTINE_SGI_CYCLE 8
109 #define MY_TIMER_ROUTINE_GETHRTIME 9
110 #define MY_TIMER_ROUTINE_READ_REAL_TIME 10
111 #define MY_TIMER_ROUTINE_CLOCK_GETTIME 11
112 #define MY_TIMER_ROUTINE_NXGETTIME 12
113 #define MY_TIMER_ROUTINE_GETTIMEOFDAY 13
114 #define MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER 14
115 #define MY_TIMER_ROUTINE_GETTICKCOUNT 15
116 #define MY_TIMER_ROUTINE_TIME 16
117 #define MY_TIMER_ROUTINE_TIMES 17
118 #define MY_TIMER_ROUTINE_FTIME 18
119 #define MY_TIMER_ROUTINE_ASM_PPC64 19
120 #define MY_TIMER_ROUTINE_ASM_SUNPRO_SPARC64 20
121 #define MY_TIMER_ROUTINE_ASM_SUNPRO_SPARC32 21
122 #define MY_TIMER_ROUTINE_ASM_SUNPRO_I386 22
123 #define MY_TIMER_ROUTINE_ASM_GCC_SPARC64 23
124 #define MY_TIMER_ROUTINE_ASM_GCC_SPARC32 24
125 #define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25
126 #define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26
127 #define MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64 27
128 
129 #endif
130