Patches contributed by Eötvös Lorand University


commit 3da297a60f7e8840f79f7d0b343af078890939ea
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Jun 7 17:39:02 2009 +0200

    perf record: Fall back to cpu-clock-ticks if no PMU
    
    On architectures/CPUs without PMU support but with perfcounters
    enabled 'perf record' currently fails because it cannot create a
    cycle based hw-perfcounter.
    
    Fall back to the cpu-clock-tick sw-perfcounter in this case, which
    is hrtimer based and will always work (as long as perfcounters
    are enabled).
    
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index aeab9c4b15e4..87866294a0e6 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -37,6 +37,7 @@ static pid_t			target_pid			= -1;
 static int			inherit				= 1;
 static int			force				= 0;
 static int			append_file			= 0;
+static int			verbose				= 0;
 
 static long			samples;
 static struct timeval		last_read;
@@ -349,17 +350,35 @@ static void create_counter(int counter, int cpu, pid_t pid)
 
 	track = 0; /* only the first counter needs these */
 
+try_again:
 	fd[nr_cpu][counter] = sys_perf_counter_open(attr, pid, cpu, group_fd, 0);
 
 	if (fd[nr_cpu][counter] < 0) {
 		int err = errno;
 
-		error("syscall returned with %d (%s)\n",
+		if (verbose)
+			error("sys_perf_counter_open() syscall returned with %d (%s)\n",
 				fd[nr_cpu][counter], strerror(err));
 		if (err == EPERM)
-			printf("Are you root?\n");
+			die("Permission error - are you root?\n");
+
+		/*
+		 * If it's cycles then fall back to hrtimer
+		 * based cpu-clock-tick sw counter, which
+		 * is always available even if no PMU support:
+		 */
+		if (attr->type == PERF_TYPE_HARDWARE
+			&& attr->config == PERF_COUNT_CPU_CYCLES) {
+
+			if (verbose)
+				warning(" ... trying to fall back to cpu-clock-ticks\n");
+			attr->type = PERF_TYPE_SOFTWARE;
+			attr->config = PERF_COUNT_CPU_CLOCK;
+			goto try_again;
+		}
 		exit(-1);
 	}
+
 	assert(fd[nr_cpu][counter] >= 0);
 	fcntl(fd[nr_cpu][counter], F_SETFL, O_NONBLOCK);
 
@@ -519,6 +538,8 @@ static const struct option options[] = {
 		    "profile at this frequency"),
 	OPT_INTEGER('m', "mmap-pages", &mmap_pages,
 		    "number of mmap data pages"),
+	OPT_BOOLEAN('v', "verbose", &verbose,
+		    "be more verbose (show counter open errors, etc)"),
 	OPT_END()
 };
 
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 6da30a140e86..1f8c97d5c32e 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -65,6 +65,7 @@ static int			group				=  0;
 static unsigned int		page_size;
 static unsigned int		mmap_pages			= 16;
 static int			freq				=  0;
+static int			verbose				=  0;
 
 static char			*sym_filter;
 static unsigned long		filter_start;
@@ -550,11 +551,12 @@ static void start_counter(int i, int counter)
 	if (fd[i][counter] < 0) {
 		int err = errno;
 
-		error("sys_perf_counter_open() syscall returned with %d (%s)\n",
-			fd[i][counter], strerror(err));
+		if (verbose)
+			error("sys_perf_counter_open() syscall returned with %d (%s)\n",
+				fd[i][counter], strerror(err));
 
 		if (err == EPERM)
-			die(" No permission - are you root?\n");
+			die("No permission - are you root?\n");
 		/*
 		 * If it's cycles then fall back to hrtimer
 		 * based cpu-clock-tick sw counter, which
@@ -563,7 +565,9 @@ static void start_counter(int i, int counter)
 		if (attr->type == PERF_TYPE_HARDWARE
 			&& attr->config == PERF_COUNT_CPU_CYCLES) {
 
-			warning(" ... trying to fall back to cpu-clock-ticks\n");
+			if (verbose)
+				warning(" ... trying to fall back to cpu-clock-ticks\n");
+
 			attr->type = PERF_TYPE_SOFTWARE;
 			attr->config = PERF_COUNT_CPU_CLOCK;
 			goto try_again;
@@ -673,6 +677,8 @@ static const struct option options[] = {
 		    "profile at this frequency"),
 	OPT_INTEGER('E', "entries", &print_entries,
 		    "display this many functions"),
+	OPT_BOOLEAN('v', "verbose", &verbose,
+		    "be more verbose (show counter open errors, etc)"),
 	OPT_END()
 };
 

commit 716c69fecacd42f2a304a97158e04af2786a3f65
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Jun 7 17:31:52 2009 +0200

    perf top: Fall back to cpu-clock-tick hrtimer sampling if no cycle counter available
    
    On architectures/CPUs without PMU support but with perfcounters
    enabled 'perf top' currently fails because it cannot create a
    cycle based hw-perfcounter.
    
    Fall back to the cpu-clock-tick sw-perfcounter in this case, which
    is hrtimer based and will always work (as long as perfcounters
    is enabled).
    
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index fdc1d5863b01..6da30a140e86 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -527,58 +527,81 @@ static void mmap_read(void)
 	}
 }
 
-static int __cmd_top(void)
+int nr_poll;
+int group_fd;
+
+static void start_counter(int i, int counter)
 {
 	struct perf_counter_attr *attr;
-	pthread_t thread;
-	int i, counter, group_fd, nr_poll = 0;
 	unsigned int cpu;
+
+	cpu = profile_cpu;
+	if (target_pid == -1 && profile_cpu == -1)
+		cpu = i;
+
+	attr = attrs + counter;
+
+	attr->sample_type	= PERF_SAMPLE_IP | PERF_SAMPLE_TID;
+	attr->freq		= freq;
+
+try_again:
+	fd[i][counter] = sys_perf_counter_open(attr, target_pid, cpu, group_fd, 0);
+
+	if (fd[i][counter] < 0) {
+		int err = errno;
+
+		error("sys_perf_counter_open() syscall returned with %d (%s)\n",
+			fd[i][counter], strerror(err));
+
+		if (err == EPERM)
+			die(" No permission - are you root?\n");
+		/*
+		 * If it's cycles then fall back to hrtimer
+		 * based cpu-clock-tick sw counter, which
+		 * is always available even if no PMU support:
+		 */
+		if (attr->type == PERF_TYPE_HARDWARE
+			&& attr->config == PERF_COUNT_CPU_CYCLES) {
+
+			warning(" ... trying to fall back to cpu-clock-ticks\n");
+			attr->type = PERF_TYPE_SOFTWARE;
+			attr->config = PERF_COUNT_CPU_CLOCK;
+			goto try_again;
+		}
+		exit(-1);
+	}
+	assert(fd[i][counter] >= 0);
+	fcntl(fd[i][counter], F_SETFL, O_NONBLOCK);
+
+	/*
+	 * First counter acts as the group leader:
+	 */
+	if (group && group_fd == -1)
+		group_fd = fd[i][counter];
+
+	event_array[nr_poll].fd = fd[i][counter];
+	event_array[nr_poll].events = POLLIN;
+	nr_poll++;
+
+	mmap_array[i][counter].counter = counter;
+	mmap_array[i][counter].prev = 0;
+	mmap_array[i][counter].mask = mmap_pages*page_size - 1;
+	mmap_array[i][counter].base = mmap(NULL, (mmap_pages+1)*page_size,
+			PROT_READ, MAP_SHARED, fd[i][counter], 0);
+	if (mmap_array[i][counter].base == MAP_FAILED)
+		die("failed to mmap with %d (%s)\n", errno, strerror(errno));
+}
+
+static int __cmd_top(void)
+{
+	pthread_t thread;
+	int i, counter;
 	int ret;
 
 	for (i = 0; i < nr_cpus; i++) {
 		group_fd = -1;
-		for (counter = 0; counter < nr_counters; counter++) {
-
-			cpu	= profile_cpu;
-			if (target_pid == -1 && profile_cpu == -1)
-				cpu = i;
-
-			attr = attrs + counter;
-
-			attr->sample_type	= PERF_SAMPLE_IP | PERF_SAMPLE_TID;
-			attr->freq		= freq;
-
-			fd[i][counter] = sys_perf_counter_open(attr, target_pid, cpu, group_fd, 0);
-			if (fd[i][counter] < 0) {
-				int err = errno;
-
-				error("syscall returned with %d (%s)\n",
-					fd[i][counter], strerror(err));
-				if (err == EPERM)
-					printf("Are you root?\n");
-				exit(-1);
-			}
-			assert(fd[i][counter] >= 0);
-			fcntl(fd[i][counter], F_SETFL, O_NONBLOCK);
-
-			/*
-			 * First counter acts as the group leader:
-			 */
-			if (group && group_fd == -1)
-				group_fd = fd[i][counter];
-
-			event_array[nr_poll].fd = fd[i][counter];
-			event_array[nr_poll].events = POLLIN;
-			nr_poll++;
-
-			mmap_array[i][counter].counter = counter;
-			mmap_array[i][counter].prev = 0;
-			mmap_array[i][counter].mask = mmap_pages*page_size - 1;
-			mmap_array[i][counter].base = mmap(NULL, (mmap_pages+1)*page_size,
-					PROT_READ, MAP_SHARED, fd[i][counter], 0);
-			if (mmap_array[i][counter].base == MAP_FAILED)
-				die("failed to mmap with %d (%s)\n", errno, strerror(errno));
-		}
+		for (counter = 0; counter < nr_counters; counter++)
+			start_counter(i, counter);
 	}
 
 	/* Wait for a minimal set of events before starting the snapshot */
diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c
index 2cad286e4371..e16bf9a707e8 100644
--- a/tools/perf/util/usage.c
+++ b/tools/perf/util/usage.c
@@ -9,29 +9,29 @@ static void report(const char *prefix, const char *err, va_list params)
 {
 	char msg[1024];
 	vsnprintf(msg, sizeof(msg), err, params);
-	fprintf(stderr, "%s%s\n", prefix, msg);
+	fprintf(stderr, " %s%s\n", prefix, msg);
 }
 
 static NORETURN void usage_builtin(const char *err)
 {
-	fprintf(stderr, "\n usage: %s\n", err);
+	fprintf(stderr, "\n Usage: %s\n", err);
 	exit(129);
 }
 
 static NORETURN void die_builtin(const char *err, va_list params)
 {
-	report("fatal: ", err, params);
+	report(" Fatal: ", err, params);
 	exit(128);
 }
 
 static void error_builtin(const char *err, va_list params)
 {
-	report("error: ", err, params);
+	report(" Error: ", err, params);
 }
 
 static void warn_builtin(const char *warn, va_list params)
 {
-	report("warning: ", warn, params);
+	report(" Warning: ", warn, params);
 }
 
 /* If we are in a dlopen()ed .so write to a global variable would segfault

commit 743ee1f80434138495bbb95ffb897acf46b51d54
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Jun 7 17:06:46 2009 +0200

    perf stat: Continue even on counter creation error
    
    Before:
    
     $ perf stat ~/hackbench 5
    
     error: syscall returned with -1 (No such device)
    
    After:
    
     $ perf stat ~/hackbench 5
     Time: 1.640
    
     Performance counter stats for '/home/mingo/hackbench 5':
    
        6524.570382  task-clock-ticks     #       3.838 CPU utilization factor
              35704  context-switches     #       0.005 M/sec
                191  CPU-migrations       #       0.000 M/sec
               8958  page-faults          #       0.001 M/sec
      <not counted>  cycles
      <not counted>  instructions
      <not counted>  cache-references
      <not counted>  cache-misses
    
     Wall-clock time elapsed:  1699.999995 msecs
    
    Also add -v (--verbose) option to allow the printing of failed
    counter opens.
    
    Plus dont print 'inf' if wall-time is zero (due to jiffies granularity),
    instead skip the printing of the CPU utilization factor.
    
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 2cbf5a189589..184ff95ef4f5 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -59,6 +59,7 @@ static struct perf_counter_attr default_attrs[MAX_COUNTERS] = {
 
 static int			system_wide			=  0;
 static int			inherit				=  1;
+static int			verbose				=  0;
 
 static int			fd[MAX_NR_CPUS][MAX_COUNTERS];
 
@@ -83,7 +84,7 @@ static __u64			event_scaled[MAX_COUNTERS];
 static __u64			runtime_nsecs;
 static __u64			walltime_nsecs;
 
-static void create_perfstat_counter(int counter)
+static void create_perf_stat_counter(int counter)
 {
 	struct perf_counter_attr *attr = attrs + counter;
 
@@ -95,10 +96,8 @@ static void create_perfstat_counter(int counter)
 		int cpu;
 		for (cpu = 0; cpu < nr_cpus; cpu ++) {
 			fd[cpu][counter] = sys_perf_counter_open(attr, -1, cpu, -1, 0);
-			if (fd[cpu][counter] < 0) {
-				printf("perfstat error: syscall returned with %d (%s)\n",
-						fd[cpu][counter], strerror(errno));
-				exit(-1);
+			if (fd[cpu][counter] < 0 && verbose) {
+				printf("Error: counter %d, sys_perf_counter_open() syscall returned with %d (%s)\n", counter, fd[cpu][counter], strerror(errno));
 			}
 		}
 	} else {
@@ -106,10 +105,8 @@ static void create_perfstat_counter(int counter)
 		attr->disabled	= 1;
 
 		fd[0][counter] = sys_perf_counter_open(attr, 0, -1, -1, 0);
-		if (fd[0][counter] < 0) {
-			printf("perfstat error: syscall returned with %d (%s)\n",
-					fd[0][counter], strerror(errno));
-			exit(-1);
+		if (fd[0][counter] < 0 && verbose) {
+			printf("Error: counter %d, sys_perf_counter_open() syscall returned with %d (%s)\n", counter, fd[0][counter], strerror(errno));
 		}
 	}
 }
@@ -147,6 +144,9 @@ static void read_counter(int counter)
 
 	nv = scale ? 3 : 1;
 	for (cpu = 0; cpu < nr_cpus; cpu ++) {
+		if (fd[cpu][counter] < 0)
+			continue;
+
 		res = read(fd[cpu][counter], single_count, nv * sizeof(__u64));
 		assert(res == nv * sizeof(__u64));
 
@@ -204,8 +204,9 @@ static void print_counter(int counter)
 		if (attrs[counter].type == PERF_TYPE_SOFTWARE &&
 			attrs[counter].config == PERF_COUNT_TASK_CLOCK) {
 
-			fprintf(stderr, " # %11.3f CPU utilization factor",
-				(double)count[0] / (double)walltime_nsecs);
+			if (walltime_nsecs)
+				fprintf(stderr, " # %11.3f CPU utilization factor",
+					(double)count[0] / (double)walltime_nsecs);
 		}
 	} else {
 		fprintf(stderr, " %14Ld  %-20s",
@@ -220,7 +221,7 @@ static void print_counter(int counter)
 	fprintf(stderr, "\n");
 }
 
-static int do_perfstat(int argc, const char **argv)
+static int do_perf_stat(int argc, const char **argv)
 {
 	unsigned long long t0, t1;
 	int counter;
@@ -232,7 +233,7 @@ static int do_perfstat(int argc, const char **argv)
 		nr_cpus = 1;
 
 	for (counter = 0; counter < nr_counters; counter++)
-		create_perfstat_counter(counter);
+		create_perf_stat_counter(counter);
 
 	/*
 	 * Enable counters and exec the command:
@@ -305,6 +306,8 @@ static const struct option options[] = {
 			    "system-wide collection from all CPUs"),
 	OPT_BOOLEAN('S', "scale", &scale,
 			    "scale/normalize counters"),
+	OPT_BOOLEAN('v', "verbose", &verbose,
+		    "be more verbose (show counter open errors, etc)"),
 	OPT_END()
 };
 
@@ -335,5 +338,5 @@ int cmd_stat(int argc, const char **argv, const char *prefix)
 	signal(SIGALRM, skip_signal);
 	signal(SIGABRT, skip_signal);
 
-	return do_perfstat(argc, argv);
+	return do_perf_stat(argc, argv);
 }

commit 5f4457a4f62cc9d78e04c0eb12ff0540899aad89
Merge: 9b94b3a19b13 b87297fb405e
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Jun 7 12:22:15 2009 +0200

    Merge branch 'linus' into x86/cpu

commit 62a6f465f6572e1f28765c583c12753bb3e23715
Merge: 56fdd18c7b89 bdc2911cde7d
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Jun 7 11:36:02 2009 +0200

    Merge branch 'dma-debug/2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into core/iommu

commit 56fdd18c7b89a2fac1dfe5d54750c9143867fdc4
Merge: 7caf6a49bb17 b87297fb405e
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Jun 7 11:34:59 2009 +0200

    Merge branch 'linus' into core/iommu
    
    Merge reason: This branch was on an -rc5 base so pull almost-2.6.30
                  to resync with the latest upstream fixes and make sure
                  the combination works fine.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

commit 23b87116c7c4f73597965218b66041acbdb4e79f
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sat Jun 6 21:25:29 2009 +0200

    perf annotate: Fix command line help text
    
    Arjan noticed this bug in the perf annotate help output:
    
        -s, --symbol <file>   symbol to annotate
    
    that should be <symbol> instead.
    
    Reported-by: Arjan van de Ven <arjan@linux.intel.com>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 80c5aa0bb42e..0e23fe98ec4e 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -1300,7 +1300,7 @@ static const char * const annotate_usage[] = {
 static const struct option options[] = {
 	OPT_STRING('i', "input", &input_name, "file",
 		    "input file name"),
-	OPT_STRING('s', "symbol", &sym_hist_filter, "file",
+	OPT_STRING('s', "symbol", &sym_hist_filter, "symbol",
 		    "symbol to annotate"),
 	OPT_BOOLEAN('v', "verbose", &verbose,
 		    "be more verbose (show symbol address, etc)"),

commit 39273ee9756917129de3190d469b0b120f87e763
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sat Jun 6 21:17:03 2009 +0200

    perf annotate: Automatically pick up vmlinux in the local directory
    
    Right now kernel debug info does not get resolved by default, because
    we dont know where to look for the vmlinux.
    
    The -k option can be used for that - but if no option is given, pick
    up vmlinux files in the current directory - in case a kernel hacker
    runs profiling from the source directory that the kernel was built in.
    
    The real solution would be to embedd the location (and perhaps the
    date/timestamp) of the vmlinux file in /proc/kallsyms, so that
    tools can pick it up automatically.
    
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 4a3c279160c5..80c5aa0bb42e 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -26,7 +26,7 @@
 #define SHOW_HV		4
 
 static char		const *input_name = "perf.data";
-static char		*vmlinux = NULL;
+static char		*vmlinux = "vmlinux";
 
 static char		default_sort_order[] = "comm,symbol";
 static char		*sort_order = default_sort_order;

commit 8953645fec933f992223286ad407dc371ac2caa5
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sat Jun 6 21:04:17 2009 +0200

    perf_counter tools: Fix error condition in parse_aliases()
    
    gcc warned about this bug:
    
    util/parse-events.c: In function ‘parse_generic_hw_symbols’:
    util/parse-events.c:175: warning: comparison is always false due to limited range of data type
    util/parse-events.c:182: warning: comparison is always false due to limited range of data type
    util/parse-events.c:190: warning: comparison is always false due to limited range of data type
    
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index e0820b4388ae..f18a9a006e1b 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -160,12 +160,12 @@ static int parse_aliases(const char *str, char *names[][MAX_ALIASES], int size)
 		}
 	}
 
-	return 0;
+	return -1;
 }
 
 static int parse_generic_hw_symbols(const char *str, struct perf_counter_attr *attr)
 {
-	__u8 cache_type = -1, cache_op = 0, cache_result = 0;
+	int cache_type = -1, cache_op = 0, cache_result = 0;
 
 	cache_type = parse_aliases(str, hw_cache, PERF_COUNT_HW_CACHE_MAX);
 	/*
@@ -179,8 +179,8 @@ static int parse_generic_hw_symbols(const char *str, struct perf_counter_attr *a
 	/*
 	 * Fall back to reads:
 	 */
-	if (cache_type == -1)
-		cache_type = PERF_COUNT_HW_CACHE_OP_READ;
+	if (cache_op == -1)
+		cache_op = PERF_COUNT_HW_CACHE_OP_READ;
 
 	cache_result = parse_aliases(str, hw_cache_result,
 					PERF_COUNT_HW_CACHE_RESULT_MAX);

commit 864709302a80f26fa9da3be5b47304f0b8bae192
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sat Jun 6 20:33:43 2009 +0200

    perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/
    
    Several people have suggested that 'perf' has become a full-fledged
    tool that should be moved out of Documentation/. Move it to the
    (new) tools/ directory.
    
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/Documentation/perf_counter/.gitignore b/tools/perf/.gitignore
similarity index 100%
rename from Documentation/perf_counter/.gitignore
rename to tools/perf/.gitignore
diff --git a/Documentation/perf_counter/Documentation/Makefile b/tools/perf/Documentation/Makefile
similarity index 100%
rename from Documentation/perf_counter/Documentation/Makefile
rename to tools/perf/Documentation/Makefile
diff --git a/Documentation/perf_counter/Documentation/asciidoc.conf b/tools/perf/Documentation/asciidoc.conf
similarity index 100%
rename from Documentation/perf_counter/Documentation/asciidoc.conf
rename to tools/perf/Documentation/asciidoc.conf
diff --git a/Documentation/perf_counter/Documentation/manpage-1.72.xsl b/tools/perf/Documentation/manpage-1.72.xsl
similarity index 100%
rename from Documentation/perf_counter/Documentation/manpage-1.72.xsl
rename to tools/perf/Documentation/manpage-1.72.xsl
diff --git a/Documentation/perf_counter/Documentation/manpage-base.xsl b/tools/perf/Documentation/manpage-base.xsl
similarity index 100%
rename from Documentation/perf_counter/Documentation/manpage-base.xsl
rename to tools/perf/Documentation/manpage-base.xsl
diff --git a/Documentation/perf_counter/Documentation/manpage-bold-literal.xsl b/tools/perf/Documentation/manpage-bold-literal.xsl
similarity index 100%
rename from Documentation/perf_counter/Documentation/manpage-bold-literal.xsl
rename to tools/perf/Documentation/manpage-bold-literal.xsl
diff --git a/Documentation/perf_counter/Documentation/manpage-normal.xsl b/tools/perf/Documentation/manpage-normal.xsl
similarity index 100%
rename from Documentation/perf_counter/Documentation/manpage-normal.xsl
rename to tools/perf/Documentation/manpage-normal.xsl
diff --git a/Documentation/perf_counter/Documentation/manpage-suppress-sp.xsl b/tools/perf/Documentation/manpage-suppress-sp.xsl
similarity index 100%
rename from Documentation/perf_counter/Documentation/manpage-suppress-sp.xsl
rename to tools/perf/Documentation/manpage-suppress-sp.xsl
diff --git a/Documentation/perf_counter/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
similarity index 100%
rename from Documentation/perf_counter/Documentation/perf-annotate.txt
rename to tools/perf/Documentation/perf-annotate.txt
diff --git a/Documentation/perf_counter/Documentation/perf-help.txt b/tools/perf/Documentation/perf-help.txt
similarity index 100%
rename from Documentation/perf_counter/Documentation/perf-help.txt
rename to tools/perf/Documentation/perf-help.txt
diff --git a/Documentation/perf_counter/Documentation/perf-list.txt b/tools/perf/Documentation/perf-list.txt
similarity index 100%
rename from Documentation/perf_counter/Documentation/perf-list.txt
rename to tools/perf/Documentation/perf-list.txt
diff --git a/Documentation/perf_counter/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
similarity index 100%
rename from Documentation/perf_counter/Documentation/perf-record.txt
rename to tools/perf/Documentation/perf-record.txt
diff --git a/Documentation/perf_counter/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
similarity index 100%
rename from Documentation/perf_counter/Documentation/perf-report.txt
rename to tools/perf/Documentation/perf-report.txt
diff --git a/Documentation/perf_counter/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt
similarity index 100%
rename from Documentation/perf_counter/Documentation/perf-stat.txt
rename to tools/perf/Documentation/perf-stat.txt
diff --git a/Documentation/perf_counter/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt
similarity index 100%
rename from Documentation/perf_counter/Documentation/perf-top.txt
rename to tools/perf/Documentation/perf-top.txt
diff --git a/Documentation/perf_counter/Documentation/perf.txt b/tools/perf/Documentation/perf.txt
similarity index 100%
rename from Documentation/perf_counter/Documentation/perf.txt
rename to tools/perf/Documentation/perf.txt
diff --git a/Documentation/perf_counter/Makefile b/tools/perf/Makefile
similarity index 100%
rename from Documentation/perf_counter/Makefile
rename to tools/perf/Makefile
diff --git a/Documentation/perf_counter/builtin-annotate.c b/tools/perf/builtin-annotate.c
similarity index 100%
rename from Documentation/perf_counter/builtin-annotate.c
rename to tools/perf/builtin-annotate.c
diff --git a/Documentation/perf_counter/builtin-help.c b/tools/perf/builtin-help.c
similarity index 100%
rename from Documentation/perf_counter/builtin-help.c
rename to tools/perf/builtin-help.c
diff --git a/Documentation/perf_counter/builtin-list.c b/tools/perf/builtin-list.c
similarity index 100%
rename from Documentation/perf_counter/builtin-list.c
rename to tools/perf/builtin-list.c
diff --git a/Documentation/perf_counter/builtin-record.c b/tools/perf/builtin-record.c
similarity index 100%
rename from Documentation/perf_counter/builtin-record.c
rename to tools/perf/builtin-record.c
diff --git a/Documentation/perf_counter/builtin-report.c b/tools/perf/builtin-report.c
similarity index 100%
rename from Documentation/perf_counter/builtin-report.c
rename to tools/perf/builtin-report.c
diff --git a/Documentation/perf_counter/builtin-stat.c b/tools/perf/builtin-stat.c
similarity index 100%
rename from Documentation/perf_counter/builtin-stat.c
rename to tools/perf/builtin-stat.c
diff --git a/Documentation/perf_counter/builtin-top.c b/tools/perf/builtin-top.c
similarity index 100%
rename from Documentation/perf_counter/builtin-top.c
rename to tools/perf/builtin-top.c
diff --git a/Documentation/perf_counter/builtin.h b/tools/perf/builtin.h
similarity index 100%
rename from Documentation/perf_counter/builtin.h
rename to tools/perf/builtin.h
diff --git a/Documentation/perf_counter/command-list.txt b/tools/perf/command-list.txt
similarity index 100%
rename from Documentation/perf_counter/command-list.txt
rename to tools/perf/command-list.txt
diff --git a/Documentation/perf_counter/design.txt b/tools/perf/design.txt
similarity index 100%
rename from Documentation/perf_counter/design.txt
rename to tools/perf/design.txt
diff --git a/Documentation/perf_counter/perf.c b/tools/perf/perf.c
similarity index 100%
rename from Documentation/perf_counter/perf.c
rename to tools/perf/perf.c
diff --git a/Documentation/perf_counter/perf.h b/tools/perf/perf.h
similarity index 100%
rename from Documentation/perf_counter/perf.h
rename to tools/perf/perf.h
diff --git a/Documentation/perf_counter/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
similarity index 100%
rename from Documentation/perf_counter/util/PERF-VERSION-GEN
rename to tools/perf/util/PERF-VERSION-GEN
diff --git a/Documentation/perf_counter/util/abspath.c b/tools/perf/util/abspath.c
similarity index 100%
rename from Documentation/perf_counter/util/abspath.c
rename to tools/perf/util/abspath.c
diff --git a/Documentation/perf_counter/util/alias.c b/tools/perf/util/alias.c
similarity index 100%
rename from Documentation/perf_counter/util/alias.c
rename to tools/perf/util/alias.c
diff --git a/Documentation/perf_counter/util/cache.h b/tools/perf/util/cache.h
similarity index 100%
rename from Documentation/perf_counter/util/cache.h
rename to tools/perf/util/cache.h
diff --git a/Documentation/perf_counter/util/color.c b/tools/perf/util/color.c
similarity index 100%
rename from Documentation/perf_counter/util/color.c
rename to tools/perf/util/color.c
diff --git a/Documentation/perf_counter/util/color.h b/tools/perf/util/color.h
similarity index 100%
rename from Documentation/perf_counter/util/color.h
rename to tools/perf/util/color.h
diff --git a/Documentation/perf_counter/util/config.c b/tools/perf/util/config.c
similarity index 100%
rename from Documentation/perf_counter/util/config.c
rename to tools/perf/util/config.c
diff --git a/Documentation/perf_counter/util/ctype.c b/tools/perf/util/ctype.c
similarity index 100%
rename from Documentation/perf_counter/util/ctype.c
rename to tools/perf/util/ctype.c
diff --git a/Documentation/perf_counter/util/environment.c b/tools/perf/util/environment.c
similarity index 100%
rename from Documentation/perf_counter/util/environment.c
rename to tools/perf/util/environment.c
diff --git a/Documentation/perf_counter/util/exec_cmd.c b/tools/perf/util/exec_cmd.c
similarity index 100%
rename from Documentation/perf_counter/util/exec_cmd.c
rename to tools/perf/util/exec_cmd.c
diff --git a/Documentation/perf_counter/util/exec_cmd.h b/tools/perf/util/exec_cmd.h
similarity index 100%
rename from Documentation/perf_counter/util/exec_cmd.h
rename to tools/perf/util/exec_cmd.h
diff --git a/Documentation/perf_counter/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
similarity index 100%
rename from Documentation/perf_counter/util/generate-cmdlist.sh
rename to tools/perf/util/generate-cmdlist.sh
diff --git a/Documentation/perf_counter/util/help.c b/tools/perf/util/help.c
similarity index 100%
rename from Documentation/perf_counter/util/help.c
rename to tools/perf/util/help.c
diff --git a/Documentation/perf_counter/util/help.h b/tools/perf/util/help.h
similarity index 100%
rename from Documentation/perf_counter/util/help.h
rename to tools/perf/util/help.h
diff --git a/Documentation/perf_counter/util/levenshtein.c b/tools/perf/util/levenshtein.c
similarity index 100%
rename from Documentation/perf_counter/util/levenshtein.c
rename to tools/perf/util/levenshtein.c
diff --git a/Documentation/perf_counter/util/levenshtein.h b/tools/perf/util/levenshtein.h
similarity index 100%
rename from Documentation/perf_counter/util/levenshtein.h
rename to tools/perf/util/levenshtein.h
diff --git a/Documentation/perf_counter/util/list.h b/tools/perf/util/list.h
similarity index 100%
rename from Documentation/perf_counter/util/list.h
rename to tools/perf/util/list.h
diff --git a/Documentation/perf_counter/util/pager.c b/tools/perf/util/pager.c
similarity index 100%
rename from Documentation/perf_counter/util/pager.c
rename to tools/perf/util/pager.c
diff --git a/Documentation/perf_counter/util/parse-events.c b/tools/perf/util/parse-events.c
similarity index 100%
rename from Documentation/perf_counter/util/parse-events.c
rename to tools/perf/util/parse-events.c
diff --git a/Documentation/perf_counter/util/parse-events.h b/tools/perf/util/parse-events.h
similarity index 100%
rename from Documentation/perf_counter/util/parse-events.h
rename to tools/perf/util/parse-events.h
diff --git a/Documentation/perf_counter/util/parse-options.c b/tools/perf/util/parse-options.c
similarity index 100%
rename from Documentation/perf_counter/util/parse-options.c
rename to tools/perf/util/parse-options.c
diff --git a/Documentation/perf_counter/util/parse-options.h b/tools/perf/util/parse-options.h
similarity index 100%
rename from Documentation/perf_counter/util/parse-options.h
rename to tools/perf/util/parse-options.h
diff --git a/Documentation/perf_counter/util/path.c b/tools/perf/util/path.c
similarity index 100%
rename from Documentation/perf_counter/util/path.c
rename to tools/perf/util/path.c
diff --git a/Documentation/perf_counter/util/quote.c b/tools/perf/util/quote.c
similarity index 100%
rename from Documentation/perf_counter/util/quote.c
rename to tools/perf/util/quote.c
diff --git a/Documentation/perf_counter/util/quote.h b/tools/perf/util/quote.h
similarity index 100%
rename from Documentation/perf_counter/util/quote.h
rename to tools/perf/util/quote.h
diff --git a/Documentation/perf_counter/util/rbtree.c b/tools/perf/util/rbtree.c
similarity index 100%
rename from Documentation/perf_counter/util/rbtree.c
rename to tools/perf/util/rbtree.c
diff --git a/Documentation/perf_counter/util/rbtree.h b/tools/perf/util/rbtree.h
similarity index 100%
rename from Documentation/perf_counter/util/rbtree.h
rename to tools/perf/util/rbtree.h
diff --git a/Documentation/perf_counter/util/run-command.c b/tools/perf/util/run-command.c
similarity index 100%
rename from Documentation/perf_counter/util/run-command.c
rename to tools/perf/util/run-command.c
diff --git a/Documentation/perf_counter/util/run-command.h b/tools/perf/util/run-command.h
similarity index 100%
rename from Documentation/perf_counter/util/run-command.h
rename to tools/perf/util/run-command.h
diff --git a/Documentation/perf_counter/util/sigchain.c b/tools/perf/util/sigchain.c
similarity index 100%
rename from Documentation/perf_counter/util/sigchain.c
rename to tools/perf/util/sigchain.c
diff --git a/Documentation/perf_counter/util/sigchain.h b/tools/perf/util/sigchain.h
similarity index 100%
rename from Documentation/perf_counter/util/sigchain.h
rename to tools/perf/util/sigchain.h
diff --git a/Documentation/perf_counter/util/strbuf.c b/tools/perf/util/strbuf.c
similarity index 100%
rename from Documentation/perf_counter/util/strbuf.c
rename to tools/perf/util/strbuf.c
diff --git a/Documentation/perf_counter/util/strbuf.h b/tools/perf/util/strbuf.h
similarity index 100%
rename from Documentation/perf_counter/util/strbuf.h
rename to tools/perf/util/strbuf.h
diff --git a/Documentation/perf_counter/util/string.c b/tools/perf/util/string.c
similarity index 100%
rename from Documentation/perf_counter/util/string.c
rename to tools/perf/util/string.c
diff --git a/Documentation/perf_counter/util/string.h b/tools/perf/util/string.h
similarity index 100%
rename from Documentation/perf_counter/util/string.h
rename to tools/perf/util/string.h
diff --git a/Documentation/perf_counter/util/symbol.c b/tools/perf/util/symbol.c
similarity index 100%
rename from Documentation/perf_counter/util/symbol.c
rename to tools/perf/util/symbol.c
diff --git a/Documentation/perf_counter/util/symbol.h b/tools/perf/util/symbol.h
similarity index 100%
rename from Documentation/perf_counter/util/symbol.h
rename to tools/perf/util/symbol.h
diff --git a/Documentation/perf_counter/util/usage.c b/tools/perf/util/usage.c
similarity index 100%
rename from Documentation/perf_counter/util/usage.c
rename to tools/perf/util/usage.c
diff --git a/Documentation/perf_counter/util/util.h b/tools/perf/util/util.h
similarity index 100%
rename from Documentation/perf_counter/util/util.h
rename to tools/perf/util/util.h
diff --git a/Documentation/perf_counter/util/wrapper.c b/tools/perf/util/wrapper.c
similarity index 100%
rename from Documentation/perf_counter/util/wrapper.c
rename to tools/perf/util/wrapper.c