Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 22649CAC5A5 for ; Thu, 25 Sep 2025 12:38:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CD77010E8FC; Thu, 25 Sep 2025 12:38:10 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="cSgTyE4k"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id E4E4E10E8FC for ; Thu, 25 Sep 2025 12:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758803890; x=1790339890; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=axPoLc8RpFvxfam1Ief2R0z9UXDExMRAV8rXW1RwV/M=; b=cSgTyE4kZ5s/FUrhP7v2hbcuF1VNN56mlEUMTIrqfAXShNYgK2x19QS5 kcbz86sFVwBbTabBESL7zY3mc5/uXoaWn0GaS+kNPIvzeRHLQJQllbKv0 xOQWtIQ6LWRiKEnv/5fsfazdaX6pBM1Xkz2DXXpIlUD3b7c0SXeDT4uBw TLFatiI/k/pk7I8YD6PpQ3uE1pkcjO4iwUzwF4Wev3mowwxtJa6AKVOk6 GXKrQrqBRGLVQWYAjDKvNErUgLnT+GHgaTC1zFPl3mDZ2JxPYYfpUu5wT H77sYiCfqla0NMEylKa44foGwTlPbb1kUQbPgdzd0Us7rtGT45cIOcmba g==; X-CSE-ConnectionGUID: d49qB9wTTEmc9Pjn9/t1XQ== X-CSE-MsgGUID: qh2KaheuSL2Pp4NXAOXY5w== X-IronPort-AV: E=McAfee;i="6800,10657,11563"; a="61226512" X-IronPort-AV: E=Sophos;i="6.18,292,1751266800"; d="scan'208";a="61226512" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2025 05:38:10 -0700 X-CSE-ConnectionGUID: uLMb06fDRs6FrN31OoDPRA== X-CSE-MsgGUID: j1wZtE6FR/+0btgtWOSxkg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,292,1751266800"; d="scan'208";a="176894460" Received: from pgcooper-mobl3.ger.corp.intel.com (HELO dpiatkow-mobl1.mshome.net) ([10.245.244.53]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2025 05:38:08 -0700 From: =?UTF-8?q?Dominik=20Karol=20Pi=C4=85tkowski?= To: igt-dev@lists.freedesktop.org Cc: =?UTF-8?q?Zbigniew=20Kempczy=C5=84ski?= , Mika Kuoppala , Christoph Manszewski , =?UTF-8?q?Dominik=20Karol=20Pi=C4=85tkowski?= Subject: [PATCH v6 i-g-t 4/9] lib/xe_eudebug: Introduce xe_eudebug_debugger_kill Date: Thu, 25 Sep 2025 14:37:40 +0200 Message-Id: <20250925123745.15721-5-dominik.karol.piatkowski@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250925123745.15721-1-dominik.karol.piatkowski@intel.com> References: <20250925123745.15721-1-dominik.karol.piatkowski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" Introduce xe_eudebug_debugger_kill helper for issuing signals to debugger thread. Passes the debugger struct to signal handler. Signed-off-by: Dominik Karol Piątkowski Reviewed-by: Zbigniew Kempczyński --- lib/xe/xe_eudebug.c | 13 +++++++++++++ lib/xe/xe_eudebug.h | 1 + 2 files changed, 14 insertions(+) diff --git a/lib/xe/xe_eudebug.c b/lib/xe/xe_eudebug.c index 0c3262c41..3495354e3 100644 --- a/lib/xe/xe_eudebug.c +++ b/lib/xe/xe_eudebug.c @@ -1391,6 +1391,19 @@ void xe_eudebug_debugger_wait_stage(struct xe_eudebug_session *s, uint64_t stage igt_assert_eq(stage_in, stage); } +/** + * xe_eudebug_debugger_kill: + * @d: pointer to the debugger + * @sig: signal to send + * + * Sends @sig signal to the debugger thread. + * Passes the debugger struct to signal handler. + */ +void xe_eudebug_debugger_kill(struct xe_eudebug_debugger *d, int sig) +{ + pthread_sigqueue(d->worker_thread, sig, (union sigval){ .sival_ptr = (void*)d }); +} + /** * xe_eudebug_client_create: * @master_fd: xe client used to open the debugger connection diff --git a/lib/xe/xe_eudebug.h b/lib/xe/xe_eudebug.h index 8f7f66220..389572ed0 100644 --- a/lib/xe/xe_eudebug.h +++ b/lib/xe/xe_eudebug.h @@ -160,6 +160,7 @@ void xe_eudebug_debugger_remove_trigger(struct xe_eudebug_debugger *d, int type, xe_eudebug_trigger_fn fn); void xe_eudebug_debugger_signal_stage(struct xe_eudebug_debugger *d, uint64_t stage); void xe_eudebug_debugger_wait_stage(struct xe_eudebug_session *s, uint64_t stage); +void xe_eudebug_debugger_kill(struct xe_eudebug_debugger *d, int sig); struct xe_eudebug_client * xe_eudebug_client_create(int xe, xe_eudebug_client_work_fn work, uint64_t flags, void *data); -- 2.34.1