For those that want a immediate fix for the issue, I have written a init script to clear the trace buffer after the pack files are created.
To install this script:
Code:
gksu gedit /etc/init/ureadahead-cleaner.conf
paste the following code:
Code:
# ureadahead-cleaner - free tracing buffer after a ureadahead profile
#
# This is only intended as a hack workaround for bug: 501715
# https://bugs.launchpad.net/ubuntu/+source/ureadahead/+bug/501715
# "Kernel trace buffer should be cleared and size restored after profiling"
#
# For more info, see this thread: http://ubuntuforums.org/showthread.php?t=1363165
description "free tracing buffer"
start on (stopped ureadahead
and stopped ureadahead-other)
task
script
if [ "$(cat /sys/kernel/debug/tracing/buffer_size_kb)" -eq "128000" ]
then
# Wait up to five mins for pack file to be generated
for delayloop in {1..300}
do
[[ -e /var/lib/ureadahead/pack ]] && break
sleep 1
done
# if pack file exists, trace file should no longer be needed.
# reduce the trace buffer
echo 1 > /sys/kernel/debug/tracing/buffer_size_kb
fi
end script
Save, then close gedit.
Now when you reboot, if ureadahead does a trace, it will wait until a pack file is written (I don't know if the wait is really needed, but added it just to be safe.) It will then set the tracebuffer to 1kb from 128Mb
Let me know if it worked for you.
Another solution is to recompile ureadahead, but for some users, this might be a better fix for now.
If you do use this script, make sure you subscribe to the bug report so that when the bug is fixed, you can remove the script.
Bookmarks