changeset 10867:78eaba1e0d24

8153731: Increase max tag combinations for UL expression (config) Reviewed-by: stefank, mlarsson
author rehn
date Fri, 08 Apr 2016 15:36:34 +0200
parents 5469b15d97f4
children dc71732b59d6
files src/share/vm/logging/log.cpp src/share/vm/logging/logTagLevelExpression.hpp src/share/vm/logging/logTagSet.hpp src/share/vm/utilities/internalVMTests.cpp
diffstat 4 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/logging/log.cpp	Tue Apr 12 07:17:44 2016 +0200
+++ b/src/share/vm/logging/log.cpp	Fri Apr 08 15:36:34 2016 +0200
@@ -32,6 +32,8 @@
 #include "logging/log.hpp"
 #include "logging/logConfiguration.hpp"
 #include "logging/logOutput.hpp"
+#include "logging/logTagLevelExpression.hpp"
+#include "logging/logTagSet.hpp"
 #include "logging/logStream.inline.hpp"
 #include "memory/resourceArea.hpp"
 
@@ -44,6 +46,13 @@
 #define assert_char_not_in(c, s) \
   assert(strchr(s, c) == NULL, "Expected '%s' to *not* contain character '%c'", s, c)
 
+void Test_log_tag_combinations_limit() {
+  assert(LogTagLevelExpression::MaxCombinations > LogTagSet::ntagsets(),
+      "Combination limit (" SIZE_FORMAT ") not sufficient "
+      "for configuring all available tag sets (" SIZE_FORMAT ")",
+      LogTagLevelExpression::MaxCombinations, LogTagSet::ntagsets());
+}
+
 class TestLogFile {
  private:
   char file_name[256];
--- a/src/share/vm/logging/logTagLevelExpression.hpp	Tue Apr 12 07:17:44 2016 +0200
+++ b/src/share/vm/logging/logTagLevelExpression.hpp	Fri Apr 08 15:36:34 2016 +0200
@@ -36,9 +36,12 @@
 // Class used to temporary encode a 'what'-expression during log configuration.
 // Consists of a combination of tags and levels, e.g. "tag1+tag2=level1,tag3*=level2".
 class LogTagLevelExpression : public StackObj {
+ public:
+  static const size_t MaxCombinations = 256;
+
+ private:
   friend void LogConfiguration::configure_stdout(LogLevelType, bool, ...);
- private:
-  static const size_t MaxCombinations = 32;
+
   static const char* DefaultExpressionString;
 
   size_t        _ntags, _ncombinations;
--- a/src/share/vm/logging/logTagSet.hpp	Tue Apr 12 07:17:44 2016 +0200
+++ b/src/share/vm/logging/logTagSet.hpp	Fri Apr 08 15:36:34 2016 +0200
@@ -64,6 +64,10 @@
     return _list;
   }
 
+  static size_t ntagsets() {
+    return _ntagsets;
+  }
+
   LogTagSet* next() {
     return _next;
   }
--- a/src/share/vm/utilities/internalVMTests.cpp	Tue Apr 12 07:17:44 2016 +0200
+++ b/src/share/vm/utilities/internalVMTests.cpp	Fri Apr 08 15:36:34 2016 +0200
@@ -67,6 +67,7 @@
   run_unit_test(Test_linked_list);
   run_unit_test(TestChunkedList_test);
   run_unit_test(JSON_test);
+  run_unit_test(Test_log_tag_combinations_limit);
   run_unit_test(Test_logtarget);
   run_unit_test(Test_logstream);
   run_unit_test(Test_loghandle);