Skip to contentSkip to conversation

perf report: Skip symbols for idle symbols

PATCH In review Rafał Miłecki 2 participants 3 messages Jun 8, 2022 – Oct 19, 2022 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf report: Skip symbols for idle symbols

From: Rafał Miłecki <[email protected]>

Displaying idle symbols is rather useless and makes reviewing "real" symbols harder. perf top already skips them so perf report should probably do the same.

BEFORE

# Overhead  Command          Shared Object          Symbol                             
# ........  ...............  .....................  ...................................
#
    75.04%  swapper          [kernel.kallsyms]      [k] arch_cpu_idle
     1.05%  ksoftirqd/0      [kernel.kallsyms]      [k] __pi___inval_dcache_area
     0.78%  ksoftirqd/0      [kernel.kallsyms]      [k] __netif_receive_skb_core
     0.75%  ksoftirqd/0      [kernel.kallsyms]      [k] fib_table_lookup
     0.58%  ksoftirqd/0      [kernel.kallsyms]      [k] __dev_queue_xmit
     0.56%  ksoftirqd/0      [kernel.kallsyms]      [k] bcm4908_enet_start_xmit
     0.55%  ksoftirqd/0      [kernel.kallsyms]      [k] __skb_flow_dissect
     0.53%  ksoftirqd/0      [kernel.kallsyms]      [k] __pi___clean_dcache_area_poc

AFTER

# Overhead  Command          Shared Object          Symbol                             
# ........  ...............  .....................  ...................................
#
     4.21%  ksoftirqd/0      [kernel.kallsyms]      [k] __pi___inval_dcache_area
     3.13%  ksoftirqd/0      [kernel.kallsyms]      [k] __netif_receive_skb_core
     3.01%  ksoftirqd/0      [kernel.kallsyms]      [k] fib_table_lookup
     2.32%  ksoftirqd/0      [kernel.kallsyms]      [k] __dev_queue_xmit
     2.23%  ksoftirqd/0      [kernel.kallsyms]      [k] bcm4908_enet_start_xmit
     2.21%  ksoftirqd/0      [kernel.kallsyms]      [k] __skb_flow_dissect
     2.13%  ksoftirqd/0      [kernel.kallsyms]      [k] __pi___clean_dcache_area_poc
     2.00%  ksoftirqd/0      [kernel.kallsyms]      [k] eth_type_trans
     1.86%  ksoftirqd/0      [kernel.kallsyms]      [k] bcm4908_enet_poll_rx
     1.73%  ksoftirqd/0      [kernel.kallsyms]      [k] __local_bh_enable_ip
     1.63%  ksoftirqd/0      [kernel.kallsyms]      [k] fib_rules_lookup
     1.61%  ksoftirqd/0      [kernel.kallsyms]      [k] bcm4908_enet_poll_tx
     (...)
---
 tools/perf/builtin-report.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
tools/perf/builtin-report.c +6 -3
index afe4a5539ecc..7e31af009d44 100644
@@ -316,9 +316,12 @@ static int process_sample_event(struct perf_tool *tool,
 				     &rep->total_cycles);
 	}
 
-	ret = hist_entry_iter__add(&iter, &al, rep->max_stack, rep);
-	if (ret < 0)
-		pr_debug("problem adding hist entry, skipping event\n");
+	if (al.sym == NULL || !al.sym->idle) {
+		ret = hist_entry_iter__add(&iter, &al, rep->max_stack, rep);
+		if (ret < 0)
+			pr_debug("problem adding hist entry, skipping event\n");
+	}
+
 out_put:
 	addr_location__put(&al);
 	return ret;
Signature · 1 line
2.34.1
#1 lore raw
Quoted 39 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

Displaying idle symbols is rather useless and makes reviewing "real" symbols harder. perf top already skips them so perf report should probably do the same.

BEFORE

# Overhead  Command          Shared Object          Symbol
# ........  ...............  .....................  ...................................
#
     75.04%  swapper          [kernel.kallsyms]      [k] arch_cpu_idle
      1.05%  ksoftirqd/0      [kernel.kallsyms]      [k] __pi___inval_dcache_area
      0.78%  ksoftirqd/0      [kernel.kallsyms]      [k] __netif_receive_skb_core
      0.75%  ksoftirqd/0      [kernel.kallsyms]      [k] fib_table_lookup
      0.58%  ksoftirqd/0      [kernel.kallsyms]      [k] __dev_queue_xmit
      0.56%  ksoftirqd/0      [kernel.kallsyms]      [k] bcm4908_enet_start_xmit
      0.55%  ksoftirqd/0      [kernel.kallsyms]      [k] __skb_flow_dissect
      0.53%  ksoftirqd/0      [kernel.kallsyms]      [k] __pi___clean_dcache_area_poc

AFTER

# Overhead  Command          Shared Object          Symbol
# ........  ...............  .....................  ...................................
#
      4.21%  ksoftirqd/0      [kernel.kallsyms]      [k] __pi___inval_dcache_area
      3.13%  ksoftirqd/0      [kernel.kallsyms]      [k] __netif_receive_skb_core
      3.01%  ksoftirqd/0      [kernel.kallsyms]      [k] fib_table_lookup
      2.32%  ksoftirqd/0      [kernel.kallsyms]      [k] __dev_queue_xmit
      2.23%  ksoftirqd/0      [kernel.kallsyms]      [k] bcm4908_enet_start_xmit
      2.21%  ksoftirqd/0      [kernel.kallsyms]      [k] __skb_flow_dissect
      2.13%  ksoftirqd/0      [kernel.kallsyms]      [k] __pi___clean_dcache_area_poc
      2.00%  ksoftirqd/0      [kernel.kallsyms]      [k] eth_type_trans
      1.86%  ksoftirqd/0      [kernel.kallsyms]      [k] bcm4908_enet_poll_rx
      1.73%  ksoftirqd/0      [kernel.kallsyms]      [k] __local_bh_enable_ip
      1.63%  ksoftirqd/0      [kernel.kallsyms]      [k] fib_rules_lookup
      1.61%  ksoftirqd/0      [kernel.kallsyms]      [k] bcm4908_enet_poll_tx
      (...)
Quoted 1 line

Ping? Does it look OK to you?

#2 lore raw

Em Tue, Oct 18, 2022 at 02:54:07PM +0200, Rafał Miłecki escreveu:

Quoted 40 lines · Rafał Miłecki
Quoted 39 lines

From: Rafał Miłecki <[email protected]>

Displaying idle symbols is rather useless and makes reviewing "real" symbols harder. perf top already skips them so perf report should probably do the same.

BEFORE

# Overhead  Command          Shared Object          Symbol
# ........  ...............  .....................  ...................................
#
     75.04%  swapper          [kernel.kallsyms]      [k] arch_cpu_idle
      1.05%  ksoftirqd/0      [kernel.kallsyms]      [k] __pi___inval_dcache_area
      0.78%  ksoftirqd/0      [kernel.kallsyms]      [k] __netif_receive_skb_core
      0.75%  ksoftirqd/0      [kernel.kallsyms]      [k] fib_table_lookup
      0.58%  ksoftirqd/0      [kernel.kallsyms]      [k] __dev_queue_xmit
      0.56%  ksoftirqd/0      [kernel.kallsyms]      [k] bcm4908_enet_start_xmit
      0.55%  ksoftirqd/0      [kernel.kallsyms]      [k] __skb_flow_dissect
      0.53%  ksoftirqd/0      [kernel.kallsyms]      [k] __pi___clean_dcache_area_poc

AFTER

# Overhead  Command          Shared Object          Symbol
# ........  ...............  .....................  ...................................
#
      4.21%  ksoftirqd/0      [kernel.kallsyms]      [k] __pi___inval_dcache_area
      3.13%  ksoftirqd/0      [kernel.kallsyms]      [k] __netif_receive_skb_core
      3.01%  ksoftirqd/0      [kernel.kallsyms]      [k] fib_table_lookup
      2.32%  ksoftirqd/0      [kernel.kallsyms]      [k] __dev_queue_xmit
      2.23%  ksoftirqd/0      [kernel.kallsyms]      [k] bcm4908_enet_start_xmit
      2.21%  ksoftirqd/0      [kernel.kallsyms]      [k] __skb_flow_dissect
      2.13%  ksoftirqd/0      [kernel.kallsyms]      [k] __pi___clean_dcache_area_poc
      2.00%  ksoftirqd/0      [kernel.kallsyms]      [k] eth_type_trans
      1.86%  ksoftirqd/0      [kernel.kallsyms]      [k] bcm4908_enet_poll_rx
      1.73%  ksoftirqd/0      [kernel.kallsyms]      [k] __local_bh_enable_ip
      1.63%  ksoftirqd/0      [kernel.kallsyms]      [k] fib_rules_lookup
      1.61%  ksoftirqd/0      [kernel.kallsyms]      [k] bcm4908_enet_poll_tx
      (...)
Quoted 3 lines
Quoted 1 line

Ping? Does it look OK to you?

Its ok, but I wonder if after all those years changing this default won't confuse users, so perhaps adding a 'I' hotkey to toggle showing idle symbols?

Additionally having a 'perf config report.hide_idle=true' (for 'perf top' as well), so that users can just switch to their liking?

Also add an entry to tools/perf/Documentation/tips.txt so that it appears from time to time on the last line on the screen?

- Arnaldo