From 58461f1f72209c465149ae89ed83c14640fb99c7 Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Fri, 9 Sep 2022 20:01:21 +0200 Subject: [PATCH] Fix clock frequency coming from LikwidCollector and update docs --- collectors/likwidMetric.go | 7 ++++--- collectors/likwidMetric.md | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/collectors/likwidMetric.go b/collectors/likwidMetric.go index c036415..f22d486 100644 --- a/collectors/likwidMetric.go +++ b/collectors/likwidMetric.go @@ -159,7 +159,8 @@ func getBaseFreq() float64 { data := strings.Replace(string(buffer), "\n", "", -1) x, err := strconv.ParseInt(data, 0, 64) if err == nil { - freq = float64(x) * 1e6 + freq = float64(x) + break } } } @@ -168,11 +169,11 @@ func getBaseFreq() float64 { C.power_init(0) info := C.get_powerInfo() if float64(info.baseFrequency) != 0 { - freq = float64(info.baseFrequency) * 1e6 + freq = float64(info.baseFrequency) } C.power_finalize() } - return freq + return freq * 1e3 } func (m *LikwidCollector) Init(config json.RawMessage) error { diff --git a/collectors/likwidMetric.md b/collectors/likwidMetric.md index 1bb211f..54640dc 100644 --- a/collectors/likwidMetric.md +++ b/collectors/likwidMetric.md @@ -7,6 +7,9 @@ The `likwid` collector is probably the most complicated collector. The LIKWID li "likwid": { "force_overwrite" : false, "invalid_to_zero" : false, + "liblikwid_path" : "/path/to/liblikwid.so", + "accessdaemon_path" : "/folder/that/contains/likwid-accessD", + "access_mode" : "direct or accessdaemon or perf_event", "eventsets": [ { "events" : {