Perf Tool monitoring by PID

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











up vote
3
down vote

favorite












I'm using linux perf tool to monitor the performance of some processes. The documentation tells that you can flag it to collect profiles on per-thread, per-process and per-cpu basis.



I get that the processor would have performance registers collecting event-counts for a given physical-core and it's resources (e.g. L1-caches).



How does perf or any such performance monitoring tool, measure counters per-process or per-thread basis? For example, let's say I'm monitoring L1-cache-misses, now since the cache is shared for all processes running on that CPU, how does perf determine how many misses came from a given process or a given thread?










share|improve this question























  • "How does perf or any such performance monitoring tool, measure counters per-process or per-thread basis? " this Q could be overly broad.
    – slm♦
    Aug 20 at 13:10






  • 1




    dtrace type monitoring was built into the Linux kernel - brendangregg.com/blog/2016-10-27/dtrace-for-linux-2016.html. Methods used to collect perf data are covered here - brendangregg.com/perf.html.
    – slm♦
    Aug 20 at 13:17















up vote
3
down vote

favorite












I'm using linux perf tool to monitor the performance of some processes. The documentation tells that you can flag it to collect profiles on per-thread, per-process and per-cpu basis.



I get that the processor would have performance registers collecting event-counts for a given physical-core and it's resources (e.g. L1-caches).



How does perf or any such performance monitoring tool, measure counters per-process or per-thread basis? For example, let's say I'm monitoring L1-cache-misses, now since the cache is shared for all processes running on that CPU, how does perf determine how many misses came from a given process or a given thread?










share|improve this question























  • "How does perf or any such performance monitoring tool, measure counters per-process or per-thread basis? " this Q could be overly broad.
    – slm♦
    Aug 20 at 13:10






  • 1




    dtrace type monitoring was built into the Linux kernel - brendangregg.com/blog/2016-10-27/dtrace-for-linux-2016.html. Methods used to collect perf data are covered here - brendangregg.com/perf.html.
    – slm♦
    Aug 20 at 13:17













up vote
3
down vote

favorite









up vote
3
down vote

favorite











I'm using linux perf tool to monitor the performance of some processes. The documentation tells that you can flag it to collect profiles on per-thread, per-process and per-cpu basis.



I get that the processor would have performance registers collecting event-counts for a given physical-core and it's resources (e.g. L1-caches).



How does perf or any such performance monitoring tool, measure counters per-process or per-thread basis? For example, let's say I'm monitoring L1-cache-misses, now since the cache is shared for all processes running on that CPU, how does perf determine how many misses came from a given process or a given thread?










share|improve this question















I'm using linux perf tool to monitor the performance of some processes. The documentation tells that you can flag it to collect profiles on per-thread, per-process and per-cpu basis.



I get that the processor would have performance registers collecting event-counts for a given physical-core and it's resources (e.g. L1-caches).



How does perf or any such performance monitoring tool, measure counters per-process or per-thread basis? For example, let's say I'm monitoring L1-cache-misses, now since the cache is shared for all processes running on that CPU, how does perf determine how many misses came from a given process or a given thread?







linux process profiling perf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 20 at 12:55









slm♦

238k65493664




238k65493664










asked Aug 20 at 5:03









Nikhilesh Singh

166




166











  • "How does perf or any such performance monitoring tool, measure counters per-process or per-thread basis? " this Q could be overly broad.
    – slm♦
    Aug 20 at 13:10






  • 1




    dtrace type monitoring was built into the Linux kernel - brendangregg.com/blog/2016-10-27/dtrace-for-linux-2016.html. Methods used to collect perf data are covered here - brendangregg.com/perf.html.
    – slm♦
    Aug 20 at 13:17

















  • "How does perf or any such performance monitoring tool, measure counters per-process or per-thread basis? " this Q could be overly broad.
    – slm♦
    Aug 20 at 13:10






  • 1




    dtrace type monitoring was built into the Linux kernel - brendangregg.com/blog/2016-10-27/dtrace-for-linux-2016.html. Methods used to collect perf data are covered here - brendangregg.com/perf.html.
    – slm♦
    Aug 20 at 13:17
















"How does perf or any such performance monitoring tool, measure counters per-process or per-thread basis? " this Q could be overly broad.
– slm♦
Aug 20 at 13:10




"How does perf or any such performance monitoring tool, measure counters per-process or per-thread basis? " this Q could be overly broad.
– slm♦
Aug 20 at 13:10




1




1




dtrace type monitoring was built into the Linux kernel - brendangregg.com/blog/2016-10-27/dtrace-for-linux-2016.html. Methods used to collect perf data are covered here - brendangregg.com/perf.html.
– slm♦
Aug 20 at 13:17





dtrace type monitoring was built into the Linux kernel - brendangregg.com/blog/2016-10-27/dtrace-for-linux-2016.html. Methods used to collect perf data are covered here - brendangregg.com/perf.html.
– slm♦
Aug 20 at 13:17
















active

oldest

votes











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%2f463566%2fperf-tool-monitoring-by-pid%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f463566%2fperf-tool-monitoring-by-pid%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?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?