perf top: Allocate space only for the number of counters used
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 17 Nov 2009 20:38:01 +0000 (18:38 -0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 19 Nov 2009 05:03:40 +0000 (06:03 +0100)
commit5a8e5a3065bf04b7673262fd6c46123e4b888d2b
treeefd85b86b8904a2a551f603a45e3ec0199ec7539
parent51a472decb845e920137284a5cfef51fb7d61206
perf top: Allocate space only for the number of counters used

Reducing memory consumption on a typical desktop machine:

From:

32710 root      20   0  172m 142m 1056 S  0.0  4.7   0:00.37
perf

To:

  420 root      20   0 47528  16m 1056 R  0.3  0.5   0:00.24 perf

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1258490282-1821-2-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/builtin-top.c