Hello,
Pfmon and perfmon2 can measure of a per-thread basis. A thread meaning a kernel visible thread as create with pthread_create(). A perfmon2 session can only be attached to one thread at a time. To monitor muli-threaded applications, you need to create one session per thread. The current version of pfmon knows how to follow thread creation and monitor newly created thread. However, when you attach to an already running multi-threaded process, pfmon will not create a session for all the existing threads. This could be added to the tool. For now, you need to designate which thread inside that process you want to monitor. You need to attach to each thread of interest manually. When you run ps ax, you get the process id. Typically the thread id of the first thread is equal to the process id. To get the thread id of the other threads, you need to use ps -L ax for instance. On Thu, Jul 10, 2008 at 3:56 AM, Jiangtian Li <[EMAIL PROTECTED]> wrote: > Hi, All, > > I am trying to combine --attach-task with --following-all so that I can > attach to an running thread and monitor all the threads it creates, > according to the section 5 in the documentation. I tested using > pthreadtest in the tests directory with >>./pthreadtest 10000000000 8 & >>ps ax | fgrep pthreadtest > 24844 pts/0 Rl 0:50 ./pthreadtest 10000000000 8 >>pfmon -v --attach-task=24844 --follow-all > > But at the end, only one thread was monitored, as can be seen from the > last lines of the output: > ... > created tasks : 1 > maximum tasks : 1 > maximum active tasks : 1 > ... > > I am using kernel 2.6.25, libpfm-3.4 and pfmon-3.4. The cpu is > Intel(R) Xeon(R) CPU E5410 @ 2.33GHz > > So I am just wondering what is the correct way to do in this case. Thank > you very much for your help! > > Best regards, > Jiangtian > > > > > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > perfmon2-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/perfmon2-devel > ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ perfmon2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/perfmon2-devel
