Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
c2772669
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看板
提交
c2772669
编写于
2月 12, 2014
作者:
D
dsamersoff
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7127191: SA JSDB does not display native symbols correctly for transported Linux cores
Summary: Better handle SA_ALTROOT Reviewed-by: sla, sspitsyn
上级
28a22157
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
93 addition
and
94 deletion
+93
-94
agent/src/os/linux/libproc_impl.c
agent/src/os/linux/libproc_impl.c
+40
-43
agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java
...lasses/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java
+13
-23
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
+40
-28
未找到文件。
agent/src/os/linux/libproc_impl.c
浏览文件 @
c2772669
...
...
@@ -29,54 +29,51 @@
#include <thread_db.h>
#include "libproc_impl.h"
static
const
char
*
alt_root
=
NULL
;
static
int
alt_root_len
=
-
1
;
#define SA_ALTROOT "SA_ALTROOT"
static
void
init_alt_root
()
{
if
(
alt_root_len
==
-
1
)
{
alt_root
=
getenv
(
SA_ALTROOT
);
if
(
alt_root
)
{
alt_root_len
=
strlen
(
alt_root
);
}
else
{
alt_root_len
=
0
;
}
}
}
int
pathmap_open
(
const
char
*
name
)
{
int
fd
;
char
alt_path
[
PATH_MAX
+
1
];
init_alt_root
();
if
(
alt_root_len
>
0
)
{
strcpy
(
alt_path
,
alt_root
);
strcat
(
alt_path
,
name
);
fd
=
open
(
alt_path
,
O_RDONLY
);
if
(
fd
>=
0
)
{
print_debug
(
"path %s substituted for %s
\n
"
,
alt_path
,
name
);
return
fd
;
}
static
const
char
*
alt_root
=
NULL
;
static
int
alt_root_initialized
=
0
;
if
(
strrchr
(
name
,
'/'
))
{
strcpy
(
alt_path
,
alt_root
);
strcat
(
alt_path
,
strrchr
(
name
,
'/'
));
fd
=
open
(
alt_path
,
O_RDONLY
);
if
(
fd
>=
0
)
{
print_debug
(
"path %s substituted for %s
\n
"
,
alt_path
,
name
);
return
fd
;
}
}
}
else
{
fd
=
open
(
name
,
O_RDONLY
);
if
(
fd
>=
0
)
{
return
fd
;
}
}
int
fd
;
char
alt_path
[
PATH_MAX
+
1
],
*
alt_path_end
;
const
char
*
s
;
return
-
1
;
if
(
!
alt_root_initialized
)
{
alt_root_initialized
=
-
1
;
alt_root
=
getenv
(
SA_ALTROOT
);
}
if
(
alt_root
==
NULL
)
{
return
open
(
name
,
O_RDONLY
);
}
strcpy
(
alt_path
,
alt_root
);
alt_path_end
=
alt_path
+
strlen
(
alt_path
);
// Strip path items one by one and try to open file with alt_root prepended
s
=
name
;
while
(
1
)
{
strcat
(
alt_path
,
s
);
s
+=
1
;
fd
=
open
(
alt_path
,
O_RDONLY
);
if
(
fd
>=
0
)
{
print_debug
(
"path %s substituted for %s
\n
"
,
alt_path
,
name
);
return
fd
;
}
// Linker always put full path to solib to process, so we can rely
// on presence of /. If slash is not present, it means, that SOlib doesn't
// physically exist (e.g. linux-gate.so) and we fail opening it anyway
if
((
s
=
strchr
(
s
,
'/'
))
==
NULL
)
{
break
;
}
*
alt_path_end
=
0
;
}
return
-
1
;
}
static
bool
_libsaproc_debug
;
...
...
agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java
浏览文件 @
c2772669
...
...
@@ -55,31 +55,21 @@ class LinuxCDebugger implements CDebugger {
if
(
pc
==
null
)
{
return
null
;
}
/* Typically we have about ten loaded objects here. So no reason to do
sort/binary search here. Linear search gives us acceptable performance.*/
List
objs
=
getLoadObjectList
();
Object
[]
arr
=
objs
.
toArray
();
// load objects are sorted by base address, do binary search
int
mid
=
-
1
;
int
low
=
0
;
int
high
=
arr
.
length
-
1
;
while
(
low
<=
high
)
{
mid
=
(
low
+
high
)
>>
1
;
LoadObject
midVal
=
(
LoadObject
)
arr
[
mid
];
long
cmp
=
pc
.
minus
(
midVal
.
getBase
());
if
(
cmp
<
0
)
{
high
=
mid
-
1
;
}
else
if
(
cmp
>
0
)
{
long
size
=
midVal
.
getSize
();
if
(
cmp
>=
size
)
{
low
=
mid
+
1
;
}
else
{
return
(
LoadObject
)
arr
[
mid
];
}
}
else
{
// match found
return
(
LoadObject
)
arr
[
mid
];
}
for
(
int
i
=
0
;
i
<
objs
.
size
();
i
++)
{
LoadObject
ob
=
(
LoadObject
)
objs
.
get
(
i
);
Address
base
=
ob
.
getBase
();
long
size
=
ob
.
getSize
();
if
(
pc
.
greaterThanOrEqual
(
base
)
&&
pc
.
lessThan
(
base
.
addOffsetTo
(
size
)))
{
return
ob
;
}
}
// no match found.
return
null
;
}
...
...
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
浏览文件 @
c2772669
...
...
@@ -371,19 +371,23 @@ function sym2addr(dso, sym) {
return
sa
.
dbg
.
lookup
(
dso
,
sym
);
}
// returns the ClosestSymbol or null
function
closestSymbolFor
(
addr
)
{
if
(
sa
.
cdbg
==
null
)
{
function
loadObjectContainingPC
(
addr
)
{
if
(
sa
.
cdbg
==
null
)
{
// no CDebugger support, return null
return
null
;
}
else
{
var
dso
=
sa
.
cdbg
.
loadObjectContainingPC
(
addr
);
if
(
dso
!=
null
)
{
return
dso
.
closestSymbolToPC
(
addr
);
}
else
{
return
null
;
}
}
}
return
sa
.
cdbg
.
loadObjectContainingPC
(
addr
);
}
// returns the ClosestSymbol or null
function
closestSymbolFor
(
addr
)
{
var
dso
=
loadObjectContainingPC
(
addr
);
if
(
dso
!=
null
)
{
return
dso
.
closestSymbolToPC
(
addr
);
}
return
null
;
}
// Address-to-symbol
...
...
@@ -884,21 +888,29 @@ function isOop(addr) {
// returns description of given pointer as a String
function
whatis
(
addr
)
{
addr
=
any2addr
(
addr
);
var
ptrLoc
=
findPtr
(
addr
);
if
(
ptrLoc
.
isUnknown
())
{
var
vmType
=
vmTypeof
(
addr
);
if
(
vmType
!=
null
)
{
return
"
pointer to
"
+
vmType
.
name
;
}
else
{
var
sym
=
closestSymbolFor
(
addr
);
if
(
sym
!=
null
)
{
return
sym
.
name
+
'
+
'
+
sym
.
offset
;
}
else
{
return
ptrLoc
.
toString
();
}
}
}
else
{
return
ptrLoc
.
toString
();
}
addr
=
any2addr
(
addr
);
var
ptrLoc
=
findPtr
(
addr
);
if
(
!
ptrLoc
.
isUnknown
())
{
return
ptrLoc
.
toString
();
}
var
vmType
=
vmTypeof
(
addr
);
if
(
vmType
!=
null
)
{
return
"
pointer to
"
+
vmType
.
name
;
}
var
dso
=
loadObjectContainingPC
(
addr
);
if
(
dso
==
null
)
{
return
ptrLoc
.
toString
();
}
var
sym
=
dso
.
closestSymbolToPC
(
addr
);
if
(
sym
!=
null
)
{
return
sym
.
name
+
'
+
'
+
sym
.
offset
;
}
var
s
=
dso
.
getName
();
var
p
=
s
.
lastIndexOf
(
"
/
"
);
var
base
=
dso
.
getBase
();
return
s
.
substring
(
p
+
1
,
s
.
length
)
+
'
+
'
+
addr
.
minus
(
base
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录