-
-
Save wholivesinapineappleunderthesea/24a93adcbafb08705e542bd0fc5e815f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma D option destructive | |
#pragma D option quiet | |
dtrace:::BEGIN | |
{ | |
printf("Begin\n"); | |
} | |
pid$target:dxasm:*:entry | |
{ | |
/* | |
printf("function %s @ %i\n", probefunc, timestamp); | |
*/ | |
self->kthread = (struct nt`_KTHREAD *)curthread; | |
/* | |
printf("ETHREAD: %p\n", self->kthread); | |
*/ | |
self->threadcounters = (struct nt`_KTHREAD_COUNTERS *)self->kthread->ThreadCounters; | |
/* | |
printf("KTHREAD_COUNTERS: %p\n", self->threadcounters); | |
*/ | |
self->hwcnts = (int)self->threadcounters->HardwareCounters; | |
printf("HardwareCounters: %i\n", self->hwcnts); | |
self->hw0 = (struct nt`_COUNTER_READING )self->threadcounters->HwCounter[0]; | |
self->hw0start = (int)self->hw0.Start; | |
self->hw0total = (int)self->hw0.Total; | |
printf("HwCounter 0: %i -> %i\n", self->hw0start, self->hw0total); | |
self->hw1 = (struct nt`_COUNTER_READING )self->threadcounters->HwCounter[1]; | |
self->hw1start = (int)self->hw1.Start; | |
self->hw1total = (int)self->hw1.Total; | |
printf("HwCounter 1: %i -> %i\n", self->hw1start, self->hw1total); | |
self->hw2 = (struct nt`_COUNTER_READING )self->threadcounters->HwCounter[2]; | |
self->hw2start = (int)self->hw2.Start; | |
self->hw2total = (int)self->hw2.Total; | |
printf("HwCounter 2: %i -> %i\n", self->hw2start, self->hw2total); | |
self->hw3 = (struct nt`_COUNTER_READING )self->threadcounters->HwCounter[3]; | |
self->hw3start = (int)self->hw3.Start; | |
self->hw3total = (int)self->hw3.Total; | |
printf("HwCounter 3: %i -> %i\n", self->hw3start, self->hw3total); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment