* [PATCH 0/4] perf: remove unused functions
@ 2013-03-13 5:07 David Ahern
2013-03-13 5:07 ` [PATCH 1/4] perf: remove unused print_event function David Ahern
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: David Ahern @ 2013-03-13 5:07 UTC (permalink / raw)
To: acme, linux-kernel; +Cc: David Ahern
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(-)
--
1.7.10.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/4] perf: remove unused print_event function
2013-03-13 5:07 [PATCH 0/4] perf: remove unused functions David Ahern
@ 2013-03-13 5:07 ` David Ahern
2013-03-13 5:07 ` [PATCH 2/4] perf: remove unused print_trace_event function David Ahern
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: David Ahern @ 2013-03-13 5:07 UTC (permalink / raw)
To: acme, linux-kernel; +Cc: David Ahern
Signed-off-by: David Ahern <dsahern@gmail.com>
---
tools/perf/util/trace-event-parse.c | 24 ------------------------
tools/perf/util/trace-event.h | 3 ---
2 files changed, 27 deletions(-)
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 3aabcd6..8450bec 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -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)
{
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index a55fd37..99f621f 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -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);
--
1.7.10.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/4] perf: remove unused print_trace_event function
2013-03-13 5:07 [PATCH 0/4] perf: remove unused functions David Ahern
2013-03-13 5:07 ` [PATCH 1/4] perf: remove unused print_event function David Ahern
@ 2013-03-13 5:07 ` David Ahern
2013-03-21 11:27 ` [tip:perf/core] perf tools: Remove unused tracing functions tip-bot for David Ahern
2013-03-13 5:07 ` [PATCH 3/4] perf: remove unused perf_session__remove_thread David Ahern
2013-03-13 5:07 ` [PATCH 4/4] perf: move machine__remove_thread and make static David Ahern
3 siblings, 1 reply; 8+ messages in thread
From: David Ahern @ 2013-03-13 5:07 UTC (permalink / raw)
To: acme, linux-kernel; +Cc: David Ahern
Signed-off-by: David Ahern <dsahern@gmail.com>
---
tools/perf/util/trace-event-parse.c | 13 -------------
tools/perf/util/trace-event.h | 1 -
2 files changed, 14 deletions(-)
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 8450bec..4454835 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -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)
{
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index 99f621f..28ccde8 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -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);
--
1.7.10.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/4] perf: remove unused perf_session__remove_thread
2013-03-13 5:07 [PATCH 0/4] perf: remove unused functions David Ahern
2013-03-13 5:07 ` [PATCH 1/4] perf: remove unused print_event function David Ahern
2013-03-13 5:07 ` [PATCH 2/4] perf: remove unused print_trace_event function David Ahern
@ 2013-03-13 5:07 ` David Ahern
2013-03-21 11:28 ` [tip:perf/core] perf session: Remove unused perf_session__remove_thread method tip-bot for David Ahern
2013-03-13 5:07 ` [PATCH 4/4] perf: move machine__remove_thread and make static David Ahern
3 siblings, 1 reply; 8+ messages in thread
From: David Ahern @ 2013-03-13 5:07 UTC (permalink / raw)
To: acme, linux-kernel; +Cc: David Ahern
Signed-off-by: David Ahern <dsahern@gmail.com>
---
tools/perf/util/session.c | 12 ------------
tools/perf/util/session.h | 1 -
2 files changed, 13 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index bd85280b..ab265c2 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -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)
{
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index b5c0847..6b51d47 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -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)
--
1.7.10.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/4] perf: move machine__remove_thread and make static
2013-03-13 5:07 [PATCH 0/4] perf: remove unused functions David Ahern
` (2 preceding siblings ...)
2013-03-13 5:07 ` [PATCH 3/4] perf: remove unused perf_session__remove_thread David Ahern
@ 2013-03-13 5:07 ` David Ahern
2013-03-21 11:30 ` [tip:perf/core] perf machine: Move " tip-bot for David Ahern
3 siblings, 1 reply; 8+ messages in thread
From: David Ahern @ 2013-03-13 5:07 UTC (permalink / raw)
To: acme, linux-kernel; +Cc: David Ahern
Signed-off-by: David Ahern <dsahern@gmail.com>
---
tools/perf/util/machine.c | 22 +++++++++++-----------
tools/perf/util/machine.h | 1 -
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index efdb38e..c5e3b12 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1003,6 +1003,17 @@ int machine__process_fork_event(struct machine *machine, union perf_event *event
return 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))
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index 5ac5892..e0b2c00 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -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);
--
1.7.10.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [tip:perf/core] perf tools: Remove unused tracing functions
2013-03-13 5:07 ` [PATCH 2/4] perf: remove unused print_trace_event function David Ahern
@ 2013-03-21 11:27 ` tip-bot for David Ahern
0 siblings, 0 replies; 8+ messages in thread
From: tip-bot for David Ahern @ 2013-03-21 11:27 UTC (permalink / raw)
To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, dsahern, tglx
Commit-ID: eba7181d56da7e8198f0c70e3d7074bab47a5910
Gitweb: http://git.kernel.org/tip/eba7181d56da7e8198f0c70e3d7074bab47a5910
Author: David Ahern <dsahern@gmail.com>
AuthorDate: Tue, 12 Mar 2013 23:07:26 -0600
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 15 Mar 2013 13:06:07 -0300
perf tools: Remove unused tracing functions
Leftovers from before libtraceevent integration.
Signed-off-by: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1363151248-16674-3-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/trace-event-parse.c | 37 -------------------------------------
tools/perf/util/trace-event.h | 4 ----
2 files changed, 41 deletions(-)
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 3aabcd6..4454835 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -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)
{
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index a55fd37..28ccde8 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -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);
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [tip:perf/core] perf session: Remove unused perf_session__remove_thread method
2013-03-13 5:07 ` [PATCH 3/4] perf: remove unused perf_session__remove_thread David Ahern
@ 2013-03-21 11:28 ` tip-bot for David Ahern
0 siblings, 0 replies; 8+ messages in thread
From: tip-bot for David Ahern @ 2013-03-21 11:28 UTC (permalink / raw)
To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, dsahern, tglx
Commit-ID: c1ad050caad5fbff13fd2f54f49e184bd71de90d
Gitweb: http://git.kernel.org/tip/c1ad050caad5fbff13fd2f54f49e184bd71de90d
Author: David Ahern <dsahern@gmail.com>
AuthorDate: Tue, 12 Mar 2013 23:07:27 -0600
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
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
Signed-off-by: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1363151248-16674-4-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/session.c | 12 ------------
tools/perf/util/session.h | 1 -
2 files changed, 13 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index bd85280b..ab265c2 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -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)
{
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index b5c0847..6b51d47 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -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)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [tip:perf/core] perf machine: Move machine__remove_thread and make static
2013-03-13 5:07 ` [PATCH 4/4] perf: move machine__remove_thread and make static David Ahern
@ 2013-03-21 11:30 ` tip-bot for David Ahern
0 siblings, 0 replies; 8+ messages in thread
From: tip-bot for David Ahern @ 2013-03-21 11:30 UTC (permalink / raw)
To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, dsahern, tglx
Commit-ID: ed8996a6d59b9eb00a50d7d30887ba9f28eb4bb0
Gitweb: http://git.kernel.org/tip/ed8996a6d59b9eb00a50d7d30887ba9f28eb4bb0
Author: David Ahern <dsahern@gmail.com>
AuthorDate: Tue, 12 Mar 2013 23:07:28 -0600
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
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.
Signed-off-by: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1363151248-16674-5-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/machine.c | 22 +++++++++++-----------
tools/perf/util/machine.h | 1 -
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index efdb38e..c5e3b12 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1003,6 +1003,17 @@ int machine__process_fork_event(struct machine *machine, union perf_event *event
return 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))
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index 5ac5892..e0b2c00 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -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);
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-03-21 11:31 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-13 5:07 [PATCH 0/4] perf: remove unused functions David Ahern
2013-03-13 5:07 ` [PATCH 1/4] perf: remove unused print_event function David Ahern
2013-03-13 5:07 ` [PATCH 2/4] perf: remove unused print_trace_event function David Ahern
2013-03-21 11:27 ` [tip:perf/core] perf tools: Remove unused tracing functions tip-bot for David Ahern
2013-03-13 5:07 ` [PATCH 3/4] perf: remove unused perf_session__remove_thread David Ahern
2013-03-21 11:28 ` [tip:perf/core] perf session: Remove unused perf_session__remove_thread method tip-bot for David Ahern
2013-03-13 5:07 ` [PATCH 4/4] perf: move machine__remove_thread and make static David Ahern
2013-03-21 11:30 ` [tip:perf/core] perf machine: Move " tip-bot for David Ahern
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.