Skip to content
This repository was archived by the owner on Mar 11, 2019. It is now read-only.

Commit 9b71358

Browse files
committed
fix(CPU sampling): Fix CPU sampling cpu device(s) selection.
1 parent d718ed6 commit 9b71358

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docker/sampling/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ COPY powerapi-sampling-cpu/target/universal/stage /powerapi-sampling-cpu
1212
WORKDIR /powerapi-sampling-cpu
1313

1414
ENTRYPOINT ["/powerapi-sampling-cpu/bin/sampling-cpu"]
15-
CMD ["--all", "results/sampling", "results/processing", "results/computing"]
15+
CMD ["--all", "results/sampling", "results/processing", "results/computing"]

powerapi-sampling-cpu/src/main/scala/org/powerapi/sampling/cpu/Application.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ package org.powerapi.sampling.cpu
2424

2525
import java.io.File
2626

27-
import org.apache.commons.io.filefilter.PrefixFileFilter
27+
import org.apache.commons.io.filefilter.RegexFileFilter
28+
import org.powerapi.module.libpfm.LibpfmHelper
2829

2930
import scala.sys
3031
import scala.sys.process.stringSeqToProcess
31-
import org.powerapi.module.libpfm.LibpfmHelper
3232

3333
/**
3434
* Main application.
@@ -42,7 +42,7 @@ object Application extends App {
4242
val backup = scala.collection.mutable.HashMap[String, (String, Option[Long])]()
4343

4444
if (new File("/sys/devices/system/cpu/").exists()) {
45-
for (file <- new File("/sys/devices/system/cpu/").list(new PrefixFileFilter("cpu"))) {
45+
for (file <- new File("/sys/devices/system/cpu/").list(new RegexFileFilter("^cpu\\d+$"))) {
4646
val governor = Seq("cat", s"/sys/devices/system/cpu/$file/cpufreq/scaling_governor").lineStream.toArray.apply(0)
4747
val frequency = Seq("cat", s"/sys/devices/system/cpu/$file/cpufreq/scaling_setspeed").lineStream.toArray.apply(0)
4848

0 commit comments

Comments
 (0)