Projects
home:Eustace:branches:Eulaceura:Factory
irqbalance
_service:obs_scm:feature-add-the-switch-of-prin...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:feature-add-the-switch-of-printing-log.patch of Package irqbalance
From b697a97436dafa13f0ae3febde299bfc20498f9d Mon Sep 17 00:00:00 2001 From: liuchao <liuchao173@huawei.com> Date: Wed, 23 Oct 2019 11:42:26 +0000 Subject: [PATCH] feature: add the switch of printing log add the switch of printing log --- cputree.c | 16 ++++++++-------- irqbalance.c | 11 ++++++++++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/cputree.c b/cputree.c index 010e672..48d3d0d 100644 --- a/cputree.c +++ b/cputree.c @@ -399,23 +399,23 @@ static void dump_irq(struct irq_info *info, void *data) indent[i] = log_indent[0]; indent[i] = '\0'; - log(TO_CONSOLE, LOG_INFO, "%sInterrupt %i node_num is %d (%s/%" PRIu64 ":%" PRIu64 ") \n", indent, + log(TO_ALL, LOG_INFO, "%sInterrupt %i node_num is %d (%s/%" PRIu64 ":%" PRIu64 ") \n", indent, info->irq, irq_numa_node(info)->number, classes[info->class], info->load, (info->irq_count - info->last_irq_count)); free(indent); } static void dump_numa_node_num(struct topo_obj *p, void *data __attribute__((unused))) { - log(TO_CONSOLE, LOG_INFO, "%d ", p->number); + log(TO_ALL, LOG_INFO, "%d ", p->number); } static void dump_balance_obj(struct topo_obj *d, void *data __attribute__((unused))) { struct topo_obj *c = (struct topo_obj *)d; - log(TO_CONSOLE, LOG_INFO, "%s%s%s%sCPU number %i numa_node is ", + log(TO_ALL, LOG_INFO, "%s%s%s%sCPU number %i numa_node is ", log_indent, log_indent, log_indent, log_indent, c->number); for_each_object(cpu_numa_node(c), dump_numa_node_num, NULL); - log(TO_CONSOLE, LOG_INFO, "(load %lu)\n", (unsigned long)c->load); + log(TO_ALL, LOG_INFO, "(load %lu)\n", (unsigned long)c->load); if (c->interrupts) for_each_irq(c->interrupts, dump_irq, (void *)18); } @@ -424,10 +424,10 @@ static void dump_cache_domain(struct topo_obj *d, void *data) { char *buffer = data; cpumask_scnprintf(buffer, 4095, d->mask); - log(TO_CONSOLE, LOG_INFO, "%s%sCache domain %i: numa_node is ", + log(TO_ALL, LOG_INFO, "%s%sCache domain %i: numa_node is ", log_indent, log_indent, d->number); for_each_object(d->numa_nodes, dump_numa_node_num, NULL); - log(TO_CONSOLE, LOG_INFO, "cpu mask is %s (load %lu) \n", buffer, + log(TO_ALL, LOG_INFO, "cpu mask is %s (load %lu) \n", buffer, (unsigned long)d->load); if (d->children) for_each_object(d->children, dump_balance_obj, NULL); @@ -439,9 +439,9 @@ static void dump_package(struct topo_obj *d, void *data) { char *buffer = data; cpumask_scnprintf(buffer, 4096, d->mask); - log(TO_CONSOLE, LOG_INFO, "Package %i: numa_node ", d->number); + log(TO_ALL, LOG_INFO, "Package %i: numa_node ", d->number); for_each_object(d->numa_nodes, dump_numa_node_num, NULL); - log(TO_CONSOLE, LOG_INFO, "cpu mask is %s (load %lu)\n", + log(TO_ALL, LOG_INFO, "cpu mask is %s (load %lu)\n", buffer, (unsigned long)d->load); if (d->children) for_each_object(d->children, dump_cache_domain, buffer); diff --git a/irqbalance.c b/irqbalance.c index ecc3eca..450a1ff 100644 --- a/irqbalance.c +++ b/irqbalance.c @@ -266,6 +266,15 @@ gboolean force_rescan(gpointer data __attribute__((unused))) return TRUE; } +static int check_debug() +{ + int ret = 0; + + process_one_line("/etc/sysconfig/irqbalance_debug", get_int, &ret); + + return ret; +} + gboolean scan(gpointer data __attribute__((unused))) { log(TO_CONSOLE, LOG_INFO, "\n\n\n-----------------------------------------------------------------------------\n"); @@ -310,7 +319,7 @@ gboolean scan(gpointer data __attribute__((unused))) activate_mappings(); out: - if (debug_mode) + if (debug_mode || check_debug()) dump_tree(); if (one_shot_mode) keep_going = 0; -- 2.23.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2