linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: Deadcode removal
@ 2025-02-04 22:05 linux
  2025-02-04 22:11 ` Ian Rogers
  2025-02-12  1:39 ` Namhyung Kim
  0 siblings, 2 replies; 4+ messages in thread
From: linux @ 2025-02-04 22:05 UTC (permalink / raw)
  To: irogers, peterz, mingo, namhyung, acme, mark.rutland,
	alexander.shishkin, jolsa, adrian.hunter, kan.liang
  Cc: linux-perf-users, linux-kernel, Dr. David Alan Gilbert

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

The last use of machine__fprintf_vmlinux_path() was removed in 2011 by
commit ab81f3fd350c ("perf top: Reuse the 'report' hist_entry/hists
classes")

mmap_cpu_mask__duplicate() was added in 2021 by
commit 6bd006c6eb7f ("perf mmap: Introduce mmap_cpu_mask__duplicate()")
but hasn't been used since.

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 tools/perf/util/machine.c | 20 --------------------
 tools/perf/util/machine.h |  2 --
 tools/perf/util/mmap.c    | 11 -----------
 tools/perf/util/mmap.h    |  3 ---
 4 files changed, 36 deletions(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 2d51badfbf2e..321cc110698c 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -886,26 +886,6 @@ size_t machines__fprintf_dsos_buildid(struct machines *machines, FILE *fp,
 	return ret;
 }
 
-size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp)
-{
-	int i;
-	size_t printed = 0;
-	struct dso *kdso = machine__kernel_dso(machine);
-
-	if (dso__has_build_id(kdso)) {
-		char filename[PATH_MAX];
-
-		if (dso__build_id_filename(kdso, filename, sizeof(filename), false))
-			printed += fprintf(fp, "[0] %s\n", filename);
-	}
-
-	for (i = 0; i < vmlinux_path__nr_entries; ++i) {
-		printed += fprintf(fp, "[%d] %s\n", i + dso__has_build_id(kdso),
-				   vmlinux_path[i]);
-	}
-	return printed;
-}
-
 struct machine_fprintf_cb_args {
 	FILE *fp;
 	size_t printed;
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index 2e5a4cb342d8..ae3e5542d57d 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -266,8 +266,6 @@ int machines__create_kernel_maps(struct machines *machines, pid_t pid);
 int machines__create_guest_kernel_maps(struct machines *machines);
 void machines__destroy_kernel_maps(struct machines *machines);
 
-size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp);
-
 typedef int (*machine__dso_t)(struct dso *dso, struct machine *machine, void *priv);
 
 int machine__for_each_dso(struct machine *machine, machine__dso_t fn,
diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c
index 43b02293f1d2..a7ef4d8d57d8 100644
--- a/tools/perf/util/mmap.c
+++ b/tools/perf/util/mmap.c
@@ -356,14 +356,3 @@ int perf_mmap__push(struct mmap *md, void *to,
 out:
 	return rc;
 }
-
-int mmap_cpu_mask__duplicate(struct mmap_cpu_mask *original, struct mmap_cpu_mask *clone)
-{
-	clone->nbits = original->nbits;
-	clone->bits  = bitmap_zalloc(original->nbits);
-	if (!clone->bits)
-		return -ENOMEM;
-
-	memcpy(clone->bits, original->bits, MMAP_CPU_MASK_BYTES(original));
-	return 0;
-}
diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h
index 0df6e1621c7e..4d72c5fa5084 100644
--- a/tools/perf/util/mmap.h
+++ b/tools/perf/util/mmap.h
@@ -61,7 +61,4 @@ size_t mmap__mmap_len(struct mmap *map);
 
 void mmap_cpu_mask__scnprintf(struct mmap_cpu_mask *mask, const char *tag);
 
-int mmap_cpu_mask__duplicate(struct mmap_cpu_mask *original,
-				struct mmap_cpu_mask *clone);
-
 #endif /*__PERF_MMAP_H */
-- 
2.48.1


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

* Re: [PATCH] perf: Deadcode removal
  2025-02-04 22:05 [PATCH] perf: Deadcode removal linux
@ 2025-02-04 22:11 ` Ian Rogers
  2025-02-10 16:14   ` Ian Rogers
  2025-02-12  1:39 ` Namhyung Kim
  1 sibling, 1 reply; 4+ messages in thread
From: Ian Rogers @ 2025-02-04 22:11 UTC (permalink / raw)
  To: linux
  Cc: peterz, mingo, namhyung, acme, mark.rutland, alexander.shishkin,
	jolsa, adrian.hunter, kan.liang, linux-perf-users, linux-kernel

On Tue, Feb 4, 2025 at 2:05 PM <linux@treblig.org> wrote:
>
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> The last use of machine__fprintf_vmlinux_path() was removed in 2011 by
> commit ab81f3fd350c ("perf top: Reuse the 'report' hist_entry/hists
> classes")
>
> mmap_cpu_mask__duplicate() was added in 2021 by
> commit 6bd006c6eb7f ("perf mmap: Introduce mmap_cpu_mask__duplicate()")
> but hasn't been used since.
>
> Remove them.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Tested-by: Ian Rogers <irogers@google.com>

Thanks!
Ian

> ---
>  tools/perf/util/machine.c | 20 --------------------
>  tools/perf/util/machine.h |  2 --
>  tools/perf/util/mmap.c    | 11 -----------
>  tools/perf/util/mmap.h    |  3 ---
>  4 files changed, 36 deletions(-)
>
> diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
> index 2d51badfbf2e..321cc110698c 100644
> --- a/tools/perf/util/machine.c
> +++ b/tools/perf/util/machine.c
> @@ -886,26 +886,6 @@ size_t machines__fprintf_dsos_buildid(struct machines *machines, FILE *fp,
>         return ret;
>  }
>
> -size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp)
> -{
> -       int i;
> -       size_t printed = 0;
> -       struct dso *kdso = machine__kernel_dso(machine);
> -
> -       if (dso__has_build_id(kdso)) {
> -               char filename[PATH_MAX];
> -
> -               if (dso__build_id_filename(kdso, filename, sizeof(filename), false))
> -                       printed += fprintf(fp, "[0] %s\n", filename);
> -       }
> -
> -       for (i = 0; i < vmlinux_path__nr_entries; ++i) {
> -               printed += fprintf(fp, "[%d] %s\n", i + dso__has_build_id(kdso),
> -                                  vmlinux_path[i]);
> -       }
> -       return printed;
> -}
> -
>  struct machine_fprintf_cb_args {
>         FILE *fp;
>         size_t printed;
> diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
> index 2e5a4cb342d8..ae3e5542d57d 100644
> --- a/tools/perf/util/machine.h
> +++ b/tools/perf/util/machine.h
> @@ -266,8 +266,6 @@ int machines__create_kernel_maps(struct machines *machines, pid_t pid);
>  int machines__create_guest_kernel_maps(struct machines *machines);
>  void machines__destroy_kernel_maps(struct machines *machines);
>
> -size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp);
> -
>  typedef int (*machine__dso_t)(struct dso *dso, struct machine *machine, void *priv);
>
>  int machine__for_each_dso(struct machine *machine, machine__dso_t fn,
> diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c
> index 43b02293f1d2..a7ef4d8d57d8 100644
> --- a/tools/perf/util/mmap.c
> +++ b/tools/perf/util/mmap.c
> @@ -356,14 +356,3 @@ int perf_mmap__push(struct mmap *md, void *to,
>  out:
>         return rc;
>  }
> -
> -int mmap_cpu_mask__duplicate(struct mmap_cpu_mask *original, struct mmap_cpu_mask *clone)
> -{
> -       clone->nbits = original->nbits;
> -       clone->bits  = bitmap_zalloc(original->nbits);
> -       if (!clone->bits)
> -               return -ENOMEM;
> -
> -       memcpy(clone->bits, original->bits, MMAP_CPU_MASK_BYTES(original));
> -       return 0;
> -}
> diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h
> index 0df6e1621c7e..4d72c5fa5084 100644
> --- a/tools/perf/util/mmap.h
> +++ b/tools/perf/util/mmap.h
> @@ -61,7 +61,4 @@ size_t mmap__mmap_len(struct mmap *map);
>
>  void mmap_cpu_mask__scnprintf(struct mmap_cpu_mask *mask, const char *tag);
>
> -int mmap_cpu_mask__duplicate(struct mmap_cpu_mask *original,
> -                               struct mmap_cpu_mask *clone);
> -
>  #endif /*__PERF_MMAP_H */
> --
> 2.48.1
>

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

* Re: [PATCH] perf: Deadcode removal
  2025-02-04 22:11 ` Ian Rogers
@ 2025-02-10 16:14   ` Ian Rogers
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Rogers @ 2025-02-10 16:14 UTC (permalink / raw)
  To: linux
  Cc: peterz, mingo, namhyung, acme, mark.rutland, alexander.shishkin,
	jolsa, adrian.hunter, kan.liang, linux-perf-users, linux-kernel

On Tue, Feb 4, 2025 at 2:11 PM Ian Rogers <irogers@google.com> wrote:
>
> On Tue, Feb 4, 2025 at 2:05 PM <linux@treblig.org> wrote:
> >
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >
> > The last use of machine__fprintf_vmlinux_path() was removed in 2011 by
> > commit ab81f3fd350c ("perf top: Reuse the 'report' hist_entry/hists
> > classes")
> >
> > mmap_cpu_mask__duplicate() was added in 2021 by
> > commit 6bd006c6eb7f ("perf mmap: Introduce mmap_cpu_mask__duplicate()")
> > but hasn't been used since.
> >
> > Remove them.
> >
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
>
> Tested-by: Ian Rogers <irogers@google.com>

Ping.

Thanks,
Ian

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

* Re: [PATCH] perf: Deadcode removal
  2025-02-04 22:05 [PATCH] perf: Deadcode removal linux
  2025-02-04 22:11 ` Ian Rogers
@ 2025-02-12  1:39 ` Namhyung Kim
  1 sibling, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2025-02-12  1:39 UTC (permalink / raw)
  To: irogers, peterz, mingo, acme, mark.rutland, alexander.shishkin,
	jolsa, adrian.hunter, kan.liang, linux
  Cc: linux-perf-users, linux-kernel

On Tue, 04 Feb 2025 22:05:45 +0000, linux@treblig.org wrote:
> The last use of machine__fprintf_vmlinux_path() was removed in 2011 by
> commit ab81f3fd350c ("perf top: Reuse the 'report' hist_entry/hists
> classes")
> 
> mmap_cpu_mask__duplicate() was added in 2021 by
> commit 6bd006c6eb7f ("perf mmap: Introduce mmap_cpu_mask__duplicate()")
> but hasn't been used since.
> 
> [...]
Applied to perf-tools-next, thanks!

Best regards,
Namhyung



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

end of thread, other threads:[~2025-02-12  1:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-04 22:05 [PATCH] perf: Deadcode removal linux
2025-02-04 22:11 ` Ian Rogers
2025-02-10 16:14   ` Ian Rogers
2025-02-12  1:39 ` 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).