Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SUPPRESS_LOG env to control the log outputs #332

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions activate.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
FILE *file;
int errsave, ret;
cpumask_t applied_mask;
char *env = getenv("SUPPRESS_LOG");

/*
* only activate mappings for irqs that have moved
Expand Down Expand Up @@ -97,9 +98,11 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
error:
/* Use EPERM as the explaination for EIO */
errsave = (errsave == EIO) ? EPERM : errsave;
log(TO_ALL, LOG_WARNING,
"Cannot change IRQ %i affinity: %s\n",
info->irq, strerror(errsave));
if (!env || strcmp(env, "yes")) {
log(TO_ALL, LOG_WARNING,
"Cannot change IRQ %i affinity: %s\n",
info->irq, strerror(errsave));
}
switch (errsave) {
case EAGAIN: /* Interrupted by signal. */
case EBUSY: /* Affinity change already in progress. */
Expand All @@ -124,8 +127,10 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
/* Any other error is considered permanent. */
info->level = BALANCE_NONE;
info->moved = 0; /* migration impossible, mark as done */
log(TO_ALL, LOG_WARNING, "IRQ %i affinity is now unmanaged\n",
info->irq);
if (!env || strcmp(env, "yes")) {
log(TO_ALL, LOG_WARNING, "IRQ %i affinity is now unmanaged\n",
info->irq);
}
}
}

Expand Down
8 changes: 8 additions & 0 deletions misc/irqbalance.env
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,11 @@
# page.
#
IRQBALANCE_ARGS=""

#
# SUPPRESS_LOG
# Configuration for suppress the following runtime logs:
# "Cannot change IRQ x affinity: ..." and
# "IRQ x affinity is now unmanaged"
# Uncomment to enable the suppression.
#SUPPRESS_LOG=yes