Skip to content

Commit c084431

Browse files
author
Markus Grönlund
committed
8298379: JFR: Some UNTIMED events only sets endTime
Reviewed-by: ehelin, egahlin
1 parent ea108f5 commit c084431

File tree

7 files changed

+15
-5
lines changed

7 files changed

+15
-5
lines changed

src/hotspot/share/gc/shared/gcTraceSend.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ void GCLockerTracer::report_gc_locker() {
389389
EventGCLocker event(UNTIMED);
390390
if (event.should_commit()) {
391391
event.set_starttime(_needs_gc_start_timestamp);
392+
event.set_endtime(_needs_gc_start_timestamp);
392393
event.set_lockCount(_jni_lock_count);
393394
event.set_stallCount(_stall_count);
394395
event.commit();

src/hotspot/share/gc/shared/objectCountEventSender.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -54,11 +54,12 @@ template <typename T>
5454
void ObjectCountEventSender::send_event_if_enabled(Klass* klass, jlong count, julong size, const Ticks& timestamp) {
5555
T event(UNTIMED);
5656
if (event.should_commit()) {
57+
event.set_starttime(timestamp);
58+
event.set_endtime(timestamp);
5759
event.set_gcId(GCId::current());
5860
event.set_objectClass(klass);
5961
event.set_count(count);
6062
event.set_totalSize(size);
61-
event.set_endtime(timestamp);
6263
event.commit();
6364
}
6465
}

src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@ static void send_event(const FinalizerEntry* fe, const InstanceKlass* ik, const
4242
const char* const url = fe != nullptr ? fe->codesource() : nullptr;
4343
const traceid url_symbol_id = url != NULL ? JfrSymbolTable::add(url) : 0;
4444
EventFinalizerStatistics event(UNTIMED);
45+
event.set_starttime(timestamp);
4546
event.set_endtime(timestamp);
4647
event.set_finalizableClass(ik);
4748
event.set_codeSource(url_symbol_id);

src/hotspot/share/jfr/periodic/jfrModuleEvent.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -60,6 +60,7 @@ class ModuleExportClosure : public ModuleEventCallbackClosure {
6060

6161
static void write_module_dependency_event(const void* from_module, const ModuleEntry* to_module) {
6262
EventModuleRequire event(UNTIMED);
63+
event.set_starttime(invocation_time);
6364
event.set_endtime(invocation_time);
6465
event.set_source((const ModuleEntry* const)from_module);
6566
event.set_requiredModule(to_module);
@@ -68,6 +69,7 @@ static void write_module_dependency_event(const void* from_module, const ModuleE
6869

6970
static void write_module_export_event(const void* package, const ModuleEntry* qualified_export) {
7071
EventModuleExport event(UNTIMED);
72+
event.set_starttime(invocation_time);
7173
event.set_endtime(invocation_time);
7274
event.set_exportedPackage((const PackageEntry*)package);
7375
event.set_targetModule(qualified_export);

src/hotspot/share/jfr/periodic/jfrOSInterface.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -292,6 +292,7 @@ int JfrOSInterface::generate_initial_environment_variable_events() {
292292
strncpy(key, variable, key_length);
293293
key[key_length] = '\0';
294294
EventInitialEnvironmentVariable event(UNTIMED);
295+
event.set_starttime(time_stamp);
295296
event.set_endtime(time_stamp);
296297
event.set_key(key);
297298
event.set_value(value);

src/hotspot/share/jfr/periodic/jfrPeriodic.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ static int _native_library_callback(const char* name, address base, address top,
151151
event.set_name(name);
152152
event.set_baseAddress((u8)base);
153153
event.set_topAddress((u8)top);
154+
event.set_starttime(*(JfrTicks*)param);
154155
event.set_endtime(*(JfrTicks*) param);
155156
event.commit();
156157
return 0;
@@ -425,6 +426,7 @@ TRACE_REQUEST_FUNC(InitialSystemProperty) {
425426
EventInitialSystemProperty event(UNTIMED);
426427
event.set_key(p->key());
427428
event.set_value(p->value());
429+
event.set_starttime(time_stamp);
428430
event.set_endtime(time_stamp);
429431
event.commit();
430432
}
@@ -451,6 +453,7 @@ TRACE_REQUEST_FUNC(ThreadAllocationStatistics) {
451453
EventThreadAllocationStatistics event(UNTIMED);
452454
event.set_allocated(allocated.at(i));
453455
event.set_thread(thread_ids.at(i));
456+
event.set_starttime(time_stamp);
454457
event.set_endtime(time_stamp);
455458
event.commit();
456459
}

src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ void JfrThreadCPULoadEvent::send_events() {
120120
EventThreadCPULoad event(UNTIMED);
121121
if (JfrThreadCPULoadEvent::update_event(event, jt, cur_wallclock_time, processor_count)) {
122122
event.set_starttime(event_time);
123+
event.set_endtime(event_time);
123124
if (jt != periodic_thread) {
124125
// Commit reads the thread id from this thread's trace data, so put it there temporarily
125126
JfrThreadLocal::impersonate(periodic_thread, JFR_JVM_THREAD_ID(jt));

0 commit comments

Comments
 (0)