Received: by 2002:ab2:687:0:b0:1f4:6588:b3a7 with SMTP id s7csp111146lqe; Tue, 9 Apr 2024 16:50:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUrbhi6dzVIAOF3PVoJt6+P36BPO5qHkbo8Kzv70xKI5+QufnAhiUJ0vYOol5aBimrw+OySAj4YXMp5JgHAi7+vTJkSNwbvfSQscjHgbA== X-Google-Smtp-Source: AGHT+IEzB/mENNvxAN4W9PuyUaqZ7Ww2mHyu2Q+7yyi0aeJkHx4dT+Ta1QZtXdI7dDtUIfU/zEo6 X-Received: by 2002:ad4:5c8a:0:b0:69b:1d4f:8237 with SMTP id o10-20020ad45c8a000000b0069b1d4f8237mr1264024qvh.31.1712706629184; Tue, 09 Apr 2024 16:50:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712706629; cv=pass; d=google.com; s=arc-20160816; b=UkmEe3c9ZNVjm4GvcAxRaY5OnFd76/Gi++pNzlXgowQvP++m1EplOJvVqa5bjBd0YA T5Kc+xmRxK2bBq/KyWmPAlrDB3v29iYo1AgdwX5dwcmMjy92yhyt0yYIwbdeTbr+CkdG NoATB7zMukbMWLR7sUOuZUohAji6LsShdnVIcc7lVVEzg+WyFgG5bpYoocXsSqtGr9r6 sT8deP455FQT/HtmrM9Ds1dkSaDKVhfqVTIcuM9QPCTerXnEePWY098IpRE0tb5eS+it Hmb0aDI6muidIBmg3hZ0H2LrJPGWRdCtaMOAwwMV2FzmF+nPMsN1cVuWfR0OY94wAe4n G+5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3JWS6f+xGOOy1qVyipmF2CND1AabTi5v93EDoh2eYSU=; fh=fHhbvXgCev/wpffLVpfaAi8pPyv7hrTyhVPgsZ7HNrs=; b=u8fCLE63Vy73QK03k/mGvcXEtWeqrPyQMe5Tr8w2bCLO9VyIbAhNRal1AqOfRj4wcB MJZL09tEMIUN1vLQXFsqPBFa154PSPQlVYz5DacvJzEW/619P42ky8kk7Sec03AwD1cb JHw26lW4HmJ7GnO7DMdmh1Uo7QbAvcJ5ut6+6v4DiDaPlk8Njf9ZBmndmuBnwR71muBp FRwpDOWYgMICTypAFgGJYIhNeQcE1nyxcu7nUOquSRcIZ7/1b3rAACpzPVppVkdUjc+W pz9iY2F4sjSHGY5kYzvOEQkpf9/OvaC++/l5jKHLikgI1C13YqqIRJuA3qOGNcrLmeMR EC5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=naEbYt79; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-137727-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137727-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w13-20020a0cc24d000000b0069b10ff8960si7419182qvh.176.2024.04.09.16.50.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 16:50:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137727-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=naEbYt79; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-137727-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137727-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CE9101C226B3 for ; Tue, 9 Apr 2024 23:50:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E531315921F; Tue, 9 Apr 2024 23:50:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="naEbYt79" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1521C1591F8; Tue, 9 Apr 2024 23:50:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712706603; cv=none; b=B9RoCtpW79tplCJXtV1YKOjNpIziaPcvAgDCpFdUsWfPISSC4KzYzAL6SX3mnDSoUMtfAFsdXuHZk2U70PJPlZiGq0NSuH+7iuZ36M9IxzIEe8peeHkaaTDOsSPlAfO3yXTOohtdRxouhVjzMqpbDwqIIfjjDpM3lmtBwLTslP4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712706603; c=relaxed/simple; bh=JniUIOtymtPSjR4nX8r1BDesYexwAvEo2n0TNtIdZes=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oYgND4sLw2RKbPuuEdNP2dik0UrCez+kkeURDJLlohcFO3K5hBHB+a1tZj9BcPPsxRiAbtICu2B1CWxlSOZu78ASBlV6PDr6J4Fa7Iv4N+vG9PR4eV790KOKp2xoggK58ZQeLV6fG8Ve1Rsu1TJEewV7wqk74Bf8yx/SeEUhwuA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=naEbYt79; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98072C433A6; Tue, 9 Apr 2024 23:50:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712706602; bh=JniUIOtymtPSjR4nX8r1BDesYexwAvEo2n0TNtIdZes=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=naEbYt79Rt3g+TLI52IaGdEmcyGYXtoC3tux39xgok/DKT0JRk9AsU/EJiSfgsf8f dLDPzD3kT4Zu9NdsSl7sYptIJqE4qk6nXoSNgbG66fDxk89d6FOqJKdQ2lrQSvuHr2 bkRsB0Apd7JM56BwCcN6dy0cGQcecWRx03iKx3AfBEDMmGW5xriF+170uyIwqVpHQJ tZmxGsvToTbmNEg5QpLrWU1vJUEZuGyWNNL5xKT8pr2dgWNvoN56lnSQo5D5eTArGn +XaMwlnm9L805riHlSjQKwns5fg5WVzLxQOh478yW/FbeuFs0VWX/DORDaV0/juA8b edRe0U70D/BPw== From: Namhyung Kim To: Arnaldo Carvalho de Melo , Ian Rogers , Kan Liang Cc: Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Subject: [PATCH 1/6] perf annotate: Show progress of sample processing Date: Tue, 9 Apr 2024 16:49:55 -0700 Message-ID: <20240409235000.1893969-2-namhyung@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240409235000.1893969-1-namhyung@kernel.org> References: <20240409235000.1893969-1-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Like perf report, it can take a while to process samples. Show the progress window to inform users how long it'll take. Signed-off-by: Namhyung Kim --- tools/perf/builtin-annotate.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 16e1581207c9..332e1ddcacbd 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -37,6 +37,7 @@ #include "util/map_symbol.h" #include "util/branch.h" #include "util/util.h" +#include "ui/progress.h" #include #include @@ -665,13 +666,23 @@ static int __cmd_annotate(struct perf_annotate *ann) evlist__for_each_entry(session->evlist, pos) { struct hists *hists = evsel__hists(pos); u32 nr_samples = hists->stats.nr_samples; + struct ui_progress prog; if (nr_samples > 0) { total_nr_samples += nr_samples; - hists__collapse_resort(hists, NULL); + + ui_progress__init(&prog, nr_samples, + "Merging related events..."); + hists__collapse_resort(hists, &prog); + ui_progress__finish(); + /* Don't sort callchain */ evsel__reset_sample_bit(pos, CALLCHAIN); - evsel__output_resort(pos, NULL); + + ui_progress__init(&prog, nr_samples, + "Sorting events for output..."); + evsel__output_resort(pos, &prog); + ui_progress__finish(); /* * An event group needs to display other events too. -- 2.44.0.478.gd926399ef9-goog