Skip to content

Commit

Permalink
[usb-moded] Silence wakelock related logging in normal builds
Browse files Browse the repository at this point in the history
Having possibility to log wakelocking activity is useful in some special
circumstance, but it creates a lot of noise and usb-moded is lacking fine
tuned logging control.

Disable wakelock logging altogether by default.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Feb 14, 2017
1 parent b846d87 commit 41b29f8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/usb_moded.c
Expand Up @@ -59,6 +59,11 @@
#include "usb_moded-dsme.h"
#endif

/* Wakelogging is noisy, do not log it by default */
#ifndef VERBOSE_WAKELOCKING
# define VERBOSE_WAKELOCKING 0
#endif

/* global definitions */

static int usb_moded_exitcode = EXIT_FAILURE;
Expand Down Expand Up @@ -978,7 +983,9 @@ void acquire_wakelock(const char *wakelock_name)
USB_MODED_SUSPEND_DELAY_MAXIMUM_MS * 1000000LL);
write_to_sysfs_file("/sys/power/wake_lock", buff);

#if VERBOSE_WAKELOCKING
log_debug("acquire_wakelock %s", wakelock_name);
#endif
}

/** Release wakelock via sysfs
Expand All @@ -987,7 +994,9 @@ void acquire_wakelock(const char *wakelock_name)
*/
void release_wakelock(const char *wakelock_name)
{
#if VERBOSE_WAKELOCKING
log_debug("release_wakelock %s", wakelock_name);
#endif

write_to_sysfs_file("/sys/power/wake_unlock", wakelock_name);
}
Expand Down

0 comments on commit 41b29f8

Please sign in to comment.