-
Notifications
You must be signed in to change notification settings - Fork 25
List core file #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List core file #75
Conversation
25713a3
to
c4e7d05
Compare
lib/orders/list_core.js
Outdated
exports.coredir = []; | ||
coreFileNamePrefix = 'core'; | ||
var patt = fs.readFileSync('/proc/sys/kernel/core_pattern', 'utf8').trim().split(' ')[0]; | ||
if (patt.indexOf('%') > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
也有不指定 %e %p 的情况把
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
目前只处理这种格式的
lib/orders/list_core.js
Outdated
|
||
for (var i = 0; i < count; i++) { | ||
getNodePWD(pids[i], done); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对其了吗。
var done = function(err, pwd) { | ||
finished++; | ||
if (pwd && pwds.indexOf(pwd) === -1) { | ||
pwds.push(pwd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 pwd 应该是有重复的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要去重
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (pwd && pwds.indexOf(pwd) === -1)
这句去重的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个效率不高。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(⊙o⊙)…哪个效率高一些?
我们只对新产生的 core 文件进行上报吧。可能要根据文件生成的时间来过滤。 |
7eb1eb8
to
9c95846
Compare
测试没有过? |
9c95846
to
4590b7b
Compare
check core files
1. if user specified "coredir": [dir1, dir2], or
2. /proc/sys/kernel/core_pattern is something like /tmp/coredump_%d_%P, or
3. by default