diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2010-05-10 11:59:37 +0200 | 
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2010-05-10 14:20:42 +0200 | 
| commit | dbb6be6d5e974c42bbecd183effaa0df69e1dd8b (patch) | |
| tree | 5735cb47e70853d057a9881dd0ce44b83e88fa63 /tools/perf/builtin-top.c | |
| parent | 6a867a395558a7f882d041783e4cdea6744ca2bf (diff) | |
| parent | b57f95a38233a2e73b679bea4a5453a1cc2a1cc9 (diff) | |
| download | olio-linux-3.10-dbb6be6d5e974c42bbecd183effaa0df69e1dd8b.tar.xz olio-linux-3.10-dbb6be6d5e974c42bbecd183effaa0df69e1dd8b.zip  | |
Merge branch 'linus' into timers/core
Reason: Further posix_cpu_timer patches depend on mainline changes
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'tools/perf/builtin-top.c')
| -rw-r--r-- | tools/perf/builtin-top.c | 22 | 
1 files changed, 13 insertions, 9 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 31f2e597800..1f529321607 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -28,6 +28,7 @@  #include <linux/rbtree.h>  #include "util/parse-options.h"  #include "util/parse-events.h" +#include "util/cpumap.h"  #include "util/debug.h" @@ -454,7 +455,7 @@ static void print_sym_table(void)  	struct sym_entry *syme, *n;  	struct rb_root tmp = RB_ROOT;  	struct rb_node *nd; -	int sym_width = 0, dso_width = 0, max_dso_width; +	int sym_width = 0, dso_width = 0, dso_short_width = 0;  	const int win_width = winsize.ws_col - 1;  	samples = userspace_samples = 0; @@ -544,15 +545,20 @@ static void print_sym_table(void)  		if (syme->map->dso->long_name_len > dso_width)  			dso_width = syme->map->dso->long_name_len; +		if (syme->map->dso->short_name_len > dso_short_width) +			dso_short_width = syme->map->dso->short_name_len; +  		if (syme->name_len > sym_width)  			sym_width = syme->name_len;  	}  	printed = 0; -	max_dso_width = winsize.ws_col - sym_width - 29; -	if (dso_width > max_dso_width) -		dso_width = max_dso_width; +	if (sym_width + dso_width > winsize.ws_col - 29) { +		dso_width = dso_short_width; +		if (sym_width + dso_width > winsize.ws_col - 29) +			sym_width = winsize.ws_col - dso_width - 29; +	}  	putchar('\n');  	if (nr_counters == 1)  		printf("             samples  pcnt"); @@ -1123,7 +1129,7 @@ static void start_counter(int i, int counter)  	cpu = profile_cpu;  	if (target_pid == -1 && profile_cpu == -1) -		cpu = i; +		cpu = cpumap[i];  	attr = attrs + counter; @@ -1347,12 +1353,10 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)  		attrs[counter].sample_period = default_interval;  	} -	nr_cpus = sysconf(_SC_NPROCESSORS_ONLN); -	assert(nr_cpus <= MAX_NR_CPUS); -	assert(nr_cpus >= 0); -  	if (target_pid != -1 || profile_cpu != -1)  		nr_cpus = 1; +	else +		nr_cpus = read_cpu_map();  	get_term_dimensions(&winsize);  	if (print_entries == 0) {  |