Open gibmat opened 1 year ago
@gibmat yeah, I remember noticing that on Fedora awhile back too. I don't know the code base (or golang itself) well enough to fix it, but I suspect you're right and it needs separate big endian and little endian MMV dumps to verify with.
Do you know how those test files were created? I do have access to the Debian porter boxes, so I can help debug/fix this in a s390x environment.
Not 100% sure but from poking around the code just now I can see similar sorts of MMV files would be created by some of the ./examples/* content. For instance ./examples/simple/main.go seems to create the metric listed in test1.mmv ...
nathans@fedora:~/git/speed$ /var/lib/pcp/pmdas/mmv/mmvdump ./mmvdump/testdata/test1.mmv
MMV file = ./mmvdump/testdata/test1.mmv
Version = 1
Generated = 1468770536
TOC count = 3
Cluster = 127
Process = 29956
Flags = 0x2 (process)
TOC[0]: toc offset 40, metrics offset 88 (1 entries)
[725/88] simple.counter
type=32-bit int (0x0), sem=counter (0x1), pad=0x0
units=count
(no indom)
shorttext=A Simple Metric
helptext=This is a simple counter metric to demonstrate the speed API
TOC[1]: offset 56, values offset 192 (1 entries)
[725/192] simple.counter = 42
TOC[2]: offset 72, string offset 224 (2 entries)
[1/224] A Simple Metric
[2/480] This is a simple counter metric to demonstrate the speed API
nathans@fedora:~/git/speed$
I've recently packaged this library for Debian, and when its tests are run on a big-endian system (s390x), several of the tests fail. My initial guess is that since the mmvdump test files were created on a little-endian system, they are being read improperly on the big-endian system.