当前位置: 首页 > news >正文

Linux /proc/pid目录下文件的含义 (转)

2013-01-16 16:10:36

分类: LINUX

attr:

进程的属性

 

cmdline:

启动进程时执行的命令

 

cwd:

指向进程当前工作目录的软链

 

environ:

进程执行时使用的环境变量,文件内容使用null字节('\0')分隔,然后以null字节结束。因此获取进程使用的环境变量使用如下:

(cat /proc/pid/environ; echo) | tr '\000' '\n'

 

fd:

 此目录包含进程打开的所有文件,文件名为文件描述符,目录中每个软连接都会指向进程打开的实际文件。

 

limits:

该文件存储了进程的软限制,硬限制等信息。

 

maps:

 

 

      address         perms offset  dev   inode   pathname

      08048000-08056000 r-xp 00000000 03:0c 64593   /usr/sbin/gpm

      4001f000-40135000 r-xp 00000000 03:0c 45494   /lib/libc-2.2.4.so

         * address:进程占用的地址空间。

         * perms:权限集

                 r = read

                 w = write

                 x = execute

                 s = shared

                 p = private (copy on write)

        * offset:文件偏移量。

        * dev:为设备(major:minor)

        * inode:设备上的inode。0为没有inode关联互内存区域,通常为:BSS(uninitialized data)

 

root:

指向进程更目录的软链

 

smaps:

 

      This file shows memory consumption for each of the process's mappings.  For each of mappings there is a series of lines such as the following:

 

  08048000-080bc000 r-xp 00000000 03:02 13130    /bin/bash

  Size:       464 kB

  Rss:       424 kB

  Shared_Clean:       424 kB

  Shared_Dirty: 0 kB

  Private_Clean: 0 kB

  Private_Dirty: 0 kB

 

      The first of these lines shows the same information as is displayed for the mapping in /proc/[pid]/maps. The remaining lines show the size of

      the  mapping,  the amount of the mapping that is currently resident in RAM, the number of clean and dirty shared pages in the mapping, and the

      number of clean and dirty private pages in the mapping.

 

      This file is only present if the CONFIG_MMU kernel configuration option is enabled.


status:
  Name:   bash
  State:  S (sleeping)
  Tgid:   3515
  Pid:   3515
  PPid:   3452
  TracerPid:   0
  Uid:   1000   1000   1000   1000
  Gid:   100   100   100   100
  FDSize: 256
  Groups: 16 33 100
  VmPeak:     9136 kB
  VmSize:     7896 kB
  VmLck:  0 kB
  VmHWM:      7572 kB
  VmRSS:      6316 kB
  VmData:     5224 kB
  VmStk: 88 kB
  VmExe:       572 kB
  VmLib:      1708 kB
  VmPTE: 20 kB
  Threads:   1
  SigQ:   0/3067
  SigPnd: 0000000000000000
  ShdPnd: 0000000000000000
  SigBlk: 0000000000010000
  SigIgn: 0000000000384004
  SigCgt: 000000004b813efb
  CapInh: 0000000000000000
  CapPrm: 0000000000000000
  CapEff: 0000000000000000
  CapBnd: ffffffffffffffff
  Cpus_allowed:   00000001
  Cpus_allowed_list:   0
  Mems_allowed:   1
  Mems_allowed_list:   0
  voluntary_ctxt_switches:   150
  nonvoluntary_ctxt_switches:   545

      The fields are as follows:

      * Name: Command run by this process.

      * State: Current state of the process.  One of "R (running)", "S (sleeping)", "D (disk sleep)", "T (stopped)", "T (tracing  stop)",  "Z  (zom-
bie)", or "X (dead)".

      * Tgid: Thread group ID (i.e., Process ID).

      * Pid: Thread ID (see gettid(2)).

      * TracerPid: PID of process tracing this process (0 if not being traced).

      * Uid, Gid: Real, effective, saved set, and file system UIDs (GIDs).

      * FDSize: Number of file descriptor slots currently allocated.

      * Groups: Supplementary group list.

      * VmPeak: Peak virtual memory size.

      * VmSize: Virtual memory size.

      * VmLck: Locked memory size.

      * VmHWM: Peak resident set size ("high water mark").

      * VmRSS: Resident set size.

      * VmData, VmStk, VmExe: Size of data, stack, and text segments.

      * VmLib: Shared library code size.

      * VmPTE: Page table entries size (since Linux 2.6.10).

      * Threads: Number of threads in process containing this thread.

      * SigPnd, ShdPnd: Number of signals pending for thread and for process as a whole (see pthreads(7) and signal(7)).

      * SigBlk, SigIgn, SigCgt: Masks indicating signals being blocked, ignored, and caught (see signal(7)).

      * CapInh, CapPrm, CapEff: Masks of capabilities enabled in inheritable, permitted, and effective sets (see capabilities(7)).

      * CapBnd: Capability Bounding set (since kernel 2.6.26, see capabilities(7)).

      * Cpus_allowed: Mask of CPUs on which this process may run (since Linux 2.6.24, see cpuset(7)).

      * Cpus_allowed_list: Same as previous, but in "list format" (since Linux 2.6.26, see cpuset(7)).

      * Mems_allowed: Mask of memory nodes allowed to this process (since Linux 2.6.24, see cpuset(7)).

      * Mems_allowed_list: Same as previous, but in "list format" (since Linux 2.6.26, see cpuset(7)).

      * voluntary_context_switches, nonvoluntary_context_switches: Number of voluntary and involuntary context switches (since Linux 2.6.23).

task:
进程包含的线程,子目录名是线程的ID

转载于:https://www.cnblogs.com/zhengah/p/4835184.html

相关文章:

  • build-essential软件包
  • (转)iOS字体
  • 蚂蚁分类信息系统5.8 数据标签调用方法(四)
  • 如何利用ThinkPHP框架实现Excel数据导入和导出
  • 异常
  • Linux的系统层次
  • Js判断H5上下滑动方向及滑动到顶部和底部判断
  • 11991 - Easy Problem from Rujia Liu?(的基础数据结构)
  • Swift - 跑酷游戏开发(SpriteKit游戏开发)
  • cURL使用说明
  • 关于 hystrix 的异常 fallback method wasn't found
  • 【cl】sikuli下载安装
  • input使用javascript限制输入带小数的数字
  • Java-事务管理
  • 和菜鸟一起学linux内核源码之基础准备篇
  • 【node学习】协程
  • 【剑指offer】让抽象问题具体化
  • 【刷算法】从上往下打印二叉树
  • 【跃迁之路】【463天】刻意练习系列222(2018.05.14)
  • android高仿小视频、应用锁、3种存储库、QQ小红点动画、仿支付宝图表等源码...
  • Java 11 发布计划来了,已确定 3个 新特性!!
  • Java 9 被无情抛弃,Java 8 直接升级到 Java 10!!
  • Java 实战开发之spring、logback配置及chrome开发神器(六)
  • mysql常用命令汇总
  • Promise面试题,控制异步流程
  • puppeteer stop redirect 的正确姿势及 net::ERR_FAILED 的解决
  • python 学习笔记 - Queue Pipes,进程间通讯
  • Spark学习笔记之相关记录
  • Spring Cloud(3) - 服务治理: Spring Cloud Eureka
  • Three.js 再探 - 写一个跳一跳极简版游戏
  • Xmanager 远程桌面 CentOS 7
  • 测试如何在敏捷团队中工作?
  • 初探 Vue 生命周期和钩子函数
  • 基于阿里云移动推送的移动应用推送模式最佳实践
  • 用简单代码看卷积组块发展
  • #{} 和 ${}区别
  • #define、const、typedef的差别
  • #NOIP 2014#Day.2 T3 解方程
  • #我与Java虚拟机的故事#连载12:一本书带我深入Java领域
  • (附源码)springboot“微印象”在线打印预约系统 毕业设计 061642
  • (附源码)springboot车辆管理系统 毕业设计 031034
  • (附源码)springboot美食分享系统 毕业设计 612231
  • (附源码)ssm本科教学合格评估管理系统 毕业设计 180916
  • (附源码)ssm高校升本考试管理系统 毕业设计 201631
  • (算法)N皇后问题
  • (转)LINQ之路
  • (转)shell中括号的特殊用法 linux if多条件判断
  • (转)编辑寄语:因为爱心,所以美丽
  • .gitignore文件设置了忽略但不生效
  • .Net Core和.Net Standard直观理解
  • .net 简单实现MD5
  • .net 受管制代码
  • @Async注解的坑,小心
  • @DependsOn:解析 Spring 中的依赖关系之艺术
  • [ IOS ] iOS-控制器View的创建和生命周期