diff options
81 files changed, 2979 insertions, 1182 deletions
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index 0cfb00fd86ff..4bbeca8483ed 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt | |||
| @@ -22,8 +22,9 @@ Appendix B: The kprobes sysctl interface | |||
| 22 | 22 | ||
| 23 | Kprobes enables you to dynamically break into any kernel routine and | 23 | Kprobes enables you to dynamically break into any kernel routine and |
| 24 | collect debugging and performance information non-disruptively. You | 24 | collect debugging and performance information non-disruptively. You |
| 25 | can trap at almost any kernel code address, specifying a handler | 25 | can trap at almost any kernel code address(*), specifying a handler |
| 26 | routine to be invoked when the breakpoint is hit. | 26 | routine to be invoked when the breakpoint is hit. |
| 27 | (*: some parts of the kernel code can not be trapped, see 1.5 Blacklist) | ||
| 27 | 28 | ||
| 28 | There are currently three types of probes: kprobes, jprobes, and | 29 | There are currently three types of probes: kprobes, jprobes, and |
| 29 | kretprobes (also called return probes). A kprobe can be inserted | 30 | kretprobes (also called return probes). A kprobe can be inserted |
| @@ -273,6 +274,19 @@ using one of the following techniques: | |||
| 273 | or | 274 | or |
| 274 | - Execute 'sysctl -w debug.kprobes_optimization=n' | 275 | - Execute 'sysctl -w debug.kprobes_optimization=n' |
| 275 | 276 | ||
| 277 | 1.5 Blacklist | ||
| 278 | |||
| 279 | Kprobes can probe most of the kernel except itself. This means | ||
| 280 | that there are some functions where kprobes cannot probe. Probing | ||
| 281 | (trapping) such functions can cause a recursive trap (e.g. double | ||
| 282 | fault) or the nested probe handler may never be called. | ||
| 283 | Kprobes manages such functions as a blacklist. | ||
| 284 | If you want to add a function into the blacklist, you just need | ||
| 285 | to (1) include linux/kprobes.h and (2) use NOKPROBE_SYMBOL() macro | ||
| 286 | to specify a blacklisted function. | ||
| 287 | Kprobes checks the given probe address against the blacklist and | ||
| 288 | rejects registering it, if the given address is in the blacklist. | ||
| 289 | |||
| 276 | 2. Architectures Supported | 290 | 2. Architectures Supported |
| 277 | 291 | ||
| 278 | Kprobes, jprobes, and return probes are implemented on the following | 292 | Kprobes, jprobes, and return probes are implemented on the following |
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index a6bc431cde70..4238bcba9d60 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
| @@ -410,7 +410,7 @@ __hw_perf_event_init(struct perf_event *event) | |||
| 410 | */ | 410 | */ |
| 411 | hwc->config_base |= (unsigned long)mapping; | 411 | hwc->config_base |= (unsigned long)mapping; |
| 412 | 412 | ||
| 413 | if (!hwc->sample_period) { | 413 | if (!is_sampling_event(event)) { |
| 414 | /* | 414 | /* |
| 415 | * For non-sampling runs, limit the sample_period to half | 415 | * For non-sampling runs, limit the sample_period to half |
| 416 | * of the counter width. That way, the new counter value | 416 | * of the counter width. That way, the new counter value |
diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c index a71ae1523620..af9e35e8836f 100644 --- a/arch/arm/kernel/perf_event_cpu.c +++ b/arch/arm/kernel/perf_event_cpu.c | |||
| @@ -126,8 +126,8 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler) | |||
| 126 | 126 | ||
| 127 | irqs = min(pmu_device->num_resources, num_possible_cpus()); | 127 | irqs = min(pmu_device->num_resources, num_possible_cpus()); |
| 128 | if (irqs < 1) { | 128 | if (irqs < 1) { |
| 129 | pr_err("no irqs for PMUs defined\n"); | 129 | printk_once("perf/ARM: No irqs for PMU defined, sampling events not supported\n"); |
| 130 | return -ENODEV; | 130 | return 0; |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | irq = platform_get_irq(pmu_device, 0); | 133 | irq = platform_get_irq(pmu_device, 0); |
| @@ -191,6 +191,10 @@ static void cpu_pmu_init(struct arm_pmu *cpu_pmu) | |||
| 191 | /* Ensure the PMU has sane values out of reset. */ | 191 | /* Ensure the PMU has sane values out of reset. */ |
| 192 | |||
