I see , for the system scope PMCs, we neednot to update the counted value
of allocated PMCs. And when we need a system call to get the counted values,
we can directly read it from the hardware counters.
More over, I see in the comments
TODO: Only process-private counting mode PMCs may be attached to a
process different from the allocator process (since we do not have
the infrastructure to make sense of an interrupted PC value from a
'target' process (yet)).
Can I use the pmcstat tool to get the sampling result of another process?
such as the example in the man page:
pmcstat -P ic-misses -t 1234 -O /tmp/sample.out
thanks
华为技术有限公司 huawei_logo
地址:深圳市龙岗区坂田华为基地 邮编:518129
http://www.huawei.com
----------------------------------------------------------------------------
---------------------------------------------------------
本邮件及其附件含有华为公司的保密信息,仅限于发送给上面地址中列出的个人或群
组。禁
止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮
件中
的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!
This e-mail and its attachments contain confidential information from
HUAWEI, which
is intended only for the person or entity whose address is listed above. Any
use of the
information contained herein in any way (including, but not limited to,
total or partial
disclosure, reproduction, or dissemination) by persons other than the
intended
recipient(s) is prohibited. If you receive this e-mail in error, please
notify the sender by
phone or email immediately and delete it!
-----邮件原件-----
发件人: Joseph Koshy [mailto:jkoshy....@gmail.com] 代表 Joseph Koshy
发送时间: 03 June 2009 10:26
收件人: lifengkai
抄送: 'Joseph Koshy'
主题: Re: A question, thanks
> Anohter question
>
> For process scope PMCs, we can update the virtual pmc's counted value
> when the threads are switch in/out/eixt,
>
> but I cannot figure out when the virtual counted values are updated
> for the system scope PMCs.
> I am really lost in it, and hoping you can give me some instructions.
System-scope PMCs run independently of which process is executing.
These PMCs aren't changed when threads get scheduled.
BTW, I have sent an an invite to the pmctools-discuss Google group.
That would be a better place for discussion.
Koshy
The comment is obsolete. Deleted in FreeBSD SVN#193388.
> Can I use the pmcstat tool to get the sampling result of another process?
> such as the example in the man page:
> pmcstat -P ic-misses -t 1234 -O /tmp/sample.out
Yes.
Koshy
> my understanding of it is like the following:
> for the process counting module, we can specify the allocated pmc to
> count the value of the events for the target process and its
> decendents, so the for the pmc allocated we can have many targets,
> and the targets are linked together by "pm->pm_targets". Each time
> csw in or out, we update the per pmc saved value "pm_savedvalue", so
> all thread's events counted value can be added together.
At context switch out time, the incremental number of events seen by a
thread while it was on the CPU is added to the per-process count.
> for the sampling module, we use the per process value, each process
> has its own event counted value, their values are not added or mixed
> together.
As mentioned earlier in private mail, the current design is flawed for
process-private sampling PMCs attached to multi-threaded processes.
I am tracking the issue here:
http://code.google.com/p/pmctools/issues/detail?id=20
> Moreover, in your slides for process scope pmcs, "PMC is allocated &
> attached to a target process, Entire row of PMCs reserved across
> CPUs."
> For the case above, "the entire row of PMCs reserved " can be used
> for the target process and its children process, sotred in the
> pm_targets list?
The entire row gets reserved for process-mode PMCs and marked as 'out
of bounds' for system mode PMCs. There can be multiple process-mode
PMCs allocated to the same "row", and concurrently measuring events,
as long as the threads they are attached to are executing on the
different CPUs.
Koshy