From: Subrata Modak <subrata@linux.vnet.ibm.com>
To: LTP List Members <ltp-list@lists.sf.net>
Cc: Mike Frysinger <vapier@gentoo.org>
Subject: [LTP] [PATCH v2] Remove files which does not have a dmesg entry
Date: Thu, 01 Jul 2010 21:04:47 +0530 [thread overview]
Message-ID: <20100701153446.16085.3341.sendpatchset@subratamodak.linux.ibm.com> (raw)
Hi,
The recently introduced option:
-K DMESG_LOG_DIR
Log Kernel messages generated for each test cases inside this directory,
when used will generate huge no. of files inside the DMESG_DIR. Many of
them will be ZERO size as we do not expect KERNEL MESSAGE to be generated
against all the LTP TESTS that we will run. It is better to prune them, and
let only those files exist which will have real entries. The following
patch fixes the same.
Signed-off-by: Subrata Modak <subrata@linux.vnet.ibm.com>,
---
--- ltp/runltp.orig 2010-07-01 20:51:15.000000000 +0530
+++ ltp/runltp 2010-07-01 21:01:07.000000000 +0530
@@ -858,6 +858,26 @@ main()
cd ..
echo "LTP Version: $version_date"
+ # $DMESG_DIR is used to cache messages obtained from dmesg after a test run.
+ # Proactively reap all of the 0-byte files in $DMESG_DIR as they have zero value
+ # and only clutter up the filesystem.
+
+ if [ $ALT_DMESG_OUT -eq 1 ] ; then
+ PREVIOUS_TO_DMESG_DIR=`pwd`
+ cd $DMESG_DIR
+ if [ $? -eq 0 ] ; then
+ find . -size 0 -exec rm {} +
+ else
+ echo "cd to $DMESG_DIR failed: $?"
+ fi
+ cd $PREVIOUS_TO_DMESG_DIR
+ if [ -n "$(ls "$DMESG_DIR")" ] ; then
+ echo "Kernel messages were generated for LTP tests $version_date"
+ else
+ echo "No Kernel messages were generated for LTP tests $version_date"
+ fi
+ fi
+
if [ "$ALT_HTML_OUT" -eq 1 ] ; then #User wants the HTML output to be created, it then needs to be generated
export LTP_VERSION=$version_date
export TEST_START_TIME=$test_start_time
---
Regards--
Subrata
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next reply other threads:[~2010-07-01 15:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-01 15:34 Subrata Modak [this message]
2010-07-01 16:44 ` [LTP] [PATCH v2] Remove files which does not have a dmesg entry Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100701153446.16085.3341.sendpatchset@subratamodak.linux.ibm.com \
--to=subrata@linux.vnet.ibm.com \
--cc=ltp-list@lists.sf.net \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox