aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/bison/lib/timevar.h
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-06-29 11:45:54 +0300
committerthegeorg <thegeorg@yandex-team.com>2024-06-29 11:54:41 +0300
commit9158d9115725ca7f4ada745ec55eddd5747bc61e (patch)
treef262cd6d7a98bb367943a4918b6963a7800f3937 /contrib/tools/bison/lib/timevar.h
parent632b3cedb8e12fbbb0bcd1bdbf7ec5686725b7e9 (diff)
downloadydb-9158d9115725ca7f4ada745ec55eddd5747bc61e.tar.gz
Update contrib/tools/bison to 3.2.4
78e59a97f3fde03511ddb9969cd1daabbaf998bd
Diffstat (limited to 'contrib/tools/bison/lib/timevar.h')
-rw-r--r--contrib/tools/bison/lib/timevar.h84
1 files changed, 65 insertions, 19 deletions
diff --git a/contrib/tools/bison/lib/timevar.h b/contrib/tools/bison/lib/timevar.h
index 14366c9628..cf9e0830d1 100644
--- a/contrib/tools/bison/lib/timevar.h
+++ b/contrib/tools/bison/lib/timevar.h
@@ -1,4 +1,4 @@
-/* Timing variables for measuring compiler performance.
+/* Timing variables for measuring application performance.
Copyright (C) 2000, 2002, 2004, 2009-2015, 2018 Free Software
Foundation, Inc.
@@ -18,11 +18,19 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#ifndef GCC_TIMEVAR_H
-#define GCC_TIMEVAR_H
+#ifndef _TIMEVAR_H
+# define _TIMEVAR_H 1
+
+# include <stdio.h>
+
+# include "xtime.h"
+
+# ifdef __cplusplus
+extern "C" {
+# endif
/* Timing variables are used to measure elapsed time in various
- portions of the compiler. Each measures elapsed user, system, and
+ portions of the application. Each measures elapsed user, system, and
wall-clock time, as appropriate to and supported by the host
system.
@@ -52,14 +60,14 @@
struct timevar_time_def
{
/* User time in this process. */
- float user;
+ xtime_t user;
/* System time (if applicable for this host platform) in this
process. */
- float sys;
+ xtime_t sys;
/* Wall clock time. */
- float wall;
+ xtime_t wall;
};
/* An enumeration of timing variable identifiers. Constructed from
@@ -75,18 +83,56 @@ typedef enum
timevar_id_t;
#undef DEFTIMEVAR
-extern void init_timevar (void);
-extern void timevar_push (timevar_id_t);
-extern void timevar_pop (timevar_id_t);
-extern void timevar_start (timevar_id_t);
-extern void timevar_stop (timevar_id_t);
-extern void timevar_get (timevar_id_t, struct timevar_time_def *);
-extern void timevar_print (FILE *);
+/* Initialize timing variables. */
+
+void timevar_init (void);
+
+/* Push TIMEVAR onto the timing stack. No further elapsed time is
+ attributed to the previous topmost timing variable on the stack;
+ subsequent elapsed time is attributed to TIMEVAR, until it is
+ popped or another element is pushed on top.
+
+ TIMEVAR cannot be running as a standalone timer. */
+
+void timevar_push (timevar_id_t timevar);
+
+/* Pop the topmost timing variable element off the timing stack. The
+ popped variable must be TIMEVAR. Elapsed time since the that
+ element was pushed on, or since it was last exposed on top of the
+ stack when the element above it was popped off, is credited to that
+ timing variable. */
+
+void timevar_pop (timevar_id_t timevar);
+
+/* Start timing TIMEVAR independently of the timing stack. Elapsed
+ time until timevar_stop is called for the same timing variable is
+ attributed to TIMEVAR. */
-/* Provided for backward compatibility. */
-extern long get_run_time (void);
-extern void print_time (const char *, long);
+void timevar_start (timevar_id_t timevar);
-extern int timevar_report;
+/* Stop timing TIMEVAR. Time elapsed since timevar_start was called
+ is attributed to it. */
+
+void timevar_stop (timevar_id_t timevar);
+
+/* Fill the elapsed time for TIMEVAR into ELAPSED. Returns
+ update-to-date information even if TIMEVAR is currently running. */
+
+void timevar_get (timevar_id_t timevar, struct timevar_time_def *elapsed);
+
+/* Summarize timing variables to FP. The timing variable TV_TOTAL has
+ a special meaning -- it's considered to be the total elapsed time,
+ for normalizing the others, and is displayed last. */
+
+void timevar_print (FILE *fp);
+
+/* Set to to nonzero to enable timing variables. All the timevar
+ functions make an early exit if timevar is disabled. */
+
+extern int timevar_enabled;
+
+# ifdef __cplusplus
+}
+# endif
-#endif /* ! GCC_TIMEVAR_H */
+#endif /* ! _TIMEVAR_H */