All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/4] DCCP: Add more debugging
@ 2006-12-28  4:06 Ian McDonald
  2007-01-03 11:40 ` Gerrit Renker
  2007-01-03 21:52 ` Ian McDonald
  0 siblings, 2 replies; 3+ messages in thread
From: Ian McDonald @ 2006-12-28  4:06 UTC (permalink / raw)
  To: dccp

This adds some more debugging. Altered to take into account Gerrit's
comments.

Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index 4401ab4..f1f9ebb 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -98,6 +98,11 @@ static inline void ccid3_update_send_time(struct ccid3_hc_tx_sock *hctx)
 	/* Calculate new delta by delta = min(t_ipi / 2, t_gran / 2) */
 	hctx->ccid3hctx_delta = min_t(u32, hctx->ccid3hctx_t_ipi / 2,
 					   TFRC_OPSYS_HALF_TIME_GRAN);
+
+	ccid3_pr_debug("t_ipi=%u, delta=%u, s=%u, x=%llu\n",
+	               hctx->ccid3hctx_t_ipi, hctx->ccid3hctx_delta,
+		       hctx->ccid3hctx_s, hctx->ccid3hctx_x >> 6);
+
 }
 /*
  * Update X by
@@ -140,8 +145,12 @@ static void ccid3_hc_tx_update_x(struct sock *sk, struct timeval *now)
 		hctx->ccid3hctx_t_ld = *now;
 	}
 
-	if (hctx->ccid3hctx_x != old_x)
+	if (hctx->ccid3hctx_x != old_x) {
+		ccid3_pr_debug("X_prev=%llu, X_now=%llu, X_calc=%u, "
+		               "X_recv=%llu\n", old_x, hctx->ccid3hctx_x,
+			       hctx->ccid3hctx_x_calc, hctx->ccid3hctx_x_recv);
 		ccid3_update_send_time(hctx);
+	}
 }
 
 /*
@@ -338,6 +347,7 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
 	case TFRC_SSTATE_NO_FBACK:
 	case TFRC_SSTATE_FBACK:
 		delay = timeval_delta(&hctx->ccid3hctx_t_nom, &now);
+		ccid3_pr_debug("delay=%ld\n", (long)delay);
 		/*
 		 *	Scheduling of packet transmissions [RFC 3448, 4.6]
 		 *

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/4] DCCP: Add more debugging
  2006-12-28  4:06 [PATCH 2/4] DCCP: Add more debugging Ian McDonald
@ 2007-01-03 11:40 ` Gerrit Renker
  2007-01-03 21:52 ` Ian McDonald
  1 sibling, 0 replies; 3+ messages in thread
From: Gerrit Renker @ 2007-01-03 11:40 UTC (permalink / raw)
  To: dccp

Hi Ian,

I have tested this at home and found a small error:

|  +	if (hctx->ccid3hctx_x != old_x) {
|  +		ccid3_pr_debug("X_prev=%llu, X_now=%llu, X_calc=%u, "
|  +		               "X_recv=%llu\n", old_x, hctx->ccid3hctx_x,
|  +			       hctx->ccid3hctx_x_calc, hctx->ccid3hctx_x_recv);
|   		ccid3_update_send_time(hctx);
=> old_x, x, and x_recv are all scaled by 2^6 and need to be divided (would give wrong results).

I have fixed this in the online version (3c_CCID3_add_more_debugging_McDonald.diff);
the inter-diff between previous and now is (having also updated `x' -> `X' for consistency):

diff -u b/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
--- b/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -100,8 +100,8 @@
        hctx->ccid3hctx_delta = min_t(u32, hctx->ccid3hctx_t_ipi / 2,
                                           TFRC_OPSYS_HALF_TIME_GRAN);

-       ccid3_pr_debug("t_ipi=%u, delta=%u, s=%u, x=%llu\n",
-                      hctx->ccid3hctx_t_ipi, hctx->ccid3hctx_delta,
+       ccid3_pr_debug("t_ipi=%u, delta=%u, s=%u, X=%llu\n",
+                      hctx->ccid3hctx_t_ipi, hctx->ccid3hctx_delta,
                       hctx->ccid3hctx_s, hctx->ccid3hctx_x >> 6);

 }
@@ -148,8 +148,9 @@

        if (hctx->ccid3hctx_x != old_x) {
                ccid3_pr_debug("X_prev=%llu, X_now=%llu, X_calc=%u, "
-                              "X_recv=%llu\n", old_x, hctx->ccid3hctx_x,
-                              hctx->ccid3hctx_x_calc, hctx->ccid3hctx_x_recv);
+                              "X_recv=%llu\n", old_x >> 6, hctx->ccid3hctx_x >> 6,
+                              hctx->ccid3hctx_x_calc, hctx->ccid3hctx_x_recv >> 6);
+
                ccid3_update_send_time(hctx);
        }
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/4] DCCP: Add more debugging
  2006-12-28  4:06 [PATCH 2/4] DCCP: Add more debugging Ian McDonald
  2007-01-03 11:40 ` Gerrit Renker
@ 2007-01-03 21:52 ` Ian McDonald
  1 sibling, 0 replies; 3+ messages in thread
From: Ian McDonald @ 2007-01-03 21:52 UTC (permalink / raw)
  To: dccp

On 1/4/07, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
> Hi Ian,
>
> I have tested this at home and found a small error:
>
> |  +    if (hctx->ccid3hctx_x != old_x) {
> |  +            ccid3_pr_debug("X_prev=%llu, X_now=%llu, X_calc=%u, "
> |  +                           "X_recv=%llu\n", old_x, hctx->ccid3hctx_x,
> |  +                           hctx->ccid3hctx_x_calc, hctx->ccid3hctx_x_recv);
> |               ccid3_update_send_time(hctx);
> => old_x, x, and x_recv are all scaled by 2^6 and need to be divided (would give wrong results).
>
> I have fixed this in the online version (3c_CCID3_add_more_debugging_McDonald.diff);
> the inter-diff between previous and now is (having also updated `x' -> `X' for consistency):
>
Yes I did realise this but I should have been consistent and altered
the label. I thought it might be useful to look at the full number
sometimes....

Anyway I'm happy with your changes.

Ian
-- 
Web: http://wand.net.nz/~iam4
Blog: http://imcdnzl.blogspot.com
WAND Network Research Group

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-01-03 21:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-28  4:06 [PATCH 2/4] DCCP: Add more debugging Ian McDonald
2007-01-03 11:40 ` Gerrit Renker
2007-01-03 21:52 ` Ian McDonald

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.