Re: [PATCH 1/2] vsp-lib: Capture the kernel log messages in test log files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Niklas,

On Sunday, 20 May 2018 13:47:53 EEST Niklas Söderlund wrote:
> On 2018-05-19 23:34:25 +0300, Laurent Pinchart wrote:
> > It can be useful to capture kernel log messages in test log files for
> > diagnostic purpose. Add a simple mechanism to do so by capturing the
> > full kernel log at the end of the test. The kernel log is cleared first
> > before starting the test to avoid capturing unrelated messages.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> > ---
> > 
> >  scripts/vsp-lib.sh | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh
> > index 0f3992a7827e..e672686a377e 100755
> > --- a/scripts/vsp-lib.sh
> > +++ b/scripts/vsp-lib.sh
> > @@ -1075,6 +1075,9 @@ test_init() {
> > 
> >  	echo "Using device $mdev ($dev)" | ./logger.sh config >> $logfile
> >  	
> >  	vsp_runner=./vsp-runner.sh
> > 
> > +
> > +	# Clear the kernel log
> > +	dmesg -c > /dev/null
> 
> I agree it's useful to capture the kernel log messages during a test, I
> did the same thing in vin-tests. What I did learn was that when
> something do go wrong you kind of want the whole kernel log from boot
> and truncating it could be annoying. Just the other day I got feed up
> with this in vin-tests and found a different way, as it's still fresh in
> my memory maybe it could be useful for you too, or not :-)
> 
>     marker=$(dmesg | tail -n 1 | sed 's/^\[\([^]]*\)\].*/\1/g')
> 
> >  }
> >  
> >  test_start() {
> > 
> > @@ -1086,6 +1089,8 @@ test_complete() {
> > 
> >  	echo "Done: $1" | ./logger.sh >> $logfile
> >  	echo $1 >&2
> > 
> > +	dmesg -c | ./logger.sh kernel >> $logfile
> > +
> 
>         dmesg | sed "1,/$marker/d" | ./logger.sh kernel >> $logfile

That's a good idea. I gave it a try and it worked, I'll send a v2.

> >  	rm -f ${frames_dir}frame-*.bin
> >  	rm -f ${frames_dir}histo-*.bin
> >  	rm -f ${frames_dir}rpf.*.bin

-- 
Regards,

Laurent Pinchart







[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux