linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: linux@treblig.org
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	 namhyung@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: event: Remove deadcode
Date: Mon, 4 Nov 2024 12:36:48 -0800	[thread overview]
Message-ID: <CAP-5=fXNJ_QbEA20eusx7EDqp=pQgVdW_+-w1T=vsrzH4BGjpw@mail.gmail.com> (raw)
In-Reply-To: <20241103142302.230370-1-linux@treblig.org>

On Sun, Nov 3, 2024 at 6:23 AM <linux@treblig.org> wrote:
>
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> event_format__print() last use was removed by 2017's
> commit 894f3f1732cb ("perf script: Use event_format__fprintf()")
>
> evlist__find_tracepoint_by_id() last use was removed by 2012's
> commit e60fc847cefa ("perf evlist: Remove some unused methods")
>
> evlist__set_tp_filter_pid() last use was removed by 2017's
> commit dd1a50377c92 ("perf trace: Introduce filter_loop_pids()")
>
> Remove them.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

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

Thanks,
Ian

> ---
>  tools/perf/util/evlist.c            | 18 ------------------
>  tools/perf/util/evlist.h            |  2 --
>  tools/perf/util/trace-event-parse.c |  6 ------
>  tools/perf/util/trace-event.h       |  3 ---
>  4 files changed, 29 deletions(-)
>
> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> index f14b7e6ff1dc..4b992a3f2985 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -362,19 +362,6 @@ __weak int arch_evlist__add_default_attrs(struct evlist *evlist,
>         return __evlist__add_default_attrs(evlist, attrs, nr_attrs);
>  }
>
> -struct evsel *evlist__find_tracepoint_by_id(struct evlist *evlist, int id)
> -{
> -       struct evsel *evsel;
> -
> -       evlist__for_each_entry(evlist, evsel) {
> -               if (evsel->core.attr.type   == PERF_TYPE_TRACEPOINT &&
> -                   (int)evsel->core.attr.config == id)
> -                       return evsel;
> -       }
> -
> -       return NULL;
> -}
> -
>  struct evsel *evlist__find_tracepoint_by_name(struct evlist *evlist, const char *name)
>  {
>         struct evsel *evsel;
> @@ -1199,11 +1186,6 @@ int evlist__set_tp_filter_pids(struct evlist *evlist, size_t npids, pid_t *pids)
>         return ret;
>  }
>
> -int evlist__set_tp_filter_pid(struct evlist *evlist, pid_t pid)
> -{
> -       return evlist__set_tp_filter_pids(evlist, 1, &pid);
> -}
> -
>  int evlist__append_tp_filter_pids(struct evlist *evlist, size_t npids, pid_t *pids)
>  {
>         char *filter = asprintf__tp_filter_pids(npids, pids);
> diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
> index bcc1c6984bb5..ff73908e2178 100644
> --- a/tools/perf/util/evlist.h
> +++ b/tools/perf/util/evlist.h
> @@ -144,7 +144,6 @@ int __evlist__set_tracepoints_handlers(struct evlist *evlist,
>         __evlist__set_tracepoints_handlers(evlist, array, ARRAY_SIZE(array))
>
>  int evlist__set_tp_filter(struct evlist *evlist, const char *filter);
> -int evlist__set_tp_filter_pid(struct evlist *evlist, pid_t pid);
>  int evlist__set_tp_filter_pids(struct evlist *evlist, size_t npids, pid_t *pids);
>
>  int evlist__append_tp_filter(struct evlist *evlist, const char *filter);
> @@ -152,7 +151,6 @@ int evlist__append_tp_filter(struct evlist *evlist, const char *filter);
>  int evlist__append_tp_filter_pid(struct evlist *evlist, pid_t pid);
>  int evlist__append_tp_filter_pids(struct evlist *evlist, size_t npids, pid_t *pids);
>
> -struct evsel *evlist__find_tracepoint_by_id(struct evlist *evlist, int id);
>  struct evsel *evlist__find_tracepoint_by_name(struct evlist *evlist, const char *name);
>
>  int evlist__add_pollfd(struct evlist *evlist, int fd);
> diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
> index f0332bd3a501..d97830cdbd7e 100644
> --- a/tools/perf/util/trace-event-parse.c
> +++ b/tools/perf/util/trace-event-parse.c
> @@ -116,12 +116,6 @@ void event_format__fprintf(struct tep_event *event,
>         trace_seq_destroy(&s);
>  }
>
> -void event_format__print(struct tep_event *event,
> -                        int cpu, void *data, int size)
> -{
> -       return event_format__fprintf(event, cpu, data, size, stdout);
> -}
> -
>  /*
>   * prev_state is of size long, which is 32 bits on 32 bit architectures.
>   * As it needs to have the same bits for both 32 bit and 64 bit architectures
> diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
> index bbf8b26bc8da..0e5133f1b910 100644
> --- a/tools/perf/util/trace-event.h
> +++ b/tools/perf/util/trace-event.h
> @@ -42,9 +42,6 @@ struct tep_event *trace_event__tp_format_id(int id);
>  void event_format__fprintf(struct tep_event *event,
>                            int cpu, void *data, int size, FILE *fp);
>
> -void event_format__print(struct tep_event *event,
> -                        int cpu, void *data, int size);
> -
>  int parse_ftrace_file(struct tep_handle *pevent, char *buf, unsigned long size);
>  int parse_event_file(struct tep_handle *pevent,
>                      char *buf, unsigned long size, char *sys);
> --
> 2.47.0
>

  reply	other threads:[~2024-11-04 20:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-03 14:23 [PATCH] perf: event: Remove deadcode linux
2024-11-04 20:36 ` Ian Rogers [this message]
2024-11-06  7:35 ` Namhyung Kim
2024-11-06 14:48   ` [PATCH v2] " linux
2024-11-07 19:26     ` Namhyung Kim
2024-11-06 14:49   ` [PATCH] " Dr. David Alan Gilbert

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=fXNJ_QbEA20eusx7EDqp=pQgVdW_+-w1T=vsrzH4BGjpw@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;
as well as URLs for NNTP newsgroup(s).