From: Ian Rogers <irogers@google.com>
To: linux@treblig.org
Cc: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org,
acme@kernel.org, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
adrian.hunter@intel.com, kan.liang@linux.intel.com,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf: Deadcode removal
Date: Tue, 4 Feb 2025 14:11:53 -0800 [thread overview]
Message-ID: <CAP-5=fWMp-ePPHUsBD_pe5NPoyCpHVZ2gzSn1HRyu_gO3Ghmkg@mail.gmail.com> (raw)
In-Reply-To: <20250204220545.456435-1-linux@treblig.org>
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
>
next prev parent reply other threads:[~2025-02-04 22:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 22:05 linux
2025-02-04 22:11 ` Ian Rogers [this message]
2025-02-10 16:14 ` Ian Rogers
2025-02-12 1:39 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAP-5=fWMp-ePPHUsBD_pe5NPoyCpHVZ2gzSn1HRyu_gO3Ghmkg@mail.gmail.com' \
--to=irogers@google.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux@treblig.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®