mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
perf tools: Release thread resources on PERF_RECORD_EXIT
For long running sessions with many threads with short lifetimes the amount of memory that the buildid process takes is too much. Since we don't have hist_entries that may be pointing to them, we can just release the resources associated with each thread when the exit (PERF_RECORD_EXIT) event is received. For normal processing we need to annotate maps with hits, and thus hist_entries pointing to it and drop the ones that had none. Will be done in a followup patch. Cc: David S. Miller <davem@davemloft.net> 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:
parent
0e60836bbd
commit
591765fdaf
5 changed files with 61 additions and 0 deletions
|
@ -62,6 +62,13 @@ static struct thread *thread__new(pid_t pid)
|
|||
return self;
|
||||
}
|
||||
|
||||
void thread__delete(struct thread *self)
|
||||
{
|
||||
map_groups__exit(&self->mg);
|
||||
free(self->comm);
|
||||
free(self);
|
||||
}
|
||||
|
||||
int thread__set_comm(struct thread *self, const char *comm)
|
||||
{
|
||||
int err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue