From 53432762ac2ff24794089e2c767b976e54c2dc0a Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 21 Dec 2020 02:02:47 +0100 Subject: profil-counter: Add missing SIGINFO case When SA_SIGINFO is available, sysdeps/posix/s?profil.c use it, so we have to fix the __profil_counter function accordingly, using sigcontextinfo.h's sigcontext_get_pc. --- sysdeps/generic/profil-counter.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sysdeps/generic') diff --git a/sysdeps/generic/profil-counter.h b/sysdeps/generic/profil-counter.h index 1fa7bc7653..da13e6aca9 100644 --- a/sysdeps/generic/profil-counter.h +++ b/sysdeps/generic/profil-counter.h @@ -19,8 +19,18 @@ /* In many Unix systems signal handlers are called like this and the interrupted PC is easily findable in the `struct sigcontext'. */ +#ifdef SA_SIGINFO +#include + +static void +__profil_counter (int signr, siginfo_t *info, void *ctx) +{ + profil_count (sigcontext_get_pc (ctx)); +} +#else static void __profil_counter (int signr, int code, struct sigcontext *scp) { profil_count ((uintptr_t) scp->sc_pc); } +#endif -- cgit 1.4.1