]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agoMerge branch 'numa/core'
Ingo Molnar [Thu, 18 Oct 2012 09:52:59 +0000 (11:52 +0200)]
Merge branch 'numa/core'

11 years agonuma: Fix task_work() double add
Ingo Molnar [Mon, 15 Oct 2012 05:46:28 +0000 (07:46 +0200)]
numa: Fix task_work() double add

task_work() must not be double added - it can result in an infinite
loop in run_task_work().

So separate out p->numa_work and signal an 'empty' work callback with
numa_work->next == &numa_work. (NULL cannot be used as the task work
code uses it.)

It would be handy if kerne/task_work.c had something like this in
run_task_work():

if (WARN_ON_ONCE(work->next == work))
break;

As it took some time to figure out why it was sporadically hanging.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Rik van Riel <riel@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Link: http://lkml.kernel.org/n/tip-gT2keodfehhzwmx0appafeUy@git.kernel.org
11 years agoMerge branch 'sched/urgent'
Ingo Molnar [Thu, 18 Oct 2012 06:05:52 +0000 (08:05 +0200)]
Merge branch 'sched/urgent'

11 years agoMerge branch 'numa/core'
Ingo Molnar [Thu, 18 Oct 2012 06:05:48 +0000 (08:05 +0200)]
Merge branch 'numa/core'

11 years agosched: Add WAKEUP_PREEMPTION feature flag, on by default
Ingo Molnar [Sun, 14 Oct 2012 12:28:50 +0000 (14:28 +0200)]
sched: Add WAKEUP_PREEMPTION feature flag, on by default

As per the recent discussion with Mike and Linus, make it easier to
test with/without this feature. No change in default behavior.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/n/tip-izoxq4haeg4mTognnDbwcevt@git.kernel.org
11 years agosched/numa/mm: Further clean up migrate_misplaced_page()
Ingo Molnar [Mon, 15 Oct 2012 09:10:38 +0000 (11:10 +0200)]
sched/numa/mm: Further clean up migrate_misplaced_page()

The 'mm' parameter is not used anymore, get rid of it.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-rwqEijuwdsgpooxrce9kniG8@git.kernel.org
11 years agosched/numa/mm: Fix and further simplify fault accounting
Peter Zijlstra [Sun, 14 Oct 2012 19:30:07 +0000 (21:30 +0200)]
sched/numa/mm: Fix and further simplify fault accounting

The THP alloc failure path did double accounting .. fix this.

While we're at it, merge task_numa_placement() into task_numa_fault()
so that there's only a single call from the fault path.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-hz6rnixgr665fv0offesjofb@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agosched/numa/mm: Improve migration
Peter Zijlstra [Fri, 12 Oct 2012 17:30:14 +0000 (19:30 +0200)]
sched/numa/mm: Improve migration

Add THP migration. Extend task_numa_fault() to absorb THP faults.

[ Would be nice if the gents on Cc: expressed their opinion about
  this change. A missing detail might be cgroup page accounting,
  plus the fact that some architectures might cache PMD_NONE pmds
  in their TLBs, needing some extra TLB magic beyond what we already
  do here? ]

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/n/tip-yv9vbiz2s455zxq1ffzx3fye@git.kernel.org
[ Significant fixes ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agosched/numa/mm: Avoid pointless TLB invalidation from page-migration
Peter Zijlstra [Thu, 11 Oct 2012 15:42:06 +0000 (17:42 +0200)]
sched/numa/mm: Avoid pointless TLB invalidation from page-migration

When we do migrate-on-fault we faulted on a PROT_NONE entry, this is
a !present entry, we then replace this with a regular entry and then
proceed with page-migration.

Page-migration in turn replaces the now valid entry with a
migration-PTE (which is again !present) which requires a TLB
invalidate.

Instead, leave the PROT_NONE entry in-place when we need to migrate
such that the PROT_NONE -> migration-PTE transition is a !preset ->
!preset transition and doesn't require a TLB invalidate.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-h1utred3dhv2ausjg1wqwuym@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agosched/numa: More NUMA_PULL_BIAS fixes
Peter Zijlstra [Thu, 11 Oct 2012 11:06:22 +0000 (13:06 +0200)]
sched/numa: More NUMA_PULL_BIAS fixes

Consider the simple case where 2 runnable tasks, each with a preferred
node (not the same), each running on the wrong node. Weight wise, this
is a well balanced situation and thus the load-balancer will not find
anything to do and is content.

NUMA_PULL_BIAS is the 'force' introduced to break this situation and
promote task movement despite the weight balance so that we might find
the situation where each task runs on its preferred node.

It was (again) observed that this force was too strong and created
undue task movement. In particular, suppose the two runnable tasks
each having the same preferred node, the weight balance will then move
one of them to the other node. This results in one task running on the
right node and one on the wrong node.

NUMA_PULL_BIAS would in this case try and move the off-node task back
to its home-node in order to promote better node-preference. This is
clearly sub-optimal since either we end up moving that same task back,
or worse, we'll move the other task to the now empty node.

This results in endless undue task movement.

Solve this by limiting the NUMA_PULL_BIAS to only allow moving an
offnode task to its home-node when the home-node has either another
offnode task or an non-numa task to trade back for it.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-2sz5f6n058jxkvuwmupjpv7x@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agosched/numa: Make the sampling period adaptive
Peter Zijlstra [Wed, 10 Oct 2012 17:41:42 +0000 (19:41 +0200)]
sched/numa: Make the sampling period adaptive

The normal sampling rate can slow down once a task settles down.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-t5oi4uiv39cd9ffjovp7kun8@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agosched/numa: Simplify task_numa_fault()
Peter Zijlstra [Wed, 10 Oct 2012 12:13:15 +0000 (14:13 +0200)]
sched/numa: Simplify task_numa_fault()

Also fix numa_scan_seq off by one.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-dvswxo34oaiibm06zyvrv0q5@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoMerge branch 'sched/urgent' into sched/numa
Ingo Molnar [Mon, 15 Oct 2012 10:28:43 +0000 (12:28 +0200)]
Merge branch 'sched/urgent' into sched/numa

Merge fixes before applying more changes.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoMerge branch 'sched/numa'
Ingo Molnar [Fri, 12 Oct 2012 10:19:38 +0000 (12:19 +0200)]
Merge branch 'sched/numa'

11 years agosched/numa: Describe the NUMA scheduling problem formally
Ingo Molnar [Fri, 12 Oct 2012 10:13:10 +0000 (12:13 +0200)]
sched/numa: Describe the NUMA scheduling problem formally

This is probably a first: formal description of a complex high-level
computing problem, within the kernel source.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Mike Galbraith <efault@gmx.de>
Rik van Riel <riel@redhat.com>
Link: http://lkml.kernel.org/n/tip-mmnlpupoetcatimvjEld16Pb@git.kernel.org
[ Next step: generate the kernel source from such formal descriptions and retire to a tropical island! ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoMerge branch 'sched/numa'
Ingo Molnar [Fri, 12 Oct 2012 10:07:33 +0000 (12:07 +0200)]
Merge branch 'sched/numa'

11 years agosched/numa: Make CONFIG_SCHED_NUMA configurable
Peter Zijlstra [Wed, 10 Oct 2012 17:01:34 +0000 (19:01 +0200)]
sched/numa: Make CONFIG_SCHED_NUMA configurable

Opt in to this new NUMA scheduling feature, because it does not cure cancer.

Requested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/n/tip-4v9ni51gu9c9a6o4hdhv5ecj@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agosched/numa: Implement migration throttle
Peter Zijlstra [Tue, 9 Oct 2012 12:09:50 +0000 (14:09 +0200)]
sched/numa: Implement migration throttle

Since our memory migration requires 2 scans/samples to stabilize,
don't migrate faster than that.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-jye7o9wfton73dra5r9hobft@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agosched/numa: Add fault driven placement policy
Peter Zijlstra [Tue, 9 Oct 2012 11:46:22 +0000 (13:46 +0200)]
sched/numa: Add fault driven placement policy

As per the problem/design document Documentation/scheduler/numa-problem.txt
implement 3ac & 4.

A pure 3a was found too unstable, I did briefly try 3bc
but found no significant improvement. We could add a NUMA_FREQ knob
if people want to play further -- but for now implement the simplest
form.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/n/tip-gzh3q3dzud3lvu6zmf7do0wu@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agosched/numa: Remove small mode
Peter Zijlstra [Tue, 9 Oct 2012 11:19:50 +0000 (13:19 +0200)]
sched/numa: Remove small mode

Now that the 'big' mode is more or less working, remove the small
mode. There's still the periodic scan cost I don't like, but Rik's
suggestion of adapting the scan period (growing it for stable tasks)
should take care of most of that (not implemented yet).

For now, start by removing 'small' mode to clear out/simplify things.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-enkx0maspx8z7mk8cx1m15jr@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agosched/numa: Don't consider numa-hot for idle balance
Peter Zijlstra [Fri, 5 Oct 2012 13:57:54 +0000 (15:57 +0200)]
sched/numa: Don't consider numa-hot for idle balance

Reducing idle time is far more important than keeping numa tasks on
their preferred node.

The fact that NEW_IDLE balance doesn't increase nr_balance_failed only
makes it worse.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-3pzp0o6gemhb8t7fj8shscpo@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agosched/numa: Fix NUMA_PULL_BIAS
Peter Zijlstra [Fri, 5 Oct 2012 13:57:54 +0000 (15:57 +0200)]
sched/numa: Fix NUMA_PULL_BIAS

PULL_BIAS is broken, the intent was to only attempt a small bias when
the machine was otherwise balanced, hence the out_balanced label.

The problem is that a number of branches that decide we're completely
unbalanced also jump to the out_balanced label, causing undue numa
bias. The end result was that an unbalanced system of 8:1 would try
and move the 1 task towards the 8.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-3pzp0o6gemhb8t7fj8shscpo@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agosched/numa: Introduce alternative wakeup bias
Peter Zijlstra [Fri, 5 Oct 2012 13:57:54 +0000 (15:57 +0200)]
sched/numa: Introduce alternative wakeup bias

Rename NUMA_BIAS to NUMA_TTWU_BIAS to clarify what it does.

Also, disable by default, it seems too agressive. Also provide an
alternative to play with, instead of altering the prev cpu, alter
the waking cpu, maybe that's less agressive.

No clear data either way for the moment.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-q93t6n7j1jaz36yh056msb5d@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agomm: Only flush the TLB when clearing an accessible pte
Rik van Riel [Tue, 9 Oct 2012 13:31:59 +0000 (15:31 +0200)]
mm: Only flush the TLB when clearing an accessible pte

If ptep_clear_flush() is called to clear a page table entry that is
accessible anyway by the CPU, eg. a _PAGE_PROTNONE page table entry,
there is no need to flush the TLB on remote CPUs.

Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/n/tip-vm3rkzevahelwhejx5uwm8ex@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agox86/mm: Reduce tlb flushes from ptep_set_access_flags()
Rik van Riel [Tue, 9 Oct 2012 13:31:34 +0000 (15:31 +0200)]
x86/mm: Reduce tlb flushes from ptep_set_access_flags()

If ptep_set_access_flags() is invoked to upgrade access permissions
on a PTE, there is no security or data integrity reason to do a
remote TLB flush.

Lazily letting another CPU incur a spurious page fault occasionally
is (much!) cheaper than aggressively flushing everybody else's TLB.

Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-zb7fqnz7byn1xmaei148pl6n@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agox86/mm: Introduce pte_accessible()
Rik van Riel [Tue, 9 Oct 2012 13:31:12 +0000 (15:31 +0200)]
x86/mm: Introduce pte_accessible()

We need pte_present to return true for _PAGE_PROTNONE pages, to indicate that
the pte is associated with a page.

However, for TLB flushing purposes, we would like to know whether the pte
points to an actually accessible page.  This allows us to skip remote TLB
flushes for pages that are not actually accessible.

Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-66p11te4uj23gevgh4j987ip@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoMerge branch 'linus' into sched/numa
Ingo Molnar [Fri, 12 Oct 2012 10:04:37 +0000 (12:04 +0200)]
Merge branch 'linus' into sched/numa

Pick up sched/core changes that went upstream, before
applying more scheduler patches.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoMerge branch 'core/rcu'
Ingo Molnar [Fri, 12 Oct 2012 07:39:50 +0000 (09:39 +0200)]
Merge branch 'core/rcu'

11 years agoMerge branch 'rcu/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck...
Ingo Molnar [Fri, 12 Oct 2012 07:39:08 +0000 (09:39 +0200)]
Merge branch 'rcu/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/rcu

Pull RCU fixes from Paul E. McKenney.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agorcu: Advise most users not to enable RCU user mode
Frederic Weisbecker [Wed, 10 Oct 2012 23:48:28 +0000 (01:48 +0200)]
rcu: Advise most users not to enable RCU user mode

Discourage distros from enabling CONFIG_RCU_USER_QS
because it brings overhead for no benefits yet.

It's not a useful feature on its own until we can
fully run an adaptive tickless kernel.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
11 years agoMerge branch 'core/urgent'
Ingo Molnar [Wed, 10 Oct 2012 16:02:30 +0000 (18:02 +0200)]
Merge branch 'core/urgent'

11 years agonohz: Fix idle ticks in cpu summary line of /proc/stat
Michal Hocko [Wed, 10 Oct 2012 06:21:09 +0000 (11:51 +0530)]
nohz: Fix idle ticks in cpu summary line of /proc/stat

Git commit 09a1d34f8535ecf9 "nohz: Make idle/iowait counter update
conditional" introduced a bug in regard to cpu hotplug. The effect is
that the number of idle ticks in the cpu summary line in /proc/stat is
still counting ticks for offline cpus.

Reproduction is easy, just start a workload that keeps all cpus busy,
switch off one or more cpus and then watch the idle field in top.
On a dual-core with one cpu 100% busy and one offline cpu you will get
something like this:

%Cpu(s): 48.7 us,  1.3 sy,  0.0 ni, 50.0 id,  0.0 wa,  0.0 hi,  0.0 si,
%0.0 st

The problem is that an offline cpu still has ts->idle_active == 1.
To fix this we should make sure that the cpu is online when calling
get_cpu_idle_time_us and get_cpu_iowait_time_us.

[Srivatsa: Rebased to current mainline]

Reported-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20121010061820.8999.57245.stgit@srivatsabhat.in.ibm.com
Cc: deepthi@linux.vnet.ibm.com
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
11 years agoMerge branch 'timers/core'
Ingo Molnar [Wed, 10 Oct 2012 08:23:31 +0000 (10:23 +0200)]
Merge branch 'timers/core'

11 years agotimekeeping: Cast raw_interval to u64 to avoid shift overflow
Dan Carpenter [Tue, 9 Oct 2012 07:18:23 +0000 (10:18 +0300)]
timekeeping: Cast raw_interval to u64 to avoid shift overflow

We fixed a bunch of integer overflows in timekeeping code during the 3.6
cycle.  I did an audit based on that and found this potential overflow.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: John Stultz <johnstul@us.ibm.com>
Link: http://lkml.kernel.org/r/20121009071823.GA19159@elgon.mountain
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
11 years agotimers: Fix endless looping between cascade() and internal_add_timer()
Hildner, Christian [Mon, 8 Oct 2012 13:49:03 +0000 (15:49 +0200)]
timers: Fix endless looping between cascade() and internal_add_timer()

Adding two (or more) timers with large values for "expires" (they have
to reside within tv5 in the same list) leads to endless looping
between cascade() and internal_add_timer() in case CONFIG_BASE_SMALL
is one and jiffies are crossing the value 1 << 18. The bug was
introduced between 2.6.11 and 2.6.12 (and survived for quite some
time).

This patch ensures that when cascade() is called timers within tv5 are
not added endlessly to their own list again, instead they are added to
the next lower tv level tv4 (as expected).

Signed-off-by: Christian Hildner <christian.hildner@siemens.com>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Link: http://lkml.kernel.org/r/98673C87CB31274881CFFE0B65ECC87B0F5FC1963E@DEFTHW99EA4MSX.ww902.siemens.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
11 years agoMerge branch 'fortglx/3.7/time' of git://git.linaro.org/people/jstultz/linux into...
Thomas Gleixner [Tue, 9 Oct 2012 19:20:05 +0000 (21:20 +0200)]
Merge branch 'fortglx/3.7/time' of git://git.linaro.org/people/jstultz/linux into timers/core

11 years agoMerge branch 'perf/core'
Ingo Molnar [Tue, 9 Oct 2012 13:34:24 +0000 (15:34 +0200)]
Merge branch 'perf/core'

11 years agoMerge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git...
Ingo Molnar [Tue, 9 Oct 2012 13:31:17 +0000 (15:31 +0200)]
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

 * Handle PERF_RECORD_EXIT events in sched and annotate.

 * struct machine refactorings to help in top and trace.

 * Add on_exit implementation for systems without one, e.g. Android, from
   Bernhard Rosenkraenzer.

 * Only process events for vcpus of interest, helps handling large number
   of events, from David Ahern.

 * Cross compilation fixes for Android, from Irina Tirdea.

 * Add documentation on compiling for Android, from Irina Tirdea.

 * perf diff improvements from Jiri Olsa.

 * Target (task/user/cpu/syswide) handling improvements, from Namhyung Kim.

 * Add support in 'trace' for tracing workload given by command line, from
   Namhyung Kim.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoDocumentation: add documentation on compiling for Android
Irina Tirdea [Mon, 8 Oct 2012 06:43:28 +0000 (09:43 +0300)]
Documentation: add documentation on compiling for Android

Add documentation for cross-compiling on Android including:

() instructions on how to set the Android NDK environment
() how to cross-compile perf for Android
() how to install on an Android device/emulator, set the runtime
environment and run it

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1349678613-7045-4-git-send-email-irina.tirdea@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf tools: Update Makefile for Android
Irina Tirdea [Mon, 8 Oct 2012 06:43:27 +0000 (09:43 +0300)]
perf tools: Update Makefile for Android

For cross-compiling on Android, some specific changes are needed in
the Makefile.

Update the Makefile to support cross-compiling for Android.
The original ideea for this was send by Bernhard Rosenkraenzer in
https://lkml.org/lkml/2012/8/23/316, but this is a rewrite.

Changes:
() support bionic in addition to glibc
() remove rt and pthread libraries that do not exist in Android
() use $(CFLAGS) when detecting initial compiler flags. This is needed
when setting CFLAGS as an argument of make (e.g. for setting --sysroot).
() include perf's local directory when building for Android to be able to find
relative paths if using --sysroot (e.g.: ../../include/linux/perf_event.h)

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Cc: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1349678613-7045-3-git-send-email-irina.tirdea@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf tools: Add on_exit implementation
Bernhard Rosenkraenzer [Mon, 8 Oct 2012 06:43:26 +0000 (09:43 +0300)]
perf tools: Add on_exit implementation

on_exit() is only available in new versions of glibc.
It is not implemented in Bionic and will lead to linking errors when
compiling for Android.

Implement a wrapper for on_exit using atexit.

The implementation for on_exit is the one sent by Bernhard Rosenkraenzer in
https://lkml.org/lkml/2012/8/23/316. The configuration part from the Makefile
is different than the one from the original patch.

Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Irina Tirdea <irina.tirdea@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1349678613-7045-2-git-send-email-irina.tirdea@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf kvm: Add braces around multi-line statements
David Ahern [Mon, 8 Oct 2012 17:17:32 +0000 (11:17 -0600)]
perf kvm: Add braces around multi-line statements

Multi-line statements should have braces. Improves readability.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Dong Hao <haodong@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1349716656-48165-9-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf kvm: Total count is a u64, print as so
David Ahern [Mon, 8 Oct 2012 17:17:34 +0000 (11:17 -0600)]
perf kvm: Total count is a u64, print as so

remove cast and use proper type in format.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Dong Hao <haodong@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1349716656-48165-11-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf kvm: Remove typecast in init_kvm_event_record
David Ahern [Mon, 8 Oct 2012 17:17:30 +0000 (11:17 -0600)]
perf kvm: Remove typecast in init_kvm_event_record

Not needed after changing i to unsigned int.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Dong Hao <haodong@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1349716656-48165-7-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf kvm: Only process events for vcpus of interest
David Ahern [Mon, 8 Oct 2012 17:17:35 +0000 (11:17 -0600)]
perf kvm: Only process events for vcpus of interest

Minimizing processing overhead for each sample - which becomes important
for the upcoming live mode when it has to deal with 100+k events per
second.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Dong Hao <haodong@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1349716656-48165-12-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agorcu: Grace-period initialization excludes only RCU notifier
Paul E. McKenney [Sun, 7 Oct 2012 15:36:12 +0000 (08:36 -0700)]
rcu: Grace-period initialization excludes only RCU notifier

Kirill noted the following deadlock cycle on shutdown involving padata:

> With commit 755609a9087fa983f567dc5452b2fa7b089b591f I've got deadlock on
> poweroff.
>
> It guess it happens because of race for cpu_hotplug.lock:
>
>       CPU A                                   CPU B
> disable_nonboot_cpus()
> _cpu_down()
> cpu_hotplug_begin()
>  mutex_lock(&cpu_hotplug.lock);
> __cpu_notify()
> padata_cpu_callback()
> __padata_remove_cpu()
> padata_replace()
> synchronize_rcu()
>                                       rcu_gp_kthread()
>                                       get_online_cpus();
>                                       mutex_lock(&cpu_hotplug.lock);

It would of course be good to eliminate grace-period delays from
CPU-hotplug notifiers, but that is a separate issue.  Deadlock is
not an appropriate diagnostic for excessive CPU-hotplug latency.

Fortunately, grace-period initialization does not actually need to
exclude all of the CPU-hotplug operation, but rather only RCU's own
CPU_UP_PREPARE and CPU_DEAD CPU-hotplug notifiers.  This commit therefore
introduces a new per-rcu_state onoff_mutex that provides the required
concurrency control in place of the get_online_cpus() that was previously
in rcu_gp_init().

Reported-by: "Kirill A. Shutemov" <kirill@shutemov.name>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Kirill A. Shutemov <kirill@shutemov.name>
11 years agoperf tools: Remove duplicated include from trace-event-python.c
Wei Yongjun [Sun, 7 Oct 2012 14:09:12 +0000 (22:09 +0800)]
perf tools: Remove duplicated include from trace-event-python.c

Remove duplicated include.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Link: http://lkml.kernel.org/r/CAPgLHd8fz+TznMVRdhzPb45WtZQXhVxadRQcLxUC4O9aX+SUbA@mail.gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf machine: Carve up event processing specific from perf_tool
Arnaldo Carvalho de Melo [Sat, 6 Oct 2012 19:26:02 +0000 (16:26 -0300)]
perf machine: Carve up event processing specific from perf_tool

The perf_tool vtable expects methods that receive perf_tool and
perf_sample entries, but for tools not interested in doing any special
processing on non PERF_RECORD_SAMPLE events, like 'perf top', and for
those not using perf_session, like 'perf trace', they were using
perf_event__process passing tool and sample paramenters that were just
not used.

Provide 'machine' methods for this purpose and make the perf_event
ones use them.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-ot9cc6mt025o8kbngzckcrx9@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf sched: Handle PERF_RECORD_EXIT events
Arnaldo Carvalho de Melo [Sat, 6 Oct 2012 18:53:41 +0000 (15:53 -0300)]
perf sched: Handle PERF_RECORD_EXIT events

Noticed sched wasn't handling those events while introducing
perf_event__process_{fork,exit}.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-035rzjtnv9ri8sssi7ojjjq0@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf annotate: Handle PERF_RECORD_EXIT events
Arnaldo Carvalho de Melo [Sat, 6 Oct 2012 18:53:41 +0000 (15:53 -0300)]
perf annotate: Handle PERF_RECORD_EXIT events

Noticed annotate wasn't handling those events while introducing
perf_event__process_{fork,exit}.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-of7tc8eqeuk3cupc6f7jtuq6@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf event: No need to create a thread when handling PERF_RECORD_EXIT
Arnaldo Carvalho de Melo [Sat, 6 Oct 2012 18:44:59 +0000 (15:44 -0300)]
perf event: No need to create a thread when handling PERF_RECORD_EXIT

When we were processing a PERF_RECORD_EXIT event we first used
machine__findnew_thread for both the thread exiting and for its parent,
only to use just the thread struct associated with the one exiting, and
to just delete it.

If it existed, i.e. not created at this very moment in
machine__findnew_thread, it will be moved to the machine->dead_threads
linked list, because we may have hist_entries pointing to it, but if it
was created just do be deleted, it will just sit there with no
references at all.

Use the new machine__find_thread() method so that if it is not there, we
don't create it.

As a bonus the parent thread will also not be created at this point.

Create process_fork() and process_exit() helpers to use this and make
the builtins use it instead of the generic process_task(), ditched by
this patch.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-z7n2y98ebjyrvmytaope4vdl@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf machine: Introduce find_thread method
Arnaldo Carvalho de Melo [Sat, 6 Oct 2012 18:43:20 +0000 (15:43 -0300)]
perf machine: Introduce find_thread method

There are cases where we want just to find a thread if it exists
already, so provide a method for that.

While doing that start moving 'machine' methods to a separate file.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-8wpzqs9kfupng6xq8hx6lnxa@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf tools: Have the page size value available for all tools
Arnaldo Carvalho de Melo [Sat, 6 Oct 2012 17:57:10 +0000 (14:57 -0300)]
perf tools: Have the page size value available for all tools

Its such a common need that we might as well have a global with that
value.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-mwfqji9f17k5j81l1404dk3q@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoMerge branch 'x86/acpi'
Ingo Molnar [Sat, 6 Oct 2012 07:33:43 +0000 (09:33 +0200)]
Merge branch 'x86/acpi'

11 years agoX86 ACPI: Use #ifdef not #if for CONFIG_X86 check
Luck, Tony [Fri, 5 Oct 2012 22:05:34 +0000 (15:05 -0700)]
X86 ACPI: Use #ifdef not #if for CONFIG_X86 check

Fix a build warning on ia64:

include/linux/acpi.h:437:5: warning: "CONFIG_X86" is not defined

Signed-off-by: Tony Luck <tony.luck@intel.com>
Link: http://lkml.kernel.org/r/506f59ae9600b36a4@agluck-desktop.sc.intel.com
Cc: Len Brown <lenb@kernel.org>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
11 years agoperf diff: Display empty space for non paired samples
Jiri Olsa [Fri, 5 Oct 2012 14:44:47 +0000 (16:44 +0200)]
perf diff: Display empty space for non paired samples

Currently in 'Baseline' and 'Period Base' columns zero values are
displayed in case no pair is found for the sample. This might be
confusing, using empty space instead.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1349448287-18919-9-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf diff: Include samples without symbol in overall stats
Jiri Olsa [Fri, 5 Oct 2012 14:44:46 +0000 (16:44 +0200)]
perf diff: Include samples without symbol in overall stats

Currently we omit samples without symbols. This way we get different and
confusing numbers for samples than from report command.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1349448287-18919-8-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf diff: Add -F option to display formula for computation
Jiri Olsa [Fri, 5 Oct 2012 14:44:45 +0000 (16:44 +0200)]
perf diff: Add -F option to display formula for computation

Adding -F option to display the formula for specified computation.

This is mainly to facilitate debugging, but can be useful anyway.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1349448287-18919-7-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf diff: Add -p option to display period values for hist entries
Jiri Olsa [Fri, 5 Oct 2012 14:44:44 +0000 (16:44 +0200)]
perf diff: Add -p option to display period values for hist entries

Adding -p option to show period values for both compared hist entries.
Showing hist column PERF_HPP__PERIOD and newly added hist column
PERF_HPP__PERIOD_BASELINE.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1349448287-18919-6-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf diff: Add weighted diff computation way to compare hist entries
Jiri Olsa [Fri, 5 Oct 2012 14:44:43 +0000 (16:44 +0200)]
perf diff: Add weighted diff computation way to compare hist entries

Adding 'wdiff' as new computation way to compare hist entries.

If specified the 'Weighted diff' column is displayed with value 'd'
computed as:

   d = B->period * WEIGHT-A - A->period * WEIGHT-B

  - A/B being matching hist entry from first/second file specified
    (or perf.data/perf.data.old) respectively.
  - period being the hist entry period value
  - WEIGHT-A/WEIGHT-B being user suplied weights in the the '-c' option
    behind ':' separator like '-c wdiff:1,2'.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1349448287-18919-5-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf diff: Add option to sort entries based on diff computation
Jiri Olsa [Fri, 5 Oct 2012 14:44:42 +0000 (16:44 +0200)]
perf diff: Add option to sort entries based on diff computation

Adding support to sort hist entries based on the outcome of selected
computation. It's now possible to specify '+' as a first character of
'-c' option value to make such sort.

Example:

  $ perf diff -c ratio -b
  # Event 'cache-misses'
  #
  #   Baseline           Ratio      Shared Object                            Symbol
  #   ........  ..............  .................  ................................
  #
        19.64%            0.69  [kernel.kallsyms]  [k] clear_page
         0.30%            0.17  [kernel.kallsyms]  [k] mm_alloc
         0.04%            0.20  [kernel.kallsyms]  [k] kmem_cache_alloc

  $ perf diff -c +ratio -b
  # Event 'cache-misses'
  #
  #   Baseline           Ratio      Shared Object                            Symbol
  #   ........  ..............  .................  ................................
  #
        19.64%            0.69  [kernel.kallsyms]  [k] clear_page
         0.04%            0.20  [kernel.kallsyms]  [k] kmem_cache_alloc
         0.30%            0.17  [kernel.kallsyms]  [k] mm_alloc

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1349448287-18919-4-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf diff: Add ratio computation way to compare hist entries
Jiri Olsa [Fri, 5 Oct 2012 14:44:41 +0000 (16:44 +0200)]
perf diff: Add ratio computation way to compare hist entries

Adding -c option to select computation method with the current 'Delta'
computation as default. Current possible values are of this option are:
'delta' and 'ratio'.

Adding 'ratio' as new computation way to compare hist entries.  If
specified the 'Ratio' column is displayed with value 'r' computed as:

  r = A->period / B->period

with:
  - A/B being matching hist entry from first/second file specified
    (or perf.data/perf.data.old) respectively.
  - period being the hist entry period value

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1349448287-18919-3-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf diff: Add -b option for perf diff to display paired entries only
Jiri Olsa [Fri, 5 Oct 2012 14:44:40 +0000 (16:44 +0200)]
perf diff: Add -b option for perf diff to display paired entries only

Adding -b option to perf diff command to display only entries with match
in the baseline.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1349448287-18919-2-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf trace: Add support for tracing workload given by command line
Namhyung Kim [Fri, 5 Oct 2012 05:02:16 +0000 (14:02 +0900)]
perf trace: Add support for tracing workload given by command line

Now perf trace is able to trace specified workload by forking it like
perf record does.  And also finish the tracing if the workload quits or
gets SIGINT.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1349413336-26936-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf trace: Explicitly enable system-wide mode if no option is given
Namhyung Kim [Fri, 5 Oct 2012 05:02:14 +0000 (14:02 +0900)]
perf trace: Explicitly enable system-wide mode if no option is given

When no target cpu/user/task option is given, perf trace will do its job
system wide for all online cpus.  Make it explicit to reduce possible
confusion when reading code.

No functional changes intended.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1349413336-26936-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf trace: Validate target task/user/cpu argument
Namhyung Kim [Fri, 5 Oct 2012 05:02:13 +0000 (14:02 +0900)]
perf trace: Validate target task/user/cpu argument

Those target options are mutually exclusive so check it before setting
up target thread/cpu maps.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1349413336-26936-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoMerge branch 'sched/urgent'
Ingo Molnar [Fri, 5 Oct 2012 12:00:47 +0000 (14:00 +0200)]
Merge branch 'sched/urgent'

11 years agoMerge branch 'sched/numa'
Ingo Molnar [Fri, 5 Oct 2012 12:00:44 +0000 (14:00 +0200)]
Merge branch 'sched/numa'

11 years agoMerge branch 'perf/urgent'
Ingo Molnar [Fri, 5 Oct 2012 12:00:40 +0000 (14:00 +0200)]
Merge branch 'perf/urgent'

11 years agomm/mpol: Fix potential buffer overflow in mpol_parse_str()
Peter Zijlstra [Mon, 1 Oct 2012 13:12:16 +0000 (15:12 +0200)]
mm/mpol: Fix potential buffer overflow in mpol_parse_str()

Wu reported an Smatch error:

+ mm/mempolicy.c:2426 mpol_parse_str() error: buffer overflow 'policy_modes' 5 <= 5

Fix it by growing the array to the right size, but avoid it being a
valid string for mpol_parse_str() because its not an effective policy.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/n/tip-i0egmq9r7tzocxo5pmc8jbfi@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoperf: Fix perf_cgroup_switch for sw-events
Peter Zijlstra [Tue, 2 Oct 2012 13:41:23 +0000 (15:41 +0200)]
perf: Fix perf_cgroup_switch for sw-events

Jiri reported that he could trigger the WARN_ON_ONCE() in
perf_cgroup_switch() using sw-events. This is because sw-events share
a cpuctx with multiple PMUs.

Use the ->unique_pmu pointer to limit the pmu iteration to unique
cpuctx instances.

Reported-and-Tested-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-so7wi2zf3jjzrwcutm2mkz0j@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoperf: Clarify perf_cpu_context::active_pmu usage by renaming it to ::unique_pmu
Peter Zijlstra [Tue, 2 Oct 2012 13:38:52 +0000 (15:38 +0200)]
perf: Clarify perf_cpu_context::active_pmu usage by renaming it to ::unique_pmu

Stephane thought the perf_cpu_context::active_pmu name confusing and
suggested using 'unique_pmu' instead.

This pointer is a pointer to a 'random' pmu sharing the cpuctx
instance, therefore limiting a for_each_pmu loop to those where
cpuctx->unique_pmu matches the pmu we get a loop over unique cpuctx
instances.

Suggested-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-kxyjqpfj2fn9gt7kwu5ag9ks@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoperf/AMD/IBS: Add sysfs support
Robert Richter [Wed, 12 Sep 2012 10:59:44 +0000 (12:59 +0200)]
perf/AMD/IBS: Add sysfs support

Add sysfs format entries for AMD IBS PMUs:

 # find /sys/bus/event_source/devices/ibs_*/format
 /sys/bus/event_source/devices/ibs_fetch/format
 /sys/bus/event_source/devices/ibs_fetch/format/rand_en
 /sys/bus/event_source/devices/ibs_op/format
 /sys/bus/event_source/devices/ibs_op/format/cnt_ctl

This allows to specify following IBS options:

 $ perf record -e ibs_fetch/rand_en=1/GH ...
 $ perf record -e ibs_op/cnt_ctl=1/GH ...

Option cnt_ctl is only enabled if the IBS_CAPS_OPCNT bit is set in IBS
cpuid feature flags (AMD family 10h RevC and above).

Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1347447584-28405-1-git-send-email-robert.richter@amd.com
[ Added small readability improvements. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agosched: Update sched_domains_numa_masks[][] when new cpus are onlined
Tang Chen [Tue, 25 Sep 2012 13:12:31 +0000 (21:12 +0800)]
sched: Update sched_domains_numa_masks[][] when new cpus are onlined

Once array sched_domains_numa_masks[] []is defined, it is never updated.

When a new cpu on a new node is onlined, the coincident member in
sched_domains_numa_masks[][] is not initialized, and all the masks are 0.
As a result, the build_overlap_sched_groups() will initialize a NULL
sched_group for the new cpu on the new node, which will lead to kernel panic:

[ 3189.403280] Call Trace:
[ 3189.403286]  [<ffffffff8106c36f>] warn_slowpath_common+0x7f/0xc0
[ 3189.403289]  [<ffffffff8106c3ca>] warn_slowpath_null+0x1a/0x20
[ 3189.403292]  [<ffffffff810b1d57>] build_sched_domains+0x467/0x470
[ 3189.403296]  [<ffffffff810b2067>] partition_sched_domains+0x307/0x510
[ 3189.403299]  [<ffffffff810b1ea2>] ? partition_sched_domains+0x142/0x510
[ 3189.403305]  [<ffffffff810fcc93>] cpuset_update_active_cpus+0x83/0x90
[ 3189.403308]  [<ffffffff810b22a8>] cpuset_cpu_active+0x38/0x70
[ 3189.403316]  [<ffffffff81674b87>] notifier_call_chain+0x67/0x150
[ 3189.403320]  [<ffffffff81664647>] ? native_cpu_up+0x18a/0x1b5
[ 3189.403328]  [<ffffffff810a044e>] __raw_notifier_call_chain+0xe/0x10
[ 3189.403333]  [<ffffffff81070470>] __cpu_notify+0x20/0x40
[ 3189.403337]  [<ffffffff8166663e>] _cpu_up+0xe9/0x131
[ 3189.403340]  [<ffffffff81666761>] cpu_up+0xdb/0xee
[ 3189.403348]  [<ffffffff8165667c>] store_online+0x9c/0xd0
[ 3189.403355]  [<ffffffff81437640>] dev_attr_store+0x20/0x30
[ 3189.403361]  [<ffffffff8124aa63>] sysfs_write_file+0xa3/0x100
[ 3189.403368]  [<ffffffff811ccbe0>] vfs_write+0xd0/0x1a0
[ 3189.403371]  [<ffffffff811ccdb4>] sys_write+0x54/0xa0
[ 3189.403375]  [<ffffffff81679c69>] system_call_fastpath+0x16/0x1b
[ 3189.403377] ---[ end trace 1e6cf85d0859c941 ]---
[ 3189.403398] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018

This patch registers a new notifier for cpu hotplug notify chain, and
updates sched_domains_numa_masks every time a new cpu is onlined or offlined.

Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
[ fixed compile warning ]
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1348578751-16904-3-git-send-email-tangchen@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agosched: Ensure 'sched_domains_numa_levels' is safe to use in other functions
Tang Chen [Tue, 25 Sep 2012 13:12:30 +0000 (21:12 +0800)]
sched: Ensure 'sched_domains_numa_levels' is safe to use in other functions

We should temporarily reset 'sched_domains_numa_levels' to 0 after
it is reset to 'level' in sched_init_numa(). If it fails to allocate
memory for array sched_domains_numa_masks[][], the array will contain
less then 'level' members. This could be dangerous when we use it to
iterate array sched_domains_numa_masks[][] in other functions.

This patch set sched_domains_numa_levels to 0 before initializing
array sched_domains_numa_masks[][], and reset it to 'level' when
sched_domains_numa_masks[][] is fully initialized.

Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1348578751-16904-2-git-send-email-tangchen@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoMerge branch 'sched/urgent'
Ingo Molnar [Fri, 5 Oct 2012 08:22:31 +0000 (10:22 +0200)]
Merge branch 'sched/urgent'

11 years agonohz: Fix one jiffy count too far in idle cputime
Frederic Weisbecker [Wed, 3 Oct 2012 23:46:44 +0000 (01:46 +0200)]
nohz: Fix one jiffy count too far in idle cputime

When we stop the tick in idle, we save the current jiffies value
in ts->idle_jiffies. This snapshot is substracted from the later
value of jiffies when the tick is restarted and the resulting
delta is accounted as idle cputime. This is how we handle the
idle cputime accounting without the tick.

But sometimes we need to schedule the next tick to some time in
the future instead of completely stopping it. In this case, a
tick may happen before we restart the periodic behaviour and
from that tick we account one jiffy to idle cputime as usual but
we also increment the ts->idle_jiffies snapshot by one so that
when we compute the delta to account, we substract the one jiffy
we just accounted.

To prepare for stopping the tick outside idle, we introduced a
check that prevents from fixing up that ts->idle_jiffies if we
are not running the idle task. But we use idle_cpu() for that
and this is a problem if we run the tick while another CPU
remotely enqueues a ttwu to our runqueue:

CPU 0:                            CPU 1:

tick_sched_timer() {              ttwu_queue_remote()
       if (idle_cpu(CPU 0))
           ts->idle_jiffies++;
}

Here, idle_cpu() notes that &rq->wake_list is not empty and
hence won't consider the CPU as idle. As a result,
ts->idle_jiffies won't be incremented. But this is wrong because
we actually account the current jiffy to idle cputime. And that
jiffy won't get substracted from the nohz time delta. So in the
end, this jiffy is accounted twice.

Fix this by changing idle_cpu(smp_processor_id()) with
is_idle_task(current). This way the jiffy is substracted
correctly even if a ttwu operation is enqueued on the CPU.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: <stable@vger.kernel.org> # 3.5+
Link: http://lkml.kernel.org/r/1349308004-3482-1-git-send-email-fweisbec@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoMerge branch 'perf/urgent'
Ingo Molnar [Fri, 5 Oct 2012 08:12:13 +0000 (10:12 +0200)]
Merge branch 'perf/urgent'

11 years agoMerge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git...
Ingo Molnar [Fri, 5 Oct 2012 08:04:33 +0000 (10:04 +0200)]
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

 * Remove several cases of needless global variables, on most builtins.

 * Look up thread using tid instead of pid in 'perf sched'.

 * Move global variables into a perf_kvm struct, from David Ahern.

 * Hists refactorings, preparatory for improved 'diff' command, from Jiri Olsa.

 * Hists refactorings, preparatory for event group viewieng work, from Namhyung Kim.

 * Remove double negation on optional feature macro definitions, from Namhyung Kim.

 * Bash auto completion improvements, now we can auto complete the tools long
   options, tracepoint event names, etc, from Namhyung Kim.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoperf hists: Add more helpers for hist entry stat
Namhyung Kim [Thu, 4 Oct 2012 12:49:43 +0000 (21:49 +0900)]
perf hists: Add more helpers for hist entry stat

Add and use he_stat__add_{period,stat} for calculating hist entry's
stat.  It will be used for accumulated stats later as well.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Arun Sharma <asharma@fb.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1349354994-17853-10-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf hists: Move he->stat.nr_events initialization to a template
Namhyung Kim [Thu, 4 Oct 2012 12:49:42 +0000 (21:49 +0900)]
perf hists: Move he->stat.nr_events initialization to a template

Since it is set to 1 for a new hist entry, no need to set to separately.
Move it to a template entry.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Arun Sharma <asharma@fb.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1349354994-17853-9-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf hists: Introduce struct he_stat
Namhyung Kim [Thu, 4 Oct 2012 12:49:41 +0000 (21:49 +0900)]
perf hists: Introduce struct he_stat

The struct he_stat is for separating out statistics data of a hist
entry.  It is required for later changes.

It's just a mechanical change and should have no functional differences.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Arun Sharma <asharma@fb.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1349354994-17853-8-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf diff: Removing the total_period argument from output code
Jiri Olsa [Thu, 4 Oct 2012 12:49:40 +0000 (21:49 +0900)]
perf diff: Removing the total_period argument from output code

The total_period is available in struct hists data via the 'struct
hist_entry::hists' pointer. There's no need to carry it through the
output code path.

Removing 'struct perf_hpp::total_period' pointer, because it's no longer
needed.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1349354994-17853-7-git-send-email-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf tool: Add hpp interface to enable/disable hpp column
Jiri Olsa [Thu, 4 Oct 2012 12:49:39 +0000 (21:49 +0900)]
perf tool: Add hpp interface to enable/disable hpp column

Adding perf_hpp__column_enable function to enable/disable hists column
and removing diff command specific stuff 'need_pair and
show_displacement' from hpp code.

The diff command now enables/disables columns separately according to
the user arguments. This will be helpful in future patches where more
columns are added into diff output.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1349354994-17853-6-git-send-email-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf tools: Removing hists pair argument from output path
Jiri Olsa [Thu, 4 Oct 2012 12:49:38 +0000 (21:49 +0900)]
perf tools: Removing hists pair argument from output path

The hists pointer is now part of the 'struct hist_entry'.

And since the overhead and baseline columns are split now, there's no
reason to pass it through the output path.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1349354994-17853-5-git-send-email-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf hists: Separate overhead and baseline columns
Jiri Olsa [Thu, 4 Oct 2012 12:49:37 +0000 (21:49 +0900)]
perf hists: Separate overhead and baseline columns

Currently the overhead and baseline columns are handled within single
function and the distinction is made by 'baseline hists' pointer passed
by 'struct perf_hpp::ptr'.

Since hists pointer is now part of each hist_entry, it's possible to
locate paired hists pointer directly from the passed struct hist_entry
pointer.

Also separating those 2 columns makes the code more obvious.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1349354994-17853-4-git-send-email-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf diff: Refactor diff displacement possition info
Jiri Olsa [Thu, 4 Oct 2012 12:49:36 +0000 (21:49 +0900)]
perf diff: Refactor diff displacement possition info

Moving the position calculation into the diff command, so the position
as prepared inside struct hist_entry data and there's no need to compute
in the output display path.

Removing 'displacement' from struct perf_hpp as it is no longer needed.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1349354994-17853-3-git-send-email-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf hists: Add struct hists pointer to struct hist_entry
Jiri Olsa [Thu, 4 Oct 2012 12:49:35 +0000 (21:49 +0900)]
perf hists: Add struct hists pointer to struct hist_entry

Adding pointer back to the parent struct hists for struct hists_entry.

This will be useful in future for any hist_entry's data computation,
that depends on total data of its parent hists.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1349354994-17853-2-git-send-email-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf tools: Complete tracepoint event names
Namhyung Kim [Thu, 4 Oct 2012 05:23:54 +0000 (14:23 +0900)]
perf tools: Complete tracepoint event names

Currently tracepoint events cannot be completed because they contain a
colon (:) character.  The colon is considered as a word separator when
bash completion is done - variable COMP_WORDBREAKS contains colon - so
if a word being completed contains a colon it can be a problem.

Recent versions of bash completion provide -n switch to
_get_comp_words_by_ref and __ltrim_colon_completions functions in order
to resolve this issue.  Copy the latter in case not exists.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1349328234-16995-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoMerge branch 'perf/urgent'
Ingo Molnar [Thu, 4 Oct 2012 11:32:56 +0000 (13:32 +0200)]
Merge branch 'perf/urgent'

11 years agoperf/x86: Add support for Intel Xeon-Phi Knights Corner PMU
Vince Weaver [Wed, 26 Sep 2012 18:12:52 +0000 (14:12 -0400)]
perf/x86: Add support for Intel Xeon-Phi Knights Corner PMU

The following patch adds perf_event support for the Xeon-Phi
PMU, as documented in the "Intel Xeon Phi Coprocessor (codename:
Knights Corner) Performance Monitoring Units" manual.

Even though it is a co-processor, a Phi runs a full Linux
environment and can support performance counters.

This is just barebones support, it does not add support for
interesting new features such as the SPFLT intruction that
allows starting/stopping events without entering the kernel.

The PMU internally is just like that of an original Pentium, but
a "P6-like" MSR interface is provided.  The interface is
different enough from a real P6 that it's not easy (or
practical) to re-use the code in  perf_event_p6.c

Acked-by: Lawrence F Meadows <lawrence.f.meadows@intel.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: eranian@gmail.com
Cc: Lawrence F <lawrence.f.meadows@intel.com>
Link: http://lkml.kernel.org/r/alpine.DEB.2.02.1209261405320.8398@vincent-weaver-1.um.maine.edu
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoMerge branch 'x86/urgent'
Ingo Molnar [Thu, 4 Oct 2012 11:28:17 +0000 (13:28 +0200)]
Merge branch 'x86/urgent'

11 years agox86/cache_info: Use ARRAY_SIZE() in amd_l3_attrs()
Dan Carpenter [Tue, 2 Oct 2012 08:34:09 +0000 (11:34 +0300)]
x86/cache_info: Use ARRAY_SIZE() in amd_l3_attrs()

Using ARRAY_SIZE() is more readable.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Shai Fultheim <shai@scalemp.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
Link: http://lkml.kernel.org/r/20121002083409.GM12398@elgon.mountain
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoMerge branch 'x86/urgent'
Ingo Molnar [Thu, 4 Oct 2012 10:22:45 +0000 (12:22 +0200)]
Merge branch 'x86/urgent'

11 years agox86/reboot: Remove quirk entry for SBC FITPC
David Hooper [Tue, 2 Oct 2012 14:26:53 +0000 (15:26 +0100)]
x86/reboot: Remove quirk entry for SBC FITPC

Remove the quirk for the SBC FITPC. It seems ot have been
required when the default was kbd reboot, but no longer required
now that the default is acpi reboot. Furthermore, BIOS reboot no
longer works for this board as of 2.6.39 or any of the 3.x
kernels.

Signed-off-by: David Hooper <dave@beermex.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Link: http://lkml.kernel.org/r/20121002142635.17403.59959.stgit@localhost.localdomain
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoMerge branch 'sched/numa'
Ingo Molnar [Thu, 4 Oct 2012 08:15:42 +0000 (10:15 +0200)]
Merge branch 'sched/numa'

11 years agomm/mpol: Fix build warning for UMA kernels
David Rientjes [Tue, 2 Oct 2012 20:14:10 +0000 (13:14 -0700)]
mm/mpol: Fix build warning for UMA kernels

Commit "mm, mpol: Use special PROT_NONE to migrate pages"
causes a build warning when CONFIG_NUMA is not enabled:

  mm/huge_memory.c: In function 'do_huge_pmd_prot_none':
  mm/huge_memory.c:745: warning: unused variable 'node'

"node" is only used once, so avoid using it altogether.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: pjt@google.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/alpine.DEB.2.00.1210021312140.8537@chino.kir.corp.google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoperf evlist: Remove some unused methods
Arnaldo Carvalho de Melo [Wed, 3 Oct 2012 14:50:55 +0000 (11:50 -0300)]
perf evlist: Remove some unused methods

Those were introduced in a previous attempt at implementing 'trace', but
are not being used anywhere, ditch them.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-ruhm5gocoh32pb7gnr0ai6gh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf evlist: Introduce add_newtp method
Arnaldo Carvalho de Melo [Wed, 3 Oct 2012 14:40:22 +0000 (11:40 -0300)]
perf evlist: Introduce add_newtp method

To reduce the boilerplate of creating and adding a new tracepoint to an
evlist.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-4z90i79gnmsza2czv2dhdrb7@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
11 years agoperf kvm: Move global variables into a perf_kvm struct
David Ahern [Wed, 3 Oct 2012 04:09:53 +0000 (22:09 -0600)]
perf kvm: Move global variables into a perf_kvm struct

Cleans up the builtin-kvm code in preparation for the live mode.  No
functional changes; only code movement.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Dong Hao <haodong@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Runzhen Wang <runzhen@linux.vnet.ibm.com>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1349237393-86006-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>