linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf callchain: Remove unused callchain_branch_counts
@ 2024-10-06  1:22 linux
  2024-10-09  5:30 ` Namhyung Kim
  0 siblings, 1 reply; 8+ messages in thread
From: linux @ 2024-10-06  1:22 UTC (permalink / raw)
  To: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin,
	jolsa, irogers, adrian.hunter, kan.liang
  Cc: linux-perf-users, linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

callchain_branch_counts() was added in 2016 by commit
3dd029ef9401 ("perf report: Calculate and return the branch flag counting")
but unused.

Remove it and it's helpers.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 tools/perf/util/callchain.c | 71 -------------------------------------
 tools/perf/util/callchain.h |  4 ---
 2 files changed, 75 deletions(-)

diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index 0c7564747a14..11435b72afbe 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -1266,77 +1266,6 @@ int callchain_node__fprintf_value(struct callchain_node *node,
 	return 0;
 }
 
-static void callchain_counts_value(struct callchain_node *node,
-				   u64 *branch_count, u64 *predicted_count,
-				   u64 *abort_count, u64 *cycles_count)
-{
-	struct callchain_list *clist;
-
-	list_for_each_entry(clist, &node->val, list) {
-		if (branch_count)
-			*branch_count += clist->branch_count;
-
-		if (predicted_count)
-			*predicted_count += clist->predicted_count;
-
-		if (abort_count)
-			*abort_count += clist->abort_count;
-
-		if (cycles_count)
-			*cycles_count += clist->cycles_count;
-	}
-}
-
-static int callchain_node_branch_counts_cumul(struct callchain_node *node,
-					      u64 *branch_count,
-					      u64 *predicted_count,
-					      u64 *abort_count,
-					      u64 *cycles_count)
-{
-	struct callchain_node *child;
-	struct rb_node *n;
-
-	n = rb_first(&node->rb_root_in);
-	while (n) {
-		child = rb_entry(n, struct callchain_node, rb_node_in);
-		n = rb_next(n);
-
-		callchain_node_branch_counts_cumul(child, branch_count,
-						   predicted_count,
-						   abort_count,
-						   cycles_count);
-
-		callchain_counts_value(child, branch_count,
-				       predicted_count, abort_count,
-				       cycles_count);
-	}
-
-	return 0;
-}
-
-int callchain_branch_counts(struct callchain_root *root,
-			    u64 *branch_count, u64 *predicted_count,
-			    u64 *abort_count, u64 *cycles_count)
-{
-	if (branch_count)
-		*branch_count = 0;
-
-	if (predicted_count)
-		*predicted_count = 0;
-
-	if (abort_count)
-		*abort_count = 0;
-
-	if (cycles_count)
-		*cycles_count = 0;
-
-	return callchain_node_branch_counts_cumul(&root->node,
-						  branch_count,
-						  predicted_count,
-						  abort_count,
-						  cycles_count);
-}
-
 static int count_pri64_printf(int idx, const char *str, u64 value, char *bf, int bfsize)
 {
 	return scnprintf(bf, bfsize, "%s%s:%" PRId64 "", (idx) ? " " : " (", str, value);
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index 86ed9e4d04f9..d7741fa9e9de 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -298,10 +298,6 @@ void free_callchain(struct callchain_root *root);
 void decay_callchain(struct callchain_root *root);
 int callchain_node__make_parent_list(struct callchain_node *node);
 
-int callchain_branch_counts(struct callchain_root *root,
-			    u64 *branch_count, u64 *predicted_count,
-			    u64 *abort_count, u64 *cycles_count);
-
 void callchain_param_setup(u64 sample_type, const char *arch);
 
 bool callchain_cnode_matched(struct callchain_node *base_cnode,
-- 
2.46.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-10-14 16:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-06  1:22 [PATCH] perf callchain: Remove unused callchain_branch_counts linux
2024-10-09  5:30 ` Namhyung Kim
2024-10-09 15:27   ` Liang, Kan
2024-10-09 16:50     ` Dr. David Alan Gilbert
2024-10-10  0:34       ` Namhyung Kim
2024-10-10  0:33     ` Namhyung Kim
2024-10-10 18:40       ` [PATCH] perf report: Display columns Predicted/Abort/Cycles in --branch-history Thomas Falcon
2024-10-14 16:59         ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).