diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2015-05-08 20:06:36 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2015-05-08 20:06:36 +0200 |
commit | 79d9b2924d7b67ba08e022792adb92770f64e0c8 (patch) | |
tree | dc2ce5058978bfe88de1613291f21aa2ca7d9b0c /pcilib/debug.c | |
parent | a1889bc2f45b3d944652be6436569980f189922d (diff) | |
download | pcitool-79d9b2924d7b67ba08e022792adb92770f64e0c8.tar.gz pcitool-79d9b2924d7b67ba08e022792adb92770f64e0c8.tar.bz2 pcitool-79d9b2924d7b67ba08e022792adb92770f64e0c8.tar.xz pcitool-79d9b2924d7b67ba08e022792adb92770f64e0c8.zip |
Prevent excessive calling of getenv by debugging code for better performance
Diffstat (limited to 'pcilib/debug.c')
-rw-r--r-- | pcilib/debug.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pcilib/debug.c b/pcilib/debug.c index ca31364..5192dc2 100644 --- a/pcilib/debug.c +++ b/pcilib/debug.c @@ -11,10 +11,11 @@ #define PCILIB_MAX_DEBUG_FILENAME_LENGTH 1023 + void pcilib_debug_message(const char *function, const char *file, int line, pcilib_log_flags_t flags, const char *format, ...) { va_list va; - if (!getenv(function)) return; +// if (!getenv(function)) return; va_start(va, format); pcilib_log_vmessage(file, line, PCILIB_LOG_DEBUG, flags, format, va); @@ -30,7 +31,6 @@ void pcilib_debug_data_buffer(const char *function, size_t size, void *buffer, p const char *prefix; char fname[PCILIB_MAX_DEBUG_FILENAME_LENGTH + 1]; - prefix = getenv(function); if (!prefix) return; |