From patchwork Fri Sep 4 21:24:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Trofimovich X-Patchwork-Id: 1357847 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=2620:52:3:1:0:246e:9693:128c; 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=tRykQyI0; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4BjrKl65M8z9sTH for ; Sat, 5 Sep 2020 07:24:42 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 24352386F434; Fri, 4 Sep 2020 21:24:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24352386F434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1599254679; bh=hsoJSV0GII4qP+yWBhxa/4vL8klR+z+r1sVnJvoT5oE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=tRykQyI00gBw4ff78i0TX0II+aTAomy3OHlemm3cwUBZNF2Sp/8qHzS4AvY7mNkFs j0NMCCfcDSfZQXxKoEoK48QIzh2XNbeNweR3K+21opzqIkjGc1ps3VO8l7Yc3yKitw yLMITzeIFbRrHkz7R68lzE6Msf3YVtwRjFvt+fL8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 4ABF53857809 for ; Fri, 4 Sep 2020 21:24:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4ABF53857809 Received: by sf.home (Postfix, from userid 1000) id 3CCED5A22061; Fri, 4 Sep 2020 22:24:31 +0100 (BST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] profile: clarify comment around histogram format Date: Fri, 4 Sep 2020 22:24:23 +0100 Message-Id: <20200904212423.3921626-1-slyfox@gentoo.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, 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: Sergei Trofimovich via Gcc-patches From: Sergei Trofimovich Reply-To: Sergei Trofimovich Cc: Sergei Trofimovich Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Sergei Trofimovich gcc/ChangeLog: * gcc/profile.c (sort_hist_values): Clarify hist format: start with a value, not counter. --- gcc/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/profile.c b/gcc/profile.c index f5c206813c7..fe8963cc9e9 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -771,7 +771,7 @@ sort_hist_values (histogram_value hist) int counters = hist->hvalue.counters[1]; for (int i = 0; i < counters - 1; i++) /* Hist value is organized as: - [total_executions, N, counter1, ..., valueN, counterN] + [total_executions, N, value1, counter1, ..., valueN, counterN] Use decrease bubble sort to rearrange it. The sort starts from and compares counter first. If counter is same, compares the value, exchange it if small to keep stable. */