Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
8298379: JFR: Some UNTIMED events only sets endTime
Browse files Browse the repository at this point in the history
Reviewed-by: ehelin, egahlin
  • Loading branch information
Markus Grönlund committed Dec 8, 2022
1 parent ea108f5 commit c084431
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/hotspot/share/gc/shared/gcTraceSend.cpp
Expand Up @@ -389,6 +389,7 @@ void GCLockerTracer::report_gc_locker() {
EventGCLocker event(UNTIMED);
if (event.should_commit()) {
event.set_starttime(_needs_gc_start_timestamp);
event.set_endtime(_needs_gc_start_timestamp);
event.set_lockCount(_jni_lock_count);
event.set_stallCount(_stall_count);
event.commit();
Expand Down
5 changes: 3 additions & 2 deletions src/hotspot/share/gc/shared/objectCountEventSender.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2022, 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
Expand Down Expand Up @@ -54,11 +54,12 @@ template <typename T>
void ObjectCountEventSender::send_event_if_enabled(Klass* klass, jlong count, julong size, const Ticks& timestamp) {
T event(UNTIMED);
if (event.should_commit()) {
event.set_starttime(timestamp);
event.set_endtime(timestamp);
event.set_gcId(GCId::current());
event.set_objectClass(klass);
event.set_count(count);
event.set_totalSize(size);
event.set_endtime(timestamp);
event.commit();
}
}
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2022, 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
Expand Down Expand Up @@ -42,6 +42,7 @@ static void send_event(const FinalizerEntry* fe, const InstanceKlass* ik, const
const char* const url = fe != nullptr ? fe->codesource() : nullptr;
const traceid url_symbol_id = url != NULL ? JfrSymbolTable::add(url) : 0;
EventFinalizerStatistics event(UNTIMED);
event.set_starttime(timestamp);
event.set_endtime(timestamp);
event.set_finalizableClass(ik);
event.set_codeSource(url_symbol_id);
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/jfr/periodic/jfrModuleEvent.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2022, 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
Expand Down Expand Up @@ -60,6 +60,7 @@ class ModuleExportClosure : public ModuleEventCallbackClosure {

static void write_module_dependency_event(const void* from_module, const ModuleEntry* to_module) {
EventModuleRequire event(UNTIMED);
event.set_starttime(invocation_time);
event.set_endtime(invocation_time);
event.set_source((const ModuleEntry* const)from_module);
event.set_requiredModule(to_module);
Expand All @@ -68,6 +69,7 @@ static void write_module_dependency_event(const void* from_module, const ModuleE

static void write_module_export_event(const void* package, const ModuleEntry* qualified_export) {
EventModuleExport event(UNTIMED);
event.set_starttime(invocation_time);
event.set_endtime(invocation_time);
event.set_exportedPackage((const PackageEntry*)package);
event.set_targetModule(qualified_export);
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/jfr/periodic/jfrOSInterface.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2022, 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
Expand Down Expand Up @@ -292,6 +292,7 @@ int JfrOSInterface::generate_initial_environment_variable_events() {
strncpy(key, variable, key_length);
key[key_length] = '\0';
EventInitialEnvironmentVariable event(UNTIMED);
event.set_starttime(time_stamp);
event.set_endtime(time_stamp);
event.set_key(key);
event.set_value(value);
Expand Down
3 changes: 3 additions & 0 deletions src/hotspot/share/jfr/periodic/jfrPeriodic.cpp
Expand Up @@ -151,6 +151,7 @@ static int _native_library_callback(const char* name, address base, address top,
event.set_name(name);
event.set_baseAddress((u8)base);
event.set_topAddress((u8)top);
event.set_starttime(*(JfrTicks*)param);
event.set_endtime(*(JfrTicks*) param);
event.commit();
return 0;
Expand Down Expand Up @@ -425,6 +426,7 @@ TRACE_REQUEST_FUNC(InitialSystemProperty) {
EventInitialSystemProperty event(UNTIMED);
event.set_key(p->key());
event.set_value(p->value());
event.set_starttime(time_stamp);
event.set_endtime(time_stamp);
event.commit();
}
Expand All @@ -451,6 +453,7 @@ TRACE_REQUEST_FUNC(ThreadAllocationStatistics) {
EventThreadAllocationStatistics event(UNTIMED);
event.set_allocated(allocated.at(i));
event.set_thread(thread_ids.at(i));
event.set_starttime(time_stamp);
event.set_endtime(time_stamp);
event.commit();
}
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.cpp
Expand Up @@ -120,6 +120,7 @@ void JfrThreadCPULoadEvent::send_events() {
EventThreadCPULoad event(UNTIMED);
if (JfrThreadCPULoadEvent::update_event(event, jt, cur_wallclock_time, processor_count)) {
event.set_starttime(event_time);
event.set_endtime(event_time);
if (jt != periodic_thread) {
// Commit reads the thread id from this thread's trace data, so put it there temporarily
JfrThreadLocal::impersonate(periodic_thread, JFR_JVM_THREAD_ID(jt));
Expand Down

0 comments on commit c084431

Please sign in to comment.