perf tools: Refactor all_tids to hold nr and the map
So that later, we can pass the thread_map instance instead of (thread_num, thread_map) for things like perf_evsel__open and friends, just like was done with cpu_map. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -18,11 +18,24 @@ struct thread {
|
||||
int comm_len;
|
||||
};
|
||||
|
||||
struct thread_map {
|
||||
int nr;
|
||||
int map[];
|
||||
};
|
||||
|
||||
struct perf_session;
|
||||
|
||||
void thread__delete(struct thread *self);
|
||||
|
||||
int find_all_tid(int pid, pid_t ** all_tid);
|
||||
struct thread_map *thread_map__new_by_pid(pid_t pid);
|
||||
struct thread_map *thread_map__new_by_tid(pid_t tid);
|
||||
struct thread_map *thread_map__new(pid_t pid, pid_t tid);
|
||||
|
||||
static inline void thread_map__delete(struct thread_map *threads)
|
||||
{
|
||||
free(threads);
|
||||
}
|
||||
|
||||
int thread__set_comm(struct thread *self, const char *comm);
|
||||
int thread__comm_len(struct thread *self);
|
||||
struct thread *perf_session__findnew(struct perf_session *self, pid_t pid);
|
||||
|
Reference in New Issue
Block a user