Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
089bbe09
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
089bbe09
编写于
4月 21, 2020
作者:
C
clanger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8241902: AIX Build broken after integration of JDK-8223147 (JFR Backport)
Reviewed-by: mdoerr, apetushkov
上级
20c19656
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
130 addition
and
57 deletion
+130
-57
make/aix/makefiles/buildtree.make
make/aix/makefiles/buildtree.make
+16
-7
make/aix/makefiles/jfr.make
make/aix/makefiles/jfr.make
+92
-0
make/aix/makefiles/top.make
make/aix/makefiles/top.make
+5
-5
make/aix/makefiles/vm.make
make/aix/makefiles/vm.make
+8
-10
src/os/aix/vm/os_perf_aix.cpp
src/os/aix/vm/os_perf_aix.cpp
+9
-35
未找到文件。
make/aix/makefiles/buildtree.make
浏览文件 @
089bbe09
#
#
# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright
2012, 2013 SAP AG
. All rights reserved.
# Copyright
(c) 2012, 2020 SAP SE
. All rights reserved.
# Copyright 2019 Red Hat, Inc.
# Copyright 2019 Red Hat, Inc.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
#
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
# flags.make - with macro settings
# flags.make - with macro settings
# vm.make - to support making "$(MAKE) -v vm.make" in makefiles
# vm.make - to support making "$(MAKE) -v vm.make" in makefiles
# adlc.make -
# adlc.make -
#
trace.make - generate tracing
event and type definitions
#
jfr.make - generate jfr
event and type definitions
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
# sa.make - generate SA jar file and natives
# sa.make - generate SA jar file and natives
#
#
...
@@ -111,6 +111,10 @@ TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name opto -o -n
...
@@ -111,6 +111,10 @@ TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name opto -o -n
endif
endif
endif
endif
ifeq
($(ENABLE_JFR),false)
ALWAYS_EXCLUDE_DIRS
+=
-o
-name
jfr
endif
# Get things from the platform file.
# Get things from the platform file.
COMPILER
=
$(
shell
sed
-n
's/^compiler[ ]*=[ ]*//p'
$(PLATFORM_FILE)
)
COMPILER
=
$(
shell
sed
-n
's/^compiler[ ]*=[ ]*//p'
$(PLATFORM_FILE)
)
...
@@ -118,7 +122,7 @@ SIMPLE_DIRS = \
...
@@ -118,7 +122,7 @@ SIMPLE_DIRS = \
$(PLATFORM_DIR)
/generated/dependencies
\
$(PLATFORM_DIR)
/generated/dependencies
\
$(PLATFORM_DIR)
/generated/adfiles
\
$(PLATFORM_DIR)
/generated/adfiles
\
$(PLATFORM_DIR)
/generated/jvmtifiles
\
$(PLATFORM_DIR)
/generated/jvmtifiles
\
$(PLATFORM_DIR)
/generated/
trace
files
$(PLATFORM_DIR)
/generated/
jfr
files
TARGETS
=
debug fastdebug optimized product
TARGETS
=
debug fastdebug optimized product
SUBMAKE_DIRS
=
$(
addprefix
$(PLATFORM_DIR)
/,
$(TARGETS)
)
SUBMAKE_DIRS
=
$(
addprefix
$(PLATFORM_DIR)
/,
$(TARGETS)
)
...
@@ -126,7 +130,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
...
@@ -126,7 +130,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
# For dependencies and recursive makes.
# For dependencies and recursive makes.
BUILDTREE_MAKE
=
$(GAMMADIR)
/make/
$(OS_FAMILY)
/makefiles/buildtree.make
BUILDTREE_MAKE
=
$(GAMMADIR)
/make/
$(OS_FAMILY)
/makefiles/buildtree.make
BUILDTREE_TARGETS
=
Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make
trace
.make sa.make
BUILDTREE_TARGETS
=
Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make
jfr
.make sa.make
BUILDTREE_VARS
=
GAMMADIR
=
$(GAMMADIR)
OS_FAMILY
=
$(OS_FAMILY)
\
BUILDTREE_VARS
=
GAMMADIR
=
$(GAMMADIR)
OS_FAMILY
=
$(OS_FAMILY)
\
SRCARCH
=
$(SRCARCH)
BUILDARCH
=
$(BUILDARCH)
LIBARCH
=
$(LIBARCH)
VARIANT
=
$(VARIANT)
SRCARCH
=
$(SRCARCH)
BUILDARCH
=
$(BUILDARCH)
LIBARCH
=
$(LIBARCH)
VARIANT
=
$(VARIANT)
...
@@ -195,6 +199,12 @@ DATA_MODE/ppc64 = 64
...
@@ -195,6 +199,12 @@ DATA_MODE/ppc64 = 64
DATA_MODE
=
$
(
DATA_MODE/
$(BUILDARCH)
)
DATA_MODE
=
$
(
DATA_MODE/
$(BUILDARCH)
)
ifeq
($(ENABLE_JFR), true)
INCLUDE_JFR
=
1
else
INCLUDE_JFR
=
0
endif
flags.make
:
$(BUILDTREE_MAKE) ../shared_dirs.lst
flags.make
:
$(BUILDTREE_MAKE) ../shared_dirs.lst
@
echo
Creating
$@
...
@
echo
Creating
$@
...
$(QUIETLY)
(
\
$(QUIETLY)
(
\
...
@@ -274,8 +284,7 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
...
@@ -274,8 +284,7 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo
&&
\
echo
&&
\
echo
"HOTSPOT_EXTRA_SYSDEFS
\$
$(HOTSPOT_EXTRA_SYSDEFS)
=
$(HOTSPOT_EXTRA_SYSDEFS)
"
&&
\
echo
"HOTSPOT_EXTRA_SYSDEFS
\$
$(HOTSPOT_EXTRA_SYSDEFS)
=
$(HOTSPOT_EXTRA_SYSDEFS)
"
&&
\
echo
"SYSDEFS +=
\$
$(HOTSPOT_EXTRA_SYSDEFS)
"
;
\
echo
"SYSDEFS +=
\$
$(HOTSPOT_EXTRA_SYSDEFS)
"
;
\
[
-n
"
$(INCLUDE_TRACE)
"
]
&&
\
echo
&&
echo
"CFLAGS += -DINCLUDE_JFR=
$(INCLUDE_JFR)
"
;
\
echo
&&
echo
"INCLUDE_TRACE =
$(INCLUDE_TRACE)
"
;
\
echo
;
\
echo
;
\
[
-n
"
$(SPEC)
"
]
&&
\
[
-n
"
$(SPEC)
"
]
&&
\
echo
"include
$(SPEC)
"
;
\
echo
"include
$(SPEC)
"
;
\
...
@@ -344,7 +353,7 @@ jvmti.make: $(BUILDTREE_MAKE)
...
@@ -344,7 +353,7 @@ jvmti.make: $(BUILDTREE_MAKE)
echo
"include
\$
$(GAMMADIR)
/make/
$(OS_FAMILY)
/makefiles/
$
(@F)"
;
\
echo
"include
\$
$(GAMMADIR)
/make/
$(OS_FAMILY)
/makefiles/
$
(@F)"
;
\
)
>
$@
)
>
$@
trace
.make
:
$(BUILDTREE_MAKE)
jfr
.make
:
$(BUILDTREE_MAKE)
@
echo
Creating
$@
...
@
echo
Creating
$@
...
$(QUIETLY)
(
\
$(QUIETLY)
(
\
$(BUILDTREE_COMMENT)
;
\
$(BUILDTREE_COMMENT)
;
\
...
...
make/aix/makefiles/jfr.make
0 → 100644
浏览文件 @
089bbe09
#
# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020 SAP SE. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# This makefile (jfr.make) is included from the jfr.make in the
# build directories.
#
# It knows how to build and run the tools to generate jfr.
include
$(GAMMADIR)/make/linux/makefiles/rules.make
# #########################################################################
# Build tools needed for the Jfr source code generation
TOPDIR
=
$(
shell
echo
`
pwd
`
)
GENERATED
=
$(TOPDIR)
/../generated
JFR_TOOLS_SRCDIR
:=
$(GAMMADIR)
/src/share/vm/jfr
JFR_TOOLS_OUTPUTDIR
:=
$(GENERATED)
/tools/jfr
JFR_OUTPUTDIR
:=
$(GENERATED)
/jfrfiles
JFR_SRCDIR
:=
$(GAMMADIR)
/src/share/vm/jfr/metadata
METADATA_XML
?=
$(JFR_SRCDIR)
/metadata.xml
METADATA_XSD
?=
$(JFR_SRCDIR)
/metadata.xsd
# Changing these will trigger a rebuild of generated jfr files.
JFR_DEPS
+=
\
$(METADATA_XML)
\
$(METADATA_XSD)
\
#
JfrGeneratedNames
=
\
jfrEventClasses.hpp
\
jfrEventControl.hpp
\
jfrEventIds.hpp
\
jfrPeriodic.hpp
\
jfrTypes.hpp
JfrGenSource
=
$(JFR_TOOLS_SRCDIR)
/GenerateJfrFiles.java
JfrGenClass
=
$(JFR_TOOLS_OUTPUTDIR)
/build/tools/jfr/GenerateJfrFiles.class
JfrGeneratedFiles
=
$
(
JfrGeneratedNames:%
=
$
(
JFR_OUTPUTDIR/%
)
.PHONY
:
all clean cleanall
# #########################################################################
all
:
$(JfrGeneratedFiles)
$(JfrGenClass)
:
$(JfrGenSource)
mkdir
-p
$
(
@D
)
$(QUIETLY)
$(REMOTE)
$(COMPILE.JAVAC)
-d
$(JFR_TOOLS_OUTPUTDIR)
$(JfrGenSource)
$(JFR_OUTPUTDIR)/jfrEventClasses.hpp
:
$(METADATA_XML) $(METADATA_XSD) $(JfrGenClass)
$(QUIETLY)
echo
Generating
$
(
@F
)
mkdir
-p
$
(
@D
)
$(QUIETLY)
$(REMOTE)
$(RUN.JAVA)
-cp
$(JFR_TOOLS_OUTPUTDIR)
build.tools.jfr.GenerateJfrFiles
$(METADATA_XML)
$(METADATA_XSD)
$(JFR_OUTPUTDIR)
test
-f
$@
$(filter-out $(JFR_OUTPUTDIR)/jfrEventClasses.hpp, $(JfrGeneratedFiles))
:
$(JFR_OUTPUTDIR)/jfrEventClasses.hpp
TARGETS
+=
$(JFR_OUTPUTDIR)
/jfrEventClasses.hpp
# #########################################################################
clean cleanall
:
rm
$(JfrGenClass)
$(JfrGeneratedFiles)
# #########################################################################
make/aix/makefiles/top.make
浏览文件 @
089bbe09
#
#
# Copyright (c) 1999, 20
13
, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 20
20
, 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
...
@@ -80,7 +80,7 @@ default: vm_build_preliminaries the_vm
...
@@ -80,7 +80,7 @@ default: vm_build_preliminaries the_vm
@
echo
All
done
.
@
echo
All
done
.
# This is an explicit dependency for the sake of parallel makes.
# This is an explicit dependency for the sake of parallel makes.
vm_build_preliminaries
:
checks $(Cached_plat) $(AD_Files_If_Required)
trace
_stuff jvmti_stuff sa_stuff
vm_build_preliminaries
:
checks $(Cached_plat) $(AD_Files_If_Required)
jfr
_stuff jvmti_stuff sa_stuff
@
# We need a null action here, so implicit rules don't get consulted.
@
# We need a null action here, so implicit rules don't get consulted.
$(Cached_plat)
:
$(Plat_File)
$(Cached_plat)
:
$(Plat_File)
...
@@ -94,9 +94,9 @@ ad_stuff: $(Cached_plat) $(adjust-mflags)
...
@@ -94,9 +94,9 @@ ad_stuff: $(Cached_plat) $(adjust-mflags)
jvmti_stuff
:
$(Cached_plat) $(adjust-mflags)
jvmti_stuff
:
$(Cached_plat) $(adjust-mflags)
@
$(MAKE)
-f
jvmti.make
$
(
MFLAGS-adjusted
)
@
$(MAKE)
-f
jvmti.make
$
(
MFLAGS-adjusted
)
# generate
trace
files
# generate
JFR
files
trace_stuff
:
jvmti_stuff
$(Cached_plat) $(adjust-mflags)
jfr_stuff
:
$(Cached_plat) $(adjust-mflags)
@
$(MAKE)
-f
trace
.make
$
(
MFLAGS-adjusted
)
@
$(MAKE)
-f
jfr
.make
$
(
MFLAGS-adjusted
)
# generate SA jar files and native header
# generate SA jar files and native header
sa_stuff
:
sa_stuff
:
...
...
make/aix/makefiles/vm.make
浏览文件 @
089bbe09
#
#
# Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright
2012, 2013 SAP AG
. All rights reserved.
# Copyright
(c) 2012, 2020 SAP SE
. 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
...
@@ -53,7 +53,7 @@ endif
...
@@ -53,7 +53,7 @@ endif
# Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
# Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
# The adfiles directory contains ad_<arch>.[ch]pp.
# The adfiles directory contains ad_<arch>.[ch]pp.
# The jvmtifiles directory contains jvmti*.[ch]pp
# The jvmtifiles directory contains jvmti*.[ch]pp
Src_Dirs_V
+=
$(GENERATED)
/adfiles
$(GENERATED)
/jvmtifiles
$(GENERATED)
/
trace
files
Src_Dirs_V
+=
$(GENERATED)
/adfiles
$(GENERATED)
/jvmtifiles
$(GENERATED)
/
jfr
files
VPATH
+=
$(Src_Dirs_V:%=%:)
VPATH
+=
$(Src_Dirs_V:%=%:)
# set INCLUDES for C preprocessor.
# set INCLUDES for C preprocessor.
...
@@ -147,24 +147,22 @@ CFLAGS += -DALLOW_OPERATOR_NEW_USAGE
...
@@ -147,24 +147,22 @@ CFLAGS += -DALLOW_OPERATOR_NEW_USAGE
LIBJVM_DEBUGINFO
=
lib
$(JVM)
.debuginfo
LIBJVM_DEBUGINFO
=
lib
$(JVM)
.debuginfo
LIBJVM_DIZ
=
lib
$(JVM)
.diz
LIBJVM_DIZ
=
lib
$(JVM)
.diz
ifeq
($(ENABLE_JFR),false)
EXCLUDE_JFR_PATHS
:=
-o
-name
jfr
-prune
endif
SPECIAL_PATHS
:=
adlc c1 gc_implementation opto shark libadt
SPECIAL_PATHS
:=
adlc c1 gc_implementation opto shark libadt
SOURCE_PATHS
=
\
SOURCE_PATHS
=
\
$(
shell
find
$(HS_COMMON_SRC)
/share/vm/
*
-type
d
\!
\
$(
shell
find
$(HS_COMMON_SRC)
/share/vm/
*
-type
d
\!
\
\(
-name
DUMMY
$(
foreach
dir
,
$(SPECIAL_PATHS)
,-o
-name
$(dir)
)
\)
)
\(
-name
DUMMY
$(
foreach
dir
,
$(SPECIAL_PATHS)
,-o
-name
$(dir)
)
$(EXCLUDE_JFR_PATHS)
\)
)
SOURCE_PATHS
+=
$(HS_COMMON_SRC)
/os/
$(Platform_os_family)
/vm
SOURCE_PATHS
+=
$(HS_COMMON_SRC)
/os/
$(Platform_os_family)
/vm
SOURCE_PATHS
+=
$(HS_COMMON_SRC)
/os/posix/vm
SOURCE_PATHS
+=
$(HS_COMMON_SRC)
/os/posix/vm
SOURCE_PATHS
+=
$(HS_COMMON_SRC)
/cpu/
$(SRCARCH)
/vm
SOURCE_PATHS
+=
$(HS_COMMON_SRC)
/cpu/
$(SRCARCH)
/vm
SOURCE_PATHS
+=
$(HS_COMMON_SRC)
/os_cpu/
$(Platform_os_family)
_
$(SRCARCH)
/vm
SOURCE_PATHS
+=
$(HS_COMMON_SRC)
/os_cpu/
$(Platform_os_family)
_
$(SRCARCH)
/vm
CORE_PATHS
=
$(
foreach
path,
$(SOURCE_PATHS)
,
$(
call
altsrc,
$(path)
)
$(path)
)
CORE_PATHS
=
$(
foreach
path,
$(SOURCE_PATHS)
,
$(
call
altsrc,
$(path)
)
$(path)
)
CORE_PATHS
+=
$(GENERATED)
/jvmtifiles
$(GENERATED)
/tracefiles
CORE_PATHS
+=
$(GENERATED)
/jvmtifiles
$(GENERATED)
/jfrfiles
ifneq
($(INCLUDE_TRACE), false)
CORE_PATHS
+=
$(
shell
if
[
-d
$(HS_ALT_SRC)
/share/vm/jfr
]
;
then
\
find
$(HS_ALT_SRC)
/share/vm/jfr
-type
d
;
\
fi
)
endif
COMPILER1_PATHS
:=
$(
call
altsrc,
$(HS_COMMON_SRC)
/share/vm/c1
)
COMPILER1_PATHS
:=
$(
call
altsrc,
$(HS_COMMON_SRC)
/share/vm/c1
)
COMPILER1_PATHS
+=
$(HS_COMMON_SRC)
/share/vm/c1
COMPILER1_PATHS
+=
$(HS_COMMON_SRC)
/share/vm/c1
...
...
src/os/aix/vm/os_perf_aix.cpp
浏览文件 @
089bbe09
/*
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. 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
...
@@ -28,8 +29,7 @@
...
@@ -28,8 +29,7 @@
#include "os_aix.inline.hpp"
#include "os_aix.inline.hpp"
#include "runtime/os.hpp"
#include "runtime/os.hpp"
#include "runtime/os_perf.hpp"
#include "runtime/os_perf.hpp"
#include "vm_version_ext_ppc.hpp"
#include CPU_HEADER(vm_version_ext)
#include <stdio.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdarg.h>
...
@@ -179,32 +179,6 @@ format: %d %s %c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %l
...
@@ -179,32 +179,6 @@ format: %d %s %c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %l
*/
*/
/**
* For platforms that have them, when declaring
* a printf-style function,
* formatSpec is the parameter number (starting at 1)
* that is the format argument ("%d pid %s")
* params is the parameter number where the actual args to
* the format starts. If the args are in a va_list, this
* should be 0.
*/
#ifndef PRINTF_ARGS
# define PRINTF_ARGS(formatSpec, params) ATTRIBUTE_PRINTF(formatSpec, params)
#endif
#ifndef SCANF_ARGS
# define SCANF_ARGS(formatSpec, params) ATTRIBUTE_SCANF(formatSpec, params)
#endif
#ifndef _PRINTFMT_
# define _PRINTFMT_
#endif
#ifndef _SCANFMT_
# define _SCANFMT_
#endif
struct
CPUPerfTicks
{
struct
CPUPerfTicks
{
uint64_t
used
;
uint64_t
used
;
uint64_t
usedKernel
;
uint64_t
usedKernel
;
...
@@ -234,7 +208,7 @@ static double get_cpu_load(int which_logical_cpu, CPUPerfCounters* counters, dou
...
@@ -234,7 +208,7 @@ static double get_cpu_load(int which_logical_cpu, CPUPerfCounters* counters, dou
/** reads /proc/<pid>/stat data, with some checks and some skips.
/** reads /proc/<pid>/stat data, with some checks and some skips.
* Ensure that 'fmt' does _NOT_ contain the first two "%d %s"
* Ensure that 'fmt' does _NOT_ contain the first two "%d %s"
*/
*/
static
int
SCANF_ARGS
(
2
,
0
)
vread_statdata
(
const
char
*
procfile
,
_SCANFMT_
const
char
*
fmt
,
va_list
args
)
{
static
int
vread_statdata
(
const
char
*
procfile
,
const
char
*
fmt
,
va_list
args
)
{
FILE
*
f
;
FILE
*
f
;
int
n
;
int
n
;
char
buf
[
2048
];
char
buf
[
2048
];
...
@@ -263,7 +237,7 @@ static int SCANF_ARGS(2, 0) vread_statdata(const char* procfile, _SCANFMT_ const
...
@@ -263,7 +237,7 @@ static int SCANF_ARGS(2, 0) vread_statdata(const char* procfile, _SCANFMT_ const
return
n
;
return
n
;
}
}
static
int
SCANF_ARGS
(
2
,
3
)
read_statdata
(
const
char
*
procfile
,
_SCANFMT_
const
char
*
fmt
,
...)
{
static
int
read_statdata
(
const
char
*
procfile
,
const
char
*
fmt
,
...)
{
int
n
;
int
n
;
va_list
args
;
va_list
args
;
...
@@ -472,7 +446,7 @@ static double get_cpu_load(int which_logical_cpu, CPUPerfCounters* counters, dou
...
@@ -472,7 +446,7 @@ static double get_cpu_load(int which_logical_cpu, CPUPerfCounters* counters, dou
return
user_load
;
return
user_load
;
}
}
static
int
SCANF_ARGS
(
1
,
2
)
parse_stat
(
_SCANFMT_
const
char
*
fmt
,
...)
{
static
int
parse_stat
(
const
char
*
fmt
,
...)
{
FILE
*
f
;
FILE
*
f
;
va_list
args
;
va_list
args
;
...
@@ -609,7 +583,7 @@ bool CPUPerformanceInterface::CPUPerformance::initialize() {
...
@@ -609,7 +583,7 @@ bool CPUPerformanceInterface::CPUPerformance::initialize() {
CPUPerformanceInterface
::
CPUPerformance
::~
CPUPerformance
()
{
CPUPerformanceInterface
::
CPUPerformance
::~
CPUPerformance
()
{
if
(
_counters
.
cpus
!=
NULL
)
{
if
(
_counters
.
cpus
!=
NULL
)
{
FREE_C_HEAP_ARRAY
(
char
,
_counters
.
cpus
);
FREE_C_HEAP_ARRAY
(
char
,
_counters
.
cpus
,
mtInternal
);
}
}
}
}
...
@@ -886,7 +860,7 @@ int SystemProcessInterface::SystemProcesses::ProcessIterator::current(SystemProc
...
@@ -886,7 +860,7 @@ int SystemProcessInterface::SystemProcesses::ProcessIterator::current(SystemProc
cmdline
=
get_cmdline
();
cmdline
=
get_cmdline
();
if
(
cmdline
!=
NULL
)
{
if
(
cmdline
!=
NULL
)
{
process_info
->
set_command_line
(
allocate_string
(
cmdline
));
process_info
->
set_command_line
(
allocate_string
(
cmdline
));
FREE_C_HEAP_ARRAY
(
char
,
cmdline
);
FREE_C_HEAP_ARRAY
(
char
,
cmdline
,
mtInternal
);
}
}
return
OS_OK
;
return
OS_OK
;
...
@@ -1011,12 +985,12 @@ CPUInformationInterface::~CPUInformationInterface() {
...
@@ -1011,12 +985,12 @@ CPUInformationInterface::~CPUInformationInterface() {
if
(
_cpu_info
!=
NULL
)
{
if
(
_cpu_info
!=
NULL
)
{
if
(
_cpu_info
->
cpu_name
()
!=
NULL
)
{
if
(
_cpu_info
->
cpu_name
()
!=
NULL
)
{
const
char
*
cpu_name
=
_cpu_info
->
cpu_name
();
const
char
*
cpu_name
=
_cpu_info
->
cpu_name
();
FREE_C_HEAP_ARRAY
(
char
,
cpu_name
);
FREE_C_HEAP_ARRAY
(
char
,
cpu_name
,
mtInternal
);
_cpu_info
->
set_cpu_name
(
NULL
);
_cpu_info
->
set_cpu_name
(
NULL
);
}
}
if
(
_cpu_info
->
cpu_description
()
!=
NULL
)
{
if
(
_cpu_info
->
cpu_description
()
!=
NULL
)
{
const
char
*
cpu_desc
=
_cpu_info
->
cpu_description
();
const
char
*
cpu_desc
=
_cpu_info
->
cpu_description
();
FREE_C_HEAP_ARRAY
(
char
,
cpu_desc
);
FREE_C_HEAP_ARRAY
(
char
,
cpu_desc
,
mtInternal
);
_cpu_info
->
set_cpu_description
(
NULL
);
_cpu_info
->
set_cpu_description
(
NULL
);
}
}
delete
_cpu_info
;
delete
_cpu_info
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录