What is this `gmain` process with these unknown PIDs in my trace file?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












1















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.










share|improve this question



















  • 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















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.










share|improve this question



















  • 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








1








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.










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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












  • 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










2 Answers
2






active

oldest

votes


















3














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).






share|improve this answer

























  • You posted just as I did :-) Didn't know about the task directory though. Thanks!

    – oligofren
    Feb 22 at 16:06



















0














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).






share|improve this answer
























    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
    );



    );













    draft saved

    draft discarded


















    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









    3














    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).






    share|improve this answer

























    • You posted just as I did :-) Didn't know about the task directory though. Thanks!

      – oligofren
      Feb 22 at 16:06
















    3














    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).






    share|improve this answer

























    • You posted just as I did :-) Didn't know about the task directory though. Thanks!

      – oligofren
      Feb 22 at 16:06














    3












    3








    3







    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).






    share|improve this answer















    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).







    share|improve this answer














    share|improve this answer



    share|improve this answer








    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 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

















    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














    0














    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).






    share|improve this answer





























      0














      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).






      share|improve this answer



























        0












        0








        0







        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).






        share|improve this answer















        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).







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 22 at 17:08

























        answered Feb 22 at 16:02









        oligofrenoligofren

        1499




        1499



























            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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






            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay