Skip to content
Permalink
Browse files
8253421: Initialize JFR trace-IDs with zero
Backport-of: 0c287de4f61f6f4780c9dad6ed45876c9eaa55f8
  • Loading branch information
Ekaterina Vergizova committed Nov 1, 2021
1 parent 8719fc4 commit b056995e280dc164f92ac3df9daf0fc1f58d4715
Showing 1 changed file with 4 additions and 4 deletions.
@@ -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;
}

@@ -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;
}

1 comment on commit b056995

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on b056995 Nov 1, 2021

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.