From patchwork Fri Mar 27 14:15:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2 via Gcc-patches" X-Patchwork-Id: 1262817 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=RSH5Ayqr; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48pkQX4JHLz9sRR for ; Sat, 28 Mar 2020 01:15:16 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A2ABA385E014; Fri, 27 Mar 2020 14:15:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2ABA385E014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1585318513; bh=UbfIu46nMJEDitZ1FWAM0175z89PYVYvsQaNxp5WEEY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=RSH5AyqrL7C7VWEIJaK55RgMyNj9dy6Vm6d6MyTBIld6h00DCDLfG9isrDtVoSxv5 qtegQ1UapJwDDh1ZVikCGzoTGgS64rR5Tp0sYA/Mlt3cXAUT7o7ML2A6DQpUKIXS9s M2idDK5OpNCnPyIWgGEcfBnMkIIJp+ggS4D/RXQY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by sourceware.org (Postfix) with ESMTP id 5D7FE385E006 for ; Fri, 27 Mar 2020 14:15:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5D7FE385E006 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-234-v8Hc0l_aOuS2QTdsLW15Mg-1; Fri, 27 Mar 2020 10:15:08 -0400 X-MC-Unique: v8Hc0l_aOuS2QTdsLW15Mg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5F52D149C2 for ; Fri, 27 Mar 2020 14:15:07 +0000 (UTC) Received: from t470.redhat.com (ovpn-112-115.phx2.redhat.com [10.3.112.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC62597B15; Fri, 27 Mar 2020 14:15:06 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [committed] analyzer: improvements to diagnostic-manager.cc logging Date: Fri, 27 Mar 2020 10:15:05 -0400 Message-Id: <20200327141505.31315-1-dmalcolm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-30.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: David Malcolm via Gcc-patches From: "Li, Pan2 via Gcc-patches" Reply-To: David Malcolm Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to master as 8f02357571a858f7ff5ca7734e5344d989a7fd0c. gcc/analyzer/ChangeLog: * diagnostic-manager.cc (dedupe_winners::add): Show the exploded_node index in the log messages. (diagnostic_manager::emit_saved_diagnostics): Log a summary of m_saved_diagnostics at entry. --- gcc/analyzer/diagnostic-manager.cc | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/gcc/analyzer/diagnostic-manager.cc b/gcc/analyzer/diagnostic-manager.cc index 9bd018a3aac..e27e6269915 100644 --- a/gcc/analyzer/diagnostic-manager.cc +++ b/gcc/analyzer/diagnostic-manager.cc @@ -358,21 +358,25 @@ public: This could introduce false negatives, as there could be longer feasible paths within the egraph. */ if (logger) - logger->log ("considering %qs at SN: %i", - sd.m_d->get_kind (), sd.m_snode->m_index); + logger->log ("considering %qs at EN: %i, SN: %i", + sd.m_d->get_kind (), sd.m_enode->m_index, + sd.m_snode->m_index); + if (!dc->get_path ().feasible_p (logger)) { if (logger) - logger->log ("rejecting %qs at SN: %i" + logger->log ("rejecting %qs at EN: %i, SN: %i" " due to infeasible path", - sd.m_d->get_kind (), sd.m_snode->m_index); + sd.m_d->get_kind (), sd.m_enode->m_index, + sd.m_snode->m_index); delete dc; return; } else if (logger) - logger->log ("accepting %qs at SN: %i with feasible path", - sd.m_d->get_kind (), sd.m_snode->m_index); + logger->log ("accepting %qs at EN: %i, SN: %i with feasible path", + sd.m_d->get_kind (), sd.m_enode->m_index, + sd.m_snode->m_index); dedupe_key *key = new dedupe_key (sd, dc->get_path ()); if (dedupe_candidate **slot = m_map.get (key)) @@ -466,6 +470,15 @@ diagnostic_manager::emit_saved_diagnostics (const exploded_graph &eg) LOG_SCOPE (get_logger ()); auto_timevar tv (TV_ANALYZER_DIAGNOSTICS); log ("# saved diagnostics: %i", m_saved_diagnostics.length ()); + if (get_logger ()) + { + unsigned i; + saved_diagnostic *sd; + FOR_EACH_VEC_ELT (m_saved_diagnostics, i, sd) + log ("[%i] sd: %qs at EN: %i, SN: %i", + i, sd->m_d->get_kind (), sd->m_enode->m_index, + sd->m_snode->m_index); + } if (m_saved_diagnostics.length () == 0) return;