Bug 8545

Summary: "cat /proc/acpi/debug_level" truncated
Product: ACPI Reporter: Márton Németh (nm127)
Component: OtherAssignee: Zhang Rui (rui.zhang)
Status: REJECTED DUPLICATE    
Severity: normal    
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.22-rc3 Subsystem:
Regression: --- Bisected commit-id:
Attachments: strace output when cat to stdout
strace output when cat to file

Description Márton Németh 2007-05-28 02:56:29 UTC
Most recent kernel where this bug did *NOT* occur:
Distribution: Debian
Hardware Environment: Clevo model D4J, product code D410J
Software Environment:
Problem Description:

The "cat /proc/acpi/debug_level" command result in a truncated output when
executing from an xterm window. When the same command is redirected to file, the
output is not truncated.

The strace analysis shows that the "cat" command executes a system read with a
buffer size of 1024, then repeats with a second read() to fetch the remaining
part of the output. The remaining part is not returned by read() in this case.

If the output of "cat" is redirected to file, it will use a buffer sized 4096
bytes, so the full output is catched with one read() call.

Steps to reproduce:

in xterm window: cat /proc/acpi/debug_level

cat /proc/acpi/debug_level >to_file.txt
Comment 1 Márton Németh 2007-05-28 02:57:53 UTC
Created attachment 11605 [details]
strace output when cat to stdout
Comment 2 Márton Németh 2007-05-28 02:58:27 UTC
Created attachment 11606 [details]
strace output when cat to file
Comment 3 Shaohua 2007-05-28 18:35:33 UTC
change to seqfile interface should fix the issue.
Comment 4 Zhang Rui 2007-05-28 23:21:57 UTC
That's true.
But the sysfs I/F for ACPI debug is available now, 
i.e. /sys/modules/acpi/parameters/debug_level and debug_layer.
As the proc interface of ACPI is going to be removed, we won't fix it. :)

*** This bug has been marked as a duplicate of 5076 ***