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 85F8C464C3 for ; Wed, 19 Jul 2023 20:34:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 33C1368C489; Wed, 19 Jul 2023 23:34:44 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BB9B368C137 for ; Wed, 19 Jul 2023 23:34:37 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id 257F810601E3 for ; Wed, 19 Jul 2023 20:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1689798877; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=coFLhSmbCXVQjBGSgBe9/nzCtiwv/q0nlSSdRmvIUno=; b=oiRbUwT53OT9lGEyVGOGmVuCrREAPKHcjaJKndohWkMSszW+V3ow656ohxzhgtQ7 cm3sn/UIe0dNWA9afhiiMVXRkF9bTqVihZxqM7ul//vc5WQpgiR/RfxaA4BlR9dcYak Sl9zj9dran1jKANBNfTlZWGz+rzeHLo6S6xQBYWBxX7FH6g5roS4bxVFv1eNHqi/SOS fotNkYrymBF2+Cfd4FZXg9DjH/oUoHJaDwjxI/nIlQhPR+7pc0atlEsjd1u/A15GbJQ BcVkt+ruzTSnUJUiYxCLa0hhfy6oCQbhjNwlj9WptCrjGmi1AhiSTUBs5z7YQeBLxEa jc5DDkQMig== Date: Wed, 19 Jul 2023 22:34:37 +0200 (CEST) From: Lynne To: FFmpeg development discussions and patches Message-ID: In-Reply-To: <20230719195540.46961-2-remi@remlab.net> References: <2113654.OBFZWjSADL@basile.remlab.net> <20230719195540.46961-2-remi@remlab.net> MIME-Version: 1.0 Subject: Re: [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 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: Jul 19, 2023, 21:56 by remi@remlab.net: > 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); > Could these be ifdef's and macro'd out on x86/arm? Perhaps behind a CONFIG_CPU_TIMERS, which would be disabled if linux perf is active. _______________________________________________ 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".