* [LTP] [PATCH v2] Remove files which does not have a dmesg entry
@ 2010-07-01 15:34 Subrata Modak
2010-07-01 16:44 ` Mike Frysinger
0 siblings, 1 reply; 2+ messages in thread
From: Subrata Modak @ 2010-07-01 15:34 UTC (permalink / raw)
To: LTP List Members; +Cc: Mike Frysinger
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH v2] Remove files which does not have a dmesg entry
2010-07-01 15:34 [LTP] [PATCH v2] Remove files which does not have a dmesg entry Subrata Modak
@ 2010-07-01 16:44 ` Mike Frysinger
0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2010-07-01 16:44 UTC (permalink / raw)
To: Subrata Modak; +Cc: LTP List Members
[-- Attachment #1.1: Type: Text/Plain, Size: 364 bytes --]
On Thursday, July 01, 2010 11:34:47 Subrata Modak wrote:
> + 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 find "$DMESG_DIR" -size 0 -exec rm {} + ; then
echo "cd to $DMESG_DIR failed: $?"
fi
-mike
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 235 bytes --]
------------------------------------------------------------------------------
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
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-01 16:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-01 15:34 [LTP] [PATCH v2] Remove files which does not have a dmesg entry Subrata Modak
2010-07-01 16:44 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox