From: "Rémi Denis-Courmont" <remi@remlab.net> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 1/2] checkasm: add helper to report a fatal signal Date: Thu, 16 Nov 2023 18:05:03 +0200 Message-ID: <20231116160504.37435-1-remi@remlab.net> (raw) --- tests/checkasm/checkasm.c | 15 +++++++++++---- tests/checkasm/checkasm.h | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index 708119e7c6..c67cf58922 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -23,10 +23,8 @@ #include "config.h" #include "config_components.h" -#if CONFIG_LINUX_PERF -# ifndef _GNU_SOURCE -# define _GNU_SOURCE // for syscall (performance monitoring API) -# endif +#ifndef _GNU_SOURCE +# define _GNU_SOURCE // for syscall (performance monitoring API), strsignal() #endif #include <stdarg.h> @@ -863,6 +861,15 @@ void checkasm_fail_func(const char *msg, ...) } } +void checkasm_fail_signal(int signum) +{ +#ifdef __GLIBC__ + checkasm_fail_func("fatal signal %d: %s", signum, strsignal(signum)); +#else + checkasm_fail_func("fatal signal %d", signum); +#endif +} + /* Get the benchmark context of the current function */ CheckasmPerf *checkasm_get_perf_context(void) { diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index cfea868ff1..8a1df43ab6 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -102,6 +102,7 @@ struct CheckasmPerf; void *checkasm_check_func(void *func, const char *name, ...) av_printf_format(2, 3); int checkasm_bench_func(void); void checkasm_fail_func(const char *msg, ...) av_printf_format(1, 2); +void checkasm_fail_signal(int signum); struct CheckasmPerf *checkasm_get_perf_context(void); void checkasm_report(const char *name, ...) av_printf_format(1, 2); -- 2.42.0 _______________________________________________ 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 reply other threads:[~2023-11-16 16:05 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-11-16 16:05 Rémi Denis-Courmont [this message] 2023-11-16 16:05 ` [FFmpeg-devel] [PATCH 2/2] checkasm/riscv: report an error upon SIGILL 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=20231116160504.37435-1-remi@remlab.net \ --to=remi@remlab.net \ --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