|
1 | 1 | /*
|
2 |
| - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
@@ -220,6 +220,12 @@ class Events : AllStatic {
|
220 | 220 | // A log for generic messages that aren't well categorized.
|
221 | 221 | static StringEventLog* _messages;
|
222 | 222 |
|
| 223 | + // A log for memory protection related messages |
| 224 | + static StringEventLog* _memprotect_messages; |
| 225 | + |
| 226 | + // A log for nmethod flush operations |
| 227 | + static StringEventLog* _nmethod_flush_messages; |
| 228 | + |
223 | 229 | // A log for VM Operations
|
224 | 230 | static StringEventLog* _vm_operations;
|
225 | 231 |
|
@@ -259,6 +265,10 @@ class Events : AllStatic {
|
259 | 265 | // Logs a generic message with timestamp and format as printf.
|
260 | 266 | static void log(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
|
261 | 267 |
|
| 268 | + static void log_memprotect(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3); |
| 269 | + |
| 270 | + static void log_nmethod_flush(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3); |
| 271 | + |
262 | 272 | static void log_vm_operation(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
|
263 | 273 |
|
264 | 274 | static void log_zgc_phase_switch(const char* format, ...) ATTRIBUTE_PRINTF(1, 2);
|
@@ -290,6 +300,24 @@ inline void Events::log(Thread* thread, const char* format, ...) {
|
290 | 300 | }
|
291 | 301 | }
|
292 | 302 |
|
| 303 | +inline void Events::log_memprotect(Thread* thread, const char* format, ...) { |
| 304 | + if (LogEvents && _memprotect_messages != nullptr) { |
| 305 | + va_list ap; |
| 306 | + va_start(ap, format); |
| 307 | + _memprotect_messages->logv(thread, format, ap); |
| 308 | + va_end(ap); |
| 309 | + } |
| 310 | +} |
| 311 | + |
| 312 | +inline void Events::log_nmethod_flush(Thread* thread, const char* format, ...) { |
| 313 | + if (LogEvents && _nmethod_flush_messages != nullptr) { |
| 314 | + va_list ap; |
| 315 | + va_start(ap, format); |
| 316 | + _nmethod_flush_messages->logv(thread, format, ap); |
| 317 | + va_end(ap); |
| 318 | + } |
| 319 | +} |
| 320 | + |
293 | 321 | inline void Events::log_vm_operation(Thread* thread, const char* format, ...) {
|
294 | 322 | if (LogEvents && _vm_operations != nullptr) {
|
295 | 323 | va_list ap;
|
|
0 commit comments