From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 599884860E for ; Thu, 11 Jan 2024 12:53:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9056D68D023; Thu, 11 Jan 2024 14:53:13 +0200 (EET) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E76468A943 for ; Thu, 11 Jan 2024 14:53:07 +0200 (EET) Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-50e7c6f0487so5655521e87.3 for ; Thu, 11 Jan 2024 04:53:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1704977587; x=1705582387; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=E++HoygGcqt/Xwn8hyBZA+xVomJSMCCd8RP3nINXRN4=; b=I4oUdgxTG47R+EJScYv4pSp46l2bmRQITxRtzhg9oYWFmahuHFJNawmuuXK9WBUQir 2YIo6sP/IC0mAZcCleMUAAzRnUHN7Q/l7GsasZyrUfH6KRXARnVf1yfCtwNEl5fueNy0 hIByzm89ms71rag5mc7fdXmk5ltaboRTSG9xMFn1a/mMpxqvqc+kVfPD/lkz0bfp3Ytn zRmnZTHQCTgGGaZtbpnF7r4VjjeP1QpcCE2TP6NamvpP8BpER+Zu98K7HVa+EjJZEOvc 7PcJNs+fmfS0pWVp5OPKrEQOgRTg0/qANSMqwM2bjskY+eJFBC95SE3h2lW7jOxUBYYJ 4EnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704977587; x=1705582387; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=E++HoygGcqt/Xwn8hyBZA+xVomJSMCCd8RP3nINXRN4=; b=RG9RQhRzAjuXbBJYClk9q44kP7V2WuQnCVzbIeMCueR6ByAbg9SUI7LJrGMgsX/Jw7 UXfymUhs8TcjREhdlmRgnHafU1Aua1/EyflWvbYcPizO1ZvD4bNOZ0lwMW/RSI8uTCJr 6rPzhCcb9Iy+1iuysaXX73om1iXrAaU+FvJsLudpv4Ww0wYmCyjTw6R72Ads40UWGokq 8xu3BzY4Zz1E4MlzlEvmy6yK65422YaTrPnRgwQ33DTWt8R+4S4HrOGjWDbDVP0eG2pJ UxtXba12lUSJTlhYM7NVFiVPo47gG+VJfHcsXdWpFZOsj56vydhwFPRi9Aq00U2xnMtZ tlBw== X-Gm-Message-State: AOJu0YyT/O5edDniG3brFZeZyWu4WJB6hVP9O5aSgU54Ng6CGwyB1ip/ P0oG4F/alH+tcGrIHdg21MKXm23MBMHJE3xwMUI8Egxb+YgJ X-Google-Smtp-Source: AGHT+IHsTFKiBHWnOib1TctgQKGUBvbWXb7SirgCiLFVoFkWxV0e9/cu0t9YfrlrHOO5MoTVjWCo0Q== X-Received: by 2002:ac2:530f:0:b0:50e:bb1a:ebaf with SMTP id c15-20020ac2530f000000b0050ebb1aebafmr392856lfh.165.1704977586681; Thu, 11 Jan 2024 04:53:06 -0800 (PST) Received: from localhost (host-97-144.parnet.fi. [77.234.97.144]) by smtp.gmail.com with ESMTPSA id d2-20020ac24c82000000b0050eab0f6a59sm187388lfl.84.2024.01.11.04.53.06 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 11 Jan 2024 04:53:06 -0800 (PST) From: =?UTF-8?q?Martin=20Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Thu, 11 Jan 2024 14:53:05 +0200 Message-Id: <20240111125306.77553-1-martin@martin.st> X-Mailer: git-send-email 2.39.3 (Apple Git-145) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] checkasm: Test whether direct cycle counter access works X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: This should print a nicer error message than crashing due to an illegal instruction, if direct cycle counter access isn't allowed. This matches the dav1d checkasm commit 95a192549a448b70d9542e840c4e34b60d09b093. --- tests/checkasm/checkasm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index 994d64e96b..9c5abb53dc 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -754,6 +754,14 @@ static int bench_init_kperf(void) static int bench_init_ffmpeg(void) { #ifdef AV_READ_TIME + if (!checkasm_save_context()) { + checkasm_set_signal_handler_state(1); + AV_READ_TIME(); + checkasm_set_signal_handler_state(0); + } else { + fprintf(stderr, "checkasm: unable to access cycle counter\n"); + return -1; + } printf("benchmarking with native FFmpeg timers\n"); return 0; #else @@ -927,7 +935,9 @@ int checkasm_bench_func(void) /* Indicate that the current test has failed */ void checkasm_fail_func(const char *msg, ...) { - if (state.current_func_ver->cpu && state.current_func_ver->ok) { + if (state.current_func_ver && state.current_func_ver->cpu && + state.current_func_ver->ok) + { va_list arg; print_cpu_name(); -- 2.39.3 (Apple Git-145) _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".