diff options
Diffstat (limited to 'ot_stats.c')
| -rw-r--r-- | ot_stats.c | 42 |
1 files changed, 0 insertions, 42 deletions
| @@ -117,10 +117,6 @@ union stats_network_node { | |||
| 117 | stats_network_node *children[STATS_NETWORK_NODE_COUNT]; | 117 | stats_network_node *children[STATS_NETWORK_NODE_COUNT]; |
| 118 | }; | 118 | }; |
| 119 | 119 | ||
| 120 | #ifdef WANT_LOG_NETWORKS | ||
| 121 | static stats_network_node *stats_network_counters_root; | ||
| 122 | #endif | ||
| 123 | |||
| 124 | static int stat_increase_network_count(stats_network_node **pnode, int depth, uintptr_t ip) { | 120 | static int stat_increase_network_count(stats_network_node **pnode, int depth, uintptr_t ip) { |
| 125 | int foo = __LDR(ip, depth); | 121 | int foo = __LDR(ip, depth); |
| 126 | stats_network_node *node; | 122 | stats_network_node *node; |
| @@ -504,36 +500,6 @@ static void stats_return_numwants(char **reply, const char *reply_en | |||
| 504 | } | 500 | } |
| 505 | #endif | 501 | #endif |
| 506 | 502 | ||
| 507 | #ifdef WANT_FULLLOG_NETWORKS | ||
| 508 | static void stats_return_fulllog(size_t *iovec_entries, struct iovec **iovector, char *r) { | ||
| 509 | ot_log *loglist = g_logchain_first, *llnext; | ||
| 510 | char *re = r + OT_STATS_TMPSIZE; | ||
| 511 | |||
| 512 | g_logchain_first = g_logchain_last = 0; | ||
| 513 | |||
| 514 | while (loglist) { | ||
| 515 | if (r + (loglist->size + 64) >= re) { | ||
| 516 | r = iovec_next_chunk(iovec_entries, iovector, r, 32 * OT_STATS_TMPSIZE); | ||
| 517 | if (!r) | ||
| 518 | return; | ||
| 519 | re = r + 32 * OT_STATS_TMPSIZE; | ||
| 520 | } | ||
| 521 | char ip_readable[64]; | ||
| 522 | |||
| 523 | ip_readable[ip_format(ip_readable, loglist->ip)] = 0; | ||
| 524 | fmt_append(&r, re, "%08ld: %s\n", loglist->time, ip_readable); | ||
| 525 | fmt_bytes(&r, re, loglist->data, loglist->size); | ||
| 526 | fmt_append(&r, re, "\n*\n\n"); | ||
| 527 | |||
| 528 | llnext = loglist->next; | ||
| 529 | free(loglist->data); | ||
| 530 | free(loglist); | ||
| 531 | loglist = llnext; | ||
| 532 | } | ||
| 533 | iovec_trim_last(iovec_entries, iovector, r); | ||
| 534 | } | ||
| 535 | #endif | ||
| 536 | |||
| 537 | static void stats_return_everything(char **reply, const char *reply_end) { | 503 | static void stats_return_everything(char **reply, const char *reply_end) { |
| 538 | unsigned long long total[OT_COUNTER_COUNT]; | 504 | unsigned long long total[OT_COUNTER_COUNT]; |
| 539 | 505 | ||
| @@ -671,11 +637,6 @@ static void stats_make(size_t *iovec_entries, struct iovec **iovector, ot_taskty | |||
| 671 | stats_return_woodpeckers(&r, r_end, 128); | 637 | stats_return_woodpeckers(&r, r_end, 128); |
| 672 | break; | 638 | break; |
| 673 | #endif | 639 | #endif |
| 674 | #ifdef WANT_FULLLOG_NETWORKS | ||
| 675 | case TASK_STATS_FULLLOG: | ||
| 676 | stats_return_fulllog(iovec_entries, iovector, r); | ||
| 677 | return; | ||
| 678 | #endif | ||
| 679 | default: | 640 | default: |
| 680 | iovec_free(iovec_entries, iovector); | 641 | iovec_free(iovec_entries, iovector); |
| 681 | return; | 642 | return; |
| @@ -693,9 +654,6 @@ void stats_issue_event(struct ot_workstruct *ws, ot_status_event event, PROTO_FL | |||
| 693 | COUNT(OT_COUNTER_TCP_CONNECTIONS, 1); | 654 | COUNT(OT_COUNTER_TCP_CONNECTIONS, 1); |
| 694 | else | 655 | else |
| 695 | COUNT(OT_COUNTER_UDP_CONNECTIONS, 1); | 656 | COUNT(OT_COUNTER_UDP_CONNECTIONS, 1); |
| 696 | #ifdef WANT_LOG_NETWORKS | ||
| 697 | stat_increase_network_count(&stats_network_counters_root, 0, event_data); | ||
| 698 | #endif | ||
| 699 | break; | 657 | break; |
| 700 | case EVENT_ANNOUNCE: | 658 | case EVENT_ANNOUNCE: |
| 701 | if (proto == FLAG_TCP) | 659 | if (proto == FLAG_TCP) |
