2/23/2017

Proc 기본정보 사용 (추후 수정)

1. proc 기본정보


  • boot parameter or kernel argument 확인 

$ cat /proc/cmdline 
console=ttyO0,115200n8 root=PARTUUID=000390f5-02 rw rootfstype=ext4 rootwait


  • 현재 사용중이 Partition 들을 확인 가능

$ cat /proc/partitions

   1        0      65536 ram0
   1        1      65536 ram1
   1        2      65536 ram2
   1        3      65536 ram3
   1        4      65536 ram4
   1        5      65536 ram5
   1        6      65536 ram6
   1        7      65536 ram7
   1        8      65536 ram8
   1        9      65536 ram9
   1       10      65536 ram10
   1       11      65536 ram11
   1       12      65536 ram12
   1       13      65536 ram13
   1       14      65536 ram14
   1       15      65536 ram15
   8        0   31457280 sda
   8        1   27348992 sda1
   8        2          1 sda2
   8        5    4105216 sda5
   8       16   31457280 sdb
   8       17   31456256 sdb1
   8       32   31457280 sdc
   8       33   31456256 sdc1
   8       48    4194304 sdd
   8       49      71680 sdd1
   8       50    4105216 sdd2


  • CPU와 Memory 정보

$ cat /proc/meminfo
MemTotal:        3960996 kB
MemFree:         2002696 kB
MemAvailable:    3665304 kB
Buffers:          375672 kB
Cached:          1150728 kB
SwapCached:            0 kB
Active:          1418624 kB
Inactive:         288124 kB
Active(anon):     181164 kB
Inactive(anon):     7332 kB
Active(file):    1237460 kB
Inactive(file):   280792 kB
Unevictable:           0 kB
....


$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model  : 60
model name : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
stepping : 3
cpu MHz  : 2494.226
cache size : 6144 KB
....


$ cat /proc/kallsyms | less  // Kernel Symbol Table 
0000000000000000 A exception_stacks
0000000000000000 A gdt_page
0000000000000000 A espfix_waddr
0000000000000000 A espfix_stack
0000000000000000 A cpu_info
0000000000000000 A cpu_llc_shared_map
0000000000000000 A cpu_core_map
0000000000000000 A cpu_sibling_map
0000000000000000 A cpu_llc_id
0000000000000000 A this_cpu_off
0000000000000000 A cpu_number
0000000000000000 A x86_bios_cpu_apicid
...


$ cat /proc/interrupts  // interrupt information 
           CPU0       CPU1       CPU2       CPU3       
  0:         35          0          0          1   IO-APIC   2-edge      timer
  1:          0          0          0          9   IO-APIC   1-edge      i8042
  8:          0          0          0          0   IO-APIC   8-edge      rtc0
  9:          0          0          0          0   IO-APIC   9-fasteoi   acpi
 12:          0          0          0        156   IO-APIC  12-edge      i8042
 14:          0          0          0          0   IO-APIC  14-edge      ata_piix
 15:          0          0          0          0   IO-APIC  15-edge      ata_piix
 19:          0          0      36462        194   IO-APIC  19-fasteoi   ehci_hcd:usb1, eth0
 20:          0          0          0       7371   IO-APIC  20-fasteoi   vboxguest
 21:          0          0          0      62967   IO-APIC  21-fasteoi   0000:00:0d.0, snd_intel8x0
 22:          0          0          0         27   IO-APIC  22-fasteoi   ohci_hcd:usb2
NMI:          0          0          0          0   Non-maskable interrupts
LOC:     191624     195228     268926     116236   Local timer interrupts

...




PROC 정보
  https://en.wikipedia.org/wiki/Procfs
  https://ko.wikipedia.org/wiki/Procfs
  https://wiki.kldp.org/Translations/html/SysAdminGuide-KLDP/x1087.html#AEN1105
  https://www.joinc.co.kr/w/Site/system_programing/proc/GetSMSInfo

PROC 세부내역
  https://www.kernel.org/doc/Documentation/filesystems/proc.txt
  http://man7.org/linux/man-pages/man5/proc.5.html
PROC 등록예제
  https://wiki.kldp.org/wiki.php/ProcfsGuide
  http://sym4975.tistory.com/entry/%EB%A6%AC%EB%88%85%EC%8A%A4-proc-%EB%94%94%EB%A0%89%ED%86%A0%EB%A6%AC-%EA%B5%AC%EC%A1%B0%ED%8D%BC%EC%98%B4



Kernel 정보확인 hex값 이용

$ dd if=/proc/kcore | hexdump -C | less
$ sudo dd if=/proc/kcore | hd | less 



  http://wiki.linuxquestions.org/wiki/Some_dd_examples

mount 를 치면 현재 mount 된 정보가 나옴

$ mount 
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
.....


PS/TOP/VMSTAT
  http://cloudsemina.com/index.php?mid=linux&document_srl=163

재미있는 linux program 유용한 UTIL (추후 분리)
  http://cloudsemina.com/index.php?mid=linux&document_srl=296

TOP/LESS/MORE
  http://webdir.tistory.com/142

댓글 없음 :