diff options
Diffstat (limited to 'include')
93 files changed, 2900 insertions, 573 deletions
diff --git a/include/Kbuild b/include/Kbuild index d8c3e3cbf416..fe36accd4328 100644 --- a/include/Kbuild +++ b/include/Kbuild | |||
@@ -8,3 +8,4 @@ header-y += mtd/ | |||
8 | header-y += rdma/ | 8 | header-y += rdma/ |
9 | header-y += video/ | 9 | header-y += video/ |
10 | header-y += drm/ | 10 | header-y += drm/ |
11 | header-y += xen/ | ||
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 8e6d0ca70aba..e410f602cab1 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -280,17 +280,18 @@ static inline void ptep_modify_prot_commit(struct mm_struct *mm, | |||
280 | #endif | 280 | #endif |
281 | 281 | ||
282 | /* | 282 | /* |
283 | * A facility to provide batching of the reload of page tables with the | 283 | * A facility to provide batching of the reload of page tables and |
284 | * actual context switch code for paravirtualized guests. By convention, | 284 | * other process state with the actual context switch code for |
285 | * only one of the lazy modes (CPU, MMU) should be active at any given | 285 | * paravirtualized guests. By convention, only one of the batched |
286 | * time, entry should never be nested, and entry and exits should always | 286 | * update (lazy) modes (CPU, MMU) should be active at any given time, |
287 | * be paired. This is for sanity of maintaining and reasoning about the | 287 | * entry should never be nested, and entry and exits should always be |
288 | * kernel code. | 288 | * paired. This is for sanity of maintaining and reasoning about the |
289 | * kernel code. In this case, the exit (end of the context switch) is | ||
290 | * in architecture-specific code, and so doesn't need a generic | ||
291 | * definition. | ||
289 | */ | 292 | */ |
290 | #ifndef __HAVE_ARCH_ENTER_LAZY_CPU_MODE | 293 | #ifndef __HAVE_ARCH_START_CONTEXT_SWITCH |
291 | #define arch_enter_lazy_cpu_mode() do {} while (0) | 294 | #define arch_start_context_switch(prev) do {} while (0) |
292 | #define arch_leave_lazy_cpu_mode() do {} while (0) | ||
293 | #define arch_flush_lazy_cpu_mode() do {} while (0) | ||
294 | #endif | 295 | #endif |
295 | 296 | ||
296 | #ifndef __HAVE_PFNMAP_TRACKING | 297 | #ifndef __HAVE_PFNMAP_TRACKING |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 89853bcd27a6..f1736ca7922c 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -63,7 +63,7 @@ | |||
63 | #define BRANCH_PROFILE() | 63 | #define BRANCH_PROFILE() |
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | #ifdef CONFIG_EVENT_TRACER | 66 | #ifdef CONFIG_EVENT_TRACING |
67 | #define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \ | 67 | #define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \ |
68 | *(_ftrace_events) \ | 68 | *(_ftrace_events) \ |
69 | VMLINUX_SYMBOL(__stop_ftrace_events) = .; | 69 | VMLINUX_SYMBOL(__stop_ftrace_events) = .; |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index c8c422151431..b84d8ae35e6f 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -1519,6 +1519,30 @@ static __inline__ void *drm_calloc(size_t nmemb, size_t size, int area) | |||
1519 | { | 1519 | { |
1520 | return kcalloc(nmemb, size, GFP_KERNEL); | 1520 | return kcalloc(nmemb, size, GFP_KERNEL); |
1521 | } | 1521 | } |
1522 | |||
1523 | static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) | ||
1524 | { | ||
1525 | u8 *addr; | ||
1526 | |||
1527 | if (size <= PAGE_SIZE) | ||
1528 | return kcalloc(nmemb, size, GFP_KERNEL); | ||
1529 | |||
1530 | addr = vmalloc(nmemb * size); | ||
1531 | if (!addr) | ||
1532 | return NULL; | ||
1533 | |||
1534 | memset(addr, 0, nmemb * size); | ||
1535 | |||
1536 | return addr; | ||
1537 | } | ||
1538 | |||
1539 | static __inline void drm_free_large(void *ptr) | ||
1540 | { | ||
1541 | if (!is_vmalloc_addr(ptr)) | ||
1542 | return kfree(ptr); | ||
1543 | |||
1544 | vfree(ptr); | ||
1545 | } | ||
1522 | #else | 1546 | #else |
1523 | extern void *drm_alloc(size_t size, int area); | 1547 | extern void *drm_alloc(size_t size, int area); |
1524 | extern void drm_free(void *pt, size_t size, int area); | 1548 | extern void drm_free(void *pt, size_t size, int area); |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 3c1924c010e8..7300fb866767 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -471,6 +471,9 @@ struct drm_connector { | |||
471 | u32 property_ids[DRM_CONNECTOR_MAX_PROPERTY]; | 471 | u32 property_ids[DRM_CONNECTOR_MAX_PROPERTY]; |
472 | uint64_t property_values[DRM_CONNECTOR_MAX_PROPERTY]; | 472 | uint64_t property_values[DRM_CONNECTOR_MAX_PROPERTY]; |
473 | 473 | ||
474 | /* requested DPMS state */ | ||
475 | int dpms; | ||
476 | |||
474 | void *helper_private; | 477 | void *helper_private; |
475 | 478 | ||
476 | uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; | 479 | uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; |
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index ec073d8288d9..6769ff6c1bc0 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h | |||
@@ -99,6 +99,8 @@ extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
99 | struct drm_framebuffer *old_fb); | 99 | struct drm_framebuffer *old_fb); |
100 | extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc); | 100 | extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc); |
101 | 101 | ||
102 | extern void drm_helper_connector_dpms(struct drm_connector *connector, int mode); | ||
103 | |||
102 | extern int drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb, | 104 | extern int drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb, |
103 | struct drm_mode_fb_cmd *mode_cmd); | 105 | struct drm_mode_fb_cmd *mode_cmd); |
104 | 106 | ||
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 88be890ee3c7..51b4b0a5ce8c 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -119,7 +119,7 @@ extern int pci_mmcfg_config_num; | |||
119 | extern int sbf_port; | 119 | extern int sbf_port; |
120 | extern unsigned long acpi_realmode_flags; | 120 | extern unsigned long acpi_realmode_flags; |
121 | 121 | ||
122 | int acpi_register_gsi (u32 gsi, int triggering, int polarity); | 122 | int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity); |
123 | int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); | 123 | int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); |
124 | 124 | ||
125 | #ifdef CONFIG_X86_IO_APIC | 125 | #ifdef CONFIG_X86_IO_APIC |
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index 48ee32a18ac5..64a982ea5d5f 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h | |||
@@ -159,6 +159,7 @@ | |||
159 | #define UART01x_FR_MODEM_ANY (UART01x_FR_DCD|UART01x_FR_DSR|UART01x_FR_CTS) | 159 | #define UART01x_FR_MODEM_ANY (UART01x_FR_DCD|UART01x_FR_DSR|UART01x_FR_CTS) |
160 | 160 | ||
161 | #ifndef __ASSEMBLY__ | 161 | #ifndef __ASSEMBLY__ |
162 | struct amba_device; /* in uncompress this is included but amba/bus.h is not */ | ||
162 | struct amba_pl010_data { | 163 | struct amba_pl010_data { |
163 | void (*set_mctrl)(struct amba_device *dev, void __iomem *base, unsigned int mctrl); | 164 | void (*set_mctrl)(struct amba_device *dev, void __iomem *base, unsigned int mctrl); |
164 | }; | 165 | }; |
diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h index 63265852b7d1..7b09c8348fd3 100644 --- a/include/linux/auto_fs.h +++ b/include/linux/auto_fs.h | |||
@@ -14,13 +14,12 @@ | |||
14 | #ifndef _LINUX_AUTO_FS_H | 14 | #ifndef _LINUX_AUTO_FS_H |
15 | #define _LINUX_AUTO_FS_H | 15 | #define _LINUX_AUTO_FS_H |
16 | 16 | ||
17 | #include <linux/types.h> | ||
17 | #ifdef __KERNEL__ | 18 | #ifdef __KERNEL__ |
18 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
19 | #include <linux/limits.h> | 20 | #include <linux/limits.h> |
20 | #include <linux/types.h> | ||
21 | #include <linux/ioctl.h> | 21 | #include <linux/ioctl.h> |
22 | #else | 22 | #else |
23 | #include <asm/types.h> | ||
24 | #include <sys/ioctl.h> | 23 | #include <sys/ioctl.h> |
25 | #endif /* __KERNEL__ */ | 24 | #endif /* __KERNEL__ */ |
26 | 25 | ||
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index d960889e92ef..7e4350ece0f8 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -116,9 +116,9 @@ struct blk_io_trace { | |||
116 | * The remap event | 116 | * The remap event |
117 | */ | 117 | */ |
118 | struct blk_io_trace_remap { | 118 | struct blk_io_trace_remap { |
119 | __be32 device; | ||
120 | __be32 device_from; | 119 | __be32 device_from; |
121 | __be64 sector; | 120 | __be32 device_to; |
121 | __be64 sector_from; | ||
122 | }; | 122 | }; |
123 | 123 | ||
124 | enum { | 124 | enum { |
@@ -165,8 +165,9 @@ struct blk_trace { | |||
165 | 165 | ||
166 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); | 166 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); |
167 | extern void blk_trace_shutdown(struct request_queue *); | 167 | extern void blk_trace_shutdown(struct request_queue *); |
168 | extern int do_blk_trace_setup(struct request_queue *q, | 168 | extern int do_blk_trace_setup(struct request_queue *q, char *name, |
169 | char *name, dev_t dev, struct blk_user_trace_setup *buts); | 169 | dev_t dev, struct block_device *bdev, |
170 | struct blk_user_trace_setup *buts); | ||
170 | extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); | 171 | extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); |
171 | 172 | ||
172 | /** | 173 | /** |
@@ -193,22 +194,42 @@ extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); | |||
193 | extern void blk_add_driver_data(struct request_queue *q, struct request *rq, | 194 | extern void blk_add_driver_data(struct request_queue *q, struct request *rq, |
194 | void *data, size_t len); | 195 | void *data, size_t len); |
195 | extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, | 196 | extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, |
197 | struct block_device *bdev, | ||
196 | char __user *arg); | 198 | char __user *arg); |
197 | extern int blk_trace_startstop(struct request_queue *q, int start); | 199 | extern int blk_trace_startstop(struct request_queue *q, int start); |
198 | extern int blk_trace_remove(struct request_queue *q); | 200 | extern int blk_trace_remove(struct request_queue *q); |
201 | extern int blk_trace_init_sysfs(struct device *dev); | ||
199 | 202 | ||
200 | extern struct attribute_group blk_trace_attr_group; | 203 | extern struct attribute_group blk_trace_attr_group; |
201 | 204 | ||
202 | #else /* !CONFIG_BLK_DEV_IO_TRACE */ | 205 | #else /* !CONFIG_BLK_DEV_IO_TRACE */ |
203 | #define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY) | 206 | # define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY) |
204 | #define blk_trace_shutdown(q) do { } while (0) | 207 | # define blk_trace_shutdown(q) do { } while (0) |
205 | #define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY) | 208 | # define do_blk_trace_setup(q, name, dev, bdev, buts) (-ENOTTY) |
206 | #define blk_add_driver_data(q, rq, data, len) do {} while (0) | 209 | # define blk_add_driver_data(q, rq, data, len) do {} while (0) |
207 | #define blk_trace_setup(q, name, dev, arg) (-ENOTTY) | 210 | # define blk_trace_setup(q, name, dev, bdev, arg) (-ENOTTY) |
208 | #define blk_trace_startstop(q, start) (-ENOTTY) | 211 | # define blk_trace_startstop(q, start) (-ENOTTY) |
209 | #define blk_trace_remove(q) (-ENOTTY) | 212 | # define blk_trace_remove(q) (-ENOTTY) |
210 | #define blk_add_trace_msg(q, fmt, ...) do { } while (0) | 213 | # define blk_add_trace_msg(q, fmt, ...) do { } while (0) |
214 | static inline int blk_trace_init_sysfs(struct device *dev) | ||
215 | { | ||
216 | return 0; | ||
217 | } | ||
211 | 218 | ||
212 | #endif /* CONFIG_BLK_DEV_IO_TRACE */ | 219 | #endif /* CONFIG_BLK_DEV_IO_TRACE */ |
220 | |||
221 | #if defined(CONFIG_EVENT_TRACING) && defined(CONFIG_BLOCK) | ||
222 | |||
223 | static inline int blk_cmd_buf_len(struct request *rq) | ||
224 | { | ||
225 | return blk_pc_request(rq) ? rq->cmd_len * 3 : 1; | ||
226 | } | ||
227 | |||
228 | extern void blk_dump_cmd(char *buf, struct request *rq); | ||
229 | extern void blk_fill_rwbs(char *rwbs, u32 rw, int bytes); | ||
230 | extern void blk_fill_rwbs_rq(char *rwbs, struct request *rq); | ||
231 | |||
232 | #endif /* CONFIG_EVENT_TRACING && CONFIG_BLOCK */ | ||
233 | |||
213 | #endif /* __KERNEL__ */ | 234 | #endif /* __KERNEL__ */ |
214 | #endif | 235 | #endif |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 5a40d14daa9f..c56457c8334e 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -288,7 +288,15 @@ static inline cycle_t clocksource_read(struct clocksource *cs) | |||
288 | */ | 288 | */ |
289 | static inline int clocksource_enable(struct clocksource *cs) | 289 | static inline int clocksource_enable(struct clocksource *cs) |
290 | { | 290 | { |
291 | return cs->enable ? cs->enable(cs) : 0; | 291 | int ret = 0; |
292 | |||
293 | if (cs->enable) | ||
294 | ret = cs->enable(cs); | ||
295 | |||
296 | /* save mult_orig on enable */ | ||
297 | cs->mult_orig = cs->mult; | ||
298 | |||
299 | return ret; | ||
292 | } | 300 | } |
293 | 301 | ||
294 | /** | 302 | /** |
diff --git a/include/linux/compat.h b/include/linux/compat.h index f2ded21f9a3c..af931ee43dd8 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -222,6 +222,8 @@ int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from); | |||
222 | int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from); | 222 | int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from); |
223 | int get_compat_sigevent(struct sigevent *event, | 223 | int get_compat_sigevent(struct sigevent *event, |
224 | const struct compat_sigevent __user *u_event); | 224 | const struct compat_sigevent __user *u_event); |
225 | long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig, | ||
226 | struct compat_siginfo __user *uinfo); | ||
225 | 227 | ||
226 | static inline int compat_timeval_compare(struct compat_timeval *lhs, | 228 | static inline int compat_timeval_compare(struct compat_timeval *lhs, |
227 | struct compat_timeval *rhs) | 229 | struct compat_timeval *rhs) |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 9f315382610b..c5ac87ca7bc6 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -1022,6 +1022,8 @@ typedef struct cpumask *cpumask_var_t; | |||
1022 | 1022 | ||
1023 | bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node); | 1023 | bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node); |
1024 | bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags); | 1024 | bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags); |
1025 | bool zalloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node); | ||
1026 | bool zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags); | ||
1025 | void alloc_bootmem_cpumask_var(cpumask_var_t *mask); | 1027 | void alloc_bootmem_cpumask_var(cpumask_var_t *mask); |
1026 | void free_cpumask_var(cpumask_var_t mask); | 1028 | void free_cpumask_var(cpumask_var_t mask); |
1027 | void free_bootmem_cpumask_var(cpumask_var_t mask); | 1029 | void free_bootmem_cpumask_var(cpumask_var_t mask); |
@@ -1040,6 +1042,19 @@ static inline bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, | |||
1040 | return true; | 1042 | return true; |
1041 | } | 1043 | } |
1042 | 1044 | ||
1045 | static inline bool zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags) | ||
1046 | { | ||
1047 | cpumask_clear(*mask); | ||
1048 | return true; | ||
1049 | } | ||
1050 | |||
1051 | static inline bool zalloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, | ||
1052 | int node) | ||
1053 | { | ||
1054 | cpumask_clear(*mask); | ||
1055 | return true; | ||
1056 | } | ||
1057 | |||
1043 | static inline void alloc_bootmem_cpumask_var(cpumask_var_t *mask) | 1058 | static inline void alloc_bootmem_cpumask_var(cpumask_var_t *mask) |
1044 | { | 1059 | { |
1045 | } | 1060 | } |
diff --git a/include/linux/cred.h b/include/linux/cred.h index 3282ee4318e7..4fa999696310 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #define _LINUX_CRED_H | 13 | #define _LINUX_CRED_H |
14 | 14 | ||
15 | #include <linux/capability.h> | 15 | #include <linux/capability.h> |
16 | #include <linux/init.h> | ||
16 | #include <linux/key.h> | 17 | #include <linux/key.h> |
17 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
18 | 19 | ||
diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h index 788850ba4e75..1fbdea4f08eb 100644 --- a/include/linux/cyclades.h +++ b/include/linux/cyclades.h | |||
@@ -142,19 +142,6 @@ struct CYZ_BOOT_CTRL { | |||
142 | 142 | ||
143 | 143 | ||
144 | #ifndef DP_WINDOW_SIZE | 144 | #ifndef DP_WINDOW_SIZE |
145 | /* #include "cyclomz.h" */ | ||
146 | /****************** ****************** *******************/ | ||
147 | /* | ||
148 | * The data types defined below are used in all ZFIRM interface | ||
149 | * data structures. They accomodate differences between HW | ||
150 | * architectures and compilers. | ||
151 | */ | ||
152 | |||
153 | typedef __u64 ucdouble; /* 64 bits, unsigned */ | ||
154 | typedef __u32 uclong; /* 32 bits, unsigned */ | ||
155 | typedef __u16 ucshort; /* 16 bits, unsigned */ | ||
156 | typedef __u8 ucchar; /* 8 bits, unsigned */ | ||
157 | |||
158 | /* | 145 | /* |
159 | * Memory Window Sizes | 146 | * Memory Window Sizes |
160 | */ | 147 | */ |
@@ -507,16 +494,20 @@ struct ZFW_CTRL { | |||
507 | 494 | ||
508 | /* Per card data structure */ | 495 | /* Per card data structure */ |
509 | struct cyclades_card { | 496 | struct cyclades_card { |
510 | void __iomem *base_addr; | 497 | void __iomem *base_addr; |
511 | void __iomem *ctl_addr; | 498 | union { |
512 | int irq; | 499 | void __iomem *p9050; |
513 | unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */ | 500 | struct RUNTIME_9060 __iomem *p9060; |
514 | unsigned int first_line; /* minor number of first channel on card */ | 501 | } ctl_addr; |
515 | unsigned int nports; /* Number of ports in the card */ | 502 | int irq; |
516 | int bus_index; /* address shift - 0 for ISA, 1 for PCI */ | 503 | unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */ |
517 | int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */ | 504 | unsigned int first_line; /* minor number of first channel on card */ |
518 | spinlock_t card_lock; | 505 | unsigned int nports; /* Number of ports in the card */ |
519 | struct cyclades_port *ports; | 506 | int bus_index; /* address shift - 0 for ISA, 1 for PCI */ |
507 | int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */ | ||
508 | u32 hw_ver; | ||
509 | spinlock_t card_lock; | ||
510 | struct cyclades_port *ports; | ||
520 | }; | 511 | }; |
521 | 512 | ||
522 | /*************************************** | 513 | /*************************************** |
diff --git a/include/linux/dma-debug.h b/include/linux/dma-debug.h index 28d53cb7b5a2..171ad8aedc83 100644 --- a/include/linux/dma-debug.h +++ b/include/linux/dma-debug.h | |||
@@ -32,6 +32,8 @@ extern void dma_debug_add_bus(struct bus_type *bus); | |||
32 | 32 | ||
33 | extern void dma_debug_init(u32 num_entries); | 33 | extern void dma_debug_init(u32 num_entries); |
34 | 34 | ||
35 | extern int dma_debug_resize_entries(u32 num_entries); | ||
36 | |||
35 | extern void debug_dma_map_page(struct device *dev, struct page *page, | 37 | extern void debug_dma_map_page(struct device *dev, struct page *page, |
36 | size_t offset, size_t size, | 38 | size_t offset, size_t size, |
37 | int direction, dma_addr_t dma_addr, | 39 | int direction, dma_addr_t dma_addr, |
@@ -91,6 +93,11 @@ static inline void dma_debug_init(u32 num_entries) | |||
91 | { | 93 | { |
92 | } | 94 | } |
93 | 95 | ||
96 | static inline int dma_debug_resize_entries(u32 num_entries) | ||
97 | { | ||
98 | return 0; | ||
99 | } | ||
100 | |||
94 | static inline void debug_dma_map_page(struct device *dev, struct page *page, | 101 | static inline void debug_dma_map_page(struct device *dev, struct page *page, |
95 | size_t offset, size_t size, | 102 | size_t offset, size_t size, |
96 | int direction, dma_addr_t dma_addr, | 103 | int direction, dma_addr_t dma_addr, |
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index e397dc342cda..10ff5c498824 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -108,6 +108,7 @@ struct irte { | |||
108 | }; | 108 | }; |
109 | #ifdef CONFIG_INTR_REMAP | 109 | #ifdef CONFIG_INTR_REMAP |
110 | extern int intr_remapping_enabled; | 110 | extern int intr_remapping_enabled; |
111 | extern int intr_remapping_supported(void); | ||
111 | extern int enable_intr_remapping(int); | 112 | extern int enable_intr_remapping(int); |
112 | extern void disable_intr_remapping(void); | 113 | extern void disable_intr_remapping(void); |
113 | extern int reenable_intr_remapping(int); | 114 | extern int reenable_intr_remapping(int); |
@@ -157,6 +158,8 @@ static inline struct intel_iommu *map_ioapic_to_ir(int apic) | |||
157 | } | 158 | } |
158 | #define irq_remapped(irq) (0) | 159 | #define irq_remapped(irq) (0) |
159 | #define enable_intr_remapping(mode) (-1) | 160 | #define enable_intr_remapping(mode) (-1) |
161 | #define disable_intr_remapping() (0) | ||
162 | #define reenable_intr_remapping(mode) (0) | ||
160 | #define intr_remapping_enabled (0) | 163 | #define intr_remapping_enabled (0) |
161 | #endif | 164 | #endif |
162 | 165 | ||
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 8a0c2f221e6b..39b95c56587e 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -233,8 +233,6 @@ extern int ftrace_arch_read_dyn_info(char *buf, int size); | |||
233 | 233 | ||
234 | extern int skip_trace(unsigned long ip); | 234 | extern int skip_trace(unsigned long ip); |
235 | 235 | ||
236 | extern void ftrace_release(void *start, unsigned long size); | ||
237 | |||
238 | extern void ftrace_disable_daemon(void); | 236 | extern void ftrace_disable_daemon(void); |
239 | extern void ftrace_enable_daemon(void); | 237 | extern void ftrace_enable_daemon(void); |
240 | #else | 238 | #else |
@@ -325,13 +323,8 @@ static inline void __ftrace_enabled_restore(int enabled) | |||
325 | 323 | ||
326 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | 324 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD |
327 | extern void ftrace_init(void); | 325 | extern void ftrace_init(void); |
328 | extern void ftrace_init_module(struct module *mod, | ||
329 | unsigned long *start, unsigned long *end); | ||
330 | #else | 326 | #else |
331 | static inline void ftrace_init(void) { } | 327 | static inline void ftrace_init(void) { } |
332 | static inline void | ||
333 | ftrace_init_module(struct module *mod, | ||
334 | unsigned long *start, unsigned long *end) { } | ||
335 | #endif | 328 | #endif |
336 | 329 | ||
337 | /* | 330 | /* |
@@ -368,6 +361,7 @@ struct ftrace_ret_stack { | |||
368 | unsigned long ret; | 361 | unsigned long ret; |
369 | unsigned long func; | 362 | unsigned long func; |
370 | unsigned long long calltime; | 363 | unsigned long long calltime; |
364 | unsigned long long subtime; | ||
371 | }; | 365 | }; |
372 | 366 | ||
373 | /* | 367 | /* |
@@ -379,8 +373,6 @@ extern void return_to_handler(void); | |||
379 | 373 | ||
380 | extern int | 374 | extern int |
381 | ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth); | 375 | ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth); |
382 | extern void | ||
383 | ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret); | ||
384 | 376 | ||
385 | /* | 377 | /* |
386 | * Sometimes we don't want to trace a function with the function | 378 | * Sometimes we don't want to trace a function with the function |
@@ -496,8 +488,15 @@ static inline int test_tsk_trace_graph(struct task_struct *tsk) | |||
496 | 488 | ||
497 | extern int ftrace_dump_on_oops; | 489 | extern int ftrace_dump_on_oops; |
498 | 490 | ||
491 | #ifdef CONFIG_PREEMPT | ||
492 | #define INIT_TRACE_RECURSION .trace_recursion = 0, | ||
493 | #endif | ||
494 | |||
499 | #endif /* CONFIG_TRACING */ | 495 | #endif /* CONFIG_TRACING */ |
500 | 496 | ||
497 | #ifndef INIT_TRACE_RECURSION | ||
498 | #define INIT_TRACE_RECURSION | ||
499 | #endif | ||
501 | 500 | ||
502 | #ifdef CONFIG_HW_BRANCH_TRACER | 501 | #ifdef CONFIG_HW_BRANCH_TRACER |
503 | 502 | ||
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h new file mode 100644 index 000000000000..5c093ffc655b --- /dev/null +++ b/include/linux/ftrace_event.h | |||
@@ -0,0 +1,172 @@ | |||
1 | #ifndef _LINUX_FTRACE_EVENT_H | ||
2 | #define _LINUX_FTRACE_EVENT_H | ||
3 | |||
4 | #include <linux/trace_seq.h> | ||
5 | #include <linux/ring_buffer.h> | ||
6 | #include <linux/percpu.h> | ||
7 | |||
8 | struct trace_array; | ||
9 | struct tracer; | ||
10 | struct dentry; | ||
11 | |||
12 | DECLARE_PER_CPU(struct trace_seq, ftrace_event_seq); | ||
13 | |||
14 | struct trace_print_flags { | ||
15 | unsigned long mask; | ||
16 | const char *name; | ||
17 | }; | ||
18 | |||
19 | const char *ftrace_print_flags_seq(struct trace_seq *p, const char *delim, | ||
20 | unsigned long flags, | ||
21 | const struct trace_print_flags *flag_array); | ||
22 | |||
23 | const char *ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val, | ||
24 | const struct trace_print_flags *symbol_array); | ||
25 | |||
26 | /* | ||
27 | * The trace entry - the most basic unit of tracing. This is what | ||
28 | * is printed in the end as a single line in the trace output, such as: | ||
29 | * | ||
30 | * bash-15816 [01] 235.197585: idle_cpu <- irq_enter | ||
31 | */ | ||
32 | struct trace_entry { | ||
33 | unsigned short type; | ||
34 | unsigned char flags; | ||
35 | unsigned char preempt_count; | ||
36 | int pid; | ||
37 | int tgid; | ||
38 | }; | ||
39 | |||
40 | #define FTRACE_MAX_EVENT \ | ||
41 | ((1 << (sizeof(((struct trace_entry *)0)->type) * 8)) - 1) | ||
42 | |||
43 | /* | ||
44 | * Trace iterator - used by printout routines who present trace | ||
45 | * results to users and which routines might sleep, etc: | ||
46 | */ | ||
47 | struct trace_iterator { | ||
48 | struct trace_array *tr; | ||
49 | struct tracer *trace; | ||
50 | void *private; | ||
51 | int cpu_file; | ||
52 | struct mutex mutex; | ||
53 | struct ring_buffer_iter *buffer_iter[NR_CPUS]; | ||
54 | unsigned long iter_flags; | ||
55 | |||
56 | /* The below is zeroed out in pipe_read */ | ||
57 | struct trace_seq seq; | ||
58 | struct trace_entry *ent; | ||
59 | int cpu; | ||
60 | u64 ts; | ||
61 | |||
62 | loff_t pos; | ||
63 | long idx; | ||
64 | |||
65 | cpumask_var_t started; | ||
66 | }; | ||
67 | |||
68 | |||
69 | typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter, | ||
70 | int flags); | ||
71 | struct trace_event { | ||
72 | struct hlist_node node; | ||
73 | struct list_head list; | ||
74 | int type; | ||
75 | trace_print_func trace; | ||
76 | trace_print_func raw; | ||
77 | trace_print_func hex; | ||
78 | trace_print_func binary; | ||
79 | }; | ||
80 | |||
81 | extern int register_ftrace_event(struct trace_event *event); | ||
82 | extern int unregister_ftrace_event(struct trace_event *event); | ||
83 | |||
84 | /* Return values for print_line callback */ | ||
85 | enum print_line_t { | ||
86 | TRACE_TYPE_PARTIAL_LINE = 0, /* Retry after flushing the seq */ | ||
87 | TRACE_TYPE_HANDLED = 1, | ||
88 | TRACE_TYPE_UNHANDLED = 2, /* Relay to other output functions */ | ||
89 | TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */ | ||
90 | }; | ||
91 | |||
92 | |||
93 | struct ring_buffer_event * | ||
94 | trace_current_buffer_lock_reserve(int type, unsigned long len, | ||
95 | unsigned long flags, int pc); | ||
96 | void trace_current_buffer_unlock_commit(struct ring_buffer_event *event, | ||
97 | unsigned long flags, int pc); | ||
98 | void trace_nowake_buffer_unlock_commit(struct ring_buffer_event *event, | ||
99 | unsigned long flags, int pc); | ||
100 | void trace_current_buffer_discard_commit(struct ring_buffer_event *event); | ||
101 | |||
102 | void tracing_record_cmdline(struct task_struct *tsk); | ||
103 | |||
104 | struct ftrace_event_call { | ||
105 | struct list_head list; | ||
106 | char *name; | ||
107 | char *system; | ||
108 | struct dentry *dir; | ||
109 | struct trace_event *event; | ||
110 | int enabled; | ||
111 | int (*regfunc)(void); | ||
112 | void (*unregfunc)(void); | ||
113 | int id; | ||
114 | int (*raw_init)(void); | ||
115 | int (*show_format)(struct trace_seq *s); | ||
116 | int (*define_fields)(void); | ||
117 | struct list_head fields; | ||
118 | int filter_active; | ||
119 | void *filter; | ||
120 | void *mod; | ||
121 | |||
122 | #ifdef CONFIG_EVENT_PROFILE | ||
123 | atomic_t profile_count; | ||
124 | int (*profile_enable)(struct ftrace_event_call *); | ||
125 | void (*profile_disable)(struct ftrace_event_call *); | ||
126 | #endif | ||
127 | }; | ||
128 | |||
129 | #define MAX_FILTER_PRED 32 | ||
130 | #define MAX_FILTER_STR_VAL 128 | ||
131 | |||
132 | extern int init_preds(struct ftrace_event_call *call); | ||
133 | extern void destroy_preds(struct ftrace_event_call *call); | ||
134 | extern int filter_match_preds(struct ftrace_event_call *call, void *rec); | ||
135 | extern int filter_current_check_discard(struct ftrace_event_call *call, | ||
136 | void *rec, | ||
137 | struct ring_buffer_event *event); | ||
138 | |||
139 | extern int trace_define_field(struct ftrace_event_call *call, char *type, | ||
140 | char *name, int offset, int size, int is_signed); | ||
141 | |||
142 | #define is_signed_type(type) (((type)(-1)) < 0) | ||
143 | |||
144 | int trace_set_clr_event(const char *system, const char *event, int set); | ||
145 | |||
146 | /* | ||
147 | * The double __builtin_constant_p is because gcc will give us an error | ||
148 | * if we try to allocate the static variable to fmt if it is not a | ||
149 | * constant. Even with the outer if statement optimizing out. | ||
150 | */ | ||
151 | #define event_trace_printk(ip, fmt, args...) \ | ||
152 | do { \ | ||
153 | __trace_printk_check_format(fmt, ##args); \ | ||
154 | tracing_record_cmdline(current); \ | ||
155 | if (__builtin_constant_p(fmt)) { \ | ||
156 | static const char *trace_printk_fmt \ | ||
157 | __attribute__((section("__trace_printk_fmt"))) = \ | ||
158 | __builtin_constant_p(fmt) ? fmt : NULL; \ | ||
159 | \ | ||
160 | __trace_bprintk(ip, trace_printk_fmt, ##args); \ | ||
161 | } else \ | ||
162 | __trace_printk(ip, fmt, ##args); \ | ||
163 | } while (0) | ||
164 | |||
165 | #define __common_field(type, item, is_signed) \ | ||
166 | ret = trace_define_field(event_call, #type, "common_" #item, \ | ||
167 | offsetof(typeof(field.ent), item), \ | ||
168 | sizeof(field.ent.item), is_signed); \ | ||
169 | if (ret) \ | ||
170 | return ret; | ||
171 | |||
172 | #endif /* _LINUX_FTRACE_EVENT_H */ | ||
diff --git a/include/linux/futex.h b/include/linux/futex.h index 3bf5bb5a34f9..34956c8fdebf 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
@@ -23,6 +23,8 @@ union ktime; | |||
23 | #define FUTEX_TRYLOCK_PI 8 | 23 | #define FUTEX_TRYLOCK_PI 8 |
24 | #define FUTEX_WAIT_BITSET 9 | 24 | #define FUTEX_WAIT_BITSET 9 |
25 | #define FUTEX_WAKE_BITSET 10 | 25 | #define FUTEX_WAKE_BITSET 10 |
26 | #define FUTEX_WAIT_REQUEUE_PI 11 | ||
27 | #define FUTEX_CMP_REQUEUE_PI 12 | ||
26 | 28 | ||
27 | #define FUTEX_PRIVATE_FLAG 128 | 29 | #define FUTEX_PRIVATE_FLAG 128 |
28 | #define FUTEX_CLOCK_REALTIME 256 | 30 | #define FUTEX_CLOCK_REALTIME 256 |
@@ -38,6 +40,10 @@ union ktime; | |||
38 | #define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG) | 40 | #define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG) |
39 | #define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITS | FUTEX_PRIVATE_FLAG) | 41 | #define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITS | FUTEX_PRIVATE_FLAG) |
40 | #define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITS | FUTEX_PRIVATE_FLAG) | 42 | #define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITS | FUTEX_PRIVATE_FLAG) |
43 | #define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \ | ||
44 | FUTEX_PRIVATE_FLAG) | ||
45 | #define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \ | ||
46 | FUTEX_PRIVATE_FLAG) | ||
41 | 47 | ||
42 | /* | 48 | /* |
43 | * Support for robust futexes: the kernel cleans up held futexes at | 49 | * Support for robust futexes: the kernel cleans up held futexes at |
diff --git a/include/linux/i7300_idle.h b/include/linux/i7300_idle.h index 05a80c44513c..1587b7dec505 100644 --- a/include/linux/i7300_idle.h +++ b/include/linux/i7300_idle.h | |||
@@ -16,35 +16,33 @@ | |||
16 | struct fbd_ioat { | 16 | struct fbd_ioat { |
17 | unsigned int vendor; | 17 | unsigned int vendor; |
18 | unsigned int ioat_dev; | 18 | unsigned int ioat_dev; |
19 | unsigned int enabled; | ||
19 | }; | 20 | }; |
20 | 21 | ||
21 | /* | 22 | /* |
22 | * The i5000 chip-set has the same hooks as the i7300 | 23 | * The i5000 chip-set has the same hooks as the i7300 |
23 | * but support is disabled by default because this driver | 24 | * but it is not enabled by default and must be manually |
24 | * has not been validated on that platform. | 25 | * manually enabled with "forceload=1" because it is |
26 | * only lightly validated. | ||
25 | */ | 27 | */ |
26 | #define SUPPORT_I5000 0 | ||
27 | 28 | ||
28 | static const struct fbd_ioat fbd_ioat_list[] = { | 29 | static const struct fbd_ioat fbd_ioat_list[] = { |
29 | {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB}, | 30 | {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB, 1}, |
30 | #if SUPPORT_I5000 | 31 | {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT, 0}, |
31 | {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT}, | ||
32 | #endif | ||
33 | {0, 0} | 32 | {0, 0} |
34 | }; | 33 | }; |
35 | 34 | ||
36 | /* table of devices that work with this driver */ | 35 | /* table of devices that work with this driver */ |
37 | static const struct pci_device_id pci_tbl[] = { | 36 | static const struct pci_device_id pci_tbl[] = { |
38 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) }, | 37 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) }, |
39 | #if SUPPORT_I5000 | ||
40 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) }, | 38 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) }, |
41 | #endif | ||
42 | { } /* Terminating entry */ | 39 | { } /* Terminating entry */ |
43 | }; | 40 | }; |
44 | 41 | ||
45 | /* Check for known platforms with I/O-AT */ | 42 | /* Check for known platforms with I/O-AT */ |
46 | static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev, | 43 | static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev, |
47 | struct pci_dev **ioat_dev) | 44 | struct pci_dev **ioat_dev, |
45 | int enable_all) | ||
48 | { | 46 | { |
49 | int i; | 47 | int i; |
50 | struct pci_dev *memdev, *dmadev; | 48 | struct pci_dev *memdev, *dmadev; |
@@ -69,6 +67,8 @@ static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev, | |||
69 | for (i = 0; fbd_ioat_list[i].vendor != 0; i++) { | 67 | for (i = 0; fbd_ioat_list[i].vendor != 0; i++) { |
70 | if (dmadev->vendor == fbd_ioat_list[i].vendor && | 68 | if (dmadev->vendor == fbd_ioat_list[i].vendor && |
71 | dmadev->device == fbd_ioat_list[i].ioat_dev) { | 69 | dmadev->device == fbd_ioat_list[i].ioat_dev) { |
70 | if (!(fbd_ioat_list[i].enabled || enable_all)) | ||
71 | continue; | ||
72 | if (fbd_dev) | 72 | if (fbd_dev) |
73 | *fbd_dev = memdev; | 73 | *fbd_dev = memdev; |
74 | if (ioat_dev) | 74 | if (ioat_dev) |
diff --git a/include/linux/ima.h b/include/linux/ima.h index 0e2aa45cb0ce..b1b827d091a9 100644 --- a/include/linux/ima.h +++ b/include/linux/ima.h | |||
@@ -13,14 +13,17 @@ | |||
13 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
14 | struct linux_binprm; | 14 | struct linux_binprm; |
15 | 15 | ||
16 | #define IMA_COUNT_UPDATE 1 | ||
17 | #define IMA_COUNT_LEAVE 0 | ||
18 | |||
16 | #ifdef CONFIG_IMA | 19 | #ifdef CONFIG_IMA |
17 | extern int ima_bprm_check(struct linux_binprm *bprm); | 20 | extern int ima_bprm_check(struct linux_binprm *bprm); |
18 | extern int ima_inode_alloc(struct inode *inode); | 21 | extern int ima_inode_alloc(struct inode *inode); |
19 | extern void ima_inode_free(struct inode *inode); | 22 | extern void ima_inode_free(struct inode *inode); |
20 | extern int ima_path_check(struct path *path, int mask); | 23 | extern int ima_path_check(struct path *path, int mask, int update_counts); |
21 | extern void ima_file_free(struct file *file); | 24 | extern void ima_file_free(struct file *file); |
22 | extern int ima_file_mmap(struct file *file, unsigned long prot); | 25 | extern int ima_file_mmap(struct file *file, unsigned long prot); |
23 | extern void ima_shm_check(struct file *file); | 26 | extern void ima_counts_get(struct file *file); |
24 | 27 | ||
25 | #else | 28 | #else |
26 | static inline int ima_bprm_check(struct linux_binprm *bprm) | 29 | static inline int ima_bprm_check(struct linux_binprm *bprm) |
@@ -38,7 +41,7 @@ static inline void ima_inode_free(struct inode *inode) | |||
38 | return; | 41 | return; |
39 | } | 42 | } |
40 | 43 | ||
41 | static inline int ima_path_check(struct path *path, int mask) | 44 | static inline int ima_path_check(struct path *path, int mask, int update_counts) |
42 | { | 45 | { |
43 | return 0; | 46 | return 0; |
44 | } | 47 | } |
@@ -53,7 +56,7 @@ static inline int ima_file_mmap(struct file *file, unsigned long prot) | |||
53 | return 0; | 56 | return 0; |
54 | } | 57 | } |
55 | 58 | ||
56 | static inline void ima_shm_check(struct file *file) | 59 | static inline void ima_counts_get(struct file *file) |
57 | { | 60 | { |
58 | return; | 61 | return; |
59 | } | 62 | } |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index d87247d2641f..6646bfc7b892 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -145,8 +145,8 @@ extern struct cred init_cred; | |||
145 | .group_leader = &tsk, \ | 145 | .group_leader = &tsk, \ |
146 | .real_cred = &init_cred, \ | 146 | .real_cred = &init_cred, \ |
147 | .cred = &init_cred, \ | 147 | .cred = &init_cred, \ |
148 | .cred_exec_mutex = \ | 148 | .cred_guard_mutex = \ |
149 | __MUTEX_INITIALIZER(tsk.cred_exec_mutex), \ | 149 | __MUTEX_INITIALIZER(tsk.cred_guard_mutex), \ |
150 | .comm = "swapper", \ | 150 | .comm = "swapper", \ |
151 | .thread = INIT_THREAD, \ | 151 | .thread = INIT_THREAD, \ |
152 | .fs = &init_fs, \ | 152 | .fs = &init_fs, \ |
@@ -174,6 +174,7 @@ extern struct cred init_cred; | |||
174 | INIT_TRACE_IRQFLAGS \ | 174 | INIT_TRACE_IRQFLAGS \ |
175 | INIT_LOCKDEP \ | 175 | INIT_LOCKDEP \ |
176 | INIT_FTRACE_GRAPH \ | 176 | INIT_FTRACE_GRAPH \ |
177 | INIT_TRACE_RECURSION \ | ||
177 | } | 178 | } |
178 | 179 | ||
179 | 180 | ||
diff --git a/include/linux/input.h b/include/linux/input.h index 0e6ff5de3588..6fed4f6a9c9e 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -656,6 +656,7 @@ struct input_absinfo { | |||
656 | #define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */ | 656 | #define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */ |
657 | #define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ | 657 | #define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ |
658 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ | 658 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ |
659 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ | ||
659 | 660 | ||
660 | #define ABS_MAX 0x3f | 661 | #define ABS_MAX 0x3f |
661 | #define ABS_CNT (ABS_MAX+1) | 662 | #define ABS_CNT (ABS_MAX+1) |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 91bb76f44f14..ff374ceface0 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -566,6 +566,6 @@ struct irq_desc; | |||
566 | extern int early_irq_init(void); | 566 | extern int early_irq_init(void); |
567 | extern int arch_probe_nr_irqs(void); | 567 | extern int arch_probe_nr_irqs(void); |
568 | extern int arch_early_irq_init(void); | 568 | extern int arch_early_irq_init(void); |
569 | extern int arch_init_chip_data(struct irq_desc *desc, int cpu); | 569 | extern int arch_init_chip_data(struct irq_desc *desc, int node); |
570 | 570 | ||
571 | #endif | 571 | #endif |
diff --git a/include/linux/irq.h b/include/linux/irq.h index b7cbeed972e4..eedbb8e5e0cc 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -117,7 +117,7 @@ struct irq_chip { | |||
117 | void (*eoi)(unsigned int irq); | 117 | void (*eoi)(unsigned int irq); |
118 | 118 | ||
119 | void (*end)(unsigned int irq); | 119 | void (*end)(unsigned int irq); |
120 | void (*set_affinity)(unsigned int irq, | 120 | int (*set_affinity)(unsigned int irq, |
121 | const struct cpumask *dest); | 121 | const struct cpumask *dest); |
122 | int (*retrigger)(unsigned int irq); | 122 | int (*retrigger)(unsigned int irq); |
123 | int (*set_type)(unsigned int irq, unsigned int flow_type); | 123 | int (*set_type)(unsigned int irq, unsigned int flow_type); |
@@ -187,7 +187,7 @@ struct irq_desc { | |||
187 | spinlock_t lock; | 187 | spinlock_t lock; |
188 | #ifdef CONFIG_SMP | 188 | #ifdef CONFIG_SMP |
189 | cpumask_var_t affinity; | 189 | cpumask_var_t affinity; |
190 | unsigned int cpu; | 190 | unsigned int node; |
191 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 191 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
192 | cpumask_var_t pending_mask; | 192 | cpumask_var_t pending_mask; |
193 | #endif | 193 | #endif |
@@ -201,26 +201,23 @@ struct irq_desc { | |||
201 | } ____cacheline_internodealigned_in_smp; | 201 | } ____cacheline_internodealigned_in_smp; |
202 | 202 | ||
203 | extern void arch_init_copy_chip_data(struct irq_desc *old_desc, | 203 | extern void arch_init_copy_chip_data(struct irq_desc *old_desc, |
204 | struct irq_desc *desc, int cpu); | 204 | struct irq_desc *desc, int node); |
205 | extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); | 205 | extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); |
206 | 206 | ||
207 | #ifndef CONFIG_SPARSE_IRQ | 207 | #ifndef CONFIG_SPARSE_IRQ |
208 | extern struct irq_desc irq_desc[NR_IRQS]; | 208 | extern struct irq_desc irq_desc[NR_IRQS]; |
209 | #else /* CONFIG_SPARSE_IRQ */ | 209 | #endif |
210 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); | ||
211 | #endif /* CONFIG_SPARSE_IRQ */ | ||
212 | |||
213 | extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu); | ||
214 | 210 | ||
215 | static inline struct irq_desc * | 211 | #ifdef CONFIG_NUMA_IRQ_DESC |
216 | irq_remap_to_desc(unsigned int irq, struct irq_desc *desc) | 212 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int node); |
217 | { | ||
218 | #ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC | ||
219 | return irq_to_desc(irq); | ||
220 | #else | 213 | #else |
214 | static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node) | ||
215 | { | ||
221 | return desc; | 216 | return desc; |
222 | #endif | ||
223 | } | 217 | } |
218 | #endif | ||
219 | |||
220 | extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node); | ||
224 | 221 | ||
225 | /* | 222 | /* |
226 | * Migration helpers for obsolete names, they will go away: | 223 | * Migration helpers for obsolete names, they will go away: |
@@ -386,7 +383,7 @@ extern void set_irq_noprobe(unsigned int irq); | |||
386 | extern void set_irq_probe(unsigned int irq); | 383 | extern void set_irq_probe(unsigned int irq); |
387 | 384 | ||
388 | /* Handle dynamic irq creation and destruction */ | 385 | /* Handle dynamic irq creation and destruction */ |
389 | extern unsigned int create_irq_nr(unsigned int irq_want); | 386 | extern unsigned int create_irq_nr(unsigned int irq_want, int node); |
390 | extern int create_irq(void); | 387 | extern int create_irq(void); |
391 | extern void destroy_irq(unsigned int irq); | 388 | extern void destroy_irq(unsigned int irq); |
392 | 389 | ||
@@ -424,47 +421,48 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry); | |||
424 | 421 | ||
425 | #ifdef CONFIG_SMP | 422 | #ifdef CONFIG_SMP |
426 | /** | 423 | /** |
427 | * init_alloc_desc_masks - allocate cpumasks for irq_desc | 424 | * alloc_desc_masks - allocate cpumasks for irq_desc |
428 | * @desc: pointer to irq_desc struct | 425 | * @desc: pointer to irq_desc struct |
429 | * @cpu: cpu which will be handling the cpumasks | 426 | * @cpu: cpu which will be handling the cpumasks |
430 | * @boot: true if need bootmem | 427 | * @boot: true if need bootmem |
431 | * | 428 | * |
432 | * Allocates affinity and pending_mask cpumask if required. | 429 | * Allocates affinity and pending_mask cpumask if required. |
433 | * Returns true if successful (or not required). | 430 | * Returns true if successful (or not required). |
434 | * Side effect: affinity has all bits set, pending_mask has all bits clear. | ||
435 | */ | 431 | */ |
436 | static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, | 432 | static inline bool alloc_desc_masks(struct irq_desc *desc, int node, |
437 | bool boot) | 433 | bool boot) |
438 | { | 434 | { |
439 | int node; | 435 | #ifdef CONFIG_CPUMASK_OFFSTACK |
440 | |||
441 | if (boot) { | 436 | if (boot) { |
442 | alloc_bootmem_cpumask_var(&desc->affinity); | 437 | alloc_bootmem_cpumask_var(&desc->affinity); |
443 | cpumask_setall(desc->affinity); | ||
444 | 438 | ||
445 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 439 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
446 | alloc_bootmem_cpumask_var(&desc->pending_mask); | 440 | alloc_bootmem_cpumask_var(&desc->pending_mask); |
447 | cpumask_clear(desc->pending_mask); | ||
448 | #endif | 441 | #endif |
449 | return true; | 442 | return true; |
450 | } | 443 | } |
451 | 444 | ||
452 | node = cpu_to_node(cpu); | ||
453 | |||
454 | if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node)) | 445 | if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node)) |
455 | return false; | 446 | return false; |
456 | cpumask_setall(desc->affinity); | ||
457 | 447 | ||
458 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 448 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
459 | if (!alloc_cpumask_var_node(&desc->pending_mask, GFP_ATOMIC, node)) { | 449 | if (!alloc_cpumask_var_node(&desc->pending_mask, GFP_ATOMIC, node)) { |
460 | free_cpumask_var(desc->affinity); | 450 | free_cpumask_var(desc->affinity); |
461 | return false; | 451 | return false; |
462 | } | 452 | } |
463 | cpumask_clear(desc->pending_mask); | 453 | #endif |
464 | #endif | 454 | #endif |
465 | return true; | 455 | return true; |
466 | } | 456 | } |
467 | 457 | ||
458 | static inline void init_desc_masks(struct irq_desc *desc) | ||
459 | { | ||
460 | cpumask_setall(desc->affinity); | ||
461 | #ifdef CONFIG_GENERIC_PENDING_IRQ | ||
462 | cpumask_clear(desc->pending_mask); | ||
463 | #endif | ||
464 | } | ||
465 | |||
468 | /** | 466 | /** |
469 | * init_copy_desc_masks - copy cpumasks for irq_desc | 467 | * init_copy_desc_masks - copy cpumasks for irq_desc |
470 | * @old_desc: pointer to old irq_desc struct | 468 | * @old_desc: pointer to old irq_desc struct |
@@ -478,7 +476,7 @@ static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, | |||
478 | static inline void init_copy_desc_masks(struct irq_desc *old_desc, | 476 | static inline void init_copy_desc_masks(struct irq_desc *old_desc, |
479 | struct irq_desc *new_desc) | 477 | struct irq_desc *new_desc) |
480 | { | 478 | { |
481 | #ifdef CONFIG_CPUMASKS_OFFSTACK | 479 | #ifdef CONFIG_CPUMASK_OFFSTACK |
482 | cpumask_copy(new_desc->affinity, old_desc->affinity); | 480 | cpumask_copy(new_desc->affinity, old_desc->affinity); |
483 | 481 | ||
484 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 482 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
@@ -499,12 +497,16 @@ static inline void free_desc_masks(struct irq_desc *old_desc, | |||
499 | 497 | ||
500 | #else /* !CONFIG_SMP */ | 498 | #else /* !CONFIG_SMP */ |
501 | 499 | ||
502 | static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, | 500 | static inline bool alloc_desc_masks(struct irq_desc *desc, int node, |
503 | bool boot) | 501 | bool boot) |
504 | { | 502 | { |
505 | return true; | 503 | return true; |
506 | } | 504 | } |
507 | 505 | ||
506 | static inline void init_desc_masks(struct irq_desc *desc) | ||
507 | { | ||
508 | } | ||
509 | |||
508 | static inline void init_copy_desc_masks(struct irq_desc *old_desc, | 510 | static inline void init_copy_desc_masks(struct irq_desc *old_desc, |
509 | struct irq_desc *new_desc) | 511 | struct irq_desc *new_desc) |
510 | { | 512 | { |
diff --git a/include/linux/kmemtrace.h b/include/linux/kmemtrace.h new file mode 100644 index 000000000000..b616d3930c3b --- /dev/null +++ b/include/linux/kmemtrace.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 Eduard - Gabriel Munteanu | ||
3 | * | ||
4 | * This file is released under GPL version 2. | ||
5 | */ | ||
6 | |||
7 | #ifndef _LINUX_KMEMTRACE_H | ||
8 | #define _LINUX_KMEMTRACE_H | ||
9 | |||
10 | #ifdef __KERNEL__ | ||
11 | |||
12 | #include <trace/events/kmem.h> | ||
13 | |||
14 | #ifdef CONFIG_KMEMTRACE | ||
15 | extern void kmemtrace_init(void); | ||
16 | #else | ||
17 | static inline void kmemtrace_init(void) | ||
18 | { | ||
19 | } | ||
20 | #endif | ||
21 | |||
22 | #endif /* __KERNEL__ */ | ||
23 | |||
24 | #endif /* _LINUX_KMEMTRACE_H */ | ||
25 | |||
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 8cc137911b34..3db5d8d37485 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -119,7 +119,7 @@ struct kvm_run { | |||
119 | __u32 error_code; | 119 | __u32 error_code; |
120 | } ex; | 120 | } ex; |
121 | /* KVM_EXIT_IO */ | 121 | /* KVM_EXIT_IO */ |
122 | struct kvm_io { | 122 | struct { |
123 | #define KVM_EXIT_IO_IN 0 | 123 | #define KVM_EXIT_IO_IN 0 |
124 | #define KVM_EXIT_IO_OUT 1 | 124 | #define KVM_EXIT_IO_OUT 1 |
125 | __u8 direction; | 125 | __u8 direction; |
@@ -224,10 +224,10 @@ struct kvm_interrupt { | |||
224 | /* for KVM_GET_DIRTY_LOG */ | 224 | /* for KVM_GET_DIRTY_LOG */ |
225 | struct kvm_dirty_log { | 225 | struct kvm_dirty_log { |
226 | __u32 slot; | 226 | __u32 slot; |
227 | __u32 padding; | 227 | __u32 padding1; |
228 | union { | 228 | union { |
229 | void __user *dirty_bitmap; /* one bit per page */ | 229 | void __user *dirty_bitmap; /* one bit per page */ |
230 | __u64 padding; | 230 | __u64 padding2; |
231 | }; | 231 | }; |
232 | }; | 232 | }; |
233 | 233 | ||
@@ -409,6 +409,10 @@ struct kvm_trace_rec { | |||
409 | #ifdef __KVM_HAVE_DEVICE_ASSIGNMENT | 409 | #ifdef __KVM_HAVE_DEVICE_ASSIGNMENT |
410 | #define KVM_CAP_DEVICE_DEASSIGNMENT 27 | 410 | #define KVM_CAP_DEVICE_DEASSIGNMENT 27 |
411 | #endif | 411 | #endif |
412 | #ifdef __KVM_HAVE_MSIX | ||
413 | #define KVM_CAP_DEVICE_MSIX 28 | ||
414 | #endif | ||
415 | #define KVM_CAP_ASSIGN_DEV_IRQ 29 | ||
412 | /* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */ | 416 | /* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */ |
413 | #define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30 | 417 | #define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30 |
414 | 418 | ||
@@ -482,11 +486,18 @@ struct kvm_irq_routing { | |||
482 | #define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \ | 486 | #define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \ |
483 | struct kvm_assigned_pci_dev) | 487 | struct kvm_assigned_pci_dev) |
484 | #define KVM_SET_GSI_ROUTING _IOW(KVMIO, 0x6a, struct kvm_irq_routing) | 488 | #define KVM_SET_GSI_ROUTING _IOW(KVMIO, 0x6a, struct kvm_irq_routing) |
489 | /* deprecated, replaced by KVM_ASSIGN_DEV_IRQ */ | ||
485 | #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ | 490 | #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ |
486 | struct kvm_assigned_irq) | 491 | struct kvm_assigned_irq) |
492 | #define KVM_ASSIGN_DEV_IRQ _IOW(KVMIO, 0x70, struct kvm_assigned_irq) | ||
487 | #define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71) | 493 | #define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71) |
488 | #define KVM_DEASSIGN_PCI_DEVICE _IOW(KVMIO, 0x72, \ | 494 | #define KVM_DEASSIGN_PCI_DEVICE _IOW(KVMIO, 0x72, \ |
489 | struct kvm_assigned_pci_dev) | 495 | struct kvm_assigned_pci_dev) |
496 | #define KVM_ASSIGN_SET_MSIX_NR \ | ||
497 | _IOW(KVMIO, 0x73, struct kvm_assigned_msix_nr) | ||
498 | #define KVM_ASSIGN_SET_MSIX_ENTRY \ | ||
499 | _IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry) | ||
500 | #define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq) | ||
490 | 501 | ||
491 | /* | 502 | /* |
492 | * ioctls for vcpu fds | 503 | * ioctls for vcpu fds |
@@ -577,6 +588,8 @@ struct kvm_debug_guest { | |||
577 | #define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18) | 588 | #define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18) |
578 | #define KVM_TRC_PPC_INSTR (KVM_TRC_HANDLER + 0x19) | 589 | #define KVM_TRC_PPC_INSTR (KVM_TRC_HANDLER + 0x19) |
579 | 590 | ||
591 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | ||
592 | |||
580 | struct kvm_assigned_pci_dev { | 593 | struct kvm_assigned_pci_dev { |
581 | __u32 assigned_dev_id; | 594 | __u32 assigned_dev_id; |
582 | __u32 busnr; | 595 | __u32 busnr; |
@@ -587,6 +600,17 @@ struct kvm_assigned_pci_dev { | |||
587 | }; | 600 | }; |
588 | }; | 601 | }; |
589 | 602 | ||
603 | #define KVM_DEV_IRQ_HOST_INTX (1 << 0) | ||
604 | #define KVM_DEV_IRQ_HOST_MSI (1 << 1) | ||
605 | #define KVM_DEV_IRQ_HOST_MSIX (1 << 2) | ||
606 | |||
607 | #define KVM_DEV_IRQ_GUEST_INTX (1 << 8) | ||
608 | #define KVM_DEV_IRQ_GUEST_MSI (1 << 9) | ||
609 | #define KVM_DEV_IRQ_GUEST_MSIX (1 << 10) | ||
610 | |||
611 | #define KVM_DEV_IRQ_HOST_MASK 0x00ff | ||
612 | #define KVM_DEV_IRQ_GUEST_MASK 0xff00 | ||
613 | |||
590 | struct kvm_assigned_irq { | 614 | struct kvm_assigned_irq { |
591 | __u32 assigned_dev_id; | 615 | __u32 assigned_dev_id; |
592 | __u32 host_irq; | 616 | __u32 host_irq; |
@@ -602,9 +626,19 @@ struct kvm_assigned_irq { | |||
602 | }; | 626 | }; |
603 | }; | 627 | }; |
604 | 628 | ||
605 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | ||
606 | 629 | ||
607 | #define KVM_DEV_IRQ_ASSIGN_MSI_ACTION KVM_DEV_IRQ_ASSIGN_ENABLE_MSI | 630 | struct kvm_assigned_msix_nr { |
608 | #define KVM_DEV_IRQ_ASSIGN_ENABLE_MSI (1 << 0) | 631 | __u32 assigned_dev_id; |
632 | __u16 entry_nr; | ||
633 | __u16 padding; | ||
634 | }; | ||
635 | |||
636 | #define KVM_MAX_MSIX_PER_DEV 512 | ||
637 | struct kvm_assigned_msix_entry { | ||
638 | __u32 assigned_dev_id; | ||
639 | __u32 gsi; | ||
640 | __u16 entry; /* The index of entry in the MSI-X table */ | ||
641 | __u16 padding[3]; | ||
642 | }; | ||
609 | 643 | ||
610 | #endif | 644 | #endif |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 894a56e365e8..aacc5449f586 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #define KVM_REQ_UNHALT 6 | 38 | #define KVM_REQ_UNHALT 6 |
39 | #define KVM_REQ_MMU_SYNC 7 | 39 | #define KVM_REQ_MMU_SYNC 7 |
40 | #define KVM_REQ_KVMCLOCK_UPDATE 8 | 40 | #define KVM_REQ_KVMCLOCK_UPDATE 8 |
41 | #define KVM_REQ_KICK 9 | ||
41 | 42 | ||
42 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 43 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
43 | 44 | ||
@@ -72,7 +73,6 @@ struct kvm_vcpu { | |||
72 | struct mutex mutex; | 73 | struct mutex mutex; |
73 | int cpu; | 74 | int cpu; |
74 | struct kvm_run *run; | 75 | struct kvm_run *run; |
75 | int guest_mode; | ||
76 | unsigned long requests; | 76 | unsigned long requests; |
77 | unsigned long guest_debug; | 77 | unsigned long guest_debug; |
78 | int fpu_active; | 78 | int fpu_active; |
@@ -298,6 +298,7 @@ int kvm_arch_hardware_setup(void); | |||
298 | void kvm_arch_hardware_unsetup(void); | 298 | void kvm_arch_hardware_unsetup(void); |
299 | void kvm_arch_check_processor_compat(void *rtn); | 299 | void kvm_arch_check_processor_compat(void *rtn); |
300 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); | 300 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); |
301 | int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu); | ||
301 | 302 | ||
302 | void kvm_free_physmem(struct kvm *kvm); | 303 | void kvm_free_physmem(struct kvm *kvm); |
303 | 304 | ||
@@ -319,6 +320,13 @@ struct kvm_irq_ack_notifier { | |||
319 | void (*irq_acked)(struct kvm_irq_ack_notifier *kian); | 320 | void (*irq_acked)(struct kvm_irq_ack_notifier *kian); |
320 | }; | 321 | }; |
321 | 322 | ||
323 | #define KVM_ASSIGNED_MSIX_PENDING 0x1 | ||
324 | struct kvm_guest_msix_entry { | ||
325 | u32 vector; | ||
326 | u16 entry; | ||
327 | u16 flags; | ||
328 | }; | ||
329 | |||
322 | struct kvm_assigned_dev_kernel { | 330 | struct kvm_assigned_dev_kernel { |
323 | struct kvm_irq_ack_notifier ack_notifier; | 331 | struct kvm_irq_ack_notifier ack_notifier; |
324 | struct work_struct interrupt_work; | 332 | struct work_struct interrupt_work; |
@@ -326,18 +334,18 @@ struct kvm_assigned_dev_kernel { | |||
326 | int assigned_dev_id; | 334 | int assigned_dev_id; |
327 | int host_busnr; | 335 | int host_busnr; |
328 | int host_devfn; | 336 | int host_devfn; |
337 | unsigned int entries_nr; | ||
329 | int host_irq; | 338 | int host_irq; |
330 | bool host_irq_disabled; | 339 | bool host_irq_disabled; |
340 | struct msix_entry *host_msix_entries; | ||
331 | int guest_irq; | 341 | int guest_irq; |
332 | #define KVM_ASSIGNED_DEV_GUEST_INTX (1 << 0) | 342 | struct kvm_guest_msix_entry *guest_msix_entries; |
333 | #define KVM_ASSIGNED_DEV_GUEST_MSI (1 << 1) | ||
334 | #define KVM_ASSIGNED_DEV_HOST_INTX (1 << 8) | ||
335 | #define KVM_ASSIGNED_DEV_HOST_MSI (1 << 9) | ||
336 | unsigned long irq_requested_type; | 343 | unsigned long irq_requested_type; |
337 | int irq_source_id; | 344 | int irq_source_id; |
338 | int flags; | 345 | int flags; |
339 | struct pci_dev *dev; | 346 | struct pci_dev *dev; |
340 | struct kvm *kvm; | 347 | struct kvm *kvm; |
348 | spinlock_t assigned_dev_lock; | ||
341 | }; | 349 | }; |
342 | 350 | ||
343 | struct kvm_irq_mask_notifier { | 351 | struct kvm_irq_mask_notifier { |
@@ -360,6 +368,9 @@ void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian); | |||
360 | int kvm_request_irq_source_id(struct kvm *kvm); | 368 | int kvm_request_irq_source_id(struct kvm *kvm); |
361 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); | 369 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); |
362 | 370 | ||
371 | /* For vcpu->arch.iommu_flags */ | ||
372 | #define KVM_IOMMU_CACHE_COHERENCY 0x1 | ||
373 | |||
363 | #ifdef CONFIG_IOMMU_API | 374 | #ifdef CONFIG_IOMMU_API |
364 | int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn, | 375 | int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn, |
365 | unsigned long npages); | 376 | unsigned long npages); |
diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h index 2b8318c83e53..fb46efbeabec 100644 --- a/include/linux/kvm_types.h +++ b/include/linux/kvm_types.h | |||
@@ -40,4 +40,31 @@ typedef unsigned long hfn_t; | |||
40 | 40 | ||
41 | typedef hfn_t pfn_t; | 41 | typedef hfn_t pfn_t; |
42 | 42 | ||
43 | union kvm_ioapic_redirect_entry { | ||
44 | u64 bits; | ||
45 | struct { | ||
46 | u8 vector; | ||
47 | u8 delivery_mode:3; | ||
48 | u8 dest_mode:1; | ||
49 | u8 delivery_status:1; | ||
50 | u8 polarity:1; | ||
51 | u8 remote_irr:1; | ||
52 | u8 trig_mode:1; | ||
53 | u8 mask:1; | ||
54 | u8 reserve:7; | ||
55 | u8 reserved[4]; | ||
56 | u8 dest_id; | ||
57 | } fields; | ||
58 | }; | ||
59 | |||
60 | struct kvm_lapic_irq { | ||
61 | u32 vector; | ||
62 | u32 delivery_mode; | ||
63 | u32 dest_mode; | ||
64 | u32 level; | ||
65 | u32 trig_mode; | ||
66 | u32 shorthand; | ||
67 | u32 dest_id; | ||
68 | }; | ||
69 | |||
43 | #endif /* __KVM_TYPES_H__ */ | 70 | #endif /* __KVM_TYPES_H__ */ |
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h new file mode 100644 index 000000000000..e461b2c3d711 --- /dev/null +++ b/include/linux/lsm_audit.h | |||
@@ -0,0 +1,111 @@ | |||
1 | /* | ||
2 | * Common LSM logging functions | ||
3 | * Heavily borrowed from selinux/avc.h | ||
4 | * | ||
5 | * Author : Etienne BASSET <etienne.basset@ensta.org> | ||
6 | * | ||
7 | * All credits to : Stephen Smalley, <sds@epoch.ncsc.mil> | ||
8 | * All BUGS to : Etienne BASSET <etienne.basset@ensta.org> | ||
9 | */ | ||
10 | #ifndef _LSM_COMMON_LOGGING_ | ||
11 | #define _LSM_COMMON_LOGGING_ | ||
12 | |||
13 | #include <linux/stddef.h> | ||
14 | #include <linux/errno.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/kdev_t.h> | ||
17 | #include <linux/spinlock.h> | ||
18 | #include <linux/init.h> | ||
19 | #include <linux/audit.h> | ||
20 | #include <linux/in6.h> | ||
21 | #include <linux/path.h> | ||
22 | #include <linux/key.h> | ||
23 | #include <linux/skbuff.h> | ||
24 | #include <asm/system.h> | ||
25 | |||
26 | |||
27 | /* Auxiliary data to use in generating the audit record. */ | ||
28 | struct common_audit_data { | ||
29 | char type; | ||
30 | #define LSM_AUDIT_DATA_FS 1 | ||
31 | #define LSM_AUDIT_DATA_NET 2 | ||
32 | #define LSM_AUDIT_DATA_CAP 3 | ||
33 | #define LSM_AUDIT_DATA_IPC 4 | ||
34 | #define LSM_AUDIT_DATA_TASK 5 | ||
35 | #define LSM_AUDIT_DATA_KEY 6 | ||
36 | struct task_struct *tsk; | ||
37 | union { | ||
38 | struct { | ||
39 | struct path path; | ||
40 | struct inode *inode; | ||
41 | } fs; | ||
42 | struct { | ||
43 | int netif; | ||
44 | struct sock *sk; | ||
45 | u16 family; | ||
46 | __be16 dport; | ||
47 | __be16 sport; | ||
48 | union { | ||
49 | struct { | ||
50 | __be32 daddr; | ||
51 | __be32 saddr; | ||
52 | } v4; | ||
53 | struct { | ||
54 | struct in6_addr daddr; | ||
55 | struct in6_addr saddr; | ||
56 | } v6; | ||
57 | } fam; | ||
58 | } net; | ||
59 | int cap; | ||
60 | int ipc_id; | ||
61 | struct task_struct *tsk; | ||
62 | #ifdef CONFIG_KEYS | ||
63 | struct { | ||
64 | key_serial_t key; | ||
65 | char *key_desc; | ||
66 | } key_struct; | ||
67 | #endif | ||
68 | } u; | ||
69 | const char *function; | ||
70 | /* this union contains LSM specific data */ | ||
71 | union { | ||
72 | /* SMACK data */ | ||
73 | struct smack_audit_data { | ||
74 | char *subject; | ||
75 | char *object; | ||
76 | char *request; | ||
77 | int result; | ||
78 | } smack_audit_data; | ||
79 | /* SELinux data */ | ||
80 | struct { | ||
81 | u32 ssid; | ||
82 | u32 tsid; | ||
83 | u16 tclass; | ||
84 | u32 requested; | ||
85 | u32 audited; | ||
86 | struct av_decision *avd; | ||
87 | int result; | ||
88 | } selinux_audit_data; | ||
89 | } lsm_priv; | ||
90 | /* these callback will be implemented by a specific LSM */ | ||
91 | void (*lsm_pre_audit)(struct audit_buffer *, void *); | ||
92 | void (*lsm_post_audit)(struct audit_buffer *, void *); | ||
93 | }; | ||
94 | |||
95 | #define v4info fam.v4 | ||
96 | #define v6info fam.v6 | ||
97 | |||
98 | int ipv4_skb_to_auditdata(struct sk_buff *skb, | ||
99 | struct common_audit_data *ad, u8 *proto); | ||
100 | |||
101 | int ipv6_skb_to_auditdata(struct sk_buff *skb, | ||
102 | struct common_audit_data *ad, u8 *proto); | ||
103 | |||
104 | /* Initialize an LSM audit data structure. */ | ||
105 | #define COMMON_AUDIT_DATA_INIT(_d, _t) \ | ||
106 | { memset((_d), 0, sizeof(struct common_audit_data)); \ | ||
107 | (_d)->type = LSM_AUDIT_DATA_##_t; (_d)->function = __func__; } | ||
108 | |||
109 | void common_lsm_audit(struct common_audit_data *a); | ||
110 | |||
111 | #endif | ||
diff --git a/include/linux/magic.h b/include/linux/magic.h index 5b4e28bcb788..927138cf3050 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #define DEBUGFS_MAGIC 0x64626720 | 9 | #define DEBUGFS_MAGIC 0x64626720 |
10 | #define SYSFS_MAGIC 0x62656572 | 10 | #define SYSFS_MAGIC 0x62656572 |
11 | #define SECURITYFS_MAGIC 0x73636673 | 11 | #define SECURITYFS_MAGIC 0x73636673 |
12 | #define SELINUX_MAGIC 0xf97cff8c | ||
12 | #define TMPFS_MAGIC 0x01021994 | 13 | #define TMPFS_MAGIC 0x01021994 |
13 | #define SQUASHFS_MAGIC 0x73717368 | 14 | #define SQUASHFS_MAGIC 0x73717368 |
14 | #define EFS_SUPER_MAGIC 0x414A53 | 15 | #define EFS_SUPER_MAGIC 0x414A53 |
diff --git a/include/linux/mm.h b/include/linux/mm.h index bff1f0d475c7..ad613ed66ab0 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -19,6 +19,7 @@ struct anon_vma; | |||
19 | struct file_ra_state; | 19 | struct file_ra_state; |
20 | struct user_struct; | 20 | struct user_struct; |
21 | struct writeback_control; | 21 | struct writeback_control; |
22 | struct rlimit; | ||
22 | 23 | ||
23 | #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ | 24 | #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ |
24 | extern unsigned long max_mapnr; | 25 | extern unsigned long max_mapnr; |
@@ -580,12 +581,10 @@ static inline void set_page_links(struct page *page, enum zone_type zone, | |||
580 | */ | 581 | */ |
581 | static inline unsigned long round_hint_to_min(unsigned long hint) | 582 | static inline unsigned long round_hint_to_min(unsigned long hint) |
582 | { | 583 | { |
583 | #ifdef CONFIG_SECURITY | ||
584 | hint &= PAGE_MASK; | 584 | hint &= PAGE_MASK; |
585 | if (((void *)hint != NULL) && | 585 | if (((void *)hint != NULL) && |
586 | (hint < mmap_min_addr)) | 586 | (hint < mmap_min_addr)) |
587 | return PAGE_ALIGN(mmap_min_addr); | 587 | return PAGE_ALIGN(mmap_min_addr); |
588 | #endif | ||
589 | return hint; | 588 | return hint; |
590 | } | 589 | } |
591 | 590 | ||
@@ -1031,8 +1030,6 @@ extern void add_active_range(unsigned int nid, unsigned long start_pfn, | |||
1031 | unsigned long end_pfn); | 1030 | unsigned long end_pfn); |
1032 | extern void remove_active_range(unsigned int nid, unsigned long start_pfn, | 1031 | extern void remove_active_range(unsigned int nid, unsigned long start_pfn, |
1033 | unsigned long end_pfn); | 1032 | unsigned long end_pfn); |
1034 | extern void push_node_boundaries(unsigned int nid, unsigned long start_pfn, | ||
1035 | unsigned long end_pfn); | ||
1036 | extern void remove_all_active_ranges(void); | 1033 | extern void remove_all_active_ranges(void); |
1037 | extern unsigned long absent_pages_in_range(unsigned long start_pfn, | 1034 | extern unsigned long absent_pages_in_range(unsigned long start_pfn, |
1038 | unsigned long end_pfn); | 1035 | unsigned long end_pfn); |
@@ -1319,8 +1316,8 @@ int vmemmap_populate_basepages(struct page *start_page, | |||
1319 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); | 1316 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); |
1320 | void vmemmap_populate_print_last(void); | 1317 | void vmemmap_populate_print_last(void); |
1321 | 1318 | ||
1322 | extern void *alloc_locked_buffer(size_t size); | 1319 | extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim, |
1323 | extern void free_locked_buffer(void *buffer, size_t size); | 1320 | size_t size); |
1324 | extern void release_locked_buffer(void *buffer, size_t size); | 1321 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); |
1325 | #endif /* __KERNEL__ */ | 1322 | #endif /* __KERNEL__ */ |
1326 | #endif /* _LINUX_MM_H */ | 1323 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mmiotrace.h b/include/linux/mmiotrace.h index 3d1b7bde1283..97491f78b08c 100644 --- a/include/linux/mmiotrace.h +++ b/include/linux/mmiotrace.h | |||
@@ -30,6 +30,8 @@ extern unsigned int kmmio_count; | |||
30 | 30 | ||
31 | extern int register_kmmio_probe(struct kmmio_probe *p); | 31 | extern int register_kmmio_probe(struct kmmio_probe *p); |
32 | extern void unregister_kmmio_probe(struct kmmio_probe *p); | 32 | extern void unregister_kmmio_probe(struct kmmio_probe *p); |
33 | extern int kmmio_init(void); | ||
34 | extern void kmmio_cleanup(void); | ||
33 | 35 | ||
34 | #ifdef CONFIG_MMIOTRACE | 36 | #ifdef CONFIG_MMIOTRACE |
35 | /* kmmio is active by some kmmio_probes? */ | 37 | /* kmmio is active by some kmmio_probes? */ |
diff --git a/include/linux/module.h b/include/linux/module.h index 627ac082e2a6..a8f2c0aa4c32 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -337,6 +337,14 @@ struct module | |||
337 | const char **trace_bprintk_fmt_start; | 337 | const char **trace_bprintk_fmt_start; |
338 | unsigned int num_trace_bprintk_fmt; | 338 | unsigned int num_trace_bprintk_fmt; |
339 | #endif | 339 | #endif |
340 | #ifdef CONFIG_EVENT_TRACING | ||
341 | struct ftrace_event_call *trace_events; | ||
342 | unsigned int num_trace_events; | ||
343 | #endif | ||
344 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | ||
345 | unsigned long *ftrace_callsites; | ||
346 | unsigned int num_ftrace_callsites; | ||
347 | #endif | ||
340 | 348 | ||
341 | #ifdef CONFIG_MODULE_UNLOAD | 349 | #ifdef CONFIG_MODULE_UNLOAD |
342 | /* What modules depend on me? */ | 350 | /* What modules depend on me? */ |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 3069ec7e0ab8..878cab4f5fcc 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -150,5 +150,6 @@ extern int __must_check mutex_lock_killable(struct mutex *lock); | |||
150 | */ | 150 | */ |
151 | extern int mutex_trylock(struct mutex *lock); | 151 | extern int mutex_trylock(struct mutex *lock); |
152 | extern void mutex_unlock(struct mutex *lock); | 152 | extern void mutex_unlock(struct mutex *lock); |
153 | extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); | ||
153 | 154 | ||
154 | #endif | 155 | #endif |
diff --git a/include/linux/net_dropmon.h b/include/linux/net_dropmon.h index 0217fb81a630..0e2e100c44a2 100644 --- a/include/linux/net_dropmon.h +++ b/include/linux/net_dropmon.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __NET_DROPMON_H | 1 | #ifndef __NET_DROPMON_H |
2 | #define __NET_DROPMON_H | 2 | #define __NET_DROPMON_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
4 | #include <linux/netlink.h> | 5 | #include <linux/netlink.h> |
5 | 6 | ||
6 | struct net_dm_drop_point { | 7 | struct net_dm_drop_point { |
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h index 3066789b972a..b2f384d42611 100644 --- a/include/linux/netfilter/nf_conntrack_tcp.h +++ b/include/linux/netfilter/nf_conntrack_tcp.h | |||
@@ -35,6 +35,9 @@ enum tcp_conntrack { | |||
35 | /* Has unacknowledged data */ | 35 | /* Has unacknowledged data */ |
36 | #define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10 | 36 | #define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10 |
37 | 37 | ||
38 | /* The field td_maxack has been set */ | ||
39 | #define IP_CT_TCP_FLAG_MAXACK_SET 0x20 | ||
40 | |||
38 | struct nf_ct_tcp_flags { | 41 | struct nf_ct_tcp_flags { |
39 | __u8 flags; | 42 | __u8 flags; |
40 | __u8 mask; | 43 | __u8 mask; |
@@ -46,6 +49,7 @@ struct ip_ct_tcp_state { | |||
46 | u_int32_t td_end; /* max of seq + len */ | 49 | u_int32_t td_end; /* max of seq + len */ |
47 | u_int32_t td_maxend; /* max of ack + max(win, 1) */ | 50 | u_int32_t td_maxend; /* max of ack + max(win, 1) */ |
48 | u_int32_t td_maxwin; /* max(win) */ | 51 | u_int32_t td_maxwin; /* max(win) */ |
52 | u_int32_t td_maxack; /* max of ack */ | ||
49 | u_int8_t td_scale; /* window scale factor */ | 53 | u_int8_t td_scale; /* window scale factor */ |
50 | u_int8_t flags; /* per direction options */ | 54 | u_int8_t flags; /* per direction options */ |
51 | }; | 55 | }; |
diff --git a/include/linux/parport.h b/include/linux/parport.h index e1f83c5065c5..38a423ed3c01 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h | |||
@@ -324,6 +324,10 @@ struct parport { | |||
324 | int spintime; | 324 | int spintime; |
325 | atomic_t ref_count; | 325 | atomic_t ref_count; |
326 | 326 | ||
327 | unsigned long devflags; | ||
328 | #define PARPORT_DEVPROC_REGISTERED 0 | ||
329 | struct pardevice *proc_device; /* Currently register proc device */ | ||
330 | |||
327 | struct list_head full_list; | 331 | struct list_head full_list; |
328 | struct parport *slaves[3]; | 332 | struct parport *slaves[3]; |
329 | }; | 333 | }; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 0f71812d67d3..d7d1c41a0b17 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1996,10 +1996,12 @@ | |||
1996 | #define PCI_DEVICE_ID_OXSEMI_PCIe952_1_U 0xC118 | 1996 | #define PCI_DEVICE_ID_OXSEMI_PCIe952_1_U 0xC118 |
1997 | #define PCI_DEVICE_ID_OXSEMI_PCIe952_1_GU 0xC11C | 1997 | #define PCI_DEVICE_ID_OXSEMI_PCIe952_1_GU 0xC11C |
1998 | #define PCI_DEVICE_ID_OXSEMI_16PCI954 0x9501 | 1998 | #define PCI_DEVICE_ID_OXSEMI_16PCI954 0x9501 |
1999 | #define PCI_DEVICE_ID_OXSEMI_C950 0x950B | ||
1999 | #define PCI_DEVICE_ID_OXSEMI_16PCI95N 0x9511 | 2000 | #define PCI_DEVICE_ID_OXSEMI_16PCI95N 0x9511 |
2000 | #define PCI_DEVICE_ID_OXSEMI_16PCI954PP 0x9513 | 2001 | #define PCI_DEVICE_ID_OXSEMI_16PCI954PP 0x9513 |
2001 | #define PCI_DEVICE_ID_OXSEMI_16PCI952 0x9521 | 2002 | #define PCI_DEVICE_ID_OXSEMI_16PCI952 0x9521 |
2002 | #define PCI_DEVICE_ID_OXSEMI_16PCI952PP 0x9523 | 2003 | #define PCI_DEVICE_ID_OXSEMI_16PCI952PP 0x9523 |
2004 | #define PCI_SUBDEVICE_ID_OXSEMI_C950 0x0001 | ||
2003 | 2005 | ||
2004 | #define PCI_VENDOR_ID_CHELSIO 0x1425 | 2006 | #define PCI_VENDOR_ID_CHELSIO 0x1425 |
2005 | 2007 | ||
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 67c15653fc23..59e133d39d50 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -95,7 +95,6 @@ extern void __ptrace_link(struct task_struct *child, | |||
95 | struct task_struct *new_parent); | 95 | struct task_struct *new_parent); |
96 | extern void __ptrace_unlink(struct task_struct *child); | 96 | extern void __ptrace_unlink(struct task_struct *child); |
97 | extern void exit_ptrace(struct task_struct *tracer); | 97 | extern void exit_ptrace(struct task_struct *tracer); |
98 | extern void ptrace_fork(struct task_struct *task, unsigned long clone_flags); | ||
99 | #define PTRACE_MODE_READ 1 | 98 | #define PTRACE_MODE_READ 1 |
100 | #define PTRACE_MODE_ATTACH 2 | 99 | #define PTRACE_MODE_ATTACH 2 |
101 | /* Returns 0 on success, -errno on denial. */ | 100 | /* Returns 0 on success, -errno on denial. */ |
@@ -327,15 +326,6 @@ static inline void user_enable_block_step(struct task_struct *task) | |||
327 | #define arch_ptrace_untrace(task) do { } while (0) | 326 | #define arch_ptrace_untrace(task) do { } while (0) |
328 | #endif | 327 | #endif |
329 | 328 | ||
330 | #ifndef arch_ptrace_fork | ||
331 | /* | ||
332 | * Do machine-specific work to initialize a new task. | ||
333 | * | ||
334 | * This is called from copy_process(). | ||
335 | */ | ||
336 | #define arch_ptrace_fork(child, clone_flags) do { } while (0) | ||
337 | #endif | ||
338 | |||
339 | extern int task_current_syscall(struct task_struct *target, long *callno, | 329 | extern int task_current_syscall(struct task_struct *target, long *callno, |
340 | unsigned long args[6], unsigned int maxargs, | 330 | unsigned long args[6], unsigned int maxargs, |
341 | unsigned long *sp, unsigned long *pc); | 331 | unsigned long *sp, unsigned long *pc); |
diff --git a/include/linux/rational.h b/include/linux/rational.h new file mode 100644 index 000000000000..4f532fcd9eea --- /dev/null +++ b/include/linux/rational.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * rational fractions | ||
3 | * | ||
4 | * Copyright (C) 2009 emlix GmbH, Oskar Schirmer <os@emlix.com> | ||
5 | * | ||
6 | * helper functions when coping with rational numbers, | ||
7 | * e.g. when calculating optimum numerator/denominator pairs for | ||
8 | * pll configuration taking into account restricted register size | ||
9 | */ | ||
10 | |||
11 | #ifndef _LINUX_RATIONAL_H | ||
12 | #define _LINUX_RATIONAL_H | ||
13 | |||
14 | void rational_best_approximation( | ||
15 | unsigned long given_numerator, unsigned long given_denominator, | ||
16 | unsigned long max_numerator, unsigned long max_denominator, | ||
17 | unsigned long *best_numerator, unsigned long *best_denominator); | ||
18 | |||
19 | #endif /* _LINUX_RATIONAL_H */ | ||
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index e649bd3f2c97..5710f43bbc9e 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -198,6 +198,32 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
198 | at->prev = last; | 198 | at->prev = last; |
199 | } | 199 | } |
200 | 200 | ||
201 | /** | ||
202 | * list_entry_rcu - get the struct for this entry | ||
203 | * @ptr: the &struct list_head pointer. | ||
204 | * @type: the type of the struct this is embedded in. | ||
205 | * @member: the name of the list_struct within the struct. | ||
206 | * | ||
207 | * This primitive may safely run concurrently with the _rcu list-mutation | ||
208 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). | ||
209 | */ | ||
210 | #define list_entry_rcu(ptr, type, member) \ | ||
211 | container_of(rcu_dereference(ptr), type, member) | ||
212 | |||
213 | /** | ||
214 | * list_first_entry_rcu - get the first element from a list | ||
215 | * @ptr: the list head to take the element from. | ||
216 | * @type: the type of the struct this is embedded in. | ||
217 | * @member: the name of the list_struct within the struct. | ||
218 | * | ||
219 | * Note, that list is expected to be not empty. | ||
220 | * | ||
221 | * This primitive may safely run concurrently with the _rcu list-mutation | ||
222 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). | ||
223 | */ | ||
224 | #define list_first_entry_rcu(ptr, type, member) \ | ||
225 | list_entry_rcu((ptr)->next, type, member) | ||
226 | |||
201 | #define __list_for_each_rcu(pos, head) \ | 227 | #define __list_for_each_rcu(pos, head) \ |
202 | for (pos = rcu_dereference((head)->next); \ | 228 | for (pos = rcu_dereference((head)->next); \ |
203 | pos != (head); \ | 229 | pos != (head); \ |
@@ -214,9 +240,9 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
214 | * as long as the traversal is guarded by rcu_read_lock(). | 240 | * as long as the traversal is guarded by rcu_read_lock(). |
215 | */ | 241 | */ |
216 | #define list_for_each_entry_rcu(pos, head, member) \ | 242 | #define list_for_each_entry_rcu(pos, head, member) \ |
217 | for (pos = list_entry(rcu_dereference((head)->next), typeof(*pos), member); \ | 243 | for (pos = list_entry_rcu((head)->next, typeof(*pos), member); \ |
218 | prefetch(pos->member.next), &pos->member != (head); \ | 244 | prefetch(pos->member.next), &pos->member != (head); \ |
219 | pos = list_entry(rcu_dereference(pos->member.next), typeof(*pos), member)) | 245 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member)) |
220 | 246 | ||
221 | 247 | ||
222 | /** | 248 | /** |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 58b2aa5312b9..5a5153806c42 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -161,8 +161,15 @@ struct rcu_data { | |||
161 | unsigned long offline_fqs; /* Kicked due to being offline. */ | 161 | unsigned long offline_fqs; /* Kicked due to being offline. */ |
162 | unsigned long resched_ipi; /* Sent a resched IPI. */ | 162 | unsigned long resched_ipi; /* Sent a resched IPI. */ |
163 | 163 | ||
164 | /* 5) For future __rcu_pending statistics. */ | 164 | /* 5) __rcu_pending() statistics. */ |
165 | long n_rcu_pending; /* rcu_pending() calls since boot. */ | 165 | long n_rcu_pending; /* rcu_pending() calls since boot. */ |
166 | long n_rp_qs_pending; | ||
167 | long n_rp_cb_ready; | ||
168 | long n_rp_cpu_needs_gp; | ||
169 | long n_rp_gp_completed; | ||
170 | long n_rp_gp_started; | ||
171 | long n_rp_need_fqs; | ||
172 | long n_rp_need_nothing; | ||
166 | 173 | ||
167 | int cpu; | 174 | int cpu; |
168 | }; | 175 | }; |
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index e1b7b2173885..8670f1575fe1 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -11,7 +11,7 @@ struct ring_buffer_iter; | |||
11 | * Don't refer to this struct directly, use functions below. | 11 | * Don't refer to this struct directly, use functions below. |
12 | */ | 12 | */ |
13 | struct ring_buffer_event { | 13 | struct ring_buffer_event { |
14 | u32 type:2, len:3, time_delta:27; | 14 | u32 type_len:5, time_delta:27; |
15 | u32 array[]; | 15 | u32 array[]; |
16 | }; | 16 | }; |
17 | 17 | ||
@@ -24,7 +24,8 @@ struct ring_buffer_event { | |||
24 | * size is variable depending on how much | 24 | * size is variable depending on how much |
25 | * padding is needed | 25 | * padding is needed |
26 | * If time_delta is non zero: | 26 | * If time_delta is non zero: |
27 | * everything else same as RINGBUF_TYPE_DATA | 27 | * array[0] holds the actual length |
28 | * size = 4 + length (bytes) | ||
28 | * | 29 | * |
29 | * @RINGBUF_TYPE_TIME_EXTEND: Extend the time delta | 30 | * @RINGBUF_TYPE_TIME_EXTEND: Extend the time delta |
30 | * array[0] = time delta (28 .. 59) | 31 | * array[0] = time delta (28 .. 59) |
@@ -35,22 +36,23 @@ struct ring_buffer_event { | |||
35 | * array[1..2] = tv_sec | 36 | * array[1..2] = tv_sec |
36 | * size = 16 bytes | 37 | * size = 16 bytes |
37 | * | 38 | * |
38 | * @RINGBUF_TYPE_DATA: Data record | 39 | * <= @RINGBUF_TYPE_DATA_TYPE_LEN_MAX: |
39 | * If len is zero: | 40 | * Data record |
41 | * If type_len is zero: | ||
40 | * array[0] holds the actual length | 42 | * array[0] holds the actual length |
41 | * array[1..(length+3)/4] holds data | 43 | * array[1..(length+3)/4] holds data |
42 | * size = 4 + 4 + length (bytes) | 44 | * size = 4 + length (bytes) |
43 | * else | 45 | * else |
44 | * length = len << 2 | 46 | * length = type_len << 2 |
45 | * array[0..(length+3)/4-1] holds data | 47 | * array[0..(length+3)/4-1] holds data |
46 | * size = 4 + length (bytes) | 48 | * size = 4 + length (bytes) |
47 | */ | 49 | */ |
48 | enum ring_buffer_type { | 50 | enum ring_buffer_type { |
51 | RINGBUF_TYPE_DATA_TYPE_LEN_MAX = 28, | ||
49 | RINGBUF_TYPE_PADDING, | 52 | RINGBUF_TYPE_PADDING, |
50 | RINGBUF_TYPE_TIME_EXTEND, | 53 | RINGBUF_TYPE_TIME_EXTEND, |
51 | /* FIXME: RINGBUF_TYPE_TIME_STAMP not implemented */ | 54 | /* FIXME: RINGBUF_TYPE_TIME_STAMP not implemented */ |
52 | RINGBUF_TYPE_TIME_STAMP, | 55 | RINGBUF_TYPE_TIME_STAMP, |
53 | RINGBUF_TYPE_DATA, | ||
54 | }; | 56 | }; |
55 | 57 | ||
56 | unsigned ring_buffer_event_length(struct ring_buffer_event *event); | 58 | unsigned ring_buffer_event_length(struct ring_buffer_event *event); |
@@ -68,13 +70,54 @@ ring_buffer_event_time_delta(struct ring_buffer_event *event) | |||
68 | return event->time_delta; | 70 | return event->time_delta; |
69 | } | 71 | } |
70 | 72 | ||
73 | /* | ||
74 | * ring_buffer_event_discard can discard any event in the ring buffer. | ||
75 | * it is up to the caller to protect against a reader from | ||
76 | * consuming it or a writer from wrapping and replacing it. | ||
77 | * | ||
78 | * No external protection is needed if this is called before | ||
79 | * the event is commited. But in that case it would be better to | ||
80 | * use ring_buffer_discard_commit. | ||
81 | * | ||
82 | * Note, if an event that has not been committed is discarded | ||
83 | * with ring_buffer_event_discard, it must still be committed. | ||
84 | */ | ||
71 | void ring_buffer_event_discard(struct ring_buffer_event *event); | 85 | void ring_buffer_event_discard(struct ring_buffer_event *event); |
72 | 86 | ||
73 | /* | 87 | /* |
88 | * ring_buffer_discard_commit will remove an event that has not | ||
89 | * ben committed yet. If this is used, then ring_buffer_unlock_commit | ||
90 | * must not be called on the discarded event. This function | ||
91 | * will try to remove the event from the ring buffer completely | ||
92 | * if another event has not been written after it. | ||
93 | * | ||
94 | * Example use: | ||
95 | * | ||
96 | * if (some_condition) | ||
97 | * ring_buffer_discard_commit(buffer, event); | ||
98 | * else | ||
99 | * ring_buffer_unlock_commit(buffer, event); | ||
100 | */ | ||
101 | void ring_buffer_discard_commit(struct ring_buffer *buffer, | ||
102 | struct ring_buffer_event *event); | ||
103 | |||
104 | /* | ||
74 | * size is in bytes for each per CPU buffer. | 105 | * size is in bytes for each per CPU buffer. |
75 | */ | 106 | */ |
76 | struct ring_buffer * | 107 | struct ring_buffer * |
77 | ring_buffer_alloc(unsigned long size, unsigned flags); | 108 | __ring_buffer_alloc(unsigned long size, unsigned flags, struct lock_class_key *key); |
109 | |||
110 | /* | ||
111 | * Because the ring buffer is generic, if other users of the ring buffer get | ||
112 | * traced by ftrace, it can produce lockdep warnings. We need to keep each | ||
113 | * ring buffer's lock class separate. | ||
114 | */ | ||
115 | #define ring_buffer_alloc(size, flags) \ | ||
116 | ({ \ | ||
117 | static struct lock_class_key __key; \ | ||
118 | __ring_buffer_alloc((size), (flags), &__key); \ | ||
119 | }) | ||
120 | |||
78 | void ring_buffer_free(struct ring_buffer *buffer); | 121 | void ring_buffer_free(struct ring_buffer *buffer); |
79 | 122 | ||
80 | int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size); | 123 | int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size); |
@@ -122,6 +165,8 @@ unsigned long ring_buffer_entries(struct ring_buffer *buffer); | |||
122 | unsigned long ring_buffer_overruns(struct ring_buffer *buffer); | 165 | unsigned long ring_buffer_overruns(struct ring_buffer *buffer); |
123 | unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); | 166 | unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); |
124 | unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); | 167 | unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); |
168 | unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu); | ||
169 | unsigned long ring_buffer_nmi_dropped_cpu(struct ring_buffer *buffer, int cpu); | ||
125 | 170 | ||
126 | u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); | 171 | u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); |
127 | void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, | 172 | void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, |
@@ -137,6 +182,11 @@ void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data); | |||
137 | int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page, | 182 | int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page, |
138 | size_t len, int cpu, int full); | 183 | size_t len, int cpu, int full); |
139 | 184 | ||
185 | struct trace_seq; | ||
186 | |||
187 | int ring_buffer_print_entry_header(struct trace_seq *s); | ||
188 | int ring_buffer_print_page_header(struct trace_seq *s); | ||
189 | |||
140 | enum ring_buffer_flags { | 190 | enum ring_buffer_flags { |
141 | RB_FL_OVERWRITE = 1 << 0, | 191 | RB_FL_OVERWRITE = 1 << 0, |
142 | }; | 192 | }; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index b4c38bc8049c..42bf2766111e 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -77,6 +77,7 @@ struct sched_param { | |||
77 | #include <linux/proportions.h> | 77 | #include <linux/proportions.h> |
78 | #include <linux/seccomp.h> | 78 | #include <linux/seccomp.h> |
79 | #include <linux/rcupdate.h> | 79 | #include <linux/rcupdate.h> |
80 | #include <linux/rculist.h> | ||
80 | #include <linux/rtmutex.h> | 81 | #include <linux/rtmutex.h> |
81 | 82 | ||
82 | #include <linux/time.h> | 83 | #include <linux/time.h> |
@@ -96,8 +97,8 @@ struct exec_domain; | |||
96 | struct futex_pi_state; | 97 | struct futex_pi_state; |
97 | struct robust_list_head; | 98 | struct robust_list_head; |
98 | struct bio; | 99 | struct bio; |
99 | struct bts_tracer; | ||
100 | struct fs_struct; | 100 | struct fs_struct; |
101 | struct bts_context; | ||
101 | 102 | ||
102 | /* | 103 | /* |
103 | * List of flags we want to share for kernel threads, | 104 | * List of flags we want to share for kernel threads, |
@@ -116,6 +117,7 @@ struct fs_struct; | |||
116 | * 11 bit fractions. | 117 | * 11 bit fractions. |
117 | */ | 118 | */ |
118 | extern unsigned long avenrun[]; /* Load averages */ | 119 | extern unsigned long avenrun[]; /* Load averages */ |
120 | extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift); | ||
119 | 121 | ||
120 | #define FSHIFT 11 /* nr of bits of precision */ | 122 | #define FSHIFT 11 /* nr of bits of precision */ |
121 | #define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ | 123 | #define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ |
@@ -135,8 +137,8 @@ DECLARE_PER_CPU(unsigned long, process_counts); | |||
135 | extern int nr_processes(void); | 137 | extern int nr_processes(void); |
136 | extern unsigned long nr_running(void); | 138 | extern unsigned long nr_running(void); |
137 | extern unsigned long nr_uninterruptible(void); | 139 | extern unsigned long nr_uninterruptible(void); |
138 | extern unsigned long nr_active(void); | ||
139 | extern unsigned long nr_iowait(void); | 140 | extern unsigned long nr_iowait(void); |
141 | extern void calc_global_load(void); | ||
140 | 142 | ||
141 | extern unsigned long get_parent_ip(unsigned long addr); | 143 | extern unsigned long get_parent_ip(unsigned long addr); |
142 | 144 | ||
@@ -838,7 +840,17 @@ struct sched_group { | |||
838 | */ | 840 | */ |
839 | u32 reciprocal_cpu_power; | 841 | u32 reciprocal_cpu_power; |
840 | 842 | ||
841 | unsigned long cpumask[]; | 843 | /* |
844 | * The CPUs this group covers. | ||
845 | * | ||
846 | * NOTE: this field is variable length. (Allocated dynamically | ||
847 | * by attaching extra space to the end of the structure, | ||
848 | * depending on how many CPUs the kernel has booted up with) | ||
849 | * | ||
850 | * It is also be embedded into static data structures at build | ||
851 | * time. (See 'struct static_sched_group' in kernel/sched.c) | ||
852 | */ | ||
853 | unsigned long cpumask[0]; | ||
842 | }; | 854 | }; |
843 | 855 | ||
844 | static inline struct cpumask *sched_group_cpus(struct sched_group *sg) | 856 | static inline struct cpumask *sched_group_cpus(struct sched_group *sg) |
@@ -924,8 +936,17 @@ struct sched_domain { | |||
924 | char *name; | 936 | char *name; |
925 | #endif | 937 | #endif |
926 | 938 | ||
927 | /* span of all CPUs in this domain */ | 939 | /* |
928 | unsigned long span[]; | 940 | * Span of all CPUs in this domain. |
941 | * | ||
942 | * NOTE: this field is variable length. (Allocated dynamically | ||
943 | * by attaching extra space to the end of the structure, | ||
944 | * depending on how many CPUs the kernel has booted up with) | ||
945 | * | ||
946 | * It is also be embedded into static data structures at build | ||
947 | * time. (See 'struct static_sched_domain' in kernel/sched.c) | ||
948 | */ | ||
949 | unsigned long span[0]; | ||
929 | }; | 950 | }; |
930 | 951 | ||
931 | static inline struct cpumask *sched_domain_span(struct sched_domain *sd) | 952 | static inline struct cpumask *sched_domain_span(struct sched_domain *sd) |
@@ -1209,18 +1230,11 @@ struct task_struct { | |||
1209 | struct list_head ptraced; | 1230 | struct list_head ptraced; |
1210 | struct list_head ptrace_entry; | 1231 | struct list_head ptrace_entry; |
1211 | 1232 | ||
1212 | #ifdef CONFIG_X86_PTRACE_BTS | ||
1213 | /* | 1233 | /* |
1214 | * This is the tracer handle for the ptrace BTS extension. | 1234 | * This is the tracer handle for the ptrace BTS extension. |
1215 | * This field actually belongs to the ptracer task. | 1235 | * This field actually belongs to the ptracer task. |
1216 | */ | 1236 | */ |
1217 | struct bts_tracer *bts; | 1237 | struct bts_context *bts; |
1218 | /* | ||
1219 | * The buffer to hold the BTS data. | ||
1220 | */ | ||
1221 | void *bts_buffer; | ||
1222 | size_t bts_size; | ||
1223 | #endif /* CONFIG_X86_PTRACE_BTS */ | ||
1224 | 1238 | ||
1225 | /* PID/PID hash table linkage. */ | 1239 | /* PID/PID hash table linkage. */ |
1226 | struct pid_link pids[PIDTYPE_MAX]; | 1240 | struct pid_link pids[PIDTYPE_MAX]; |
@@ -1247,7 +1261,9 @@ struct task_struct { | |||
1247 | * credentials (COW) */ | 1261 | * credentials (COW) */ |
1248 | const struct cred *cred; /* effective (overridable) subjective task | 1262 | const struct cred *cred; /* effective (overridable) subjective task |
1249 | * credentials (COW) */ | 1263 | * credentials (COW) */ |
1250 | struct mutex cred_exec_mutex; /* execve vs ptrace cred calculation mutex */ | 1264 | struct mutex cred_guard_mutex; /* guard against foreign influences on |
1265 | * credential calculations | ||
1266 | * (notably. ptrace) */ | ||
1251 | 1267 | ||
1252 | char comm[TASK_COMM_LEN]; /* executable name excluding path | 1268 | char comm[TASK_COMM_LEN]; /* executable name excluding path |
1253 | - access with [gs]et_task_comm (which lock | 1269 | - access with [gs]et_task_comm (which lock |
@@ -1428,7 +1444,9 @@ struct task_struct { | |||
1428 | #ifdef CONFIG_TRACING | 1444 | #ifdef CONFIG_TRACING |
1429 | /* state flags for use by tracers */ | 1445 | /* state flags for use by tracers */ |
1430 | unsigned long trace; | 1446 | unsigned long trace; |
1431 | #endif | 1447 | /* bitmask of trace recursion */ |
1448 | unsigned long trace_recursion; | ||
1449 | #endif /* CONFIG_TRACING */ | ||
1432 | }; | 1450 | }; |
1433 | 1451 | ||
1434 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ | 1452 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ |
@@ -1885,6 +1903,7 @@ extern void sched_dead(struct task_struct *p); | |||
1885 | 1903 | ||
1886 | extern void proc_caches_init(void); | 1904 | extern void proc_caches_init(void); |
1887 | extern void flush_signals(struct task_struct *); | 1905 | extern void flush_signals(struct task_struct *); |
1906 | extern void __flush_signals(struct task_struct *); | ||
1888 | extern void ignore_signals(struct task_struct *); | 1907 | extern void ignore_signals(struct task_struct *); |
1889 | extern void flush_signal_handlers(struct task_struct *, int force_default); | 1908 | extern void flush_signal_handlers(struct task_struct *, int force_default); |
1890 | extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info); | 1909 | extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info); |
@@ -2001,8 +2020,10 @@ extern void set_task_comm(struct task_struct *tsk, char *from); | |||
2001 | extern char *get_task_comm(char *to, struct task_struct *tsk); | 2020 | extern char *get_task_comm(char *to, struct task_struct *tsk); |
2002 | 2021 | ||
2003 | #ifdef CONFIG_SMP | 2022 | #ifdef CONFIG_SMP |
2023 | extern void wait_task_context_switch(struct task_struct *p); | ||
2004 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); | 2024 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); |
2005 | #else | 2025 | #else |
2026 | static inline void wait_task_context_switch(struct task_struct *p) {} | ||
2006 | static inline unsigned long wait_task_inactive(struct task_struct *p, | 2027 | static inline unsigned long wait_task_inactive(struct task_struct *p, |
2007 | long match_state) | 2028 | long match_state) |
2008 | { | 2029 | { |
@@ -2010,7 +2031,8 @@ static inline unsigned long wait_task_inactive(struct task_struct *p, | |||
2010 | } | 2031 | } |
2011 | #endif | 2032 | #endif |
2012 | 2033 | ||
2013 | #define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) | 2034 | #define next_task(p) \ |
2035 | list_entry_rcu((p)->tasks.next, struct task_struct, tasks) | ||
2014 | 2036 | ||
2015 | #define for_each_process(p) \ | 2037 | #define for_each_process(p) \ |
2016 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) | 2038 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) |
@@ -2049,8 +2071,8 @@ int same_thread_group(struct task_struct *p1, struct task_struct *p2) | |||
2049 | 2071 | ||
2050 | static inline struct task_struct *next_thread(const struct task_struct *p) | 2072 | static inline struct task_struct *next_thread(const struct task_struct *p) |
2051 | { | 2073 | { |
2052 | return list_entry(rcu_dereference(p->thread_group.next), | 2074 | return list_entry_rcu(p->thread_group.next, |
2053 | struct task_struct, thread_group); | 2075 | struct task_struct, thread_group); |
2054 | } | 2076 | } |
2055 | 2077 | ||
2056 | static inline int thread_group_empty(struct task_struct *p) | 2078 | static inline int thread_group_empty(struct task_struct *p) |
diff --git a/include/linux/security.h b/include/linux/security.h index d5fd6163606f..5eff459b3833 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -2197,6 +2197,8 @@ static inline int security_file_mmap(struct file *file, unsigned long reqprot, | |||
2197 | unsigned long addr, | 2197 | unsigned long addr, |
2198 | unsigned long addr_only) | 2198 | unsigned long addr_only) |
2199 | { | 2199 | { |
2200 | if ((addr < mmap_min_addr) && !capable(CAP_SYS_RAWIO)) | ||
2201 | return -EACCES; | ||
2200 | return 0; | 2202 | return 0; |
2201 | } | 2203 | } |
2202 | 2204 | ||
diff --git a/include/linux/serial.h b/include/linux/serial.h index 9136cc5608c3..e5bb75a63802 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
@@ -96,54 +96,76 @@ struct serial_uart_config { | |||
96 | 96 | ||
97 | /* | 97 | /* |
98 | * Definitions for async_struct (and serial_struct) flags field | 98 | * Definitions for async_struct (and serial_struct) flags field |
99 | * | ||
100 | * Define ASYNCB_* for convenient use with {test,set,clear}_bit. | ||
99 | */ | 101 | */ |
100 | #define ASYNC_HUP_NOTIFY 0x0001 /* Notify getty on hangups and closes | 102 | #define ASYNCB_HUP_NOTIFY 0 /* Notify getty on hangups and closes |
101 | on the callout port */ | 103 | * on the callout port */ |
102 | #define ASYNC_FOURPORT 0x0002 /* Set OU1, OUT2 per AST Fourport settings */ | 104 | #define ASYNCB_FOURPORT 1 /* Set OU1, OUT2 per AST Fourport settings */ |
103 | #define ASYNC_SAK 0x0004 /* Secure Attention Key (Orange book) */ | 105 | #define ASYNCB_SAK 2 /* Secure Attention Key (Orange book) */ |
104 | #define ASYNC_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */ | 106 | #define ASYNCB_SPLIT_TERMIOS 3 /* Separate termios for dialin/callout */ |
105 | 107 | #define ASYNCB_SPD_HI 4 /* Use 56000 instead of 38400 bps */ | |
106 | #define ASYNC_SPD_MASK 0x1030 | 108 | #define ASYNCB_SPD_VHI 5 /* Use 115200 instead of 38400 bps */ |
107 | #define ASYNC_SPD_HI 0x0010 /* Use 56000 instead of 38400 bps */ | 109 | #define ASYNCB_SKIP_TEST 6 /* Skip UART test during autoconfiguration */ |
108 | 110 | #define ASYNCB_AUTO_IRQ 7 /* Do automatic IRQ during | |
109 | #define ASYNC_SPD_VHI 0x0020 /* Use 115200 instead of 38400 bps */ | 111 | * autoconfiguration */ |
110 | #define ASYNC_SPD_CUST 0x0030 /* Use user-specified divisor */ | 112 | #define ASYNCB_SESSION_LOCKOUT 8 /* Lock out cua opens based on session */ |
111 | 113 | #define ASYNCB_PGRP_LOCKOUT 9 /* Lock out cua opens based on pgrp */ | |
112 | #define ASYNC_SKIP_TEST 0x0040 /* Skip UART test during autoconfiguration */ | 114 | #define ASYNCB_CALLOUT_NOHUP 10 /* Don't do hangups for cua device */ |
113 | #define ASYNC_AUTO_IRQ 0x0080 /* Do automatic IRQ during autoconfiguration */ | 115 | #define ASYNCB_HARDPPS_CD 11 /* Call hardpps when CD goes high */ |
114 | #define ASYNC_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */ | 116 | #define ASYNCB_SPD_SHI 12 /* Use 230400 instead of 38400 bps */ |
115 | #define ASYNC_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */ | 117 | #define ASYNCB_LOW_LATENCY 13 /* Request low latency behaviour */ |
116 | #define ASYNC_CALLOUT_NOHUP 0x0400 /* Don't do hangups for cua device */ | 118 | #define ASYNCB_BUGGY_UART 14 /* This is a buggy UART, skip some safety |
117 | 119 | * checks. Note: can be dangerous! */ | |
118 | #define ASYNC_HARDPPS_CD 0x0800 /* Call hardpps when CD goes high */ | 120 | #define ASYNCB_AUTOPROBE 15 /* Port was autoprobed by PCI or PNP code */ |
119 | 121 | #define ASYNCB_LAST_USER 15 | |
120 | #define ASYNC_SPD_SHI 0x1000 /* Use 230400 instead of 38400 bps */ | 122 | |
121 | #define ASYNC_SPD_WARP 0x1010 /* Use 460800 instead of 38400 bps */ | 123 | /* Internal flags used only by kernel */ |
122 | 124 | #define ASYNCB_INITIALIZED 31 /* Serial port was initialized */ | |
123 | #define ASYNC_LOW_LATENCY 0x2000 /* Request low latency behaviour */ | 125 | #define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */ |
124 | 126 | #define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */ | |
125 | #define ASYNC_BUGGY_UART 0x4000 /* This is a buggy UART, skip some safety | 127 | #define ASYNCB_CLOSING 27 /* Serial port is closing */ |
126 | * checks. Note: can be dangerous! */ | 128 | #define ASYNCB_CTS_FLOW 26 /* Do CTS flow control */ |
127 | 129 | #define ASYNCB_CHECK_CD 25 /* i.e., CLOCAL */ | |
128 | #define ASYNC_AUTOPROBE 0x8000 /* Port was autoprobed by PCI or PNP code */ | 130 | #define ASYNCB_SHARE_IRQ 24 /* for multifunction cards, no longer used */ |
129 | 131 | #define ASYNCB_CONS_FLOW 23 /* flow control for console */ | |
130 | #define ASYNC_FLAGS 0x7FFF /* Possible legal async flags */ | 132 | #define ASYNCB_BOOT_ONLYMCA 22 /* Probe only if MCA bus */ |
131 | #define ASYNC_USR_MASK 0x3430 /* Legal flags that non-privileged | 133 | #define ASYNCB_FIRST_KERNEL 22 |
132 | * users can set or reset */ | 134 | |
133 | 135 | #define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY) | |
134 | /* Internal flags used only by kernel/chr_drv/serial.c */ | 136 | #define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT) |
135 | #define ASYNC_INITIALIZED 0x80000000 /* Serial port was initialized */ | 137 | #define ASYNC_SAK (1U << ASYNCB_SAK) |
136 | #define ASYNC_NORMAL_ACTIVE 0x20000000 /* Normal device is active */ | 138 | #define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS) |
137 | #define ASYNC_BOOT_AUTOCONF 0x10000000 /* Autoconfigure port on bootup */ | 139 | #define ASYNC_SPD_HI (1U << ASYNCB_SPD_HI) |
138 | #define ASYNC_CLOSING 0x08000000 /* Serial port is closing */ | 140 | #define ASYNC_SPD_VHI (1U << ASYNCB_SPD_VHI) |
139 | #define ASYNC_CTS_FLOW 0x04000000 /* Do CTS flow control */ | 141 | #define ASYNC_SKIP_TEST (1U << ASYNCB_SKIP_TEST) |
140 | #define ASYNC_CHECK_CD 0x02000000 /* i.e., CLOCAL */ | 142 | #define ASYNC_AUTO_IRQ (1U << ASYNCB_AUTO_IRQ) |
141 | #define ASYNC_SHARE_IRQ 0x01000000 /* for multifunction cards | 143 | #define ASYNC_SESSION_LOCKOUT (1U << ASYNCB_SESSION_LOCKOUT) |
142 | --- no longer used */ | 144 | #define ASYNC_PGRP_LOCKOUT (1U << ASYNCB_PGRP_LOCKOUT) |
143 | #define ASYNC_CONS_FLOW 0x00800000 /* flow control for console */ | 145 | #define ASYNC_CALLOUT_NOHUP (1U << ASYNCB_CALLOUT_NOHUP) |
144 | 146 | #define ASYNC_HARDPPS_CD (1U << ASYNCB_HARDPPS_CD) | |
145 | #define ASYNC_BOOT_ONLYMCA 0x00400000 /* Probe only if MCA bus */ | 147 | #define ASYNC_SPD_SHI (1U << ASYNCB_SPD_SHI) |
146 | #define ASYNC_INTERNAL_FLAGS 0xFFC00000 /* Internal flags */ | 148 | #define ASYNC_LOW_LATENCY (1U << ASYNCB_LOW_LATENCY) |
149 | #define ASYNC_BUGGY_UART (1U << ASYNCB_BUGGY_UART) | ||
150 | #define ASYNC_AUTOPROBE (1U << ASYNCB_AUTOPROBE) | ||
151 | |||
152 | #define ASYNC_FLAGS ((1U << ASYNCB_LAST_USER) - 1) | ||
153 | #define ASYNC_USR_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI| \ | ||
154 | ASYNC_CALLOUT_NOHUP|ASYNC_SPD_SHI|ASYNC_LOW_LATENCY) | ||
155 | #define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI) | ||
156 | #define ASYNC_SPD_WARP (ASYNC_SPD_HI|ASYNC_SPD_SHI) | ||
157 | #define ASYNC_SPD_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI) | ||
158 | |||
159 | #define ASYNC_INITIALIZED (1U << ASYNCB_INITIALIZED) | ||
160 | #define ASYNC_NORMAL_ACTIVE (1U << ASYNCB_NORMAL_ACTIVE) | ||
161 | #define ASYNC_BOOT_AUTOCONF (1U << ASYNCB_BOOT_AUTOCONF) | ||
162 | #define ASYNC_CLOSING (1U << ASYNCB_CLOSING) | ||
163 | #define ASYNC_CTS_FLOW (1U << ASYNCB_CTS_FLOW) | ||
164 | #define ASYNC_CHECK_CD (1U << ASYNCB_CHECK_CD) | ||
165 | #define ASYNC_SHARE_IRQ (1U << ASYNCB_SHARE_IRQ) | ||
166 | #define ASYNC_CONS_FLOW (1U << ASYNCB_CONS_FLOW) | ||
167 | #define ASYNC_BOOT_ONLYMCA (1U << ASYNCB_BOOT_ONLYMCA) | ||
168 | #define ASYNC_INTERNAL_FLAGS (~((1U << ASYNCB_FIRST_KERNEL) - 1)) | ||
147 | 169 | ||
148 | /* | 170 | /* |
149 | * Multiport serial configuration structure --- external structure | 171 | * Multiport serial configuration structure --- external structure |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 57a97e52e58d..6fd80c4243f1 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -41,7 +41,8 @@ | |||
41 | #define PORT_XSCALE 15 | 41 | #define PORT_XSCALE 15 |
42 | #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ | 42 | #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ |
43 | #define PORT_OCTEON 17 /* Cavium OCTEON internal UART */ | 43 | #define PORT_OCTEON 17 /* Cavium OCTEON internal UART */ |
44 | #define PORT_MAX_8250 17 /* max port ID */ | 44 | #define PORT_AR7 18 /* Texas Instruments AR7 internal UART */ |
45 | #define PORT_MAX_8250 18 /* max port ID */ | ||
45 | 46 | ||
46 | /* | 47 | /* |
47 | * ARM specific type numbers. These are not currently guaranteed | 48 | * ARM specific type numbers. These are not currently guaranteed |
@@ -167,6 +168,9 @@ | |||
167 | /* MAX3100 */ | 168 | /* MAX3100 */ |
168 | #define PORT_MAX3100 86 | 169 | #define PORT_MAX3100 86 |
169 | 170 | ||
171 | /* Timberdale UART */ | ||
172 | #define PORT_TIMBUART 87 | ||
173 | |||
170 | #ifdef __KERNEL__ | 174 | #ifdef __KERNEL__ |
171 | 175 | ||
172 | #include <linux/compiler.h> | 176 | #include <linux/compiler.h> |
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index 893cc53486bc..1c297ddc9d5a 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
@@ -25,8 +25,7 @@ struct plat_sci_port { | |||
25 | unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ | 25 | unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ |
26 | unsigned int type; /* SCI / SCIF / IRDA */ | 26 | unsigned int type; /* SCI / SCIF / IRDA */ |
27 | upf_t flags; /* UPF_* flags */ | 27 | upf_t flags; /* UPF_* flags */ |
28 | char *clk; /* clock string */ | ||
28 | }; | 29 | }; |
29 | 30 | ||
30 | int early_sci_setup(struct uart_port *port); | ||
31 | |||
32 | #endif /* __LINUX_SERIAL_SCI_H */ | 31 | #endif /* __LINUX_SERIAL_SCI_H */ |
diff --git a/include/linux/sh_cmt.h b/include/linux/sh_cmt.h deleted file mode 100644 index 68cacde5954f..000000000000 --- a/include/linux/sh_cmt.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | #ifndef __SH_CMT_H__ | ||
2 | #define __SH_CMT_H__ | ||
3 | |||
4 | struct sh_cmt_config { | ||
5 | char *name; | ||
6 | unsigned long channel_offset; | ||
7 | int timer_bit; | ||
8 | char *clk; | ||
9 | unsigned long clockevent_rating; | ||
10 | unsigned long clocksource_rating; | ||
11 | }; | ||
12 | |||
13 | #endif /* __SH_CMT_H__ */ | ||
diff --git a/include/linux/sh_timer.h b/include/linux/sh_timer.h new file mode 100644 index 000000000000..864bd56bd3b0 --- /dev/null +++ b/include/linux/sh_timer.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef __SH_TIMER_H__ | ||
2 | #define __SH_TIMER_H__ | ||
3 | |||
4 | struct sh_timer_config { | ||
5 | char *name; | ||
6 | long channel_offset; | ||
7 | int timer_bit; | ||
8 | char *clk; | ||
9 | unsigned long clockevent_rating; | ||
10 | unsigned long clocksource_rating; | ||
11 | }; | ||
12 | |||
13 | #endif /* __SH_TIMER_H__ */ | ||
diff --git a/include/linux/signal.h b/include/linux/signal.h index 84f997f8aa53..c7552836bd95 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -235,6 +235,8 @@ static inline int valid_signal(unsigned long sig) | |||
235 | extern int next_signal(struct sigpending *pending, sigset_t *mask); | 235 | extern int next_signal(struct sigpending *pending, sigset_t *mask); |
236 | extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); | 236 | extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); |
237 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); | 237 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); |
238 | extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, | ||
239 | siginfo_t *info); | ||
238 | extern long do_sigpending(void __user *, unsigned long); | 240 | extern long do_sigpending(void __user *, unsigned long); |
239 | extern int sigprocmask(int, sigset_t *, sigset_t *); | 241 | extern int sigprocmask(int, sigset_t *, sigset_t *); |
240 | extern int show_unhandled_signals; | 242 | extern int show_unhandled_signals; |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 5ac9b0bcaf9a..713f841ecaa9 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */ | 14 | #include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */ |
15 | #include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ | 15 | #include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ |
16 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
17 | #include <trace/kmemtrace.h> | 17 | #include <linux/kmemtrace.h> |
18 | 18 | ||
19 | /* Size description struct for general caches. */ | 19 | /* Size description struct for general caches. */ |
20 | struct cache_sizes { | 20 | struct cache_sizes { |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 5046f90c1171..be5d40c43bd2 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #include <linux/gfp.h> | 10 | #include <linux/gfp.h> |
11 | #include <linux/workqueue.h> | 11 | #include <linux/workqueue.h> |
12 | #include <linux/kobject.h> | 12 | #include <linux/kobject.h> |
13 | #include <trace/kmemtrace.h> | 13 | #include <linux/kmemtrace.h> |
14 | 14 | ||
15 | enum stat_item { | 15 | enum stat_item { |
16 | ALLOC_FASTPATH, /* Allocation from cpu slab */ | 16 | ALLOC_FASTPATH, /* Allocation from cpu slab */ |
diff --git a/include/linux/spinlock_up.h b/include/linux/spinlock_up.h index 938234c4a996..d4841ed8215b 100644 --- a/include/linux/spinlock_up.h +++ b/include/linux/spinlock_up.h | |||
@@ -60,6 +60,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock) | |||
60 | #define __raw_spin_is_locked(lock) ((void)(lock), 0) | 60 | #define __raw_spin_is_locked(lock) ((void)(lock), 0) |
61 | /* for sched.c and kernel_lock.c: */ | 61 | /* for sched.c and kernel_lock.c: */ |
62 | # define __raw_spin_lock(lock) do { (void)(lock); } while (0) | 62 | # define __raw_spin_lock(lock) do { (void)(lock); } while (0) |
63 | # define __raw_spin_lock_flags(lock, flags) do { (void)(lock); } while (0) | ||
63 | # define __raw_spin_unlock(lock) do { (void)(lock); } while (0) | 64 | # define __raw_spin_unlock(lock) do { (void)(lock); } while (0) |
64 | # define __raw_spin_trylock(lock) ({ (void)(lock); 1; }) | 65 | # define __raw_spin_trylock(lock) ({ (void)(lock); 1; }) |
65 | #endif /* DEBUG_SPINLOCK */ | 66 | #endif /* DEBUG_SPINLOCK */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 62d81435347a..d476aad3ff57 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -437,6 +437,11 @@ static inline int mem_cgroup_cache_charge_swapin(struct page *page, | |||
437 | return 0; | 437 | return 0; |
438 | } | 438 | } |
439 | 439 | ||
440 | static inline void | ||
441 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | ||
442 | { | ||
443 | } | ||
444 | |||
440 | #endif /* CONFIG_SWAP */ | 445 | #endif /* CONFIG_SWAP */ |
441 | #endif /* __KERNEL__*/ | 446 | #endif /* __KERNEL__*/ |
442 | #endif /* _LINUX_SWAP_H */ | 447 | #endif /* _LINUX_SWAP_H */ |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index ac9ff54f7cb3..cb1a6631b8f4 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
@@ -29,7 +29,8 @@ extern void *swiotlb_alloc(unsigned order, unsigned long nslabs); | |||
29 | 29 | ||
30 | extern dma_addr_t swiotlb_phys_to_bus(struct device *hwdev, | 30 | extern dma_addr_t swiotlb_phys_to_bus(struct device *hwdev, |
31 | phys_addr_t address); | 31 | phys_addr_t address); |
32 | extern phys_addr_t swiotlb_bus_to_phys(dma_addr_t address); | 32 | extern phys_addr_t swiotlb_bus_to_phys(struct device *hwdev, |
33 | dma_addr_t address); | ||
33 | 34 | ||
34 | extern int swiotlb_arch_range_needs_mapping(phys_addr_t paddr, size_t size); | 35 | extern int swiotlb_arch_range_needs_mapping(phys_addr_t paddr, size_t size); |
35 | 36 | ||
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index e6b820f8b56b..a8cc4e13434c 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h | |||
@@ -21,13 +21,14 @@ struct restart_block { | |||
21 | struct { | 21 | struct { |
22 | unsigned long arg0, arg1, arg2, arg3; | 22 | unsigned long arg0, arg1, arg2, arg3; |
23 | }; | 23 | }; |
24 | /* For futex_wait */ | 24 | /* For futex_wait and futex_wait_requeue_pi */ |
25 | struct { | 25 | struct { |
26 | u32 *uaddr; | 26 | u32 *uaddr; |
27 | u32 val; | 27 | u32 val; |
28 | u32 flags; | 28 | u32 flags; |
29 | u32 bitset; | 29 | u32 bitset; |
30 | u64 time; | 30 | u64 time; |
31 | u32 *uaddr2; | ||
31 | } futex; | 32 | } futex; |
32 | /* For nanosleep */ | 33 | /* For nanosleep */ |
33 | struct { | 34 | struct { |
diff --git a/include/linux/time.h b/include/linux/time.h index 242f62499bb7..ea16c1a01d51 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -113,6 +113,21 @@ struct timespec current_kernel_time(void); | |||
113 | #define CURRENT_TIME (current_kernel_time()) | 113 | #define CURRENT_TIME (current_kernel_time()) |
114 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) | 114 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) |
115 | 115 | ||
116 | /* Some architectures do not supply their own clocksource. | ||
117 | * This is mainly the case in architectures that get their | ||
118 | * inter-tick times by reading the counter on their interval | ||
119 | * timer. Since these timers wrap every tick, they're not really | ||
120 | * useful as clocksources. Wrapping them to act like one is possible | ||
121 | * but not very efficient. So we provide a callout these arches | ||
122 | * can implement for use with the jiffies clocksource to provide | ||
123 | * finer then tick granular time. | ||
124 | */ | ||
125 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET | ||
126 | extern u32 arch_gettimeoffset(void); | ||
127 | #else | ||
128 | static inline u32 arch_gettimeoffset(void) { return 0; } | ||
129 | #endif | ||
130 | |||
116 | extern void do_gettimeofday(struct timeval *tv); | 131 | extern void do_gettimeofday(struct timeval *tv); |
117 | extern int do_settimeofday(struct timespec *tv); | 132 | extern int do_settimeofday(struct timespec *tv); |
118 | extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); | 133 | extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); |
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h new file mode 100644 index 000000000000..c68bccba2074 --- /dev/null +++ b/include/linux/trace_seq.h | |||
@@ -0,0 +1,92 @@ | |||
1 | #ifndef _LINUX_TRACE_SEQ_H | ||
2 | #define _LINUX_TRACE_SEQ_H | ||
3 | |||
4 | #include <linux/fs.h> | ||
5 | |||
6 | /* | ||
7 | * Trace sequences are used to allow a function to call several other functions | ||
8 | * to create a string of data to use (up to a max of PAGE_SIZE. | ||
9 | */ | ||
10 | |||
11 | struct trace_seq { | ||
12 | unsigned char buffer[PAGE_SIZE]; | ||
13 | unsigned int len; | ||
14 | unsigned int readpos; | ||
15 | }; | ||
16 | |||
17 | static inline void | ||
18 | trace_seq_init(struct trace_seq *s) | ||
19 | { | ||
20 | s->len = 0; | ||
21 | s->readpos = 0; | ||
22 | } | ||
23 | |||
24 | /* | ||
25 | * Currently only defined when tracing is enabled. | ||
26 | */ | ||
27 | #ifdef CONFIG_TRACING | ||
28 | extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...) | ||
29 | __attribute__ ((format (printf, 2, 3))); | ||
30 | extern int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args) | ||
31 | __attribute__ ((format (printf, 2, 0))); | ||
32 | extern int | ||
33 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); | ||
34 | extern void trace_print_seq(struct seq_file *m, struct trace_seq *s); | ||
35 | extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | ||
36 | size_t cnt); | ||
37 | extern int trace_seq_puts(struct trace_seq *s, const char *str); | ||
38 | extern int trace_seq_putc(struct trace_seq *s, unsigned char c); | ||
39 | extern int trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len); | ||
40 | extern int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, | ||
41 | size_t len); | ||
42 | extern void *trace_seq_reserve(struct trace_seq *s, size_t len); | ||
43 | extern int trace_seq_path(struct trace_seq *s, struct path *path); | ||
44 | |||
45 | #else /* CONFIG_TRACING */ | ||
46 | static inline int trace_seq_printf(struct trace_seq *s, const char *fmt, ...) | ||
47 | { | ||
48 | return 0; | ||
49 | } | ||
50 | static inline int | ||
51 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary) | ||
52 | { | ||
53 | return 0; | ||
54 | } | ||
55 | |||
56 | static inline void trace_print_seq(struct seq_file *m, struct trace_seq *s) | ||
57 | { | ||
58 | } | ||
59 | static inline ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | ||
60 | size_t cnt) | ||
61 | { | ||
62 | return 0; | ||
63 | } | ||
64 | static inline int trace_seq_puts(struct trace_seq *s, const char *str) | ||
65 | { | ||
66 | return 0; | ||
67 | } | ||
68 | static inline int trace_seq_putc(struct trace_seq *s, unsigned char c) | ||
69 | { | ||
70 | return 0; | ||
71 | } | ||
72 | static inline int | ||
73 | trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len) | ||
74 | { | ||
75 | return 0; | ||
76 | } | ||
77 | static inline int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, | ||
78 | size_t len) | ||
79 | { | ||
80 | return 0; | ||
81 | } | ||
82 | static inline void *trace_seq_reserve(struct trace_seq *s, size_t len) | ||
83 | { | ||
84 | return NULL; | ||
85 | } | ||
86 | static inline int trace_seq_path(struct trace_seq *s, struct path *path) | ||
87 | { | ||
88 | return 0; | ||
89 | } | ||
90 | #endif /* CONFIG_TRACING */ | ||
91 | |||
92 | #endif /* _LINUX_TRACE_SEQ_H */ | ||
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index c7aa154f4bfc..eb96603d92db 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -259,14 +259,12 @@ static inline void tracehook_finish_clone(struct task_struct *child, | |||
259 | 259 | ||
260 | /** | 260 | /** |
261 | * tracehook_report_clone - in parent, new child is about to start running | 261 | * tracehook_report_clone - in parent, new child is about to start running |
262 | * @trace: return value from tracehook_prepare_clone() | ||
263 | * @regs: parent's user register state | 262 | * @regs: parent's user register state |
264 | * @clone_flags: flags from parent's system call | 263 | * @clone_flags: flags from parent's system call |
265 | * @pid: new child's PID in the parent's namespace | 264 | * @pid: new child's PID in the parent's namespace |
266 | * @child: new child task | 265 | * @child: new child task |
267 | * | 266 | * |
268 | * Called after a child is set up, but before it has been started | 267 | * Called after a child is set up, but before it has been started running. |
269 | * running. @trace is the value returned by tracehook_prepare_clone(). | ||
270 | * This is not a good place to block, because the child has not started | 268 | * This is not a good place to block, because the child has not started |
271 | * yet. Suspend the child here if desired, and then block in | 269 | * yet. Suspend the child here if desired, and then block in |
272 | * tracehook_report_clone_complete(). This must prevent the child from | 270 | * tracehook_report_clone_complete(). This must prevent the child from |
@@ -276,13 +274,14 @@ static inline void tracehook_finish_clone(struct task_struct *child, | |||
276 | * | 274 | * |
277 | * Called with no locks held, but the child cannot run until this returns. | 275 | * Called with no locks held, but the child cannot run until this returns. |
278 | */ | 276 | */ |
279 | static inline void tracehook_report_clone(int trace, struct pt_regs *regs, | 277 | static inline void tracehook_report_clone(struct pt_regs *regs, |
280 | unsigned long clone_flags, | 278 | unsigned long clone_flags, |
281 | pid_t pid, struct task_struct *child) | 279 | pid_t pid, struct task_struct *child) |
282 | { | 280 | { |
283 | if (unlikely(trace) || unlikely(clone_flags & CLONE_PTRACE)) { | 281 | if (unlikely(task_ptrace(child))) { |
284 | /* | 282 | /* |
285 | * The child starts up with an immediate SIGSTOP. | 283 | * It doesn't matter who attached/attaching to this |
284 | * task, the pending SIGSTOP is right in any case. | ||
286 | */ | 285 | */ |
287 | sigaddset(&child->pending.signal, SIGSTOP); | 286 | sigaddset(&child->pending.signal, SIGSTOP); |
288 | set_tsk_thread_flag(child, TIF_SIGPENDING); | 287 | set_tsk_thread_flag(child, TIF_SIGPENDING); |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index d35a7ee7611f..14df7e635d43 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -31,6 +31,8 @@ struct tracepoint { | |||
31 | * Keep in sync with vmlinux.lds.h. | 31 | * Keep in sync with vmlinux.lds.h. |
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef DECLARE_TRACE | ||
35 | |||
34 | #define TP_PROTO(args...) args | 36 | #define TP_PROTO(args...) args |
35 | #define TP_ARGS(args...) args | 37 | #define TP_ARGS(args...) args |
36 | 38 | ||
@@ -114,6 +116,7 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
114 | struct tracepoint *end) | 116 | struct tracepoint *end) |
115 | { } | 117 | { } |
116 | #endif /* CONFIG_TRACEPOINTS */ | 118 | #endif /* CONFIG_TRACEPOINTS */ |
119 | #endif /* DECLARE_TRACE */ | ||
117 | 120 | ||
118 | /* | 121 | /* |
119 | * Connect a probe to a tracepoint. | 122 | * Connect a probe to a tracepoint. |
@@ -154,10 +157,8 @@ static inline void tracepoint_synchronize_unregister(void) | |||
154 | } | 157 | } |
155 | 158 | ||
156 | #define PARAMS(args...) args | 159 | #define PARAMS(args...) args |
157 | #define TRACE_FORMAT(name, proto, args, fmt) \ | ||
158 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | ||
159 | |||
160 | 160 | ||
161 | #ifndef TRACE_EVENT | ||
161 | /* | 162 | /* |
162 | * For use with the TRACE_EVENT macro: | 163 | * For use with the TRACE_EVENT macro: |
163 | * | 164 | * |
@@ -262,5 +263,6 @@ static inline void tracepoint_synchronize_unregister(void) | |||
262 | 263 | ||
263 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ | 264 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ |
264 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 265 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
266 | #endif | ||
265 | 267 | ||
266 | #endif | 268 | #endif |
diff --git a/include/linux/tty.h b/include/linux/tty.h index fc39db95499f..1488d8c81aac 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -185,7 +185,7 @@ struct tty_port; | |||
185 | struct tty_port_operations { | 185 | struct tty_port_operations { |
186 | /* Return 1 if the carrier is raised */ | 186 | /* Return 1 if the carrier is raised */ |
187 | int (*carrier_raised)(struct tty_port *port); | 187 | int (*carrier_raised)(struct tty_port *port); |
188 | void (*raise_dtr_rts)(struct tty_port *port); | 188 | void (*dtr_rts)(struct tty_port *port, int raise); |
189 | }; | 189 | }; |
190 | 190 | ||
191 | struct tty_port { | 191 | struct tty_port { |
@@ -201,6 +201,9 @@ struct tty_port { | |||
201 | unsigned char *xmit_buf; /* Optional buffer */ | 201 | unsigned char *xmit_buf; /* Optional buffer */ |
202 | int close_delay; /* Close port delay */ | 202 | int close_delay; /* Close port delay */ |
203 | int closing_wait; /* Delay for output */ | 203 | int closing_wait; /* Delay for output */ |
204 | int drain_delay; /* Set to zero if no pure time | ||
205 | based drain is needed else | ||
206 | set to size of fifo */ | ||
204 | }; | 207 | }; |
205 | 208 | ||
206 | /* | 209 | /* |
@@ -223,8 +226,11 @@ struct tty_struct { | |||
223 | struct tty_driver *driver; | 226 | struct tty_driver *driver; |
224 | const struct tty_operations *ops; | 227 | const struct tty_operations *ops; |
225 | int index; | 228 | int index; |
226 | /* The ldisc objects are protected by tty_ldisc_lock at the moment */ | 229 | |
227 | struct tty_ldisc ldisc; | 230 | /* Protects ldisc changes: Lock tty not pty */ |
231 | struct mutex ldisc_mutex; | ||
232 | struct tty_ldisc *ldisc; | ||
233 | |||
228 | struct mutex termios_mutex; | 234 | struct mutex termios_mutex; |
229 | spinlock_t ctrl_lock; | 235 | spinlock_t ctrl_lock; |
230 | /* Termios values are protected by the termios mutex */ | 236 | /* Termios values are protected by the termios mutex */ |
@@ -311,6 +317,7 @@ struct tty_struct { | |||
311 | #define TTY_CLOSING 7 /* ->close() in progress */ | 317 | #define TTY_CLOSING 7 /* ->close() in progress */ |
312 | #define TTY_LDISC 9 /* Line discipline attached */ | 318 | #define TTY_LDISC 9 /* Line discipline attached */ |
313 | #define TTY_LDISC_CHANGING 10 /* Line discipline changing */ | 319 | #define TTY_LDISC_CHANGING 10 /* Line discipline changing */ |
320 | #define TTY_LDISC_OPEN 11 /* Line discipline is open */ | ||
314 | #define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ | 321 | #define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ |
315 | #define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ | 322 | #define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ |
316 | #define TTY_PTY_LOCK 16 /* pty private */ | 323 | #define TTY_PTY_LOCK 16 /* pty private */ |
@@ -403,6 +410,7 @@ extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); | |||
403 | extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); | 410 | extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); |
404 | extern void tty_ldisc_deref(struct tty_ldisc *); | 411 | extern void tty_ldisc_deref(struct tty_ldisc *); |
405 | extern struct tty_ldisc *tty_ldisc_ref_wait(struct tty_struct *); | 412 | extern struct tty_ldisc *tty_ldisc_ref_wait(struct tty_struct *); |
413 | extern void tty_ldisc_hangup(struct tty_struct *tty); | ||
406 | extern const struct file_operations tty_ldiscs_proc_fops; | 414 | extern const struct file_operations tty_ldiscs_proc_fops; |
407 | 415 | ||
408 | extern void tty_wakeup(struct tty_struct *tty); | 416 | extern void tty_wakeup(struct tty_struct *tty); |
@@ -425,6 +433,9 @@ extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx, | |||
425 | extern void tty_release_dev(struct file *filp); | 433 | extern void tty_release_dev(struct file *filp); |
426 | extern int tty_init_termios(struct tty_struct *tty); | 434 | extern int tty_init_termios(struct tty_struct *tty); |
427 | 435 | ||
436 | extern struct tty_struct *tty_pair_get_tty(struct tty_struct *tty); | ||
437 | extern struct tty_struct *tty_pair_get_pty(struct tty_struct *tty); | ||
438 | |||
428 | extern struct mutex tty_mutex; | 439 | extern struct mutex tty_mutex; |
429 | 440 | ||
430 | extern void tty_write_unlock(struct tty_struct *tty); | 441 | extern void tty_write_unlock(struct tty_struct *tty); |
@@ -438,6 +449,7 @@ extern struct tty_struct *tty_port_tty_get(struct tty_port *port); | |||
438 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); | 449 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); |
439 | extern int tty_port_carrier_raised(struct tty_port *port); | 450 | extern int tty_port_carrier_raised(struct tty_port *port); |
440 | extern void tty_port_raise_dtr_rts(struct tty_port *port); | 451 | extern void tty_port_raise_dtr_rts(struct tty_port *port); |
452 | extern void tty_port_lower_dtr_rts(struct tty_port *port); | ||
441 | extern void tty_port_hangup(struct tty_port *port); | 453 | extern void tty_port_hangup(struct tty_port *port); |
442 | extern int tty_port_block_til_ready(struct tty_port *port, | 454 | extern int tty_port_block_til_ready(struct tty_port *port, |
443 | struct tty_struct *tty, struct file *filp); | 455 | struct tty_struct *tty, struct file *filp); |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index bcba84ea2d86..3566129384a4 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -127,7 +127,8 @@ | |||
127 | * the line discipline are close to full, and it should somehow | 127 | * the line discipline are close to full, and it should somehow |
128 | * signal that no more characters should be sent to the tty. | 128 | * signal that no more characters should be sent to the tty. |
129 | * | 129 | * |
130 | * Optional: Always invoke via tty_throttle(); | 130 | * Optional: Always invoke via tty_throttle(), called under the |
131 | * termios lock. | ||
131 | * | 132 | * |
132 | * void (*unthrottle)(struct tty_struct * tty); | 133 | * void (*unthrottle)(struct tty_struct * tty); |
133 | * | 134 | * |
@@ -135,7 +136,8 @@ | |||
135 | * that characters can now be sent to the tty without fear of | 136 | * that characters can now be sent to the tty without fear of |
136 | * overrunning the input buffers of the line disciplines. | 137 | * overrunning the input buffers of the line disciplines. |
137 | * | 138 | * |
138 | * Optional: Always invoke via tty_unthrottle(); | 139 | * Optional: Always invoke via tty_unthrottle(), called under the |
140 | * termios lock. | ||
139 | * | 141 | * |
140 | * void (*stop)(struct tty_struct *tty); | 142 | * void (*stop)(struct tty_struct *tty); |
141 | * | 143 | * |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 625e9e4639c6..8cdfed738fe4 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -224,8 +224,7 @@ struct usb_serial_driver { | |||
224 | /* Called by console with tty = NULL and by tty */ | 224 | /* Called by console with tty = NULL and by tty */ |
225 | int (*open)(struct tty_struct *tty, | 225 | int (*open)(struct tty_struct *tty, |
226 | struct usb_serial_port *port, struct file *filp); | 226 | struct usb_serial_port *port, struct file *filp); |
227 | void (*close)(struct tty_struct *tty, | 227 | void (*close)(struct usb_serial_port *port); |
228 | struct usb_serial_port *port, struct file *filp); | ||
229 | int (*write)(struct tty_struct *tty, struct usb_serial_port *port, | 228 | int (*write)(struct tty_struct *tty, struct usb_serial_port *port, |
230 | const unsigned char *buf, int count); | 229 | const unsigned char *buf, int count); |
231 | /* Called only by the tty layer */ | 230 | /* Called only by the tty layer */ |
@@ -241,6 +240,10 @@ struct usb_serial_driver { | |||
241 | int (*tiocmget)(struct tty_struct *tty, struct file *file); | 240 | int (*tiocmget)(struct tty_struct *tty, struct file *file); |
242 | int (*tiocmset)(struct tty_struct *tty, struct file *file, | 241 | int (*tiocmset)(struct tty_struct *tty, struct file *file, |
243 | unsigned int set, unsigned int clear); | 242 | unsigned int set, unsigned int clear); |
243 | /* Called by the tty layer for port level work. There may or may not | ||
244 | be an attached tty at this point */ | ||
245 | void (*dtr_rts)(struct usb_serial_port *port, int on); | ||
246 | int (*carrier_raised)(struct usb_serial_port *port); | ||
244 | /* USB events */ | 247 | /* USB events */ |
245 | void (*read_int_callback)(struct urb *urb); | 248 | void (*read_int_callback)(struct urb *urb); |
246 | void (*write_int_callback)(struct urb *urb); | 249 | void (*write_int_callback)(struct urb *urb); |
@@ -283,8 +286,7 @@ extern int usb_serial_generic_open(struct tty_struct *tty, | |||
283 | struct usb_serial_port *port, struct file *filp); | 286 | struct usb_serial_port *port, struct file *filp); |
284 | extern int usb_serial_generic_write(struct tty_struct *tty, | 287 | extern int usb_serial_generic_write(struct tty_struct *tty, |
285 | struct usb_serial_port *port, const unsigned char *buf, int count); | 288 | struct usb_serial_port *port, const unsigned char *buf, int count); |
286 | extern void usb_serial_generic_close(struct tty_struct *tty, | 289 | extern void usb_serial_generic_close(struct usb_serial_port *port); |
287 | struct usb_serial_port *port, struct file *filp); | ||
288 | extern int usb_serial_generic_resume(struct usb_serial *serial); | 290 | extern int usb_serial_generic_resume(struct usb_serial *serial); |
289 | extern int usb_serial_generic_write_room(struct tty_struct *tty); | 291 | extern int usb_serial_generic_write_room(struct tty_struct *tty); |
290 | extern int usb_serial_generic_chars_in_buffer(struct tty_struct *tty); | 292 | extern int usb_serial_generic_chars_in_buffer(struct tty_struct *tty); |
diff --git a/include/linux/wait.h b/include/linux/wait.h index bc024632f365..6788e1a4d4ca 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -132,8 +132,6 @@ static inline void __remove_wait_queue(wait_queue_head_t *head, | |||
132 | list_del(&old->task_list); | 132 | list_del(&old->task_list); |
133 | } | 133 | } |
134 | 134 | ||
135 | void __wake_up_common(wait_queue_head_t *q, unsigned int mode, | ||
136 | int nr_exclusive, int sync, void *key); | ||
137 | void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); | 135 | void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); |
138 | void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key); | 136 | void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key); |
139 | void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, | 137 | void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, |
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index c9184f756cad..68a8d873bbd9 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
@@ -680,7 +680,7 @@ fc_remote_port_chkready(struct fc_rport *rport) | |||
680 | if (rport->roles & FC_PORT_ROLE_FCP_TARGET) | 680 | if (rport->roles & FC_PORT_ROLE_FCP_TARGET) |
681 | result = 0; | 681 | result = 0; |
682 | else if (rport->flags & FC_RPORT_DEVLOSS_PENDING) | 682 | else if (rport->flags & FC_RPORT_DEVLOSS_PENDING) |
683 | result = DID_TRANSPORT_DISRUPTED << 16; | 683 | result = DID_IMM_RETRY << 16; |
684 | else | 684 | else |
685 | result = DID_NO_CONNECT << 16; | 685 | result = DID_NO_CONNECT << 16; |
686 | break; | 686 | break; |
@@ -688,7 +688,7 @@ fc_remote_port_chkready(struct fc_rport *rport) | |||
688 | if (rport->flags & FC_RPORT_FAST_FAIL_TIMEDOUT) | 688 | if (rport->flags & FC_RPORT_FAST_FAIL_TIMEDOUT) |
689 | result = DID_TRANSPORT_FAILFAST << 16; | 689 | result = DID_TRANSPORT_FAILFAST << 16; |
690 | else | 690 | else |
691 | result = DID_TRANSPORT_DISRUPTED << 16; | 691 | result = DID_IMM_RETRY << 16; |
692 | break; | 692 | break; |
693 | default: | 693 | default: |
694 | result = DID_NO_CONNECT << 16; | 694 | result = DID_NO_CONNECT << 16; |
diff --git a/include/trace/block.h b/include/trace/block.h deleted file mode 100644 index 25b7068b819e..000000000000 --- a/include/trace/block.h +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | #ifndef _TRACE_BLOCK_H | ||
2 | #define _TRACE_BLOCK_H | ||
3 | |||
4 | #include <linux/blkdev.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | DECLARE_TRACE(block_rq_abort, | ||
8 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
9 | TP_ARGS(q, rq)); | ||
10 | |||
11 | DECLARE_TRACE(block_rq_insert, | ||
12 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
13 | TP_ARGS(q, rq)); | ||
14 | |||
15 | DECLARE_TRACE(block_rq_issue, | ||
16 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
17 | TP_ARGS(q, rq)); | ||
18 | |||
19 | DECLARE_TRACE(block_rq_requeue, | ||
20 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
21 | TP_ARGS(q, rq)); | ||
22 | |||
23 | DECLARE_TRACE(block_rq_complete, | ||
24 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
25 | TP_ARGS(q, rq)); | ||
26 | |||
27 | DECLARE_TRACE(block_bio_bounce, | ||
28 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
29 | TP_ARGS(q, bio)); | ||
30 | |||
31 | DECLARE_TRACE(block_bio_complete, | ||
32 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
33 | TP_ARGS(q, bio)); | ||
34 | |||
35 | DECLARE_TRACE(block_bio_backmerge, | ||
36 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
37 | TP_ARGS(q, bio)); | ||
38 | |||
39 | DECLARE_TRACE(block_bio_frontmerge, | ||
40 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
41 | TP_ARGS(q, bio)); | ||
42 | |||
43 | DECLARE_TRACE(block_bio_queue, | ||
44 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
45 | TP_ARGS(q, bio)); | ||
46 | |||
47 | DECLARE_TRACE(block_getrq, | ||
48 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), | ||
49 | TP_ARGS(q, bio, rw)); | ||
50 | |||
51 | DECLARE_TRACE(block_sleeprq, | ||
52 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), | ||
53 | TP_ARGS(q, bio, rw)); | ||
54 | |||
55 | DECLARE_TRACE(block_plug, | ||
56 | TP_PROTO(struct request_queue *q), | ||
57 | TP_ARGS(q)); | ||
58 | |||
59 | DECLARE_TRACE(block_unplug_timer, | ||
60 | TP_PROTO(struct request_queue *q), | ||
61 | TP_ARGS(q)); | ||
62 | |||
63 | DECLARE_TRACE(block_unplug_io, | ||
64 | TP_PROTO(struct request_queue *q), | ||
65 | TP_ARGS(q)); | ||
66 | |||
67 | DECLARE_TRACE(block_split, | ||
68 | TP_PROTO(struct request_queue *q, struct bio *bio, unsigned int pdu), | ||
69 | TP_ARGS(q, bio, pdu)); | ||
70 | |||
71 | DECLARE_TRACE(block_remap, | ||
72 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, | ||
73 | sector_t from, sector_t to), | ||
74 | TP_ARGS(q, bio, dev, from, to)); | ||
75 | |||
76 | #endif | ||
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h new file mode 100644 index 000000000000..f7a7ae1e8f90 --- /dev/null +++ b/include/trace/define_trace.h | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * Trace files that want to automate creationg of all tracepoints defined | ||
3 | * in their file should include this file. The following are macros that the | ||
4 | * trace file may define: | ||
5 | * | ||
6 | * TRACE_SYSTEM defines the system the tracepoint is for | ||
7 | * | ||
8 | * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h | ||
9 | * This macro may be defined to tell define_trace.h what file to include. | ||
10 | * Note, leave off the ".h". | ||
11 | * | ||
12 | * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace | ||
13 | * then this macro can define the path to use. Note, the path is relative to | ||
14 | * define_trace.h, not the file including it. Full path names for out of tree | ||
15 | * modules must be used. | ||
16 | */ | ||
17 | |||
18 | #ifdef CREATE_TRACE_POINTS | ||
19 | |||
20 | /* Prevent recursion */ | ||
21 | #undef CREATE_TRACE_POINTS | ||
22 | |||
23 | #include <linux/stringify.h> | ||
24 | |||
25 | #undef TRACE_EVENT | ||
26 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ | ||
27 | DEFINE_TRACE(name) | ||
28 | |||
29 | #undef DECLARE_TRACE | ||
30 | #define DECLARE_TRACE(name, proto, args) \ | ||
31 | DEFINE_TRACE(name) | ||
32 | |||
33 | #undef TRACE_INCLUDE | ||
34 | #undef __TRACE_INCLUDE | ||
35 | |||
36 | #ifndef TRACE_INCLUDE_FILE | ||
37 | # define TRACE_INCLUDE_FILE TRACE_SYSTEM | ||
38 | # define UNDEF_TRACE_INCLUDE_FILE | ||
39 | #endif | ||
40 | |||
41 | #ifndef TRACE_INCLUDE_PATH | ||
42 | # define __TRACE_INCLUDE(system) <trace/events/system.h> | ||
43 | # define UNDEF_TRACE_INCLUDE_PATH | ||
44 | #else | ||
45 | # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h) | ||
46 | #endif | ||
47 | |||
48 | # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system) | ||
49 | |||
50 | /* Let the trace headers be reread */ | ||
51 | #define TRACE_HEADER_MULTI_READ | ||
52 | |||
53 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
54 | |||
55 | #ifdef CONFIG_EVENT_TRACING | ||
56 | #include <trace/ftrace.h> | ||
57 | #endif | ||
58 | |||
59 | #undef TRACE_HEADER_MULTI_READ | ||
60 | |||
61 | /* Only undef what we defined in this file */ | ||
62 | #ifdef UNDEF_TRACE_INCLUDE_FILE | ||
63 | # undef TRACE_INCLUDE_FILE | ||
64 | # undef UNDEF_TRACE_INCLUDE_FILE | ||
65 | #endif | ||
66 | |||
67 | #ifdef UNDEF_TRACE_INCLUDE_PATH | ||
68 | # undef TRACE_INCLUDE_PATH | ||
69 | # undef UNDEF_TRACE_INCLUDE_PATH | ||
70 | #endif | ||
71 | |||
72 | /* We may be processing more files */ | ||
73 | #define CREATE_TRACE_POINTS | ||
74 | |||
75 | #endif /* CREATE_TRACE_POINTS */ | ||
diff --git a/include/trace/events/block.h b/include/trace/events/block.h new file mode 100644 index 000000000000..d6b05f42dd44 --- /dev/null +++ b/include/trace/events/block.h | |||
@@ -0,0 +1,493 @@ | |||
1 | #if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_BLOCK_H | ||
3 | |||
4 | #include <linux/blktrace_api.h> | ||
5 | #include <linux/blkdev.h> | ||
6 | #include <linux/tracepoint.h> | ||
7 | |||
8 | #undef TRACE_SYSTEM | ||
9 | #define TRACE_SYSTEM block | ||
10 | |||
11 | TRACE_EVENT(block_rq_abort, | ||
12 | |||
13 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
14 | |||
15 | TP_ARGS(q, rq), | ||
16 | |||
17 | TP_STRUCT__entry( | ||
18 | __field( dev_t, dev ) | ||
19 | __field( sector_t, sector ) | ||
20 | __field( unsigned int, nr_sector ) | ||
21 | __field( int, errors ) | ||
22 | __array( char, rwbs, 6 ) | ||
23 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | ||
24 | ), | ||
25 | |||
26 | TP_fast_assign( | ||
27 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | ||
28 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | ||
29 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | ||
30 | __entry->errors = rq->errors; | ||
31 | |||
32 | blk_fill_rwbs_rq(__entry->rwbs, rq); | ||
33 | blk_dump_cmd(__get_str(cmd), rq); | ||
34 | ), | ||
35 | |||
36 | TP_printk("%d,%d %s (%s) %llu + %u [%d]", | ||
37 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
38 | __entry->rwbs, __get_str(cmd), | ||
39 | (unsigned long long)__entry->sector, | ||
40 | __entry->nr_sector, __entry->errors) | ||
41 | ); | ||
42 | |||
43 | TRACE_EVENT(block_rq_insert, | ||
44 | |||
45 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
46 | |||
47 | TP_ARGS(q, rq), | ||
48 | |||
49 | TP_STRUCT__entry( | ||
50 | __field( dev_t, dev ) | ||
51 | __field( sector_t, sector ) | ||
52 | __field( unsigned int, nr_sector ) | ||
53 | __field( unsigned int, bytes ) | ||
54 | __array( char, rwbs, 6 ) | ||
55 | __array( char, comm, TASK_COMM_LEN ) | ||
56 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | ||
57 | ), | ||
58 | |||
59 | TP_fast_assign( | ||
60 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | ||
61 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | ||
62 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | ||
63 | __entry->bytes = blk_pc_request(rq) ? blk_rq_bytes(rq) : 0; | ||
64 | |||
65 | blk_fill_rwbs_rq(__entry->rwbs, rq); | ||
66 | blk_dump_cmd(__get_str(cmd), rq); | ||
67 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
68 | ), | ||
69 | |||
70 | TP_printk("%d,%d %s %u (%s) %llu + %u [%s]", | ||
71 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
72 | __entry->rwbs, __entry->bytes, __get_str(cmd), | ||
73 | (unsigned long long)__entry->sector, | ||
74 | __entry->nr_sector, __entry->comm) | ||
75 | ); | ||
76 | |||
77 | TRACE_EVENT(block_rq_issue, | ||
78 | |||
79 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
80 | |||
81 | TP_ARGS(q, rq), | ||
82 | |||
83 | TP_STRUCT__entry( | ||
84 | __field( dev_t, dev ) | ||
85 | __field( sector_t, sector ) | ||
86 | __field( unsigned int, nr_sector ) | ||
87 | __field( unsigned int, bytes ) | ||
88 | __array( char, rwbs, 6 ) | ||
89 | __array( char, comm, TASK_COMM_LEN ) | ||
90 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | ||
91 | ), | ||
92 | |||
93 | TP_fast_assign( | ||
94 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | ||
95 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | ||
96 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | ||
97 | __entry->bytes = blk_pc_request(rq) ? blk_rq_bytes(rq) : 0; | ||
98 | |||
99 | blk_fill_rwbs_rq(__entry->rwbs, rq); | ||
100 | blk_dump_cmd(__get_str(cmd), rq); | ||
101 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
102 | ), | ||
103 | |||
104 | TP_printk("%d,%d %s %u (%s) %llu + %u [%s]", | ||
105 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
106 | __entry->rwbs, __entry->bytes, __get_str(cmd), | ||
107 | (unsigned long long)__entry->sector, | ||
108 | __entry->nr_sector, __entry->comm) | ||
109 | ); | ||
110 | |||
111 | TRACE_EVENT(block_rq_requeue, | ||
112 | |||
113 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
114 | |||
115 | TP_ARGS(q, rq), | ||
116 | |||
117 | TP_STRUCT__entry( | ||
118 | __field( dev_t, dev ) | ||
119 | __field( sector_t, sector ) | ||
120 | __field( unsigned int, nr_sector ) | ||
121 | __field( int, errors ) | ||
122 | __array( char, rwbs, 6 ) | ||
123 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | ||
124 | ), | ||
125 | |||
126 | TP_fast_assign( | ||
127 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | ||
128 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | ||
129 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | ||
130 | __entry->errors = rq->errors; | ||
131 | |||
132 | blk_fill_rwbs_rq(__entry->rwbs, rq); | ||
133 | blk_dump_cmd(__get_str(cmd), rq); | ||
134 | ), | ||
135 | |||
136 | TP_printk("%d,%d %s (%s) %llu + %u [%d]", | ||
137 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
138 | __entry->rwbs, __get_str(cmd), | ||
139 | (unsigned long long)__entry->sector, | ||
140 | __entry->nr_sector, __entry->errors) | ||
141 | ); | ||
142 | |||
143 | TRACE_EVENT(block_rq_complete, | ||
144 | |||
145 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
146 | |||
147 | TP_ARGS(q, rq), | ||
148 | |||
149 | TP_STRUCT__entry( | ||
150 | __field( dev_t, dev ) | ||
151 | __field( sector_t, sector ) | ||
152 | __field( unsigned int, nr_sector ) | ||
153 | __field( int, errors ) | ||
154 | __array( char, rwbs, 6 ) | ||
155 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | ||
156 | ), | ||
157 | |||
158 | TP_fast_assign( | ||
159 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | ||
160 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | ||
161 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | ||
162 | __entry->errors = rq->errors; | ||
163 | |||
164 | blk_fill_rwbs_rq(__entry->rwbs, rq); | ||
165 | blk_dump_cmd(__get_str(cmd), rq); | ||
166 | ), | ||
167 | |||
168 | TP_printk("%d,%d %s (%s) %llu + %u [%d]", | ||
169 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
170 | __entry->rwbs, __get_str(cmd), | ||
171 | (unsigned long long)__entry->sector, | ||
172 | __entry->nr_sector, __entry->errors) | ||
173 | ); | ||
174 | TRACE_EVENT(block_bio_bounce, | ||
175 | |||
176 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
177 | |||
178 | TP_ARGS(q, bio), | ||
179 | |||
180 | TP_STRUCT__entry( | ||
181 | __field( dev_t, dev ) | ||
182 | __field( sector_t, sector ) | ||
183 | __field( unsigned int, nr_sector ) | ||
184 | __array( char, rwbs, 6 ) | ||
185 | __array( char, comm, TASK_COMM_LEN ) | ||
186 | ), | ||
187 | |||
188 | TP_fast_assign( | ||
189 | __entry->dev = bio->bi_bdev->bd_dev; | ||
190 | __entry->sector = bio->bi_sector; | ||
191 | __entry->nr_sector = bio->bi_size >> 9; | ||
192 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
193 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
194 | ), | ||
195 | |||
196 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
197 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
198 | (unsigned long long)__entry->sector, | ||
199 | __entry->nr_sector, __entry->comm) | ||
200 | ); | ||
201 | |||
202 | TRACE_EVENT(block_bio_complete, | ||
203 | |||
204 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
205 | |||
206 | TP_ARGS(q, bio), | ||
207 | |||
208 | TP_STRUCT__entry( | ||
209 | __field( dev_t, dev ) | ||
210 | __field( sector_t, sector ) | ||
211 | __field( unsigned, nr_sector ) | ||
212 | __field( int, error ) | ||
213 | __array( char, rwbs, 6 ) | ||
214 | ), | ||
215 | |||
216 | TP_fast_assign( | ||
217 | __entry->dev = bio->bi_bdev->bd_dev; | ||
218 | __entry->sector = bio->bi_sector; | ||
219 | __entry->nr_sector = bio->bi_size >> 9; | ||
220 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
221 | ), | ||
222 | |||
223 | TP_printk("%d,%d %s %llu + %u [%d]", | ||
224 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
225 | (unsigned long long)__entry->sector, | ||
226 | __entry->nr_sector, __entry->error) | ||
227 | ); | ||
228 | |||
229 | TRACE_EVENT(block_bio_backmerge, | ||
230 | |||
231 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
232 | |||
233 | TP_ARGS(q, bio), | ||
234 | |||
235 | TP_STRUCT__entry( | ||
236 | __field( dev_t, dev ) | ||
237 | __field( sector_t, sector ) | ||
238 | __field( unsigned int, nr_sector ) | ||
239 | __array( char, rwbs, 6 ) | ||
240 | __array( char, comm, TASK_COMM_LEN ) | ||
241 | ), | ||
242 | |||
243 | TP_fast_assign( | ||
244 | __entry->dev = bio->bi_bdev->bd_dev; | ||
245 | __entry->sector = bio->bi_sector; | ||
246 | __entry->nr_sector = bio->bi_size >> 9; | ||
247 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
248 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
249 | ), | ||
250 | |||
251 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
252 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
253 | (unsigned long long)__entry->sector, | ||
254 | __entry->nr_sector, __entry->comm) | ||
255 | ); | ||
256 | |||
257 | TRACE_EVENT(block_bio_frontmerge, | ||
258 | |||
259 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
260 | |||
261 | TP_ARGS(q, bio), | ||
262 | |||
263 | TP_STRUCT__entry( | ||
264 | __field( dev_t, dev ) | ||
265 | __field( sector_t, sector ) | ||
266 | __field( unsigned, nr_sector ) | ||
267 | __array( char, rwbs, 6 ) | ||
268 | __array( char, comm, TASK_COMM_LEN ) | ||
269 | ), | ||
270 | |||
271 | TP_fast_assign( | ||
272 | __entry->dev = bio->bi_bdev->bd_dev; | ||
273 | __entry->sector = bio->bi_sector; | ||
274 | __entry->nr_sector = bio->bi_size >> 9; | ||
275 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
276 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
277 | ), | ||
278 | |||
279 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
280 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
281 | (unsigned long long)__entry->sector, | ||
282 | __entry->nr_sector, __entry->comm) | ||
283 | ); | ||
284 | |||
285 | TRACE_EVENT(block_bio_queue, | ||
286 | |||
287 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
288 | |||
289 | TP_ARGS(q, bio), | ||
290 | |||
291 | TP_STRUCT__entry( | ||
292 | __field( dev_t, dev ) | ||
293 | __field( sector_t, sector ) | ||
294 | __field( unsigned int, nr_sector ) | ||
295 | __array( char, rwbs, 6 ) | ||
296 | __array( char, comm, TASK_COMM_LEN ) | ||
297 | ), | ||
298 | |||
299 | TP_fast_assign( | ||
300 | __entry->dev = bio->bi_bdev->bd_dev; | ||
301 | __entry->sector = bio->bi_sector; | ||
302 | __entry->nr_sector = bio->bi_size >> 9; | ||
303 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
304 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
305 | ), | ||
306 | |||
307 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
308 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
309 | (unsigned long long)__entry->sector, | ||
310 | __entry->nr_sector, __entry->comm) | ||
311 | ); | ||
312 | |||
313 | TRACE_EVENT(block_getrq, | ||
314 | |||
315 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), | ||
316 | |||
317 | TP_ARGS(q, bio, rw), | ||
318 | |||
319 | TP_STRUCT__entry( | ||
320 | __field( dev_t, dev ) | ||
321 | __field( sector_t, sector ) | ||
322 | __field( unsigned int, nr_sector ) | ||
323 | __array( char, rwbs, 6 ) | ||
324 | __array( char, comm, TASK_COMM_LEN ) | ||
325 | ), | ||
326 | |||
327 | TP_fast_assign( | ||
328 | __entry->dev = bio ? bio->bi_bdev->bd_dev : 0; | ||
329 | __entry->sector = bio ? bio->bi_sector : 0; | ||
330 | __entry->nr_sector = bio ? bio->bi_size >> 9 : 0; | ||
331 | blk_fill_rwbs(__entry->rwbs, | ||
332 | bio ? bio->bi_rw : 0, __entry->nr_sector); | ||
333 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
334 | ), | ||
335 | |||
336 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
337 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
338 | (unsigned long long)__entry->sector, | ||
339 | __entry->nr_sector, __entry->comm) | ||
340 | ); | ||
341 | |||
342 | TRACE_EVENT(block_sleeprq, | ||
343 | |||
344 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), | ||
345 | |||
346 | TP_ARGS(q, bio, rw), | ||
347 | |||
348 | TP_STRUCT__entry( | ||
349 | __field( dev_t, dev ) | ||
350 | __field( sector_t, sector ) | ||
351 | __field( unsigned int, nr_sector ) | ||
352 | __array( char, rwbs, 6 ) | ||
353 | __array( char, comm, TASK_COMM_LEN ) | ||
354 | ), | ||
355 | |||
356 | TP_fast_assign( | ||
357 | __entry->dev = bio ? bio->bi_bdev->bd_dev : 0; | ||
358 | __entry->sector = bio ? bio->bi_sector : 0; | ||
359 | __entry->nr_sector = bio ? bio->bi_size >> 9 : 0; | ||
360 | blk_fill_rwbs(__entry->rwbs, | ||
361 | bio ? bio->bi_rw : 0, __entry->nr_sector); | ||
362 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
363 | ), | ||
364 | |||
365 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
366 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
367 | (unsigned long long)__entry->sector, | ||
368 | __entry->nr_sector, __entry->comm) | ||
369 | ); | ||
370 | |||
371 | TRACE_EVENT(block_plug, | ||
372 | |||
373 | TP_PROTO(struct request_queue *q), | ||
374 | |||
375 | TP_ARGS(q), | ||
376 | |||
377 | TP_STRUCT__entry( | ||
378 | __array( char, comm, TASK_COMM_LEN ) | ||
379 | ), | ||
380 | |||
381 | TP_fast_assign( | ||
382 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
383 | ), | ||
384 | |||
385 | TP_printk("[%s]", __entry->comm) | ||
386 | ); | ||
387 | |||
388 | TRACE_EVENT(block_unplug_timer, | ||
389 | |||
390 | TP_PROTO(struct request_queue *q), | ||
391 | |||
392 | TP_ARGS(q), | ||
393 | |||
394 | TP_STRUCT__entry( | ||
395 | __field( int, nr_rq ) | ||
396 | __array( char, comm, TASK_COMM_LEN ) | ||
397 | ), | ||
398 | |||
399 | TP_fast_assign( | ||
400 | __entry->nr_rq = q->rq.count[READ] + q->rq.count[WRITE]; | ||
401 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
402 | ), | ||
403 | |||
404 | TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) | ||
405 | ); | ||
406 | |||
407 | TRACE_EVENT(block_unplug_io, | ||
408 | |||
409 | TP_PROTO(struct request_queue *q), | ||
410 | |||
411 | TP_ARGS(q), | ||
412 | |||
413 | TP_STRUCT__entry( | ||
414 | __field( int, nr_rq ) | ||
415 | __array( char, comm, TASK_COMM_LEN ) | ||
416 | ), | ||
417 | |||
418 | TP_fast_assign( | ||
419 | __entry->nr_rq = q->rq.count[READ] + q->rq.count[WRITE]; | ||
420 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
421 | ), | ||
422 | |||
423 | TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) | ||
424 | ); | ||
425 | |||
426 | TRACE_EVENT(block_split, | ||
427 | |||
428 | TP_PROTO(struct request_queue *q, struct bio *bio, | ||
429 | unsigned int new_sector), | ||
430 | |||
431 | TP_ARGS(q, bio, new_sector), | ||
432 | |||
433 | TP_STRUCT__entry( | ||
434 | __field( dev_t, dev ) | ||
435 | __field( sector_t, sector ) | ||
436 | __field( sector_t, new_sector ) | ||
437 | __array( char, rwbs, 6 ) | ||
438 | __array( char, comm, TASK_COMM_LEN ) | ||
439 | ), | ||
440 | |||
441 | TP_fast_assign( | ||
442 | __entry->dev = bio->bi_bdev->bd_dev; | ||
443 | __entry->sector = bio->bi_sector; | ||
444 | __entry->new_sector = new_sector; | ||
445 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
446 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
447 | ), | ||
448 | |||
449 | TP_printk("%d,%d %s %llu / %llu [%s]", | ||
450 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
451 | (unsigned long long)__entry->sector, | ||
452 | (unsigned long long)__entry->new_sector, | ||
453 | __entry->comm) | ||
454 | ); | ||
455 | |||
456 | TRACE_EVENT(block_remap, | ||
457 | |||
458 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, | ||
459 | sector_t from), | ||
460 | |||
461 | TP_ARGS(q, bio, dev, from), | ||
462 | |||
463 | TP_STRUCT__entry( | ||
464 | __field( dev_t, dev ) | ||
465 | __field( sector_t, sector ) | ||
466 | __field( unsigned int, nr_sector ) | ||
467 | __field( dev_t, old_dev ) | ||
468 | __field( sector_t, old_sector ) | ||
469 | __array( char, rwbs, 6 ) | ||
470 | ), | ||
471 | |||
472 | TP_fast_assign( | ||
473 | __entry->dev = bio->bi_bdev->bd_dev; | ||
474 | __entry->sector = bio->bi_sector; | ||
475 | __entry->nr_sector = bio->bi_size >> 9; | ||
476 | __entry->old_dev = dev; | ||
477 | __entry->old_sector = from; | ||
478 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
479 | ), | ||
480 | |||
481 | TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu", | ||
482 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
483 | (unsigned long long)__entry->sector, | ||
484 | __entry->nr_sector, | ||
485 | MAJOR(__entry->old_dev), MINOR(__entry->old_dev), | ||
486 | (unsigned long long)__entry->old_sector) | ||
487 | ); | ||
488 | |||
489 | #endif /* _TRACE_BLOCK_H */ | ||
490 | |||
491 | /* This part must be outside protection */ | ||
492 | #include <trace/define_trace.h> | ||
493 | |||
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h new file mode 100644 index 000000000000..b0c7ede55eb1 --- /dev/null +++ b/include/trace/events/irq.h | |||
@@ -0,0 +1,145 @@ | |||
1 | #if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_IRQ_H | ||
3 | |||
4 | #include <linux/tracepoint.h> | ||
5 | #include <linux/interrupt.h> | ||
6 | |||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM irq | ||
9 | |||
10 | #define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq } | ||
11 | #define show_softirq_name(val) \ | ||
12 | __print_symbolic(val, \ | ||
13 | softirq_name(HI), \ | ||
14 | softirq_name(TIMER), \ | ||
15 | softirq_name(NET_TX), \ | ||
16 | softirq_name(NET_RX), \ | ||
17 | softirq_name(BLOCK), \ | ||
18 | softirq_name(TASKLET), \ | ||
19 | softirq_name(SCHED), \ | ||
20 | softirq_name(HRTIMER), \ | ||
21 | softirq_name(RCU)) | ||
22 | |||
23 | /** | ||
24 | * irq_handler_entry - called immediately before the irq action handler | ||
25 | * @irq: irq number | ||
26 | * @action: pointer to struct irqaction | ||
27 | * | ||
28 | * The struct irqaction pointed to by @action contains various | ||
29 | * information about the handler, including the device name, | ||
30 | * @action->name, and the device id, @action->dev_id. When used in | ||
31 | * conjunction with the irq_handler_exit tracepoint, we can figure | ||
32 | * out irq handler latencies. | ||
33 | */ | ||
34 | TRACE_EVENT(irq_handler_entry, | ||
35 | |||
36 | TP_PROTO(int irq, struct irqaction *action), | ||
37 | |||
38 | TP_ARGS(irq, action), | ||
39 | |||
40 | TP_STRUCT__entry( | ||
41 | __field( int, irq ) | ||
42 | __string( name, action->name ) | ||
43 | ), | ||
44 | |||
45 | TP_fast_assign( | ||
46 | __entry->irq = irq; | ||
47 | __assign_str(name, action->name); | ||
48 | ), | ||
49 | |||
50 | TP_printk("irq=%d handler=%s", __entry->irq, __get_str(name)) | ||
51 | ); | ||
52 | |||
53 | /** | ||
54 | * irq_handler_exit - called immediately after the irq action handler returns | ||
55 | * @irq: irq number | ||
56 | * @action: pointer to struct irqaction | ||
57 | * @ret: return value | ||
58 | * | ||
59 | * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding | ||
60 | * @action->handler scuccessully handled this irq. Otherwise, the irq might be | ||
61 | * a shared irq line, or the irq was not handled successfully. Can be used in | ||
62 | * conjunction with the irq_handler_entry to understand irq handler latencies. | ||
63 | */ | ||
64 | TRACE_EVENT(irq_handler_exit, | ||
65 | |||
66 | TP_PROTO(int irq, struct irqaction *action, int ret), | ||
67 | |||
68 | TP_ARGS(irq, action, ret), | ||
69 | |||
70 | TP_STRUCT__entry( | ||
71 | __field( int, irq ) | ||
72 | __field( int, ret ) | ||
73 | ), | ||
74 | |||
75 | TP_fast_assign( | ||
76 | __entry->irq = irq; | ||
77 | __entry->ret = ret; | ||
78 | ), | ||
79 | |||
80 | TP_printk("irq=%d return=%s", | ||
81 | __entry->irq, __entry->ret ? "handled" : "unhandled") | ||
82 | ); | ||
83 | |||
84 | /** | ||
85 | * softirq_entry - called immediately before the softirq handler | ||
86 | * @h: pointer to struct softirq_action | ||
87 | * @vec: pointer to first struct softirq_action in softirq_vec array | ||
88 | * | ||
89 | * The @h parameter, contains a pointer to the struct softirq_action | ||
90 | * which has a pointer to the action handler that is called. By subtracting | ||
91 | * the @vec pointer from the @h pointer, we can determine the softirq | ||
92 | * number. Also, when used in combination with the softirq_exit tracepoint | ||
93 | * we can determine the softirq latency. | ||
94 | */ | ||
95 | TRACE_EVENT(softirq_entry, | ||
96 | |||
97 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | ||
98 | |||
99 | TP_ARGS(h, vec), | ||
100 | |||
101 | TP_STRUCT__entry( | ||
102 | __field( int, vec ) | ||
103 | ), | ||
104 | |||
105 | TP_fast_assign( | ||
106 | __entry->vec = (int)(h - vec); | ||
107 | ), | ||
108 | |||
109 | TP_printk("softirq=%d action=%s", __entry->vec, | ||
110 | show_softirq_name(__entry->vec)) | ||
111 | ); | ||
112 | |||
113 | /** | ||
114 | * softirq_exit - called immediately after the softirq handler returns | ||
115 | * @h: pointer to struct softirq_action | ||
116 | * @vec: pointer to first struct softirq_action in softirq_vec array | ||
117 | * | ||
118 | * The @h parameter contains a pointer to the struct softirq_action | ||
119 | * that has handled the softirq. By subtracting the @vec pointer from | ||
120 | * the @h pointer, we can determine the softirq number. Also, when used in | ||
121 | * combination with the softirq_entry tracepoint we can determine the softirq | ||
122 | * latency. | ||
123 | */ | ||
124 | TRACE_EVENT(softirq_exit, | ||
125 | |||
126 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | ||
127 | |||
128 | TP_ARGS(h, vec), | ||
129 | |||
130 | TP_STRUCT__entry( | ||
131 | __field( int, vec ) | ||
132 | ), | ||
133 | |||
134 | TP_fast_assign( | ||
135 | __entry->vec = (int)(h - vec); | ||
136 | ), | ||
137 | |||
138 | TP_printk("softirq=%d action=%s", __entry->vec, | ||
139 | show_softirq_name(__entry->vec)) | ||
140 | ); | ||
141 | |||
142 | #endif /* _TRACE_IRQ_H */ | ||
143 | |||
144 | /* This part must be outside protection */ | ||
145 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h new file mode 100644 index 000000000000..9baba50d6512 --- /dev/null +++ b/include/trace/events/kmem.h | |||
@@ -0,0 +1,231 @@ | |||
1 | #if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_KMEM_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM kmem | ||
9 | |||
10 | /* | ||
11 | * The order of these masks is important. Matching masks will be seen | ||
12 | * first and the left over flags will end up showing by themselves. | ||
13 | * | ||
14 | * For example, if we have GFP_KERNEL before GFP_USER we wil get: | ||
15 | * | ||
16 | * GFP_KERNEL|GFP_HARDWALL | ||
17 | * | ||
18 | * Thus most bits set go first. | ||
19 | */ | ||
20 | #define show_gfp_flags(flags) \ | ||
21 | (flags) ? __print_flags(flags, "|", \ | ||
22 | {(unsigned long)GFP_HIGHUSER_MOVABLE, "GFP_HIGHUSER_MOVABLE"}, \ | ||
23 | {(unsigned long)GFP_HIGHUSER, "GFP_HIGHUSER"}, \ | ||
24 | {(unsigned long)GFP_USER, "GFP_USER"}, \ | ||
25 | {(unsigned long)GFP_TEMPORARY, "GFP_TEMPORARY"}, \ | ||
26 | {(unsigned long)GFP_KERNEL, "GFP_KERNEL"}, \ | ||
27 | {(unsigned long)GFP_NOFS, "GFP_NOFS"}, \ | ||
28 | {(unsigned long)GFP_ATOMIC, "GFP_ATOMIC"}, \ | ||
29 | {(unsigned long)GFP_NOIO, "GFP_NOIO"}, \ | ||
30 | {(unsigned long)__GFP_HIGH, "GFP_HIGH"}, \ | ||
31 | {(unsigned long)__GFP_WAIT, "GFP_WAIT"}, \ | ||
32 | {(unsigned long)__GFP_IO, "GFP_IO"}, \ | ||
33 | {(unsigned long)__GFP_COLD, "GFP_COLD"}, \ | ||
34 | {(unsigned long)__GFP_NOWARN, "GFP_NOWARN"}, \ | ||
35 | {(unsigned long)__GFP_REPEAT, "GFP_REPEAT"}, \ | ||
36 | {(unsigned long)__GFP_NOFAIL, "GFP_NOFAIL"}, \ | ||
37 | {(unsigned long)__GFP_NORETRY, "GFP_NORETRY"}, \ | ||
38 | {(unsigned long)__GFP_COMP, "GFP_COMP"}, \ | ||
39 | {(unsigned long)__GFP_ZERO, "GFP_ZERO"}, \ | ||
40 | {(unsigned long)__GFP_NOMEMALLOC, "GFP_NOMEMALLOC"}, \ | ||
41 | {(unsigned long)__GFP_HARDWALL, "GFP_HARDWALL"}, \ | ||
42 | {(unsigned long)__GFP_THISNODE, "GFP_THISNODE"}, \ | ||
43 | {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \ | ||
44 | {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"} \ | ||
45 | ) : "GFP_NOWAIT" | ||
46 | |||
47 | TRACE_EVENT(kmalloc, | ||
48 | |||
49 | TP_PROTO(unsigned long call_site, | ||
50 | const void *ptr, | ||
51 | size_t bytes_req, | ||
52 | size_t bytes_alloc, | ||
53 | gfp_t gfp_flags), | ||
54 | |||
55 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags), | ||
56 | |||
57 | TP_STRUCT__entry( | ||
58 | __field( unsigned long, call_site ) | ||
59 | __field( const void *, ptr ) | ||
60 | __field( size_t, bytes_req ) | ||
61 | __field( size_t, bytes_alloc ) | ||
62 | __field( gfp_t, gfp_flags ) | ||
63 | ), | ||
64 | |||
65 | TP_fast_assign( | ||
66 | __entry->call_site = call_site; | ||
67 | __entry->ptr = ptr; | ||
68 | __entry->bytes_req = bytes_req; | ||
69 | __entry->bytes_alloc = bytes_alloc; | ||
70 | __entry->gfp_flags = gfp_flags; | ||
71 | ), | ||
72 | |||
73 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s", | ||
74 | __entry->call_site, | ||
75 | __entry->ptr, | ||
76 | __entry->bytes_req, | ||
77 | __entry->bytes_alloc, | ||
78 | show_gfp_flags(__entry->gfp_flags)) | ||
79 | ); | ||
80 | |||
81 | TRACE_EVENT(kmem_cache_alloc, | ||
82 | |||
83 | TP_PROTO(unsigned long call_site, | ||
84 | const void *ptr, | ||
85 | size_t bytes_req, | ||
86 | size_t bytes_alloc, | ||
87 | gfp_t gfp_flags), | ||
88 | |||
89 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags), | ||
90 | |||
91 | TP_STRUCT__entry( | ||
92 | __field( unsigned long, call_site ) | ||
93 | __field( const void *, ptr ) | ||
94 | __field( size_t, bytes_req ) | ||
95 | __field( size_t, bytes_alloc ) | ||
96 | __field( gfp_t, gfp_flags ) | ||
97 | ), | ||
98 | |||
99 | TP_fast_assign( | ||
100 | __entry->call_site = call_site; | ||
101 | __entry->ptr = ptr; | ||
102 | __entry->bytes_req = bytes_req; | ||
103 | __entry->bytes_alloc = bytes_alloc; | ||
104 | __entry->gfp_flags = gfp_flags; | ||
105 | ), | ||
106 | |||
107 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s", | ||
108 | __entry->call_site, | ||
109 | __entry->ptr, | ||
110 | __entry->bytes_req, | ||
111 | __entry->bytes_alloc, | ||
112 | show_gfp_flags(__entry->gfp_flags)) | ||
113 | ); | ||
114 | |||
115 | TRACE_EVENT(kmalloc_node, | ||
116 | |||
117 | TP_PROTO(unsigned long call_site, | ||
118 | const void *ptr, | ||
119 | size_t bytes_req, | ||
120 | size_t bytes_alloc, | ||
121 | gfp_t gfp_flags, | ||
122 | int node), | ||
123 | |||
124 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node), | ||
125 | |||
126 | TP_STRUCT__entry( | ||
127 | __field( unsigned long, call_site ) | ||
128 | __field( const void *, ptr ) | ||
129 | __field( size_t, bytes_req ) | ||
130 | __field( size_t, bytes_alloc ) | ||
131 | __field( gfp_t, gfp_flags ) | ||
132 | __field( int, node ) | ||
133 | ), | ||
134 | |||
135 | TP_fast_assign( | ||
136 | __entry->call_site = call_site; | ||
137 | __entry->ptr = ptr; | ||
138 | __entry->bytes_req = bytes_req; | ||
139 | __entry->bytes_alloc = bytes_alloc; | ||
140 | __entry->gfp_flags = gfp_flags; | ||
141 | __entry->node = node; | ||
142 | ), | ||
143 | |||
144 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d", | ||
145 | __entry->call_site, | ||
146 | __entry->ptr, | ||
147 | __entry->bytes_req, | ||
148 | __entry->bytes_alloc, | ||
149 | show_gfp_flags(__entry->gfp_flags), | ||
150 | __entry->node) | ||
151 | ); | ||
152 | |||
153 | TRACE_EVENT(kmem_cache_alloc_node, | ||
154 | |||
155 | TP_PROTO(unsigned long call_site, | ||
156 | const void *ptr, | ||
157 | size_t bytes_req, | ||
158 | size_t bytes_alloc, | ||
159 | gfp_t gfp_flags, | ||
160 | int node), | ||
161 | |||
162 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node), | ||
163 | |||
164 | TP_STRUCT__entry( | ||
165 | __field( unsigned long, call_site ) | ||
166 | __field( const void *, ptr ) | ||
167 | __field( size_t, bytes_req ) | ||
168 | __field( size_t, bytes_alloc ) | ||
169 | __field( gfp_t, gfp_flags ) | ||
170 | __field( int, node ) | ||
171 | ), | ||
172 | |||
173 | TP_fast_assign( | ||
174 | __entry->call_site = call_site; | ||
175 | __entry->ptr = ptr; | ||
176 | __entry->bytes_req = bytes_req; | ||
177 | __entry->bytes_alloc = bytes_alloc; | ||
178 | __entry->gfp_flags = gfp_flags; | ||
179 | __entry->node = node; | ||
180 | ), | ||
181 | |||
182 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d", | ||
183 | __entry->call_site, | ||
184 | __entry->ptr, | ||
185 | __entry->bytes_req, | ||
186 | __entry->bytes_alloc, | ||
187 | show_gfp_flags(__entry->gfp_flags), | ||
188 | __entry->node) | ||
189 | ); | ||
190 | |||
191 | TRACE_EVENT(kfree, | ||
192 | |||
193 | TP_PROTO(unsigned long call_site, const void *ptr), | ||
194 | |||
195 | TP_ARGS(call_site, ptr), | ||
196 | |||
197 | TP_STRUCT__entry( | ||
198 | __field( unsigned long, call_site ) | ||
199 | __field( const void *, ptr ) | ||
200 | ), | ||
201 | |||
202 | TP_fast_assign( | ||
203 | __entry->call_site = call_site; | ||
204 | __entry->ptr = ptr; | ||
205 | ), | ||
206 | |||
207 | TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) | ||
208 | ); | ||
209 | |||
210 | TRACE_EVENT(kmem_cache_free, | ||
211 | |||
212 | TP_PROTO(unsigned long call_site, const void *ptr), | ||
213 | |||
214 | TP_ARGS(call_site, ptr), | ||
215 | |||
216 | TP_STRUCT__entry( | ||
217 | __field( unsigned long, call_site ) | ||
218 | __field( const void *, ptr ) | ||
219 | ), | ||
220 | |||
221 | TP_fast_assign( | ||
222 | __entry->call_site = call_site; | ||
223 | __entry->ptr = ptr; | ||
224 | ), | ||
225 | |||
226 | TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) | ||
227 | ); | ||
228 | #endif /* _TRACE_KMEM_H */ | ||
229 | |||
230 | /* This part must be outside protection */ | ||
231 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/lockdep.h b/include/trace/events/lockdep.h new file mode 100644 index 000000000000..0e956c9dfd7e --- /dev/null +++ b/include/trace/events/lockdep.h | |||
@@ -0,0 +1,96 @@ | |||
1 | #if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_LOCKDEP_H | ||
3 | |||
4 | #include <linux/lockdep.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM lockdep | ||
9 | |||
10 | #ifdef CONFIG_LOCKDEP | ||
11 | |||
12 | TRACE_EVENT(lock_acquire, | ||
13 | |||
14 | TP_PROTO(struct lockdep_map *lock, unsigned int subclass, | ||
15 | int trylock, int read, int check, | ||
16 | struct lockdep_map *next_lock, unsigned long ip), | ||
17 | |||
18 | TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip), | ||
19 | |||
20 | TP_STRUCT__entry( | ||
21 | __field(unsigned int, flags) | ||
22 | __string(name, lock->name) | ||
23 | ), | ||
24 | |||
25 | TP_fast_assign( | ||
26 | __entry->flags = (trylock ? 1 : 0) | (read ? 2 : 0); | ||
27 | __assign_str(name, lock->name); | ||
28 | ), | ||
29 | |||
30 | TP_printk("%s%s%s", (__entry->flags & 1) ? "try " : "", | ||
31 | (__entry->flags & 2) ? "read " : "", | ||
32 | __get_str(name)) | ||
33 | ); | ||
34 | |||
35 | TRACE_EVENT(lock_release, | ||
36 | |||
37 | TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip), | ||
38 | |||
39 | TP_ARGS(lock, nested, ip), | ||
40 | |||
41 | TP_STRUCT__entry( | ||
42 | __string(name, lock->name) | ||
43 | ), | ||
44 | |||
45 | TP_fast_assign( | ||
46 | __assign_str(name, lock->name); | ||
47 | ), | ||
48 | |||
49 | TP_printk("%s", __get_str(name)) | ||
50 | ); | ||
51 | |||
52 | #ifdef CONFIG_LOCK_STAT | ||
53 | |||
54 | TRACE_EVENT(lock_contended, | ||
55 | |||
56 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), | ||
57 | |||
58 | TP_ARGS(lock, ip), | ||
59 | |||
60 | TP_STRUCT__entry( | ||
61 | __string(name, lock->name) | ||
62 | ), | ||
63 | |||
64 | TP_fast_assign( | ||
65 | __assign_str(name, lock->name); | ||
66 | ), | ||
67 | |||
68 | TP_printk("%s", __get_str(name)) | ||
69 | ); | ||
70 | |||
71 | TRACE_EVENT(lock_acquired, | ||
72 | TP_PROTO(struct lockdep_map *lock, unsigned long ip, s64 waittime), | ||
73 | |||
74 | TP_ARGS(lock, ip, waittime), | ||
75 | |||
76 | TP_STRUCT__entry( | ||
77 | __string(name, lock->name) | ||
78 | __field(unsigned long, wait_usec) | ||
79 | __field(unsigned long, wait_nsec_rem) | ||
80 | ), | ||
81 | TP_fast_assign( | ||
82 | __assign_str(name, lock->name); | ||
83 | __entry->wait_nsec_rem = do_div(waittime, NSEC_PER_USEC); | ||
84 | __entry->wait_usec = (unsigned long) waittime; | ||
85 | ), | ||
86 | TP_printk("%s (%lu.%03lu us)", __get_str(name), __entry->wait_usec, | ||
87 | __entry->wait_nsec_rem) | ||
88 | ); | ||
89 | |||
90 | #endif | ||
91 | #endif | ||
92 | |||
93 | #endif /* _TRACE_LOCKDEP_H */ | ||
94 | |||
95 | /* This part must be outside protection */ | ||
96 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/sched_event_types.h b/include/trace/events/sched.h index 63547dc1125f..24ab5bcff7b2 100644 --- a/include/trace/sched_event_types.h +++ b/include/trace/events/sched.h | |||
@@ -1,9 +1,8 @@ | |||
1 | #if !defined(_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_SCHED_H | ||
1 | 3 | ||
2 | /* use <trace/sched.h> instead */ | 4 | #include <linux/sched.h> |
3 | #ifndef TRACE_EVENT | 5 | #include <linux/tracepoint.h> |
4 | # error Do not include this file directly. | ||
5 | # error Unless you know what you are doing. | ||
6 | #endif | ||
7 | 6 | ||
8 | #undef TRACE_SYSTEM | 7 | #undef TRACE_SYSTEM |
9 | #define TRACE_SYSTEM sched | 8 | #define TRACE_SYSTEM sched |
@@ -157,6 +156,7 @@ TRACE_EVENT(sched_switch, | |||
157 | __array( char, prev_comm, TASK_COMM_LEN ) | 156 | __array( char, prev_comm, TASK_COMM_LEN ) |
158 | __field( pid_t, prev_pid ) | 157 | __field( pid_t, prev_pid ) |
159 | __field( int, prev_prio ) | 158 | __field( int, prev_prio ) |
159 | __field( long, prev_state ) | ||
160 | __array( char, next_comm, TASK_COMM_LEN ) | 160 | __array( char, next_comm, TASK_COMM_LEN ) |
161 | __field( pid_t, next_pid ) | 161 | __field( pid_t, next_pid ) |
162 | __field( int, next_prio ) | 162 | __field( int, next_prio ) |
@@ -166,13 +166,19 @@ TRACE_EVENT(sched_switch, | |||
166 | memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); | 166 | memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); |
167 | __entry->prev_pid = prev->pid; | 167 | __entry->prev_pid = prev->pid; |
168 | __entry->prev_prio = prev->prio; | 168 | __entry->prev_prio = prev->prio; |
169 | __entry->prev_state = prev->state; | ||
169 | memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); | 170 | memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); |
170 | __entry->next_pid = next->pid; | 171 | __entry->next_pid = next->pid; |
171 | __entry->next_prio = next->prio; | 172 | __entry->next_prio = next->prio; |
172 | ), | 173 | ), |
173 | 174 | ||
174 | TP_printk("task %s:%d [%d] ==> %s:%d [%d]", | 175 | TP_printk("task %s:%d [%d] (%s) ==> %s:%d [%d]", |
175 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, | 176 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, |
177 | __entry->prev_state ? | ||
178 | __print_flags(__entry->prev_state, "|", | ||
179 | { 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" }, | ||
180 | { 16, "Z" }, { 32, "X" }, { 64, "x" }, | ||
181 | { 128, "W" }) : "R", | ||
176 | __entry->next_comm, __entry->next_pid, __entry->next_prio) | 182 | __entry->next_comm, __entry->next_pid, __entry->next_prio) |
177 | ); | 183 | ); |
178 | 184 | ||
@@ -181,9 +187,9 @@ TRACE_EVENT(sched_switch, | |||
181 | */ | 187 | */ |
182 | TRACE_EVENT(sched_migrate_task, | 188 | TRACE_EVENT(sched_migrate_task, |
183 | 189 | ||
184 | TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu), | 190 | TP_PROTO(struct task_struct *p, int dest_cpu), |
185 | 191 | ||
186 | TP_ARGS(p, orig_cpu, dest_cpu), | 192 | TP_ARGS(p, dest_cpu), |
187 | 193 | ||
188 | TP_STRUCT__entry( | 194 | TP_STRUCT__entry( |
189 | __array( char, comm, TASK_COMM_LEN ) | 195 | __array( char, comm, TASK_COMM_LEN ) |
@@ -197,7 +203,7 @@ TRACE_EVENT(sched_migrate_task, | |||
197 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | 203 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
198 | __entry->pid = p->pid; | 204 | __entry->pid = p->pid; |
199 | __entry->prio = p->prio; | 205 | __entry->prio = p->prio; |
200 | __entry->orig_cpu = orig_cpu; | 206 | __entry->orig_cpu = task_cpu(p); |
201 | __entry->dest_cpu = dest_cpu; | 207 | __entry->dest_cpu = dest_cpu; |
202 | ), | 208 | ), |
203 | 209 | ||
@@ -334,4 +340,7 @@ TRACE_EVENT(sched_signal_send, | |||
334 | __entry->sig, __entry->comm, __entry->pid) | 340 | __entry->sig, __entry->comm, __entry->pid) |
335 | ); | 341 | ); |
336 | 342 | ||
337 | #undef TRACE_SYSTEM | 343 | #endif /* _TRACE_SCHED_H */ |
344 | |||
345 | /* This part must be outside protection */ | ||
346 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h new file mode 100644 index 000000000000..1e8fabb57c06 --- /dev/null +++ b/include/trace/events/skb.h | |||
@@ -0,0 +1,40 @@ | |||
1 | #if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_SKB_H | ||
3 | |||
4 | #include <linux/skbuff.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM skb | ||
9 | |||
10 | /* | ||
11 | * Tracepoint for free an sk_buff: | ||
12 | */ | ||
13 | TRACE_EVENT(kfree_skb, | ||
14 | |||
15 | TP_PROTO(struct sk_buff *skb, void *location), | ||
16 | |||
17 | TP_ARGS(skb, location), | ||
18 | |||
19 | TP_STRUCT__entry( | ||
20 | __field( void *, skbaddr ) | ||
21 | __field( unsigned short, protocol ) | ||
22 | __field( void *, location ) | ||
23 | ), | ||
24 | |||
25 | TP_fast_assign( | ||
26 | __entry->skbaddr = skb; | ||
27 | if (skb) { | ||
28 | __entry->protocol = ntohs(skb->protocol); | ||
29 | } | ||
30 | __entry->location = location; | ||
31 | ), | ||
32 | |||
33 | TP_printk("skbaddr=%p protocol=%u location=%p", | ||
34 | __entry->skbaddr, __entry->protocol, __entry->location) | ||
35 | ); | ||
36 | |||
37 | #endif /* _TRACE_SKB_H */ | ||
38 | |||
39 | /* This part must be outside protection */ | ||
40 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h new file mode 100644 index 000000000000..035f1bff288e --- /dev/null +++ b/include/trace/events/workqueue.h | |||
@@ -0,0 +1,100 @@ | |||
1 | #if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_WORKQUEUE_H | ||
3 | |||
4 | #include <linux/workqueue.h> | ||
5 | #include <linux/sched.h> | ||
6 | #include <linux/tracepoint.h> | ||
7 | |||
8 | #undef TRACE_SYSTEM | ||
9 | #define TRACE_SYSTEM workqueue | ||
10 | |||
11 | TRACE_EVENT(workqueue_insertion, | ||
12 | |||
13 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | ||
14 | |||
15 | TP_ARGS(wq_thread, work), | ||
16 | |||
17 | TP_STRUCT__entry( | ||
18 | __array(char, thread_comm, TASK_COMM_LEN) | ||
19 | __field(pid_t, thread_pid) | ||
20 | __field(work_func_t, func) | ||
21 | ), | ||
22 | |||
23 | TP_fast_assign( | ||
24 | memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); | ||
25 | __entry->thread_pid = wq_thread->pid; | ||
26 | __entry->func = work->func; | ||
27 | ), | ||
28 | |||
29 | TP_printk("thread=%s:%d func=%pF", __entry->thread_comm, | ||
30 | __entry->thread_pid, __entry->func) | ||
31 | ); | ||
32 | |||
33 | TRACE_EVENT(workqueue_execution, | ||
34 | |||
35 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | ||
36 | |||
37 | TP_ARGS(wq_thread, work), | ||
38 | |||
39 | TP_STRUCT__entry( | ||
40 | __array(char, thread_comm, TASK_COMM_LEN) | ||
41 | __field(pid_t, thread_pid) | ||
42 | __field(work_func_t, func) | ||
43 | ), | ||
44 | |||
45 | TP_fast_assign( | ||
46 | memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); | ||
47 | __entry->thread_pid = wq_thread->pid; | ||
48 | __entry->func = work->func; | ||
49 | ), | ||
50 | |||
51 | TP_printk("thread=%s:%d func=%pF", __entry->thread_comm, | ||
52 | __entry->thread_pid, __entry->func) | ||
53 | ); | ||
54 | |||
55 | /* Trace the creation of one workqueue thread on a cpu */ | ||
56 | TRACE_EVENT(workqueue_creation, | ||
57 | |||
58 | TP_PROTO(struct task_struct *wq_thread, int cpu), | ||
59 | |||
60 | TP_ARGS(wq_thread, cpu), | ||
61 | |||
62 | TP_STRUCT__entry( | ||
63 | __array(char, thread_comm, TASK_COMM_LEN) | ||
64 | __field(pid_t, thread_pid) | ||
65 | __field(int, cpu) | ||
66 | ), | ||
67 | |||
68 | TP_fast_assign( | ||
69 | memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); | ||
70 | __entry->thread_pid = wq_thread->pid; | ||
71 | __entry->cpu = cpu; | ||
72 | ), | ||
73 | |||
74 | TP_printk("thread=%s:%d cpu=%d", __entry->thread_comm, | ||
75 | __entry->thread_pid, __entry->cpu) | ||
76 | ); | ||
77 | |||
78 | TRACE_EVENT(workqueue_destruction, | ||
79 | |||
80 | TP_PROTO(struct task_struct *wq_thread), | ||
81 | |||
82 | TP_ARGS(wq_thread), | ||
83 | |||
84 | TP_STRUCT__entry( | ||
85 | __array(char, thread_comm, TASK_COMM_LEN) | ||
86 | __field(pid_t, thread_pid) | ||
87 | ), | ||
88 | |||
89 | TP_fast_assign( | ||
90 | memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); | ||
91 | __entry->thread_pid = wq_thread->pid; | ||
92 | ), | ||
93 | |||
94 | TP_printk("thread=%s:%d", __entry->thread_comm, __entry->thread_pid) | ||
95 | ); | ||
96 | |||
97 | #endif /* _TRACE_WORKQUEUE_H */ | ||
98 | |||
99 | /* This part must be outside protection */ | ||
100 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h new file mode 100644 index 000000000000..1867553c61e5 --- /dev/null +++ b/include/trace/ftrace.h | |||
@@ -0,0 +1,591 @@ | |||
1 | /* | ||
2 | * Stage 1 of the trace events. | ||
3 | * | ||
4 | * Override the macros in <trace/trace_events.h> to include the following: | ||
5 | * | ||
6 | * struct ftrace_raw_<call> { | ||
7 | * struct trace_entry ent; | ||
8 | * <type> <item>; | ||
9 | * <type2> <item2>[<len>]; | ||
10 | * [...] | ||
11 | * }; | ||
12 | * | ||
13 | * The <type> <item> is created by the __field(type, item) macro or | ||
14 | * the __array(type2, item2, len) macro. | ||
15 | * We simply do "type item;", and that will create the fields | ||
16 | * in the structure. | ||
17 | */ | ||
18 | |||
19 | #include <linux/ftrace_event.h> | ||
20 | |||
21 | #undef __field | ||
22 | #define __field(type, item) type item; | ||
23 | |||
24 | #undef __array | ||
25 | #define __array(type, item, len) type item[len]; | ||
26 | |||
27 | #undef __dynamic_array | ||
28 | #define __dynamic_array(type, item, len) unsigned short __data_loc_##item; | ||
29 | |||
30 | #undef __string | ||
31 | #define __string(item, src) __dynamic_array(char, item, -1) | ||
32 | |||
33 | #undef TP_STRUCT__entry | ||
34 | #define TP_STRUCT__entry(args...) args | ||
35 | |||
36 | #undef TRACE_EVENT | ||
37 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ | ||
38 | struct ftrace_raw_##name { \ | ||
39 | struct trace_entry ent; \ | ||
40 | tstruct \ | ||
41 | char __data[0]; \ | ||
42 | }; \ | ||
43 | static struct ftrace_event_call event_##name | ||
44 | |||
45 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
46 | |||
47 | |||
48 | /* | ||
49 | * Stage 2 of the trace events. | ||
50 | * | ||
51 | * Include the following: | ||
52 | * | ||
53 | * struct ftrace_data_offsets_<call> { | ||
54 | * int <item1>; | ||
55 | * int <item2>; | ||
56 | * [...] | ||
57 | * }; | ||
58 | * | ||
59 | * The __dynamic_array() macro will create each int <item>, this is | ||
60 | * to keep the offset of each array from the beginning of the event. | ||
61 | */ | ||
62 | |||
63 | #undef __field | ||
64 | #define __field(type, item); | ||
65 | |||
66 | #undef __array | ||
67 | #define __array(type, item, len) | ||
68 | |||
69 | #undef __dynamic_array | ||
70 | #define __dynamic_array(type, item, len) int item; | ||
71 | |||
72 | #undef __string | ||
73 | #define __string(item, src) __dynamic_array(char, item, -1) | ||
74 | |||
75 | #undef TRACE_EVENT | ||
76 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | ||
77 | struct ftrace_data_offsets_##call { \ | ||
78 | tstruct; \ | ||
79 | }; | ||
80 | |||
81 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
82 | |||
83 | /* | ||
84 | * Setup the showing format of trace point. | ||
85 | * | ||
86 | * int | ||
87 | * ftrace_format_##call(struct trace_seq *s) | ||
88 | * { | ||
89 | * struct ftrace_raw_##call field; | ||
90 | * int ret; | ||
91 | * | ||
92 | * ret = trace_seq_printf(s, #type " " #item ";" | ||
93 | * " offset:%u; size:%u;\n", | ||
94 | * offsetof(struct ftrace_raw_##call, item), | ||
95 | * sizeof(field.type)); | ||
96 | * | ||
97 | * } | ||
98 | */ | ||
99 | |||
100 | #undef TP_STRUCT__entry | ||
101 | #define TP_STRUCT__entry(args...) args | ||
102 | |||
103 | #undef __field | ||
104 | #define __field(type, item) \ | ||
105 | ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \ | ||
106 | "offset:%u;\tsize:%u;\n", \ | ||
107 | (unsigned int)offsetof(typeof(field), item), \ | ||
108 | (unsigned int)sizeof(field.item)); \ | ||
109 | if (!ret) \ | ||
110 | return 0; | ||
111 | |||
112 | #undef __array | ||
113 | #define __array(type, item, len) \ | ||
114 | ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \ | ||
115 | "offset:%u;\tsize:%u;\n", \ | ||
116 | (unsigned int)offsetof(typeof(field), item), \ | ||
117 | (unsigned int)sizeof(field.item)); \ | ||
118 | if (!ret) \ | ||
119 | return 0; | ||
120 | |||
121 | #undef __dynamic_array | ||
122 | #define __dynamic_array(type, item, len) \ | ||
123 | ret = trace_seq_printf(s, "\tfield:__data_loc " #item ";\t" \ | ||
124 | "offset:%u;\tsize:%u;\n", \ | ||
125 | (unsigned int)offsetof(typeof(field), \ | ||
126 | __data_loc_##item), \ | ||
127 | (unsigned int)sizeof(field.__data_loc_##item)); \ | ||
128 | if (!ret) \ | ||
129 | return 0; | ||
130 | |||
131 | #undef __string | ||
132 | #define __string(item, src) __dynamic_array(char, item, -1) | ||
133 | |||
134 | #undef __entry | ||
135 | #define __entry REC | ||
136 | |||
137 | #undef __print_symbolic | ||
138 | #undef __get_dynamic_array | ||
139 | #undef __get_str | ||
140 | |||
141 | #undef TP_printk | ||
142 | #define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args) | ||
143 | |||
144 | #undef TP_fast_assign | ||
145 | #define TP_fast_assign(args...) args | ||
146 | |||
147 | #undef TRACE_EVENT | ||
148 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ | ||
149 | static int \ | ||
150 | ftrace_format_##call(struct trace_seq *s) \ | ||
151 | { \ | ||
152 | struct ftrace_raw_##call field __attribute__((unused)); \ | ||
153 | int ret = 0; \ | ||
154 | \ | ||
155 | tstruct; \ | ||
156 | \ | ||
157 | trace_seq_printf(s, "\nprint fmt: " print); \ | ||
158 | \ | ||
159 | return ret; \ | ||
160 | } | ||
161 | |||
162 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
163 | |||
164 | /* | ||
165 | * Stage 3 of the trace events. | ||
166 | * | ||
167 | * Override the macros in <trace/trace_events.h> to include the following: | ||
168 | * | ||
169 | * enum print_line_t | ||
170 | * ftrace_raw_output_<call>(struct trace_iterator *iter, int flags) | ||
171 | * { | ||
172 | * struct trace_seq *s = &iter->seq; | ||
173 | * struct ftrace_raw_<call> *field; <-- defined in stage 1 | ||
174 | * struct trace_entry *entry; | ||
175 | * struct trace_seq *p; | ||
176 | * int ret; | ||
177 | * | ||
178 | * entry = iter->ent; | ||
179 | * | ||
180 | * if (entry->type != event_<call>.id) { | ||
181 | * WARN_ON_ONCE(1); | ||
182 | * return TRACE_TYPE_UNHANDLED; | ||
183 | * } | ||
184 | * | ||
185 | * field = (typeof(field))entry; | ||
186 | * | ||
187 | * p = get_cpu_var(ftrace_event_seq); | ||
188 | * trace_seq_init(p); | ||
189 | * ret = trace_seq_printf(s, <TP_printk> "\n"); | ||
190 | * put_cpu(); | ||
191 | * if (!ret) | ||
192 | * return TRACE_TYPE_PARTIAL_LINE; | ||
193 | * | ||
194 | * return TRACE_TYPE_HANDLED; | ||
195 | * } | ||
196 | * | ||
197 | * This is the method used to print the raw event to the trace | ||
198 | * output format. Note, this is not needed if the data is read | ||
199 | * in binary. | ||
200 | */ | ||
201 | |||
202 | #undef __entry | ||
203 | #define __entry field | ||
204 | |||
205 | #undef TP_printk | ||
206 | #define TP_printk(fmt, args...) fmt "\n", args | ||
207 | |||
208 | #undef __get_dynamic_array | ||
209 | #define __get_dynamic_array(field) \ | ||
210 | ((void *)__entry + __entry->__data_loc_##field) | ||
211 | |||
212 | #undef __get_str | ||
213 | #define __get_str(field) (char *)__get_dynamic_array(field) | ||
214 | |||
215 | #undef __print_flags | ||
216 | #define __print_flags(flag, delim, flag_array...) \ | ||
217 | ({ \ | ||
218 | static const struct trace_print_flags flags[] = \ | ||
219 | { flag_array, { -1, NULL }}; \ | ||
220 | ftrace_print_flags_seq(p, delim, flag, flags); \ | ||
221 | }) | ||
222 | |||
223 | #undef __print_symbolic | ||
224 | #define __print_symbolic(value, symbol_array...) \ | ||
225 | ({ \ | ||
226 | static const struct trace_print_flags symbols[] = \ | ||
227 | { symbol_array, { -1, NULL }}; \ | ||
228 | ftrace_print_symbols_seq(p, value, symbols); \ | ||
229 | }) | ||
230 | |||
231 | #undef TRACE_EVENT | ||
232 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | ||
233 | enum print_line_t \ | ||
234 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | ||
235 | { \ | ||
236 | struct trace_seq *s = &iter->seq; \ | ||
237 | struct ftrace_raw_##call *field; \ | ||
238 | struct trace_entry *entry; \ | ||
239 | struct trace_seq *p; \ | ||
240 | int ret; \ | ||
241 | \ | ||
242 | entry = iter->ent; \ | ||
243 | \ | ||
244 | if (entry->type != event_##call.id) { \ | ||
245 | WARN_ON_ONCE(1); \ | ||
246 | return TRACE_TYPE_UNHANDLED; \ | ||
247 | } \ | ||
248 | \ | ||
249 | field = (typeof(field))entry; \ | ||
250 | \ | ||
251 | p = &get_cpu_var(ftrace_event_seq); \ | ||
252 | trace_seq_init(p); \ | ||
253 | ret = trace_seq_printf(s, #call ": " print); \ | ||
254 | put_cpu(); \ | ||
255 | if (!ret) \ | ||
256 | return TRACE_TYPE_PARTIAL_LINE; \ | ||
257 | \ | ||
258 | return TRACE_TYPE_HANDLED; \ | ||
259 | } | ||
260 | |||
261 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
262 | |||
263 | #undef __field | ||
264 | #define __field(type, item) \ | ||
265 | ret = trace_define_field(event_call, #type, #item, \ | ||
266 | offsetof(typeof(field), item), \ | ||
267 | sizeof(field.item), is_signed_type(type)); \ | ||
268 | if (ret) \ | ||
269 | return ret; | ||
270 | |||
271 | #undef __array | ||
272 | #define __array(type, item, len) \ | ||
273 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ | ||
274 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ | ||
275 | offsetof(typeof(field), item), \ | ||
276 | sizeof(field.item), 0); \ | ||
277 | if (ret) \ | ||
278 | return ret; | ||
279 | |||
280 | #undef __dynamic_array | ||
281 | #define __dynamic_array(type, item, len) \ | ||
282 | ret = trace_define_field(event_call, "__data_loc" "[" #type "]", #item,\ | ||
283 | offsetof(typeof(field), __data_loc_##item), \ | ||
284 | sizeof(field.__data_loc_##item), 0); | ||
285 | |||
286 | #undef __string | ||
287 | #define __string(item, src) __dynamic_array(char, item, -1) | ||
288 | |||
289 | #undef TRACE_EVENT | ||
290 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ | ||
291 | int \ | ||
292 | ftrace_define_fields_##call(void) \ | ||
293 | { \ | ||
294 | struct ftrace_raw_##call field; \ | ||
295 | struct ftrace_event_call *event_call = &event_##call; \ | ||
296 | int ret; \ | ||
297 | \ | ||
298 | __common_field(int, type, 1); \ | ||
299 | __common_field(unsigned char, flags, 0); \ | ||
300 | __common_field(unsigned char, preempt_count, 0); \ | ||
301 | __common_field(int, pid, 1); \ | ||
302 | __common_field(int, tgid, 1); \ | ||
303 | \ | ||
304 | tstruct; \ | ||
305 | \ | ||
306 | return ret; \ | ||
307 | } | ||
308 | |||
309 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
310 | |||
311 | /* | ||
312 | * remember the offset of each array from the beginning of the event. | ||
313 | */ | ||
314 | |||
315 | #undef __entry | ||
316 | #define __entry entry | ||
317 | |||
318 | #undef __field | ||
319 | #define __field(type, item) | ||
320 | |||
321 | #undef __array | ||
322 | #define __array(type, item, len) | ||
323 | |||
324 | #undef __dynamic_array | ||
325 | #define __dynamic_array(type, item, len) \ | ||
326 | __data_offsets->item = __data_size + \ | ||
327 | offsetof(typeof(*entry), __data); \ | ||
328 | __data_size += (len) * sizeof(type); | ||
329 | |||
330 | #undef __string | ||
331 | #define __string(item, src) __dynamic_array(char, item, strlen(src) + 1) \ | ||
332 | |||
333 | #undef TRACE_EVENT | ||
334 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | ||
335 | static inline int ftrace_get_offsets_##call( \ | ||
336 | struct ftrace_data_offsets_##call *__data_offsets, proto) \ | ||
337 | { \ | ||
338 | int __data_size = 0; \ | ||
339 | struct ftrace_raw_##call __maybe_unused *entry; \ | ||
340 | \ | ||
341 | tstruct; \ | ||
342 | \ | ||
343 | return __data_size; \ | ||
344 | } | ||
345 | |||
346 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
347 | |||
348 | /* | ||
349 | * Stage 4 of the trace events. | ||
350 | * | ||
351 | * Override the macros in <trace/trace_events.h> to include the following: | ||
352 | * | ||
353 | * static void ftrace_event_<call>(proto) | ||
354 | * { | ||
355 | * event_trace_printk(_RET_IP_, "<call>: " <fmt>); | ||
356 | * } | ||
357 | * | ||
358 | * static int ftrace_reg_event_<call>(void) | ||
359 | * { | ||
360 | * int ret; | ||
361 | * | ||
362 | * ret = register_trace_<call>(ftrace_event_<call>); | ||
363 | * if (!ret) | ||
364 | * pr_info("event trace: Could not activate trace point " | ||
365 | * "probe to <call>"); | ||
366 | * return ret; | ||
367 | * } | ||
368 | * | ||
369 | * static void ftrace_unreg_event_<call>(void) | ||
370 | * { | ||
371 | * unregister_trace_<call>(ftrace_event_<call>); | ||
372 | * } | ||
373 | * | ||
374 | * | ||
375 | * For those macros defined with TRACE_EVENT: | ||
376 | * | ||
377 | * static struct ftrace_event_call event_<call>; | ||
378 | * | ||
379 | * static void ftrace_raw_event_<call>(proto) | ||
380 | * { | ||
381 | * struct ring_buffer_event *event; | ||
382 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 | ||
383 | * unsigned long irq_flags; | ||
384 | * int pc; | ||
385 | * | ||
386 | * local_save_flags(irq_flags); | ||
387 | * pc = preempt_count(); | ||
388 | * | ||
389 | * event = trace_current_buffer_lock_reserve(event_<call>.id, | ||
390 | * sizeof(struct ftrace_raw_<call>), | ||
391 | * irq_flags, pc); | ||
392 | * if (!event) | ||
393 | * return; | ||
394 | * entry = ring_buffer_event_data(event); | ||
395 | * | ||
396 | * <assign>; <-- Here we assign the entries by the __field and | ||
397 | * __array macros. | ||
398 | * | ||
399 | * trace_current_buffer_unlock_commit(event, irq_flags, pc); | ||
400 | * } | ||
401 | * | ||
402 | * static int ftrace_raw_reg_event_<call>(void) | ||
403 | * { | ||
404 | * int ret; | ||
405 | * | ||
406 | * ret = register_trace_<call>(ftrace_raw_event_<call>); | ||
407 | * if (!ret) | ||
408 | * pr_info("event trace: Could not activate trace point " | ||
409 | * "probe to <call>"); | ||
410 | * return ret; | ||
411 | * } | ||
412 | * | ||
413 | * static void ftrace_unreg_event_<call>(void) | ||
414 | * { | ||
415 | * unregister_trace_<call>(ftrace_raw_event_<call>); | ||
416 | * } | ||
417 | * | ||
418 | * static struct trace_event ftrace_event_type_<call> = { | ||
419 | * .trace = ftrace_raw_output_<call>, <-- stage 2 | ||
420 | * }; | ||
421 | * | ||
422 | * static int ftrace_raw_init_event_<call>(void) | ||
423 | * { | ||
424 | * int id; | ||
425 | * | ||
426 | * id = register_ftrace_event(&ftrace_event_type_<call>); | ||
427 | * if (!id) | ||
428 | * return -ENODEV; | ||
429 | * event_<call>.id = id; | ||
430 | * return 0; | ||
431 | * } | ||
432 | * | ||
433 | * static struct ftrace_event_call __used | ||
434 | * __attribute__((__aligned__(4))) | ||
435 | * __attribute__((section("_ftrace_events"))) event_<call> = { | ||
436 | * .name = "<call>", | ||
437 | * .system = "<system>", | ||
438 | * .raw_init = ftrace_raw_init_event_<call>, | ||
439 | * .regfunc = ftrace_reg_event_<call>, | ||
440 | * .unregfunc = ftrace_unreg_event_<call>, | ||
441 | * .show_format = ftrace_format_<call>, | ||
442 | * } | ||
443 | * | ||
444 | */ | ||
445 | |||
446 | #undef TP_FMT | ||
447 | #define TP_FMT(fmt, args...) fmt "\n", ##args | ||
448 | |||
449 | #ifdef CONFIG_EVENT_PROFILE | ||
450 | #define _TRACE_PROFILE(call, proto, args) \ | ||
451 | static void ftrace_profile_##call(proto) \ | ||
452 | { \ | ||
453 | extern void perf_tpcounter_event(int); \ | ||
454 | perf_tpcounter_event(event_##call.id); \ | ||
455 | } \ | ||
456 | \ | ||
457 | static int ftrace_profile_enable_##call(struct ftrace_event_call *event_call) \ | ||
458 | { \ | ||
459 | int ret = 0; \ | ||
460 | \ | ||
461 | if (!atomic_inc_return(&event_call->profile_count)) \ | ||
462 | ret = register_trace_##call(ftrace_profile_##call); \ | ||
463 | \ | ||
464 | return ret; \ | ||
465 | } \ | ||
466 | \ | ||
467 | static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | ||
468 | { \ | ||
469 | if (atomic_add_negative(-1, &event_call->profile_count)) \ | ||
470 | unregister_trace_##call(ftrace_profile_##call); \ | ||
471 | } | ||
472 | |||
473 | #define _TRACE_PROFILE_INIT(call) \ | ||
474 | .profile_count = ATOMIC_INIT(-1), \ | ||
475 | .profile_enable = ftrace_profile_enable_##call, \ | ||
476 | .profile_disable = ftrace_profile_disable_##call, | ||
477 | |||
478 | #else | ||
479 | #define _TRACE_PROFILE(call, proto, args) | ||
480 | #define _TRACE_PROFILE_INIT(call) | ||
481 | #endif | ||
482 | |||
483 | #undef __entry | ||
484 | #define __entry entry | ||
485 | |||
486 | #undef __field | ||
487 | #define __field(type, item) | ||
488 | |||
489 | #undef __array | ||
490 | #define __array(type, item, len) | ||
491 | |||
492 | #undef __dynamic_array | ||
493 | #define __dynamic_array(type, item, len) \ | ||
494 | __entry->__data_loc_##item = __data_offsets.item; | ||
495 | |||
496 | #undef __string | ||
497 | #define __string(item, src) __dynamic_array(char, item, -1) \ | ||
498 | |||
499 | #undef __assign_str | ||
500 | #define __assign_str(dst, src) \ | ||
501 | strcpy(__get_str(dst), src); | ||
502 | |||
503 | #undef TRACE_EVENT | ||
504 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | ||
505 | _TRACE_PROFILE(call, PARAMS(proto), PARAMS(args)) \ | ||
506 | \ | ||
507 | static struct ftrace_event_call event_##call; \ | ||
508 | \ | ||
509 | static void ftrace_raw_event_##call(proto) \ | ||
510 | { \ | ||
511 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | ||
512 | struct ftrace_event_call *event_call = &event_##call; \ | ||
513 | struct ring_buffer_event *event; \ | ||
514 | struct ftrace_raw_##call *entry; \ | ||
515 | unsigned long irq_flags; \ | ||
516 | int __data_size; \ | ||
517 | int pc; \ | ||
518 | \ | ||
519 | local_save_flags(irq_flags); \ | ||
520 | pc = preempt_count(); \ | ||
521 | \ | ||
522 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ | ||
523 | \ | ||
524 | event = trace_current_buffer_lock_reserve(event_##call.id, \ | ||
525 | sizeof(*entry) + __data_size, \ | ||
526 | irq_flags, pc); \ | ||
527 | if (!event) \ | ||
528 | return; \ | ||
529 | entry = ring_buffer_event_data(event); \ | ||
530 | \ | ||
531 | \ | ||
532 | tstruct \ | ||
533 | \ | ||
534 | { assign; } \ | ||
535 | \ | ||
536 | if (!filter_current_check_discard(event_call, entry, event)) \ | ||
537 | trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \ | ||
538 | } \ | ||
539 | \ | ||
540 | static int ftrace_raw_reg_event_##call(void) \ | ||
541 | { \ | ||
542 | int ret; \ | ||
543 | \ | ||
544 | ret = register_trace_##call(ftrace_raw_event_##call); \ | ||
545 | if (ret) \ | ||
546 | pr_info("event trace: Could not activate trace point " \ | ||
547 | "probe to " #call "\n"); \ | ||
548 | return ret; \ | ||
549 | } \ | ||
550 | \ | ||
551 | static void ftrace_raw_unreg_event_##call(void) \ | ||
552 | { \ | ||
553 | unregister_trace_##call(ftrace_raw_event_##call); \ | ||
554 | } \ | ||
555 | \ | ||
556 | static struct trace_event ftrace_event_type_##call = { \ | ||
557 | .trace = ftrace_raw_output_##call, \ | ||
558 | }; \ | ||
559 | \ | ||
560 | static int ftrace_raw_init_event_##call(void) \ | ||
561 | { \ | ||
562 | int id; \ | ||
563 | \ | ||
564 | id = register_ftrace_event(&ftrace_event_type_##call); \ | ||
565 | if (!id) \ | ||
566 | return -ENODEV; \ | ||
567 | event_##call.id = id; \ | ||
568 | INIT_LIST_HEAD(&event_##call.fields); \ | ||
569 | init_preds(&event_##call); \ | ||
570 | return 0; \ | ||
571 | } \ | ||
572 | \ | ||
573 | static struct ftrace_event_call __used \ | ||
574 | __attribute__((__aligned__(4))) \ | ||
575 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
576 | .name = #call, \ | ||
577 | .system = __stringify(TRACE_SYSTEM), \ | ||
578 | .event = &ftrace_event_type_##call, \ | ||
579 | .raw_init = ftrace_raw_init_event_##call, \ | ||
580 | .regfunc = ftrace_raw_reg_event_##call, \ | ||
581 | .unregfunc = ftrace_raw_unreg_event_##call, \ | ||
582 | .show_format = ftrace_format_##call, \ | ||
583 | .define_fields = ftrace_define_fields_##call, \ | ||
584 | _TRACE_PROFILE_INIT(call) \ | ||
585 | } | ||
586 | |||
587 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
588 | |||
589 | #undef _TRACE_PROFILE | ||
590 | #undef _TRACE_PROFILE_INIT | ||
591 | |||
diff --git a/include/trace/irq.h b/include/trace/irq.h deleted file mode 100644 index ff5d4495dc37..000000000000 --- a/include/trace/irq.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef _TRACE_IRQ_H | ||
2 | #define _TRACE_IRQ_H | ||
3 | |||
4 | #include <linux/interrupt.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | #include <trace/irq_event_types.h> | ||
8 | |||
9 | #endif | ||
diff --git a/include/trace/irq_event_types.h b/include/trace/irq_event_types.h deleted file mode 100644 index 85964ebd47ec..000000000000 --- a/include/trace/irq_event_types.h +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | |||
2 | /* use <trace/irq.h> instead */ | ||
3 | #ifndef TRACE_FORMAT | ||
4 | # error Do not include this file directly. | ||
5 | # error Unless you know what you are doing. | ||
6 | #endif | ||
7 | |||
8 | #undef TRACE_SYSTEM | ||
9 | #define TRACE_SYSTEM irq | ||
10 | |||
11 | /* | ||
12 | * Tracepoint for entry of interrupt handler: | ||
13 | */ | ||
14 | TRACE_FORMAT(irq_handler_entry, | ||
15 | TP_PROTO(int irq, struct irqaction *action), | ||
16 | TP_ARGS(irq, action), | ||
17 | TP_FMT("irq=%d handler=%s", irq, action->name) | ||
18 | ); | ||
19 | |||
20 | /* | ||
21 | * Tracepoint for return of an interrupt handler: | ||
22 | */ | ||
23 | TRACE_EVENT(irq_handler_exit, | ||
24 | |||
25 | TP_PROTO(int irq, struct irqaction *action, int ret), | ||
26 | |||
27 | TP_ARGS(irq, action, ret), | ||
28 | |||
29 | TP_STRUCT__entry( | ||
30 | __field( int, irq ) | ||
31 | __field( int, ret ) | ||
32 | ), | ||
33 | |||
34 | TP_fast_assign( | ||
35 | __entry->irq = irq; | ||
36 | __entry->ret = ret; | ||
37 | ), | ||
38 | |||
39 | TP_printk("irq=%d return=%s", | ||
40 | __entry->irq, __entry->ret ? "handled" : "unhandled") | ||
41 | ); | ||
42 | |||
43 | TRACE_FORMAT(softirq_entry, | ||
44 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | ||
45 | TP_ARGS(h, vec), | ||
46 | TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec]) | ||
47 | ); | ||
48 | |||
49 | TRACE_FORMAT(softirq_exit, | ||
50 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | ||
51 | TP_ARGS(h, vec), | ||
52 | TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec]) | ||
53 | ); | ||
54 | |||
55 | #undef TRACE_SYSTEM | ||
diff --git a/include/trace/kmemtrace.h b/include/trace/kmemtrace.h deleted file mode 100644 index 28ee69f9cd46..000000000000 --- a/include/trace/kmemtrace.h +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 Eduard - Gabriel Munteanu | ||
3 | * | ||
4 | * This file is released under GPL version 2. | ||
5 | */ | ||
6 | |||
7 | #ifndef _LINUX_KMEMTRACE_H | ||
8 | #define _LINUX_KMEMTRACE_H | ||
9 | |||
10 | #ifdef __KERNEL__ | ||
11 | |||
12 | #include <linux/tracepoint.h> | ||
13 | #include <linux/types.h> | ||
14 | |||
15 | #ifdef CONFIG_KMEMTRACE | ||
16 | extern void kmemtrace_init(void); | ||
17 | #else | ||
18 | static inline void kmemtrace_init(void) | ||
19 | { | ||
20 | } | ||
21 | #endif | ||
22 | |||
23 | DECLARE_TRACE(kmalloc, | ||
24 | TP_PROTO(unsigned long call_site, | ||
25 | const void *ptr, | ||
26 | size_t bytes_req, | ||
27 | size_t bytes_alloc, | ||
28 | gfp_t gfp_flags), | ||
29 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags)); | ||
30 | DECLARE_TRACE(kmem_cache_alloc, | ||
31 | TP_PROTO(unsigned long call_site, | ||
32 | const void *ptr, | ||
33 | size_t bytes_req, | ||
34 | size_t bytes_alloc, | ||
35 | gfp_t gfp_flags), | ||
36 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags)); | ||
37 | DECLARE_TRACE(kmalloc_node, | ||
38 | TP_PROTO(unsigned long call_site, | ||
39 | const void *ptr, | ||
40 | size_t bytes_req, | ||
41 | size_t bytes_alloc, | ||
42 | gfp_t gfp_flags, | ||
43 | int node), | ||
44 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node)); | ||
45 | DECLARE_TRACE(kmem_cache_alloc_node, | ||
46 | TP_PROTO(unsigned long call_site, | ||
47 | const void *ptr, | ||
48 | size_t bytes_req, | ||
49 | size_t bytes_alloc, | ||
50 | gfp_t gfp_flags, | ||
51 | int node), | ||
52 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node)); | ||
53 | DECLARE_TRACE(kfree, | ||
54 | TP_PROTO(unsigned long call_site, const void *ptr), | ||
55 | TP_ARGS(call_site, ptr)); | ||
56 | DECLARE_TRACE(kmem_cache_free, | ||
57 | TP_PROTO(unsigned long call_site, const void *ptr), | ||
58 | TP_ARGS(call_site, ptr)); | ||
59 | |||
60 | #endif /* __KERNEL__ */ | ||
61 | |||
62 | #endif /* _LINUX_KMEMTRACE_H */ | ||
63 | |||
diff --git a/include/trace/lockdep.h b/include/trace/lockdep.h deleted file mode 100644 index 5ca67df87f2a..000000000000 --- a/include/trace/lockdep.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef _TRACE_LOCKDEP_H | ||
2 | #define _TRACE_LOCKDEP_H | ||
3 | |||
4 | #include <linux/lockdep.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | #include <trace/lockdep_event_types.h> | ||
8 | |||
9 | #endif | ||
diff --git a/include/trace/lockdep_event_types.h b/include/trace/lockdep_event_types.h deleted file mode 100644 index adccfcd2ec8f..000000000000 --- a/include/trace/lockdep_event_types.h +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | |||
2 | #ifndef TRACE_FORMAT | ||
3 | # error Do not include this file directly. | ||
4 | # error Unless you know what you are doing. | ||
5 | #endif | ||
6 | |||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM lock | ||
9 | |||
10 | #ifdef CONFIG_LOCKDEP | ||
11 | |||
12 | TRACE_FORMAT(lock_acquire, | ||
13 | TP_PROTO(struct lockdep_map *lock, unsigned int subclass, | ||
14 | int trylock, int read, int check, | ||
15 | struct lockdep_map *next_lock, unsigned long ip), | ||
16 | TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip), | ||
17 | TP_FMT("%s%s%s", trylock ? "try " : "", | ||
18 | read ? "read " : "", lock->name) | ||
19 | ); | ||
20 | |||
21 | TRACE_FORMAT(lock_release, | ||
22 | TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip), | ||
23 | TP_ARGS(lock, nested, ip), | ||
24 | TP_FMT("%s", lock->name) | ||
25 | ); | ||
26 | |||
27 | #ifdef CONFIG_LOCK_STAT | ||
28 | |||
29 | TRACE_FORMAT(lock_contended, | ||
30 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), | ||
31 | TP_ARGS(lock, ip), | ||
32 | TP_FMT("%s", lock->name) | ||
33 | ); | ||
34 | |||
35 | TRACE_FORMAT(lock_acquired, | ||
36 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), | ||
37 | TP_ARGS(lock, ip), | ||
38 | TP_FMT("%s", lock->name) | ||
39 | ); | ||
40 | |||
41 | #endif | ||
42 | #endif | ||
43 | |||
44 | #undef TRACE_SYSTEM | ||
diff --git a/include/trace/sched.h b/include/trace/sched.h deleted file mode 100644 index 4e372a1a29bf..000000000000 --- a/include/trace/sched.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef _TRACE_SCHED_H | ||
2 | #define _TRACE_SCHED_H | ||
3 | |||
4 | #include <linux/sched.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | #include <trace/sched_event_types.h> | ||
8 | |||
9 | #endif | ||
diff --git a/include/trace/skb.h b/include/trace/skb.h deleted file mode 100644 index b66206d9be72..000000000000 --- a/include/trace/skb.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | #ifndef _TRACE_SKB_H_ | ||
2 | #define _TRACE_SKB_H_ | ||
3 | |||
4 | #include <linux/skbuff.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | DECLARE_TRACE(kfree_skb, | ||
8 | TP_PROTO(struct sk_buff *skb, void *location), | ||
9 | TP_ARGS(skb, location)); | ||
10 | |||
11 | #endif | ||
diff --git a/include/trace/trace_event_types.h b/include/trace/trace_event_types.h deleted file mode 100644 index df56f5694be6..000000000000 --- a/include/trace/trace_event_types.h +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | /* trace/<type>_event_types.h here */ | ||
2 | |||
3 | #include <trace/sched_event_types.h> | ||
4 | #include <trace/irq_event_types.h> | ||
5 | #include <trace/lockdep_event_types.h> | ||
diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h deleted file mode 100644 index fd13750ca4ba..000000000000 --- a/include/trace/trace_events.h +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | /* trace/<type>.h here */ | ||
2 | |||
3 | #include <trace/sched.h> | ||
4 | #include <trace/irq.h> | ||
5 | #include <trace/lockdep.h> | ||
diff --git a/include/trace/workqueue.h b/include/trace/workqueue.h deleted file mode 100644 index 7626523deeba..000000000000 --- a/include/trace/workqueue.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #ifndef __TRACE_WORKQUEUE_H | ||
2 | #define __TRACE_WORKQUEUE_H | ||
3 | |||
4 | #include <linux/tracepoint.h> | ||
5 | #include <linux/workqueue.h> | ||
6 | #include <linux/sched.h> | ||
7 | |||
8 | DECLARE_TRACE(workqueue_insertion, | ||
9 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | ||
10 | TP_ARGS(wq_thread, work)); | ||
11 | |||
12 | DECLARE_TRACE(workqueue_execution, | ||
13 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | ||
14 | TP_ARGS(wq_thread, work)); | ||
15 | |||
16 | /* Trace the creation of one workqueue thread on a cpu */ | ||
17 | DECLARE_TRACE(workqueue_creation, | ||
18 | TP_PROTO(struct task_struct *wq_thread, int cpu), | ||
19 | TP_ARGS(wq_thread, cpu)); | ||
20 | |||
21 | DECLARE_TRACE(workqueue_destruction, | ||
22 | TP_PROTO(struct task_struct *wq_thread), | ||
23 | TP_ARGS(wq_thread)); | ||
24 | |||
25 | #endif /* __TRACE_WORKQUEUE_H */ | ||
diff --git a/include/xen/Kbuild b/include/xen/Kbuild new file mode 100644 index 000000000000..4e65c16a445b --- /dev/null +++ b/include/xen/Kbuild | |||
@@ -0,0 +1 @@ | |||
header-y += evtchn.h | |||
diff --git a/include/xen/events.h b/include/xen/events.h index 0d5f1adc0363..e68d59a90ca8 100644 --- a/include/xen/events.h +++ b/include/xen/events.h | |||
@@ -53,4 +53,7 @@ bool xen_test_irq_pending(int irq); | |||
53 | irq will be disabled so it won't deliver an interrupt. */ | 53 | irq will be disabled so it won't deliver an interrupt. */ |
54 | void xen_poll_irq(int irq); | 54 | void xen_poll_irq(int irq); |
55 | 55 | ||
56 | /* Determine the IRQ which is bound to an event channel */ | ||
57 | unsigned irq_from_evtchn(unsigned int evtchn); | ||
58 | |||
56 | #endif /* _XEN_EVENTS_H */ | 59 | #endif /* _XEN_EVENTS_H */ |
diff --git a/include/xen/evtchn.h b/include/xen/evtchn.h new file mode 100644 index 000000000000..14e833ee4e0b --- /dev/null +++ b/include/xen/evtchn.h | |||
@@ -0,0 +1,88 @@ | |||
1 | /****************************************************************************** | ||
2 | * evtchn.h | ||
3 | * | ||
4 | * Interface to /dev/xen/evtchn. | ||
5 | * | ||
6 | * Copyright (c) 2003-2005, K A Fraser | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License version 2 | ||
10 | * as published by the Free Software Foundation; or, when distributed | ||
11 | * separately from the Linux kernel or incorporated into other | ||
12 | * software packages, subject to the following license: | ||
13 | * | ||
14 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
15 | * of this source file (the "Software"), to deal in the Software without | ||
16 | * restriction, including without limitation the rights to use, copy, modify, | ||
17 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
18 | * and to permit persons to whom the Software is furnished to do so, subject to | ||
19 | * the following conditions: | ||
20 | * | ||
21 | * The above copyright notice and this permission notice shall be included in | ||
22 | * all copies or substantial portions of the Software. | ||
23 | * | ||
24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
30 | * IN THE SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef __LINUX_PUBLIC_EVTCHN_H__ | ||
34 | #define __LINUX_PUBLIC_EVTCHN_H__ | ||
35 | |||
36 | /* | ||
37 | * Bind a fresh port to VIRQ @virq. | ||
38 | * Return allocated port. | ||
39 | */ | ||
40 | #define IOCTL_EVTCHN_BIND_VIRQ \ | ||
41 | _IOC(_IOC_NONE, 'E', 0, sizeof(struct ioctl_evtchn_bind_virq)) | ||
42 | struct ioctl_evtchn_bind_virq { | ||
43 | unsigned int virq; | ||
44 | }; | ||
45 | |||
46 | /* | ||
47 | * Bind a fresh port to remote <@remote_domain, @remote_port>. | ||
48 | * Return allocated port. | ||
49 | */ | ||
50 | #define IOCTL_EVTCHN_BIND_INTERDOMAIN \ | ||
51 | _IOC(_IOC_NONE, 'E', 1, sizeof(struct ioctl_evtchn_bind_interdomain)) | ||
52 | struct ioctl_evtchn_bind_interdomain { | ||
53 | unsigned int remote_domain, remote_port; | ||
54 | }; | ||
55 | |||
56 | /* | ||
57 | * Allocate a fresh port for binding to @remote_domain. | ||
58 | * Return allocated port. | ||
59 | */ | ||
60 | #define IOCTL_EVTCHN_BIND_UNBOUND_PORT \ | ||
61 | _IOC(_IOC_NONE, 'E', 2, sizeof(struct ioctl_evtchn_bind_unbound_port)) | ||
62 | struct ioctl_evtchn_bind_unbound_port { | ||
63 | unsigned int remote_domain; | ||
64 | }; | ||
65 | |||
66 | /* | ||
67 | * Unbind previously allocated @port. | ||
68 | */ | ||
69 | #define IOCTL_EVTCHN_UNBIND \ | ||
70 | _IOC(_IOC_NONE, 'E', 3, sizeof(struct ioctl_evtchn_unbind)) | ||
71 | struct ioctl_evtchn_unbind { | ||
72 | unsigned int port; | ||
73 | }; | ||
74 | |||
75 | /* | ||
76 | * Unbind previously allocated @port. | ||
77 | */ | ||
78 | #define IOCTL_EVTCHN_NOTIFY \ | ||
79 | _IOC(_IOC_NONE, 'E', 4, sizeof(struct ioctl_evtchn_notify)) | ||
80 | struct ioctl_evtchn_notify { | ||
81 | unsigned int port; | ||
82 | }; | ||
83 | |||
84 | /* Clear and reinitialise the event buffer. Clear error condition. */ | ||
85 | #define IOCTL_EVTCHN_RESET \ | ||
86 | _IOC(_IOC_NONE, 'E', 5, 0) | ||
87 | |||
88 | #endif /* __LINUX_PUBLIC_EVTCHN_H__ */ | ||
diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h index 453235e923f0..e8b6519d47e9 100644 --- a/include/xen/interface/version.h +++ b/include/xen/interface/version.h | |||
@@ -57,4 +57,7 @@ struct xen_feature_info { | |||
57 | /* Declares the features reported by XENVER_get_features. */ | 57 | /* Declares the features reported by XENVER_get_features. */ |
58 | #include "features.h" | 58 | #include "features.h" |
59 | 59 | ||
60 | /* arg == NULL; returns host memory page size. */ | ||
61 | #define XENVER_pagesize 7 | ||
62 | |||
60 | #endif /* __XEN_PUBLIC_VERSION_H__ */ | 63 | #endif /* __XEN_PUBLIC_VERSION_H__ */ |
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h index f87f9614844d..b9763badbd77 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h | |||
@@ -91,8 +91,7 @@ struct xenbus_driver { | |||
91 | void (*otherend_changed)(struct xenbus_device *dev, | 91 | void (*otherend_changed)(struct xenbus_device *dev, |
92 | enum xenbus_state backend_state); | 92 | enum xenbus_state backend_state); |
93 | int (*remove)(struct xenbus_device *dev); | 93 | int (*remove)(struct xenbus_device *dev); |
94 | int (*suspend)(struct xenbus_device *dev); | 94 | int (*suspend)(struct xenbus_device *dev, pm_message_t state); |
95 | int (*suspend_cancel)(struct xenbus_device *dev); | ||
96 | int (*resume)(struct xenbus_device *dev); | 95 | int (*resume)(struct xenbus_device *dev); |
97 | int (*uevent)(struct xenbus_device *, char **, int, char *, int); | 96 | int (*uevent)(struct xenbus_device *, char **, int, char *, int); |
98 | struct device_driver driver; | 97 | struct device_driver driver; |