From patchwork Tue Feb 13 07:52:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 20289 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp383771dyb; Mon, 12 Feb 2024 23:53:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVXk0/Im2CB0q/h+HWSaBHkiyDNzm0extuAyRp8XW2XkMaigyKgoLYYo5KMA8BgfGHR7+CWywnXoGdwO+Jr7jM224zLzA== X-Google-Smtp-Source: AGHT+IGyx6SWjLkuK5mLgCjkrx/ututDNOFFiB6kxpEaz9Ua4Rij/j3SApIQVTM1lUMLUOIkXFCB X-Received: by 2002:ac8:7f82:0:b0:42c:6a1d:c593 with SMTP id z2-20020ac87f82000000b0042c6a1dc593mr2993931qtj.2.1707810839813; Mon, 12 Feb 2024 23:53:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707810839; cv=pass; d=google.com; s=arc-20160816; b=vYHhhgYdWQa4Rvae6UriRg3/r5uAxsU12usI6DSOIJ6VaG2rFyA7T3YCmzgOP9KAoJ cT3vExbIPnB2lvYKnthHpWVpwS98/n6Ul2+T7WUuPyT9alXDr3/dWXT/uSiSJZuWSjlr jjh6BychdhuAqSUuKrIVJvf4zkc1H1/dhyHdJEz9Hw/947MTuCk7vlyfPJd6y6LOJPd7 gOEPt867weikwajb2uE2q8PngpuiOLoefJZVGQnY+5CBJoSeKyhuwQOCmR9D66IpCARN ES9Ofow0s5DlkbCuA9NdlX5+C0qMTZb6nAixSZZ2gsnpWoixXn9y4UYX19Nqz7y9AXQi XXkw== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=IQ8+FeBvJBYvyFGIw+SFqE3esopTbLE/l0SXghmiK94=; fh=2w70ymsse0BN89xqdngh1jquvVtxaDHwmsGL/pRpoM4=; b=d8zd1hJ9PVkul/phFPfX0WF9cOhZn1JPrT/m0HxDWO2rgbIKVu9qS/jm/0nxFbhEqx BRXwTIJHnKLNPft9tuUJikOSQNojKVERV2azpBJxaNfQvDMCaU2/EfD73B7R6g1M+aiF ipYLY29ZvjdejkE1iFYC4EOLcYSK2AbUxdR9MUNVJH1Ur799yvVcH5CxTKyrTZ/rcsG0 Mal9DL+Cl2sAXh8n6PXujGAPezBNvpxyLmax6TeLsgLNZoVG8IY8I9XURlMA6zDCdX8H 2GbjPo6vZBPfrSvX2jXfONAADiwtoO9s0n46+mjspZvrdhbEthpkaXFOzbmQZvxeJ0uf CiHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rVYTRJWx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63061-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63061-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCVTQBbg+J2uZ/y7r+Uz3xK1Mcvjm5FpL2UQ91ZJy9UWu2ZZFDKsZyM4aFe8X4z4TvYzCARrY8m6+EcqXsjPz7bFb03pYQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jn2-20020ad45de2000000b0068c452b7d9esi2286497qvb.356.2024.02.12.23.53.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 23:53:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63061-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rVYTRJWx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63061-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63061-ouuuleilei=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 997AD1C21931 for ; Tue, 13 Feb 2024 07:53:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D4B020B02; Tue, 13 Feb 2024 07:53:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rVYTRJWx" 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 D8C3517743; Tue, 13 Feb 2024 07:52:57 +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=1707810777; cv=none; b=AFwlRdzvSQusN085zPT+mBkh9z/CTvhytyxNPXUTwX0xDZiJEFrO4QAR62IjhWugwknUwGHOyhrcwn4HMfuIJ6uqHU/V1qdGez2wozUYb1T4IupR8tVyRLCzqck178VVxevpRaeCmKa1OT7bDcjZTlVzwJ/s5YUZXoli3uJzqck= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707810777; c=relaxed/simple; bh=RAMSiO9LDsSEGaCX0VfpRG5twBN521Gc1CP60zBfNjM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=e1YBMR2ycjwFZMXa26idFR4Q3kHflxssskHajqXikKtcyNYrgLR02Dxdpz13aacdCXl2357TsfbSoYFNC/L0yAWPn0JVG6Nk0hUS19gt8vjJ0VMtgOygS5bX/LG2287udx9BXoHD0NuMlyFnC+GzxBPtXqSWwNce0OqciQoDQYI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rVYTRJWx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AA3FC433F1; Tue, 13 Feb 2024 07:52:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707810777; bh=RAMSiO9LDsSEGaCX0VfpRG5twBN521Gc1CP60zBfNjM=; h=From:To:Cc:Subject:Date:From; b=rVYTRJWxch4D6YJ6sy/5Q5z5Cfn84zgis4PxTRcNmSOMUKdd+CrgaCQqpgWkf7MvO PoLnU2fBZCZeQUXB29GfakR1M1Xdf+VG9hf6OiZzZNUI6q4/HVV95b4KsHRAJRr1XM BZ52S9728iPK6ie7ZdJKJlWpCjiPcvU4KTtDsJgnirhJR9zFCsmvmgA1WMyym5Crq6 ljLAXFs2m8/UvNWbYycjeppBLyNQ9ei5b3bfMNjPZ6Mm8JtSAFqyHb6+Ka2f3azXe0 7EEugxs3fU3Q/+qJVnklrhjVocRs/yQQLrl3cyAABJV/t/s40sbaXV/LCb+04xkSIW FapA8tqtv8vYQ== From: Namhyung Kim To: Arnaldo Carvalho de Melo , Ian Rogers Cc: Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Subject: [PATCHSET 0/4] perf report: Omit dummy events in the output (v1) Date: Mon, 12 Feb 2024 23:52:52 -0800 Message-ID: <20240213075256.1983638-1-namhyung@kernel.org> X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790769459076138050 X-GMAIL-MSGID: 1790769459076138050 Hello, This work is to make the output compact by removing dummy events in the evlist. The dummy events are used to save side-band information like task creation or memory address space change using mmap(2). But after collecting these, it's not used because it won't have any samples. Sometimes users want to run perf report --group to show all recorded events together but they are not interested in those dummy events. This just wastes the precious screen space so we want to get rid of them after use. perf report already has --skip-empty option to skip 0 result in the stat output. I think we can extend it to skip empty events that have no samples. Example output: Before) # # Samples: 232 of events 'cpu/mem-loads,ldlat=30/P, cpu/mem-stores/P, dummy:u' # Event count (approx.): 3089861 # # Overhead Command Shared Object Symbol # ........................ ........... ................. ..................................... # 9.29% 0.00% 0.00% swapper [kernel.kallsyms] [k] update_blocked_averages 5.26% 0.15% 0.00% swapper [kernel.kallsyms] [k] __update_load_avg_se 4.15% 0.00% 0.00% perf-exec [kernel.kallsyms] [k] slab_update_freelist.isra.0 3.87% 0.00% 0.00% perf-exec [kernel.kallsyms] [k] memcg_slab_post_alloc_hook 3.79% 0.17% 0.00% swapper [kernel.kallsyms] [k] enqueue_task_fair 3.63% 0.00% 0.00% sleep [kernel.kallsyms] [k] next_uptodate_page 2.86% 0.00% 0.00% swapper [kernel.kallsyms] [k] __update_load_avg_cfs_rq 2.78% 0.00% 0.00% swapper [kernel.kallsyms] [k] __schedule 2.34% 0.00% 0.00% swapper [kernel.kallsyms] [k] intel_idle 2.32% 0.97% 0.00% swapper [kernel.kallsyms] [k] psi_group_change After) # # Samples: 232 of events 'cpu/mem-loads,ldlat=30/P, cpu/mem-stores/P' # Event count (approx.): 3089861 # # Overhead Command Shared Object Symbol # ................ ........... ................. ..................................... # 9.29% 0.00% swapper [kernel.kallsyms] [k] update_blocked_averages 5.26% 0.15% swapper [kernel.kallsyms] [k] __update_load_avg_se 4.15% 0.00% perf-exec [kernel.kallsyms] [k] slab_update_freelist.isra.0 3.87% 0.00% perf-exec [kernel.kallsyms] [k] memcg_slab_post_alloc_hook 3.79% 0.17% swapper [kernel.kallsyms] [k] enqueue_task_fair 3.63% 0.00% sleep [kernel.kallsyms] [k] next_uptodate_page 2.86% 0.00% swapper [kernel.kallsyms] [k] __update_load_avg_cfs_rq 2.78% 0.00% swapper [kernel.kallsyms] [k] __schedule 2.34% 0.00% swapper [kernel.kallsyms] [k] intel_idle 2.32% 0.97% swapper [kernel.kallsyms] [k] psi_group_change Now 'Overhead' column only has two values for mem-loads and mem-stores. Thanks, Namhyung Namhyung Kim (4): libperf evlist: Update group info in perf_evlist__remove() perf hist: Simplify hist printing logic for group events perf hist: Do not use event index in hpp__fmt() perf report: Do not show dummy events with --skip-empty tools/lib/perf/evlist.c | 21 +++++++ tools/perf/Documentation/perf-report.txt | 3 +- tools/perf/builtin-report.c | 14 ++++- tools/perf/ui/hist.c | 77 +++++++++++++----------- 4 files changed, 79 insertions(+), 36 deletions(-)