Commit Graph

17 Commits

Author SHA1 Message Date
stuart nelson
450fe0f3ba Add test 2016-09-28 09:10:05 +02:00
stuart nelson
ee37a27d91 Export values as uint64_t 2016-09-20 23:27:56 +02:00
stuart nelson
e942d7e234 Maintain granularity in cpu data
Export cpu mode times as original uint64_t data,
and update frequency, and do the conversion to
float64 and subsequent division in go.
2016-09-20 09:10:53 +02:00
stuart nelson
57f88ac4f6 Update comment 2016-09-19 09:48:53 +02:00
stuart nelson
78c84b1a47 Remove old freq finding code
This is the code that was lifted from the freebsd
implementation, but was not correct.
2016-09-19 09:48:34 +02:00
stuart nelson
45ac033d9e Use correct frequency for calculating cpu time
The correct frequency is the systimer frequency,
not the stathz.

From one of the DragonFly developers:

The bump upon each statclock is:
((cur_systimer - prev_systimer) * systimer_freq) >> 32

systimer_freq can be extracted from following
sysctl in userspace:
sysctl kern.cputimer.freq
2016-09-19 09:35:41 +02:00
stuart nelson
8cc06aab04 Remove unneeded ncpu variable 2016-09-18 17:36:39 +02:00
stuart nelson
9f7822ccdc Remember to bzero string
Duplication was caused by malloc returning a
region of memory that already had data in it.
2016-09-18 16:17:49 +02:00
stuart nelson
c02dcdeb35 Remove unused comment. 2016-09-18 14:21:54 +02:00
stuart nelson
3e4a154656 Correctly exporting values
Moved to exporting via a string, which is then
split and parsed.

The string is sometimes duplicated, however.
2016-09-18 14:16:26 +02:00
stuart nelson
4b4385bd44 Remove free
Don't need it since we aren't malloc'ing
2016-09-17 19:14:31 +02:00
stuart nelson
cc5142a007 Remove some unnecessary includes 2016-09-17 19:13:05 +02:00
stuart nelson
a9d27ea722 Appears to be working? Still need to cleanup after self 2016-09-17 18:50:08 +02:00
stuart nelson
1d75b376ae checkpoint 2016-09-17 14:43:29 +02:00
stuart nelson
1b7a18c271 Creating slice from C-array
Might not be lined up correctly? Weird output data
in the second CPU.
2016-09-17 14:05:36 +02:00
stuart nelson
03da1ea516 successfully exporting one of 2 cpus 2016-09-10 21:13:06 +02:00
stuart nelson
cda2f493ee wip 2016-09-10 19:22:34 +02:00