Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
/ jdk15u-dev Public archive

Commit

Permalink
8253421: Initialize JFR trace-IDs with zero
Browse files Browse the repository at this point in the history
Backport-of: 0c287de4f61f6f4780c9dad6ed45876c9eaa55f8
  • Loading branch information
Ekaterina Vergizova committed Nov 1, 2021
1 parent 8719fc4 commit b056995
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static traceid atomic_inc(traceid volatile* const dest) {
}

static traceid next_class_id() {
static volatile traceid class_id_counter = LAST_TYPE_ID + 1;
static volatile traceid class_id_counter = LAST_TYPE_ID;
return atomic_inc(&class_id_counter) << TRACE_ID_SHIFT;
}

Expand All @@ -62,17 +62,17 @@ static traceid next_thread_id() {
}

static traceid next_module_id() {
static volatile traceid module_id_counter = 1;
static volatile traceid module_id_counter = 0;
return atomic_inc(&module_id_counter) << TRACE_ID_SHIFT;
}

static traceid next_package_id() {
static volatile traceid package_id_counter = 1;
static volatile traceid package_id_counter = 0;
return atomic_inc(&package_id_counter) << TRACE_ID_SHIFT;
}

static traceid next_class_loader_data_id() {
static volatile traceid cld_id_counter = 1;
static volatile traceid cld_id_counter = 0;
return atomic_inc(&cld_id_counter) << TRACE_ID_SHIFT;
}

Expand Down

1 comment on commit b056995

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.