25 #include "pips_config.h"
33 #include <sys/types.h>
34 #include <sys/times.h>
92 gettimeofday(&tv, NULL);
93 return (
double) tv.tv_sec + (double) tv.tv_usec / 1.0e6;
150 #define MAX_TIME_STRING_LENGTH 1024
157 struct tms total_phase_time;
158 double real_total_phase_time;
165 total_phase_time.tms_utime -=
phase_time.tms_utime;
166 total_phase_time.tms_stime -=
phase_time.tms_stime;
169 long HZ = sysconf(_SC_CLK_TCK);
171 sprintf (
s1,
"(r%.3f u%.2f s%.2f)\n",
172 real_total_phase_time,
173 (
double) total_phase_time.tms_utime / HZ,
174 (
double) total_phase_time.tms_stime / HZ);
176 sprintf (s2,
"(r%.3f u%.2f s%.2f)\n",
181 *with_io =
s1; *io = s2;
198 struct tms total_request_time;
199 double real_total_request_time;
211 long HZ = sysconf(_SC_CLK_TCK);
213 sprintf (
s1,
"(r%.3f u%.2f s%.2f)\n",
214 real_total_request_time,
215 (
double) total_request_time.tms_utime / HZ,
216 (
double) total_request_time.tms_stime / HZ);
218 sprintf (s2,
"(r%.3f u%.2f s%.2f)\n",
223 sprintf (s3,
"(r%.3f u%.2f s%.2f)\n",
string concatenate(const char *,...)
Return the concatenation of the given strings.
set set_clear(set)
Assign the empty set to s s := {}.
#define set_undefined_p(s)
set set_make(set_type)
Create an empty set of any type but hash_private.
set set_add_element(set, const set, const void *)
static struct tms request_phase_time
static bool flag_interrupt_pipsmake_asap
void interrupt_pipsmake_asap()
misc.c
void get_request_string_timers(string *global, string *phases, string *dbm)
compute times elapsed since init_request_log_timers(), i.e.
static set res_read
Sets of the readwrite resources by pipsdbm.
static double get_real_timer()
Get real time in seconds in a double representation.
void dbm_stop_timer()
accumulate dbm related times for one phase
void init_request_timers()
Functions for timing one request.
static struct tms dbm_time
static struct tms request_time
Timing of one request.
void get_string_timers(string *with_io, string *io)
compute times elapsed since init_log_timers(), i.e.
void get_logged_resources(set *sr, set *sw)
Get the made sets.
#define MAX_TIME_STRING_LENGTH
static double real_request_dbm_time
static struct tms total_dbm_time
static void set_current_time(struct tms *now, double *rnow)
set current usage and time in two formats
static double real_request_phase_time
static double real_phase_time
void add_read_resource(string rname, string oname)
add an element to the read set
void init_log_timers()
Functions for timing one phase.
bool interrupt_pipsmake_asap_p()
static double real_total_dbm_time
void init_resource_usage_check()
init variables
void dont_interrupt_pipsmake_asap()
static struct tms request_dbm_time
void add_write_resource(string rname, string oname)
add an element to the write set
static double real_dbm_time
static double real_request_time
static struct tms phase_time
Timing of one phase.
FI: I do not understand why the type is duplicated at the set level.