位置: 编程技术 - 正文
推荐整理分享Linux下多线程查看工具(pstree、ps、pstack)(linux查看多线程),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:linux多线程命令,linux多线程怎么调度,linux多线程编程实例,linux 多线程 多进程,linux 多线程 多进程,linux 多线程 多进程,linux多线程执行顺序,linux多线程调试手段,内容如对您有帮助,希望把文章链接给更多的朋友!
1. pstree
pstree以树结构显示进程$ pstree -p work | grep adsshd()---bash()---ad_preprocess()--{ad_preprocess}() |-{ad_preprocess}() |-{ad_preprocess}() |-{ad_preprocess}() |-{ad_preprocess}() `-{ad_preprocess}()
work为工作用户,-p为显示进程识别码,ad_preprocess共启动了6个子线程,加上主线程共7个线程
2. ps -Lf
$ ps -Lf UID PID PPID LWP C NLWP STIME TTY STAT TIME CMDwork 2 7 : pts/2 Sl 0: ./ad_preprocesswork 0 7 : pts/2 Sl 0: ./ad_preprocesswork 0 7 : pts/2 Sl 0: ./ad_preprocesswork 0 7 : pts/2 Sl 0: ./ad_preprocesswork 0 7 : pts/2 Sl 0: ./ad_preprocesswork 0 7 : pts/2 Sl 0: ./ad_preprocesswork 0 7 : pts/2 Sl 0: ./ad_preprocess
进程共启动了7个线程
3. pstack
pstack显示每个进程的栈跟踪
$ pstack Thread 7 (Thread (LWP )):#0 0xafcdc in epoll_wait () from /lib/tls/libc.so.6#1 0xf in ub::EPollEx::poll ()#2 0xfa in ub::NetReactor::callback ()#3 0xfbbbb in ub::UBTask::CALLBACK ()#4 0xba in start_thread () from /lib/tls/libpthread.so.0#5 0xafc in clone () from /lib/tls/libc.so.6#6 0x in ?? ()Thread 6 (Thread (LWP )):#0 0xafcdc in epoll_wait () from /lib/tls/libc.so.6#1 0xf in ub::EPollEx::poll ()#2 0xfa in ub::NetReactor::callback ()#3 0xfbbbb in ub::UBTask::CALLBACK ()#4 0xba in start_thread () from /lib/tls/libpthread.so.0#5 0xafc in clone () from /lib/tls/libc.so.6#6 0x in ?? ()Thread 5 (Thread (LWP )):#0 0xbbaa5 in __nanosleep_nocancel ()#1 0xe in comcm::ms_sleep ()#2 0xc in ub::UbClientManager::healthyCheck ()#3 0xc in ub::UbClientManager::start_healthy_check ()#4 0xba in start_thread () from /lib/tls/libpthread.so.0#5 0xafc in clone () from /lib/tls/libc.so.6#6 0x in ?? ()Thread 4 (Thread (LWP )):#0 0xbbaa5 in __nanosleep_nocancel ()#1 0xb0e in armor::armor_check_thread ()#2 0xba in start_thread () from /lib/tls/libpthread.so.0#3 0xafc in clone () from /lib/tls/libc.so.6#4 0x in ?? ()Thread 3 (Thread (LWP )):#0 0xaf8f1a5 in __nanosleep_nocancel () from /lib/tls/libc.so.6#1 0xaf8f in sleep () from /lib/tls/libc.so.6#2 0xc in Business_config_manager::run ()#3 0xb in Thread::run_thread ()#4 0xba in start_thread () from /lib/tls/libpthread.so.0#5 0xafc in clone () from /lib/tls/libc.so.6#6 0x in ?? ()Thread 2 (Thread (LWP )):#0 0xaf8f1a5 in __nanosleep_nocancel () from /lib/tls/libc.so.6#1 0xaf8f in sleep () from /lib/tls/libc.so.6#2 0xbb in Process_thread::sleep_period ()#3 0x in Process_thread::run ()#4 0xb in Thread::run_thread ()#5 0xba in start_thread () from /lib/tls/libpthread.so.0#6 0xafc in clone () from /lib/tls/libc.so.6#7 0x in ?? ()Thread 1 (Thread (LWP )):#0 0xaf8f1a5 in __nanosleep_nocancel () from /lib/tls/libc.so.6#1 0xaf8f in sleep () from /lib/tls/libc.so.6#2 0xd in Ad_preprocess::run ()#3 0xad0 in main ()
Android系统架构 1、Linux系统内核层LlinuxKernel):为Android设备的各种硬件提供了底层的驱动eg:显示驱动,音频驱动2、系统运行库层(1)c/c库,SQLite库(Libraries)(2)Androi
Android学习MediaRecorder和MediaPlayer 今天自己利用课余时间做了一个关于语音记录器的初步设计。主要实现的功能如下(录音、播放、发送音频):(这是一个在客户端中使用的部分关键
Android之4.4版本以上沉浸式状态栏实现 Android在4.4(KITKAT)版本加入了沉浸式,这个概念开始是在ios上使用的,现在ios的应用基本上都使用了沉浸式,而android只能在4.4及以上的版本进行使用。先
标签: linux查看多线程
本文链接地址:https://www.jiuchutong.com/biancheng/371098.html 转载请保留说明!友情链接: 武汉网站建设