We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d50c55d commit a240d9fCopy full SHA for a240d9f
note/linux命令.md
@@ -427,6 +427,11 @@ pidstat -u 1 # 每秒1次的频率输出
427
428
### netstat
429
430
+我经常用的就是
431
+```
432
+netstat -atunlp
433
434
+
435
### strace
436
437
跟踪系统运行的过程中,执行的系统调用和信号。这个简直就是debug的神器呀。
@@ -456,13 +461,18 @@ accept(3,
456
461
457
462
说明程序阻塞在了accept上面。当然,这个用gdb也可以实现。
458
463
459
-### perf命令
464
+### perf
460
465
- 分析性能问题的一个神器。
466
+分析性能问题的一个神器。
467
468
469
+# -g 参数表示记录
470
+sudo perf top -g -p pid
471
472
- perf top
473
+从perf的输出可以看出,在那些函数执行的时间是比较长的,这样可以帮助对性能问题,进行相关的分析。
474
- perf record
475
+
476
477
### nc
478
pic/perf.png
38.5 KB
0 commit comments