diff options
author | Kay Sievers <kay@vrfy.org> | 2012-05-08 17:08:23 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2012-05-08 17:08:23 +0200 |
commit | c2a1ad9f26706e320dad4bfc1011b861227be8e2 (patch) | |
tree | 4bee508c388da3577044ab5a023defe56d29e2d1 | |
parent | 3338de888687bc02111231b6e1ebf785a06d51b8 (diff) | |
download | patches-c2a1ad9f26706e320dad4bfc1011b861227be8e2.tar.gz |
add more KERN_CONT
-rw-r--r-- | kern-cont-acpi.patch (renamed from kern-cont.patch) | 50 | ||||
-rw-r--r-- | kern-cont-mm.patch | 29 | ||||
-rw-r--r-- | kern-cont-parport.patch | 78 | ||||
-rw-r--r-- | kmsg-docs.patch | 36 | ||||
-rw-r--r-- | kmsg-fix64bit-division.patch | 36 | ||||
-rw-r--r-- | series | 8 |
6 files changed, 189 insertions, 48 deletions
diff --git a/kern-cont.patch b/kern-cont-acpi.patch index a73576f..3b363cb 100644 --- a/kern-cont.patch +++ b/kern-cont-acpi.patch @@ -1,39 +1,15 @@ From: Kay Sievers <kay@vrfy.org> -Subject: printk(): add KERN_CONT where needed +Subject: acpi: add KERN_CONT where needed -A prototype for record-based instead of a byte-stream buffer revealed -a couple of missing printk(KERN_CONT ...) uses. Subsequent calls produce -one record per printk() call, while all should have ended up in a single -record. +With a record-based printk subsequent calls without KERN_CONT produce one +record per printk() call, while all should have ended up in a single record. -Instead of: - ACPI: (supports S0 S5) - ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11) - hpet0: at MMIO 0xfed00000, IRQs 2 , 8 , 0 - -It prints: - ACPI: (supports S0 - S5 - ) - ACPI: PCI Interrupt Link [LNKA] (IRQs - 5 - *10 - 11 - ) - hpet0: at MMIO 0xfed00000, IRQs - 2 - , 8 - , 0 - -Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Len Brown <lenb@kernel.org> -Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Kay Sievers <kay@vrfy.org> --- drivers/acpi/pci_link.c | 12 ++++++------ drivers/acpi/sleep.c | 8 ++++---- - mm/page_alloc.c | 6 +++--- - 3 files changed, 13 insertions(+), 13 deletions(-) + 2 files changed, 10 insertions(+), 10 deletions(-) --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -99,21 +75,3 @@ Signed-off-by: Kay Sievers <kay@vrfy.org> /* * Register the tts_notifier to reboot notifier list so that the _TTS * object can also be evaluated when the system enters S5. ---- a/mm/page_alloc.c -+++ b/mm/page_alloc.c -@@ -4763,12 +4763,12 @@ void __init free_area_init_nodes(unsigne - for (i = 0; i < MAX_NR_ZONES; i++) { - if (i == ZONE_MOVABLE) - continue; -- printk(" %-8s ", zone_names[i]); -+ printk(KERN_CONT " %-8s ", zone_names[i]); - if (arch_zone_lowest_possible_pfn[i] == - arch_zone_highest_possible_pfn[i]) -- printk("empty\n"); -+ printk(KERN_CONT "empty\n"); - else -- printk("%0#10lx -> %0#10lx\n", -+ printk(KERN_CONT "%0#10lx -> %0#10lx\n", - arch_zone_lowest_possible_pfn[i], - arch_zone_highest_possible_pfn[i]); - } diff --git a/kern-cont-mm.patch b/kern-cont-mm.patch new file mode 100644 index 0000000..ea7fc4e --- /dev/null +++ b/kern-cont-mm.patch @@ -0,0 +1,29 @@ +From: Kay Sievers <kay@vrfy.org> +Subject: mm: add KERN_CONT where needed + +With a record-based printk subsequent calls without KERN_CONT produce one +record per printk() call, while all should have ended up in a single record. + +Signed-off-by: Kay Sievers <kay@vrfy.org> +--- + mm/page_alloc.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -4763,12 +4763,12 @@ void __init free_area_init_nodes(unsigne + for (i = 0; i < MAX_NR_ZONES; i++) { + if (i == ZONE_MOVABLE) + continue; +- printk(" %-8s ", zone_names[i]); ++ printk(KERN_CONT " %-8s ", zone_names[i]); + if (arch_zone_lowest_possible_pfn[i] == + arch_zone_highest_possible_pfn[i]) +- printk("empty\n"); ++ printk(KERN_CONT "empty\n"); + else +- printk("%0#10lx -> %0#10lx\n", ++ printk(KERN_CONT "%0#10lx -> %0#10lx\n", + arch_zone_lowest_possible_pfn[i], + arch_zone_highest_possible_pfn[i]); + } diff --git a/kern-cont-parport.patch b/kern-cont-parport.patch new file mode 100644 index 0000000..8c7b637 --- /dev/null +++ b/kern-cont-parport.patch @@ -0,0 +1,78 @@ +From: Kay Sievers <kay@vrfy.org> +Subject: parport: use KERN_CONT in printk() continuation lines + +On Tue, May 8, 2012 at 10:48 AM, Sasha Levin <levinsasha928@gmail.com> wrote: +> Before: +> [ 10.110626] parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE] +> +> After: +> parport0: PC-style at 0x378 +> , irq 7 +> [ +> PCSPP +> ,TRISTATE +> ] + +Signed-off-by: Kay Sievers <kay@vrfy.org> +--- + drivers/parport/parport_pc.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +--- a/drivers/parport/parport_pc.c ++++ b/drivers/parport/parport_pc.c +@@ -2351,7 +2351,7 @@ struct parport *parport_pc_probe_port(un + + printk(KERN_INFO "%s: PC-style at 0x%lx", p->name, p->base); + if (p->base_hi && priv->ecr) +- printk(" (0x%lx)", p->base_hi); ++ printk(KERN_CONT " (0x%lx)", p->base_hi); + if (p->irq == PARPORT_IRQ_AUTO) { + p->irq = PARPORT_IRQ_NONE; + parport_irq_probe(p); +@@ -2362,7 +2362,7 @@ struct parport *parport_pc_probe_port(un + p->irq = PARPORT_IRQ_NONE; + } + if (p->irq != PARPORT_IRQ_NONE) { +- printk(", irq %d", p->irq); ++ printk(KERN_CONT ", irq %d", p->irq); + priv->ctr_writable |= 0x10; + + if (p->dma == PARPORT_DMA_AUTO) { +@@ -2386,21 +2386,21 @@ struct parport *parport_pc_probe_port(un + /* p->ops->ecp_read_data = parport_pc_ecp_read_block_pio; */ + #endif /* IEEE 1284 support */ + if (p->dma != PARPORT_DMA_NONE) { +- printk(", dma %d", p->dma); ++ printk(KERN_CONT ", dma %d", p->dma); + p->modes |= PARPORT_MODE_DMA; + } else +- printk(", using FIFO"); ++ printk(KERN_CONT ", using FIFO"); + } else + /* We can't use the DMA channel after all. */ + p->dma = PARPORT_DMA_NONE; + #endif /* Allowed to use FIFO/DMA */ + +- printk(" ["); ++ printk(KERN_CONT " ["); + + #define printmode(x) \ + {\ + if (p->modes & PARPORT_MODE_##x) {\ +- printk("%s%s", f ? "," : "", #x);\ ++ printk(KERN_CONT "%s%s", f ? "," : "", #x);\ + f++;\ + } \ + } +@@ -2416,9 +2416,9 @@ struct parport *parport_pc_probe_port(un + } + #undef printmode + #ifndef CONFIG_PARPORT_1284 +- printk("(,...)"); ++ printk(KERN_CONT "(,...)"); + #endif /* CONFIG_PARPORT_1284 */ +- printk("]\n"); ++ printk(KERN_CONT "]\n"); + if (probedirq != PARPORT_IRQ_NONE) + printk(KERN_INFO "%s: irq %d detected\n", p->name, probedirq); + diff --git a/kmsg-docs.patch b/kmsg-docs.patch new file mode 100644 index 0000000..3f93183 --- /dev/null +++ b/kmsg-docs.patch @@ -0,0 +1,36 @@ +From: Kay Sievers <kay@vrfy.org> +Subject: kmsg - add Documentation/ABI/testing/dev-kmsg + +Signed-off-by: Kay Sievers <kay@vrfy.org> +--- + Documentation/ABI/testing/dev-kmsg | 12 ++++++++++++ + Documentation/devices.txt | 3 ++- + 2 files changed, 14 insertions(+), 1 deletion(-) + +--- /dev/null ++++ b/Documentation/ABI/testing/dev-kmsg +@@ -0,0 +1,12 @@ ++What: /dev/kmsg ++Date: Mai 2012 ++KernelVersion: 3.4 ++Contact: Kay Sievers <kay@vrfy.org> ++Description: The /dev/kmsg character device node provides userspace access ++ to the kernel's printk buffer. ++ ++ Userspace can inject messages into the kernel printk buffer by ++ opening the device node and writing a plain text line into it. ++ The line can optionally start with a syslog prefix. ++ ++Users: dmesg(1), userspace kernel log consumers, systemd-journald +--- a/Documentation/devices.txt ++++ b/Documentation/devices.txt +@@ -98,7 +98,8 @@ Your cooperation is appreciated. + 8 = /dev/random Nondeterministic random number gen. + 9 = /dev/urandom Faster, less secure random number gen. + 10 = /dev/aio Asynchronous I/O notification interface +- 11 = /dev/kmsg Writes to this come out as printk's ++ 11 = /dev/kmsg Writes to this come out as printk's, reads ++ export the buffered printk records. + 12 = /dev/oldmem Used by crashdump kernels to access + the memory of the kernel that crashed. + diff --git a/kmsg-fix64bit-division.patch b/kmsg-fix64bit-division.patch new file mode 100644 index 0000000..89b12c7 --- /dev/null +++ b/kmsg-fix64bit-division.patch @@ -0,0 +1,36 @@ +From: Kay Sievers <kay@vrfy.org> +Subject: kmsg: use do_div() to divide 64bit integer + +On Tue, May 8, 2012 at 10:02 AM, Stephen Rothwell <sfr@canb.auug.org.au> wrote: +> kernel/built-in.o: In function `devkmsg_read': +> printk.c:(.text+0x27e8): undefined reference to `__udivdi3' +> Most probably the "msg->ts_nsec / 1000" since +> ts_nsec is a u64 and this is a 32 bit build ... + +Signed-off-by: Kay Sievers <kay@vrfy.org> +--- + kernel/printk.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/kernel/printk.c ++++ b/kernel/printk.c +@@ -407,6 +407,7 @@ static ssize_t devkmsg_read(struct file + { + struct devkmsg_user *user = file->private_data; + struct log *msg; ++ u64 ts_usec; + size_t i; + size_t len; + ssize_t ret; +@@ -441,8 +442,10 @@ static ssize_t devkmsg_read(struct file + } + + msg = log_from_idx(user->idx); ++ ts_usec = msg->ts_nsec; ++ do_div(ts_usec, 1000); + len = sprintf(user->buf, "%u,%llu,%llu;", +- msg->level, user->seq, msg->ts_nsec / 1000); ++ msg->level, user->seq, ts_usec); + + /* escape non-printable characters */ + for (i = 0; i < msg->text_len; i++) { @@ -1,6 +1,10 @@ printk-records.patch printk-devkmsg.patch printk-dev_printk.patch -kern-cont.patch -devpts.patch +kmsg-fix64bit-division.patch +kern-cont-parport.patch +kmsg-docs.patch +kern-conti-acpi.patch +#devpts.patch +kern-cont-mm.patch |