7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24 #ifndef SHARE_LOGGING_LOGTAG_HPP
25 #define SHARE_LOGGING_LOGTAG_HPP
26
27 #include "logging/logTag_ext.hpp"
28 #include "memory/allocation.hpp"
29 #include "utilities/globalDefinitions.hpp"
30
31 // List of available logging tags. New tags should be added here.
32 // (The tags 'all', 'disable' and 'help' are special tags that can
33 // not be used in log calls, and should not be listed below.)
34 #define LOG_TAG_LIST \
35 LOG_TAG(add) \
36 LOG_TAG(age) \
37 LOG_TAG(alloc) \
38 LOG_TAG(aot) \
39 LOG_TAG(annotation) \
40 LOG_TAG(arguments) \
41 LOG_TAG(attach) \
42 LOG_TAG(barrier) \
43 LOG_TAG(biasedlocking) \
44 LOG_TAG(blocks) \
45 LOG_TAG(bot) \
46 LOG_TAG(breakpoint) \
47 LOG_TAG(bytecode) \
159 LOG_TAG(system) \
160 LOG_TAG(table) \
161 LOG_TAG(task) \
162 DEBUG_ONLY(LOG_TAG(test)) \
163 LOG_TAG(thread) \
164 LOG_TAG(tlab) \
165 LOG_TAG(time) \
166 LOG_TAG(timer) \
167 LOG_TAG(tracking) \
168 LOG_TAG(update) \
169 LOG_TAG(unload) /* Trace unloading of classes */ \
170 LOG_TAG(unshareable) \
171 LOG_TAG(mirror) \
172 LOG_TAG(verification) \
173 LOG_TAG(verify) \
174 LOG_TAG(vmmutex) \
175 LOG_TAG(vmoperation) \
176 LOG_TAG(vmthread) \
177 LOG_TAG(vtables) \
178 LOG_TAG(vtablestubs) \
179 LOG_TAG(workgang) \
180 LOG_TAG_LIST_EXT
181
182 #define PREFIX_LOG_TAG(T) (LogTag::_##T)
183
184 // Expand a set of log tags to their prefixed names.
185 // For error detection purposes, the macro passes one more tag than what is supported.
186 // If too many tags are given, a static assert in the log class will fail.
187 #define LOG_TAGS_EXPANDED(T0, T1, T2, T3, T4, T5, ...) PREFIX_LOG_TAG(T0), PREFIX_LOG_TAG(T1), PREFIX_LOG_TAG(T2), \
188 PREFIX_LOG_TAG(T3), PREFIX_LOG_TAG(T4), PREFIX_LOG_TAG(T5)
189 // The EXPAND_VARARGS macro is required for MSVC, or it will resolve the LOG_TAGS_EXPANDED macro incorrectly.
190 #define EXPAND_VARARGS(x) x
191 #define LOG_TAGS(...) EXPAND_VARARGS(LOG_TAGS_EXPANDED(__VA_ARGS__, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG))
192
193 // Log tags are used to classify log messages.
194 // Each log message can be assigned between 1 to LogTag::MaxTags number of tags.
195 // Specifying multiple tags for a log message means that only outputs configured
196 // for those exact tags, or a subset of the tags with a wildcard, will see the logging.
197 // Multiple tags should be comma separated, e.g. log_error(tag1, tag2)("msg").
198 class LogTag : public AllStatic {
199 public:
200 // The maximum number of tags that a single log message can have.
|
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24 #ifndef SHARE_LOGGING_LOGTAG_HPP
25 #define SHARE_LOGGING_LOGTAG_HPP
26
27 #include "memory/allocation.hpp"
28 #include "utilities/globalDefinitions.hpp"
29
30 // List of available logging tags. New tags should be added here.
31 // (The tags 'all', 'disable' and 'help' are special tags that can
32 // not be used in log calls, and should not be listed below.)
33 #define LOG_TAG_LIST \
34 LOG_TAG(add) \
35 LOG_TAG(age) \
36 LOG_TAG(alloc) \
37 LOG_TAG(aot) \
38 LOG_TAG(annotation) \
39 LOG_TAG(arguments) \
40 LOG_TAG(attach) \
41 LOG_TAG(barrier) \
42 LOG_TAG(biasedlocking) \
43 LOG_TAG(blocks) \
44 LOG_TAG(bot) \
45 LOG_TAG(breakpoint) \
46 LOG_TAG(bytecode) \
158 LOG_TAG(system) \
159 LOG_TAG(table) \
160 LOG_TAG(task) \
161 DEBUG_ONLY(LOG_TAG(test)) \
162 LOG_TAG(thread) \
163 LOG_TAG(tlab) \
164 LOG_TAG(time) \
165 LOG_TAG(timer) \
166 LOG_TAG(tracking) \
167 LOG_TAG(update) \
168 LOG_TAG(unload) /* Trace unloading of classes */ \
169 LOG_TAG(unshareable) \
170 LOG_TAG(mirror) \
171 LOG_TAG(verification) \
172 LOG_TAG(verify) \
173 LOG_TAG(vmmutex) \
174 LOG_TAG(vmoperation) \
175 LOG_TAG(vmthread) \
176 LOG_TAG(vtables) \
177 LOG_TAG(vtablestubs) \
178 LOG_TAG(workgang)
179
180 #define PREFIX_LOG_TAG(T) (LogTag::_##T)
181
182 // Expand a set of log tags to their prefixed names.
183 // For error detection purposes, the macro passes one more tag than what is supported.
184 // If too many tags are given, a static assert in the log class will fail.
185 #define LOG_TAGS_EXPANDED(T0, T1, T2, T3, T4, T5, ...) PREFIX_LOG_TAG(T0), PREFIX_LOG_TAG(T1), PREFIX_LOG_TAG(T2), \
186 PREFIX_LOG_TAG(T3), PREFIX_LOG_TAG(T4), PREFIX_LOG_TAG(T5)
187 // The EXPAND_VARARGS macro is required for MSVC, or it will resolve the LOG_TAGS_EXPANDED macro incorrectly.
188 #define EXPAND_VARARGS(x) x
189 #define LOG_TAGS(...) EXPAND_VARARGS(LOG_TAGS_EXPANDED(__VA_ARGS__, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG))
190
191 // Log tags are used to classify log messages.
192 // Each log message can be assigned between 1 to LogTag::MaxTags number of tags.
193 // Specifying multiple tags for a log message means that only outputs configured
194 // for those exact tags, or a subset of the tags with a wildcard, will see the logging.
195 // Multiple tags should be comma separated, e.g. log_error(tag1, tag2)("msg").
196 class LogTag : public AllStatic {
197 public:
198 // The maximum number of tags that a single log message can have.
|