Questions tagged [procfs]

The proc filesystem is a virtual filesystem through which kernels of Unix-like operating systems, including Linux, expose process and kernel information. It is commonly mounted at /proc and implements a view of the system process table inside the file system. It provides a two-level view of process space.

Procfs, also known as the proc filesystem, is a virtual filesystem normally mounted at /proc. The details vary between unix variants, but on most, /proc/PID is a file or a directory that exposes information about the running process whose id is PID.

In addition, /proc can expose information about other aspects on the system. Linux, in particular, exposes information about mounted filesystems, network status, connected devices and more. This use is partly phased out in favor of the newer .

234 questions
0
votes
2 answers

thread level memory consumption of process

How do I get per thread based memory consumption of a process in Linux? I understand that we can use /proc/pid/task/tid/statm, but thats not helping my case. All the threads show same value and its same as PID's statm. We can do valgrind but I am…
Jack
  • 1,398
  • 3
  • 16
  • 26
0
votes
2 answers

Which libraries appear in /proc/$PID/pmaps?

On Linux you can inspect /proc/$PID/pmaps to see the libraries loaded by a particular program, and a program can open /proc/self/pmaps to examine the libraries it itself has loaded. I know pmaps will only contain dynamic libraries, and obviously the…
Joseph Garvin
  • 20,727
  • 18
  • 94
  • 165
0
votes
2 answers

finding out thread information

I have a list of processes running in my system and the threads belonging to these processes. I want to know if there is anyway to get the complete information about a specific thread, for example: priority, function it executes, etc.
Sid Ramadoss
  • 521
  • 2
  • 6
  • 13
0
votes
1 answer

how to print contents of proc/meminfo in a kernel module?

I am currently working on making a kernel module that would print certain contents of proc/meminfo (SwapTotal to be specific) into the kernel using printk. Unfortunately all the guides on the net teach you how to open your own procfs file. Is it…
0
votes
2 answers

How can I peek at values from a thread for time to time?

I'm projecting a monitoring client in Java which will read information from /proc. I have a main class MonitoringClient and ProcParser class. My ProcParser extends Thread. I thought it would be a good approach to instantiate many (four: cpu, memory,…
Pedro Dusso
  • 2,100
  • 9
  • 34
  • 64
-1
votes
1 answer

How can I get the stat in linux?

I'm working in Linux and C, and I am trying to get the specific values from stat. In /proc when I do stat I get multiple values returned. Now I'm trying to do this like below: thisFile = fopen("/proc/stat","r"); and print the individual User,…
tejosa
  • 135
  • 2
  • 11
-1
votes
1 answer

How to get the pid if i only know process name in linux using proc

I am going to make program to get process informaition(pid, process name, virtual memory, physical memory ) using procfs. and i want print like this PID Name Virtual physical shared 1 init 1234 123 22 33 firefox 33 33 2 I…
jijijijiji
  • 1,038
  • 11
  • 17
-1
votes
1 answer

How to perform sequential read in procfs?

#include #include #include #include #include #include #include //extern uint64_t interrupt_time; static struct proc_dir_entry…
user3458454
  • 291
  • 1
  • 4
  • 20
-1
votes
1 answer

Negative return value in open system call for file created in /proc file system

I have created a file in /proc named "test" (it was created in kernel). The file exists. When I want to open it in user level it returns negative. int fd; if((fd=open("/proc/test","O_RDONLY"))<0){ perror("open"); } The error that I see is…
Sara
  • 2,308
  • 11
  • 50
  • 76
1 2 3
15
16