Make enable of disk cache statistics code configurable.

* configure.ac: --enable-cache-stats added.
	* config.h.in (DISK_CACHE_STATS): New define.
	* grub-core/Makefile.core.def (cacheinfo): New command.
	* include/grub/disk.h(grub_disk_cache_get_performance): New function.
	* grub-core/commands/cacheinfo.c: New file.
	* grub-core/commands/minicmd.c (grub_rescue_cmd_info): Updated and
	moved to cacheinfo.c.
	* grub-core/kern/disk.c: Use DISK_CACHE_STATS to disable disk cache
	debug code.
	* include/grub/disk.h: Likewise.
This commit is contained in:
Szymon Janc 2010-10-06 19:57:01 +02:00
parent a61499a1c3
commit c5dc16905a
8 changed files with 106 additions and 23 deletions

View file

@ -160,6 +160,11 @@ grub_err_t EXPORT_FUNC(grub_disk_write) (grub_disk_t disk,
grub_uint64_t EXPORT_FUNC(grub_disk_get_size) (grub_disk_t disk);
#if DISK_CACHE_STATS
void
EXPORT_FUNC(grub_disk_cache_get_performance) (unsigned long *hits, unsigned long *misses);
#endif
extern void (* EXPORT_VAR(grub_disk_firmware_fini)) (void);
extern int EXPORT_VAR(grub_disk_firmware_is_tainted);