/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pcilib/debug.c

  • Committer: Suren A. Chilingaryan
  • Date: 2015-05-08 18:06:36 UTC
  • Revision ID: csa@suren.me-20150508180636-x3vsolbme4uot0ox
Prevent excessive calling of getenv by debugging code for better performance

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
#define PCILIB_MAX_DEBUG_FILENAME_LENGTH 1023
13
13
 
 
14
 
14
15
void pcilib_debug_message(const char *function, const char *file, int line, pcilib_log_flags_t flags, const char *format, ...) {
15
16
    va_list va;
16
17
 
17
 
    if (!getenv(function)) return;
 
18
//    if (!getenv(function)) return;
18
19
 
19
20
    va_start(va, format);
20
21
    pcilib_log_vmessage(file, line, PCILIB_LOG_DEBUG, flags, format, va);
30
31
    const char *prefix;
31
32
    char fname[PCILIB_MAX_DEBUG_FILENAME_LENGTH + 1];
32
33
 
33
 
 
34
34
    prefix = getenv(function);
35
35
    if (!prefix) return;
36
36