Committer: Tim Just <tim.just@xxxxxxxxxxxxxx> Date: Fri Feb 26 12:18:32 2010 +0100 Revision: 3579 Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: tiny Log: Fixed performance measurement for I2 packets. Modified: M hipd/init.c M hipd/input.c === modified file 'hipd/init.c' --- hipd/init.c 2010-02-26 11:16:19 +0000 +++ hipd/init.c 2010-02-26 11:18:32 +0000 @@ -439,17 +439,6 @@ hip_register_handle_function(HIP_I2, HIP_STATE_CLOSED, &hip_handle_i2, 0); hip_register_handle_function(HIP_I2, HIP_STATE_NONE, &hip_handle_i2, 0); - /** @todo Register performance measurement functions as handle functions */ -#if 0 -#ifdef CONFIG_HIP_PERFORMANCE - HIP_DEBUG("Start PERF_I2\n"); - hip_perf_start_benchmark(perf_set, PERF_I2); - HIP_DEBUG("Stop and write PERF_I2\n"); - hip_perf_stop_benchmark(perf_set, PERF_I2); - hip_perf_write_benchmark(perf_set, PERF_I2); -#endif -#endif - hip_register_handle_function(HIP_R1, HIP_STATE_UNASSOCIATED, &hip_drop_packet, 0); hip_register_handle_function(HIP_R1, HIP_STATE_I1_SENT, &hip_handle_r1, 0); hip_register_handle_function(HIP_R1, HIP_STATE_I2_SENT, &hip_handle_r1, 0); === modified file 'hipd/input.c' --- hipd/input.c 2010-02-26 11:16:19 +0000 +++ hipd/input.c 2010-02-26 11:18:32 +0000 @@ -1510,6 +1510,10 @@ int if_index = 0; struct sockaddr_storage ss_addr; struct sockaddr *addr = NULL; +#ifdef CONFIG_HIP_PERFORMANCE + HIP_DEBUG("Start PERF_I2\n"); + hip_perf_start_benchmark(perf_set, PERF_I2); +#endif HIP_IFEL(ipv6_addr_any(&(ctx->msg)->hitr), 0, @@ -2089,7 +2093,11 @@ if (i2_context.dh_shared_key != NULL) { free(i2_context.dh_shared_key); } - +#ifdef CONFIG_HIP_PERFORMANCE + HIP_DEBUG("Stop and write PERF_I2\n"); + hip_perf_stop_benchmark(perf_set, PERF_I2); + hip_perf_write_benchmark(perf_set, PERF_I2); +#endif return err; }