From patchwork Mon Apr 28 20:23:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Khouzam X-Patchwork-Id: 739 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 9F44D360078 for ; Mon, 28 Apr 2014 13:24:12 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14314964) id 06B484FB0E7E; Mon, 28 Apr 2014 13:24:11 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx22.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id DF1DF50DE964 for ; Mon, 28 Apr 2014 13:24:07 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-type; q=dns; s=default; b=Rfg9TrUSn4Xa6VV/ WwBwytDpjELu+36jTorad8SY8LK64KKFIJ9QH5eSlldJE/gYYuTHPU9z1WBr+uIx p/Lo0JtbNdAAPCKtC6vCQ6tqSVO+LHIdk8f3cdpMR8TP44Rc591tBXl5/IFRdxjr q100X4NjZwC6n+rt9dO9YkuCxM4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-type; s=default; bh=Q6dHy4kOsqVqq1d12YLozK nLHFk=; b=WgjqyKYzscaCoA4KkL2qxxPxP5mT9xl2PT5ys/2C0eSqNkjEAYWKa0 GqKNqy8mS3db5z7jUSplmR+NJgxfWh0kogdcMlLPPChb1JqBBXGnhYMobXZMzBtH wGRY/TQrHvuKMJEBaiwFZjdFsTsiyXabF0RoI82hELYzO289BUQWs= Received: (qmail 32733 invoked by alias); 28 Apr 2014 20:24:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 32717 invoked by uid 89); 28 Apr 2014 20:24:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg20.ericsson.net Received: from usevmg20.ericsson.net (HELO usevmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 28 Apr 2014 20:24:03 +0000 Received: from EUSAAHC001.ericsson.se (Unknown_Domain [147.117.188.75]) by usevmg20.ericsson.net (Symantec Mail Security) with SMTP id 97.9D.07420.15A6E535; Mon, 28 Apr 2014 16:48:50 +0200 (CEST) Received: from elx67nvvz1-ei.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.75) with Microsoft SMTP Server (TLS) id 14.3.174.1; Mon, 28 Apr 2014 16:24:00 -0400 From: Marc Khouzam To: CC: Marc Khouzam Subject: [PATCH] PR breakpoints/15697: Remove =breakpoint-modified when hitting dprintf Date: Mon, 28 Apr 2014 16:23:43 -0400 Message-ID: <1398716623-16991-1-git-send-email-marc.khouzam@ericsson.com> MIME-Version: 1.0 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in GDB currently sends a =breakpoint-modified for every dprintf hit. This can cause performance degradation at the frontend. The below patch prevents GDB from sending this event for dprintf when the event is triggered by the dprintf being hit. This means the event is not sent when the hit-count is incremented or the ignore-count is decremented due to a hit. https://sourceware.org/bugzilla/show_bug.cgi?id=15697 This was discussed last year: http://sourceware.org/ml/gdb-patches/2013-03/msg00260.html No regressions. Ok? Thanks Marc --- DPrintfs can be hit very often since they don't interrupt the execution. Having a =breakpoint-modified event at every hit can cause performance degradation at the frontend. The only value in this event is to indicate that the hit-count has changed. For the hit-count value however, it is sufficient for a frontend to get the latest value upon request and not through an asynchronous event. We also remove =breakpoint-modified when hitting a dprintf and decrementing the ignore count. If the ignore count is set to a high number, the =breakpoint-modified could also cause performance degradation as it will be sent at every dprintf hit which decrements the ignore count. 2014-04-28 Marc Khouzam PR breakpoints/15697 * breakpoint.c (bpstat_check_breakpoint_conditions): Don't call observer_notify_breakpoint_modified for dprintf. * breakpoint.c (bpstat_stop_status): Ditto. --- gdb/breakpoint.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index f422998..25615eb 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -5378,7 +5378,8 @@ bpstat_check_breakpoint_conditions (bpstat bs, ptid_t ptid) bs->stop = 0; /* Increase the hit count even though we don't stop. */ ++(b->hit_count); - observer_notify_breakpoint_modified (b); + if (b->type != bp_dprintf) + observer_notify_breakpoint_modified (b); } } @@ -5515,7 +5516,8 @@ bpstat_stop_status (struct address_space *aspace, if (bs->stop) { ++(b->hit_count); - observer_notify_breakpoint_modified (b); + if (b->type != bp_dprintf) + observer_notify_breakpoint_modified (b); /* We will stop here. */ if (b->disposition == disp_disable)