added temporary timing logs thomas_timing_tests
authorKrista Bennett <krista@pep-project.org>
Tue, 13 Feb 2018 10:24:12 +0100
branchthomas_timing_tests
changeset 25028c29dd55946e
parent 2501 2e8bb7f39f04
added temporary timing logs
src/message_api.c
src/pEp_internal.h
     1.1 --- a/src/message_api.c	Tue Feb 13 00:13:18 2018 +0100
     1.2 +++ b/src/message_api.c	Tue Feb 13 10:24:12 2018 +0100
     1.3 @@ -2903,11 +2903,20 @@
     1.4          if (il->ident)
     1.5          {   
     1.6              PEP_STATUS status = PEP_STATUS_OK;
     1.7 -            if (!is_me(session, il->ident))
     1.8 +            DEBUG_LOG("timing_log", "_max_comm_type_from_identity_list for address ", il->ident->address);            
     1.9 +            DEBUG_LOG("timing_log", "_max_comm_type_from_identity_list - calling is_me", quick_ts());
    1.10 +            if (!is_me(session, il->ident)) {
    1.11 +                DEBUG_LOG("timing_log", "_max_comm_type_from_identity_list - done with is_me, calling update_identity", quick_ts());
    1.12                  status = update_identity(session, il->ident);
    1.13 -            else
    1.14 +                DEBUG_LOG("timing_log", "_max_comm_type_from_identity_list - return from update_identity", quick_ts());                
    1.15 +            }
    1.16 +            else {
    1.17 +                DEBUG_LOG("timing_log", "_max_comm_type_from_identity_list -done with is_me, calling myself", quick_ts());
    1.18                  status = myself(session, il->ident);
    1.19 -                
    1.20 +                DEBUG_LOG("timing_log", "_max_comm_type_from_identity_list - return from myself", quick_ts());
    1.21 +            }    
    1.22 +
    1.23 +            DEBUG_LOG("timing_log", "_max_comm_type_from_identity_list - evaluating comm type", quick_ts());                
    1.24              // check for the return statuses which might not a representative
    1.25              // value in the comm_type
    1.26              if (status == PEP_ILLEGAL_VALUE || status == PEP_CANNOT_SET_PERSON ||
    1.27 @@ -2922,6 +2931,7 @@
    1.28                          il->ident);
    1.29                  *comm_type_determined = true;
    1.30              }
    1.31 +            DEBUG_LOG("timing_log", "_max_comm_type_from_identity_list - done evaluating comm type", quick_ts());                
    1.32          }
    1.33      }
    1.34  }
    1.35 @@ -2932,6 +2942,7 @@
    1.36          PEP_rating *rating
    1.37      )
    1.38  {
    1.39 +    DEBUG_LOG("timing_log", "outgoing_message_rating - start", quick_ts());
    1.40      PEP_comm_type max_comm_type = PEP_ct_pEp;
    1.41      bool comm_type_determined = false;
    1.42  
    1.43 @@ -2948,12 +2959,15 @@
    1.44  
    1.45      *rating = PEP_rating_undefined;
    1.46  
    1.47 +    DEBUG_LOG("timing_log", "outgoing_message_rating - calling _max_comm_type_from_identity on msg->to", quick_ts());
    1.48      _max_comm_type_from_identity_list(msg->to, session,
    1.49                                        &max_comm_type, &comm_type_determined);
    1.50 -
    1.51 +                                      
    1.52 +    DEBUG_LOG("timing_log", "outgoing_message_rating - finished, calling _max_comm_type_from_identity on msg->cc", quick_ts());
    1.53      _max_comm_type_from_identity_list(msg->cc, session,
    1.54                                        &max_comm_type, &comm_type_determined);
    1.55  
    1.56 +    DEBUG_LOG("timing_log", "outgoing_message_rating - finished, calling _max_comm_type_from_identity on msg->bcc", quick_ts());
    1.57      _max_comm_type_from_identity_list(msg->bcc, session,
    1.58                                        &max_comm_type, &comm_type_determined);
    1.59  
    1.60 @@ -2966,6 +2980,7 @@
    1.61          *rating = _MAX(_rating(max_comm_type, PEP_rating_undefined),
    1.62                  PEP_rating_unencrypted);
    1.63  
    1.64 +    DEBUG_LOG("timing_log", "outgoing_message_rating - end", quick_ts());
    1.65      return PEP_STATUS_OK;
    1.66  }
    1.67  
     2.1 --- a/src/pEp_internal.h	Tue Feb 13 00:13:18 2018 +0100
     2.2 +++ b/src/pEp_internal.h	Tue Feb 13 10:24:12 2018 +0100
     2.3 @@ -425,3 +425,8 @@
     2.4      _pEp_rand_max_bits = ceil(log2(RAND_MAX));
     2.5      _pEp_log2_36 = log2(36);
     2.6  }
     2.7 +
     2.8 +static inline char* quick_ts() {
     2.9 +    time_t the_time = time(NULL);
    2.10 +    return ctime(&the_time);
    2.11 +}