From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cYHsMAmj5GoseBQAWB0awg (envelope-from ) for ; Fri, 30 Oct 2026 10:00:41 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KOsN8Ckh; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C2913378002; Fri, 30 Oct 2026 10:00:41 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B718D1E023 for ; Fri, 30 Oct 2026 10:00:40 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D39C84BA900B for ; Fri, 30 Oct 2026 14:00:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D39C84BA900B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KOsN8Ckh Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by sourceware.org (Postfix) with ESMTPS id AE6FC4BAE7CD for ; Fri, 30 Oct 2026 13:57:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AE6FC4BAE7CD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AE6FC4BAE7CD Authentication-Results: sourceware.org; arc=none smtp.remote-ip=198.175.65.12 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793368678; cv=none; b=SwVkfquaoXEvSp/zDnkaycsbmw7EOawnuljpY/gcgfFJ+GIx91XOx/yMh37BH7CUTiiDLa5naDrbZxjk9vn5maEmxXj9iEePEl4qT4ycJ7sDxMwjsr3BNsr/fptJoLBtoYFVSStDMofygzYI/A7/SiVBmbvIj/KFBEVGaJIoVk4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793368678; c=relaxed/simple; bh=e5dXamse5fZeXueLCzx9fUO+NFe2wXxzM0n1GEzzNTg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=KmYk27IfLmbHCYjODBU77xvDQlTQuVY80ZrcNsw6T4+uZxtNeIJqKhWHcPOWttk2QQw+uWNlOTP33cwxpYaeV7sTVBeWaOPvtvBnI9+UVKZb5AJ7Af285EjaatnOhkzF4nl17SeUaf2gvs+acT87TXnk+WebLwZHpj0VrLhrtMo= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KOsN8Ckh DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE6FC4BAE7CD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1793368678; x=1824904678; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=e5dXamse5fZeXueLCzx9fUO+NFe2wXxzM0n1GEzzNTg=; b=KOsN8Ckhcfa9eSabQh60ikv9WJN9aFath+IIr27zoon5udpMLXEJ06wd Ge74uRh/ks4Kx8zihGntP/z2Zlee9ipx+vjXf1GUfV/53OIVfzhT3kPf+ B/bvGBdTKXh59x2JvQymRZZW9TV+EEBPMsAQRiGco7vIa3Qst7kUWUoF4 TolXtK6CyKj9+qnLan7L8wO1c9hNPmr5lLkJY3ayVj+XmFimWfU3ho9So Z91i7/SaLo3/ZUvqtkQTIr+NmYWxsXj6InUzINPmsGoTY75gHnT91GW2P dTuxYsfI7SFhpPqNG87miFxRp6yzpynP4ecJGnmIuU5EJUBf9Bwq35+xa A==; X-CSE-ConnectionGUID: mxcbqjazRpO1k1Nb5WXFeQ== X-CSE-MsgGUID: WAPvxpXWSU+ZdmJoVYuhbw== X-IronPort-AV: E=McAfee;i="6800,10657,11951"; a="2011306" X-IronPort-AV: E=Sophos;i="6.27,186,1787036400"; d="scan'208";a="2011306" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2026 06:57:58 -0700 X-CSE-ConnectionGUID: A4FGSENARiyfr3kOIp2h8Q== X-CSE-MsgGUID: 7o+6NR0bRBmnL8hY3XstyA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,186,1787036400"; d="scan'208";a="5331831" Received: from gkldtt-dev-004.igk.intel.com (HELO localhost) ([10.123.221.202]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2026 06:57:56 -0700 From: Markus Metzger To: gdb-patches@sourceware.org Subject: [PATCH 3/5] gdb, btrace: fix btrace remote configuration Date: Fri, 30 Oct 2026 14:57:42 +0100 Message-ID: <20261030135744.921562-4-markus.t.metzger@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030135744.921562-1-markus.t.metzger@intel.com> References: <20261030135744.921562-1-markus.t.metzger@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org GDB currently only updates those parts of the remote btrace configuration that it believes are different than on the remote target. Since it does not read the target configuration initially, this can only be a guess. There currently is no packet to read the global btrace configuration. The existing qXfer:btrace-conf:read packet requires a thread and fails with E.Must select a single thread. if the general thread is null_ptid. The packet could be extended to provide the global configuration in that case, but older gdbserver would still reply with an error, requiring GDB to write its configuration at least once. The overhead of writing all aspects of the configuration is tiny compared to reading the trace from the target, so this patch simply writes all parts whenever tracing is enabled for a thread. Also fix a few overlong lines in this area. --- gdb/remote.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index 6e3a2089b9e..e0e508bd0ce 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -15455,8 +15455,8 @@ remote_target::btrace_sync_conf (const btrace_config *conf) buf = rs->buf.data (); endbuf = buf + get_remote_packet_size (); - if (m_features.packet_support (PACKET_Qbtrace_conf_bts_size) == PACKET_ENABLE - && conf->bts.size != rs->btrace_config.bts.size) + if (m_features.packet_support (PACKET_Qbtrace_conf_bts_size) + == PACKET_ENABLE) { pos = buf; pos += xsnprintf (pos, endbuf - pos, "%s=0x%x", @@ -15466,15 +15466,17 @@ remote_target::btrace_sync_conf (const btrace_config *conf) putpkt (buf); getpkt (&rs->buf); - packet_result result = m_features.packet_ok (buf, PACKET_Qbtrace_conf_bts_size); + packet_result result + = m_features.packet_ok (buf, PACKET_Qbtrace_conf_bts_size); if (result.status () == PACKET_ERROR) - error (_("Failed to configure the BTS buffer size: %s"), result.err_msg ()); + error (_("Failed to configure the BTS buffer size: %s"), + result.err_msg ()); rs->btrace_config.bts.size = conf->bts.size; } - if (m_features.packet_support (PACKET_Qbtrace_conf_pt_size) == PACKET_ENABLE - && conf->pt.size != rs->btrace_config.pt.size) + if (m_features.packet_support (PACKET_Qbtrace_conf_pt_size) + == PACKET_ENABLE) { pos = buf; pos += xsnprintf (pos, endbuf - pos, "%s=0x%x", @@ -15484,16 +15486,17 @@ remote_target::btrace_sync_conf (const btrace_config *conf) putpkt (buf); getpkt (&rs->buf); - packet_result result = m_features.packet_ok (buf, PACKET_Qbtrace_conf_pt_size); + packet_result result + = m_features.packet_ok (buf, PACKET_Qbtrace_conf_pt_size); if (result.status () == PACKET_ERROR) - error (_("Failed to configure the trace buffer size: %s"), result.err_msg ()); + error (_("Failed to configure the trace buffer size: %s"), + result.err_msg ()); rs->btrace_config.pt.size = conf->pt.size; } - if ((m_features.packet_support (PACKET_Qbtrace_conf_pt_ptwrite) - == PACKET_ENABLE) - && conf->pt.ptwrite != rs->btrace_config.pt.ptwrite) + if (m_features.packet_support (PACKET_Qbtrace_conf_pt_ptwrite) + == PACKET_ENABLE) { pos = buf; const char *ptw = conf->pt.ptwrite ? "yes" : "no"; @@ -15524,9 +15527,8 @@ remote_target::btrace_sync_conf (const btrace_config *conf) && conf->pt.event_tracing) warning (_("Target does not support event-tracing.")); - if ((m_features.packet_support (PACKET_Qbtrace_conf_pt_event_tracing) - == PACKET_ENABLE) - && conf->pt.event_tracing != rs->btrace_config.pt.event_tracing) + if (m_features.packet_support (PACKET_Qbtrace_conf_pt_event_tracing) + == PACKET_ENABLE) { pos = buf; const char *event_tracing = conf->pt.event_tracing ? "yes" : "no"; -- 2.53.0 ________________________________________ Intel Deutschland GmbH Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany Tel: +49 (89) 99143-0 www.intel.de Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman Chairperson of the Supervisory Board: Sonja Pierer Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.