Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e53cdf1 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

perf top: Reduce default filter threshold



On idle systems 'perf top' comes up empty by default, because the event
count filter is set to 100.

Reduce it to 5 instead.

Also add an option to limit the number of functions displayed.

Reported-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <new-submission>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent a4c43bea
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -64,7 +64,8 @@ static int default_interval = 100000;
static int			event_count[MAX_COUNTERS];
static int			event_count[MAX_COUNTERS];
static int			fd[MAX_NR_CPUS][MAX_COUNTERS];
static int			fd[MAX_NR_CPUS][MAX_COUNTERS];


static __u64			count_filter		       = 100;
static __u64			count_filter			=  5;
static int			print_entries			= 15;


static int			target_pid			= -1;
static int			target_pid			= -1;
static int			profile_cpu			= -1;
static int			profile_cpu			= -1;
@@ -254,7 +255,7 @@ static void print_sym_table(void)
		struct symbol *sym = (struct symbol *)(syme + 1);
		struct symbol *sym = (struct symbol *)(syme + 1);
		float pcnt;
		float pcnt;


		if (++printed > 18 || syme->snap_count < count_filter)
		if (++printed > print_entries || syme->snap_count < count_filter)
			continue;
			continue;


		pcnt = 100.0 - (100.0 * ((sum_kevents - syme->snap_count) /
		pcnt = 100.0 - (100.0 * ((sum_kevents - syme->snap_count) /
@@ -650,7 +651,7 @@ static const struct option options[] = {
		    "number of seconds to delay between refreshes"),
		    "number of seconds to delay between refreshes"),
	OPT_BOOLEAN('D', "dump-symtab", &dump_symtab,
	OPT_BOOLEAN('D', "dump-symtab", &dump_symtab,
			    "dump the symbol table used for profiling"),
			    "dump the symbol table used for profiling"),
	OPT_INTEGER('f', "--count-filter", &count_filter,
	OPT_INTEGER('f', "count-filter", &count_filter,
		    "only display functions with more events than this"),
		    "only display functions with more events than this"),
	OPT_BOOLEAN('g', "group", &group,
	OPT_BOOLEAN('g', "group", &group,
			    "put the counters into a counter group"),
			    "put the counters into a counter group"),
@@ -662,8 +663,10 @@ static const struct option options[] = {
		    "track mmap events"),
		    "track mmap events"),
	OPT_BOOLEAN('U', "use-munmap", &use_munmap,
	OPT_BOOLEAN('U', "use-munmap", &use_munmap,
		    "track munmap events"),
		    "track munmap events"),
	OPT_INTEGER('F', "--freq", &freq,
	OPT_INTEGER('F', "freq", &freq,
		    "profile at this frequency"),
		    "profile at this frequency"),
	OPT_INTEGER('E', "entries", &print_entries,
		    "display this many functions"),
	OPT_END()
	OPT_END()
};
};