From patchwork Mon Dec 21 01:09:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 41490 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4A1273857808; Mon, 21 Dec 2020 01:09:06 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by sourceware.org (Postfix) with ESMTPS id 100963858D29 for ; Mon, 21 Dec 2020 01:09:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 100963858D29 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 2FE92FBF; Mon, 21 Dec 2020 02:09:03 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FVs1VImhdY46; Mon, 21 Dec 2020 02:09:02 +0100 (CET) Received: from function.youpi.perso.aquilenet.fr (unknown [IPv6:2a01:cb19:956:1b00:9eb6:d0ff:fe88:c3c7]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 944F2FBE; Mon, 21 Dec 2020 02:09:02 +0100 (CET) Received: from samy by function.youpi.perso.aquilenet.fr with local (Exim 4.94) (envelope-from ) id 1kr9h7-00GDk3-Em; Mon, 21 Dec 2020 02:09:01 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd,commited] profil-counter: Add missing SIGINFO case Date: Mon, 21 Dec 2020 02:09:01 +0100 Message-Id: <20201221010901.3866028-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: commit-hurd@gnu.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" 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(+) 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