2022 Developer Survey is open! Take survey.

Questions tagged [proc]

procfs (or the proc filesystem) is a special filesystem in UNIX-like operating systems that presents information about processes and other system information in a hierarchical file-like structure

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

How to get schedule delay information of each cpu?

I know that the scheduling information of each process can be obtained from procfs, but I don't know how to get the schedule delay information of each cpu. It's better to use procfs or syscall.
user avatar
  • 1
0 votes
0 answers
11 views

Present symbols in /proc/kallsyms with enabled KALLSYMS_ALL

If KALLSYMS_ALL is enabled on the kernel, are all the kernel symbols present in /proc/kallsyms? Or are there still some that aren't visible in it?
user avatar
  • 27
0 votes
1 answer
29 views

Why is VmallocTotal 34359738367 kB?

/proc/meminfo has a memory statistic VmallocTotal. It is described as Total size of vmalloc memory area. in proc's man page and elsewhere as Total memory available in kernel for vmalloc allocations ...
user avatar
2 votes
0 answers
26 views

What do the permissions mean in /proc/<pid>/fd/?

I'm looking at the result of running ls -l on /proc/<pid>/fd/: lr-x------ 1 root root 64 Apr 22 23:13 0 -> /dev/null lrwx------ 1 root root 64 Apr 22 23:13 1 -> 'socket:[19700]' lrwx------ ...
user avatar
1 vote
0 answers
23 views

How to get NSPid on kernel 3.10

In kernel 4.1 and above, /proc/[pid]/status contains these 4 lines: NStgid: 1 NSpid: 1 NSpgid: 1 NSsid: 1 This allow a process in parent namespace to know about that process' PID in all namespaces. ...
user avatar
  • 11
0 votes
1 answer
16 views

Kernel option in /sys change

If /proc/sys and /sys are the same, can I change the kernel options in /sys not in /proc/sys? If not, why?
user avatar
  • 45
1 vote
1 answer
70 views

Linux: difference between "/usr/bin/env" and "/usr/bin/strings /proc/$$/environ"

I am learning about linux and I have a question that I have encountered in one of the books I read: The following are two different ways to print out environment variables. Please describe their ...
user avatar
0 votes
3 answers
91 views

Given we have the API /proc/pid/status should/could /proc/pid/stat be deprecated?

I have a few questions about the process information avaiable in GNU/Linux via procfs. This was originally prompted by a desire to extract vmPeak, vmSize, vmRSS & vmHWM from within an application....
user avatar
0 votes
1 answer
153 views

/proc won't mount in kali linux running under Android

I'm now using kali Linux on termux. I had several problems like /proc is not mounted, /proc permission denied, etc. ps -auxtells this: > root@localhost:~# ps -aux > > Error: /proc must be ...
user avatar
0 votes
1 answer
57 views

How can `cat` read a file without a file descriptor?

I'm learning Linux procfs, which utilizes a virtual file system where operations like open, read, write, and release are processed by functions registered to it. I've left the open and release to null ...
user avatar
0 votes
1 answer
136 views

How to find the amount of time a process spends in user mode or kernel mode

I read through the docs for cat /proc/pid/stat It displays many numbers. The process I am calculating this for is running in an infinite loop. So the values will keep on changing. I see that there is ...
user avatar
  • 1
-1 votes
1 answer
48 views

Modify the number of interruption cat /proc/interruption

As you can see, when running the command cat /proc/interrupts, in the second column the number of interrupts delivered to each CPU per device driver. test@test:~$ cat /proc/interrupts CPU0 ...
user avatar
0 votes
1 answer
33 views

Programmatically ascertain aspects of socket file

I'm trying to write a program (in C) which, as one of its features, walks the procfs to find open sockets and ascertain things like the destination/source ports/addresses (similar to what netstat and ...
user avatar
1 vote
1 answer
37 views

from where htop collects IO read/write data for one current user proccess without root?

I cant find a way to capture htop output for a single process about IO_RATE IO_READ_RATE IO_WRITE_RATE. I need it (the last few seconds IO (or just 1s), not the overall accumulated IO) to determine if ...
user avatar
0 votes
2 answers
155 views

How to change /proc/*/environ of a bash shell

This is the shell's PID: nathan@guixlaptop ~ $ $$ bash: 10984: command not found I export an environment variable: nathan@guixlaptop ~ $ export TESTVAR=test The variable is not found in the shell's ...
user avatar
0 votes
2 answers
107 views

What PSI cpu full means?

I've found two articles about PSI, and both of them say that cpu has only "some" metric. atop shows only "cpu some" too. But my system has "cpu full" metric: $ cat /proc/...
user avatar
  • 101
0 votes
1 answer
42 views

Where in the filesystem can I get metadata about a socket?

I know lsof and ss provide metadata about connections. Where do they get it from? For example, this represents a connection: ls -al /proc/102922/fd/98 lrwx------ 1 me me 64 dic 21 06:06 /proc/102922/...
user avatar
0 votes
0 answers
56 views

What are unnumbered interrupts in /proc/stat?

According to man page for the /proc/stat "intr" field: The first column is the total of all interrupts serviced including unnumbered architecture specific interrupts; each subsequent column ...
user avatar
  • 2,010
1 vote
0 answers
67 views

Format the output of "read_file uptime" in i3status

I'm trying to display my system uptime with i3status. This is what I have in my i3status.conf file: read_file uptime { format = "%title: %content" path = "/proc/uptime" } ...
user avatar
  • 11
0 votes
1 answer
119 views

Dumping virtual memory addresses of an executable from /proc/pid/maps

I want to dump the virtual memory addresses of a running executable. This is the command I'm running: ./executable & cat /proc/$(pidof executable)/maps > maps.dump, and this is the error I get: ...
user avatar
2 votes
1 answer
32 views

Unexpected behavior when checking file size

I'm trying to write a 1 line bash script that will get all PIDs of processes that look like kernel processes, and check to see if they have contents in /proc/*/maps, which indicated kernel process ...
user avatar
0 votes
1 answer
19 views

Writing to procfs file opened with r+ does not change modification timestamp (as opposed to opened with w) - any particular reason?

Noted for a file in /proc modification timestamp is not changed when file is written to after being open in r+ mode (but changed if opened in w mode). Any particular reason why is it working that way? ...
user avatar
1 vote
0 answers
31 views

inconsistency between fuser and /proc/$PID/fd

I wanted to find out what prevents the root filesystem on a certain from being remounted read-only. fuser -vm / found a few files which are supposed to be opened for writing. For example: root ...
user avatar
  • 81.5k
-2 votes
1 answer
943 views

What does the output of `ll /proc/self/fd/` (from `ll /dev/fd`) mean?

Related, but not duplicates: /dev/fd inconsistency How does /dev/fd relate to /proc/self/fd/? Why does process substitution result in a file called /dev/fd/63 which is a pipe? On Ubuntu 18.04 and 20....
user avatar
2 votes
3 answers
635 views

How to set a file that is owned by a user but not readable by the owner?

I'm looking through the /proc directory and, as user, I'm not able to list a directory even though it shows that user is the owner. Why and how does this happen? For instance, in ls -l /proc/2323/...
user avatar
30 votes
2 answers
6k views

Is there any reason why /proc/*/cmdline is world-readable?

Maybe I haven't had enough coffee yet today, but I can't remember or think of any reason why /proc/PID/cmdline should be world-readable - after all, /proc/PID/environ isn't. Making it readable only by ...
user avatar
  • 66.6k
2 votes
2 answers
146 views

Linux mount point in proc virtual filesystem?

I was asked to move this question here from stackoverflow. I did fork guitmz's memrun repo (for asm and go). I did provide memrun and memfd_create for C in my fork: https://github.com/Hermann-SW/...
user avatar
4 votes
0 answers
188 views

/proc/diskstats disk time spent writing more than 1000ms*CPU-core-count per second

I'm interested in how could one interpret the results of procfs-diskstats. It looks like an API, but I see no exhaustive explanation in Internet or man pages or Linux kernel Documentation. There is a ...
user avatar
  • 265
0 votes
0 answers
44 views

List ALL interrupts (currently in use or not)

I understand that /proc/interrupts contains a list of interrupts currently in use. I am just curious where I can find a list of ALL interrupts (including their names), whether they are in use or not, ...
user avatar
0 votes
1 answer
40 views

capture commands from each PID and calculate the memory consuming of command in GIGA ( with sort way )

I am running this approach in order to verify the commands that consuming memory from high to low on linux redhat machine I wrote this approach as 1024/1024 , in order to get the values in GIGA ps -...
user avatar
  • 10.9k
1 vote
1 answer
85 views

Get the unresolved pwd of a shell from another process

I'm hitting an issue where I need to get the unresolved symlink of a shell process. For example given a symlink ~/link -> ~/actual, if bash is launched with a $PWD of ~/link, I need to fetch that ...
user avatar
0 votes
1 answer
105 views

How to install/create the /proc/cpuinfo file in SUSE12?

I have a system which has /proc/cpuinfo and a system which does not: /proc/cpuinfo : No such file or directory Both of them run SUSE12. I'm trying to figure out how to have this file on the second ...
user avatar
  • 63
0 votes
0 answers
81 views

`ps -o lstart` vs. PID-file vs. /proc/PID

I need to verify validity of PID-files -- to find any stale ones. To this end, I verify, that: the recorded PID still exists and belongs to the right UID (using kill -0). the process' start-time is ...
user avatar
2 votes
1 answer
50 views

cd into `/proc/xxx` works even if there is no process [duplicate]

today I found something strange about the /proc folder. There is a PID (7825) which I cannot see as a running process via ps, also I cannot see the process id when I make ls /proc BUT I can see it ...
user avatar
  • 153
-2 votes
3 answers
211 views

Why do we need procfs at `/proc`?

So I know the stuff in /proc is not an actual file system but a pseudo-filesystem (647551). Now my question is: Why do we even have it there? Having the procfs listed like a file system allows ...
user avatar
9 votes
6 answers
3k views

How is having processes kept as files in `/proc` not a performance issue?

I understand that "everything is a file" is not entirely true, but as far as I know, every process gets a directory in /proc with lots of files. Read/write operations are often great ...
user avatar
1 vote
0 answers
13 views

Symlink to file in /proc [duplicate]

I was looking at some different files in /proc, and observed some strange behavior. So, first of all, we know that symlinks [point to names, not files][1]. And when creating a symlink, I can both ...
user avatar
  • 151
0 votes
1 answer
50 views

calculating ifa flags larger then 0xFF from /proc/net/if_inet6

I have been trying to write some code for puppetlabs facter program to parse the ifa flags from /proc/net/if_inet6. currently the code works well detecting flags for values < FF but struggles ...
user avatar
  • 146
1 vote
1 answer
295 views

Mounting proc with hidepid option doesn’t hide procs as expected, why?

I have a regular proc fs mounted at /proc by default. (I’m root for all of the following commands) I’m mounting the same again at a different location with hidepid option set like so: mount -t proc -o ...
user avatar
  • 138
0 votes
1 answer
376 views

How to get open file descriptors/handles using libprocps in c program

I am trying to create a performance display for my IOT device. The device uses Linux so , i want to get the number of file handles programmatically using C program. Currently i am using libprocps API ...
user avatar
  • 13
0 votes
1 answer
103 views

List open files without lsof/fuser at a particular path

On a system that doesn't have lsof or fuser, is it possible to get a list of open files at a particular path? E.g., I'm looking to dismount /volume1 (a software RAID) to run e2fsck and can't, because ...
user avatar
  • 1,320
2 votes
1 answer
608 views

how to interpret octal flags in /proc/PID/fdinfo/N

The procps manpage states that the flags field in files in /proc/PID/fdinfo/ is an octal number indicating the file access mode and file status flags. The open manpage gives explanations of various ...
user avatar
  • 145
1 vote
0 answers
156 views

How to find out how many RAM slot?

I have to extend my RAM memory, Because I need to use Android Studio. I need to find out how many RAM slot via lshw command or greping /proc contents.I don't want to open my laptop. How can I find out?...
user avatar
  • 10.2k
0 votes
1 answer
181 views

Is there a reliable path to specific device events?

I'm running ubuntu linux and I have a bluetooth mouse that I would like to capture evdev events from. The problem is that the event device can potentially be different any time I connect the mouse: ...
user avatar
  • 285
0 votes
1 answer
76 views

I want to display specific infomation from /proc/cpuinfo

I want to Show the number of CPUs, the producer of the CPUs and the CPU model. I have used cat /proc/cpuinfo to show the cpuinfo. however i want to only display the needed information. e.g. processor ...
user avatar
0 votes
1 answer
81 views

Why cwd in /proc/nautilus_pid/cwd always points to /home/username?

I wanted to check the current directory opened in nautilus window. I check the pid of nautilus, and symbolic link proc/pid/cwd, always points to home directory. Is this expected behaviour? If so ...
user avatar
  • 5,410
1 vote
1 answer
40 views

Bind-mount and cryptsetup result in truncated root-path in /proc/self/mountinfo

I have an encrypted container containing an ext4 filesystem with a subdirectory which is bind-mounted at a later point in time. If I take look at /proc/self/mountinfo, the root-directory for the mount ...
user avatar
3 votes
1 answer
303 views

Where does one find the total number of context switches performed since bootup?

I figured out that the number of context switches performed by a process can be found in /proc/$$/status. I have been trying to look for the total number of context switches performed since bootup. I ...
user avatar
  • 131
3 votes
1 answer
120 views

How to access /proc/ file (procfs) via SSHFS

Using a computer with Ubuntu 16.04 (no update suggestions please) I mounted /proc/ at my Raspberry Pi 3B + (linux kernel version 4.19.88) via SSHFS: sshfs pi@192.168.0.4:/proc ~/procAtPi ls -la ~/...
user avatar
  • 133
2 votes
1 answer
926 views

Getting the executable name in Linux from /proc/ and detect if it's truncated

The executable name is linux can be read in various ways. By reading /proc/[pid]/comm, which contains a string that's truncated after reaching 16 characters or TASK_COMM_LEN. By reading /proc/[pid]/...
user avatar
  • 1,635

1
2 3 4 5
11