Skip to contentSkip to conversation

perf: Remove unused struct

PATCH Applied Yuan Can 2 participants 8 messages Sep 27, 2022 perf events

lore
Share & tools
lore

Yuan Can

author
#0 lore raw

cover perf: Remove unused struct

This series contains five cleanup patches, remove unused struct.

Yuan Can (5):
perf machine: Remove unused struct process_args perf annotate: Remove unused struct disasm_line_samples perf metric: Remove unused struct metric_ref_node perf jit: Remove unused struct debug_line_info perf lock: Remove unused struct lock_contention_key

 tools/perf/ui/browsers/annotate.c     |  5 -----
 tools/perf/util/bpf_lock_contention.c |  5 -----
 tools/perf/util/jitdump.c             |  7 -------
 tools/perf/util/machine.c             |  4 ----
 tools/perf/util/metricgroup.c         | 11 -----------
 5 files changed, 32 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/5 perf machine: Remove unused struct process_args

After commit a93f0e551af9("perf symbols: Get kernel start address by symbol name"), no one uses struct process_args any more, so remove it.

---
 tools/perf/util/machine.c | 4 ----
 1 file changed, 4 deletions(-)
tools/perf/util/machine.c +0 -4
index 2a16cae28407..76316e459c3d 100644
@@ -1128,10 +1128,6 @@ static struct dso *machine__get_kernel(struct machine *machine)
 	return kernel;
 }
 
-struct process_args {
-	u64 start;
-};
-
 void machine__get_kallsyms_filename(struct machine *machine, char *buf,
 				    size_t bufsz)
 {
Signature · 1 line
2.17.1
maintainer Applied
#2 lore raw

Re: [PATCH 1/5] perf machine: Remove unused struct process_args

Em Tue, Sep 27, 2022 at 01:39:27AM +0000, Yuan Can escreveu:

Quoted 2 lines

After commit a93f0e551af9("perf symbols: Get kernel start address by symbol name"), no one uses struct process_args any more, so remove it.

Thanks, applied.

- Arnaldo

Quoted 22 lines
---
 tools/perf/util/machine.c | 4 ----
 1 file changed, 4 deletions(-)
tools/perf/util/machine.c +0 -4
index 2a16cae28407..76316e459c3d 100644
@@ -1128,10 +1128,6 @@ static struct dso *machine__get_kernel(struct machine *machine)
 	return kernel;
 }
 
-struct process_args {
-	u64 start;
-};
-
 void machine__get_kallsyms_filename(struct machine *machine, char *buf,
 				    size_t bufsz)
 {
Signature · 1 line
2.17.1
Signature · 1 line
- Arnaldo
author
#3 lore raw

PATCH 2/5 perf annotate: Remove unused struct disasm_line_samples

In reply to Yuan Can

After commit 3ab6db8d0f3b("perf annotate browser: Use samples data from struct annotation_line"), no one use struct disasm_line_samples, so remove it.

---
 tools/perf/ui/browsers/annotate.c | 5 -----
 1 file changed, 5 deletions(-)
tools/perf/ui/browsers/annotate.c +0 -5
index 9bc1076374ff..b4293c9df346 100644
@@ -19,11 +19,6 @@
 #include <sys/ttydefaults.h>
 #include <asm/bug.h>
 
-struct disasm_line_samples {
-	double		      percent;
-	struct sym_hist_entry he;
-};
-
 struct arch;
 
 struct annotate_browser {
Signature · 1 line
2.17.1
author
#4 lore raw

PATCH 3/5 perf metric: Remove unused struct metric_ref_node

In reply to Yuan Can

After commit 46bdc0bf8d21("perf metric: Simplify metric_refs calculation"), no one use struct metric_ref_node, so remove it.

---
 tools/perf/util/metricgroup.c | 11 -----------
 1 file changed, 11 deletions(-)
tools/perf/util/metricgroup.c +0 -11
index b18da1a62a55..4c98ac29ee13 100644
@@ -109,17 +109,6 @@ void metricgroup__rblist_exit(struct rblist *metric_events)
 	rblist__exit(metric_events);
 }
 
-/*
- * A node in the list of referenced metrics. metric_expr
- * is held as a convenience to avoid a search through the
- * metric list.
- */
-struct metric_ref_node {
-	const char *metric_name;
-	const char *metric_expr;
-	struct list_head list;
-};
-
 /**
  * The metric under construction. The data held here will be placed in a
  * metric_expr.
Signature · 1 line
2.17.1
author
#5 lore raw

PATCH 4/5 perf jit: Remove unused struct debug_line_info

In reply to Yuan Can

The struct debug_line_info is never used, remove it.

---
 tools/perf/util/jitdump.c | 7 -------
 1 file changed, 7 deletions(-)
tools/perf/util/jitdump.c +0 -7
index 4e6632203704..0e033278fa12 100644
@@ -56,13 +56,6 @@ struct jit_buf_desc {
 	char		 dir[PATH_MAX];
 };
 
-struct debug_line_info {
-	unsigned long vma;
-	unsigned int lineno;
-	/* The filename format is unspecified, absolute path, relative etc. */
-	char const filename[];
-};
-
 struct jit_tool {
 	struct perf_tool tool;
 	struct perf_data	output;
Signature · 1 line
2.17.1
author
#6 lore raw

PATCH 5/5 perf lock: Remove unused struct lock_contention_key

In reply to Yuan Can

The struct lock_contention_key is never used, remove it.

---
 tools/perf/util/bpf_lock_contention.c | 5 -----
 1 file changed, 5 deletions(-)
tools/perf/util/bpf_lock_contention.c +0 -5
index c591a66733ef..462827c407c7 100644
@@ -14,11 +14,6 @@
 
 static struct lock_contention_bpf *skel;
 
-/* should be same as bpf_skel/lock_contention.bpf.c */
-struct lock_contention_key {
-	s32 stack_id;
-};
-
 struct lock_contention_data {
 	u64 total_time;
 	u64 min_time;
Signature · 1 line
2.17.1
maintainer Applied
#7 lore raw
In reply to Yuan Can

Em Tue, Sep 27, 2022 at 01:39:26AM +0000, Yuan Can escreveu:

Quoted 1 line

This series contains five cleanup patches, remove unused struct.

Thanks, applied.

- Arnaldo

Quoted 16 lines

Yuan Can (5):
perf machine: Remove unused struct process_args perf annotate: Remove unused struct disasm_line_samples perf metric: Remove unused struct metric_ref_node perf jit: Remove unused struct debug_line_info perf lock: Remove unused struct lock_contention_key

 tools/perf/ui/browsers/annotate.c     |  5 -----
 tools/perf/util/bpf_lock_contention.c |  5 -----
 tools/perf/util/jitdump.c             |  7 -------
 tools/perf/util/machine.c             |  4 ----
 tools/perf/util/metricgroup.c         | 11 -----------
 5 files changed, 32 deletions(-)
Signature · 1 line
2.17.1
Signature · 1 line
- Arnaldo