Patches contributed by Eötvös Lorand University


commit 1d87cff407ceddf0bc4e825949a4b1bf645418bd
Merge: 05154752cf37 342688f9db39
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Nov 3 16:54:14 2009 +0100

    Merge branch 'iommu/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into x86/urgent

commit 900b20d5900045fb9b48f2fb3d80cbdbae3f44c0
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Nov 2 19:25:25 2009 +0100

    perf tools: Fix missing symtabs printouts
    
    Fix:
    
      util/map.c: In function ‘map__find_symbol’:
      util/map.c:97: error: field precision should have type ‘int’, but argument 3 has type ‘size_t’
    
    Also clean up some line wrap damage - we dont line-wrap printk
    messages.
    
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Mike Galbraith <efault@gmx.de>
    LKML-Reference: <1256927305-4628-3-git-send-email-acme@infradead.org>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index f1e216955420..33f868420d73 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -93,13 +93,12 @@ map__find_symbol(struct map *self, u64 ip, symbol_filter_t filter)
 			const size_t real_len = len - sizeof(DSO__DELETED);
 
 			if (len > sizeof(DSO__DELETED) &&
-			    strcmp(name + real_len + 1, DSO__DELETED) == 0)
-				pr_warning("%.*s was updated, restart the "
-					   "long running apps that use it!\n",
-					   real_len, name);
-			else
-				pr_warning("no symbols found in %s, maybe "
-					   "install a debug package?\n", name);
+			    strcmp(name + real_len + 1, DSO__DELETED) == 0) {
+				pr_warning("%.*s was updated, restart the long running apps that use it!\n",
+					   (int)real_len, name);
+			} else {
+				pr_warning("no symbols found in %s, maybe install a debug package?\n", name);
+			}
 			return NULL;
 		}
 	}

commit 9de09ace8d518141a4375e1d216ab64db4377799
Merge: 1beee96bae0d 6d3f1e12f46a
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Oct 29 09:02:15 2009 +0100

    Merge branch 'tracing/urgent' into tracing/core
    
    Merge reason: Pick up fixes and move base from -rc1 to -rc5.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

commit 4ce5b90340879ce93d169b7b523c2cbbe7c45843
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Oct 26 07:55:55 2009 +0100

    rcu: Do tiny cleanups in rcutiny
    
    No change in functionality - just straighten out a few small
    stylistic details.
    
    Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Cc: David Howells <dhowells@redhat.com>
    Cc: Josh Triplett <josh@joshtriplett.org>
    Cc: laijs@cn.fujitsu.com
    Cc: dipankar@in.ibm.com
    Cc: mathieu.desnoyers@polymtl.ca
    Cc: dvhltc@us.ibm.com
    Cc: niv@us.ibm.com
    Cc: peterz@infradead.org
    Cc: rostedt@goodmis.org
    Cc: Valdis.Kletnieks@vt.edu
    Cc: avi@redhat.com
    Cc: mtosatti@redhat.com
    LKML-Reference: <12565226351355-git-send-email->
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 891073c264dc..2c1fe8373e71 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -20,9 +20,8 @@
  * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  *
  * For detailed explanation of Read-Copy Update mechanism see -
- * 		Documentation/RCU
+ *		Documentation/RCU
  */
-
 #ifndef __LINUX_TINY_H
 #define __LINUX_TINY_H
 
@@ -70,8 +69,7 @@ static inline void synchronize_rcu_bh_expedited(void)
 }
 
 struct notifier_block;
-extern int rcu_cpu_notify(struct notifier_block *self,
-			  unsigned long action, void *hcpu);
+extern int rcu_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu);
 
 #ifdef CONFIG_NO_HZ
 
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
index 0b54efde66ac..b33ec3aa377a 100644
--- a/kernel/rcutiny.c
+++ b/kernel/rcutiny.c
@@ -20,22 +20,21 @@
  * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  *
  * For detailed explanation of Read-Copy Update mechanism see -
- * 		Documentation/RCU
+ *		Documentation/RCU
  */
-
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/rcupdate.h>
-#include <linux/interrupt.h>
-#include <linux/sched.h>
-#include <linux/module.h>
-#include <linux/completion.h>
 #include <linux/moduleparam.h>
+#include <linux/completion.h>
+#include <linux/interrupt.h>
 #include <linux/notifier.h>
-#include <linux/cpu.h>
+#include <linux/rcupdate.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/mutex.h>
+#include <linux/sched.h>
+#include <linux/types.h>
+#include <linux/init.h>
 #include <linux/time.h>
+#include <linux/cpu.h>
 
 /* Global control variables for rcupdate callback mechanism. */
 struct rcu_ctrlblk {
@@ -46,14 +45,13 @@ struct rcu_ctrlblk {
 
 /* Definition for rcupdate control block. */
 static struct rcu_ctrlblk rcu_ctrlblk = {
-	.rcucblist = NULL,
-	.donetail = &rcu_ctrlblk.rcucblist,
-	.curtail = &rcu_ctrlblk.rcucblist,
+	.donetail	= &rcu_ctrlblk.rcucblist,
+	.curtail	= &rcu_ctrlblk.rcucblist,
 };
+
 static struct rcu_ctrlblk rcu_bh_ctrlblk = {
-	.rcucblist = NULL,
-	.donetail = &rcu_bh_ctrlblk.rcucblist,
-	.curtail = &rcu_bh_ctrlblk.rcucblist,
+	.donetail	= &rcu_bh_ctrlblk.rcucblist,
+	.curtail	= &rcu_bh_ctrlblk.rcucblist,
 };
 
 #ifdef CONFIG_NO_HZ
@@ -84,8 +82,8 @@ void rcu_exit_nohz(void)
 
 /*
  * Helper function for rcu_qsctr_inc() and rcu_bh_qsctr_inc().
- * Also disable irqs to avoid confusion due to interrupt handlers invoking
- * call_rcu().
+ * Also disable irqs to avoid confusion due to interrupt handlers
+ * invoking call_rcu().
  */
 static int rcu_qsctr_help(struct rcu_ctrlblk *rcp)
 {
@@ -99,6 +97,7 @@ static int rcu_qsctr_help(struct rcu_ctrlblk *rcp)
 		return 1;
 	}
 	local_irq_restore(flags);
+
 	return 0;
 }
 
@@ -143,8 +142,8 @@ void rcu_check_callbacks(int cpu, int user)
  */
 static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
 {
-	unsigned long flags;
 	struct rcu_head *next, *list;
+	unsigned long flags;
 
 	/* If no RCU callbacks ready to invoke, just return. */
 	if (&rcp->rcucblist == rcp->donetail)
@@ -182,8 +181,7 @@ static void rcu_process_callbacks(struct softirq_action *unused)
  * Null function to handle CPU being onlined.  Longer term, we want to
  * make TINY_RCU avoid using rcupdate.c, but later...
  */
-int rcu_cpu_notify(struct notifier_block *self,
-		   unsigned long action, void *hcpu)
+int rcu_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu)
 {
 	return NOTIFY_OK;
 }
@@ -223,6 +221,7 @@ static void __call_rcu(struct rcu_head *head,
 
 	head->func = func;
 	head->next = NULL;
+
 	local_irq_save(flags);
 	*rcp->curtail = head;
 	rcp->curtail = &head->next;
@@ -234,8 +233,7 @@ static void __call_rcu(struct rcu_head *head,
  * period.  But since we have but one CPU, that would be after any
  * quiescent state.
  */
-void call_rcu(struct rcu_head *head,
-	      void (*func)(struct rcu_head *rcu))
+void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
 {
 	__call_rcu(head, func, &rcu_ctrlblk);
 }
@@ -245,8 +243,7 @@ EXPORT_SYMBOL_GPL(call_rcu);
  * Post an RCU bottom-half callback to be invoked after any subsequent
  * quiescent state.
  */
-void call_rcu_bh(struct rcu_head *head,
-		 void (*func)(struct rcu_head *rcu))
+void call_rcu_bh(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
 {
 	__call_rcu(head, func, &rcu_bh_ctrlblk);
 }

commit 0b9e31e9264f1bad89856afb96da1688292f13b4
Merge: cf82ff7ea769 964fe080d94d
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Oct 25 17:30:53 2009 +0100

    Merge branch 'linus' into sched/core
    
    Conflicts:
            fs/proc/array.c
    
    Merge reason: resolve conflict and queue up dependent patch.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --cc fs/proc/array.c
index 762aea9c9c71,07f77a7945c3..e209f64ab27b
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@@ -321,16 -322,94 +322,104 @@@ static inline void task_context_switch_
  			p->nivcsw);
  }
  
+ #ifdef CONFIG_MMU
+ 
+ struct stack_stats {
+ 	struct vm_area_struct *vma;
+ 	unsigned long	startpage;
+ 	unsigned long	usage;
+ };
+ 
+ static int stack_usage_pte_range(pmd_t *pmd, unsigned long addr,
+ 				unsigned long end, struct mm_walk *walk)
+ {
+ 	struct stack_stats *ss = walk->private;
+ 	struct vm_area_struct *vma = ss->vma;
+ 	pte_t *pte, ptent;
+ 	spinlock_t *ptl;
+ 	int ret = 0;
+ 
+ 	pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
+ 	for (; addr != end; pte++, addr += PAGE_SIZE) {
+ 		ptent = *pte;
+ 
+ #ifdef CONFIG_STACK_GROWSUP
+ 		if (pte_present(ptent) || is_swap_pte(ptent))
+ 			ss->usage = addr - ss->startpage + PAGE_SIZE;
+ #else
+ 		if (pte_present(ptent) || is_swap_pte(ptent)) {
+ 			ss->usage = ss->startpage - addr + PAGE_SIZE;
+ 			pte++;
+ 			ret = 1;
+ 			break;
+ 		}
+ #endif
+ 	}
+ 	pte_unmap_unlock(pte - 1, ptl);
+ 	cond_resched();
+ 	return ret;
+ }
+ 
+ static inline unsigned long get_stack_usage_in_bytes(struct vm_area_struct *vma,
+ 				struct task_struct *task)
+ {
+ 	struct stack_stats ss;
+ 	struct mm_walk stack_walk = {
+ 		.pmd_entry = stack_usage_pte_range,
+ 		.mm = vma->vm_mm,
+ 		.private = &ss,
+ 	};
+ 
+ 	if (!vma->vm_mm || is_vm_hugetlb_page(vma))
+ 		return 0;
+ 
+ 	ss.vma = vma;
+ 	ss.startpage = task->stack_start & PAGE_MASK;
+ 	ss.usage = 0;
+ 
+ #ifdef CONFIG_STACK_GROWSUP
+ 	walk_page_range(KSTK_ESP(task) & PAGE_MASK, vma->vm_end,
+ 		&stack_walk);
+ #else
+ 	walk_page_range(vma->vm_start, (KSTK_ESP(task) & PAGE_MASK) + PAGE_SIZE,
+ 		&stack_walk);
+ #endif
+ 	return ss.usage;
+ }
+ 
+ static inline void task_show_stack_usage(struct seq_file *m,
+ 						struct task_struct *task)
+ {
+ 	struct vm_area_struct	*vma;
+ 	struct mm_struct	*mm = get_task_mm(task);
+ 
+ 	if (mm) {
+ 		down_read(&mm->mmap_sem);
+ 		vma = find_vma(mm, task->stack_start);
+ 		if (vma)
+ 			seq_printf(m, "Stack usage:\t%lu kB\n",
+ 				get_stack_usage_in_bytes(vma, task) >> 10);
+ 
+ 		up_read(&mm->mmap_sem);
+ 		mmput(mm);
+ 	}
+ }
+ #else
+ static void task_show_stack_usage(struct seq_file *m, struct task_struct *task)
+ {
+ }
+ #endif		/* CONFIG_MMU */
+ 
 +static void task_cpus_allowed(struct seq_file *m, struct task_struct *task)
 +{
 +	seq_printf(m, "Cpus_allowed:\t");
 +	seq_cpumask(m, &task->cpus_allowed);
 +	seq_printf(m, "\n");
 +	seq_printf(m, "Cpus_allowed_list:\t");
 +	seq_cpumask_list(m, &task->cpus_allowed);
 +	seq_printf(m, "\n");
 +}
 +
  int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
  			struct pid *pid, struct task_struct *task)
  {

commit 43315956509ca6913764861ac7dec128b91eb1ec
Merge: 9bf4e7fba800 6beba7adbe09
Author: Ingo Molnar <mingo@elte.hu>
Date:   Fri Oct 23 08:23:20 2009 +0200

    Merge branch 'perf/core' into perf/probes
    
    Conflicts:
            tools/perf/Makefile
    
    Merge reason:
    
     - fix the conflict
     - pick up the pr_*() infrastructure to queue up dependent patch
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --cc tools/perf/Makefile
index 1811a7015f9c,0a40c29b2387..147e3cf035d3
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@@ -328,9 -335,26 +335,27 @@@ LIB_FILE=libperf.
  LIB_H += ../../include/linux/perf_event.h
  LIB_H += ../../include/linux/rbtree.h
  LIB_H += ../../include/linux/list.h
 +LIB_H += ../../include/linux/stringify.h
+ LIB_H += util/include/linux/bitmap.h
+ LIB_H += util/include/linux/bitops.h
+ LIB_H += util/include/linux/compiler.h
+ LIB_H += util/include/linux/ctype.h
+ LIB_H += util/include/linux/kernel.h
  LIB_H += util/include/linux/list.h
+ LIB_H += util/include/linux/module.h
+ LIB_H += util/include/linux/poison.h
+ LIB_H += util/include/linux/prefetch.h
+ LIB_H += util/include/linux/rbtree.h
+ LIB_H += util/include/linux/string.h
+ LIB_H += util/include/linux/types.h
+ LIB_H += util/include/asm/asm-offsets.h
+ LIB_H += util/include/asm/bitops.h
+ LIB_H += util/include/asm/byteorder.h
+ LIB_H += util/include/asm/swab.h
+ LIB_H += util/include/asm/system.h
+ LIB_H += util/include/asm/uaccess.h
  LIB_H += perf.h
+ LIB_H += util/event.h
  LIB_H += util/types.h
  LIB_H += util/levenshtein.h
  LIB_H += util/parse-options.h
@@@ -424,19 -455,14 +457,23 @@@ ifeq ($(uname_S),Darwin
  	PTHREAD_LIBS =
  endif
  
+ ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
+ 	msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
+ endif
+ 
  ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
- 	msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]);
+ 	msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel);
  endif
  
 +ifneq ($(shell sh -c "(echo '\#include <libdwarf/dwarf.h>'; echo '\#include <libdwarf/libdwarf.h>'; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; Dwarf_Ranges *rng; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); dwarf_get_ranges(dbg, 0, &rng, 0, 0, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -ldwarf -lelf -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
 +	msg := $(warning No libdwarf.h found or old libdwarf.h found, disables dwarf support. Please install libdwarf-dev/libdwarf-devel >= 20081231);
 +	BASIC_CFLAGS += -DNO_LIBDWARF
 +else
 +	EXTLIBS += -lelf -ldwarf
 +	LIB_H += util/probe-finder.h
 +	LIB_OBJS += util/probe-finder.o
 +endif
 +
  ifdef NO_DEMANGLE
  	BASIC_CFLAGS += -DNO_DEMANGLE
  else

commit 9bf4e7fba8006d19846fec877b6da0616b2772de
Author: Ingo Molnar <mingo@elte.hu>
Date:   Wed Oct 21 14:39:51 2009 +0200

    x86, instruction decoder: Fix test_get_len build rules
    
    Add the kernel source include file as well to the include files
    search path, to fix this build bug:
    
     In file included from arch/x86/tools/test_get_len.c:28:
       arch/x86/lib/insn.c:21:26: error: linux/string.h: No such file or directory
    
    Cc: Masami Hiramatsu <mhiramat@redhat.com>
    Cc: systemtap<systemtap@sources.redhat.com>
    Cc: DLE <dle-develop@lists.sourceforge.net>
    Cc: Jim Keniston <jkenisto@us.ibm.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    LKML-Reference: <20091020165531.4145.21872.stgit@dhcp-100-2-132.bos.redhat.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/tools/Makefile b/arch/x86/tools/Makefile
index 1bd006c81564..5e295d95dc25 100644
--- a/arch/x86/tools/Makefile
+++ b/arch/x86/tools/Makefile
@@ -8,8 +8,8 @@ posttest: $(obj)/test_get_len vmlinux
 hostprogs-y	:= test_get_len
 
 # -I needed for generated C source and C source which in the kernel tree.
-HOSTCFLAGS_test_get_len.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/
+HOSTCFLAGS_test_get_len.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/
 
-# Dependancies are also needed.
+# Dependencies are also needed.
 $(obj)/test_get_len.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c
 

commit c258449bc9d286e2ee6546c9cdf911e96cbc126a
Merge: 79b9ad361be8 2e600d01c131
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Oct 20 07:51:41 2009 +0200

    Merge branch 'perf/urgent' into perf/core
    
    Merge reason: Queue up dependent patch.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

commit dd86e72abdbc4b436471af5a97927c6145f5298c
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Oct 19 13:33:03 2009 +0200

    perf stat: Count branches first
    
    Count branches first, cache-misses second. The reason is that
    on x86 branches are not counted by all counters on all CPUs.
    
    Before:
    
     Performance counter stats for 'ls':
    
           0.756653  task-clock-msecs         #      0.802 CPUs
                  0  context-switches         #      0.000 M/sec
                  0  CPU-migrations           #      0.000 M/sec
                250  page-faults              #      0.330 M/sec
            2375725  cycles                   #   3139.781 M/sec
            1628129  instructions             #      0.685 IPC
              19643  cache-references         #     25.960 M/sec
               4608  cache-misses             #      6.090 M/sec
             342532  branches                 #    452.694 M/sec
      <not counted>  branch-misses
    
        0.000943356  seconds time elapsed
    
    After:
    
     Performance counter stats for 'ls':
    
           1.056734  task-clock-msecs         #      0.859 CPUs
                  0  context-switches         #      0.000 M/sec
                  0  CPU-migrations           #      0.000 M/sec
                259  page-faults              #      0.245 M/sec
            3345932  cycles                   #   3166.295 M/sec
            3074090  instructions             #      0.919 IPC
             616928  branches                 #    583.806 M/sec
              39279  branch-misses            #      6.367 %
              21312  cache-references         #     20.168 M/sec
               3661  cache-misses             #      3.464 M/sec
    
        0.001230551  seconds time elapsed
    
    (also prettify the printout of branch misses, in case it's
     getting scaled.)
    
    Cc: Tim Blechmann <tim@klingt.org>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    LKML-Reference: <4ADC3975.8050109@klingt.org>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    ---
     tools/perf/builtin-stat.c |    2 ++
     1 files changed, 2 insertions(+), 0 deletions(-)
    
    diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
    index c373683..95a55ea 100644
    --- a/tools/perf/builtin-stat.c
    +++ b/tools/perf/builtin-stat.c
    @@ -59,6 +59,8 @@ static struct perf_event_attr default_attrs[] = {
       { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS   },
       { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES},
       { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES   },
    +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS},
    +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_MISSES  },
    
     };
    ---
     tools/perf/builtin-stat.c |   20 ++++++++++----------
     1 files changed, 10 insertions(+), 10 deletions(-)
    
    diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
    index 95a55ea..90e0a26 100644
    --- a/tools/perf/builtin-stat.c
    +++ b/tools/perf/builtin-stat.c
    @@ -50,17 +50,17 @@
    
     static struct perf_event_attr default_attrs[] = {
    
    -  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_TASK_CLOCK     },
    -  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CONTEXT_SWITCHES},
    -  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CPU_MIGRATIONS },
    -  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_PAGE_FAULTS    },
    -
    -  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CPU_CYCLES     },
    -  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS   },
    -  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES},
    -  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES   },
    -  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS},
    -  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_MISSES  },
    +  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_TASK_CLOCK             },
    +  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CONTEXT_SWITCHES       },
    +  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CPU_MIGRATIONS         },
    +  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_PAGE_FAULTS            },
    +
    +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CPU_CYCLES             },
    +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS           },
    +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES       },
    +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES           },
    +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS    },
    +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_MISSES          },
    
     };

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 90e0a268343d..c6df3770b87e 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -57,10 +57,10 @@ static struct perf_event_attr default_attrs[] = {
 
   { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CPU_CYCLES		},
   { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS		},
-  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES	},
-  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES		},
   { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS	},
   { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_MISSES		},
+  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES	},
+  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES		},
 
 };
 
@@ -363,7 +363,7 @@ static void abs_printout(int counter, double avg)
 		if (total)
 			ratio = avg * 100 / total;
 
-		fprintf(stderr, " # %10.3f %%  ", ratio);
+		fprintf(stderr, " # %10.3f %%    ", ratio);
 
 	} else {
 		total = avg_stats(&runtime_nsecs_stats);

commit 56aab464ff6232bcc2f53b26576983dc83f75db7
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Oct 19 13:27:08 2009 +0200

    perf stat: Re-align the default_attrs[] array
    
    Clean up the array definition to be vertically aligned.
    
    No functional effects.
    
    Cc: Tim Blechmann <tim@klingt.org>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    LKML-Reference: <4ADC3975.8050109@klingt.org>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    ---
     tools/perf/builtin-stat.c |    2 ++
     1 files changed, 2 insertions(+), 0 deletions(-)
    
    diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
    index c373683..95a55ea 100644
    --- a/tools/perf/builtin-stat.c
    +++ b/tools/perf/builtin-stat.c
    @@ -59,6 +59,8 @@ static struct perf_event_attr default_attrs[] = {
       { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS   },
       { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES},
       { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES   },
    +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS},
    +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_MISSES  },
    
     };

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 95a55eaf72f5..90e0a268343d 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -50,17 +50,17 @@
 
 static struct perf_event_attr default_attrs[] = {
 
-  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_TASK_CLOCK	},
-  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CONTEXT_SWITCHES},
-  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CPU_MIGRATIONS	},
-  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_PAGE_FAULTS	},
-
-  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CPU_CYCLES	},
-  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS	},
-  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES},
-  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES	},
-  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS},
-  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_MISSES	},
+  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_TASK_CLOCK		},
+  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CONTEXT_SWITCHES	},
+  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CPU_MIGRATIONS		},
+  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_PAGE_FAULTS		},
+
+  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CPU_CYCLES		},
+  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS		},
+  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES	},
+  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES		},
+  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS	},
+  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_MISSES		},
 
 };