Linux笔记-Linux中的TracerPid
Posted IT1995
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux笔记-Linux中的TracerPid相关的知识,希望对你有一定的参考价值。
在每个进程都在/proc中有对应的文件夹,其中有个status文件:
[root@VM-0-2-centos 15173]# ls
attr cmdline environ io mem ns pagemap sched stack task
autogroup comm exe limits mountinfo numa_maps patch_state schedstat stat timers
auxv coredump_filter fd loginuid mounts oom_adj personality sessionid statm uid_map
cgroup cpuset fdinfo map_files mountstats oom_score projid_map setgroups status wchan
clear_refs cwd gid_map maps net oom_score_adj root smaps syscall
[root@VM-0-2-centos 15173]#
status内容如下:
[root@VM-0-2-centos 15173]# cat status
Name: bash
Umask: 0022
State: S (sleeping)
Tgid: 15173
Ngid: 0
Pid: 15173
PPid: 15169
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
FDSize: 256
Groups: 0
VmPeak: 116376 kB
VmSize: 116372 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 3196 kB
VmRSS: 3196 kB
RssAnon: 1384 kB
RssFile: 1812 kB
RssShmem: 0 kB
VmData: 1300 kB
VmStk: 132 kB
VmExe: 884 kB
VmLib: 2140 kB
VmPTE: 48 kB
VmSwap: 0 kB
Threads: 1
SigQ: 0/7270
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000010000
SigIgn: 0000000000384004
SigCgt: 000000004b813efb
CapInh: 0000000000000000
CapPrm: 0000001fffffffff
CapEff: 0000001fffffffff
CapBnd: 0000001fffffffff
CapAmb: 0000000000000000
Seccomp: 0
Cpus_allowed: 1
Cpus_allowed_list: 0
Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
Mems_allowed_list: 0
voluntary_ctxt_switches: 220
nonvoluntary_ctxt_switches: 0
里面有个TracerPid
也就是说,这个TracerPid是追踪进程ID,如果没有进程对其追踪就是0。
这个tracerpid在Andorid安全很有用。
以上是关于Linux笔记-Linux中的TracerPid的主要内容,如果未能解决你的问题,请参考以下文章
Android深度探索--HAL与驱动开发----第九章读书笔记
OmniSharp.MSBuild.ProjectManager无法在Linux上加载项目
代写C, C++ or Python 作业,Linux environment下编程代写C, C++ or Python 作业代写