Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracelog vs. xperf #1

Open
mikedn opened this issue Sep 7, 2017 · 3 comments
Open

tracelog vs. xperf #1

mikedn opened this issue Sep 7, 2017 · 3 comments

Comments

@mikedn
Copy link

mikedn commented Sep 7, 2017

The xperf that ships with the current Windows SDK doesn't seem to have the -pmcprofile option so it's not possible to use it to configure the profile source. Options:

  • Remove the option. It looks like InstructionsRetired is the default in my experiments
  • Replace xperf with tracelog:
tracelog -start pmc_counters -eflag PROC_THREAD+LOADER+PMC_PROFILE+PROFILE -ProfileSource InstructionRetired -f pmc.etl

That said, it's not clear to me how useful this PMC_PROFILE thing is. As far as I can tell this alone can't give accurate numbers due to thread switching. Or perhaps I'm missing something?

@mikedn
Copy link
Author

mikedn commented Sep 7, 2017

cc @AndyAyersMS

@AndyAyersMS
Copy link
Owner

Thanks for pointing out a non-xperf way of running this.

I've found the Instructions retired data to be quite useful, especially for jit TP analysis. I have gotten very stable numbers this way (~ 0.1% variation from run to run in most cases).

@mikedn
Copy link
Author

mikedn commented Sep 12, 2017

I've found the Instructions retired data to be quite useful, especially for jit TP analysis. I have gotten very stable numbers this way (~ 0.1% variation from run to run in most cases).

Indeed, it works very well. The sampling frequency is so high that errors resulting from (usually infrequent) thread switching are likely minimal.

I also tried to use the PMC information reported via CSWITCH events and the results are practically identical - ~0.02% more instructions, possibly due to kernel work (ISR/APC/DPC stuff). However, CSWITCH events occasionally fail to work correctly, they report significantly fewer instructions. Oddly enough, this only happens when no other applications are running on the machine. PMC_PROFILE appears to work correctly in all circumstances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants