zoukankan      html  css  js  c++  java
  • Linux火焰图-ubuntu

    关注火焰图非常长的时间了!~~一直未能自己做个火焰图出来。今天小试一把。

    ubuntu18.04

    ssh登陆之后执行命令

    安装软件

    apt-get install -y linux-cloud-tools-generic linux-tools-generic

    访问https://github.com/brendangregg/FlameGraph

    download zip然后解压完传到ubuntu18.04的/root/

    然后找个程序执行(我拿iperf用来做性能测试的对象,你可以用dd或者ping命令测试下)

    ps -ef | grep iperf

    看到进程为18061

    然后执行

    perf record -F 99 -p 18061 -g -- sleep 30

    上面命令的参数为监控频率为1秒钟监控99次,监控进程为18061,监控时长为30秒

    #  report是文本显示例子,看细节挺方便

    perf report -n --stdio

    #  perf script一条条打印perf.data内的数据,输出的是perf record收集到的原始数据。

    perf script -i perf.data &> perf.unfold
    /root/flamegraph-master/stackcollapse-perf.pl perf.unfold &> perf.folded
    /root/flamegraph-master/flamegraph.pl perf.folded > perf.svg
    perf script | /root/flamegraph-master/stackcollapse-perf.pl | /root/flamegraph-master/flamegraph.pl >process.svg

    然后把svg复制到你的电脑用浏览器打开看下吧!

    我的是这个样子的

    可以看到copy_user_generic_string和finish_task_switch是平顶山,找到问题原因了,解决问题那就是另外一回事了!

    更详细的中文参考http://www.qingpingshan.com/pc/fwq/172560.html

    这么好的文章浏览量居然之后203!!!!

    还有一个linux performance大神的网站http://www.brendangregg.com,基本上google上搜索到的linux性能优化的文章、视频都引用了他的软件或者图片。

  • 相关阅读:
    easyui
    applicationContext.xml xxx-servlet.xml
    response ,request编码
    json 处理
    webservice wsdl 生成服务
    springmvc 定时器
    ftp命令和scp命令
    Telnet、FTP、SSH、SFTP、SCP
    mysql 索引
    民科吧 见闻录
  • 原文地址:https://www.cnblogs.com/tcicy/p/10023554.html
Copyright © 2011-2022 走看看