aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2010-10-15 06:45:00 -0400
committerRobert Richter <robert.richter@amd.com>2010-10-15 06:45:00 -0400
commit6268464b370e234e0255330190f9bd5d19386ad7 (patch)
tree5742641092ce64227dd2086d78baaede57da1f80 /include
parent7df01d96b295e400167e78061b81d4c91630b12d (diff)
parent0fdf13606b67f830559abdaad15980c7f4f05ec4 (diff)
Merge remote branch 'tip/perf/core' into oprofile/core
Conflicts: arch/arm/oprofile/common.c kernel/perf_event.c
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpixf.h2
-rw-r--r--include/asm-generic/hardirq.h2
-rw-r--r--include/asm-generic/vmlinux.lds.h10
-rw-r--r--include/drm/drmP.h29
-rw-r--r--include/drm/drm_pciids.h2
-rw-r--r--include/linux/cpuidle.h1
-rw-r--r--include/linux/dma-mapping.h4
-rw-r--r--include/linux/dmaengine.h2
-rw-r--r--include/linux/dynamic_debug.h39
-rw-r--r--include/linux/ftrace_event.h8
-rw-r--r--include/linux/interrupt.h8
-rw-r--r--include/linux/jump_label.h64
-rw-r--r--include/linux/module.h10
-rw-r--r--include/linux/netlink.h4
-rw-r--r--include/linux/pci_ids.h3
-rw-r--r--include/linux/percpu.h9
-rw-r--r--include/linux/perf_event.h155
-rw-r--r--include/linux/rcupdate.h2
-rw-r--r--include/linux/sched.h9
-rw-r--r--include/linux/socket.h2
-rw-r--r--include/linux/stop_machine.h10
-rw-r--r--include/linux/tracepoint.h5
-rw-r--r--include/linux/wait.h1
-rw-r--r--include/net/addrconf.h1
-rw-r--r--include/net/dst.h1
-rw-r--r--include/net/route.h2
-rw-r--r--include/net/xfrm.h4
-rw-r--r--include/trace/events/irq.h26
-rw-r--r--include/trace/events/napi.h25
-rw-r--r--include/trace/events/net.h82
-rw-r--r--include/trace/events/power.h90
-rw-r--r--include/trace/events/skb.h17
32 files changed, 517 insertions, 112 deletions
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index c0786d446a00..984cdc62e30b 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -55,7 +55,7 @@
55extern u8 acpi_gbl_permanent_mmap; 55extern u8 acpi_gbl_permanent_mmap;
56 56
57/* 57/*
58 * Globals that are publically available, allowing for 58 * Globals that are publicly available, allowing for
59 * run time configuration 59 * run time configuration
60 */ 60 */
61extern u32 acpi_dbg_level; 61extern u32 acpi_dbg_level;
diff --git a/include/asm-generic/hardirq.h b/include/asm-generic/hardirq.h
index 62f59080e5cc..04d0a977cd43 100644
--- a/include/asm-generic/hardirq.h
+++ b/include/asm-generic/hardirq.h
@@ -3,13 +3,13 @@
3 3
4#include <linux/cache.h> 4#include <linux/cache.h>
5#include <linux/threads.h> 5#include <linux/threads.h>
6#include <linux/irq.h>
7 6
8typedef struct { 7typedef struct {
9 unsigned int __softirq_pending; 8 unsigned int __softirq_pending;
10} ____cacheline_aligned irq_cpustat_t; 9} ____cacheline_aligned irq_cpustat_t;
11 10
12#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ 11#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
12#include <linux/irq.h>
13 13
14#ifndef ack_bad_irq 14#ifndef ack_bad_irq
15static inline void ack_bad_irq(unsigned int irq) 15static inline void ack_bad_irq(unsigned int irq)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 8a92a170fb7d..ef2af9948eac 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -220,6 +220,8 @@
220 \ 220 \
221 BUG_TABLE \ 221 BUG_TABLE \
222 \ 222 \
223 JUMP_TABLE \
224 \
223 /* PCI quirks */ \ 225 /* PCI quirks */ \
224 .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \ 226 .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \
225 VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \ 227 VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \
@@ -563,6 +565,14 @@
563#define BUG_TABLE 565#define BUG_TABLE
564#endif 566#endif
565 567
568#define JUMP_TABLE \
569 . = ALIGN(8); \
570 __jump_table : AT(ADDR(__jump_table) - LOAD_OFFSET) { \
571 VMLINUX_SYMBOL(__start___jump_table) = .; \
572 *(__jump_table) \
573 VMLINUX_SYMBOL(__stop___jump_table) = .; \
574 }
575
566#ifdef CONFIG_PM_TRACE 576#ifdef CONFIG_PM_TRACE
567#define TRACEDATA \ 577#define TRACEDATA \
568 . = ALIGN(4); \ 578 . = ALIGN(4); \
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 7809d230adee..4c9461a4f9e6 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -612,7 +612,7 @@ struct drm_gem_object {
612 struct kref refcount; 612 struct kref refcount;
613 613
614 /** Handle count of this object. Each handle also holds a reference */ 614 /** Handle count of this object. Each handle also holds a reference */
615 struct kref handlecount; 615 atomic_t handle_count; /* number of handles on this object */
616 616
617 /** Related drm device */ 617 /** Related drm device */
618 struct drm_device *dev; 618 struct drm_device *dev;
@@ -808,7 +808,6 @@ struct drm_driver {
808 */ 808 */
809 int (*gem_init_object) (struct drm_gem_object *obj); 809 int (*gem_init_object) (struct drm_gem_object *obj);
810 void (*gem_free_object) (struct drm_gem_object *obj); 810 void (*gem_free_object) (struct drm_gem_object *obj);
811 void (*gem_free_object_unlocked) (struct drm_gem_object *obj);
812 811
813 /* vga arb irq handler */ 812 /* vga arb irq handler */
814 void (*vgaarb_irq)(struct drm_device *dev, bool state); 813 void (*vgaarb_irq)(struct drm_device *dev, bool state);
@@ -1175,6 +1174,7 @@ extern int drm_release(struct inode *inode, struct file *filp);
1175extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); 1174extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);
1176extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); 1175extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma);
1177extern void drm_vm_open_locked(struct vm_area_struct *vma); 1176extern void drm_vm_open_locked(struct vm_area_struct *vma);
1177extern void drm_vm_close_locked(struct vm_area_struct *vma);
1178extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map); 1178extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map);
1179extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev); 1179extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev);
1180extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); 1180extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
@@ -1455,12 +1455,11 @@ int drm_gem_init(struct drm_device *dev);
1455void drm_gem_destroy(struct drm_device *dev); 1455void drm_gem_destroy(struct drm_device *dev);
1456void drm_gem_object_release(struct drm_gem_object *obj); 1456void drm_gem_object_release(struct drm_gem_object *obj);
1457void drm_gem_object_free(struct kref *kref); 1457void drm_gem_object_free(struct kref *kref);
1458void drm_gem_object_free_unlocked(struct kref *kref);
1459struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev, 1458struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev,
1460 size_t size); 1459 size_t size);
1461int drm_gem_object_init(struct drm_device *dev, 1460int drm_gem_object_init(struct drm_device *dev,
1462 struct drm_gem_object *obj, size_t size); 1461 struct drm_gem_object *obj, size_t size);
1463void drm_gem_object_handle_free(struct kref *kref); 1462void drm_gem_object_handle_free(struct drm_gem_object *obj);
1464void drm_gem_vm_open(struct vm_area_struct *vma); 1463void drm_gem_vm_open(struct vm_area_struct *vma);
1465void drm_gem_vm_close(struct vm_area_struct *vma); 1464void drm_gem_vm_close(struct vm_area_struct *vma);
1466int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); 1465int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
@@ -1483,8 +1482,12 @@ drm_gem_object_unreference(struct drm_gem_object *obj)
1483static inline void 1482static inline void
1484drm_gem_object_unreference_unlocked(struct drm_gem_object *obj) 1483drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)
1485{ 1484{
1486 if (obj != NULL) 1485 if (obj != NULL) {
1487 kref_put(&obj->refcount, drm_gem_object_free_unlocked); 1486 struct drm_device *dev = obj->dev;
1487 mutex_lock(&dev->struct_mutex);
1488 kref_put(&obj->refcount, drm_gem_object_free);
1489 mutex_unlock(&dev->struct_mutex);
1490 }
1488} 1491}
1489 1492
1490int drm_gem_handle_create(struct drm_file *file_priv, 1493int drm_gem_handle_create(struct drm_file *file_priv,
@@ -1495,7 +1498,7 @@ static inline void
1495drm_gem_object_handle_reference(struct drm_gem_object *obj) 1498drm_gem_object_handle_reference(struct drm_gem_object *obj)
1496{ 1499{
1497 drm_gem_object_reference(obj); 1500 drm_gem_object_reference(obj);
1498 kref_get(&obj->handlecount); 1501 atomic_inc(&obj->handle_count);
1499} 1502}
1500 1503
1501static inline void 1504static inline void
@@ -1504,12 +1507,15 @@ drm_gem_object_handle_unreference(struct drm_gem_object *obj)
1504 if (obj == NULL) 1507 if (obj == NULL)
1505 return; 1508 return;
1506 1509
1510 if (atomic_read(&obj->handle_count) == 0)
1511 return;
1507 /* 1512 /*
1508 * Must bump handle count first as this may be the last 1513 * Must bump handle count first as this may be the last
1509 * ref, in which case the object would disappear before we 1514 * ref, in which case the object would disappear before we
1510 * checked for a name 1515 * checked for a name
1511 */ 1516 */
1512 kref_put(&obj->handlecount, drm_gem_object_handle_free); 1517 if (atomic_dec_and_test(&obj->handle_count))
1518 drm_gem_object_handle_free(obj);
1513 drm_gem_object_unreference(obj); 1519 drm_gem_object_unreference(obj);
1514} 1520}
1515 1521
@@ -1519,12 +1525,17 @@ drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj)
1519 if (obj == NULL) 1525 if (obj == NULL)
1520 return; 1526 return;
1521 1527
1528 if (atomic_read(&obj->handle_count) == 0)
1529 return;
1530
1522 /* 1531 /*
1523 * Must bump handle count first as this may be the last 1532 * Must bump handle count first as this may be the last
1524 * ref, in which case the object would disappear before we 1533 * ref, in which case the object would disappear before we
1525 * checked for a name 1534 * checked for a name
1526 */ 1535 */
1527 kref_put(&obj->handlecount, drm_gem_object_handle_free); 1536
1537 if (atomic_dec_and_test(&obj->handle_count))
1538 drm_gem_object_handle_free(obj);
1528 drm_gem_object_unreference_unlocked(obj); 1539 drm_gem_object_unreference_unlocked(obj);
1529} 1540}
1530 1541
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index 3a9940ef728b..883c1d439899 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -85,7 +85,6 @@
85 {0x1002, 0x5460, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ 85 {0x1002, 0x5460, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
86 {0x1002, 0x5462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ 86 {0x1002, 0x5462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
87 {0x1002, 0x5464, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ 87 {0x1002, 0x5464, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
88 {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
89 {0x1002, 0x5548, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \ 88 {0x1002, 0x5548, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
90 {0x1002, 0x5549, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \ 89 {0x1002, 0x5549, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
91 {0x1002, 0x554A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \ 90 {0x1002, 0x554A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
@@ -103,6 +102,7 @@
103 {0x1002, 0x564F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 102 {0x1002, 0x564F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
104 {0x1002, 0x5652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 103 {0x1002, 0x5652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
105 {0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 104 {0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
105 {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \
106 {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \ 106 {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \
107 {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ 107 {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \
108 {0x1002, 0x5954, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 108 {0x1002, 0x5954, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 36ca9721a0c2..1be416bbbb82 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -53,6 +53,7 @@ struct cpuidle_state {
53#define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */ 53#define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */
54#define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */ 54#define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */
55#define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */ 55#define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */
56#define CPUIDLE_FLAG_TLB_FLUSHED (0x200) /* tlb will be flushed */
56 57
57#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) 58#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
58 59
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index ce29b8151198..ba8319ae5fcc 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -102,6 +102,9 @@ static inline u64 dma_get_mask(struct device *dev)
102 return DMA_BIT_MASK(32); 102 return DMA_BIT_MASK(32);
103} 103}
104 104
105#ifdef ARCH_HAS_DMA_SET_COHERENT_MASK
106int dma_set_coherent_mask(struct device *dev, u64 mask);
107#else
105static inline int dma_set_coherent_mask(struct device *dev, u64 mask) 108static inline int dma_set_coherent_mask(struct device *dev, u64 mask)
106{ 109{
107 if (!dma_supported(dev, mask)) 110 if (!dma_supported(dev, mask))
@@ -109,6 +112,7 @@ static inline int dma_set_coherent_mask(struct device *dev, u64 mask)
109 dev->coherent_dma_mask = mask; 112 dev->coherent_dma_mask = mask;
110 return 0; 113 return 0;
111} 114}
115#endif
112 116
113extern u64 dma_get_required_mask(struct device *dev); 117extern u64 dma_get_required_mask(struct device *dev);
114 118
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index c61d4ca27bcc..e2106495cc11 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -548,7 +548,7 @@ static inline bool dma_dev_has_pq_continue(struct dma_device *dma)
548 return (dma->max_pq & DMA_HAS_PQ_CONTINUE) == DMA_HAS_PQ_CONTINUE; 548 return (dma->max_pq & DMA_HAS_PQ_CONTINUE) == DMA_HAS_PQ_CONTINUE;
549} 549}
550 550
551static unsigned short dma_dev_to_maxpq(struct dma_device *dma) 551static inline unsigned short dma_dev_to_maxpq(struct dma_device *dma)
552{ 552{
553 return dma->max_pq & ~DMA_HAS_PQ_CONTINUE; 553 return dma->max_pq & ~DMA_HAS_PQ_CONTINUE;
554} 554}
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index 52c0da4bdd18..bef3cda44c4c 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -1,6 +1,8 @@
1#ifndef _DYNAMIC_DEBUG_H 1#ifndef _DYNAMIC_DEBUG_H
2#define _DYNAMIC_DEBUG_H 2#define _DYNAMIC_DEBUG_H
3 3
4#include <linux/jump_label.h>
5
4/* dynamic_printk_enabled, and dynamic_printk_enabled2 are bitmasks in which 6/* dynamic_printk_enabled, and dynamic_printk_enabled2 are bitmasks in which
5 * bit n is set to 1 if any modname hashes into the bucket n, 0 otherwise. They 7 * bit n is set to 1 if any modname hashes into the bucket n, 0 otherwise. They
6 * use independent hash functions, to reduce the chance of false positives. 8 * use independent hash functions, to reduce the chance of false positives.
@@ -22,8 +24,6 @@ struct _ddebug {
22 const char *function; 24 const char *function;
23 const char *filename; 25 const char *filename;
24 const char *format; 26 const char *format;
25 char primary_hash;
26 char secondary_hash;
27 unsigned int lineno:24; 27 unsigned int lineno:24;
28 /* 28 /*
29 * The flags field controls the behaviour at the callsite. 29 * The flags field controls the behaviour at the callsite.
@@ -33,6 +33,7 @@ struct _ddebug {
33#define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */ 33#define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */
34#define _DPRINTK_FLAGS_DEFAULT 0 34#define _DPRINTK_FLAGS_DEFAULT 0
35 unsigned int flags:8; 35 unsigned int flags:8;
36 char enabled;
36} __attribute__((aligned(8))); 37} __attribute__((aligned(8)));
37 38
38 39
@@ -42,33 +43,35 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n,
42#if defined(CONFIG_DYNAMIC_DEBUG) 43#if defined(CONFIG_DYNAMIC_DEBUG)
43extern int ddebug_remove_module(const char *mod_name); 44extern int ddebug_remove_module(const char *mod_name);
44 45
45#define __dynamic_dbg_enabled(dd) ({ \
46 int __ret = 0; \
47 if (unlikely((dynamic_debug_enabled & (1LL << DEBUG_HASH)) && \
48 (dynamic_debug_enabled2 & (1LL << DEBUG_HASH2)))) \
49 if (unlikely(dd.flags)) \
50 __ret = 1; \
51 __ret; })
52
53#define dynamic_pr_debug(fmt, ...) do { \ 46#define dynamic_pr_debug(fmt, ...) do { \
47 __label__ do_printk; \
48 __label__ out; \
54 static struct _ddebug descriptor \ 49 static struct _ddebug descriptor \
55 __used \ 50 __used \
56 __attribute__((section("__verbose"), aligned(8))) = \ 51 __attribute__((section("__verbose"), aligned(8))) = \
57 { KBUILD_MODNAME, __func__, __FILE__, fmt, DEBUG_HASH, \ 52 { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \
58 DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ 53 _DPRINTK_FLAGS_DEFAULT }; \
59 if (__dynamic_dbg_enabled(descriptor)) \ 54 JUMP_LABEL(&descriptor.enabled, do_printk); \
60 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \ 55 goto out; \
56do_printk: \
57 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
58out: ; \
61 } while (0) 59 } while (0)
62 60
63 61
64#define dynamic_dev_dbg(dev, fmt, ...) do { \ 62#define dynamic_dev_dbg(dev, fmt, ...) do { \
63 __label__ do_printk; \
64 __label__ out; \
65 static struct _ddebug descriptor \ 65 static struct _ddebug descriptor \
66 __used \ 66 __used \
67 __attribute__((section("__verbose"), aligned(8))) = \ 67 __attribute__((section("__verbose"), aligned(8))) = \
68 { KBUILD_MODNAME, __func__, __FILE__, fmt, DEBUG_HASH, \ 68 { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \
69 DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ 69 _DPRINTK_FLAGS_DEFAULT }; \
70 if (__dynamic_dbg_enabled(descriptor)) \ 70 JUMP_LABEL(&descriptor.enabled, do_printk); \
71 dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ 71 goto out; \
72do_printk: \
73 dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \
74out: ; \
72 } while (0) 75 } while (0)
73 76
74#else 77#else
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 02b8b24f8f51..8beabb958f61 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -191,8 +191,8 @@ struct ftrace_event_call {
191 unsigned int flags; 191 unsigned int flags;
192 192
193#ifdef CONFIG_PERF_EVENTS 193#ifdef CONFIG_PERF_EVENTS
194 int perf_refcount; 194 int perf_refcount;
195 struct hlist_head *perf_events; 195 struct hlist_head __percpu *perf_events;
196#endif 196#endif
197}; 197};
198 198
@@ -252,8 +252,8 @@ DECLARE_PER_CPU(struct pt_regs, perf_trace_regs);
252 252
253extern int perf_trace_init(struct perf_event *event); 253extern int perf_trace_init(struct perf_event *event);
254extern void perf_trace_destroy(struct perf_event *event); 254extern void perf_trace_destroy(struct perf_event *event);
255extern int perf_trace_enable(struct perf_event *event); 255extern int perf_trace_add(struct perf_event *event, int flags);
256extern void perf_trace_disable(struct perf_event *event); 256extern void perf_trace_del(struct perf_event *event, int flags);
257extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, 257extern int ftrace_profile_set_filter(struct perf_event *event, int event_id,
258 char *filter_str); 258 char *filter_str);
259extern void ftrace_profile_free_filter(struct perf_event *event); 259extern void ftrace_profile_free_filter(struct perf_event *event);
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index a0384a4d1e6f..531495db1708 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -18,6 +18,7 @@
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/system.h> 20#include <asm/system.h>
21#include <trace/events/irq.h>
21 22
22/* 23/*
23 * These correspond to the IORESOURCE_IRQ_* defines in 24 * These correspond to the IORESOURCE_IRQ_* defines in
@@ -407,7 +408,12 @@ asmlinkage void do_softirq(void);
407asmlinkage void __do_softirq(void); 408asmlinkage void __do_softirq(void);
408extern void open_softirq(int nr, void (*action)(struct softirq_action *)); 409extern void open_softirq(int nr, void (*action)(struct softirq_action *));
409extern void softirq_init(void); 410extern void softirq_init(void);
410#define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0) 411static inline void __raise_softirq_irqoff(unsigned int nr)
412{
413 trace_softirq_raise((struct softirq_action *)(unsigned long)nr, NULL);
414 or_softirq_pending(1UL << nr);
415}
416
411extern void raise_softirq_irqoff(unsigned int nr); 417extern void raise_softirq_irqoff(unsigned int nr);
412extern void raise_softirq(unsigned int nr); 418extern void raise_softirq(unsigned int nr);
413extern void wakeup_softirqd(void); 419extern void wakeup_softirqd(void);
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
new file mode 100644
index 000000000000..b72cd9f92c2e
--- /dev/null
+++ b/include/linux/jump_label.h
@@ -0,0 +1,64 @@
1#ifndef _LINUX_JUMP_LABEL_H
2#define _LINUX_JUMP_LABEL_H
3
4#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_HAVE_ARCH_JUMP_LABEL)
5# include <asm/jump_label.h>
6# define HAVE_JUMP_LABEL
7#endif
8
9enum jump_label_type {
10 JUMP_LABEL_ENABLE,
11 JUMP_LABEL_DISABLE
12};
13
14struct module;
15
16#ifdef HAVE_JUMP_LABEL
17
18extern struct jump_entry __start___jump_table[];
19extern struct jump_entry __stop___jump_table[];
20
21extern void arch_jump_label_transform(struct jump_entry *entry,
22 enum jump_label_type type);
23extern void arch_jump_label_text_poke_early(jump_label_t addr);
24extern void jump_label_update(unsigned long key, enum jump_label_type type);
25extern void jump_label_apply_nops(struct module *mod);
26extern int jump_label_text_reserved(void *start, void *end);
27
28#define enable_jump_label(key) \
29 jump_label_update((unsigned long)key, JUMP_LABEL_ENABLE);
30
31#define disable_jump_label(key) \
32 jump_label_update((unsigned long)key, JUMP_LABEL_DISABLE);
33
34#else
35
36#define JUMP_LABEL(key, label) \
37do { \
38 if (unlikely(*key)) \
39 goto label; \
40} while (0)
41
42#define enable_jump_label(cond_var) \
43do { \
44 *(cond_var) = 1; \
45} while (0)
46
47#define disable_jump_label(cond_var) \
48do { \
49 *(cond_var) = 0; \
50} while (0)
51
52static inline int jump_label_apply_nops(struct module *mod)
53{
54 return 0;
55}
56
57static inline int jump_label_text_reserved(void *start, void *end)
58{
59 return 0;
60}
61
62#endif
63
64#endif
diff --git a/include/linux/module.h b/include/linux/module.h
index 8a6b9fdc7ffa..b29e7458b966 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -350,7 +350,10 @@ struct module
350 struct tracepoint *tracepoints; 350 struct tracepoint *tracepoints;
351 unsigned int num_tracepoints; 351 unsigned int num_tracepoints;
352#endif 352#endif
353 353#ifdef HAVE_JUMP_LABEL
354 struct jump_entry *jump_entries;
355 unsigned int num_jump_entries;
356#endif
354#ifdef CONFIG_TRACING 357#ifdef CONFIG_TRACING
355 const char **trace_bprintk_fmt_start; 358 const char **trace_bprintk_fmt_start;
356 unsigned int num_trace_bprintk_fmt; 359 unsigned int num_trace_bprintk_fmt;
@@ -686,17 +689,16 @@ extern int module_sysfs_initialized;
686 689
687 690
688#ifdef CONFIG_GENERIC_BUG 691#ifdef CONFIG_GENERIC_BUG
689int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, 692void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
690 struct module *); 693 struct module *);
691void module_bug_cleanup(struct module *); 694void module_bug_cleanup(struct module *);
692 695
693#else /* !CONFIG_GENERIC_BUG */ 696#else /* !CONFIG_GENERIC_BUG */
694 697
695static inline int module_bug_finalize(const Elf_Ehdr *hdr, 698static inline void module_bug_finalize(const Elf_Ehdr *hdr,
696 const Elf_Shdr *sechdrs, 699 const Elf_Shdr *sechdrs,
697 struct module *mod) 700 struct module *mod)
698{ 701{
699 return 0;
700} 702}
701static inline void module_bug_cleanup(struct module *mod) {} 703static inline void module_bug_cleanup(struct module *mod) {}
702#endif /* CONFIG_GENERIC_BUG */ 704#endif /* CONFIG_GENERIC_BUG */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 59d066936ab9..123566912d73 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -27,8 +27,6 @@
27 27
28#define MAX_LINKS 32 28#define MAX_LINKS 32
29 29
30struct net;
31
32struct sockaddr_nl { 30struct sockaddr_nl {
33 sa_family_t nl_family; /* AF_NETLINK */ 31 sa_family_t nl_family; /* AF_NETLINK */
34 unsigned short nl_pad; /* zero */ 32 unsigned short nl_pad; /* zero */
@@ -151,6 +149,8 @@ struct nlattr {
151#include <linux/capability.h> 149#include <linux/capability.h>
152#include <linux/skbuff.h> 150#include <linux/skbuff.h>
153 151
152struct net;
153
154static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb) 154static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb)
155{ 155{
156 return (struct nlmsghdr *)skb->data; 156 return (struct nlmsghdr *)skb->data;
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 10d33309e9a6..570fddeb0388 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -393,6 +393,9 @@
393#define PCI_DEVICE_ID_VLSI_82C147 0x0105 393#define PCI_DEVICE_ID_VLSI_82C147 0x0105
394#define PCI_DEVICE_ID_VLSI_VAS96011 0x0702 394#define PCI_DEVICE_ID_VLSI_VAS96011 0x0702
395 395
396/* AMD RD890 Chipset */
397#define PCI_DEVICE_ID_RD890_IOMMU 0x5a23
398
396#define PCI_VENDOR_ID_ADL 0x1005 399#define PCI_VENDOR_ID_ADL 0x1005
397#define PCI_DEVICE_ID_ADL_2301 0x2301 400#define PCI_DEVICE_ID_ADL_2301 0x2301
398 401
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 49466b13c5c6..0eb50832aa00 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -39,6 +39,15 @@
39 preempt_enable(); \ 39 preempt_enable(); \
40} while (0) 40} while (0)
41 41
42#define get_cpu_ptr(var) ({ \
43 preempt_disable(); \
44 this_cpu_ptr(var); })
45
46#define put_cpu_ptr(var) do { \
47 (void)(var); \
48 preempt_enable(); \
49} while (0)
50
42#ifdef CONFIG_SMP 51#ifdef CONFIG_SMP
43 52
44/* minimum unit size, also is the maximum supported allocation size */ 53/* minimum unit size, also is the maximum supported allocation size */
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 33f08dafda2f..a9227e985207 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -529,7 +529,6 @@ struct hw_perf_event {
529 int last_cpu; 529 int last_cpu;
530 }; 530 };
531 struct { /* software */ 531 struct { /* software */
532 s64 remaining;
533 struct hrtimer hrtimer; 532 struct hrtimer hrtimer;
534 }; 533 };
535#ifdef CONFIG_HAVE_HW_BREAKPOINT 534#ifdef CONFIG_HAVE_HW_BREAKPOINT
@@ -539,6 +538,7 @@ struct hw_perf_event {
539 }; 538 };
540#endif 539#endif
541 }; 540 };
541 int state;
542 local64_t prev_count; 542 local64_t prev_count;
543 u64 sample_period; 543 u64 sample_period;
544 u64 last_period; 544 u64 last_period;
@@ -550,6 +550,13 @@ struct hw_perf_event {
550#endif 550#endif
551}; 551};
552 552
553/*
554 * hw_perf_event::state flags
555 */
556#define PERF_HES_STOPPED 0x01 /* the counter is stopped */
557#define PERF_HES_UPTODATE 0x02 /* event->count up-to-date */
558#define PERF_HES_ARCH 0x04
559
553struct perf_event; 560struct perf_event;
554 561
555/* 562/*
@@ -561,36 +568,70 @@ struct perf_event;
561 * struct pmu - generic performance monitoring unit 568 * struct pmu - generic performance monitoring unit
562 */ 569 */
563struct pmu { 570struct pmu {
564 int (*enable) (struct perf_event *event); 571 struct list_head entry;
565 void (*disable) (struct perf_event *event); 572
566 int (*start) (struct perf_event *event); 573 int * __percpu pmu_disable_count;
567 void (*stop) (struct perf_event *event); 574 struct perf_cpu_context * __percpu pmu_cpu_context;
568 void (*read) (struct perf_event *event); 575 int task_ctx_nr;
569 void (*unthrottle) (struct perf_event *event);
570 576
571 /* 577 /*
572 * Group events scheduling is treated as a transaction, add group 578 * Fully disable/enable this PMU, can be used to protect from the PMI
573 * events as a whole and perform one schedulability test. If the test 579 * as well as for lazy/batch writing of the MSRs.
574 * fails, roll back the whole group
575 */ 580 */
581 void (*pmu_enable) (struct pmu *pmu); /* optional */
582 void (*pmu_disable) (struct pmu *pmu); /* optional */
576 583
577 /* 584 /*
578 * Start the transaction, after this ->enable() doesn't need 585 * Try and initialize the event for this PMU.
579 * to do schedulability tests. 586 * Should return -ENOENT when the @event doesn't match this PMU.
580 */ 587 */
581 void (*start_txn) (const struct pmu *pmu); 588 int (*event_init) (struct perf_event *event);
589
590#define PERF_EF_START 0x01 /* start the counter when adding */
591#define PERF_EF_RELOAD 0x02 /* reload the counter when starting */
592#define PERF_EF_UPDATE 0x04 /* update the counter when stopping */
593
582 /* 594 /*
583 * If ->start_txn() disabled the ->enable() schedulability test 595 * Adds/Removes a counter to/from the PMU, can be done inside
596 * a transaction, see the ->*_txn() methods.
597 */
598 int (*add) (struct perf_event *event, int flags);
599 void (*del) (struct perf_event *event, int flags);
600
601 /*
602 * Starts/Stops a counter present on the PMU. The PMI handler
603 * should stop the counter when perf_event_overflow() returns
604 * !0. ->start() will be used to continue.
605 */
606 void (*start) (struct perf_event *event, int flags);
607 void (*stop) (struct perf_event *event, int flags);
608
609 /*
610 * Updates the counter value of the event.
611 */
612 void (*read) (struct perf_event *event);
613
614 /*
615 * Group events scheduling is treated as a transaction, add
616 * group events as a whole and perform one schedulability test.
617 * If the test fails, roll back the whole group
618 *
619 * Start the transaction, after this ->add() doesn't need to
620 * do schedulability tests.
621 */
622 void (*start_txn) (struct pmu *pmu); /* optional */
623 /*
624 * If ->start_txn() disabled the ->add() schedulability test
584 * then ->commit_txn() is required to perform one. On success 625 * then ->commit_txn() is required to perform one. On success
585 * the transaction is closed. On error the transaction is kept 626 * the transaction is closed. On error the transaction is kept
586 * open until ->cancel_txn() is called. 627 * open until ->cancel_txn() is called.
587 */ 628 */
588 int (*commit_txn) (const struct pmu *pmu); 629 int (*commit_txn) (struct pmu *pmu); /* optional */
589 /* 630 /*
590 * Will cancel the transaction, assumes ->disable() is called for 631 * Will cancel the transaction, assumes ->del() is called
591 * each successfull ->enable() during the transaction. 632 * for each successfull ->add() during the transaction.
592 */ 633 */
593 void (*cancel_txn) (const struct pmu *pmu); 634 void (*cancel_txn) (struct pmu *pmu); /* optional */
594}; 635};
595 636
596/** 637/**
@@ -669,7 +710,7 @@ struct perf_event {
669 int nr_siblings; 710 int nr_siblings;
670 int group_flags; 711 int group_flags;
671 struct perf_event *group_leader; 712 struct perf_event *group_leader;
672 const struct pmu *pmu; 713 struct pmu *pmu;
673 714
674 enum perf_event_active_state state; 715 enum perf_event_active_state state;
675 unsigned int attach_state; 716 unsigned int attach_state;
@@ -763,12 +804,19 @@ struct perf_event {
763#endif /* CONFIG_PERF_EVENTS */ 804#endif /* CONFIG_PERF_EVENTS */
764}; 805};
765 806
807enum perf_event_context_type {
808 task_context,
809 cpu_context,
810};
811
766/** 812/**
767 * struct perf_event_context - event context structure 813 * struct perf_event_context - event context structure
768 * 814 *
769 * Used as a container for task events and CPU events as well: 815 * Used as a container for task events and CPU events as well:
770 */ 816 */
771struct perf_event_context { 817struct perf_event_context {
818 enum perf_event_context_type type;
819 struct pmu *pmu;
772 /* 820 /*
773 * Protect the states of the events in the list, 821 * Protect the states of the events in the list,
774 * nr_active, and the list: 822 * nr_active, and the list:
@@ -808,6 +856,12 @@ struct perf_event_context {
808 struct rcu_head rcu_head; 856 struct rcu_head rcu_head;
809}; 857};
810 858
859/*
860 * Number of contexts where an event can trigger:
861 * task, softirq, hardirq, nmi.
862 */
863#define PERF_NR_CONTEXTS 4
864
811/** 865/**
812 * struct perf_event_cpu_context - per cpu event context structure 866 * struct perf_event_cpu_context - per cpu event context structure
813 */ 867 */
@@ -815,18 +869,9 @@ struct perf_cpu_context {
815 struct perf_event_context ctx; 869 struct perf_event_context ctx;
816 struct perf_event_context *task_ctx; 870 struct perf_event_context *task_ctx;
817 int active_oncpu; 871 int active_oncpu;
818 int max_pertask;
819 int exclusive; 872 int exclusive;
820 struct swevent_hlist *swevent_hlist; 873 struct list_head rotation_list;
821 struct mutex hlist_mutex; 874 int jiffies_interval;
822 int hlist_refcount;
823
824 /*
825 * Recursion avoidance:
826 *
827 * task, softirq, irq, nmi context
828 */
829 int recursion[4];
830}; 875};
831 876
832struct perf_output_handle { 877struct perf_output_handle {
@@ -842,28 +887,22 @@ struct perf_output_handle {
842 887
843#ifdef CONFIG_PERF_EVENTS 888#ifdef CONFIG_PERF_EVENTS
844 889
845/* 890extern int perf_pmu_register(struct pmu *pmu);
846 * Set by architecture code: 891extern void perf_pmu_unregister(struct pmu *pmu);
847 */
848extern int perf_max_events;
849
850extern const struct pmu *hw_perf_event_init(struct perf_event *event);
851 892
852extern int perf_num_counters(void); 893extern int perf_num_counters(void);
853extern const char *perf_pmu_name(void); 894extern const char *perf_pmu_name(void);
854extern void perf_event_task_sched_in(struct task_struct *task); 895extern void perf_event_task_sched_in(struct task_struct *task);
855extern void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); 896extern void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next);
856extern void perf_event_task_tick(struct task_struct *task);
857extern int perf_event_init_task(struct task_struct *child); 897extern int perf_event_init_task(struct task_struct *child);
858extern void perf_event_exit_task(struct task_struct *child); 898extern void perf_event_exit_task(struct task_struct *child);
859extern void perf_event_free_task(struct task_struct *task); 899extern void perf_event_free_task(struct task_struct *task);
900extern void perf_event_delayed_put(struct task_struct *task);
860extern void set_perf_event_pending(void); 901extern void set_perf_event_pending(void);
861extern void perf_event_do_pending(void); 902extern void perf_event_do_pending(void);
862extern void perf_event_print_debug(void); 903extern void perf_event_print_debug(void);
863extern void __perf_disable(void); 904extern void perf_pmu_disable(struct pmu *pmu);
864extern bool __perf_enable(void); 905extern void perf_pmu_enable(struct pmu *pmu);
865extern void perf_disable(void);
866extern void perf_enable(void);
867extern int perf_event_task_disable(void); 906extern int perf_event_task_disable(void);
868extern int perf_event_task_enable(void); 907extern int perf_event_task_enable(void);
869extern void perf_event_update_userpage(struct perf_event *event); 908extern void perf_event_update_userpage(struct perf_event *event);
@@ -871,7 +910,7 @@ extern int perf_event_release_kernel(struct perf_event *event);
871extern struct perf_event * 910extern struct perf_event *
872perf_event_create_kernel_counter(struct perf_event_attr *attr, 911perf_event_create_kernel_counter(struct perf_event_attr *attr,
873 int cpu, 912 int cpu,
874 pid_t pid, 913 struct task_struct *task,
875 perf_overflow_handler_t callback); 914 perf_overflow_handler_t callback);
876extern u64 perf_event_read_value(struct perf_event *event, 915extern u64 perf_event_read_value(struct perf_event *event,
877 u64 *enabled, u64 *running); 916 u64 *enabled, u64 *running);
@@ -922,14 +961,7 @@ extern int perf_event_overflow(struct perf_event *event, int nmi,
922 */ 961 */
923static inline int is_software_event(struct perf_event *event) 962static inline int is_software_event(struct perf_event *event)
924{ 963{
925 switch (event->attr.type) { 964 return event->pmu->task_ctx_nr == perf_sw_context;
926 case PERF_TYPE_SOFTWARE:
927 case PERF_TYPE_TRACEPOINT:
928 /* for now the breakpoint stuff also works as software event */
929 case PERF_TYPE_BREAKPOINT:
930 return 1;
931 }
932 return 0;
933} 965}
934 966
935extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; 967extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX];
@@ -978,7 +1010,21 @@ extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks
978extern void perf_event_comm(struct task_struct *tsk); 1010extern void perf_event_comm(struct task_struct *tsk);
979extern void perf_event_fork(struct task_struct *tsk); 1011extern void perf_event_fork(struct task_struct *tsk);
980 1012
981extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs); 1013/* Callchains */
1014DECLARE_PER_CPU(struct perf_callchain_entry, perf_callchain_entry);
1015
1016extern void perf_callchain_user(struct perf_callchain_entry *entry,
1017 struct pt_regs *regs);
1018extern void perf_callchain_kernel(struct perf_callchain_entry *entry,
1019 struct pt_regs *regs);
1020
1021
1022static inline void
1023perf_callchain_store(struct perf_callchain_entry *entry, u64 ip)
1024{
1025 if (entry->nr < PERF_MAX_STACK_DEPTH)
1026 entry->ip[entry->nr++] = ip;
1027}
982 1028
983extern int sysctl_perf_event_paranoid; 1029extern int sysctl_perf_event_paranoid;
984extern int sysctl_perf_event_mlock; 1030extern int sysctl_perf_event_mlock;
@@ -1021,21 +1067,19 @@ extern int perf_swevent_get_recursion_context(void);
1021extern void perf_swevent_put_recursion_context(int rctx); 1067extern void perf_swevent_put_recursion_context(int rctx);
1022extern void perf_event_enable(struct perf_event *event); 1068extern void perf_event_enable(struct perf_event *event);
1023extern void perf_event_disable(struct perf_event *event); 1069extern void perf_event_disable(struct perf_event *event);
1070extern void perf_event_task_tick(void);
1024#else 1071#else
1025static inline void 1072static inline void
1026perf_event_task_sched_in(struct task_struct *task) { } 1073perf_event_task_sched_in(struct task_struct *task) { }
1027static inline void 1074static inline void
1028perf_event_task_sched_out(struct task_struct *task, 1075perf_event_task_sched_out(struct task_struct *task,
1029 struct task_struct *next) { } 1076 struct task_struct *next) { }
1030static inline void
1031perf_event_task_tick(struct task_struct *task) { }
1032static inline int perf_event_init_task(struct task_struct *child) { return 0; } 1077static inline int perf_event_init_task(struct task_struct *child) { return 0; }
1033static inline void perf_event_exit_task(struct task_struct *child) { } 1078static inline void perf_event_exit_task(struct task_struct *child) { }
1034static inline void perf_event_free_task(struct task_struct *task) { } 1079static inline void perf_event_free_task(struct task_struct *task) { }
1080static inline void perf_event_delayed_put(struct task_struct *task) { }
1035static inline void perf_event_do_pending(void) { } 1081static inline void perf_event_do_pending(void) { }
1036static inline void perf_event_print_debug(void) { } 1082static inline void perf_event_print_debug(void) { }
1037static inline void perf_disable(void) { }
1038static inline void perf_enable(void) { }
1039static inline int perf_event_task_disable(void) { return -EINVAL; } 1083static inline int perf_event_task_disable(void) { return -EINVAL; }
1040static inline int perf_event_task_enable(void) { return -EINVAL; } 1084static inline int perf_event_task_enable(void) { return -EINVAL; }
1041 1085
@@ -1058,6 +1102,7 @@ static inline int perf_swevent_get_recursion_context(void) { return -1; }
1058static inline void perf_swevent_put_recursion_context(int rctx) { } 1102static inline void perf_swevent_put_recursion_context(int rctx) { }
1059static inline void perf_event_enable(struct perf_event *event) { } 1103static inline void perf_event_enable(struct perf_event *event) { }
1060static inline void perf_event_disable(struct perf_event *event) { } 1104static inline void perf_event_disable(struct perf_event *event) { }
1105static inline void perf_event_task_tick(void) { }
1061#endif 1106#endif
1062 1107
1063#define perf_output_put(handle, x) \ 1108#define perf_output_put(handle, x) \
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 9fbc54a2585d..83af1f8d8b74 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -454,7 +454,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
454 * Makes rcu_dereference_check() do the dirty work. 454 * Makes rcu_dereference_check() do the dirty work.
455 */ 455 */
456#define rcu_dereference_bh(p) \ 456#define rcu_dereference_bh(p) \
457 rcu_dereference_check(p, rcu_read_lock_bh_held()) 457 rcu_dereference_check(p, rcu_read_lock_bh_held() || irqs_disabled())
458 458
459/** 459/**
460 * rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched 460 * rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 1e2a6db2d7dd..eb3c1ceec06e 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1160,6 +1160,13 @@ struct sched_rt_entity {
1160 1160
1161struct rcu_node; 1161struct rcu_node;
1162 1162
1163enum perf_event_task_context {
1164 perf_invalid_context = -1,
1165 perf_hw_context = 0,
1166 perf_sw_context,
1167 perf_nr_task_contexts,
1168};
1169
1163struct task_struct { 1170struct task_struct {
1164 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ 1171 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
1165 void *stack; 1172 void *stack;
@@ -1431,7 +1438,7 @@ struct task_struct {
1431 struct futex_pi_state *pi_state_cache; 1438 struct futex_pi_state *pi_state_cache;
1432#endif 1439#endif
1433#ifdef CONFIG_PERF_EVENTS 1440#ifdef CONFIG_PERF_EVENTS
1434 struct perf_event_context *perf_event_ctxp; 1441 struct perf_event_context *perf_event_ctxp[perf_nr_task_contexts];
1435 struct mutex perf_event_mutex; 1442 struct mutex perf_event_mutex;
1436 struct list_head perf_event_list; 1443 struct list_head perf_event_list;
1437#endif 1444#endif
diff --git a/include/linux/socket.h b/include/linux/socket.h
index a2fada9becb6..a8f56e1ec760 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -322,7 +322,7 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
322 int offset, 322 int offset,
323 unsigned int len, __wsum *csump); 323 unsigned int len, __wsum *csump);
324 324
325extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); 325extern long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode);
326extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); 326extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
327extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, 327extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,
328 int offset, int len); 328 int offset, int len);
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index 6b524a0d02e4..1808960c5059 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -126,8 +126,8 @@ int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
126 126
127#else /* CONFIG_STOP_MACHINE && CONFIG_SMP */ 127#else /* CONFIG_STOP_MACHINE && CONFIG_SMP */
128 128
129static inline int stop_machine(int (*fn)(void *), void *data, 129static inline int __stop_machine(int (*fn)(void *), void *data,
130 const struct cpumask *cpus) 130 const struct cpumask *cpus)
131{ 131{
132 int ret; 132 int ret;
133 local_irq_disable(); 133 local_irq_disable();
@@ -136,5 +136,11 @@ static inline int stop_machine(int (*fn)(void *), void *data,
136 return ret; 136 return ret;
137} 137}
138 138
139static inline int stop_machine(int (*fn)(void *), void *data,
140 const struct cpumask *cpus)
141{
142 return __stop_machine(fn, data, cpus);
143}
144
139#endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */ 145#endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */
140#endif /* _LINUX_STOP_MACHINE */ 146#endif /* _LINUX_STOP_MACHINE */
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 103d1b61aacb..a4a90b6726ce 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -17,6 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/rcupdate.h> 19#include <linux/rcupdate.h>
20#include <linux/jump_label.h>
20 21
21struct module; 22struct module;
22struct tracepoint; 23struct tracepoint;
@@ -145,7 +146,9 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin,
145 extern struct tracepoint __tracepoint_##name; \ 146 extern struct tracepoint __tracepoint_##name; \
146 static inline void trace_##name(proto) \ 147 static inline void trace_##name(proto) \
147 { \ 148 { \
148 if (unlikely(__tracepoint_##name.state)) \ 149 JUMP_LABEL(&__tracepoint_##name.state, do_trace); \
150 return; \
151do_trace: \
149 __DO_TRACE(&__tracepoint_##name, \ 152 __DO_TRACE(&__tracepoint_##name, \
150 TP_PROTO(data_proto), \ 153 TP_PROTO(data_proto), \
151 TP_ARGS(data_args)); \ 154 TP_ARGS(data_args)); \
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 0836ccc57121..3efc9f3f43a0 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -614,6 +614,7 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
614 (wait)->private = current; \ 614 (wait)->private = current; \
615 (wait)->func = autoremove_wake_function; \ 615 (wait)->func = autoremove_wake_function; \
616 INIT_LIST_HEAD(&(wait)->task_list); \ 616 INIT_LIST_HEAD(&(wait)->task_list); \
617 (wait)->flags = 0; \
617 } while (0) 618 } while (0)
618 619
619/** 620/**
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 45375b41a2a0..4d40c4d0230b 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -121,6 +121,7 @@ static inline int addrconf_finite_timeout(unsigned long timeout)
121 * IPv6 Address Label subsystem (addrlabel.c) 121 * IPv6 Address Label subsystem (addrlabel.c)
122 */ 122 */
123extern int ipv6_addr_label_init(void); 123extern int ipv6_addr_label_init(void);
124extern void ipv6_addr_label_cleanup(void);
124extern void ipv6_addr_label_rtnl_register(void); 125extern void ipv6_addr_label_rtnl_register(void);
125extern u32 ipv6_addr_label(struct net *net, 126extern u32 ipv6_addr_label(struct net *net,
126 const struct in6_addr *addr, 127 const struct in6_addr *addr,
diff --git a/include/net/dst.h b/include/net/dst.h
index 81d1413a8701..02386505033d 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -242,6 +242,7 @@ static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
242 dev->stats.rx_packets++; 242 dev->stats.rx_packets++;
243 dev->stats.rx_bytes += skb->len; 243 dev->stats.rx_bytes += skb->len;
244 skb->rxhash = 0; 244 skb->rxhash = 0;
245 skb_set_queue_mapping(skb, 0);
245 skb_dst_drop(skb); 246 skb_dst_drop(skb);
246 nf_reset(skb); 247 nf_reset(skb);
247} 248}
diff --git a/include/net/route.h b/include/net/route.h
index bd732d62e1c3..7e5e73bfa4de 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -199,6 +199,8 @@ static inline int ip_route_newports(struct rtable **rp, u8 protocol,
199 fl.fl_ip_sport = sport; 199 fl.fl_ip_sport = sport;
200 fl.fl_ip_dport = dport; 200 fl.fl_ip_dport = dport;
201 fl.proto = protocol; 201 fl.proto = protocol;
202 if (inet_sk(sk)->transparent)
203 fl.flags |= FLOWI_FLAG_ANYSRC;
202 ip_rt_put(*rp); 204 ip_rt_put(*rp);
203 *rp = NULL; 205 *rp = NULL;
204 security_sk_classify_flow(sk, &fl); 206 security_sk_classify_flow(sk, &fl);
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index fc8f36dd0f5c..4f53532d4c2f 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -298,8 +298,8 @@ struct xfrm_state_afinfo {
298 const struct xfrm_type *type_map[IPPROTO_MAX]; 298 const struct xfrm_type *type_map[IPPROTO_MAX];
299 struct xfrm_mode *mode_map[XFRM_MODE_MAX]; 299 struct xfrm_mode *mode_map[XFRM_MODE_MAX];
300 int (*init_flags)(struct xfrm_state *x); 300 int (*init_flags)(struct xfrm_state *x);
301 void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl, 301 void (*init_tempsel)(struct xfrm_selector *sel, struct flowi *fl);
302 struct xfrm_tmpl *tmpl, 302 void (*init_temprop)(struct xfrm_state *x, struct xfrm_tmpl *tmpl,
303 xfrm_address_t *daddr, xfrm_address_t *saddr); 303 xfrm_address_t *daddr, xfrm_address_t *saddr);
304 int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n); 304 int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n);
305 int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n); 305 int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n);
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index 0e4cfb694fe7..6fa7cbab7d93 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -5,7 +5,9 @@
5#define _TRACE_IRQ_H 5#define _TRACE_IRQ_H
6 6
7#include <linux/tracepoint.h> 7#include <linux/tracepoint.h>
8#include <linux/interrupt.h> 8
9struct irqaction;
10struct softirq_action;
9 11
10#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq } 12#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
11#define show_softirq_name(val) \ 13#define show_softirq_name(val) \
@@ -93,7 +95,10 @@ DECLARE_EVENT_CLASS(softirq,
93 ), 95 ),
94 96
95 TP_fast_assign( 97 TP_fast_assign(
96 __entry->vec = (int)(h - vec); 98 if (vec)
99 __entry->vec = (int)(h - vec);
100 else
101 __entry->vec = (int)(long)h;
97 ), 102 ),
98 103
99 TP_printk("vec=%d [action=%s]", __entry->vec, 104 TP_printk("vec=%d [action=%s]", __entry->vec,
@@ -136,6 +141,23 @@ DEFINE_EVENT(softirq, softirq_exit,
136 TP_ARGS(h, vec) 141 TP_ARGS(h, vec)
137); 142);
138 143
144/**
145 * softirq_raise - called immediately when a softirq is raised
146 * @h: pointer to struct softirq_action
147 * @vec: pointer to first struct softirq_action in softirq_vec array
148 *
149 * The @h parameter contains a pointer to the softirq vector number which is
150 * raised. @vec is NULL and it means @h includes vector number not
151 * softirq_action. When used in combination with the softirq_entry tracepoint
152 * we can determine the softirq raise latency.
153 */
154DEFINE_EVENT(softirq, softirq_raise,
155
156 TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
157
158 TP_ARGS(h, vec)
159);
160
139#endif /* _TRACE_IRQ_H */ 161#endif /* _TRACE_IRQ_H */
140 162
141/* This part must be outside protection */ 163/* This part must be outside protection */
diff --git a/include/trace/events/napi.h b/include/trace/events/napi.h
index 188deca2f3c7..8fe1e93f531d 100644
--- a/include/trace/events/napi.h
+++ b/include/trace/events/napi.h
@@ -6,10 +6,31 @@
6 6
7#include <linux/netdevice.h> 7#include <linux/netdevice.h>
8#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
9#include <linux/ftrace.h>
10
11#define NO_DEV "(no_device)"
12
13TRACE_EVENT(napi_poll,
9 14
10DECLARE_TRACE(napi_poll,
11 TP_PROTO(struct napi_struct *napi), 15 TP_PROTO(struct napi_struct *napi),
12 TP_ARGS(napi)); 16
17 TP_ARGS(napi),
18
19 TP_STRUCT__entry(
20 __field( struct napi_struct *, napi)
21 __string( dev_name, napi->dev ? napi->dev->name : NO_DEV)
22 ),
23
24 TP_fast_assign(
25 __entry->napi = napi;
26 __assign_str(dev_name, napi->dev ? napi->dev->name : NO_DEV);
27 ),
28
29 TP_printk("napi poll on napi struct %p for device %s",
30 __entry->napi, __get_str(dev_name))
31);
32
33#undef NO_DEV
13 34
14#endif /* _TRACE_NAPI_H_ */ 35#endif /* _TRACE_NAPI_H_ */
15 36
diff --git a/include/trace/events/net.h b/include/trace/events/net.h
new file mode 100644
index 000000000000..5f247f5ffc56
--- /dev/null
+++ b/include/trace/events/net.h
@@ -0,0 +1,82 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM net
3
4#if !defined(_TRACE_NET_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_NET_H
6
7#include <linux/skbuff.h>
8#include <linux/netdevice.h>
9#include <linux/ip.h>
10#include <linux/tracepoint.h>
11
12TRACE_EVENT(net_dev_xmit,
13
14 TP_PROTO(struct sk_buff *skb,
15 int rc),
16
17 TP_ARGS(skb, rc),
18
19 TP_STRUCT__entry(
20 __field( void *, skbaddr )
21 __field( unsigned int, len )
22 __field( int, rc )
23 __string( name, skb->dev->name )
24 ),
25
26 TP_fast_assign(
27 __entry->skbaddr = skb;
28 __entry->len = skb->len;
29 __entry->rc = rc;
30 __assign_str(name, skb->dev->name);
31 ),
32
33 TP_printk("dev=%s skbaddr=%p len=%u rc=%d",
34 __get_str(name), __entry->skbaddr, __entry->len, __entry->rc)
35);
36
37DECLARE_EVENT_CLASS(net_dev_template,
38
39 TP_PROTO(struct sk_buff *skb),
40
41 TP_ARGS(skb),
42
43 TP_STRUCT__entry(
44 __field( void *, skbaddr )
45 __field( unsigned int, len )
46 __string( name, skb->dev->name )
47 ),
48
49 TP_fast_assign(
50 __entry->skbaddr = skb;
51 __entry->len = skb->len;
52 __assign_str(name, skb->dev->name);
53 ),
54
55 TP_printk("dev=%s skbaddr=%p len=%u",
56 __get_str(name), __entry->skbaddr, __entry->len)
57)
58
59DEFINE_EVENT(net_dev_template, net_dev_queue,
60
61 TP_PROTO(struct sk_buff *skb),
62
63 TP_ARGS(skb)
64);
65
66DEFINE_EVENT(net_dev_template, netif_receive_skb,
67
68 TP_PROTO(struct sk_buff *skb),
69
70 TP_ARGS(skb)
71);
72
73DEFINE_EVENT(net_dev_template, netif_rx,
74
75 TP_PROTO(struct sk_buff *skb),
76
77 TP_ARGS(skb)
78);
79#endif /* _TRACE_NET_H */
80
81/* This part must be outside protection */
82#include <trace/define_trace.h>
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index 35a2a6e7bf1e..286784d69b8f 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -10,12 +10,17 @@
10#ifndef _TRACE_POWER_ENUM_ 10#ifndef _TRACE_POWER_ENUM_
11#define _TRACE_POWER_ENUM_ 11#define _TRACE_POWER_ENUM_
12enum { 12enum {
13 POWER_NONE = 0, 13 POWER_NONE = 0,
14 POWER_CSTATE = 1, 14 POWER_CSTATE = 1, /* C-State */
15 POWER_PSTATE = 2, 15 POWER_PSTATE = 2, /* Fequency change or DVFS */
16 POWER_SSTATE = 3, /* Suspend */
16}; 17};
17#endif 18#endif
18 19
20/*
21 * The power events are used for cpuidle & suspend (power_start, power_end)
22 * and for cpufreq (power_frequency)
23 */
19DECLARE_EVENT_CLASS(power, 24DECLARE_EVENT_CLASS(power,
20 25
21 TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), 26 TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
@@ -70,6 +75,85 @@ TRACE_EVENT(power_end,
70 75
71); 76);
72 77
78/*
79 * The clock events are used for clock enable/disable and for
80 * clock rate change
81 */
82DECLARE_EVENT_CLASS(clock,
83
84 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
85
86 TP_ARGS(name, state, cpu_id),
87
88 TP_STRUCT__entry(
89 __string( name, name )
90 __field( u64, state )
91 __field( u64, cpu_id )
92 ),
93
94 TP_fast_assign(
95 __assign_str(name, name);
96 __entry->state = state;
97 __entry->cpu_id = cpu_id;
98 ),
99
100 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
101 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
102);
103
104DEFINE_EVENT(clock, clock_enable,
105
106 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
107
108 TP_ARGS(name, state, cpu_id)
109);
110
111DEFINE_EVENT(clock, clock_disable,
112
113 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
114
115 TP_ARGS(name, state, cpu_id)
116);
117
118DEFINE_EVENT(clock, clock_set_rate,
119
120 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
121
122 TP_ARGS(name, state, cpu_id)
123);
124
125/*
126 * The power domain events are used for power domains transitions
127 */
128DECLARE_EVENT_CLASS(power_domain,
129
130 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
131
132 TP_ARGS(name, state, cpu_id),
133
134 TP_STRUCT__entry(
135 __string( name, name )
136 __field( u64, state )
137 __field( u64, cpu_id )
138 ),
139
140 TP_fast_assign(
141 __assign_str(name, name);
142 __entry->state = state;
143 __entry->cpu_id = cpu_id;
144),
145
146 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
147 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
148);
149
150DEFINE_EVENT(power_domain, power_domain_target,
151
152 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
153
154 TP_ARGS(name, state, cpu_id)
155);
156
73#endif /* _TRACE_POWER_H */ 157#endif /* _TRACE_POWER_H */
74 158
75/* This part must be outside protection */ 159/* This part must be outside protection */
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index 4b2be6dc76f0..75ce9d500d8e 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -35,6 +35,23 @@ TRACE_EVENT(kfree_skb,
35 __entry->skbaddr, __entry->protocol, __entry->location) 35 __entry->skbaddr, __entry->protocol, __entry->location)
36); 36);
37 37
38TRACE_EVENT(consume_skb,
39
40 TP_PROTO(struct sk_buff *skb),
41
42 TP_ARGS(skb),
43
44 TP_STRUCT__entry(
45 __field( void *, skbaddr )
46 ),
47
48 TP_fast_assign(
49 __entry->skbaddr = skb;
50 ),
51
52 TP_printk("skbaddr=%p", __entry->skbaddr)
53);
54
38TRACE_EVENT(skb_copy_datagram_iovec, 55TRACE_EVENT(skb_copy_datagram_iovec,
39 56
40 TP_PROTO(const struct sk_buff *skb, int len), 57 TP_PROTO(const struct sk_buff *skb, int len),