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 C819A4864E for ; Thu, 11 Jan 2024 20:57:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BE6DC68D026; Thu, 11 Jan 2024 22:57:30 +0200 (EET) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0E8E768CBC3 for ; Thu, 11 Jan 2024 22:57:23 +0200 (EET) Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-50e5a9bcec9so7063980e87.3 for ; Thu, 11 Jan 2024 12:57:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1705006643; x=1705611443; 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=a4TnZlscfKBdp4Mxbux0LZqQfeQlFvRYGkYcPjVTo2w=; b=ou5aCKeXnNAGwwhS5L8EnmeNBJHcKcgodW/NaWmU8WNhNbm7h0juvzzVCsOlD56dsX 2YK/z1bZzChqfO/zhQAh71F0KlmASFUYqanc3XZZvzDwqJMo+zO6AVZQAyDbQHaHOUWx qvHnoiA8m1GQ8yYvTl1wvoLpAQdiPJhg/58eH40xmxQA/NaG6ugavd2Pa5W3XVFxweBk HU4h2fcWvFmSwqePiGjM2n4QFombzM+FFZbgymX1oWjeZx10Ku4ak2gEKrSz2JvXXxwv UbLzcn6AdNwHO5MyK+1mxqPJxEDj6BKGqVnl6e2VGXF611sldf62CHJoiSeSDAbhD2v3 +/KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705006643; x=1705611443; 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=a4TnZlscfKBdp4Mxbux0LZqQfeQlFvRYGkYcPjVTo2w=; b=H5hBJaNWQscmVTIUqKzQ2RZJxMN4ZcA187su4e5mV467PG+N/CVXtviGjWVOA+Ib0H jLfQwPquG6DUZdCgYu3DeoMMeJ3pDDcver8G3jRQdKKzHNh3vdHT4+Q3XEw4codx7bKg IeGgaLuZhRpOJAwA1OkDnljKcK6d5iYmSo0Bj9+mHep08FWdFTknANzuOZU5bsyGmNx1 GY+khGWVjqQlbAmFcdeQUaxvnkF4W7GR9cRcNXGBlH1izIBpSeGnmrXuy+lKrmBxi+Hv C90j/30i4zGjfYdedzHlTRgIMLesZlhtYl/ZD6LcEB/HRsTJcW52Ap5IN7DtQH4x74En eKCg== X-Gm-Message-State: AOJu0YxJ45bL3Gw09+weinnXNSnUgmd22L9DjbKwMcYu17zYGohoh7Uw /vQnE+DI6l2z/jJZfmZTMt502LRdnneA+e7rcwpnH9VhQpUt X-Google-Smtp-Source: AGHT+IHTfGUFbI6h1e9MyV5XwR1IsVlrTFPf+TYaxC/ZK2T6Tmjd1/Rk1U/KQcpWUCdi1ztOdrFu2w== X-Received: by 2002:a05:6512:401e:b0:50e:7044:7656 with SMTP id br30-20020a056512401e00b0050e70447656mr184490lfb.57.1705006642749; Thu, 11 Jan 2024 12:57:22 -0800 (PST) Received: from localhost (host-97-144.parnet.fi. [77.234.97.144]) by smtp.gmail.com with ESMTPSA id d2-20020ac24c82000000b0050eab0f6a59sm297435lfl.84.2024.01.11.12.57.22 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 11 Jan 2024 12:57:22 -0800 (PST) From: =?UTF-8?q?Martin=20Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Thu, 11 Jan 2024 22:57:21 +0200 Message-Id: <20240111205721.79886-1-martin@martin.st> X-Mailer: git-send-email 2.39.3 (Apple Git-145) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] checkasm: Test whether the native FFmpeg timers work 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: On some platforms (in particular, ARM/AArch64), the implementation of AV_READ_TIME() may use a privileged instruction - in such cases, benchmarking just fails with a SIGILL. Instead of crashing, try executing AV_READ_TIME() once within a region with the signal handler active, to allow gracefully informing the user about the issue. This matches the dav1d checkasm commit 95a192549a448b70d9542e840c4e34b60d09b093. --- Reworded the commit message and the printed warning message, as the actual type of the timer is undefined and varies across platforms. --- 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..05f23898d3 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 execute platform specific timer\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".