From: Lynne <dev@lynne.ee>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 2/6] checkasm: use pointers for start/stop functions
Date: Wed, 19 Jul 2023 22:34:37 +0200 (CEST)
Message-ID: <N_jqW4A--3-9@lynne.ee> (raw)
In-Reply-To: <20230719195540.46961-2-remi@remlab.net>
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 <unistd.h>
> #endif
> +#if CONFIG_LINUX_PERF
> +#include <sys/ioctl.h>
> +#include <asm/unistd.h>
> +#include <linux/perf_event.h>
> +#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".
next prev parent reply other threads:[~2023-07-19 20:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-19 19:55 [FFmpeg-devel] [PATCHv3 0/6] RISC-V Linux perf run-time enablement Rémi Denis-Courmont
2023-07-19 19:55 ` [FFmpeg-devel] [PATCH 1/6] checkasm: make perf macros functional Rémi Denis-Courmont
2023-07-19 19:55 ` [FFmpeg-devel] [PATCH 2/6] checkasm: use pointers for start/stop functions Rémi Denis-Courmont
2023-07-19 20:34 ` Lynne [this message]
2023-07-19 19:55 ` [FFmpeg-devel] [PATCH 3/6] checkasm: remove unused variables Rémi Denis-Courmont
2023-07-19 19:55 ` [FFmpeg-devel] [PATCH 4/6] checkasm: make bench clean-up also a function pointer Rémi Denis-Courmont
2023-07-19 19:55 ` [FFmpeg-devel] [PATCH 5/6] checkasm: allow run-time fallback to AV_READ_TIME Rémi Denis-Courmont
2023-07-19 19:55 ` [FFmpeg-devel] [PATCH 6/6] configure: enable Linux perf on RISC-V by default Rémi Denis-Courmont
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=N_jqW4A--3-9@lynne.ee \
--to=dev@lynne.ee \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git