Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions bin/xprofctl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const args = yargs
.command('diag_report', '生成诊断报告', normalYargs)
.command('generate_cored', '生成 coredump', normalYargs)
.command('check_version', '获取 xprofiler 版本号', normalYargs)
.command('kill', '杀死进程', normalYargs)
.command('get_config', '获取 xprofiler 配置', normalYargs)
.command('set_config', '设置 xprofiler 配置',
yargs => {
Expand Down Expand Up @@ -95,6 +96,16 @@ const pid = args['pid'];
const thread_id = args['worker_thread_id'] || 0;
utils.cleanArgs(args);

if (action === 'kill') {
try {
process.kill(pid);
console.log(`进程 (pid ${pid}) 已被杀死`);
} catch (err) {
console.error(`杀死进程 (pid ${pid}) 失败: ${err.message}`);
}
return;
}

// send message
utils.formatArgs(args);

Expand Down
Empty file added src/commands/simple/kill.cc
Empty file.
Empty file added src/commands/simple/kill.h
Empty file.
Loading