使用 top/ps 识别 perf 的 PID

identify perf's PID using top/ps

我需要使用其 PID 在 bash 脚本中终止 perf。但是,无法识别 perf 的 PID(使用 top)。任何指针表示赞赏。 Ubuntu XX 16.04.2。谢谢

您可以对进程进行 grep ps 并从那里获取其 ID。然后使用 kill 命令的输出。

kill $(ps aux | awk '/perf/{print }')