/proc/cpuinfo_Linux中的/ proc / cpuinfo和/ proc / meminfo文件

冷不防 2023-02-28 06:09 109阅读 0赞

/proc/cpuinfo

/proc is a directory in the Linux system that contains information about the system.

/ proc是Linux系统中的目录,其中包含有关系统的信息。

/proc is not a real file system, rather a virtual file system. It is sometimes also referred to as a process information pseudo-file system. This virtual file system is created on the fly when system boots and is dissolved at the time of system shut down.

/ proc不是真正的文件系统,而是虚拟文件系统。 有时也称为过程信息文件系统 。 该虚拟文件系统是在系统启动时动态创建的,并在系统关闭时被溶解。

It contains runtime system information instead of real files. To gain more information about the proc file read the man page.

它包含运行时系统信息,而不是实际文件。 要获取有关proc文件的更多信息,请阅读手册页。

We’ll look at two files particularly in /proc file system. /proc/cpuinfo and /proc/meminfo.

我们将研究两个文件,尤其是在/ proc文件系统中。 / proc / cpuinfo/ proc / meminfo。

/ proc / cpuinfo文件 (**The /proc/cpuinfo file**)

/proc/cpuinfo contains information about the processor, the Linux system is running on. It’s a read-only file.

/ proc / cpuinfo包含有关运行Linux系统的处理器的信息。 这是一个只读文件。

To view the proc/cpuinfo file use the cat command:

要查看proc / cpuinfo文件,请使用cat命令:

  1. $ cat /proc/cpuinfo

Proccpuinfo File

Proccpuinfo File Proccpuinfo文件

  1. processor : 0
  2. vendor_id : AuthenticAMD
  3. cpu family : 23
  4. model : 1
  5. model name : AMD EPYC 7501 32-Core Processor
  6. stepping : 2
  7. microcode : 0x1000065
  8. cpu MHz : 1999.650
  9. cache size : 512 KB
  10. physical id : 0
  11. siblings : 1
  12. core id : 0
  13. cpu cores : 1
  14. apicid : 0
  15. initial apicid : 0
  16. fpu : yes
  17. fpu_exception : yes
  18. cpuid level : 13
  19. wp : yes
  20. flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw perfctr_core ssbd ibpb vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 virt_ssbd arat
  21. bugs : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
  22. bogomips : 3999.30
  23. TLB size : 1024 4K pages
  24. clflush size : 64
  25. cache_alignment : 64
  26. address sizes : 40 bits physical, 48 bits virtual
  27. power management:

The contents of the file contain information about the processor.

该文件的内容包含有关处理器的信息。

It tells me that the model name of my processor is AMD EPYC 7501 32-Core Processor.

它告诉我处理器的型号名称是AMD EPYC 7501 32核处理器。

  • Vendor ID represents the name of the vendor that built the processor.

    供应商ID代表构建处理器的供应商的名称。

  • Cache size shows the amount of cache memory present.

    缓存大小显示存在的缓存内存量。

  • Processor value of 0 indicates a single processor system.

    处理器值0表示单个处理器系统。

  • Flags field shows which features are available in the CPU.

    标志字段显示CPU中可用的功能。

Together all this information tells the users about the architecture of the system in use.

所有这些信息共同告诉用户正在使用的系统的体系结构。

/ proc / meminfo文件 (**/proc/meminfo file**)

This file contains information about the system’s memory usage. To view the file we can use the cat command:

该文件包含有关系统内存使用情况的信息。 要查看文件,我们可以使用cat命令 :

  1. $ cat /proc/meminfo

Procmeminfo 1

  1. MemTotal: 2035428 kB
  2. MemFree: 195028 kB
  3. MemAvailable: 1692724 kB
  4. Buffers: 108020 kB
  5. Cached: 1451608 kB
  6. SwapCached: 16 kB
  7. Active: 539536 kB
  8. Inactive: 1072496 kB
  9. Active(anon): 33308 kB
  10. Inactive(anon): 27948 kB
  11. Active(file): 506228 kB
  12. Inactive(file): 1044548 kB
  13. Unevictable: 18512 kB
  14. Mlocked: 18512 kB
  15. SwapTotal: 524284 kB
  16. SwapFree: 524016 kB
  17. Dirty: 0 kB
  18. Writeback: 0 kB
  19. AnonPages: 70920 kB
  20. Mapped: 171140 kB
  21. Shmem: 676 kB
  22. KReclaimable: 134660 kB
  23. Slab: 179536 kB
  24. SReclaimable: 134660 kB
  25. SUnreclaim: 44876 kB
  26. KernelStack: 2156 kB
  27. PageTables: 2324 kB
  28. NFS_Unstable: 0 kB
  29. Bounce: 0 kB
  30. WritebackTmp: 0 kB
  31. CommitLimit: 1541996 kB
  32. Committed_AS: 383328 kB
  33. VmallocTotal: 34359738367 kB
  34. VmallocUsed: 19176 kB
  35. VmallocChunk: 0 kB
  36. Percpu: 828 kB
  37. HardwareCorrupted: 0 kB
  38. AnonHugePages: 0 kB
  39. ShmemHugePages: 0 kB
  40. ShmemPmdMapped: 0 kB
  41. FileHugePages: 0 kB
  42. FilePmdMapped: 0 kB
  43. CmaTotal: 0 kB
  44. CmaFree: 0 kB
  45. HugePages_Total: 0
  46. HugePages_Free: 0
  47. HugePages_Rsvd: 0
  48. HugePages_Surp: 0
  49. Hugepagesize: 2048 kB
  50. Hugetlb: 0 kB
  51. DirectMap4k: 102256 kB
  52. DirectMap2M: 1994752 kB
  53. DirectMap1G: 0 kB

The file contains information about free and used memory (both physical and swap) on the system as well as the shared memory and buffers used by the kernel.

该文件包含有关系统上的可用内存和已使用内存(物理内存和交换内存)以及内核使用的共享内存和缓冲区的信息。

Some of the important fields are :

一些重要的领域是:

  • MemTotal — Total amount of physical RAM in the system, in kilobytes.

    MemTotal-系统中物理RAM的总量,以千字节为单位。

  • MemFree — The amount of physical RAM, in kilobytes, left unused by the system.

    MemFree-系统未使用的物理RAM量(以千字节为单位)。

  • Buffers — The amount of physical RAM, in kilobytes, used for file buffers.

    缓冲区 -用于文件缓冲区的物理RAM量(以千字节为单位)。

  • Cached — The amount of physical RAM, in kilobytes, used as cache memory.

    缓存 -用作缓存的物理RAM量(以千字节为单位)。

  • SwapCached — The amount of swap space, in kilobytes, used as cache memory.

    SwapCached —用作缓存的交换空间量(以千字节为单位)。

结论 (**Conclusion )**

/proc/cpuinfo and /proc/meminfo are a part of the virtual /proc file system. These contain important and detailed information about the system’s processor and memory. Regular users might not require such information, however, system administrators might find it useful. To know more about the proc files read this.

/ proc / cpuinfo/ proc / meminfo是虚拟/ proc文件系统的一部分。 这些包含有关系统处理器和内存的重要而详细的信息。 普通用户可能不需要此类信息,但是,系统管理员可能会发现它很有用。 要了解有关proc文件的更多信息,请阅读此内容 。

翻译自: https://www.journaldev.com/41545/proc-cpuinfo-meminfo-files-linux

/proc/cpuinfo

发表评论

表情:
评论列表 (有 0 条评论,109人围观)

还没有评论,来说两句吧...

相关阅读

    相关 /proc/meminfo

    > cat /proc/meminfo 读出的内核信息进行解释, 下篇文章会简单对读出该信息的代码进行简单的分析。 MemTotal: 507480 kB

    相关 /proccpuinfo

    最近在研究[Linux][]系统负载的时候,接触到一些关于CPU信息查看的知识,和大家分享一下。通过对/proc/cpuinfo文件中的参数的分析,也学到了不少东西。 在li