diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-09-16 14:29:34 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-09-16 14:29:34 +0000 |
commit | c245f7c4b2ab80ecd33020cac386bbbf7d1b3f43 (patch) | |
tree | 8ee0435a7a5a2615d128b6703b996c31b38ccfa6 /usr.bin | |
parent | 0b215147aaec093b73211eead0f552fdd9ed63bd (diff) |
remove old debug code nothing uses
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/make/dir.c | 54 | ||||
-rw-r--r-- | usr.bin/make/dir.h | 9 | ||||
-rw-r--r-- | usr.bin/make/targ.c | 6 |
3 files changed, 3 insertions, 66 deletions
diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index 1eef17c4b39..31703971350 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: dir.c,v 1.51 2007/09/16 12:30:35 espie Exp $ */ +/* $OpenBSD: dir.c,v 1.52 2007/09/16 14:29:33 espie Exp $ */ /* $NetBSD: dir.c,v 1.14 1997/03/29 16:51:26 christos Exp $ */ /* @@ -87,10 +87,6 @@ struct PathEntry { int refCount; /* Number of paths with this directory */ -#ifdef DEBUG_DIRECTORY_CACHE - int hits; /* the number of times a file in this - * directory has been found */ -#endif struct ohash files; /* Hash table of files in directory */ char name[1]; /* Name of directory */ }; @@ -165,15 +161,6 @@ struct PathEntry { static LIST theDefaultPath; /* main search path */ Lst defaultPath= &theDefaultPath; -#ifdef DEBUG_DIRECTORY_CACHE -/* Variables for gathering statistics on the efficiency of the hashing - * mechanism. */ -static int hits, /* Found in directory cache */ - misses, /* Sad, but not evil misses */ - nearmisses, /* Found under search path */ - bigmisses; /* Sought by itself */ -#endif - struct PathEntry *dot; /* contents of current directory */ struct file_stamp { @@ -400,10 +387,6 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path, find_file_hashi(dot, cp, ename, hv) != NULL) { if (DEBUG(DIR)) printf("in '.'\n"); -#ifdef DEBUG_DIRECTORY_CACHE - hits++; - dot->hits++; -#endif return Str_dupi(name, ename); } @@ -446,10 +429,6 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path, ename, '/'); if (DEBUG(DIR)) printf("returning %s\n", file); -#ifdef DEBUG_DIRECTORY_CACHE - p->hits++; - hits++; -#endif return file; } else if (hasSlash) { /* If the file has a leading path component and that @@ -482,9 +461,6 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path, if (!hasSlash) { if (DEBUG(DIR)) printf("failed.\n"); -#ifdef DEBUG_DIRECTORY_CACHE - misses++; -#endif return NULL; } @@ -532,9 +508,6 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path, printf("Caching %s for %s\n", time_to_string(mtime), file); record_stamp(file, mtime); -#ifdef DEBUG_DIRECTORY_CACHE - nearmisses++; -#endif return file; } else free(file); @@ -567,9 +540,6 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path, if (DEBUG(DIR)) printf("Looking for \"%s\"...", q); -#ifdef DEBUG_DIRECTORY_CACHE - bigmisses++; -#endif entry = find_stampi(name, ename); if (entry != NULL) { if (DEBUG(DIR)) @@ -607,9 +577,6 @@ DirReaddiri(const char *name, const char *ename) return p; p = ohash_create_entry(&dir_info, name, &ename); -#ifdef DEBUG_DIRECTORY_CACHE - p->hits = 0; -#endif p->refCount = 0; ohash_init(&p->files, 4, &file_info); @@ -762,25 +729,6 @@ Dir_Concat(Lst path1, Lst path2) } } -#ifdef DEBUG_DIRECTORY_CACHE -void -Dir_PrintDirectories(void) -{ - struct PathEntry *p; - unsigned int i; - - printf("#*** Directory Cache:\n"); - printf("# Stats: %d hits %d misses %d near misses %d losers (%d%%)\n", - hits, misses, nearmisses, bigmisses, - (hits+bigmisses+nearmisses ? - hits * 100 / (hits + bigmisses + nearmisses) : 0)); - printf("# %-20s referenced\thits\n", "directory"); - for (p = ohash_first(&knownDirectories, &i); p != NULL; - p = ohash_next(&knownDirectories, &i)) - printf("# %-20s %10d\t%4d\n", p->name, p->refCount, p->hits); -} -#endif - static void DirPrintDir(void *p) { diff --git a/usr.bin/make/dir.h b/usr.bin/make/dir.h index 91e58b95ce5..b49583c8b58 100644 --- a/usr.bin/make/dir.h +++ b/usr.bin/make/dir.h @@ -2,7 +2,7 @@ #define DIR_H /* $OpenPackages$ */ -/* $OpenBSD: dir.h,v 1.20 2007/09/16 12:30:35 espie Exp $ */ +/* $OpenBSD: dir.h,v 1.21 2007/09/16 14:29:33 espie Exp $ */ /* $NetBSD: dir.h,v 1.4 1996/11/06 17:59:05 christos Exp $ */ /* @@ -142,13 +142,6 @@ extern TIMESTAMP Dir_MTime(GNode *); extern char *Dir_MakeFlags(const char *, Lst); -#ifdef DEBUG_DIRECTORY_CACHE -/* Dir_PrintDirectories(); - * Print stats about the directory cache. - */ -extern void Dir_PrintDirectories(void); -#endif - /* List of directories to search when looking for targets. */ extern Lst defaultPath; diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 7f45a82f607..9c46786d4c4 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: targ.c,v 1.42 2007/09/16 14:09:18 espie Exp $ */ +/* $OpenBSD: targ.c,v 1.43 2007/09/16 14:29:33 espie Exp $ */ /* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* @@ -555,9 +555,5 @@ Targ_PrintGraph(int pass) /* Which pass this is. 1 => no processing TargPrintOnlySrc(gn); Var_Dump(); printf("\n"); -#ifdef DEBUG_DIRECTORY_CACHE - Dir_PrintDirectories(); - printf("\n"); -#endif Suff_PrintAll(); } |