aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/io_apic.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2009-10-13 16:07:05 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-14 03:17:01 -0400
commit2626eb2b2fd958dc0f683126aa84e93b939699a1 (patch)
treec4f8b6f1e577ab09ea8355e1cd67d0b6e6d72da8 /arch/x86/kernel/apic/io_apic.c
parenta933c61829509eb27083146dda392132baa0969a (diff)
x86, apic: Limit apic dumping, introduce new show_lapic= setup option
In case if a system has a large number of cpus printing apics contents may consume a long time period. We limit such an output by 1 apic by default. But to have an ability to see all apics or some part of them we introduce "show_lapic" setup option which allow us to limit/unlimit the number of APICs being dumped. Example: apic=debug show_lapic=5, or apic=debug show_lapic=all Also move apic_verbosity checking upper that way so helper routines do not need to inspect it at all. Suggested-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Cc: yinghai@kernel.org Cc: macro@linux-mips.org LKML-Reference: <20091013201022.926793122@openvz.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic/io_apic.c')
-rw-r--r--arch/x86/kernel/apic/io_apic.c47
1 files changed, 32 insertions, 15 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index dc69f28489f5..8c718c93d079 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1599,9 +1599,6 @@ __apicdebuginit(void) print_IO_APIC(void)
1599 struct irq_desc *desc; 1599 struct irq_desc *desc;
1600 unsigned int irq; 1600 unsigned int irq;
1601 1601
1602 if (apic_verbosity == APIC_QUIET)
1603 return;
1604
1605 printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); 1602 printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries);
1606 for (i = 0; i < nr_ioapics; i++) 1603 for (i = 0; i < nr_ioapics; i++)
1607 printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n", 1604 printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n",
@@ -1708,9 +1705,6 @@ __apicdebuginit(void) print_APIC_field(int base)
1708{ 1705{
1709 int i; 1706 int i;
1710 1707
1711 if (apic_verbosity == APIC_QUIET)
1712 return;
1713
1714 printk(KERN_DEBUG); 1708 printk(KERN_DEBUG);
1715 1709
1716 for (i = 0; i < 8; i++) 1710 for (i = 0; i < 8; i++)
@@ -1724,9 +1718,6 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
1724 unsigned int i, v, ver, maxlvt; 1718 unsigned int i, v, ver, maxlvt;
1725 u64 icr; 1719 u64 icr;
1726 1720
1727 if (apic_verbosity == APIC_QUIET)
1728 return;
1729
1730 printk(KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n", 1721 printk(KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n",
1731 smp_processor_id(), hard_smp_processor_id()); 1722 smp_processor_id(), hard_smp_processor_id());
1732 v = apic_read(APIC_ID); 1723 v = apic_read(APIC_ID);
@@ -1824,13 +1815,19 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
1824 printk("\n"); 1815 printk("\n");
1825} 1816}
1826 1817
1827__apicdebuginit(void) print_all_local_APICs(void) 1818__apicdebuginit(void) print_local_APICs(int maxcpu)
1828{ 1819{
1829 int cpu; 1820 int cpu;
1830 1821
1822 if (!maxcpu)
1823 return;
1824
1831 preempt_disable(); 1825 preempt_disable();
1832 for_each_online_cpu(cpu) 1826 for_each_online_cpu(cpu) {
1827 if (cpu >= maxcpu)
1828 break;
1833 smp_call_function_single(cpu, print_local_APIC, NULL, 1); 1829 smp_call_function_single(cpu, print_local_APIC, NULL, 1);
1830 }
1834 preempt_enable(); 1831 preempt_enable();
1835} 1832}
1836 1833
@@ -1839,7 +1836,7 @@ __apicdebuginit(void) print_PIC(void)
1839 unsigned int v; 1836 unsigned int v;
1840 unsigned long flags; 1837 unsigned long flags;
1841 1838
1842 if (apic_verbosity == APIC_QUIET || !nr_legacy_irqs) 1839 if (!nr_legacy_irqs)
1843 return; 1840 return;
1844 1841
1845 printk(KERN_DEBUG "\nprinting PIC contents\n"); 1842 printk(KERN_DEBUG "\nprinting PIC contents\n");
@@ -1866,21 +1863,41 @@ __apicdebuginit(void) print_PIC(void)
1866 printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); 1863 printk(KERN_DEBUG "... PIC ELCR: %04x\n", v);
1867} 1864}
1868 1865
1869__apicdebuginit(int) print_all_ICs(void) 1866static int __initdata show_lapic = 1;
1867static __init int setup_show_lapic(char *arg)
1868{
1869 int num = -1;
1870
1871 if (strcmp(arg, "all") == 0) {
1872 show_lapic = CONFIG_NR_CPUS;
1873 } else {
1874 get_option(&arg, &num);
1875 if (num >= 0)
1876 show_lapic = num;
1877 }
1878
1879 return 1;
1880}
1881__setup("show_lapic=", setup_show_lapic);
1882
1883__apicdebuginit(int) print_ICs(void)
1870{ 1884{
1885 if (apic_verbosity == APIC_QUIET)
1886 return 0;
1887
1871 print_PIC(); 1888 print_PIC();
1872 1889
1873 /* don't print out if apic is not there */ 1890 /* don't print out if apic is not there */
1874 if (!cpu_has_apic && !apic_from_smp_config()) 1891 if (!cpu_has_apic && !apic_from_smp_config())
1875 return 0; 1892 return 0;
1876 1893
1877 print_all_local_APICs(); 1894 print_local_APICs(show_lapic);
1878 print_IO_APIC(); 1895 print_IO_APIC();
1879 1896
1880 return 0; 1897 return 0;
1881} 1898}
1882 1899
1883fs_initcall(print_all_ICs); 1900fs_initcall(print_ICs);
1884 1901
1885 1902
1886/* Where if anywhere is the i8259 connect in external int mode */ 1903/* Where if anywhere is the i8259 connect in external int mode */