mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
8259563: The CPU model name is printed multiple times when using -Xlog:os+cpu
Reviewed-by: dholmes
This commit is contained in:
parent
b040a3d7a9
commit
b8ef2bad52
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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
|
||||||
// Other platforms have less repetitive cpuinfo files
|
// Other platforms have less repetitive cpuinfo files
|
||||||
FILE *fp = fopen("/proc/cpuinfo", "r");
|
FILE *fp = fopen("/proc/cpuinfo", "r");
|
||||||
if (fp) {
|
if (fp) {
|
||||||
|
bool model_name_printed = false;
|
||||||
while (!feof(fp)) {
|
while (!feof(fp)) {
|
||||||
if (fgets(buf, buflen, fp)) {
|
if (fgets(buf, buflen, fp)) {
|
||||||
// Assume model name comes before flags
|
// Assume model name comes before flags
|
||||||
bool model_name_printed = false;
|
|
||||||
if (strstr(buf, "model name") != NULL) {
|
if (strstr(buf, "model name") != NULL) {
|
||||||
if (!model_name_printed) {
|
if (!model_name_printed) {
|
||||||
st->print_raw("CPU Model and flags from /proc/cpuinfo:\n");
|
st->print_raw("CPU Model and flags from /proc/cpuinfo:\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue