转自:http://blog.csdn.net/nanjingligong/article/details/8624739

方法一:pstack pid
NAME
       pstack - print a stack trace of a running process

SYNOPSIS
       pstack pid

DESCRIPTION
       pstack  attaches  to  the active process named by the pid on the command line, and prints out an execution stack trace.  If ELF symbols exist in the binary (usually the case
       unless you have run strip(1)), then symbolic addresses are printed as well.

If the process is part of a thread group, then pstack will print out a stack trace for each of the threads in the group.

SEE ALSO
       nm(1), ptrace(2), gdb(1)

方法二:gstack pid
NAME
       gstack - print a stack trace of a running process

SYNOPSIS
       gstack pid

DESCRIPTION
       gstack  attaches  to  the active process named by the pid on the command line, and prints out an execution stack trace.  If ELF symbols exist in the binary (usually the case
       unless you have run strip(1)), then symbolic addresses are printed as well.

If the process is part of a thread group, then gstack will print out a stack trace for each of the threads in the group.

SEE ALSO
       nm(1), ptrace(2), gdb(1)

方法三:
使用gdb 然后attach 进程ID,然后再使用命令 thread apply all bt。

方法一和方法二一样,方法三可以查看更多的信息。

linux如何查看一个进程的堆栈的更多相关文章

  1. Linux 如何查看一个进程的堆栈

    有两种方法: 第一种:pstack 进程ID 第二种,使用gdb 然后attach 进程ID,然后再使用命令 thread apply all bt 第三种:strace -f -p pid  该方法 ...

  2. [转] linux 下查看一个进程运行路径的方法

    http://blog.csdn.net/brioxu/article/details/5104736 在linux下查看进程大家都会想到用 ps -ef|grep XXX ps -aux | hea ...

  3. linux 下查看一个进程执行路径

    在linux下查看进程大家都会想到用 ps -ef|grep XXX 但是看到的不是全路径.怎么看全路径呢? 每一个进程启动之后在 /proc以下有一个于pid相应的路径 比如:ps -ef|grep ...

  4. linux下查看一个进程的启动时间和运行时间

    使用 ps命令 :#ps -A -opid,stime,etime,args ps -A -opid,stime,etime,args 结果: root:src# ps -A -opid,stime, ...

  5. 操作系统复习——如何查看一个进程的详细信息,如何追踪一个进程的执行过程 ,如何在 Linux 系统下查看 CPU、内存、磁盘、IO、网卡情况?epoll和select区别?

    1. 如何查看一个进程的详细信息,如何追踪一个进程的执行过程 通过pstree命令(根据pid)进行查询进程内部当前运行了多少线程:# pstree -p 19135(进程号) 使用top命令查看(可 ...

  6. Linux内存管理 一个进程究竟占用多少空间?-VSS/RSS/PSS/USS

    关键词:VSS.RSS.PSS.USS._mapcount.pte_present.mem_size_stats. 在Linux里面,一个进程占用的内存有不同种说法,可以是VSS/RSS/PSS/US ...

  7. Linux下查看某个进程打开的文件数-losf工具常用参数介绍

    Linux下查看某个进程打开的文件数-losf工具常用参数介绍 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 在linux操作系统中,一切皆文件.通过文件不仅仅可以访问常规数据,还 ...

  8. linux下查看运行进程详细信息

    通过ps及top命令查看进程信息时,只能查到相对路径,查不到的进程的详细信息,如绝对路径等.这时,我们需要通过以下的方法来查看进程的详细信息: Linux在启动一个进程时,系统会在/proc下创建一个 ...

  9. (转)如何在Linux中统计一个进程的线程数

    如何在Linux中统计一个进程的线程数 原文:http://os.51cto.com/art/201509/491728.htm 我正在运行一个程序,它在运行时会派生出多个线程.我想知道程序在运行时会 ...

随机推荐

  1. 输出控制台信息到日志 并 通过cronolog对tomcat进行日志切分

    windows下tomcat默认并不会把控制台输出的信息都记录进日志文件.但是在生产环境中,出现问题时,控制台的日志输出是无法查据的,因此需要将日志记录下来. 解决方法: 输出日志到文件 修改tomc ...

  2. RS:关于协同过滤,矩阵分解,LFM隐语义模型三者的区别

    项亮老师在其所著的<推荐系统实战>中写道: 第2章 利用用户行为数据 2.2.2 用户活跃度和物品流行度的关系 [仅仅基于用户行为数据设计的推荐算法一般称为协同过滤算法.学术界对协同过滤算 ...

  3. [Spring学习笔记 7 ] Spring中的数据库支持 RowMapper,JdbcDaoSupport 和 事务处理Transaction

    1.Spring中的数据库支持 把具有相同功能的代码模板抽取到一个工具类中.2.关于jdbc template的应用 jdbcTemplate模板操作类,把访问jdbc的模板抽取到template中, ...

  4. 转载:kafka c接口librdkafka介绍之二:生产者接口

    转载:from:http://www.verydemo.com/demo_c92_i210679.html 这个程序虽然我调试过,也分析过,但是没有记录笔记,发现下边这篇文章分析直接透彻,拿来借用,聊 ...

  5. 关于使用coreseek并为其做分页的介绍(转)

    coreseek 做分页时找数据总量还真不好找.以为他会给一个方法(函数)什么的去获取,结果却不是.首先需要了解:num_matches: 当前返回的结果数,<= limit设置值.max_ma ...

  6. android 获取view在屏幕中的位置

    使用view中的getLocationOnScreen方法,即可: final int[] locations = new int[2]; Button btn = (Button) findView ...

  7. 使用Openssl的AES加密算法

    原文链接: http://blog.csdn.net/yasi_xi/article/details/13997337 Openssl是很常见的C接口的库,个人觉得易用.以下是AES加密的使用备忘.如 ...

  8. Debian静态IP地址和DNS

    Debian静态IP地址和DNS 一.配置文件及路径 /etc/network/interfaces 二.IP地址1. DHCP的IP配置如下 # The primary network interf ...

  9. A标签实现文件下载功能

    <a>可直接下载xls,doc,rar,zip,exe,js文件(图片跟txt文件是直接打开的) <a href="wKioJlJolKeCIzkCADd3Wf7OPI42 ...

  10. C#基础第一天-作业

    1.从键盘上输入三个数,用if语句和逻辑表达式把最大数找出来.2.从键盘上输入三个数,用if语句和逻辑表达式把最小数找出来.3.输入一个成绩(0-100),然后用if else语句判断该成绩是优.良. ...