zoukankan      html  css  js  c++  java
  • proc文件系统

    • 在linux系统中,proc文件系统用于导出内核的信息
    • proc文件系统一般是只读,也是可以通过编写代码给proc中添加信息,感兴趣可以在网上找一找代码来实现,用处不大。
    • 类比window系统的任务管理器
    • 学习方法参考"linux命令",知道有这个功能,用到的时候再去查即可

    meminfo

    cat /proc/meminfo

    返回结果:

    MemTotal:         613560 kB
    MemFree:          586892 kB
    Buffers:            2948 kB
    Cached:             4416 kB
    SwapCached:            0 kB
    Active:             2220 kB
    Inactive:           5460 kB
    Active(anon):        320 kB
    Inactive(anon):        0 kB
    Active(file):       1900 kB
    Inactive(file):     5460 kB
    Unevictable:           0 kB
    Mlocked:               0 kB
    HighTotal:        261120 kB
    HighFree:         256056 kB
    LowTotal:         352440 kB
    LowFree:          330836 kB
    SwapTotal:             0 kB
    SwapFree:              0 kB
    Dirty:                12 kB
    Writeback:             0 kB
    AnonPages:           360 kB
    返回结果(部分)
    • 常用参数
      • MemTotal:从内存
      • MemFree:空闲内存
      • Cached:缓存
      • Active:活跃内存
      • Inactive:非活跃内存

    cpuinfo

    cat /proc/cpuinfo

    返回结果:

    [root@iTOP-4412]# cat /proc/cpuinfo                                                                        
    cpu id          : 0xe4412011
    
    Processor       : ARMv7 Processor rev 0 (v7l)
    processor       : 0
    BogoMIPS        : 1992.29
    
    Features        : swp half thumb fastmult vfp edsp neon vfpv3 tls 
    CPU implementer : 0x41
    CPU architecture: 7
    CPU variant     : 0x3
    CPU part        : 0xc09
    CPU revision    : 0
    
    Hardware        : SMDK4X12
    Revision        : 0000
    Serial          : 0000000000000000
    返回结果
    • 常用参数:
      • cpu id:cpu代号
      • Processor:处理器

    interrupts

    cat /proc/interrupts

    测试结果;

    [root@iTOP-4412]# cat /proc/interrupts                                                                     
               CPU0       
     24:        330  s3c-uart  s5pv210-uart
     26:        815  s3c-uart  s5pv210-uart
     98:          0       GIC  s3c-pl330.0
     99:          0       GIC  s3c-pl330.1
    100:          0       GIC  s3c-pl330.2
    107:          0       GIC  s3c2410-wdt
    108:          0       GIC  s3c2410-rtc alarm
    121:          9       GIC  mct_comp_irq
    123:      31686       GIC  s3c2440-i2c.1
    125:          1       GIC  s3c2440-i2c.3
    126:         60       GIC  s3c2440-i2c.4
    127:          0       GIC  s3c2440-i2c.5
    129:          6       GIC  s3c2440-i2c.7
    134:      58467       GIC  ehci_hcd:usb1
    135:         55       GIC  s3c-udc
    139:          0       GIC  mmc1
    140:          0       GIC  mmc2
    141:       4221       GIC  mmc0
    142:          0       GIC  s3c-csis0
    144:          0       GIC  s3c-csis1
    148:          0       GIC  s3c-fimc0
    149:          0       GIC  s3c-fimc1
    150:          0       GIC  s3c-fimc2
    151:          0       GIC  s3c-fimc3
    152:          0       GIC  s5p-jpeg
    153:          0       GIC  s5p-fimg2d
    155:          0       GIC  s5p-mixer
    156:          0       GIC  s5p-hdmi
    158:          0       GIC  s3c-mfc
    160:          0       GIC  samsung-rp
    173:          0       GIC  samsung-keypad
    182:          0       GIC  mali_mmu_irq_handlers
    183:          0       GIC  mali_mmu_irq_handlers
    184:          0       GIC  mali_mmu_irq_handlers
    185:          0       GIC  mali_mmu_irq_handlers
    186:          0       GIC  mali_mmu_irq_handlers
    187:          0       GIC  mali_core_irq_handlers
    188:          0       GIC  mali_core_irq_handlers
    189:          0       GIC  mali_core_irq_handlers
    190:          0       GIC  mali_core_irq_handlers
    191:          0       GIC  mali_core_irq_handlers
    226:          0  COMBINER  s5p-sysmmu.1
    227:          0  COMBINER  s5p-sysmmu.2
    228:          0  COMBINER  s5p-sysmmu.3
    229:          0  COMBINER  s5p-sysmmu.4
    230:          0  COMBINER  s5p-sysmmu.5
    231:          0  COMBINER  s5p-sysmmu.15
    236:          0  COMBINER  s5p-sysmmu.12
    237:          0  COMBINER  s5p-sysmmu.14
    238:          0  COMBINER  s5p-sysmmu.13
    281:          0  COMBINER  s3cfb
    352:          1  exynos-eint
    359:          0  exynos-eint  s3c-sdhci.2
    361:          0  exynos-eint  BUTTON1
    362:          0  exynos-eint  BUTTON2
    367:          1  exynos-eint  s5m87xx-irq
    368:          0  exynos-eint  BUTTON4
    369:          0  exynos-eint  BUTTON5
    370:          0  exynos-eint  switch-gpio
    379:          0  exynos-eint  BUTTON3
    383:          1  exynos-eint  hpd
    428:          0   s5m8767  rtc-alarm0
    IPI0:          0          0          0          0  Timer broadcast interrupts
    IPI1:       1028       1134        601        367  Rescheduling interrupts
    IPI2:          2          6          7          4  Function call interrupts
    IPI3:          0          1          0          0  Single function call interrupts
    IPI4:          0          0          0          0  CPU stop interrupts
    IPI5:          0          0          0          0  CPU backtrace
    LOC:      86291        467       1287        804  Local timer interrupts
    Err:          0
    测试结果
    • 常用参数:里面是一些中断相关函数
    • 注册的中断都会在这里显示
    • 其他文件
      • 提供给大家一个文档"proc参数介绍",有时间可以看一看
      • 实际过程中,用到的时候可以通过网络查找
  • 相关阅读:
    如何知道电脑是几核?
    宝塔服务器管理助手Linux面版使用教程
    阿里云服务器怎么更换系统盘

    MoonScript
    webmin
    requests 0.7.6
    盘古搜索
    c练习总结
    Download a webpage using CURL in C
  • 原文地址:https://www.cnblogs.com/ch122633/p/9485883.html
Copyright © 2011-2022 走看看