
On Mon, Aug 10, 2009 at 3:26 PM, Robin Getzrgetz@blackfin.uclinux.org wrote:
From bca49fb5e3045bc175e924999a4015804c39c5c6 Mon Sep 17 00:00:00 2001 From: Robin Getz rgetz@blackfin.uclinux.org
I was using this when I was looking at some other recent tftp performance, and thought I would share. I really don't think it belongs, as it is (a) trivial and (b) mostly debug... (but I'm trying out some more things with git).
This adds the ability to make tftp a little quieter, which saves some time printing hash marks on the console. It also has the ability to print some download stats for debugging network issues.
Signed-off-by: Robin Getz rgetz@blackfin.uclinux.org
net/tftp.c | 29 ++++++++++++++++++++++++----- 1 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/net/tftp.c b/net/tftp.c index 0fa7033..9544691 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -22,6 +22,16 @@ /* (for checking the image size) */ #define HASHES_PER_LINE 65 /* Number of "loading" hashes per line */
+#ifdef CONFIG_TFTP_QUIET +#define puts_quiet(fmt) +#else +#define puts_quiet(fmt) puts(fmt); +#endif
This looks backwards to me. I would do this:
#ifdef CONFIG_TFTP_QUIET #define puts(x) puts_quiet(x) #endif
That way, you don't need to change all of the puts calls to puts_quiet. Plus, having the normal calls be "puts_quiet" that changes to puts when QUIET is *not* enabled just feels wrong.