[tools] Fully implement linux-perf tools --timeout
Change-Id: I462af434a695a09c9b65b11759e01aace463b414 No-Try: True Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3755147 Auto-Submit: Camillo Bruni <cbruni@chromium.org> Reviewed-by: Igor Sheludko <ishell@chromium.org> Commit-Queue: Igor Sheludko <ishell@chromium.org> Cr-Commit-Position: refs/heads/main@{#81641}
This commit is contained in:
parent
db1a66b53d
commit
45867618b2
@ -5,6 +5,7 @@
|
||||
|
||||
import optparse
|
||||
from pathlib import Path
|
||||
from datetime import datetime, timedelta
|
||||
import os
|
||||
import shlex
|
||||
import subprocess
|
||||
@ -114,8 +115,11 @@ JS_FLAGS_PERF = ("--perf-prof", "--no-write-protect-code-memory",
|
||||
|
||||
|
||||
def wait_for_process_timeout(process):
|
||||
sleeping_time = 0
|
||||
while (sleeping_time < options.timeout):
|
||||
delta = timedelta(seconds=options.timeout)
|
||||
start_time = datetime.now()
|
||||
while True:
|
||||
if (datetime.now() - start_time) >= delta:
|
||||
return False
|
||||
processHasStopped = process.poll() is not None
|
||||
if processHasStopped:
|
||||
return True
|
||||
|
@ -3,7 +3,7 @@
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timedelta
|
||||
from pathlib import Path
|
||||
import optparse
|
||||
import os
|
||||
@ -166,8 +166,11 @@ log("LINUX PERF CMD: ", shlex.join(cmd))
|
||||
|
||||
|
||||
def wait_for_process_timeout(process):
|
||||
sleeping_time = 0
|
||||
while (sleeping_time < options.timeout):
|
||||
delta = timedelta(seconds=options.timeout)
|
||||
start_time = datetime.now()
|
||||
while True:
|
||||
if (datetime.now() - start_time) >= delta:
|
||||
return False
|
||||
processHasStopped = process.poll() is not None
|
||||
if processHasStopped:
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user