Skip to content

Commit 556fbaa

Browse files
committed
extend time for detecting support for perf events to improve accuracy
1 parent fbb8212 commit 556fbaa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: cmd/metrics/metadata.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ func getPerfSupportedEvents(myTarget target.Target, perfPath string) (supportedE
343343
func getSupportsRefCycles(myTarget target.Target, noRoot bool, perfPath string, localTempDir string) (supported bool, output string, err error) {
344344
scriptDef := script.ScriptDefinition{
345345
Name: "perf stat ref-cycles",
346-
Script: perfPath + " stat -a -e ref-cycles sleep .1",
346+
Script: perfPath + " stat -a -e ref-cycles sleep 1",
347347
Superuser: !noRoot,
348348
}
349349
scriptOutput, err := script.RunScript(myTarget, scriptDef, localTempDir)
@@ -369,7 +369,7 @@ func getSupportsRefCycles(myTarget target.Target, noRoot bool, perfPath string,
369369
func getSupportsFixedTMA(myTarget target.Target, noRoot bool, perfPath string, localTempDir string) (supported bool, output string, err error) {
370370
scriptDef := script.ScriptDefinition{
371371
Name: "perf stat tma",
372-
Script: perfPath + " stat -a -e '{cpu/event=0x00,umask=0x04,period=10000003,name='TOPDOWN.SLOTS'/,cpu/event=0x00,umask=0x81,period=10000003,name='PERF_METRICS.BAD_SPECULATION'/}' sleep .1",
372+
Script: perfPath + " stat -a -e '{cpu/event=0x00,umask=0x04,period=10000003,name='TOPDOWN.SLOTS'/,cpu/event=0x00,umask=0x81,period=10000003,name='PERF_METRICS.BAD_SPECULATION'/}' sleep 1",
373373
Superuser: !noRoot,
374374
}
375375
scriptOutput, err := script.RunScript(myTarget, scriptDef, localTempDir)
@@ -434,7 +434,7 @@ func getSupportsFixedEvent(myTarget target.Target, event string, uarch string, n
434434
}
435435
scriptDef := script.ScriptDefinition{
436436
Name: "perf stat " + event,
437-
Script: perfPath + " stat -a -e '{" + strings.Join(eventList, ",") + "}' sleep .1",
437+
Script: perfPath + " stat -a -e '{" + strings.Join(eventList, ",") + "}' sleep 1",
438438
Superuser: !noRoot,
439439
}
440440
scriptOutput, err := script.RunScript(myTarget, scriptDef, localTempDir)

0 commit comments

Comments
 (0)