Getting Information about locks associated with a process

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











up vote
0
down vote

favorite












I am unable to list the locks associated with a process and information about the locks i.e How many threads share this lock etc.



Kindly tell my how to extract this information from a process ID.



My case:



i have run sysbench command



sysbench --test=threads --thread-locks=100 --max-time=20s run



i want to list locks that sysbench just created and information about the locks i.e which threads the sharing this lock etc







share|improve this question

























    up vote
    0
    down vote

    favorite












    I am unable to list the locks associated with a process and information about the locks i.e How many threads share this lock etc.



    Kindly tell my how to extract this information from a process ID.



    My case:



    i have run sysbench command



    sysbench --test=threads --thread-locks=100 --max-time=20s run



    i want to list locks that sysbench just created and information about the locks i.e which threads the sharing this lock etc







    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am unable to list the locks associated with a process and information about the locks i.e How many threads share this lock etc.



      Kindly tell my how to extract this information from a process ID.



      My case:



      i have run sysbench command



      sysbench --test=threads --thread-locks=100 --max-time=20s run



      i want to list locks that sysbench just created and information about the locks i.e which threads the sharing this lock etc







      share|improve this question













      I am unable to list the locks associated with a process and information about the locks i.e How many threads share this lock etc.



      Kindly tell my how to extract this information from a process ID.



      My case:



      i have run sysbench command



      sysbench --test=threads --thread-locks=100 --max-time=20s run



      i want to list locks that sysbench just created and information about the locks i.e which threads the sharing this lock etc









      share|improve this question












      share|improve this question




      share|improve this question








      edited May 9 at 11:21
























      asked May 9 at 10:57









      Muhammad Umer Saeed

      11




      11




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          you can get lock process list using below command



          lslocks





          share|improve this answer





















          • lslocks does not list the locks associated with a process in my case I am running sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run Locks associated with sysbench are not listing in lslocks
            – Muhammad Umer Saeed
            May 9 at 11:17

















          up vote
          0
          down vote













          If you're talking about file locks,



          lsof -p PID


          will list all files opened by process with PID.



          lsof -c processname


          will list all files opened by processname.



          Note that lsof lists also files opened only for read i.e. without file locks. The mode under which a file is open is specified as the fourth character in the FD (File Descriptor) column in the output:



           r for read access;
          w for write access;
          u for read and write access;
          space if mode unknown and no lock
          character follows;
          `-' if mode unknown and lock
          character follows.





          share|improve this answer























          • I have run sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run
            – Muhammad Umer Saeed
            May 9 at 11:15










          • now i want to list the locks that sysbench just created and find information about the locks i.e which threads are sharing these locks
            – Muhammad Umer Saeed
            May 9 at 11:16










          • Then please edit your question and add this information there.
            – dr01
            May 9 at 11:17










          • Edited thanks a lot
            – Muhammad Umer Saeed
            May 9 at 11:26










          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f442731%2fgetting-information-about-locks-associated-with-a-process%23new-answer', 'question_page');

          );

          Post as a guest






























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          you can get lock process list using below command



          lslocks





          share|improve this answer





















          • lslocks does not list the locks associated with a process in my case I am running sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run Locks associated with sysbench are not listing in lslocks
            – Muhammad Umer Saeed
            May 9 at 11:17














          up vote
          0
          down vote













          you can get lock process list using below command



          lslocks





          share|improve this answer





















          • lslocks does not list the locks associated with a process in my case I am running sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run Locks associated with sysbench are not listing in lslocks
            – Muhammad Umer Saeed
            May 9 at 11:17












          up vote
          0
          down vote










          up vote
          0
          down vote









          you can get lock process list using below command



          lslocks





          share|improve this answer













          you can get lock process list using below command



          lslocks






          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered May 9 at 11:05









          jayeshkh007

          1093




          1093











          • lslocks does not list the locks associated with a process in my case I am running sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run Locks associated with sysbench are not listing in lslocks
            – Muhammad Umer Saeed
            May 9 at 11:17
















          • lslocks does not list the locks associated with a process in my case I am running sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run Locks associated with sysbench are not listing in lslocks
            – Muhammad Umer Saeed
            May 9 at 11:17















          lslocks does not list the locks associated with a process in my case I am running sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run Locks associated with sysbench are not listing in lslocks
          – Muhammad Umer Saeed
          May 9 at 11:17




          lslocks does not list the locks associated with a process in my case I am running sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run Locks associated with sysbench are not listing in lslocks
          – Muhammad Umer Saeed
          May 9 at 11:17












          up vote
          0
          down vote













          If you're talking about file locks,



          lsof -p PID


          will list all files opened by process with PID.



          lsof -c processname


          will list all files opened by processname.



          Note that lsof lists also files opened only for read i.e. without file locks. The mode under which a file is open is specified as the fourth character in the FD (File Descriptor) column in the output:



           r for read access;
          w for write access;
          u for read and write access;
          space if mode unknown and no lock
          character follows;
          `-' if mode unknown and lock
          character follows.





          share|improve this answer























          • I have run sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run
            – Muhammad Umer Saeed
            May 9 at 11:15










          • now i want to list the locks that sysbench just created and find information about the locks i.e which threads are sharing these locks
            – Muhammad Umer Saeed
            May 9 at 11:16










          • Then please edit your question and add this information there.
            – dr01
            May 9 at 11:17










          • Edited thanks a lot
            – Muhammad Umer Saeed
            May 9 at 11:26














          up vote
          0
          down vote













          If you're talking about file locks,



          lsof -p PID


          will list all files opened by process with PID.



          lsof -c processname


          will list all files opened by processname.



          Note that lsof lists also files opened only for read i.e. without file locks. The mode under which a file is open is specified as the fourth character in the FD (File Descriptor) column in the output:



           r for read access;
          w for write access;
          u for read and write access;
          space if mode unknown and no lock
          character follows;
          `-' if mode unknown and lock
          character follows.





          share|improve this answer























          • I have run sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run
            – Muhammad Umer Saeed
            May 9 at 11:15










          • now i want to list the locks that sysbench just created and find information about the locks i.e which threads are sharing these locks
            – Muhammad Umer Saeed
            May 9 at 11:16










          • Then please edit your question and add this information there.
            – dr01
            May 9 at 11:17










          • Edited thanks a lot
            – Muhammad Umer Saeed
            May 9 at 11:26












          up vote
          0
          down vote










          up vote
          0
          down vote









          If you're talking about file locks,



          lsof -p PID


          will list all files opened by process with PID.



          lsof -c processname


          will list all files opened by processname.



          Note that lsof lists also files opened only for read i.e. without file locks. The mode under which a file is open is specified as the fourth character in the FD (File Descriptor) column in the output:



           r for read access;
          w for write access;
          u for read and write access;
          space if mode unknown and no lock
          character follows;
          `-' if mode unknown and lock
          character follows.





          share|improve this answer















          If you're talking about file locks,



          lsof -p PID


          will list all files opened by process with PID.



          lsof -c processname


          will list all files opened by processname.



          Note that lsof lists also files opened only for read i.e. without file locks. The mode under which a file is open is specified as the fourth character in the FD (File Descriptor) column in the output:



           r for read access;
          w for write access;
          u for read and write access;
          space if mode unknown and no lock
          character follows;
          `-' if mode unknown and lock
          character follows.






          share|improve this answer















          share|improve this answer



          share|improve this answer








          edited May 9 at 11:11


























          answered May 9 at 11:03









          dr01

          15.2k114768




          15.2k114768











          • I have run sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run
            – Muhammad Umer Saeed
            May 9 at 11:15










          • now i want to list the locks that sysbench just created and find information about the locks i.e which threads are sharing these locks
            – Muhammad Umer Saeed
            May 9 at 11:16










          • Then please edit your question and add this information there.
            – dr01
            May 9 at 11:17










          • Edited thanks a lot
            – Muhammad Umer Saeed
            May 9 at 11:26
















          • I have run sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run
            – Muhammad Umer Saeed
            May 9 at 11:15










          • now i want to list the locks that sysbench just created and find information about the locks i.e which threads are sharing these locks
            – Muhammad Umer Saeed
            May 9 at 11:16










          • Then please edit your question and add this information there.
            – dr01
            May 9 at 11:17










          • Edited thanks a lot
            – Muhammad Umer Saeed
            May 9 at 11:26















          I have run sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run
          – Muhammad Umer Saeed
          May 9 at 11:15




          I have run sysbench command sysbench --test=threads --thread-locks=100 --max-time=20s run
          – Muhammad Umer Saeed
          May 9 at 11:15












          now i want to list the locks that sysbench just created and find information about the locks i.e which threads are sharing these locks
          – Muhammad Umer Saeed
          May 9 at 11:16




          now i want to list the locks that sysbench just created and find information about the locks i.e which threads are sharing these locks
          – Muhammad Umer Saeed
          May 9 at 11:16












          Then please edit your question and add this information there.
          – dr01
          May 9 at 11:17




          Then please edit your question and add this information there.
          – dr01
          May 9 at 11:17












          Edited thanks a lot
          – Muhammad Umer Saeed
          May 9 at 11:26




          Edited thanks a lot
          – Muhammad Umer Saeed
          May 9 at 11:26












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442731%2fgetting-information-about-locks-associated-with-a-process%23new-answer', 'question_page');

          );

          Post as a guest













































































          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