diff --git a/client/devkit_client/__init__.py b/client/devkit_client/__init__.py index 60afa4dfb643d43683f80af873c01530e255f3e5..cfdac6e3b3547923f990f8045780cfff3ae44b17 100644 --- a/client/devkit_client/__init__.py +++ b/client/devkit_client/__init__.py @@ -1454,12 +1454,13 @@ def _obtain_trace(ssh, sftp, args): capture_cmd = f'gpu-trace --capture --no-gpuvis -o {remote_trace_file}' _, err_text, exit_status = _simple_ssh(ssh, capture_cmd) - if err_text.find('Capture request failed') != -1 or err_text.find('Failed to capture a perf trace.') != -1: - # recognize this error, tell the daemon to start tracing and try again + if exit_status != 0 or err_text.find('Failed to capture trace') != -1: + # recognize this error, tell the daemon to start tracing # (assuming that tracing mode not enabled is the cause .. this is fragile unfortunately) logger.info('start tracing and try again') start_cmd = 'gpu-trace --start' _simple_ssh(ssh, start_cmd) + # issue again _, err_text, exit_status = _simple_ssh(ssh, capture_cmd) if exit_status != 0: