Bug 8545 - "cat /proc/acpi/debug_level" truncated
Summary: "cat /proc/acpi/debug_level" truncated
Status: REJECTED DUPLICATE of bug 5076
Alias: None
Product: ACPI
Classification: Unclassified
Component: Other (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Zhang Rui
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-28 02:56 UTC by Márton Németh
Modified: 2007-05-28 23:21 UTC (History)
0 users

See Also:
Kernel Version: 2.6.22-rc3
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
strace output when cat to stdout (2.35 KB, text/plain)
2007-05-28 02:57 UTC, Márton Németh
Details
strace output when cat to file (2.34 KB, text/plain)
2007-05-28 02:58 UTC, Márton Németh
Details

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 ***

Note You need to log in before you can comment on or make changes to this bug.