16 Dec, 2010
6 commits
-
Simple sysfs emumeration of the PMUs.
Use a "event_source" bus, and add PMU devices using their name.
Each PMU device has a type attribute which contrains the value needed
for perf_event_attr::type to identify this PMU.This is the minimal stub needed to start using this interface,
we'll consider extending the sysfs usage later.Cc: Kay Sievers
Cc: Greg KH
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Extend the perf_pmu_register() interface to allow for named and
dynamic pmu types.Because we need to support the existing static types we cannot use
dynamic types for everything, hence provide a type argument.If we want to enumerate the PMUs they need a name, provide one.
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Currently we call perf_event_init() from sched_init(). In order to
make it more obvious move it to the cannnonical location.Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Merge reason: We want to apply a dependent patch.
Signed-off-by: Ingo Molnar
-
…rostedt/linux-2.6-trace into perf/urgent
-
The perf_swevent_enabled[] array has PERF_COUNT_SW_MAX elements.
Signed-off-by: Dan Carpenter
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar
10 Dec, 2010
1 commit
-
Originally adapted from Huang Ying's patch which moved the
unknown_nmi_panic to the traps.c file. Because the old nmi
watchdog was deleted before this change happened, the
unknown_nmi_panic sysctl was lost. This re-adds it.Also, the nmi_watchdog sysctl was re-implemented and its
documentation updated accordingly.Patch-inspired-by: Huang Ying
Signed-off-by: Don Zickus
Reviewed-by: Cyrill Gorcunov
Acked-by: Yinghai Lu
Cc: fweisbec@gmail.com
LKML-Reference:
Signed-off-by: Ingo Molnar
09 Dec, 2010
2 commits
-
Use the reboot notifier to detach all running counters on reboot, this
solves a problem with kexec where the new kernel doesn't expect
running counters (rightly so).It will however decrease the coverage of the NMI watchdog. Making a
kexec specific reboot notifier callback would be best, however that
would require touching all notifier callback handlers as they are not
properly structured to deal with new state.As a compromise, place the perf reboot notifier at the very last
position in the list.Reported-by: Yinghai Lu
Signed-off-by: Peter Zijlstra
Cc: Vivek Goyal
Cc: Eric W. Biederman
Cc: Jason Wessel
Cc: Don Zickus
LKML-Reference:
Signed-off-by: Ingo Molnar -
Because the multi-pmu bits can share contexts between struct pmu
instances we could get duplicate events by iterating the pmu list.Signed-off-by: Peter Zijlstra
Signed-off-by: Thomas Gleixner
LKML-Reference:
Signed-off-by: Ingo Molnar
08 Dec, 2010
2 commits
-
…r-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86/pvclock: Zero last_value on resume* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf record: Fix eternal wait for stillborn child
perf header: Don't assume there's no attr info if no sample ids is provided
perf symbols: Figure out start address of kernel map from kallsyms
perf symbols: Fix kallsyms kernel/module map splitting* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
nohz: Fix printk_needs_cpu() return value on offline cpus
printk: Fix wake_up_klogd() vs cpu hotplug -
…git/tip/linux-2.6-tip
* 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
genirq: Fix incorrect proc spurious output
07 Dec, 2010
12 commits
-
…inux-2.6 into perf/core
-
Merge reason: Pick up the latest -rc.
Signed-off-by: Ingo Molnar
-
* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
PM / Hibernate: Fix memory corruption related to swap
PM / Hibernate: Use async I/O when reading compressed hibernation image -
There is a problem that swap pages allocated before the creation of
a hibernation image can be released and used for storing the contents
of different memory pages while the image is being saved. Since the
kernel stored in the image doesn't know of that, it causes memory
corruption to occur after resume from hibernation, especially on
systems with relatively small RAM that need to swap often.This issue can be addressed by keeping the GFP_IOFS bits clear
in gfp_allowed_mask during the entire hibernation, including the
saving of the image, until the system is finally turned off or
the hibernation is aborted. Unfortunately, for this purpose
it's necessary to rework the way in which the hibernate and
suspend code manipulates gfp_allowed_mask.This change is based on an earlier patch from Hugh Dickins.
Signed-off-by: Rafael J. Wysocki
Reported-by: Ondrej Zary
Acked-by: Hugh Dickins
Reviewed-by: KAMEZAWA Hiroyuki
Cc: stable@kernel.org -
This is a fix for reading LZO compressed image using async I/O.
Essentially, instead of having just one page into which we keep
reading blocks from swap, we allocate enough of them to cover the
largest compressed size and then let block I/O pick them all up. Once
we have them all (and here we wait), we decompress them, as usual.
Obviously, the very first block we still pick up synchronously,
because we need to know the size of the lot before we pick up the
rest.Also fixed the copyright line, which I've forgotten before.
Signed-off-by: Bojan Smojver
Signed-off-by: Rafael J. Wysocki -
Use text_poke_smp_batch() on unoptimization path for reducing
the number of stop_machine() issues. If the number of
unoptimizing probes is more than MAX_OPTIMIZE_PROBES(=256),
kprobes unoptimizes first MAX_OPTIMIZE_PROBES probes and kicks
optimizer for remaining probes.Signed-off-by: Masami Hiramatsu
Cc: Rusty Russell
Cc: Frederic Weisbecker
Cc: Ananth N Mavinakayanahalli
Cc: Jason Baron
Cc: Mathieu Desnoyers
Cc: 2nddept-manager@sdl.hitachi.co.jp
Cc: Peter Zijlstra
Cc: Steven Rostedt
LKML-Reference:
Signed-off-by: Ingo Molnar -
Use text_poke_smp_batch() in optimization path for reducing
the number of stop_machine() issues. If the number of optimizing
probes is more than MAX_OPTIMIZE_PROBES(=256), kprobes optimizes
first MAX_OPTIMIZE_PROBES probes and kicks optimizer for
remaining probes.Changes in v5:
- Use kick_kprobe_optimizer() instead of directly calling
schedule_delayed_work().
- Rescheduling optimizer outside of kprobe mutex lock.Changes in v2:
- Allocate code buffer and parameters in arch_init_kprobes()
instead of using static arraies.
- Merge previous max optimization limit patch into this patch.
So, this patch introduces upper limit of optimization at
once.Signed-off-by: Masami Hiramatsu
Cc: Rusty Russell
Cc: Frederic Weisbecker
Cc: Ananth N Mavinakayanahalli
Cc: Jason Baron
Cc: Mathieu Desnoyers
Cc: 2nddept-manager@sdl.hitachi.co.jp
Cc: Peter Zijlstra
Cc: Steven Rostedt
LKML-Reference:
Signed-off-by: Ingo Molnar -
Reuse unused (waiting for unoptimizing and no user handler)
kprobe on given address instead of returning -EBUSY for
registering a new kprobe.Signed-off-by: Masami Hiramatsu
Cc: Rusty Russell
Cc: Frederic Weisbecker
Cc: Ananth N Mavinakayanahalli
Cc: Jason Baron
Cc: Mathieu Desnoyers
Cc: 2nddept-manager@sdl.hitachi.co.jp
LKML-Reference:
Signed-off-by: Ingo Molnar -
Unoptimization occurs when a probe is unregistered or disabled,
and is heavy because it recovers instructions by using
stop_machine(). This patch delays unoptimization operations and
unoptimize several probes at once by using
text_poke_smp_batch(). This can avoid unexpected system slowdown
coming from stop_machine().Changes in v5:
- Split this patch into several cleanup patches and this patch.
- Fix some text_mutex lock miss.
- Use bool instead of int for behavior flags.
- Add additional comment for (un)optimizing path.Changes in v2:
- Use dynamic allocated buffers and params.Signed-off-by: Masami Hiramatsu
Cc: Rusty Russell
Cc: Frederic Weisbecker
Cc: Ananth N Mavinakayanahalli
Cc: Jason Baron
Cc: Mathieu Desnoyers
Cc: 2nddept-manager@sdl.hitachi.co.jp
LKML-Reference:
Signed-off-by: Ingo Molnar -
Separate kprobe optimizing code from optimizer, this
will make easy to introducing unoptimizing code in
optimizer.Signed-off-by: Masami Hiramatsu
Cc: Rusty Russell
Cc: Frederic Weisbecker
Cc: Ananth N Mavinakayanahalli
Cc: Jason Baron
Cc: Mathieu Desnoyers
Cc: 2nddept-manager@sdl.hitachi.co.jp
LKML-Reference:
Signed-off-by: Ingo Molnar -
Merge disabling kprobe to unregistering kprobe function
and add comments for disabing/unregistring process.Current unregistering code disables(disarms) kprobes after
checking target kprobe status. This patch changes it to
disabling kprobe first after that it changing the kprobe's
state. This allows to share probe disabling code between
disable_kprobe() and unregister_kprobe().Signed-off-by: Masami Hiramatsu
Cc: Rusty Russell
Cc: Frederic Weisbecker
Cc: Ananth N Mavinakayanahalli
Cc: Jason Baron
Cc: Mathieu Desnoyers
Cc: 2nddept-manager@sdl.hitachi.co.jp
LKML-Reference:
Signed-off-by: Ingo Molnar -
Rename irrelevant uses of "old_p" to more appropriate names.
Originally, "old_p" just meant "the old kprobe on given address"
but current code uses that name as "just another kprobe" or
something like that. This patch renames those pointer names
to more appropriate one for maintainability.Signed-off-by: Masami Hiramatsu
Cc: Rusty Russell
Cc: Frederic Weisbecker
Cc: Ananth N Mavinakayanahalli
Cc: Jason Baron
Cc: Mathieu Desnoyers
Cc: 2nddept-manager@sdl.hitachi.co.jp
LKML-Reference:
Signed-off-by: Ingo Molnar
05 Dec, 2010
3 commits
-
If perf_event_attr.sample_id_all is set it will add the PERF_SAMPLE_ identity
info:TID, TIME, ID, CPU, STREAM_ID
As a trailer, so that older perf tools can process new files, just ignoring the
extra payload.With this its possible to do further analysis on problems in the event stream,
like detecting reordering of MMAP and FORK events, etc.V2: Fixup header size in comm, mmap and task processing, as we have to take into
account different sample_types for each matching event, noticed by Thomas Gleixner.Thomas also noticed a problem in v2 where if we didn't had space in the buffer we
wouldn't restore the header size.Tested-by: Thomas Gleixner
Reviewed-by: Thomas Gleixner
Acked-by: Ian Munsie
Acked-by: Peter Zijlstra
Acked-by: Thomas Gleixner
Cc: Frédéric Weisbecker
Cc: Ian Munsie
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc: Stephane Eranian
Cc: Thomas Gleixner
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo -
Those will be made available in sample like events like MMAP, EXEC, etc in a
followup patch. So precalculate the extra id header space and have a separate
routine to fill them up.V2: Thomas noticed that the id header needs to be precalculated at
inherit_events too:LKML-Reference:
Tested-by: Thomas Gleixner
Reviewed-by: Thomas Gleixner
Acked-by: Ian Munsie
Acked-by: Peter Zijlstra
Acked-by: Thomas Gleixner
Cc: Frédéric Weisbecker
Cc: Ian Munsie
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc: Stephane Eranian
Cc: Thomas Gleixner
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo -
The precalculated header size is not updated when an event is inherited. That
results in bogus sample entries for all child events. Bug introduced in c320c7b.Cc: Frederic Weisbecker
Cc: Ian Munsie
Cc: Ingo Molnar
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Stephane Eranian
LKML-Reference:
Signed-off-by: Thomas Gleixner
Signed-off-by: Arnaldo Carvalho de Melo
03 Dec, 2010
1 commit
-
If a user manages to trigger an oops with fs set to KERNEL_DS, fs is not
otherwise reset before do_exit(). do_exit may later (via mm_release in
fork.c) do a put_user to a user-controlled address, potentially allowing
a user to leverage an oops into a controlled write into kernel memory.This is only triggerable in the presence of another bug, but this
potentially turns a lot of DoS bugs into privilege escalations, so it's
worth fixing. I have proof-of-concept code which uses this bug along
with CVE-2010-3849 to write a zero to an arbitrary kernel address, so
I've tested that this is not theoretical.A more logical place to put this fix might be when we know an oops has
occurred, before we call do_exit(), but that would involve changing
every architecture, in multiple places.Let's just stick it in do_exit instead.
[akpm@linux-foundation.org: update code comment]
Signed-off-by: Nelson Elhage
Cc: KOSAKI Motohiro
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
01 Dec, 2010
3 commits
-
Since commit a1afb637(switch /proc/irq/*/spurious to seq_file) all
/proc/irq/XX/spurious files show the information of irq 0.Current irq_spurious_proc_open() passes on NULL as the 3rd argument,
which is used as an IRQ number in irq_spurious_proc_show(), to the
single_open(). Because of this, all the /proc/irq/XX/spurious file
shows IRQ 0 information regardless of the IRQ number.To fix the problem, irq_spurious_proc_open() must pass on the
appropreate data (IRQ number) to single_open().Signed-off-by: Kenji Kaneshige
Reviewed-by: Yong Zhang
LKML-Reference:
Cc: stable@kernel.org [2.6.33+]
Signed-off-by: Thomas Gleixner -
PERF_SAMPLE_{CALLCHAIN,RAW} have variable lenghts per sample, but the others
can be precalculated, reducing a bit the per sample cost.Acked-by: Peter Zijlstra
Cc: Frédéric Weisbecker
Cc: Ian Munsie
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc: Stephane Eranian
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo -
The file_ops struct for the "trace" special file defined llseek as seq_lseek().
However, if the file was opened for writing only, seq_open() was not called,
and the seek would dereference a null pointer, file->private_data.This patch introduces a new wrapper for seq_lseek() which checks if the file
descriptor is opened for reading first. If not, it does nothing.Cc:
Signed-off-by: Slava Pestov
LKML-Reference:
Signed-off-by: Steven Rostedt
29 Nov, 2010
1 commit
-
…/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf: Fix the software context switch counter
perf, x86: Fixup Kconfig deps
x86, perf, nmi: Disable perf if counters are not accessible
perf: Fix inherit vs. context rotation bug
27 Nov, 2010
3 commits
-
…el/git/tip/linux-2.6-tip
* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
posix-cpu-timers: Rcu_read_lock/unlock protect find_task_by_vpid call -
…/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf symbols: Remove incorrect open-coded container_of()
perf record: Handle restrictive permissions in /proc/{kallsyms,modules}
x86/kprobes: Prevent kprobes to probe on save_args()
irq_work: Drop cmpxchg() result
perf: Fix owner-list vs exit
x86, hw_nmi: Move backtrace_mask declaration under ARCH_HAS_NMI_WATCHDOG
tracing: Fix recursive user stack trace
perf,hw_breakpoint: Initialize hardware api earlier
x86: Ignore trap bits on single step exceptions
tracing: Force arch_local_irq_* notrace for paravirt
tracing: Fix module use of trace_bprintk() -
…l/git/tip/linux-2.6-tip
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
sched: Fix idle balancing
sched: Fix volanomark performance regression
26 Nov, 2010
6 commits
-
The perf hardware pmu got initialized at various points in the boot,
some before early_initcall() some after (notably arch_initcall).The problem is that the NMI lockup detector is ran from early_initcall()
and expects the hardware pmu to be present.Sanitize this by moving all architecture hardware pmu implementations to
initialize at early_initcall() and move the lockup detector to an explicit
initcall right after that.Cc: paulus
Cc: davem
Cc: Michael Cree
Cc: Deng-Cheng Zhu
Acked-by: Paul Mundt
Acked-by: Will Deacon
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Some arch implementations call perf_event_overflow() by 'accident',
ignore this.Reported-by: Francis Moreau
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Signed-off-by: Franck Bui-Huu
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Signed-off-by: Franck Bui-Huu
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
and use it when appropriate.
Signed-off-by: Franck Bui-Huu
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Conflicts:
arch/x86/kernel/apic/hw_nmi.cMerge reason: Resolve conflict, queue up dependent patch.
Signed-off-by: Ingo Molnar