Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp158719lqg; Wed, 10 Apr 2024 20:33:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWwfS57xhQZ7GjbbSy+XlrETTA4ZajIbSZpftsRFsnR1J/m0v55ZAS0/M8j3HCp97d51YZ/EBMbtHaqAI+qY2KpN91O3nqVMazFUTfmfQ== X-Google-Smtp-Source: AGHT+IHFGtSfBl4Ov3coUaeTaB+6NKXrdEB3JyhgeDh169EywLHJRwGgxnT84BMrn4nOqD9AZFGm X-Received: by 2002:a05:6214:76c:b0:699:1eb1:23a9 with SMTP id f12-20020a056214076c00b006991eb123a9mr4375185qvz.42.1712806403730; Wed, 10 Apr 2024 20:33:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712806403; cv=pass; d=google.com; s=arc-20160816; b=06px+PYklGyRxGBzCvwWB+dTF45AzHQJw+Lk/vtF9CMF7vVIlYS4wd89h5coT9+dvV mmTzhx9TOT2+WdyfELD8be1PUAl6ip82M8s7GWaRaIjsiFw1c0TCEKvclO9H+kXVjkT4 VRiipxV3RNqAcGRgDkEQxw4iI6URI0fBfFZTDZIIvJwYFwfO7jzgVMInzpdQyYTTWQhE +86zT2YunY2bM3Q79L/jftlfO+BI+TXyL0VqxlDU0VboJLe5PxR58rp3VO0Bzj1YznR0 THr1wKem5E94K3bkvuXg1XEfXl4df34e2XngbI5ZFKD55ShIeRIva7C6ARdqgnAFGWw1 96+w== 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=gLtWDdiE/QwYvCKYwa7rnO9iPGb3k6QVJcLr2yhXkyk=; fh=fHhbvXgCev/wpffLVpfaAi8pPyv7hrTyhVPgsZ7HNrs=; b=xFLi90pbRHiyPolaCv2MFNt/y+ZBHZU9lJg8tUaeDk8LBZiBzLdiklH78JV6VJgF5e s9eBN+PDv1NZSU7rhZ96LQ0A0RQQcGZBEWh2j3qfnFdMI/JeiNDjK8yV8wG1jwBI/KE2 7coDXu4G2mR5uea5hEoho4LOTJbPvgPnau3ZoTnFxljh0cy1OVLzV4l/hrYjo96cWdXm kQnMvMITMaf0XzQCufXG2WXHMLbAlIFn69EpiCPrleemgWE10PHXsmtu9b1B8f8FogUc j8eONu92z5Pr8P88u7ri6CrJ/8/lXx8CPRt2GA27vBZ2AWPMj43ojzFFkqbKTIAmfQn5 JMpQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ngVvk5vq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139715-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 a18-20020a0ccdd2000000b0069b29c09d33si615517qvn.486.2024.04.10.20.33.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 20:33:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139715-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=ngVvk5vq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139715-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 704A11C21CC0 for ; Thu, 11 Apr 2024 03:33:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A413913BC1B; Thu, 11 Apr 2024 03:32:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ngVvk5vq" 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 C6D7313BAE5; Thu, 11 Apr 2024 03:32:58 +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=1712806378; cv=none; b=cTpEoCtCwk43FGuRNT4vYlLWQNYfTKnuvB1aP48EbNXGTRuG78mWUfZWBGEpcFMlCS2gXVIa3gUG5ATzqZuYshkMmfRbH1VOylx0diFHQNejr2FS8ErSgd0b3G+ZoXM2qeuiMs/1nd8lJ11fVpaxJTbQJbcBnoobw3Y/MzwULXk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712806378; c=relaxed/simple; bh=E7MUbHglg5iWys9JXYDObrTkAuoigHes409w9J6EGEc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bjo0uOOpsakFSVn6nTbzuLX+h1xKQ2bbQ5oC2vN2HJvVNdnMG+ktMJCeaeHozdqGE+HX+it/1f9/cKOPypJneyZtxHsyQ1FSRe9dwPyCIZAs6o1RgIl0NR8T1hZpMaJ6I3AuPM49zM8dobl2Hu8vnhIgvG4CQpunZqbRbGGWjCw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ngVvk5vq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F85CC43399; Thu, 11 Apr 2024 03:32:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712806378; bh=E7MUbHglg5iWys9JXYDObrTkAuoigHes409w9J6EGEc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ngVvk5vq9Y6CbMgZjWWsYxjtjK4/EdUjH75o2kERRsv0x6/5KAAJDjK8ZLxY2z/rW EyvE/G1p9gwBqVTqgGfS6Bq9iRVSlVP0ei6SxFEG85UwgnVGhYB3jOcW+ssj2CNjmQ QiIyTgFB/u0peIdYJXlJO9/gLfLjN3MYlDaEDtiHgVTt6dAWb1sCNszrY+amBYJ7xh 98h2w71Y2oB+cW7ZRiZYeHWuhznhi9CT7ACS5/XxOuyb00O+ddpNNln+kocglkpdpY /BvMYFQ5OUelsOV7wZk8YcXZPIx0oDh10viB9okTmGoNqt6z9M10AL44wy3MbENgQU 2BppXXCHiILig== 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 2/7] perf annotate: Show progress of sample processing Date: Wed, 10 Apr 2024 20:32:51 -0700 Message-ID: <20240411033256.2099646-3-namhyung@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240411033256.2099646-1-namhyung@kernel.org> References: <20240411033256.2099646-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 a progress window to inform users how that it is not stuck. Reviewed-by: Ian Rogers 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