Revision: 14306 Author: adrian.chadd Date: Sat Sep 26 00:12:32 2009 Log: * Add in code to initialise the debugging code via the environment variable(s) * Add in debug lines to output start/finish lines
http://code.google.com/p/lusca-cache/source/detail?r=14306 Modified: /branches/LUSCA_HEAD/app/coss_newfs/coss_newfs.c ======================================= --- /branches/LUSCA_HEAD/app/coss_newfs/coss_newfs.c Fri Sep 25 22:19:05 2009 +++ /branches/LUSCA_HEAD/app/coss_newfs/coss_newfs.c Sat Sep 26 00:12:32 2009 @@ -27,10 +27,15 @@ int fd; char *buf; off_t r; + char *t = NULL; + char *debug_args = "ALL,1"; /* Setup the debugging library */ - _db_init("ALL,1"); - _db_set_stderr_debug(1); + if ((t = getenv("SQUID_DEBUG"))) + debug_args = xstrdup(t); + _db_init(debug_args); + _db_set_stderr_debug(99); + getCurrentTime(); if (argc < 3) { printf("Usage: %s <path> <stripe count> <stripe size>\n", argv[0]); @@ -54,6 +59,7 @@ exit(127); } buf = xcalloc(stripe_sz, sizeof(char)); + debug(85, 1) ("coss_newfs: %s: initialising stripe\n", path); for (i = 0; i < sz; i += 1) { getCurrentTime(); @@ -70,6 +76,7 @@ } } safe_free(buf); + debug(85, 1) ("coss_newfs: %s: finished\n", path); close(fd); exit(0); } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "lusca-commit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/lusca-commit?hl=en -~----------~----~----~----~------~----~------~--~---
