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 3F1EECCD183 for ; Thu, 2 Oct 2025 10:45:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E515310E7BC; Thu, 2 Oct 2025 10:45:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="P5V8C3OQ"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id A843910E7BC for ; Thu, 2 Oct 2025 10:45:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1759401905; x=1790937905; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=A4qRc8VTlCxTQS1Y6SLESwHMzetyMMzHHB2dA/FhNDg=; b=P5V8C3OQRyHiLzi89sPgzHfsm7rrdUuLM6S8xXHYVDn2Vqd/lL/rffZJ /BgpgB/V/WQHURpFnKwaN1xwSMprhiFsnG/0zoWxC2B2GcV9KucAyRoDW ChNlDSyYREJs3Xj3og663/5zGluSMnpz/0KRFRzFWfmErT9vABISMGUTn ErPvYobD766HIsWZpI13pJ1SMIfHRf+5AOTiNy+vE7bn3224wcQVozaWZ H6p94bnvCdQlIbgJtdM5pex1v7E58UfSPnIEePb4g66hsKd/4g9ebaemu 6+E6+pCrk+zQEBPlJ2yLVSvzo6GlwE8FG5wLl06pcmZl4+/wTXXF8o2FN w==; X-CSE-ConnectionGUID: lqg0m4lnSoqMK4xQx7DncA== X-CSE-MsgGUID: n9DJUYNDQiGE4FBT7Nq0zg== X-IronPort-AV: E=McAfee;i="6800,10657,11569"; a="60895244" X-IronPort-AV: E=Sophos;i="6.18,309,1751266800"; d="scan'208";a="60895244" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2025 03:45:04 -0700 X-CSE-ConnectionGUID: 1DP/HiYcQgi1u5E49xIlyw== X-CSE-MsgGUID: HuBtaOmeSv6IdWD7zLhTRQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,309,1751266800"; d="scan'208";a="184213204" Received: from bergbenj-mobl1.ger.corp.intel.com (HELO dpiatkow-mobl1.mshome.net) ([10.245.245.176]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2025 03:45:03 -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 v10 i-g-t 04/10] lib/xe_eudebug: Introduce xe_eudebug_debugger_kill Date: Thu, 2 Oct 2025 12:44:37 +0200 Message-Id: <20251002104443.7021-5-dominik.karol.piatkowski@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251002104443.7021-1-dominik.karol.piatkowski@intel.com> References: <20251002104443.7021-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 2fb8cf2a0..6def162ce 100644 --- a/lib/xe/xe_eudebug.c +++ b/lib/xe/xe_eudebug.c @@ -1395,6 +1395,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