Skip to content

Commit b8ef2ba

Browse files
wangxuesDavid Holmes
authored and
David Holmes
committed
8259563: The CPU model name is printed multiple times when using -Xlog:os+cpu
Reviewed-by: dholmes
1 parent b040a3d commit b8ef2ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hotspot/os/linux/os_linux.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2021, 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
@@ -2464,10 +2464,10 @@ static bool print_model_name_and_flags(outputStream* st, char* buf, size_t bufle
24642464
// Other platforms have less repetitive cpuinfo files
24652465
FILE *fp = fopen("/proc/cpuinfo", "r");
24662466
if (fp) {
2467+
bool model_name_printed = false;
24672468
while (!feof(fp)) {
24682469
if (fgets(buf, buflen, fp)) {
24692470
// Assume model name comes before flags
2470-
bool model_name_printed = false;
24712471
if (strstr(buf, "model name") != NULL) {
24722472
if (!model_name_printed) {
24732473
st->print_raw("CPU Model and flags from /proc/cpuinfo:\n");

0 commit comments

Comments
 (0)