Page MenuHomeFreeBSD

PMC: Collect user call chains while in kernel space

Authored by jtl on Jul 28 2016, 2:57 PM.


Group Reviewers

Currently, when PMC is sampling call chains, it will sample a user-space call chain when the counter fires while in user space and will sample kernel-space call chains when the counter fires while in kernel space. This is useful functionality and should not be discarded.

However, there are cases where a user really wants to know the user-space call chain every time the sample counter fires, even if the sample counter fires while in kernel mode. This change adds this capability, which is activated when the user specifies an optional parameter.

(To go a step further, we discussed at BSDCan the fact that a user might like to be able to see both the kernel and user call chains associated with each sampling interval. However, this patch does not go that far.)

Note: This patch is against stable/10 + D4227 (diff 1). Once D4227 is committed, I will regenerate the patch against CURRENT. Until that time, this is probably more of a draft than a serious proposal.

Test Plan

This has been tested within Juniper on a large-scale multi-threaded app. I also plan to run some simple pathological threaded apps (constantly starting/stopping threads, several threads with long-running tight loops) which I've used for basic PMC sanity-testing for previous changes.

Diff Detail

rS FreeBSD src repository - subversion
Lint Skipped
Unit Tests Skipped

Event Timeline

jtl retitled this revision from to PMC: Collect user call chains while in kernel space.
jtl updated this object.
jtl edited the test plan for this revision. (Show Details)
jtl added reviewers: jhb, pmc.
jtl set the repository for this revision to rS FreeBSD src repository - subversion.
jtl added a subscriber: stevek.
gnn added a reviewer: gnn.
gnn added inline comments.

Silly request but can you remove "normal" here because it makes me think of normalization of samples of data. I think that just pmc_add_sample() would be fine.

This revision is now accepted and ready to land.Jul 29 2016, 10:26 PM
sbruno requested changes to this revision.Jul 15 2017, 4:26 PM
sbruno added a subscriber: sbruno.

This review definitely needs D4227 updated and committed before it can land.

This revision now requires changes to proceed.Jul 15 2017, 4:27 PM

@jtl Can you close this as it appears @mmacy committed functionally the same thing? Or is there work yet to be done here?

This was largely committed by mmacy last year.