8153731: Increase max tag combinations for UL expression (config)
Reviewed-by: stefank, mlarsson
--- a/hotspot/src/share/vm/logging/log.cpp Tue Apr 12 07:17:44 2016 +0200
+++ b/hotspot/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/hotspot/src/share/vm/logging/logTagLevelExpression.hpp Tue Apr 12 07:17:44 2016 +0200
+++ b/hotspot/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 {
- friend void LogConfiguration::configure_stdout(LogLevelType, bool, ...);
+ public:
+ static const size_t MaxCombinations = 256;
+
private:
- static const size_t MaxCombinations = 32;
+ friend void LogConfiguration::configure_stdout(LogLevelType, bool, ...);
+
static const char* DefaultExpressionString;
size_t _ntags, _ncombinations;
--- a/hotspot/src/share/vm/logging/logTagSet.hpp Tue Apr 12 07:17:44 2016 +0200
+++ b/hotspot/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/hotspot/src/share/vm/utilities/internalVMTests.cpp Tue Apr 12 07:17:44 2016 +0200
+++ b/hotspot/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);