[or-cvs] Some tor servers process billions of cells in a matter of d...

arma at seul.org arma at seul.org
Sat Dec 31 08:09:28 UTC 2005


Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	command.c main.c relay.c 
Log Message:
Some tor servers process billions of cells in a matter of days.
These statistics need to be uint64_t's.


Index: command.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/command.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -p -d -r1.105 -r1.106
--- command.c	14 Dec 2005 20:40:40 -0000	1.105
+++ command.c	31 Dec 2005 08:09:26 -0000	1.106
@@ -20,11 +20,11 @@ const char command_c_id[] =
 #include "or.h"
 
 /** Keep statistics about how many of each type of cell we've received. */
-unsigned long stats_n_padding_cells_processed = 0;
-unsigned long stats_n_create_cells_processed = 0;
-unsigned long stats_n_created_cells_processed = 0;
-unsigned long stats_n_relay_cells_processed = 0;
-unsigned long stats_n_destroy_cells_processed = 0;
+uint64_t stats_n_padding_cells_processed = 0;
+uint64_t stats_n_create_cells_processed = 0;
+uint64_t stats_n_created_cells_processed = 0;
+uint64_t stats_n_relay_cells_processed = 0;
+uint64_t stats_n_destroy_cells_processed = 0;
 
 /* These are the main four functions for processing cells */
 static void command_process_create_cell(cell_t *cell, connection_t *conn);

Index: main.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.606
retrieving revision 1.607
diff -u -p -d -r1.606 -r1.607
--- main.c	28 Dec 2005 09:07:31 -0000	1.606
+++ main.c	31 Dec 2005 08:09:26 -0000	1.607
@@ -1298,20 +1298,20 @@ dumpstats(int severity)
                                            * using this conn */
   }
   log(severity, LD_NET,
-      "Cells processed: %10lu padding\n"
-      "                 %10lu create\n"
-      "                 %10lu created\n"
-      "                 %10lu relay\n"
-      "                        (%10lu relayed)\n"
-      "                        (%10lu delivered)\n"
-      "                 %10lu destroy",
-      stats_n_padding_cells_processed,
-      stats_n_create_cells_processed,
-      stats_n_created_cells_processed,
-      stats_n_relay_cells_processed,
-      stats_n_relay_cells_relayed,
-      stats_n_relay_cells_delivered,
-      stats_n_destroy_cells_processed);
+      "Cells processed: "U64_FORMAT" padding\n"
+      "                 "U64_FORMAT" create\n"
+      "                 "U64_FORMAT" created\n"
+      "                 "U64_FORMAT" relay\n"
+      "                        ("U64_FORMAT" relayed)\n"
+      "                        ("U64_FORMAT" delivered)\n"
+      "                 "U64_FORMAT" destroy",
+      U64_PRINTF_ARG(stats_n_padding_cells_processed),
+      U64_PRINTF_ARG(stats_n_create_cells_processed),
+      U64_PRINTF_ARG(stats_n_created_cells_processed),
+      U64_PRINTF_ARG(stats_n_relay_cells_processed),
+      U64_PRINTF_ARG(stats_n_relay_cells_relayed),
+      U64_PRINTF_ARG(stats_n_relay_cells_delivered),
+      U64_PRINTF_ARG(stats_n_destroy_cells_processed));
   if (stats_n_data_cells_packaged)
     log(severity,LD_NET,"Average packaged cell fullness: %2.3f%%",
         100*(((double)stats_n_data_bytes_packaged) /

Index: relay.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/relay.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -p -d -r1.95 -r1.96
--- relay.c	19 Dec 2005 21:56:43 -0000	1.95
+++ relay.c	31 Dec 2005 08:09:26 -0000	1.96
@@ -37,11 +37,11 @@ circuit_consider_stop_edge_reading(circu
 /** Stats: how many relay cells have originated at this hop, or have
  * been relayed onward (not recognized at this hop)?
  */
-unsigned long stats_n_relay_cells_relayed = 0;
+uint64_t stats_n_relay_cells_relayed = 0;
 /** Stats: how many relay cells have been delivered to streams at this
  * hop?
  */
-unsigned long stats_n_relay_cells_delivered = 0;
+uint64_t stats_n_relay_cells_delivered = 0;
 
 /** Update digest from the payload of cell. Assign integrity part to
  * cell.



More information about the tor-commits mailing list