What is this `gmain` process with these unknown PIDs in my trace file?
Clash Royale CLAN TAG#URR8PPP
Reading up on an answer to find out which process registered inotify watchers, I executed the following commands
echo 1 | sudo tee /sys/kernel/debug/tracing/events/syscalls/sys_exit_inotify_add_watch/enable
sudo cat /sys/kernel/debug/tracing/trace
The resulting output from the trace
file had a header that indicated that the first column should have the name of the process (task?), along with the PID:
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
gmain-1715 [004] .... 23200.386116: sys_inotify_add_watch -> 0xfffffffffffffffe
Surprisingly, none of the PIDs listed in the many lines of output exist when I grep for them using ps -ef | grep $THE_PID
(where $THE_PID would be 1715). Also, the task name is unknown to me and does not exist in the ps
output either.
Further, the entire list is all tuples like gmain-<some number>
. Not the expected postgres
or node
. So what is this gmain
process? And what are these PIDs that do not exist in /proc/? Are they historic by the time I try accessing them?
I see gmain
is a thing in these kernel docs by Theodore Ts'o on tracing, so it's something.
linux linux-kernel inotify tracing
add a comment |
Reading up on an answer to find out which process registered inotify watchers, I executed the following commands
echo 1 | sudo tee /sys/kernel/debug/tracing/events/syscalls/sys_exit_inotify_add_watch/enable
sudo cat /sys/kernel/debug/tracing/trace
The resulting output from the trace
file had a header that indicated that the first column should have the name of the process (task?), along with the PID:
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
gmain-1715 [004] .... 23200.386116: sys_inotify_add_watch -> 0xfffffffffffffffe
Surprisingly, none of the PIDs listed in the many lines of output exist when I grep for them using ps -ef | grep $THE_PID
(where $THE_PID would be 1715). Also, the task name is unknown to me and does not exist in the ps
output either.
Further, the entire list is all tuples like gmain-<some number>
. Not the expected postgres
or node
. So what is this gmain
process? And what are these PIDs that do not exist in /proc/? Are they historic by the time I try accessing them?
I see gmain
is a thing in these kernel docs by Theodore Ts'o on tracing, so it's something.
linux linux-kernel inotify tracing
1
this is not answering your actual question, but the original problem: that answer you link to is not the best approach; info about watches set by inotify is present since linux 3.8 in/proc/PID/fdinfo/FD
, so you can adapt my answer to a similar question:find /proc/*/fd -lname anon_inode:inotify -printf '%hinfo/%fn' 2>/dev /null | xargs grep -c '^inotify'
. There are better answers (using fdinfo) even to the question you're linking to.
– mosvy
Feb 22 at 16:03
Ooh, nice oneliner! I even learned a new thing with the-c
option. Genius.
– oligofren
Feb 22 at 16:17
@mosvy I cobbled togheter this utility script from your comment: github.com/fatso83/dotfiles/blob/master/utils/scripts/…. Thanks!
– oligofren
Feb 22 at 17:07
add a comment |
Reading up on an answer to find out which process registered inotify watchers, I executed the following commands
echo 1 | sudo tee /sys/kernel/debug/tracing/events/syscalls/sys_exit_inotify_add_watch/enable
sudo cat /sys/kernel/debug/tracing/trace
The resulting output from the trace
file had a header that indicated that the first column should have the name of the process (task?), along with the PID:
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
gmain-1715 [004] .... 23200.386116: sys_inotify_add_watch -> 0xfffffffffffffffe
Surprisingly, none of the PIDs listed in the many lines of output exist when I grep for them using ps -ef | grep $THE_PID
(where $THE_PID would be 1715). Also, the task name is unknown to me and does not exist in the ps
output either.
Further, the entire list is all tuples like gmain-<some number>
. Not the expected postgres
or node
. So what is this gmain
process? And what are these PIDs that do not exist in /proc/? Are they historic by the time I try accessing them?
I see gmain
is a thing in these kernel docs by Theodore Ts'o on tracing, so it's something.
linux linux-kernel inotify tracing
Reading up on an answer to find out which process registered inotify watchers, I executed the following commands
echo 1 | sudo tee /sys/kernel/debug/tracing/events/syscalls/sys_exit_inotify_add_watch/enable
sudo cat /sys/kernel/debug/tracing/trace
The resulting output from the trace
file had a header that indicated that the first column should have the name of the process (task?), along with the PID:
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
gmain-1715 [004] .... 23200.386116: sys_inotify_add_watch -> 0xfffffffffffffffe
Surprisingly, none of the PIDs listed in the many lines of output exist when I grep for them using ps -ef | grep $THE_PID
(where $THE_PID would be 1715). Also, the task name is unknown to me and does not exist in the ps
output either.
Further, the entire list is all tuples like gmain-<some number>
. Not the expected postgres
or node
. So what is this gmain
process? And what are these PIDs that do not exist in /proc/? Are they historic by the time I try accessing them?
I see gmain
is a thing in these kernel docs by Theodore Ts'o on tracing, so it's something.
linux linux-kernel inotify tracing
linux linux-kernel inotify tracing
edited Feb 22 at 15:22
oligofren
asked Feb 22 at 15:16
oligofrenoligofren
1499
1499
1
this is not answering your actual question, but the original problem: that answer you link to is not the best approach; info about watches set by inotify is present since linux 3.8 in/proc/PID/fdinfo/FD
, so you can adapt my answer to a similar question:find /proc/*/fd -lname anon_inode:inotify -printf '%hinfo/%fn' 2>/dev /null | xargs grep -c '^inotify'
. There are better answers (using fdinfo) even to the question you're linking to.
– mosvy
Feb 22 at 16:03
Ooh, nice oneliner! I even learned a new thing with the-c
option. Genius.
– oligofren
Feb 22 at 16:17
@mosvy I cobbled togheter this utility script from your comment: github.com/fatso83/dotfiles/blob/master/utils/scripts/…. Thanks!
– oligofren
Feb 22 at 17:07
add a comment |
1
this is not answering your actual question, but the original problem: that answer you link to is not the best approach; info about watches set by inotify is present since linux 3.8 in/proc/PID/fdinfo/FD
, so you can adapt my answer to a similar question:find /proc/*/fd -lname anon_inode:inotify -printf '%hinfo/%fn' 2>/dev /null | xargs grep -c '^inotify'
. There are better answers (using fdinfo) even to the question you're linking to.
– mosvy
Feb 22 at 16:03
Ooh, nice oneliner! I even learned a new thing with the-c
option. Genius.
– oligofren
Feb 22 at 16:17
@mosvy I cobbled togheter this utility script from your comment: github.com/fatso83/dotfiles/blob/master/utils/scripts/…. Thanks!
– oligofren
Feb 22 at 17:07
1
1
this is not answering your actual question, but the original problem: that answer you link to is not the best approach; info about watches set by inotify is present since linux 3.8 in
/proc/PID/fdinfo/FD
, so you can adapt my answer to a similar question: find /proc/*/fd -lname anon_inode:inotify -printf '%hinfo/%fn' 2>/dev /null | xargs grep -c '^inotify'
. There are better answers (using fdinfo) even to the question you're linking to.– mosvy
Feb 22 at 16:03
this is not answering your actual question, but the original problem: that answer you link to is not the best approach; info about watches set by inotify is present since linux 3.8 in
/proc/PID/fdinfo/FD
, so you can adapt my answer to a similar question: find /proc/*/fd -lname anon_inode:inotify -printf '%hinfo/%fn' 2>/dev /null | xargs grep -c '^inotify'
. There are better answers (using fdinfo) even to the question you're linking to.– mosvy
Feb 22 at 16:03
Ooh, nice oneliner! I even learned a new thing with the
-c
option. Genius.– oligofren
Feb 22 at 16:17
Ooh, nice oneliner! I even learned a new thing with the
-c
option. Genius.– oligofren
Feb 22 at 16:17
@mosvy I cobbled togheter this utility script from your comment: github.com/fatso83/dotfiles/blob/master/utils/scripts/…. Thanks!
– oligofren
Feb 22 at 17:07
@mosvy I cobbled togheter this utility script from your comment: github.com/fatso83/dotfiles/blob/master/utils/scripts/…. Thanks!
– oligofren
Feb 22 at 17:07
add a comment |
2 Answers
2
active
oldest
votes
These are not processes. These are tasks. Linux works in terms of tasks. You do not see their IDs in a process list because these tasks happen to be threads within a process. They are the worker threads of some multi-threaded GIO process somewhere. You'll find them in the task/
subdirectory of the /proc/<process>
subdirectory (example /proc/860/task/926
).
You posted just as I did :-) Didn't know about thetask
directory though. Thanks!
– oligofren
Feb 22 at 16:06
add a comment |
As suspected, this gmain
process had something to do with GTK or Gnome, but the thing to note is that it wasn't a process at all, but a thread (the gtk main loop)! That's also why it didn't show when grepping ps
.
I understood this when using the -q
option to ps
, which lets you list the pids you are interested in. The pid that came up wasn't the one I passed as an option at all, but still showed when I did pstree -p
, which made me think this was perhaps some kind of thread.
Using my newfound knowledge, I found that I could list all the threads, that also have PIDs (is this the right name?) of their own by supplying ps
with the -L
option.
Example: sudo ps -efL -q 906
.
This (and pstree
) led me to find out that the thread belonged to NetworkManager
).
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502334%2fwhat-is-this-gmain-process-with-these-unknown-pids-in-my-trace-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
These are not processes. These are tasks. Linux works in terms of tasks. You do not see their IDs in a process list because these tasks happen to be threads within a process. They are the worker threads of some multi-threaded GIO process somewhere. You'll find them in the task/
subdirectory of the /proc/<process>
subdirectory (example /proc/860/task/926
).
You posted just as I did :-) Didn't know about thetask
directory though. Thanks!
– oligofren
Feb 22 at 16:06
add a comment |
These are not processes. These are tasks. Linux works in terms of tasks. You do not see their IDs in a process list because these tasks happen to be threads within a process. They are the worker threads of some multi-threaded GIO process somewhere. You'll find them in the task/
subdirectory of the /proc/<process>
subdirectory (example /proc/860/task/926
).
You posted just as I did :-) Didn't know about thetask
directory though. Thanks!
– oligofren
Feb 22 at 16:06
add a comment |
These are not processes. These are tasks. Linux works in terms of tasks. You do not see their IDs in a process list because these tasks happen to be threads within a process. They are the worker threads of some multi-threaded GIO process somewhere. You'll find them in the task/
subdirectory of the /proc/<process>
subdirectory (example /proc/860/task/926
).
These are not processes. These are tasks. Linux works in terms of tasks. You do not see their IDs in a process list because these tasks happen to be threads within a process. They are the worker threads of some multi-threaded GIO process somewhere. You'll find them in the task/
subdirectory of the /proc/<process>
subdirectory (example /proc/860/task/926
).
edited Feb 22 at 16:27
oligofren
1499
1499
answered Feb 22 at 16:02
JdeBPJdeBP
37.2k476178
37.2k476178
You posted just as I did :-) Didn't know about thetask
directory though. Thanks!
– oligofren
Feb 22 at 16:06
add a comment |
You posted just as I did :-) Didn't know about thetask
directory though. Thanks!
– oligofren
Feb 22 at 16:06
You posted just as I did :-) Didn't know about the
task
directory though. Thanks!– oligofren
Feb 22 at 16:06
You posted just as I did :-) Didn't know about the
task
directory though. Thanks!– oligofren
Feb 22 at 16:06
add a comment |
As suspected, this gmain
process had something to do with GTK or Gnome, but the thing to note is that it wasn't a process at all, but a thread (the gtk main loop)! That's also why it didn't show when grepping ps
.
I understood this when using the -q
option to ps
, which lets you list the pids you are interested in. The pid that came up wasn't the one I passed as an option at all, but still showed when I did pstree -p
, which made me think this was perhaps some kind of thread.
Using my newfound knowledge, I found that I could list all the threads, that also have PIDs (is this the right name?) of their own by supplying ps
with the -L
option.
Example: sudo ps -efL -q 906
.
This (and pstree
) led me to find out that the thread belonged to NetworkManager
).
add a comment |
As suspected, this gmain
process had something to do with GTK or Gnome, but the thing to note is that it wasn't a process at all, but a thread (the gtk main loop)! That's also why it didn't show when grepping ps
.
I understood this when using the -q
option to ps
, which lets you list the pids you are interested in. The pid that came up wasn't the one I passed as an option at all, but still showed when I did pstree -p
, which made me think this was perhaps some kind of thread.
Using my newfound knowledge, I found that I could list all the threads, that also have PIDs (is this the right name?) of their own by supplying ps
with the -L
option.
Example: sudo ps -efL -q 906
.
This (and pstree
) led me to find out that the thread belonged to NetworkManager
).
add a comment |
As suspected, this gmain
process had something to do with GTK or Gnome, but the thing to note is that it wasn't a process at all, but a thread (the gtk main loop)! That's also why it didn't show when grepping ps
.
I understood this when using the -q
option to ps
, which lets you list the pids you are interested in. The pid that came up wasn't the one I passed as an option at all, but still showed when I did pstree -p
, which made me think this was perhaps some kind of thread.
Using my newfound knowledge, I found that I could list all the threads, that also have PIDs (is this the right name?) of their own by supplying ps
with the -L
option.
Example: sudo ps -efL -q 906
.
This (and pstree
) led me to find out that the thread belonged to NetworkManager
).
As suspected, this gmain
process had something to do with GTK or Gnome, but the thing to note is that it wasn't a process at all, but a thread (the gtk main loop)! That's also why it didn't show when grepping ps
.
I understood this when using the -q
option to ps
, which lets you list the pids you are interested in. The pid that came up wasn't the one I passed as an option at all, but still showed when I did pstree -p
, which made me think this was perhaps some kind of thread.
Using my newfound knowledge, I found that I could list all the threads, that also have PIDs (is this the right name?) of their own by supplying ps
with the -L
option.
Example: sudo ps -efL -q 906
.
This (and pstree
) led me to find out that the thread belonged to NetworkManager
).
edited Feb 22 at 17:08
answered Feb 22 at 16:02
oligofrenoligofren
1499
1499
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502334%2fwhat-is-this-gmain-process-with-these-unknown-pids-in-my-trace-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
this is not answering your actual question, but the original problem: that answer you link to is not the best approach; info about watches set by inotify is present since linux 3.8 in
/proc/PID/fdinfo/FD
, so you can adapt my answer to a similar question:find /proc/*/fd -lname anon_inode:inotify -printf '%hinfo/%fn' 2>/dev /null | xargs grep -c '^inotify'
. There are better answers (using fdinfo) even to the question you're linking to.– mosvy
Feb 22 at 16:03
Ooh, nice oneliner! I even learned a new thing with the
-c
option. Genius.– oligofren
Feb 22 at 16:17
@mosvy I cobbled togheter this utility script from your comment: github.com/fatso83/dotfiles/blob/master/utils/scripts/…. Thanks!
– oligofren
Feb 22 at 17:07