Re: [Lldb-commits] [PATCH] D16858: Add verbose logging support to gdb-remote tests

2016-02-05 Thread Todd Fiala via lldb-commits
:-)  Okay.  I'll attack that problem when I get ambitious and need a break
from something else.

On Fri, Feb 5, 2016 at 1:53 AM, Pavel Labath  wrote:

> On 5 February 2016 at 03:13, Todd Fiala  wrote:
> > True.
> >
> > Maybe I'll wait until then.
>
> Just don't hold your breath for too long. What I said is what I would
> _like_ to do, but currently I don't see myself having enough time to
> do that. If you want to do something sooner, then by all means, go
> ahead. Maybe the easiest solution would be to put the decorator on
> every test, as making it work on classes looks like a non-trivial job.
>
> pl
>



-- 
-Todd
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16858: Add verbose logging support to gdb-remote tests

2016-02-05 Thread Pavel Labath via lldb-commits
On 5 February 2016 at 03:13, Todd Fiala  wrote:
> True.
>
> Maybe I'll wait until then.

Just don't hold your breath for too long. What I said is what I would
_like_ to do, but currently I don't see myself having enough time to
do that. If you want to do something sooner, then by all means, go
ahead. Maybe the easiest solution would be to put the decorator on
every test, as making it work on classes looks like a non-trivial job.

pl
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16858: Add verbose logging support to gdb-remote tests

2016-02-04 Thread Todd Fiala via lldb-commits
tfiala added a comment.

In http://reviews.llvm.org/D16858#343895, @labath wrote:

> In http://reviews.llvm.org/D16858#343140, @tfiala wrote:
>
> > BTW I was planning on re-organizing the lldb-server/debugserver tests 
> > sometime in the near future to break them into many different directories 
> > and pull off the dsym/dwarf/dwo changes for the many tests where that 
> > doesn't matter.
>
>
> I think that basically none of these tests rely on debug info, and we can 
> remove the debug info duplication entirely. Unfortunately, the only way right 
> now is to annotate each function with `@no_debug_info_test`, so I have been 
> waiting until I get a chance to make that decorator work on classes.
>
> That should cut the running time in half, so then you may not even need to 
> split stuff out more...


True.

Maybe I'll wait until then.  If/when I get to writing more tests in that area, 
I may reorganize just because it is currently a massive hunk of tests in one 
file, but if you're going to get rid of the alternatives with a class-level 
decorator, that definitely will remove the main piece I cared about (namely, 
the time).


Repository:
  rL LLVM

http://reviews.llvm.org/D16858



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16858: Add verbose logging support to gdb-remote tests

2016-02-04 Thread Pavel Labath via lldb-commits
labath added a comment.

In http://reviews.llvm.org/D16858#343140, @tfiala wrote:

> BTW I was planning on re-organizing the lldb-server/debugserver tests 
> sometime in the near future to break them into many different directories and 
> pull off the dsym/dwarf/dwo changes for the many tests where that doesn't 
> matter.


I think that basically none of these tests rely on debug info, and we can 
remove the debug info duplication entirely. Unfortunately, the only way right 
now is to annotate each function with `@no_debug_info_test`, so I have been 
waiting until I get a chance to make that decorator work on classes.

That should cut the running time in half, so then you may not even need to 
split stuff out more...


Repository:
  rL LLVM

http://reviews.llvm.org/D16858



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16858: Add verbose logging support to gdb-remote tests

2016-02-04 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL259774: Add verbose logging support to gdb-remote tests 
(authored by labath).

Changed prior to commit:
  http://reviews.llvm.org/D16858?vs=46795&id=46884#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D16858

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py

Index: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -30,9 +30,6 @@
 
 _GDBREMOTE_KILL_PACKET = "$k#6b"
 
-_LOGGING_LEVEL = logging.WARNING
-# _LOGGING_LEVEL = logging.DEBUG
-
 # Start the inferior separately, attach to the inferior on the stub 
command line.
 _STARTUP_ATTACH = "attach"
 # Start the inferior separately, start the stub without attaching, allow 
the test to attach to the inferior however it wants (e.g. $vAttach;pid).
@@ -48,12 +45,42 @@
 TARGET_EXC_SOFTWARE= 0x95
 TARGET_EXC_BREAKPOINT  = 0x96
 
+_verbose_log_handler = None
+_log_formatter = logging.Formatter(fmt='%(asctime)-15s %(levelname)-8s 
%(message)s')
+
+def setUpBaseLogging(self):
+self.logger = logging.getLogger(__name__)
+
+if len(self.logger.handlers) > 0:
+return # We have set up this handler already
+
+self.logger.propagate = False
+self.logger.setLevel(logging.DEBUG)
+
+# log all warnings to stderr
+handler = logging.StreamHandler()
+handler.setLevel(logging.WARNING)
+handler.setFormatter(self._log_formatter)
+self.logger.addHandler(handler)
+
+
+def isVerboseLoggingRequested(self):
+# We will report our detailed logs if the user requested that the 
"gdb-remote" channel is
+# logged.
+return any(("gdb-remote" in channel) for channel in 
lldbtest_config.channels)
+
 def setUp(self):
 TestBase.setUp(self)
-FORMAT = '%(asctime)-15s %(levelname)-8s %(message)s'
-logging.basicConfig(format=FORMAT)
-self.logger = logging.getLogger(__name__)
-self.logger.setLevel(self._LOGGING_LEVEL)
+
+self.setUpBaseLogging()
+
+if self.isVerboseLoggingRequested():
+# If requested, full logs go to a log file
+self._verbose_log_handler = logging.FileHandler(self.log_basename 
+ "-host.log")
+self._verbose_log_handler.setFormatter(self._log_formatter)
+self._verbose_log_handler.setLevel(logging.DEBUG)
+self.logger.addHandler(self._verbose_log_handler)
+
 self.test_sequence = GdbRemoteTestSequence(self.logger)
 self.set_inferior_startup_launch()
 self.port = self.get_next_port()
@@ -76,6 +103,11 @@
 else:
 self.stub_hostname = "localhost"
 
+def tearDown(self):
+self.logger.removeHandler(self._verbose_log_handler)
+self._verbose_log_handler = None
+TestBase.tearDown(self)
+
 def get_next_port(self):
 return 12000 + random.randint(0,3999)
 


Index: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -30,9 +30,6 @@
 
 _GDBREMOTE_KILL_PACKET = "$k#6b"
 
-_LOGGING_LEVEL = logging.WARNING
-# _LOGGING_LEVEL = logging.DEBUG
-
 # Start the inferior separately, attach to the inferior on the stub command line.
 _STARTUP_ATTACH = "attach"
 # Start the inferior separately, start the stub without attaching, allow the test to attach to the inferior however it wants (e.g. $vAttach;pid).
@@ -48,12 +45,42 @@
 TARGET_EXC_SOFTWARE= 0x95
 TARGET_EXC_BREAKPOINT  = 0x96
 
+_verbose_log_handler = None
+_log_formatter = logging.Formatter(fmt='%(asctime)-15s %(levelname)-8s %(message)s')
+
+def setUpBaseLogging(self):
+self.logger = logging.getLogger(__name__)
+
+if len(self.logger.handlers) > 0:
+return # We have set up this handler already
+
+self.logger.propagate = False
+self.logger.setLevel(logging.DEBUG)
+
+# log all warnings to stderr
+handler = logging.StreamHandler()
+handler.setLevel(logging.WARNING)
+handler.setFormatter(self._log_formatter)
+self.logger.addHandler(handler)
+
+
+def isVerboseLoggingRequested(self):
+# We will report our detailed logs if the user requested that the "gdb-remote" channel is
+# logged.
+return any(("gdb-remote" in channel) for channel in lldbtest_config.channels)
+
  

Re: [Lldb-commits] [PATCH] D16858: Add verbose logging support to gdb-remote tests

2016-02-03 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.
This revision is now accepted and ready to land.

LGTM.

BTW I was planning on re-organizing the lldb-server/debugserver tests sometime 
in the near future to break them into many different directories and pull off 
the dsym/dwarf/dwo changes for the many tests where that doesn't matter.  It's 
causing more tests to run and is less concurrent than it could be with our test 
runner.  I'll shoot out a note when that time shows up.  (It may still be a 
while, feel free to tackle if you want to get there sooner.)


http://reviews.llvm.org/D16858



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D16858: Add verbose logging support to gdb-remote tests

2016-02-03 Thread Pavel Labath via lldb-commits
labath created this revision.
labath added reviewers: tfiala, tberghammer.
labath added a subscriber: lldb-commits.

gdb-remote tests are not able to use the same logging mechanisms as the rest of 
our tests, and
currently we get no host logs from them, even though the tests themselves have 
logging
capability. This commit changes that. When user specifies that he would like to 
log the
gdb-remote channel (--channel gdb-remote argument to dotest.py), we write 
detailed logs to the
-host.log file, just like we would in the case of regular tests. If 
this argument is not
specified, we only log the serious messages to stderr, which matches the 
existing behaviour.

http://reviews.llvm.org/D16858

Files:
  packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py

Index: packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
===
--- packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -30,9 +30,6 @@
 
 _GDBREMOTE_KILL_PACKET = "$k#6b"
 
-_LOGGING_LEVEL = logging.WARNING
-# _LOGGING_LEVEL = logging.DEBUG
-
 # Start the inferior separately, attach to the inferior on the stub 
command line.
 _STARTUP_ATTACH = "attach"
 # Start the inferior separately, start the stub without attaching, allow 
the test to attach to the inferior however it wants (e.g. $vAttach;pid).
@@ -48,12 +45,42 @@
 TARGET_EXC_SOFTWARE= 0x95
 TARGET_EXC_BREAKPOINT  = 0x96
 
+_verbose_log_handler = None
+_log_formatter = logging.Formatter(fmt='%(asctime)-15s %(levelname)-8s 
%(message)s')
+
+def setUpBaseLogging(self):
+self.logger = logging.getLogger(__name__)
+
+if len(self.logger.handlers) > 0:
+return # We have set up this handler already
+
+self.logger.propagate = False
+self.logger.setLevel(logging.DEBUG)
+
+# log all warnings to stderr
+handler = logging.StreamHandler()
+handler.setLevel(logging.WARNING)
+handler.setFormatter(self._log_formatter)
+self.logger.addHandler(handler)
+
+
+def isVerboseLoggingRequested(self):
+# We will report our detailed logs if the user requested that the 
"gdb-remote" channel is
+# logged.
+return any(("gdb-remote" in channel) for channel in 
lldbtest_config.channels)
+
 def setUp(self):
 TestBase.setUp(self)
-FORMAT = '%(asctime)-15s %(levelname)-8s %(message)s'
-logging.basicConfig(format=FORMAT)
-self.logger = logging.getLogger(__name__)
-self.logger.setLevel(self._LOGGING_LEVEL)
+
+self.setUpBaseLogging()
+
+if self.isVerboseLoggingRequested():
+# If requested, full logs go to a log file
+self._verbose_log_handler = logging.FileHandler(self.log_basename 
+ "-host.log")
+self._verbose_log_handler.setFormatter(self._log_formatter)
+self._verbose_log_handler.setLevel(logging.DEBUG)
+self.logger.addHandler(self._verbose_log_handler)
+
 self.test_sequence = GdbRemoteTestSequence(self.logger)
 self.set_inferior_startup_launch()
 self.port = self.get_next_port()
@@ -76,6 +103,11 @@
 else:
 self.stub_hostname = "localhost"
 
+def tearDown(self):
+self.logger.removeHandler(self._verbose_log_handler)
+self._verbose_log_handler = None
+TestBase.tearDown(self)
+
 def get_next_port(self):
 return 12000 + random.randint(0,3999)
 


Index: packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
===
--- packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -30,9 +30,6 @@
 
 _GDBREMOTE_KILL_PACKET = "$k#6b"
 
-_LOGGING_LEVEL = logging.WARNING
-# _LOGGING_LEVEL = logging.DEBUG
-
 # Start the inferior separately, attach to the inferior on the stub command line.
 _STARTUP_ATTACH = "attach"
 # Start the inferior separately, start the stub without attaching, allow the test to attach to the inferior however it wants (e.g. $vAttach;pid).
@@ -48,12 +45,42 @@
 TARGET_EXC_SOFTWARE= 0x95
 TARGET_EXC_BREAKPOINT  = 0x96
 
+_verbose_log_handler = None
+_log_formatter = logging.Formatter(fmt='%(asctime)-15s %(levelname)-8s %(message)s')
+
+def setUpBaseLogging(self):
+self.logger = logging.getLogger(__name__)
+
+if len(self.logger.handlers) > 0:
+return # We have set up this handler already
+
+self.logger.propagate = False
+self.logger.setLevel(logging.DEBUG)
+
+# log all warnings to stderr
+handler = logging.StreamHandler()
+handler.setLevel(logging.WARNING)
+handler.setFormatter(self