转自: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. SQL之group by

    转自:理解group by 先来看下表1,表名为test: 表1 执行如下SQL语句: 1 2 SELECT name FROM test GROUP BY name 你应该很容易知道运行的结果,没错 ...

  2. kafaka可视化工具

    许多中间件系统都提供了良好的可视化系统.MySQL有workbench,navcat,php版的mysqladmin等可视化程序.Redis.MongoDB也有开源的可视化程序.只要官方提供了探索数据 ...

  3. Delphi消息推送

    移动端的消息推送大家都体验过,智能手机上一大堆广告等各种消息会不时从消息栏中弹出来骚扰你. PC程序中我们有时也会用到消息推送,比如通知之类.通常我们使用的方法可能更多地使用Socket之类来处理,有 ...

  4. java struts2入门学习实例--用户注册

     一.用户注册示例 register.jsp <%@ page language="java" contentType="text/html; charset=UT ...

  5. java mongodb 基础系列---查询,排序,limit,$in,$or,输出为list,创建索引,$ne 非操作

    官方api教程:http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-java-driver/#getting-started ...

  6. Install MySQL 5.7 on Fedora 25/24, CentOS/RHEL 7.3/6.8/5.11

    MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user ...

  7. (转)失败和拒绝,也是一种肯定 找工作时,我四处碰壁这一段经历对自己职业生涯的帮助最大。为什么? "因为这些挫折让我的脸皮变厚了 如果你不是每天被人拒绝,那就说明你的人生目标不够远大 所谓成功,就是不停地经历失败,并且始终保持热情

    (转)失败和拒绝,也是一种肯定 昨天,先是看到一个老外,说了一句很震撼的话. "你个人的项目,应该有四分之一会失败,否则就说明你的冒险精神不够." (Expect and hope ...

  8. java 实现唯一ID生成器

      2014-11-08 内容存档在evernote,笔记名"java 实现唯一ID生成器"

  9. linux达人养成计划学习笔记(二)—— 文件查找命令

    一.locate命令 1.命令格式: locate 文件名 2.locate在后台数据库中按文件名搜索,速度快,locate命令所搜索的后台数据库 /var/lib/mlocate 3.后台数据库跟新 ...

  10. Docker Dockerfile简述

    原文地址:https://www.cnblogs.com/cuimiemie/p/6442677.html 作用 Dockerfile的内容是一坨可以执行的代码(或者说是指令)(docker的DSL) ...