From patchwork Wed Jul 19 19:55:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= X-Patchwork-Id: 42844 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:b813:b0:130:ccc6:6c4b with SMTP id fi19csp1427728pzb; Wed, 19 Jul 2023 12:55:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlHBAZZ36WxSKzulSFl1yRiZybIoVia8Y7duWBA4UvvpQ9mEjboqSJT3U8Ig9a/m9gxlWN7E X-Received: by 2002:a05:6402:654:b0:521:ad49:8493 with SMTP id u20-20020a056402065400b00521ad498493mr3884389edx.6.1689796551198; Wed, 19 Jul 2023 12:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689796551; cv=none; d=google.com; s=arc-20160816; b=iqpYUisFtaa6aSuFpEqRAvU2qCA8QSDZJJHUoIQCSrMwEN+FlPu0t8mohMgpu3jml0 Xh7PZUgJHCJW5zsp8eTm2sQA+4dFizDh4zaQdki1acYs7/g3wfnrFaXJI/TZVbqsnWw3 K1d5OAZiufdsEPa5l4Wz1mzn9FEj9ZhqW/YxnwSZZh+LTPLIG45BcaQiyOTD5wE+W7WV nWhzJgDdAN8lJYHhSCfCCpELcXC6KtaToSzdWXobVekXAVMLTaLVhCC3nGDxQGcXDI0v Gdk8vraNC337+AEL6jesZQ4tzTFbCIlH1o+65CBMIuwKLcD5bxCQPKqf3FxzSMcibXhv OLJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=SJ15s4s1r4lpfbM0s7Fk79zDaADxCQ13bColPYNYRCY=; fh=hQcp50obTJ8bXC1it5NuEN23RGKfx0/zZ3s2gmreL+A=; b=Bj/ULtC7gL8p55Hc9htRgX91jPYeAUZq9mjhMo8+a6qCKFNRkIDKat7uEwUGyI6qjn b33UU7pVHymFql/obBXVJHRnjj3d8oF8frJL7vxKeOmCpMrZCVjYYLj6lN+sCdYKDXi8 99XtguTyb1COr3Y4DMVyi8nBcCOlObgzbfyEQaNIDNne87KmTGrkdSN3+Mtq4Fv6ATlR GLHF9h/+e+yp8SsJaTQFbDBFSU/lZq3WB0lMGHG2+P5iH7xmrulxRkDKAo8SzZ0qy4JF kCMcADpBAfEG2AivS/wUkIlpJVmYnzN+oZaUS3YzPa5KSHMEHphn91VZVQnpDUZ4EDyU lW6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id q18-20020a056402041200b0051e22d772a2si3408883edv.679.2023.07.19.12.55.50; Wed, 19 Jul 2023 12:55:51 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8BC3668C5F8; Wed, 19 Jul 2023 22:55:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5768968BF90 for ; Wed, 19 Jul 2023 22:55:41 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id CD022C01EF for ; Wed, 19 Jul 2023 22:55:40 +0300 (EEST) From: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Jul 2023 22:55:35 +0300 Message-Id: <20230719195540.46961-1-remi@remlab.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <2113654.OBFZWjSADL@basile.remlab.net> References: <2113654.OBFZWjSADL@basile.remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/6] checkasm: make perf macros functional 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: XimKW+kTzNh7 This converts the bench/perf start/stop macros into functional macros, and for that to work, take the Linux perf code out of line. --- tests/checkasm/checkasm.c | 24 ++++++++++++++++++++---- tests/checkasm/checkasm.h | 36 +++++++++++++----------------------- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index 30e2dc6fed..63141e1f7a 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -514,11 +514,9 @@ static int measure_nop_time(void) int i, nop_sum = 0; av_unused const int sysfd = state.sysfd; - uint64_t t = 0; for (i = 0; i < 10000; i++) { - PERF_START(t); - PERF_STOP(t); - nops[i] = t; + uint64_t t = checkasm_bench_start(); + nops[i] = checkasm_bench_stop() - t; } qsort(nops, 10000, sizeof(uint16_t), cmp_nop); @@ -652,6 +650,24 @@ static void print_cpu_name(void) } #if CONFIG_LINUX_PERF +uint64_t checkasm_bench_linux_perf_start(void) +{ + int fd = state.sysfd; + + ioctl(fd, PERF_EVENT_IOC_RESET, 0); + ioctl(fd, PERF_EVENT_IOC_ENABLE, 0); + return 0; +} + +uint64_t checkasm_bench_linux_perf_stop(void) +{ + uint64_t t; + int fd = state.sysfd; + + ioctl(fd, PERF_EVENT_IOC_DISABLE, 0); + return (read(fd, &t, sizeof(t)) == sizeof (t)) ? t : 0; +} + static int bench_init_linux(void) { struct perf_event_attr attr = { diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index 117d4dd35c..8a62b98f3e 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -238,25 +238,20 @@ typedef struct CheckasmPerf { int iterations; } CheckasmPerf; -#if defined(AV_READ_TIME) || CONFIG_LINUX_PERF || CONFIG_MACOS_KPERF - #if CONFIG_LINUX_PERF -#define PERF_START(t) do { \ - ioctl(sysfd, PERF_EVENT_IOC_RESET, 0); \ - ioctl(sysfd, PERF_EVENT_IOC_ENABLE, 0); \ -} while (0) -#define PERF_STOP(t) do { \ - int ret; \ - ioctl(sysfd, PERF_EVENT_IOC_DISABLE, 0); \ - ret = read(sysfd, &t, sizeof(t)); \ - (void)ret; \ -} while (0) +uint64_t checkasm_bench_linux_perf_start(void); +uint64_t checkasm_bench_linux_perf_stop(void); +#define checkasm_bench_start() checkasm_bench_linux_perf_start() +#define checkasm_bench_stop() checkasm_bench_linux_perf_stop() #elif CONFIG_MACOS_KPERF -#define PERF_START(t) t = ff_kperf_cycles() -#define PERF_STOP(t) t = ff_kperf_cycles() - t +#define checkasm_bench_start() ff_kperf_cycles() +#define checkasm_bench_stop() ff_kperf_cycles() +#elif defined (AV_READ_TIME) +#define checkasm_bench_start() AV_READ_TIME() +#define checkasm_bench_stop() AV_READ_TIME() #else -#define PERF_START(t) t = AV_READ_TIME() -#define PERF_STOP(t) t = AV_READ_TIME() - t +#define checkasm_bench_start() UINT64_C(0) +#define checkasm_bench_stop() UINT64_C(0) #endif /* Benchmark the function */ @@ -270,12 +265,12 @@ typedef struct CheckasmPerf { int ti, tcount = 0;\ uint64_t t = 0; \ for (ti = 0; ti < BENCH_RUNS; ti++) {\ - PERF_START(t);\ + t = checkasm_bench_start(); \ tfunc(__VA_ARGS__);\ tfunc(__VA_ARGS__);\ tfunc(__VA_ARGS__);\ tfunc(__VA_ARGS__);\ - PERF_STOP(t);\ + t = checkasm_bench_stop() - t;\ if (t*tcount <= tsum*4 && ti > 0) {\ tsum += t;\ tcount++;\ @@ -286,11 +281,6 @@ typedef struct CheckasmPerf { perf->iterations++;\ }\ } while (0) -#else -#define bench_new(...) while(0) -#define PERF_START(t) while(0) -#define PERF_STOP(t) while(0) -#endif #define DECL_CHECKASM_CHECK_FUNC(type) \ int checkasm_check_##type(const char *const file, const int line, \ From patchwork Wed Jul 19 19:55:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= X-Patchwork-Id: 42845 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:b813:b0:130:ccc6:6c4b with SMTP id fi19csp1427757pzb; Wed, 19 Jul 2023 12:56:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlGoYs/3kZervKJ4SZPJRY8DFSg1tVxemIzDtX/PuuEtqig+BtujRArxafd8am4kj2W/wUO1 X-Received: by 2002:a17:906:7484:b0:994:4e9c:30c6 with SMTP id e4-20020a170906748400b009944e9c30c6mr3160986ejl.57.1689796560125; Wed, 19 Jul 2023 12:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689796560; cv=none; d=google.com; s=arc-20160816; b=zu70RMK1UaZutmhZEgxHkVRzOFP5ef0cTCFLv6NAr2UhLWkUNwoGHuGKA9t+gAOPSJ XaVpl1vjJiFfA9aPG1GZrZXNQofc4TuovYbOxzeX8tUnNFz5q5eMgxLDjnfwQX8jn1H4 o3ymtqWke004abIJGaJUghR3lqIgqA+e1EIGt8BWzBRUBt1EXS2QJRMN/nrj8Btz4Qln uFbC5coob/0sjmM5yxKmtBQzCptIbm37gVzh0OWBSAvYlyMbPKTLrlR35KqRUsxUkOlE Bp3ID8QedbPZYv57Z8K5oEtMa7dMRuJHyDngaM1Q/M37s6MUvlIWLV59CILb3oQjJf4A 7dtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=7e4t/unE+zjLWn1Ot6MTVRVoq88z9SDgDV8Ivlq6tzM=; fh=hQcp50obTJ8bXC1it5NuEN23RGKfx0/zZ3s2gmreL+A=; b=WRnltZFlUpkG0MQ9cWy8wAfXxcqwwKZXR9KsFicduIcxtCK36AViDWUUgHUDAadeGr R5au6CY48gxlfHwAz0rEgDfCphd4Cxltyv+JG8vBJVgTtY69UWLMDXsWDFhGt6osCSt4 Anda1iLPsw+xHB3XgWbCxJCKJZvzdOHEXnKqXd0/df9F3xK0yst3nRERuN4dikrL5dqj 8RdIA45Lqz8L3VsQi8wGnFGaGweNy0s1jyguNfpemHXx9Ur7DOl0qvimiCHMKQrWLNhD oUTVy9DGve3fgCXhZU11YJbTNTulZmcPWCPXMk5bq7rZyzQzXDKT7lidX4ts53bLSu6a oDKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i20-20020a1709061cd400b00991ece4c959si3253357ejh.532.2023.07.19.12.55.59; Wed, 19 Jul 2023 12:56:00 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7E05C68BF90; Wed, 19 Jul 2023 22:55:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6DD7E68C33E for ; Wed, 19 Jul 2023 22:55:41 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 08C59C0214 for ; Wed, 19 Jul 2023 22:55:40 +0300 (EEST) From: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Jul 2023 22:55:36 +0300 Message-Id: <20230719195540.46961-2-remi@remlab.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <2113654.OBFZWjSADL@basile.remlab.net> References: <2113654.OBFZWjSADL@basile.remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/6] checkasm: use pointers for start/stop functions 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: y34vzYuP3nJU Linux and MacOS kernel performance APIs are not always available. This introduces function pointers so that we can fall back to other timing functions (in later changesets). If AV_READ_TIME is the only configured timer, then this sticks to inline assembler since there will be nothing to fall back to (or from), and some people are concerned than an indirect function call is too much overhead. --- tests/checkasm/checkasm.c | 25 +++++++++++++++++++++++-- tests/checkasm/checkasm.h | 24 ++++++------------------ 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index 63141e1f7a..933d85bac3 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -57,6 +57,14 @@ #if HAVE_UNISTD_H #include #endif +#if CONFIG_LINUX_PERF +#include +#include +#include +#endif +#if CONFIG_MACOS_KPERF +#include "libavutil/macos_kperf.h" +#endif #if !HAVE_ISATTY #define isatty(fd) 1 @@ -313,6 +321,8 @@ static struct { /* perf */ int nop_time; int sysfd; + uint64_t (*start)(void); + uint64_t (*stop)(void); int cpu_flag; const char *cpu_flag_name; @@ -513,6 +523,12 @@ static int measure_nop_time(void) uint16_t nops[10000]; int i, nop_sum = 0; av_unused const int sysfd = state.sysfd; +#if CONFIG_LINUX_PERF || CONFIG_MACOS_KPERF + struct { + uint64_t (*start)(void); + uint64_t (*stop)(void); + } p = { state.start, state.stop }, *perf = &p; +#endif for (i = 0; i < 10000; i++) { uint64_t t = checkasm_bench_start(); @@ -650,7 +666,7 @@ static void print_cpu_name(void) } #if CONFIG_LINUX_PERF -uint64_t checkasm_bench_linux_perf_start(void) +static uint64_t checkasm_bench_linux_perf_start(void) { int fd = state.sysfd; @@ -659,7 +675,7 @@ uint64_t checkasm_bench_linux_perf_start(void) return 0; } -uint64_t checkasm_bench_linux_perf_stop(void) +static uint64_t checkasm_bench_linux_perf_stop(void) { uint64_t t; int fd = state.sysfd; @@ -686,12 +702,15 @@ static int bench_init_linux(void) perror("syscall"); return -1; } + state.start = checkasm_bench_linux_perf_start; + state.stop = checkasm_bench_linux_perf_stop; return 0; } #elif CONFIG_MACOS_KPERF static int bench_init_kperf(void) { ff_kperf_init(); + state.start = state.stop = ff_kperf_cycles; return 0; } #else @@ -882,6 +901,8 @@ CheckasmPerf *checkasm_get_perf_context(void) CheckasmPerf *perf = &state.current_func_ver->perf; memset(perf, 0, sizeof(*perf)); perf->sysfd = state.sysfd; + perf->start = state.start; + perf->stop = state.stop; return perf; } diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index 8a62b98f3e..3b3a1ab35b 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -26,15 +26,6 @@ #include #include "config.h" -#if CONFIG_LINUX_PERF -#include // read(3) -#include -#include -#include -#elif CONFIG_MACOS_KPERF -#include "libavutil/macos_kperf.h" -#endif - #include "libavutil/avstring.h" #include "libavutil/cpu.h" #include "libavutil/internal.h" @@ -236,16 +227,13 @@ typedef struct CheckasmPerf { int sysfd; uint64_t cycles; int iterations; + uint64_t (*start)(void); + uint64_t (*stop)(void); } CheckasmPerf; -#if CONFIG_LINUX_PERF -uint64_t checkasm_bench_linux_perf_start(void); -uint64_t checkasm_bench_linux_perf_stop(void); -#define checkasm_bench_start() checkasm_bench_linux_perf_start() -#define checkasm_bench_stop() checkasm_bench_linux_perf_stop() -#elif CONFIG_MACOS_KPERF -#define checkasm_bench_start() ff_kperf_cycles() -#define checkasm_bench_stop() ff_kperf_cycles() +#if CONFIG_LINUX_PERF || CONFIG_MACOS_KPERF +#define checkasm_bench_start() (perf->start)() +#define checkasm_bench_stop() (perf->stop)() #elif defined (AV_READ_TIME) #define checkasm_bench_start() AV_READ_TIME() #define checkasm_bench_stop() AV_READ_TIME() @@ -258,7 +246,7 @@ uint64_t checkasm_bench_linux_perf_stop(void); #define bench_new(...)\ do {\ if (checkasm_bench_func()) {\ - struct CheckasmPerf *perf = checkasm_get_perf_context();\ + struct CheckasmPerf *restrict perf = checkasm_get_perf_context();\ av_unused const int sysfd = perf->sysfd;\ func_type *tfunc = func_new;\ uint64_t tsum = 0;\ From patchwork Wed Jul 19 19:55:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= X-Patchwork-Id: 42846 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:b813:b0:130:ccc6:6c4b with SMTP id fi19csp1427800pzb; Wed, 19 Jul 2023 12:56:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlGPFHvIT/zqyXBnfTXQEFnijNvsoM+OzkafpT+mWV+lOM1d7MA//YE38v9MRSLkffnyTeqj X-Received: by 2002:a17:907:7805:b0:994:5303:a1ec with SMTP id la5-20020a170907780500b009945303a1ecmr3632463ejc.43.1689796568068; Wed, 19 Jul 2023 12:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689796568; cv=none; d=google.com; s=arc-20160816; b=geal+t+z7uvL66TFXvKwktozAFJ7nEQ8IapAQhLwts3Ti8UrjTDUBezNDOkgCMLHPm 8pjVNLnDukwrovQWOpW1tZDSvDmbsY+8RA6cu0egDAwdtn7GwjuK2pBxd+0ahgTTA+3K pF9JMmpVX/VS1hTrodPlu3KOfWVKm2B4dXWmS6CQrWerbGLwVSuqAb2wN2ikjPzGuB6X e5lFsTxEUcPhxkPt2NrPJN5YLb8bJTAreTVy7xJah/ZFx5e9tTNcYLF7kxtbqGBV/Hao DBjzF2rfrO0FeUWq5gvNnJgPhKPv6K359RIk6As0KN1ZGIxlyH0ycuasbikcG9yt+1/u T9nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=3FihU+hdkDV+EGtF9Q3I10ZfTuuVlYMZBHh0qkDz0OM=; fh=hQcp50obTJ8bXC1it5NuEN23RGKfx0/zZ3s2gmreL+A=; b=X4st7fg7xcGZSI8BiO185sceLW8GSEWU0jv4cye/xBFrW++HdZ9cLezON+80FyN+Xm 6Ol+1gOWKUbbVAOtdbu2PP6S3Nuwr9ipYa53H/zt2jgmhuVeJpHZ1J8U79FW+fkuijAU ajd4BJqzBZEDhms3uZ0pD97HyCtFn9Qafzj4VTnx/v7qUyBpR3fLC9mhJ5p0Bf4KAgAG 1ZEZt3nH9iKmL//CsRxVC482G/L4zD44Z58V/eUt1BwuTze1N1zkN9eK73dSdU0UyKS1 giq3PfrTacU9cduBpNjWwIX7/PVQBxRotXPkVvfUGEHPMXkaeksHsOFnObACknL3q85g aoYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ke8-20020a17090798e800b009926007b7dasi3027099ejc.126.2023.07.19.12.56.07; Wed, 19 Jul 2023 12:56:08 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 671FF68C5F9; Wed, 19 Jul 2023 22:55:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C162368C33E for ; Wed, 19 Jul 2023 22:55:41 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 38735C0219 for ; Wed, 19 Jul 2023 22:55:41 +0300 (EEST) From: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Jul 2023 22:55:37 +0300 Message-Id: <20230719195540.46961-3-remi@remlab.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <2113654.OBFZWjSADL@basile.remlab.net> References: <2113654.OBFZWjSADL@basile.remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/6] checkasm: remove unused variables 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: EmHYd0kl82QS --- tests/checkasm/checkasm.c | 2 -- tests/checkasm/checkasm.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index 933d85bac3..987162e6b5 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -522,7 +522,6 @@ static int measure_nop_time(void) { uint16_t nops[10000]; int i, nop_sum = 0; - av_unused const int sysfd = state.sysfd; #if CONFIG_LINUX_PERF || CONFIG_MACOS_KPERF struct { uint64_t (*start)(void); @@ -900,7 +899,6 @@ CheckasmPerf *checkasm_get_perf_context(void) { CheckasmPerf *perf = &state.current_func_ver->perf; memset(perf, 0, sizeof(*perf)); - perf->sysfd = state.sysfd; perf->start = state.start; perf->stop = state.stop; return perf; diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index 3b3a1ab35b..80e6561e69 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -224,7 +224,6 @@ void *checkasm_get_wrapper(void); #endif typedef struct CheckasmPerf { - int sysfd; uint64_t cycles; int iterations; uint64_t (*start)(void); @@ -247,7 +246,6 @@ typedef struct CheckasmPerf { do {\ if (checkasm_bench_func()) {\ struct CheckasmPerf *restrict perf = checkasm_get_perf_context();\ - av_unused const int sysfd = perf->sysfd;\ func_type *tfunc = func_new;\ uint64_t tsum = 0;\ int ti, tcount = 0;\ From patchwork Wed Jul 19 19:55:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= X-Patchwork-Id: 42847 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:b813:b0:130:ccc6:6c4b with SMTP id fi19csp1427854pzb; Wed, 19 Jul 2023 12:56:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlEjB6TMSJxuoYWe1OBs9UUqKHgK7ZKwE0tM/rGLabUx2w7en8Ose8gjqYcmnDgONRtvdSCQ X-Received: by 2002:a05:6402:514f:b0:51a:2c81:72ee with SMTP id n15-20020a056402514f00b0051a2c8172eemr3227407edd.20.1689796575956; Wed, 19 Jul 2023 12:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689796575; cv=none; d=google.com; s=arc-20160816; b=Wf6JtBqhuNV830o1tARTALcW9So+cMHD0Sr2w/7g8pR25ntSehJyEaDv+UGuj6nWzR GLRvsGrxxZOY8lY7E1R9OVhSJrBXuAW6U9U5RMkwxTpOsQ66vCjuHLu+yUP6U9SSI+wl t4jT/NbbkEx/FeANehQT98kA3gZ9Ljt8sxJBXuT+Y5nZDp/Mf1kvswmaL41BbE4el4f/ uUm6ZS7W4ZCKiu6RD+ridqpiDTGl1v88KdzJyaV4/p8cWe/TgecVCgU8HK5AMXEUBE/F P2GNhgn4aWXcMEpm5YpBujHW5Q1dsUmHco95aaVUcSuvf9+JMZ8AQM32Av4he6USi0X6 eV/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=QZrMDfkQM0afRc8S4s89dHe/bH9TwgXWfTX/VXoVnDY=; fh=hQcp50obTJ8bXC1it5NuEN23RGKfx0/zZ3s2gmreL+A=; b=it2opUWVWGY+nQETwpvISgK8mKNXHkkLAPoyK0E9uFlQPrAhY3+ll1sYLS1tLDhOXW R2Gr2Wp4/vWM8F8K6Pkha5s7A39a6Vdp/Mtp1A3XqWQoD/cBtOiVvCg5lzrwTkVAOan/ FtK0kT2+ltGGx4I9fLqq5ODB2VEC9WcJMFrfTGPsU3TDbBXhnLozQq8DIPZcwFaltxs+ dNQfPup0SPEwYVLoBL6V18TQKxGhue25t2UCJahkdNxDeaZ93s8754tvDW+dFqwlE0ZK 1wmxShoPpC9lEB+n4z0s02YNiPybvv/BoQ8ne5ze3fOlt0H9PoiyBEdhL62Kee1FgfWA DlMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u5-20020a50eac5000000b00521830574b5si3656044edp.153.2023.07.19.12.56.15; Wed, 19 Jul 2023 12:56:15 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 39FDE68C636; Wed, 19 Jul 2023 22:55:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E848968C33E for ; Wed, 19 Jul 2023 22:55:41 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 67F16C021A for ; Wed, 19 Jul 2023 22:55:41 +0300 (EEST) From: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Jul 2023 22:55:38 +0300 Message-Id: <20230719195540.46961-4-remi@remlab.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <2113654.OBFZWjSADL@basile.remlab.net> References: <2113654.OBFZWjSADL@basile.remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/6] checkasm: make bench clean-up also a function pointer 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: BIYGNzAJ2gA7 There are no performance concerns with cleaning up, so might as well indirect it. This incidentally fixes a corner case (and inconsequential) bug whereby the Linux perf descriptor is zero and did not get closed. --- tests/checkasm/checkasm.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index 987162e6b5..fad660a924 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -320,9 +320,12 @@ static struct { /* perf */ int nop_time; +#if CONFIG_LINUX_PERF int sysfd; +#endif uint64_t (*start)(void); uint64_t (*stop)(void); + void (*close)(void); int cpu_flag; const char *cpu_flag_name; @@ -683,6 +686,11 @@ static uint64_t checkasm_bench_linux_perf_stop(void) return (read(fd, &t, sizeof(t)) == sizeof (t)) ? t : 0; } +static void checkasm_bench_linux_perf_close(void) +{ + close(state.sysfd); +} + static int bench_init_linux(void) { struct perf_event_attr attr = { @@ -703,6 +711,7 @@ static int bench_init_linux(void) } state.start = checkasm_bench_linux_perf_start; state.stop = checkasm_bench_linux_perf_stop; + state.close = checkasm_bench_linux_perf_close; return 0; } #elif CONFIG_MACOS_KPERF @@ -742,14 +751,6 @@ static int bench_init(void) return 0; } -static void bench_uninit(void) -{ -#if CONFIG_LINUX_PERF - if (state.sysfd > 0) - close(state.sysfd); -#endif -} - static int usage(const char *path) { fprintf(stderr, @@ -816,7 +817,8 @@ int main(int argc, char *argv[]) } destroy_func_tree(state.funcs); - bench_uninit(); + if (state.close != NULL) + state.close(); return ret; } From patchwork Wed Jul 19 19:55:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= X-Patchwork-Id: 42848 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:b813:b0:130:ccc6:6c4b with SMTP id fi19csp1427913pzb; Wed, 19 Jul 2023 12:56:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlFd+qGCUwFeQoSMAHDwMrrdXhy/hYqYn1TU6yDs3hghKN4JSvkz1XnJ/Stkis4hs/HtY7dO X-Received: by 2002:a17:906:3291:b0:98e:26ae:9b07 with SMTP id 17-20020a170906329100b0098e26ae9b07mr2796666ejw.35.1689796584100; Wed, 19 Jul 2023 12:56:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689796584; cv=none; d=google.com; s=arc-20160816; b=FD9YV5MKPgg/Oyps6gijjPWnGu3YVZ0zMADKUyWmu6ezSM2ojRrc9Ybl/nSSB/9tEO SV1Twdtb4Lp8KL5vc/0HTHcZIAZJDgx8Ln2HVd0s4AObX+eF8jeFf6FH6Liw5pnVW+xJ nFLuWukh+mMupRBdcMkeTICPikS8F/nDmFM/EhouukRQqli5XI24kSkHBp8FlPY6iOvZ HypXpxRqONY6RWRFBrg6RyvZOxLxX+wIA5SRoLrzxnrvr/VvzC2gZDXHnNN3pp5277qW ONvy5tUK5oghbKpQQbeNSQjwuV7F1t0UOTo27Io5mT94pIdFHzzOxDBJSTCWExutJm2A 9dzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=scy/AtwUuMg4fzmQZEcfJKmDWRYkr4N5ILOwaGiMqSw=; fh=hQcp50obTJ8bXC1it5NuEN23RGKfx0/zZ3s2gmreL+A=; b=HdEnVpP1xN6/kqxMCx6NJbxcGibiY5TpEVwsRiGQJ0mAojhZZKI9KG21xef0Gy3/W0 Ofm+ThYdX7UIXo4ANf4pkwEMS7pqM9yrHCvsFFI42SizBiwJ/f7gAeWV8oUvFhtEtZrs MB+s0eT8f3Z3nF/N9S++Cht4dv5ZDMX0MO3Pq3N/uVG/402+pAt3OtT3vdCm6S47/HWu wtlAeSs3sG6lz6fPb3TsOw2xWFw9zyVXZOGB8qEzldbRd+oGjxMvAMsHlBxv15GY3rpP knz4rvrmtLN4v14gtJjx6FAjEVm0gkxBWo8h2bEpFFmi/iWwZkU5/JSV5iaPjIjRRWkT WjQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g9-20020a170906c18900b0098759d6f22csi3403403ejz.161.2023.07.19.12.56.23; Wed, 19 Jul 2023 12:56:24 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 08E5268C64B; Wed, 19 Jul 2023 22:55:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0ADAC68C5F8 for ; Wed, 19 Jul 2023 22:55:42 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 97284C021B for ; Wed, 19 Jul 2023 22:55:41 +0300 (EEST) From: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Jul 2023 22:55:39 +0300 Message-Id: <20230719195540.46961-5-remi@remlab.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <2113654.OBFZWjSADL@basile.remlab.net> References: <2113654.OBFZWjSADL@basile.remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/6] checkasm: allow run-time fallback to AV_READ_TIME 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: tkY3ucGasiLo On Linux RISC-V, depending on kernel version and configuration, the cycle counters may be available: - via Linux perf (as on Arm), - directly with RDCYCLE (which is considered legacy), - neither (if admistratively disabled), or - or both (in legacy compatibility mode). This allows to try Linux perf, with a fallback to RDCYCLE. Without this, benchmarking would breakdown in upcoming Linux RISC-V kernel releases. This also paves the way for falling back from the cycle counter on Arm or RISC-V, whence they too are disabled. --- tests/checkasm/checkasm.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index fad660a924..3c8aa8631e 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -714,37 +714,43 @@ static int bench_init_linux(void) state.close = checkasm_bench_linux_perf_close; return 0; } -#elif CONFIG_MACOS_KPERF +#endif +#if CONFIG_MACOS_KPERF static int bench_init_kperf(void) { ff_kperf_init(); state.start = state.stop = ff_kperf_cycles; return 0; } -#else +#endif +#ifdef AV_READ_TIME static int bench_init_ffmpeg(void) { -#ifdef AV_READ_TIME printf("benchmarking with native FFmpeg timers\n"); + state.start = state.stop = AV_READ_TIME; return 0; -#else - fprintf(stderr, "checkasm: --bench is not supported on your system\n"); - return -1; -#endif } #endif static int bench_init(void) { + int ret = -1; #if CONFIG_LINUX_PERF - int ret = bench_init_linux(); -#elif CONFIG_MACOS_KPERF - int ret = bench_init_kperf(); -#else - int ret = bench_init_ffmpeg(); + if (ret < 0) + ret = bench_init_linux(); +#endif +#if CONFIG_MACOS_KPERF + if (ret < 0) + ret = bench_init_kperf(); #endif +#ifdef AV_READ_TIME if (ret < 0) - return ret; + ret = bench_init_ffmpeg(); +#endif + if (ret < 0) { + fputs("checkasm: --bench is not supported on your system\n", stderr); + return -1; + } state.nop_time = measure_nop_time(); printf("nop: %d.%d\n", state.nop_time/10, state.nop_time%10); From patchwork Wed Jul 19 19:55:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= X-Patchwork-Id: 42849 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:b813:b0:130:ccc6:6c4b with SMTP id fi19csp1427963pzb; Wed, 19 Jul 2023 12:56:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlEq0cLGP5kwEs3VJgNSmeKLBoNvC1DDmTI/DeOhYOv2UAXhjqIf823IVJ/CFLXGpIf3Fuif X-Received: by 2002:aa7:d384:0:b0:51e:309:2e11 with SMTP id x4-20020aa7d384000000b0051e03092e11mr3480676edq.36.1689796592256; Wed, 19 Jul 2023 12:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689796592; cv=none; d=google.com; s=arc-20160816; b=j/ariH1jcTY74MsHfDFpSRdZzRv12Acm0luecv7dpva1xbUKY+cLo76Bx7/l3JZmAM u+jvr1IkWYG4hqGvvwOOUq+skiQ3jZc/IIaZcRUDaYO8WHSvNyOctJoiDWPy4skBMnFf vhFcndBjDuiz5bpuryy37X/CXHQ/7EEVgeMXALC7yhdsm7gArh+OPHAKd45/5fluzqw4 z/X7XKTyBglIvxGvBxKH3jUo4uLeMaZLMxltpi24H5AjKCJiOYtvAOQvlxFFuxmEc+7Y wsC/1wfExyUvuEaVSGHEgtWcFiUendFvujPk4cMtQzHWWklzoYV/cnLyHU00r4ZgeiBs 0uSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=VmvbO684zDytNL2QKHGM9BMQPgHCdj6C4G689xam7+0=; fh=hQcp50obTJ8bXC1it5NuEN23RGKfx0/zZ3s2gmreL+A=; b=bClEfC6H4P/sX3+Q2/ZVnAHf0fOPjnVcRQzZ6f2EYfbCdlWakD9g9toRRV4xXuVz7R zO8JXSLPi6J58qpn2rhy3rex69oQEgn3hO9F9WKRdjqsDIYyEjSeQLuR5aSp/XjNTSd+ gVc72O70fT6Ha3L6c9jIfLsmuTpFKWNDRRpX7XIZNUn66d0+1AppIPq181Y/ilrQA9TV 1vfKlH+H6LxifmYqXMsCmadpy6qYSTmK4Ad1Hv7huFlRNGn6doyWuboPQBahkmBidTtB ZUo7cx02ig2r8q3zf1fVOGfzl4gZ+449sg9X8yRQc8Q8q1Du1dzXd1YLwYb//w79Bcl6 W1xQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v15-20020aa7d9cf000000b0051e43d9948dsi3387856eds.389.2023.07.19.12.56.31; Wed, 19 Jul 2023 12:56:32 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DA98F68C663; Wed, 19 Jul 2023 22:55:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B242868C641 for ; Wed, 19 Jul 2023 22:55:46 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id C723FC021C for ; Wed, 19 Jul 2023 22:55:41 +0300 (EEST) From: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Jul 2023 22:55:40 +0300 Message-Id: <20230719195540.46961-6-remi@remlab.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <2113654.OBFZWjSADL@basile.remlab.net> References: <2113654.OBFZWjSADL@basile.remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 6/6] configure: enable Linux perf on RISC-V by default 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: JE9uVH6B7kNY Now that checkasm can automatically fall back to RDCYCLE, it is safe to enable this for forward compatibility with kernel versions mitigating the "Cycle Drift" side channel attack. Where available, this should also reduce measurement noise, since kernel and hypervisor cycles should no longer be counted. --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index b018abf139..c60e8d3438 100755 --- a/configure +++ b/configure @@ -5753,7 +5753,7 @@ case $target_os in ;; linux) enable section_data_rel_ro - enabled_any arm aarch64 && enable_weak linux_perf + enabled_any arm aarch64 riscv && enable_weak linux_perf ;; irix*) target_os=irix