Skip to content
Permalink
Browse files
8253421: Initialize JFR trace-IDs with zero
Reviewed-by: mgronlun, egahlin
  • Loading branch information
rkennke committed Sep 22, 2020
1 parent aa38624 commit 0c287de4f61f6f4780c9dad6ed45876c9eaa55f8
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 0c287de

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 0c287de Sep 22, 2020

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.