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_VM_LOGGING_LOGTAG_HPP
25 #define SHARE_VM_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(defaultmethods) \
35 LOG_TAG(logging) \
36 LOG_TAG(safepoint)
37
38 #define PREFIX_LOG_TAG(T) (LogTag::T)
39
40 // Expand a set of log tags to their prefixed names.
41 // For error detection purposes, the macro passes one more tag than what is supported.
42 // If too many tags are given, a static assert in the log class will fail.
43 #define LOG_TAGS_EXPANDED(T0, T1, T2, T3, T4, T5, ...) PREFIX_LOG_TAG(T0), PREFIX_LOG_TAG(T1), PREFIX_LOG_TAG(T2), \
44 PREFIX_LOG_TAG(T3), PREFIX_LOG_TAG(T4), PREFIX_LOG_TAG(T5)
45 // The EXPAND_VARARGS macro is required for MSVC, or it will resolve the LOG_TAGS_EXPANDED macro incorrectly.
46 #define EXPAND_VARARGS(x) x
47 #define LOG_TAGS(...) EXPAND_VARARGS(LOG_TAGS_EXPANDED(__VA_ARGS__, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG))
48
49 // Log tags are used to classify log messages.
50 // Each log message can be assigned between 1 to LogTag::MaxTags number of tags.
51 // Specifying multiple tags for a log message means that only outputs configured
52 // for those exact tags, or a subset of the tags with a wildcard, will see the logging.
53 // Multiple tags should be comma separated, e.g. log_error(tag1, tag2)("msg").
54 class LogTag : public AllStatic {
55 public:
56 // The maximum number of tags that a single log message can have.
|
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_VM_LOGGING_LOGTAG_HPP
25 #define SHARE_VM_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(alloc) \
35 LOG_TAG(age) \
36 LOG_TAG(barrier) \
37 LOG_TAG(bot) \
38 LOG_TAG(classhisto) \
39 LOG_TAG(comp) \
40 LOG_TAG(compaction) \
41 LOG_TAG(conc) \
42 LOG_TAG(cpu) \
43 LOG_TAG(cset) \
44 LOG_TAG(defaultmethods) \
45 LOG_TAG(ergo) \
46 LOG_TAG(exit) \
47 LOG_TAG(freelist) \
48 LOG_TAG(gc) \
49 LOG_TAG(heap) \
50 LOG_TAG(humongous) \
51 LOG_TAG(init) \
52 LOG_TAG(jni) \
53 LOG_TAG(liveness) \
54 LOG_TAG(logging) \
55 LOG_TAG(marking) \
56 LOG_TAG(metaspace) \
57 LOG_TAG(phases) \
58 LOG_TAG(plab) \
59 LOG_TAG(promotion) \
60 LOG_TAG(ref) \
61 LOG_TAG(refine) \
62 LOG_TAG(region) \
63 LOG_TAG(remset) \
64 LOG_TAG(rt) \
65 LOG_TAG(safepoint) \
66 LOG_TAG(scavenge) \
67 LOG_TAG(scrub) \
68 LOG_TAG(start) \
69 LOG_TAG(svc) \
70 LOG_TAG(stats) \
71 LOG_TAG(stringdedup) \
72 LOG_TAG(survivor) \
73 LOG_TAG(task) \
74 LOG_TAG(tlab) \
75 LOG_TAG(time) \
76 LOG_TAG(verify)
77
78
79
80 #define PREFIX_LOG_TAG(T) (LogTag::T)
81
82 // Expand a set of log tags to their prefixed names.
83 // For error detection purposes, the macro passes one more tag than what is supported.
84 // If too many tags are given, a static assert in the log class will fail.
85 #define LOG_TAGS_EXPANDED(T0, T1, T2, T3, T4, T5, ...) PREFIX_LOG_TAG(T0), PREFIX_LOG_TAG(T1), PREFIX_LOG_TAG(T2), \
86 PREFIX_LOG_TAG(T3), PREFIX_LOG_TAG(T4), PREFIX_LOG_TAG(T5)
87 // The EXPAND_VARARGS macro is required for MSVC, or it will resolve the LOG_TAGS_EXPANDED macro incorrectly.
88 #define EXPAND_VARARGS(x) x
89 #define LOG_TAGS(...) EXPAND_VARARGS(LOG_TAGS_EXPANDED(__VA_ARGS__, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG))
90
91 // Log tags are used to classify log messages.
92 // Each log message can be assigned between 1 to LogTag::MaxTags number of tags.
93 // Specifying multiple tags for a log message means that only outputs configured
94 // for those exact tags, or a subset of the tags with a wildcard, will see the logging.
95 // Multiple tags should be comma separated, e.g. log_error(tag1, tag2)("msg").
96 class LogTag : public AllStatic {
97 public:
98 // The maximum number of tags that a single log message can have.
|