Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211947
b: refs/heads/master
c: d7b4d6d
h: refs/heads/master
i:
  211945: f9917c0
  211943: d7d2541
v: v3
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Oct 18, 2010
1 parent 8dc3d65 commit b1a4598
Show file tree
Hide file tree
Showing 47 changed files with 326 additions and 537 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ebf31f502492527e2b6b5e5cf85a4ebc7fc8a52e
refs/heads/master: d7b4d6de57d414a6384376880f2caf7125a45494
1 change: 0 additions & 1 deletion trunk/arch/alpha/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ config ALPHA
select HAVE_IDE
select HAVE_OPROFILE
select HAVE_SYSCALL_WRAPPERS
select HAVE_IRQ_WORK
select HAVE_PERF_EVENTS
select HAVE_DMA_ATTRS
help
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/alpha/include/asm/perf_event.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#ifndef __ASM_ALPHA_PERF_EVENT_H
#define __ASM_ALPHA_PERF_EVENT_H

/* Alpha only supports software events through this interface. */
extern void set_perf_event_pending(void);

#define PERF_EVENT_INDEX_OFFSET 0

#ifdef CONFIG_PERF_EVENTS
extern void init_hw_perf_events(void);
#else
Expand Down
30 changes: 15 additions & 15 deletions trunk/arch/alpha/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <linux/init.h>
#include <linux/bcd.h>
#include <linux/profile.h>
#include <linux/irq_work.h>
#include <linux/perf_event.h>

#include <asm/uaccess.h>
#include <asm/io.h>
Expand Down Expand Up @@ -83,25 +83,25 @@ static struct {

unsigned long est_cycle_freq;

#ifdef CONFIG_IRQ_WORK
#ifdef CONFIG_PERF_EVENTS

DEFINE_PER_CPU(u8, irq_work_pending);
DEFINE_PER_CPU(u8, perf_event_pending);

#define set_irq_work_pending_flag() __get_cpu_var(irq_work_pending) = 1
#define test_irq_work_pending() __get_cpu_var(irq_work_pending)
#define clear_irq_work_pending() __get_cpu_var(irq_work_pending) = 0
#define set_perf_event_pending_flag() __get_cpu_var(perf_event_pending) = 1
#define test_perf_event_pending() __get_cpu_var(perf_event_pending)
#define clear_perf_event_pending() __get_cpu_var(perf_event_pending) = 0

void set_irq_work_pending(void)
void set_perf_event_pending(void)
{
set_irq_work_pending_flag();
set_perf_event_pending_flag();
}

#else /* CONFIG_IRQ_WORK */
#else /* CONFIG_PERF_EVENTS */

#define test_irq_work_pending() 0
#define clear_irq_work_pending()
#define test_perf_event_pending() 0
#define clear_perf_event_pending()

#endif /* CONFIG_IRQ_WORK */
#endif /* CONFIG_PERF_EVENTS */


static inline __u32 rpcc(void)
Expand Down Expand Up @@ -191,9 +191,9 @@ irqreturn_t timer_interrupt(int irq, void *dev)

write_sequnlock(&xtime_lock);

if (test_irq_work_pending()) {
clear_irq_work_pending();
irq_work_run();
if (test_perf_event_pending()) {
clear_perf_event_pending();
perf_event_do_pending();
}

#ifndef CONFIG_SMP
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ config ARM
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_LZO
select HAVE_KERNEL_LZMA
select HAVE_IRQ_WORK
select HAVE_PERF_EVENTS
select PERF_USE_VMALLOC
select HAVE_REGS_AND_STACK_ACCESS_API
Expand Down
12 changes: 12 additions & 0 deletions trunk/arch/arm/include/asm/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
#ifndef __ARM_PERF_EVENT_H__
#define __ARM_PERF_EVENT_H__

/*
* NOP: on *most* (read: all supported) ARM platforms, the performance
* counter interrupts are regular interrupts and not an NMI. This
* means that when we receive the interrupt we can call
* perf_event_do_pending() that handles all of the work with
* interrupts disabled.
*/
static inline void
set_perf_event_pending(void)
{
}

/* ARM performance counters start from 1 (in the cp15 accesses) so use the
* same indexes here for consistency. */
#define PERF_EVENT_INDEX_OFFSET 1
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/arm/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ armv6pmu_handle_irq(int irq_num,
* platforms that can have the PMU interrupts raised as an NMI, this
* will not work.
*/
irq_work_run();
perf_event_do_pending();

return IRQ_HANDLED;
}
Expand Down Expand Up @@ -2068,7 +2068,7 @@ static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev)
* platforms that can have the PMU interrupts raised as an NMI, this
* will not work.
*/
irq_work_run();
perf_event_do_pending();

return IRQ_HANDLED;
}
Expand Down Expand Up @@ -2436,7 +2436,7 @@ xscale1pmu_handle_irq(int irq_num, void *dev)
armpmu->disable(hwc, idx);
}

irq_work_run();
perf_event_do_pending();

/*
* Re-enable the PMU.
Expand Down Expand Up @@ -2763,7 +2763,7 @@ xscale2pmu_handle_irq(int irq_num, void *dev)
armpmu->disable(hwc, idx);
}

irq_work_run();
perf_event_do_pending();

/*
* Re-enable the PMU.
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/frv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ config FRV
default y
select HAVE_IDE
select HAVE_ARCH_TRACEHOOK
select HAVE_IRQ_WORK
select HAVE_PERF_EVENTS

config ZONE_DMA
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/frv/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
lib-y := \
__ashldi3.o __lshrdi3.o __muldi3.o __ashrdi3.o __negdi2.o __ucmpdi2.o \
checksum.o memcpy.o memset.o atomic-ops.o atomic64-ops.o \
outsl_ns.o outsl_sw.o insl_ns.o insl_sw.o cache.o
outsl_ns.o outsl_sw.o insl_ns.o insl_sw.o cache.o perf_event.o
19 changes: 19 additions & 0 deletions trunk/arch/frv/lib/perf_event.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Performance event handling
*
* Copyright (C) 2009 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public Licence
* as published by the Free Software Foundation; either version
* 2 of the Licence, or (at your option) any later version.
*/

#include <linux/perf_event.h>

/*
* mark the performance event as pending
*/
void set_perf_event_pending(void)
{
}
1 change: 0 additions & 1 deletion trunk/arch/parisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ config PARISC
select RTC_DRV_GENERIC
select INIT_ALL_POSSIBLE
select BUG
select HAVE_IRQ_WORK
select HAVE_PERF_EVENTS
select GENERIC_ATOMIC64 if !64BIT
help
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/parisc/include/asm/perf_event.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef __ASM_PARISC_PERF_EVENT_H
#define __ASM_PARISC_PERF_EVENT_H

/* Empty, just to avoid compiling error */
/* parisc only supports software events through this interface. */
static inline void set_perf_event_pending(void) { }

#endif /* __ASM_PARISC_PERF_EVENT_H */
1 change: 0 additions & 1 deletion trunk/arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ config PPC
select HAVE_OPROFILE
select HAVE_SYSCALL_WRAPPERS if PPC64
select GENERIC_ATOMIC64 if PPC32
select HAVE_IRQ_WORK
select HAVE_PERF_EVENTS
select HAVE_REGS_AND_STACK_ACCESS_API
select HAVE_HW_BREAKPOINT if PERF_EVENTS && PPC_BOOK3S_64
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/include/asm/paca.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ struct paca_struct {
u8 soft_enabled; /* irq soft-enable flag */
u8 hard_enabled; /* set if irqs are enabled in MSR */
u8 io_sync; /* writel() needs spin_unlock sync */
u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */
u8 perf_event_pending; /* PM interrupt while soft-disabled */

/* Stuff for accurate time accounting */
u64 user_time; /* accumulated usermode TB ticks */
Expand Down
42 changes: 21 additions & 21 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include <linux/posix-timers.h>
#include <linux/irq.h>
#include <linux/delay.h>
#include <linux/irq_work.h>
#include <linux/perf_event.h>
#include <asm/trace.h>

#include <asm/io.h>
Expand Down Expand Up @@ -493,60 +493,60 @@ void __init iSeries_time_init_early(void)
}
#endif /* CONFIG_PPC_ISERIES */

#ifdef CONFIG_IRQ_WORK
#ifdef CONFIG_PERF_EVENTS

/*
* 64-bit uses a byte in the PACA, 32-bit uses a per-cpu variable...
*/
#ifdef CONFIG_PPC64
static inline unsigned long test_irq_work_pending(void)
static inline unsigned long test_perf_event_pending(void)
{
unsigned long x;

asm volatile("lbz %0,%1(13)"
: "=r" (x)
: "i" (offsetof(struct paca_struct, irq_work_pending)));
: "i" (offsetof(struct paca_struct, perf_event_pending)));
return x;
}

static inline void set_irq_work_pending_flag(void)
static inline void set_perf_event_pending_flag(void)
{
asm volatile("stb %0,%1(13)" : :
"r" (1),
"i" (offsetof(struct paca_struct, irq_work_pending)));
"i" (offsetof(struct paca_struct, perf_event_pending)));
}

static inline void clear_irq_work_pending(void)
static inline void clear_perf_event_pending(void)
{
asm volatile("stb %0,%1(13)" : :
"r" (0),
"i" (offsetof(struct paca_struct, irq_work_pending)));
"i" (offsetof(struct paca_struct, perf_event_pending)));
}

#else /* 32-bit */

DEFINE_PER_CPU(u8, irq_work_pending);
DEFINE_PER_CPU(u8, perf_event_pending);

#define set_irq_work_pending_flag() __get_cpu_var(irq_work_pending) = 1
#define test_irq_work_pending() __get_cpu_var(irq_work_pending)
#define clear_irq_work_pending() __get_cpu_var(irq_work_pending) = 0
#define set_perf_event_pending_flag() __get_cpu_var(perf_event_pending) = 1
#define test_perf_event_pending() __get_cpu_var(perf_event_pending)
#define clear_perf_event_pending() __get_cpu_var(perf_event_pending) = 0

#endif /* 32 vs 64 bit */

void set_irq_work_pending(void)
void set_perf_event_pending(void)
{
preempt_disable();
set_irq_work_pending_flag();
set_perf_event_pending_flag();
set_dec(1);
preempt_enable();
}

#else /* CONFIG_IRQ_WORK */
#else /* CONFIG_PERF_EVENTS */

#define test_irq_work_pending() 0
#define clear_irq_work_pending()
#define test_perf_event_pending() 0
#define clear_perf_event_pending()

#endif /* CONFIG_IRQ_WORK */
#endif /* CONFIG_PERF_EVENTS */

/*
* For iSeries shared processors, we have to let the hypervisor
Expand Down Expand Up @@ -587,9 +587,9 @@ void timer_interrupt(struct pt_regs * regs)

calculate_steal_time();

if (test_irq_work_pending()) {
clear_irq_work_pending();
irq_work_run();
if (test_perf_event_pending()) {
clear_perf_event_pending();
perf_event_do_pending();
}

#ifdef CONFIG_PPC_ISERIES
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ config S390
select HAVE_KVM if 64BIT
select HAVE_ARCH_TRACEHOOK
select INIT_ALL_POSSIBLE
select HAVE_IRQ_WORK
select HAVE_PERF_EVENTS
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_BZIP2
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/s390/include/asm/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Copyright 2009 Martin Schwidefsky, IBM Corporation.
*/

/* Empty, just to avoid compiling error */
static inline void set_perf_event_pending(void) {}
static inline void clear_perf_event_pending(void) {}

#define PERF_EVENT_INDEX_OFFSET 0
1 change: 0 additions & 1 deletion trunk/arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ config SUPERH
select HAVE_ARCH_TRACEHOOK
select HAVE_DMA_API_DEBUG
select HAVE_DMA_ATTRS
select HAVE_IRQ_WORK
select HAVE_PERF_EVENTS
select PERF_USE_VMALLOC
select HAVE_KERNEL_GZIP
Expand Down
7 changes: 7 additions & 0 deletions trunk/arch/sh/include/asm/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,11 @@ extern int register_sh_pmu(struct sh_pmu *);
extern int reserve_pmc_hardware(void);
extern void release_pmc_hardware(void);

static inline void set_perf_event_pending(void)
{
/* Nothing to see here, move along. */
}

#define PERF_EVENT_INDEX_OFFSET 0

#endif /* __ASM_SH_PERF_EVENT_H */
2 changes: 0 additions & 2 deletions trunk/arch/sparc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ config SPARC
select ARCH_WANT_OPTIONAL_GPIOLIB
select RTC_CLASS
select RTC_DRV_M48T59
select HAVE_IRQ_WORK
select HAVE_PERF_EVENTS
select PERF_USE_VMALLOC
select HAVE_DMA_ATTRS
Expand Down Expand Up @@ -55,7 +54,6 @@ config SPARC64
select RTC_DRV_BQ4802
select RTC_DRV_SUN4V
select RTC_DRV_STARFIRE
select HAVE_IRQ_WORK
select HAVE_PERF_EVENTS
select PERF_USE_VMALLOC

Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/sparc/include/asm/perf_event.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef __ASM_SPARC_PERF_EVENT_H
#define __ASM_SPARC_PERF_EVENT_H

extern void set_perf_event_pending(void);

#define PERF_EVENT_INDEX_OFFSET 0

#ifdef CONFIG_PERF_EVENTS
#include <asm/ptrace.h>

Expand Down
Loading

0 comments on commit b1a4598

Please sign in to comment.