Committer: Tim Just <tim.just@xxxxxxxxxxxxxx> Date: 25/04/2010 at 17:40:23 Revision: 4406 Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: trunk Log: Added startup time measurement. The startup time of the daemon (until the mainloop is reached) can now be measured using the performance library. The new slot is called PERF_STARTUP. Modified: M hipd/hipd.c M lib/core/performance.h === modified file 'hipd/hipd.c' --- hipd/hipd.c 2010-04-20 11:19:56 +0000 +++ hipd/hipd.c 2010-04-25 14:38:43 +0000 @@ -366,6 +366,7 @@ check_and_create_dir("results", DEFAULT_CONFIG_DIR_MODE); + hip_perf_set_name(perf_set, PERF_STARTUP, "results/PERF_STARTUP.csv"); hip_perf_set_name(perf_set, PERF_I1_SEND, "results/PERF_I1_SEND.csv"); hip_perf_set_name(perf_set, PERF_I1, "results/PERF_I1.csv"); hip_perf_set_name(perf_set, PERF_R1, "results/PERF_R1.csv"); @@ -393,6 +394,9 @@ hip_perf_set_name(perf_set, PERF_RSA_VERIFY_IMPL, "results/PERF_RSA_VERIFY_IMPL.csv"); hip_perf_set_name(perf_set, PERF_RSA_SIGN_IMPL, "results/PERF_RSA_SIGN_IMPL.csv"); hip_perf_open(perf_set); + + HIP_DEBUG("Start PERF_STARTUP\n"); + hip_perf_start_benchmark(perf_set, PERF_STARTUP); #endif /* default is long format */ @@ -482,6 +486,11 @@ "Hipd daemon running.\n" "Starting select loop.\n"); hipd_set_state(HIPD_STATE_EXEC); +#ifdef CONFIG_HIP_PERFORMANCE + HIP_DEBUG("Stop and write PERF_STARTUP\n"); + hip_perf_stop_benchmark(perf_set, PERF_STARTUP); + hip_perf_write_benchmark(perf_set, PERF_STARTUP); +#endif while (hipd_get_state() != HIPD_STATE_CLOSED) { /* prepare file descriptor sets */ if (hip_opendht_inuse == HIP_MSG_DHT_ON) { === modified file 'lib/core/performance.h' --- lib/core/performance.h 2010-04-22 10:12:54 +0000 +++ lib/core/performance.h 2010-04-25 14:38:43 +0000 @@ -81,9 +81,10 @@ #define PERF_UPDATE_FINISH_REKEYING 23 #define PERF_HANDLE_UPDATE_2 24 #define PERF_RSA_SIGN_IMPL 25 +#define PERF_STARTUP 26 /* Number of sensors for the HIP daemon. */ -#define PERF_MAX 26 +#define PERF_MAX 27 perf_set_t *perf_set;