src/share/vm/runtime/sweeper.cpp
Print this page
rev 13113 : 8182651: Add TRACE_ONLY conditional macro to support more fine-grained INCLUDE_TRACE programming
Reviewed-by:
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -36,14 +36,18 @@
#include "runtime/orderAccess.inline.hpp"
#include "runtime/os.hpp"
#include "runtime/sweeper.hpp"
#include "runtime/thread.inline.hpp"
#include "runtime/vm_operations.hpp"
-#include "trace/tracing.hpp"
#include "utilities/events.hpp"
+#include "utilities/macros.hpp"
#include "utilities/ticks.inline.hpp"
#include "utilities/xmlstream.hpp"
+#if INCLUDE_TRACE
+#include "trace/tracing.hpp"
+#endif
+
#ifdef ASSERT
#define SWEEP(nm) record_sweep(nm, __LINE__)
// Sweeper logging code
@@ -483,20 +487,23 @@
_total_flushed_size += freed_memory;
_total_nof_methods_reclaimed += flushed_count;
_total_nof_c2_methods_reclaimed += flushed_c2_count;
_peak_sweep_time = MAX2(_peak_sweep_time, _total_time_this_sweep);
}
+
+#if INCLUDE_TRACE
EventSweepCodeCache event(UNTIMED);
if (event.should_commit()) {
event.set_starttime(sweep_start_counter);
event.set_endtime(sweep_end_counter);
event.set_sweepId(_traversals);
event.set_sweptCount(swept_count);
event.set_flushedCount(flushed_count);
event.set_zombifiedCount(zombified_count);
event.commit();
}
+#endif // INCLUDE_TRACE
#ifdef ASSERT
if(PrintMethodFlushing) {
tty->print_cr("### sweeper: sweep time(" JLONG_FORMAT "): ", sweep_time.value());
}