perf: remove unused functions
cover perf: remove unused functions
Hi Arnaldo:
Going through my backlog of perf cleanup patches. These remove unused functions and then makes a sole callee static.
David Ahern (4):
perf: remove unused print_event function
perf: remove unused print_trace_event function
perf: remove unused perf_session__remove_thread
perf: move machine__remove_thread and make static
tools/perf/util/machine.c | 22 ++++++++++----------- tools/perf/util/machine.h | 1 - tools/perf/util/session.c | 12 ------------ tools/perf/util/session.h | 1 - tools/perf/util/trace-event-parse.c | 37 ----------------------------------- tools/perf/util/trace-event.h | 4 ---- 6 files changed, 11 insertions(+), 66 deletions(-)
Signature · 1 line
1.7.10.1
PATCH 1/4 perf: remove unused print_event function
--- tools/perf/util/trace-event-parse.c | 24 ------------------------ tools/perf/util/trace-event.h | 3 --- 2 files changed, 27 deletions(-)
tools/perf/util/trace-event-parse.c +0 -24
@@ -196,30 +196,6 @@ void print_trace_event(struct pevent *pevent, int cpu, void *data, int size)event_format__print (event, cpu, data, size); } -void print_event (struct pevent *pevent,int cpu,void *data,int size, -unsigned long long nsecs,char *comm) -{ -struct pevent_record record; -struct trace_seq s; -int pid; - - pevent->latency_format = latency_format; - - record.ts = nsecs; - record.cpu = cpu; - record.size = size; - record.data = data; - pid =pevent_data_pid (pevent, &record); - -if (!pevent_pid_is_registered (pevent, pid)) -pevent_register_comm (pevent, comm, pid); - -trace_seq_init (&s); -pevent_print_event (pevent, &s, &record); -trace_seq_do_printf (&s); -printf ("\n" ); -} -void parse_proc_kallsyms (struct pevent *pevent,char *file,unsigned int size__maybe_unused ) {
tools/perf/util/trace-event.h +0 -3
@@ -34,9 +34,6 @@ void print_trace_event(struct pevent *pevent, int cpu, void *data, int size);void event_format__print (struct event_format *event,int cpu,void *data,int size); -void print_event (struct pevent *pevent,int cpu,void *data,int size, -unsigned long long nsecs,char *comm); -int parse_ftrace_file (struct pevent *pevent,char *buf,unsigned long size);int parse_event_file (struct pevent *pevent,char *buf,unsigned long size,char *sys);
Signature · 1 line
1.7.10.1
PATCH 2/4 perf: remove unused print_trace_event function
In reply to David Ahern--- tools/perf/util/trace-event-parse.c | 13 ------------- tools/perf/util/trace-event.h | 1 - 2 files changed, 14 deletions(-)
tools/perf/util/trace-event-parse.c +0 -13
@@ -183,19 +183,6 @@ void event_format__print(struct event_format *event,trace_seq_do_printf (&s); } -void print_trace_event (struct pevent *pevent,int cpu,void *data,int size) -{ -int type =trace_parse_common_type (pevent, data); -struct event_format *event =pevent_find_event (pevent, type); - -if (!event) { -warning ("ug! no event found for type %d" , type); -return ; - } - -event_format__print (event, cpu, data, size); -} -void parse_proc_kallsyms (struct pevent *pevent,char *file,unsigned int size__maybe_unused ) {
tools/perf/util/trace-event.h +0 -1
@@ -30,7 +30,6 @@ enum {int bigendian (void );struct pevent *read_trace_init (int file_bigendian,int host_bigendian); -void print_trace_event (struct pevent *pevent,int cpu,void *data,int size);void event_format__print (struct event_format *event,int cpu,void *data,int size);
Signature · 1 line
1.7.10.1
tip-bot for David Ahern
merge bot[tip:perf/core] perf tools: Remove unused tracing functions
perf tools: Remove unused tracing functions
Commit-ID: eba7181d56da7e8198f0c70e3d7074bab47a5910 Gitweb: http://git.kernel.org/tip/eba7181d56da7e8198f0c70e3d7074bab47a5910 Author: David Ahern <[email protected]> AuthorDate: Tue, 12 Mar 2013 23:07:26 -0600 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Fri, 15 Mar 2013 13:06:07 -0300
perf tools: Remove unused tracing functions
Leftovers from before libtraceevent integration.
--- tools/perf/util/trace-event-parse.c | 37 ------------------------------------- tools/perf/util/trace-event.h | 4 ---- 2 files changed, 41 deletions(-)
tools/perf/util/trace-event-parse.c +0 -37
@@ -183,43 +183,6 @@ void event_format__print(struct event_format *event,trace_seq_do_printf (&s); } -void print_trace_event (struct pevent *pevent,int cpu,void *data,int size) -{ -int type =trace_parse_common_type (pevent, data); -struct event_format *event =pevent_find_event (pevent, type); - -if (!event) { -warning ("ug! no event found for type %d" , type); -return ; - } - -event_format__print (event, cpu, data, size); -} - -void print_event (struct pevent *pevent,int cpu,void *data,int size, -unsigned long long nsecs,char *comm) -{ -struct pevent_record record; -struct trace_seq s; -int pid; - - pevent->latency_format = latency_format; - - record.ts = nsecs; - record.cpu = cpu; - record.size = size; - record.data = data; - pid =pevent_data_pid (pevent, &record); - -if (!pevent_pid_is_registered (pevent, pid)) -pevent_register_comm (pevent, comm, pid); - -trace_seq_init (&s); -pevent_print_event (pevent, &s, &record); -trace_seq_do_printf (&s); -printf ("\n" ); -} -void parse_proc_kallsyms (struct pevent *pevent,char *file,unsigned int size__maybe_unused ) {
tools/perf/util/trace-event.h +0 -4
@@ -30,13 +30,9 @@ enum {int bigendian (void );struct pevent *read_trace_init (int file_bigendian,int host_bigendian); -void print_trace_event (struct pevent *pevent,int cpu,void *data,int size);void event_format__print (struct event_format *event,int cpu,void *data,int size); -void print_event (struct pevent *pevent,int cpu,void *data,int size, -unsigned long long nsecs,char *comm); -int parse_ftrace_file (struct pevent *pevent,char *buf,unsigned long size);int parse_event_file (struct pevent *pevent,char *buf,unsigned long size,char *sys);
PATCH 3/4 perf: remove unused perf_session__remove_thread
In reply to David Ahern--- tools/perf/util/session.c | 12 ------------ tools/perf/util/session.h | 1 - 2 files changed, 13 deletions(-)
tools/perf/util/session.c +0 -12
@@ -1365,18 +1365,6 @@ size_t perf_session__fprintf(struct perf_session *session, FILE *fp)return machine__fprintf (&session->machines.host, fp); } -void perf_session__remove_thread (struct perf_session *session, -struct thread *th) -{ -/* -* FIXME: This one makes no sense, we need to remove the thread from -* the machine it belongs to, perf_session can have many machines, so -* doing it always on ->machines.host is wrong. Fix when auditing all -* the 'perf kvm' code. -*/ -machine__remove_thread (&session->machines.host, th); -} -struct perf_evsel *perf_session__find_first_evtype (struct perf_session *session,unsigned int type) {
tools/perf/util/session.h +0 -1
@@ -72,7 +72,6 @@ void perf_event__attr_swap(struct perf_event_attr *attr);int perf_session__create_kernel_maps (struct perf_session *self);void perf_session__set_id_hdr_size (struct perf_session *session); -void perf_session__remove_thread (struct perf_session *self,struct thread *th);static inline struct machine *perf_session__find_machine (struct perf_session *self,pid_t pid)
Signature · 1 line
1.7.10.1
tip-bot for David Ahern
merge bot[tip:perf/core] perf session: Remove unused perf_session__remove_thread method
perf session: Remove unused perf_session__remove_thread method
Commit-ID: c1ad050caad5fbff13fd2f54f49e184bd71de90d Gitweb: http://git.kernel.org/tip/c1ad050caad5fbff13fd2f54f49e184bd71de90d Author: David Ahern <[email protected]> AuthorDate: Tue, 12 Mar 2013 23:07:27 -0600 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Fri, 15 Mar 2013 13:06:08 -0300
perf session: Remove unused perf_session__remove_thread method
Should have been removed on this changeset, that removed the last user of it:
743eb868657bdb1b26c7b24077ca21c67c82c777
perf tools: Resolve machine earlier and pass it to perf_event_ops
--- tools/perf/util/session.c | 12 ------------ tools/perf/util/session.h | 1 - 2 files changed, 13 deletions(-)
tools/perf/util/session.c +0 -12
@@ -1365,18 +1365,6 @@ size_t perf_session__fprintf(struct perf_session *session, FILE *fp)return machine__fprintf (&session->machines.host, fp); } -void perf_session__remove_thread (struct perf_session *session, -struct thread *th) -{ -/* -* FIXME: This one makes no sense, we need to remove the thread from -* the machine it belongs to, perf_session can have many machines, so -* doing it always on ->machines.host is wrong. Fix when auditing all -* the 'perf kvm' code. -*/ -machine__remove_thread (&session->machines.host, th); -} -struct perf_evsel *perf_session__find_first_evtype (struct perf_session *session,unsigned int type) {
tools/perf/util/session.h +0 -1
@@ -72,7 +72,6 @@ void perf_event__attr_swap(struct perf_event_attr *attr);int perf_session__create_kernel_maps (struct perf_session *self);void perf_session__set_id_hdr_size (struct perf_session *session); -void perf_session__remove_thread (struct perf_session *self,struct thread *th);static inline struct machine *perf_session__find_machine (struct perf_session *self,pid_t pid)
PATCH 4/4 perf: move machine__remove_thread and make static
In reply to David Ahern--- tools/perf/util/machine.c | 22 +++++++++++----------- tools/perf/util/machine.h | 1 - 2 files changed, 11 insertions(+), 12 deletions(-)
tools/perf/util/machine.c +11 -11
@@ -1003,6 +1003,17 @@ int machine__process_fork_event(struct machine *machine, union perf_event *eventreturn 0 ; } +static void machine__remove_thread (struct machine *machine,struct thread *th) +{ + machine->last_match =NULL ; +rb_erase (&th->rb_node, &machine->threads); +/* +* We may have references to this thread, for instance in some hist_entry +* instances, so just move them to a separate list. +*/ +list_add_tail (&th->node, &machine->dead_threads); +} +int machine__process_exit_event (struct machine *machine,union perf_event *event) {struct thread *thread =machine__find_thread (machine, event->fork.tid);
@@ -1039,17 +1050,6 @@ int machine__process_event(struct machine *machine, union perf_event *event)return ret; } -void machine__remove_thread (struct machine *machine,struct thread *th) -{ - machine->last_match =NULL ; -rb_erase (&th->rb_node, &machine->threads); -/* -* We may have references to this thread, for instance in some hist_entry -* instances, so just move them to a separate list. -*/ -list_add_tail (&th->node, &machine->dead_threads); -} -static bool symbol__match_parent_regex (struct symbol *sym) {if (sym->name && !regexec (&parent_regex, sym->name,0 ,NULL ,0 ))
tools/perf/util/machine.h +0 -1
@@ -97,7 +97,6 @@ static inline bool machine__is_host(struct machine *machine) }struct thread *machine__findnew_thread (struct machine *machine,pid_t pid); -void machine__remove_thread (struct machine *machine,struct thread *th);size_t machine__fprintf (struct machine *machine,FILE *fp);
Signature · 1 line
1.7.10.1
tip-bot for David Ahern
merge bot[tip:perf/core] perf machine: Move machine__remove_thread and make static
perf machine: Move machine__remove_thread and make static
Commit-ID: ed8996a6d59b9eb00a50d7d30887ba9f28eb4bb0 Gitweb: http://git.kernel.org/tip/ed8996a6d59b9eb00a50d7d30887ba9f28eb4bb0 Author: David Ahern <[email protected]> AuthorDate: Tue, 12 Mar 2013 23:07:28 -0600 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Fri, 15 Mar 2013 13:06:08 -0300
perf machine: Move machine__remove_thread and make static
As the now only user, machine__process_exit_event, that is what tools use to process PERF_RECORD_EXIT events, is on the same object file.
--- tools/perf/util/machine.c | 22 +++++++++++----------- tools/perf/util/machine.h | 1 - 2 files changed, 11 insertions(+), 12 deletions(-)
tools/perf/util/machine.c +11 -11
@@ -1003,6 +1003,17 @@ int machine__process_fork_event(struct machine *machine, union perf_event *eventreturn 0 ; } +static void machine__remove_thread (struct machine *machine,struct thread *th) +{ + machine->last_match =NULL ; +rb_erase (&th->rb_node, &machine->threads); +/* +* We may have references to this thread, for instance in some hist_entry +* instances, so just move them to a separate list. +*/ +list_add_tail (&th->node, &machine->dead_threads); +} +int machine__process_exit_event (struct machine *machine,union perf_event *event) {struct thread *thread =machine__find_thread (machine, event->fork.tid);
@@ -1039,17 +1050,6 @@ int machine__process_event(struct machine *machine, union perf_event *event)return ret; } -void machine__remove_thread (struct machine *machine,struct thread *th) -{ - machine->last_match =NULL ; -rb_erase (&th->rb_node, &machine->threads); -/* -* We may have references to this thread, for instance in some hist_entry -* instances, so just move them to a separate list. -*/ -list_add_tail (&th->node, &machine->dead_threads); -} -static bool symbol__match_parent_regex (struct symbol *sym) {if (sym->name && !regexec (&parent_regex, sym->name,0 ,NULL ,0 ))
tools/perf/util/machine.h +0 -1
@@ -97,7 +97,6 @@ static inline bool machine__is_host(struct machine *machine) }struct thread *machine__findnew_thread (struct machine *machine,pid_t pid); -void machine__remove_thread (struct machine *machine,struct thread *th);size_t machine__fprintf (struct machine *machine,FILE *fp);