Re: [for-next][PATCH 8/8] ktest.pl: Add MAIL_MAX_SIZE to limit the amount of log emailed

2020-07-02 Thread Greg KH
On Thu, Jul 02, 2020 at 08:58:49AM -0400, Steven Rostedt wrote:
> On Thu, 2 Jul 2020 14:34:02 +0200
> Greg KH  wrote:
> 
> > > I can add an option to do that if you want. My full logs end up being a
> > > few hundred megabytes. Perhaps I could add a compress option too.  
> > 
> > It's fine, the default should be good enough for me for now.  If not,
> > I'll just bump the value, or add compression.
> 
> If we compress, it would need to be an attachment. I'm guessing you are
> fine with that. Do you already make it an attachment?

Yes I do, so attachments are fine.

thanks,

greg k-h


Re: [for-next][PATCH 8/8] ktest.pl: Add MAIL_MAX_SIZE to limit the amount of log emailed

2020-07-02 Thread Steven Rostedt
On Thu, 2 Jul 2020 14:34:02 +0200
Greg KH  wrote:

> > I can add an option to do that if you want. My full logs end up being a
> > few hundred megabytes. Perhaps I could add a compress option too.  
> 
> It's fine, the default should be good enough for me for now.  If not,
> I'll just bump the value, or add compression.

If we compress, it would need to be an attachment. I'm guessing you are
fine with that. Do you already make it an attachment?

BTW, my test just failed and for some reason it created a 13162697 byte
log file to include in my email, which failed to send :-p 

Strange that it did that, as I had the max set to 95. Thus, I've
changed this code to be:

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 917810fa4c85..9363a5b27339 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1499,18 +1499,21 @@ sub dodie {
my $log_file;
 
if (defined($opt{"LOG_FILE"})) {
-   my $size = 0;
+   my $whence = 0; # beginning of file
+   my $pos = $test_log_start;
+
if (defined($mail_max_size)) {
my $log_size = tell LOG;
$log_size -= $test_log_start;
if ($log_size > $mail_max_size) {
-   $size = $log_size - $mail_max_size;
+   $whence = 2; # end of file
+   $pos = - $mail_max_size;
}
}
$log_file = "$tmpdir/log";
open (L, "$opt{LOG_FILE}") or die "Can't open $opt{LOG_FILE} to 
read)";
open (O, "> $tmpdir/log") or die "Can't open $tmpdir/log\n";
-   seek(L, $test_log_start + $size, 0);
+   seek(L, $pos, $whence);
while () {
print O;
}

Let's see if this now limits it :-/

-- Steve


Re: [for-next][PATCH 8/8] ktest.pl: Add MAIL_MAX_SIZE to limit the amount of log emailed

2020-07-02 Thread Greg KH
On Thu, Jul 02, 2020 at 08:19:49AM -0400, Steven Rostedt wrote:
> On Thu, 2 Jul 2020 09:41:03 +0200
> Greg KH  wrote:
> 
> > On Wed, Jul 01, 2020 at 07:17:25PM -0400, Steven Rostedt wrote:
> > > From: "Steven Rostedt (VMware)" 
> > > 
> > > Add the ktest config option MAIL_MAX_SIZE that will limit the size of the
> > > log file that is placed into the email on failure.
> > > 
> > > Cc: Greg KH 
> > > Signed-off-by: Steven Rostedt (VMware) 
> > > ---
> > >  tools/testing/ktest/ktest.pl| 12 +++-
> > >  tools/testing/ktest/sample.conf | 13 +
> > >  2 files changed, 24 insertions(+), 1 deletion(-)  
> > 
> > Interesting, but I like full log files for my reports :)
> 
> I can add an option to do that if you want. My full logs end up being a
> few hundred megabytes. Perhaps I could add a compress option too.

It's fine, the default should be good enough for me for now.  If not,
I'll just bump the value, or add compression.

thanks,

greg k-h-


Re: [for-next][PATCH 8/8] ktest.pl: Add MAIL_MAX_SIZE to limit the amount of log emailed

2020-07-02 Thread Steven Rostedt
On Thu, 2 Jul 2020 09:41:03 +0200
Greg KH  wrote:

> On Wed, Jul 01, 2020 at 07:17:25PM -0400, Steven Rostedt wrote:
> > From: "Steven Rostedt (VMware)" 
> > 
> > Add the ktest config option MAIL_MAX_SIZE that will limit the size of the
> > log file that is placed into the email on failure.
> > 
> > Cc: Greg KH 
> > Signed-off-by: Steven Rostedt (VMware) 
> > ---
> >  tools/testing/ktest/ktest.pl| 12 +++-
> >  tools/testing/ktest/sample.conf | 13 +
> >  2 files changed, 24 insertions(+), 1 deletion(-)  
> 
> Interesting, but I like full log files for my reports :)

I can add an option to do that if you want. My full logs end up being a
few hundred megabytes. Perhaps I could add a compress option too.

> 
> Reviewed-by: Greg Kroah-Hartman 

Thanks!

-- Steve


Re: [for-next][PATCH 8/8] ktest.pl: Add MAIL_MAX_SIZE to limit the amount of log emailed

2020-07-02 Thread Greg KH
On Wed, Jul 01, 2020 at 07:17:25PM -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" 
> 
> Add the ktest config option MAIL_MAX_SIZE that will limit the size of the
> log file that is placed into the email on failure.
> 
> Cc: Greg KH 
> Signed-off-by: Steven Rostedt (VMware) 
> ---
>  tools/testing/ktest/ktest.pl| 12 +++-
>  tools/testing/ktest/sample.conf | 13 +
>  2 files changed, 24 insertions(+), 1 deletion(-)

Interesting, but I like full log files for my reports :)

Reviewed-by: Greg Kroah-Hartman