MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / log_expiry

Function log_expiry

ut.h:1434–1502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1432 } while (0)
1433
1434static inline void log_expiry(int time_diff,int expire,
1435 const char *func_info,char *extra_dbg,int dbg_len,int tcp)
1436{
1437 str param;
1438 evi_params_p list;
1439 static str func_str = str_init("source");
1440 static str time_str = str_init("time");
1441 static str extra_str = str_init("extra");
1442 int i;
1443
1444 if (time_diff > expire)
1445 {
1446 if (tcp) {
1447 LM_WARN("threshold exceeded : tcp took too long : "
1448 "con_get=%d, rcv_fd=%d, send=%d. Source : %.*s\n",
1449 tcp_timeout_con_get,tcp_timeout_receive_fd,
1450 tcp_timeout_send,dbg_len,extra_dbg);
1451 time_diff = tcp_timeout_send + tcp_timeout_receive_fd +
1452 tcp_timeout_con_get;
1453 } else
1454 LM_WARN("threshold exceeded : %s took too long - %d us."
1455 "Source : %.*s\n",func_info,time_diff,dbg_len,extra_dbg);
1456
1457 if (memcmp(func_info,"msg",3) == 0) {
1458 for (i=0;i<LONGEST_ACTION_SIZE;i++) {
1459 if (longest_action[i].a) {
1460 if ((unsigned char)longest_action[i].a->type == CMD_T)
1461 LM_WARN("#%i is a module action : %s - %dus - line %d\n",i+1,
1462 ((cmd_export_t*)(longest_action[i].a->elem[0].u.data))->name,
1463 longest_action[i].a_time,longest_action[i].a->line);
1464 else
1465 LM_WARN("#%i is a core action : %d - %dus - line %d\n",i+1,
1466 longest_action[i].a->type,
1467 longest_action[i].a_time,longest_action[i].a->line);
1468 }
1469 }
1470 }
1471 if (evi_probe_event(EVI_THRESHOLD_ID)) {
1472
1473 param.s = (char *)func_info;
1474 param.len = strlen(func_info);
1475 if (!(list = evi_get_params()))
1476 return;
1477 if (evi_param_add_str(list, &func_str, &param)) {
1478 LM_ERR("unable to add func parameter\n");
1479 goto error;
1480 }
1481 if (evi_param_add_int(list, &time_str, &time_diff)) {
1482 LM_ERR("unable to add time parameter\n");
1483 goto error;
1484 }
1485 param.s = extra_dbg;
1486 param.len = dbg_len;
1487 if (evi_param_add_str(list, &extra_str, &param)) {
1488 LM_ERR("unable to add extra parameter\n");
1489 goto error;
1490 }
1491 if (evi_raise_event(EVI_THRESHOLD_ID, list)) {

Callers

nothing calls this directly

Calls 4

evi_probe_eventFunction · 0.85
evi_get_paramsFunction · 0.85
evi_raise_eventFunction · 0.85
evi_free_paramsFunction · 0.85

Tested by

no test coverage detected