aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/s390/kvm/trace-s390.h7
-rw-r--r--drivers/gpu/drm/drm_trace.h1
-rw-r--r--drivers/gpu/drm/i915/i915_trace.h1
-rw-r--r--drivers/gpu/drm/radeon/radeon_trace.h1
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_brcmsmac.h102
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_brcmsmac_msg.h88
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_brcmsmac_tx.h110
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_events.h225
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-devtrace-data.h79
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-devtrace-io.h155
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h200
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h97
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h81
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-devtrace.h438
-rw-r--r--drivers/usb/host/xhci-trace.h7
-rw-r--r--include/asm-generic/vmlinux.lds.h5
-rw-r--r--include/linux/ftrace_event.h4
-rw-r--r--include/linux/module.h2
-rw-r--r--include/linux/tracepoint.h8
-rw-r--r--include/trace/events/9p.h157
-rw-r--r--include/trace/events/btrfs.h4
-rw-r--r--include/trace/events/ext3.h2
-rw-r--r--include/trace/events/ext4.h6
-rw-r--r--include/trace/events/f2fs.h30
-rw-r--r--include/trace/events/intel-sst.h7
-rw-r--r--include/trace/events/irq.h39
-rw-r--r--include/trace/events/migrate.h42
-rw-r--r--include/trace/events/module.h4
-rw-r--r--include/trace/events/random.h10
-rw-r--r--include/trace/events/sunrpc.h62
-rw-r--r--include/trace/events/tlb.h30
-rw-r--r--include/trace/events/v4l2.h75
-rw-r--r--include/trace/events/writeback.h33
-rw-r--r--include/trace/ftrace.h41
-rw-r--r--kernel/module.c3
-rw-r--r--kernel/trace/Kconfig28
-rw-r--r--kernel/trace/ftrace.c22
-rw-r--r--kernel/trace/ring_buffer.c10
-rw-r--r--kernel/trace/trace.c304
-rw-r--r--kernel/trace/trace.h2
-rw-r--r--kernel/trace/trace_entries.h6
-rw-r--r--kernel/trace/trace_events.c121
-rw-r--r--kernel/trace/trace_export.c2
-rw-r--r--kernel/trace/trace_kprobe.c5
-rw-r--r--kernel/trace/trace_probe.c19
-rw-r--r--kernel/trace/trace_probe.h10
-rw-r--r--kernel/trace/trace_uprobe.c5
-rw-r--r--net/mac80211/trace.c1
-rw-r--r--net/mac80211/trace.h38
-rw-r--r--net/mac80211/trace_msg.h53
-rw-r--r--samples/trace_events/trace-events-sample.h84
-rw-r--r--tools/lib/traceevent/event-parse.c2
52 files changed, 1959 insertions, 909 deletions
diff --git a/arch/s390/kvm/trace-s390.h b/arch/s390/kvm/trace-s390.h
index 653a7ec09ef5..3208d33a48cb 100644
--- a/arch/s390/kvm/trace-s390.h
+++ b/arch/s390/kvm/trace-s390.h
@@ -10,6 +10,13 @@
10#define TRACE_INCLUDE_FILE trace-s390 10#define TRACE_INCLUDE_FILE trace-s390
11 11
12/* 12/*
13 * The TRACE_SYSTEM_VAR defaults to TRACE_SYSTEM, but must be a
14 * legitimate C variable. It is not exported to user space.
15 */
16#undef TRACE_SYSTEM_VAR
17#define TRACE_SYSTEM_VAR kvm_s390
18
19/*
13 * Trace point for the creation of the kvm instance. 20 * Trace point for the creation of the kvm instance.
14 */ 21 */
15TRACE_EVENT(kvm_s390_create_vm, 22TRACE_EVENT(kvm_s390_create_vm,
diff --git a/drivers/gpu/drm/drm_trace.h b/drivers/gpu/drm/drm_trace.h
index 27cc95f36381..ce3c42813fbb 100644
--- a/drivers/gpu/drm/drm_trace.h
+++ b/drivers/gpu/drm/drm_trace.h
@@ -7,7 +7,6 @@
7 7
8#undef TRACE_SYSTEM 8#undef TRACE_SYSTEM
9#define TRACE_SYSTEM drm 9#define TRACE_SYSTEM drm
10#define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM)
11#define TRACE_INCLUDE_FILE drm_trace 10#define TRACE_INCLUDE_FILE drm_trace
12 11
13TRACE_EVENT(drm_vblank_event, 12TRACE_EVENT(drm_vblank_event,
diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
index 6058a01b4443..d776621c8521 100644
--- a/drivers/gpu/drm/i915/i915_trace.h
+++ b/drivers/gpu/drm/i915/i915_trace.h
@@ -12,7 +12,6 @@
12 12
13#undef TRACE_SYSTEM 13#undef TRACE_SYSTEM
14#define TRACE_SYSTEM i915 14#define TRACE_SYSTEM i915
15#define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM)
16#define TRACE_INCLUDE_FILE i915_trace 15#define TRACE_INCLUDE_FILE i915_trace
17 16
18/* pipe updates */ 17/* pipe updates */
diff --git a/drivers/gpu/drm/radeon/radeon_trace.h b/drivers/gpu/drm/radeon/radeon_trace.h
index ce075cb08cb2..fdce4062901f 100644
--- a/drivers/gpu/drm/radeon/radeon_trace.h
+++ b/drivers/gpu/drm/radeon/radeon_trace.h
@@ -9,7 +9,6 @@
9 9
10#undef TRACE_SYSTEM 10#undef TRACE_SYSTEM
11#define TRACE_SYSTEM radeon 11#define TRACE_SYSTEM radeon
12#define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM)
13#define TRACE_INCLUDE_FILE radeon_trace 12#define TRACE_INCLUDE_FILE radeon_trace
14 13
15TRACE_EVENT(radeon_bo_create, 14TRACE_EVENT(radeon_bo_create,
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_brcmsmac.h b/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_brcmsmac.h
new file mode 100644
index 000000000000..a0da3248b942
--- /dev/null
+++ b/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_brcmsmac.h
@@ -0,0 +1,102 @@
1/*
2 * Copyright (c) 2011 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#if !defined(__TRACE_BRCMSMAC_H) || defined(TRACE_HEADER_MULTI_READ)
18#define __TRACE_BRCMSMAC_H
19
20#include <linux/tracepoint.h>
21
22#undef TRACE_SYSTEM
23#define TRACE_SYSTEM brcmsmac
24
25/*
26 * We define a tracepoint, its arguments, its printk format and its
27 * 'fast binary record' layout.
28 */
29TRACE_EVENT(brcms_timer,
30 /* TPPROTO is the prototype of the function called by this tracepoint */
31 TP_PROTO(struct brcms_timer *t),
32 /*
33 * TPARGS(firstarg, p) are the parameters names, same as found in the
34 * prototype.
35 */
36 TP_ARGS(t),
37 /*
38 * Fast binary tracing: define the trace record via TP_STRUCT__entry().
39 * You can think about it like a regular C structure local variable
40 * definition.
41 */
42 TP_STRUCT__entry(
43 __field(uint, ms)
44 __field(uint, set)
45 __field(uint, periodic)
46 ),
47 TP_fast_assign(
48 __entry->ms = t->ms;
49 __entry->set = t->set;
50 __entry->periodic = t->periodic;
51 ),
52 TP_printk(
53 "ms=%u set=%u periodic=%u",
54 __entry->ms, __entry->set, __entry->periodic
55 )
56);
57
58TRACE_EVENT(brcms_dpc,
59 TP_PROTO(unsigned long data),
60 TP_ARGS(data),
61 TP_STRUCT__entry(
62 __field(unsigned long, data)
63 ),
64 TP_fast_assign(
65 __entry->data = data;
66 ),
67 TP_printk(
68 "data=%p",
69 (void *)__entry->data
70 )
71);
72
73TRACE_EVENT(brcms_macintstatus,
74 TP_PROTO(const struct device *dev, int in_isr, u32 macintstatus,
75 u32 mask),
76 TP_ARGS(dev, in_isr, macintstatus, mask),
77 TP_STRUCT__entry(
78 __string(dev, dev_name(dev))
79 __field(int, in_isr)
80 __field(u32, macintstatus)
81 __field(u32, mask)
82 ),
83 TP_fast_assign(
84 __assign_str(dev, dev_name(dev));
85 __entry->in_isr = in_isr;
86 __entry->macintstatus = macintstatus;
87 __entry->mask = mask;
88 ),
89 TP_printk("[%s] in_isr=%d macintstatus=%#x mask=%#x", __get_str(dev),
90 __entry->in_isr, __entry->macintstatus, __entry->mask)
91);
92#endif /* __TRACE_BRCMSMAC_H */
93
94#ifdef CONFIG_BRCM_TRACING
95
96#undef TRACE_INCLUDE_PATH
97#define TRACE_INCLUDE_PATH .
98#undef TRACE_INCLUDE_FILE
99#define TRACE_INCLUDE_FILE brcms_trace_brcmsmac
100#include <trace/define_trace.h>
101
102#endif /* CONFIG_BRCM_TRACING */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_brcmsmac_msg.h b/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_brcmsmac_msg.h
new file mode 100644
index 000000000000..0e8a69ab909f
--- /dev/null
+++ b/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_brcmsmac_msg.h
@@ -0,0 +1,88 @@
1/*
2 * Copyright (c) 2011 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#if !defined(__TRACE_BRCMSMAC_MSG_H) || defined(TRACE_HEADER_MULTI_READ)
18#define __TRACE_BRCMSMAC_MSG_H
19
20#include <linux/tracepoint.h>
21
22#undef TRACE_SYSTEM
23#define TRACE_SYSTEM brcmsmac_msg
24
25#define MAX_MSG_LEN 100
26
27DECLARE_EVENT_CLASS(brcms_msg_event,
28 TP_PROTO(struct va_format *vaf),
29 TP_ARGS(vaf),
30 TP_STRUCT__entry(
31 __dynamic_array(char, msg, MAX_MSG_LEN)
32 ),
33 TP_fast_assign(
34 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
35 MAX_MSG_LEN, vaf->fmt,
36 *vaf->va) >= MAX_MSG_LEN);
37 ),
38 TP_printk("%s", __get_str(msg))
39);
40
41DEFINE_EVENT(brcms_msg_event, brcms_info,
42 TP_PROTO(struct va_format *vaf),
43 TP_ARGS(vaf)
44);
45
46DEFINE_EVENT(brcms_msg_event, brcms_warn,
47 TP_PROTO(struct va_format *vaf),
48 TP_ARGS(vaf)
49);
50
51DEFINE_EVENT(brcms_msg_event, brcms_err,
52 TP_PROTO(struct va_format *vaf),
53 TP_ARGS(vaf)
54);
55
56DEFINE_EVENT(brcms_msg_event, brcms_crit,
57 TP_PROTO(struct va_format *vaf),
58 TP_ARGS(vaf)
59);
60
61TRACE_EVENT(brcms_dbg,
62 TP_PROTO(u32 level, const char *func, struct va_format *vaf),
63 TP_ARGS(level, func, vaf),
64 TP_STRUCT__entry(
65 __field(u32, level)
66 __string(func, func)
67 __dynamic_array(char, msg, MAX_MSG_LEN)
68 ),
69 TP_fast_assign(
70 __entry->level = level;
71 __assign_str(func, func);
72 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
73 MAX_MSG_LEN, vaf->fmt,
74 *vaf->va) >= MAX_MSG_LEN);
75 ),
76 TP_printk("%s: %s", __get_str(func), __get_str(msg))
77);
78#endif /* __TRACE_BRCMSMAC_MSG_H */
79
80#ifdef CONFIG_BRCM_TRACING
81
82#undef TRACE_INCLUDE_PATH
83#define TRACE_INCLUDE_PATH .
84#undef TRACE_INCLUDE_FILE
85#define TRACE_INCLUDE_FILE brcms_trace_brcmsmac_msg
86#include <trace/define_trace.h>
87
88#endif /* CONFIG_BRCM_TRACING */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_brcmsmac_tx.h b/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_brcmsmac_tx.h
new file mode 100644
index 000000000000..cf2cc070f1e5
--- /dev/null
+++ b/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_brcmsmac_tx.h
@@ -0,0 +1,110 @@
1/*
2 * Copyright (c) 2011 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#if !defined(__TRACE_BRCMSMAC_TX_H) || defined(TRACE_HEADER_MULTI_READ)
18#define __TRACE_BRCMSMAC_TX_H
19
20#include <linux/tracepoint.h>
21
22#undef TRACE_SYSTEM
23#define TRACE_SYSTEM brcmsmac_tx
24
25TRACE_EVENT(brcms_txdesc,
26 TP_PROTO(const struct device *dev,
27 void *txh, size_t txh_len),
28 TP_ARGS(dev, txh, txh_len),
29 TP_STRUCT__entry(
30 __string(dev, dev_name(dev))
31 __dynamic_array(u8, txh, txh_len)
32 ),
33 TP_fast_assign(
34 __assign_str(dev, dev_name(dev));
35 memcpy(__get_dynamic_array(txh), txh, txh_len);
36 ),
37 TP_printk("[%s] txdesc", __get_str(dev))
38);
39
40TRACE_EVENT(brcms_txstatus,
41 TP_PROTO(const struct device *dev, u16 framelen, u16 frameid,
42 u16 status, u16 lasttxtime, u16 sequence, u16 phyerr,
43 u16 ackphyrxsh),
44 TP_ARGS(dev, framelen, frameid, status, lasttxtime, sequence, phyerr,
45 ackphyrxsh),
46 TP_STRUCT__entry(
47 __string(dev, dev_name(dev))
48 __field(u16, framelen)
49 __field(u16, frameid)
50 __field(u16, status)
51 __field(u16, lasttxtime)
52 __field(u16, sequence)
53 __field(u16, phyerr)
54 __field(u16, ackphyrxsh)
55 ),
56 TP_fast_assign(
57 __assign_str(dev, dev_name(dev));
58 __entry->framelen = framelen;
59 __entry->frameid = frameid;
60 __entry->status = status;
61 __entry->lasttxtime = lasttxtime;
62 __entry->sequence = sequence;
63 __entry->phyerr = phyerr;
64 __entry->ackphyrxsh = ackphyrxsh;
65 ),
66 TP_printk("[%s] FrameId %#04x TxStatus %#04x LastTxTime %#04x "
67 "Seq %#04x PHYTxStatus %#04x RxAck %#04x",
68 __get_str(dev), __entry->frameid, __entry->status,
69 __entry->lasttxtime, __entry->sequence, __entry->phyerr,
70 __entry->ackphyrxsh)
71);
72
73TRACE_EVENT(brcms_ampdu_session,
74 TP_PROTO(const struct device *dev, unsigned max_ampdu_len,
75 u16 max_ampdu_frames, u16 ampdu_len, u16 ampdu_frames,
76 u16 dma_len),
77 TP_ARGS(dev, max_ampdu_len, max_ampdu_frames, ampdu_len, ampdu_frames,
78 dma_len),
79 TP_STRUCT__entry(
80 __string(dev, dev_name(dev))
81 __field(unsigned, max_ampdu_len)
82 __field(u16, max_ampdu_frames)
83 __field(u16, ampdu_len)
84 __field(u16, ampdu_frames)
85 __field(u16, dma_len)
86 ),
87 TP_fast_assign(
88 __assign_str(dev, dev_name(dev));
89 __entry->max_ampdu_len = max_ampdu_len;
90 __entry->max_ampdu_frames = max_ampdu_frames;
91 __entry->ampdu_len = ampdu_len;
92 __entry->ampdu_frames = ampdu_frames;
93 __entry->dma_len = dma_len;
94 ),
95 TP_printk("[%s] ampdu session max_len=%u max_frames=%u len=%u frames=%u dma_len=%u",
96 __get_str(dev), __entry->max_ampdu_len,
97 __entry->max_ampdu_frames, __entry->ampdu_len,
98 __entry->ampdu_frames, __entry->dma_len)
99);
100#endif /* __TRACE_BRCMSMAC_TX_H */
101
102#ifdef CONFIG_BRCM_TRACING
103
104#undef TRACE_INCLUDE_PATH
105#define TRACE_INCLUDE_PATH .
106#undef TRACE_INCLUDE_FILE
107#define TRACE_INCLUDE_FILE brcms_trace_brcmsmac_tx
108#include <trace/define_trace.h>
109
110#endif /* CONFIG_BRCM_TRACING */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_events.h b/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_events.h
index 871781e6a713..cbf2f06436fc 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_events.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_events.h
@@ -14,9 +14,8 @@
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */ 15 */
16 16
17#if !defined(__TRACE_BRCMSMAC_H) || defined(TRACE_HEADER_MULTI_READ) 17#ifndef __BRCMS_TRACE_EVENTS_H
18 18#define __BRCMS_TRACE_EVENTS_H
19#define __TRACE_BRCMSMAC_H
20 19
21#include <linux/types.h> 20#include <linux/types.h>
22#include <linux/device.h> 21#include <linux/device.h>
@@ -34,222 +33,8 @@ static inline void trace_ ## name(proto) {}
34static inline void trace_ ## name(proto) {} 33static inline void trace_ ## name(proto) {}
35#endif 34#endif
36 35
37#undef TRACE_SYSTEM 36#include "brcms_trace_brcmsmac.h"
38#define TRACE_SYSTEM brcmsmac 37#include "brcms_trace_brcmsmac_tx.h"
39 38#include "brcms_trace_brcmsmac_msg.h"
40/*
41 * We define a tracepoint, its arguments, its printk format and its
42 * 'fast binary record' layout.
43 */
44TRACE_EVENT(brcms_timer,
45 /* TPPROTO is the prototype of the function called by this tracepoint */
46 TP_PROTO(struct brcms_timer *t),
47 /*
48 * TPARGS(firstarg, p) are the parameters names, same as found in the
49 * prototype.
50 */
51 TP_ARGS(t),
52 /*
53 * Fast binary tracing: define the trace record via TP_STRUCT__entry().
54 * You can think about it like a regular C structure local variable
55 * definition.
56 */
57 TP_STRUCT__entry(
58 __field(uint, ms)
59 __field(uint, set)
60 __field(uint, periodic)
61 ),
62 TP_fast_assign(
63 __entry->ms = t->ms;
64 __entry->set = t->set;
65 __entry->periodic = t->periodic;
66 ),
67 TP_printk(
68 "ms=%u set=%u periodic=%u",
69 __entry->ms, __entry->set, __entry->periodic
70 )
71);
72
73TRACE_EVENT(brcms_dpc,
74 TP_PROTO(unsigned long data),
75 TP_ARGS(data),
76 TP_STRUCT__entry(
77 __field(unsigned long, data)
78 ),
79 TP_fast_assign(
80 __entry->data = data;
81 ),
82 TP_printk(
83 "data=%p",
84 (void *)__entry->data
85 )
86);
87
88TRACE_EVENT(brcms_macintstatus,
89 TP_PROTO(const struct device *dev, int in_isr, u32 macintstatus,
90 u32 mask),
91 TP_ARGS(dev, in_isr, macintstatus, mask),
92 TP_STRUCT__entry(
93 __string(dev, dev_name(dev))
94 __field(int, in_isr)
95 __field(u32, macintstatus)
96 __field(u32, mask)
97 ),
98 TP_fast_assign(
99 __assign_str(dev, dev_name(dev));
100 __entry->in_isr = in_isr;
101 __entry->macintstatus = macintstatus;
102 __entry->mask = mask;
103 ),
104 TP_printk("[%s] in_isr=%d macintstatus=%#x mask=%#x", __get_str(dev),
105 __entry->in_isr, __entry->macintstatus, __entry->mask)
106);
107
108#undef TRACE_SYSTEM
109#define TRACE_SYSTEM brcmsmac_tx
110
111TRACE_EVENT(brcms_txdesc,
112 TP_PROTO(const struct device *dev,
113 void *txh, size_t txh_len),
114 TP_ARGS(dev, txh, txh_len),
115 TP_STRUCT__entry(
116 __string(dev, dev_name(dev))
117 __dynamic_array(u8, txh, txh_len)
118 ),
119 TP_fast_assign(
120 __assign_str(dev, dev_name(dev));
121 memcpy(__get_dynamic_array(txh), txh, txh_len);
122 ),
123 TP_printk("[%s] txdesc", __get_str(dev))
124);
125
126TRACE_EVENT(brcms_txstatus,
127 TP_PROTO(const struct device *dev, u16 framelen, u16 frameid,
128 u16 status, u16 lasttxtime, u16 sequence, u16 phyerr,
129 u16 ackphyrxsh),
130 TP_ARGS(dev, framelen, frameid, status, lasttxtime, sequence, phyerr,
131 ackphyrxsh),
132 TP_STRUCT__entry(
133 __string(dev, dev_name(dev))
134 __field(u16, framelen)
135 __field(u16, frameid)
136 __field(u16, status)
137 __field(u16, lasttxtime)
138 __field(u16, sequence)
139 __field(u16, phyerr)
140 __field(u16, ackphyrxsh)
141 ),
142 TP_fast_assign(
143 __assign_str(dev, dev_name(dev));
144 __entry->framelen = framelen;
145 __entry->frameid = frameid;
146 __entry->status = status;
147 __entry->lasttxtime = lasttxtime;
148 __entry->sequence = sequence;
149 __entry->phyerr = phyerr;
150 __entry->ackphyrxsh = ackphyrxsh;
151 ),
152 TP_printk("[%s] FrameId %#04x TxStatus %#04x LastTxTime %#04x "
153 "Seq %#04x PHYTxStatus %#04x RxAck %#04x",
154 __get_str(dev), __entry->frameid, __entry->status,
155 __entry->lasttxtime, __entry->sequence, __entry->phyerr,
156 __entry->ackphyrxsh)
157);
158
159TRACE_EVENT(brcms_ampdu_session,
160 TP_PROTO(const struct device *dev, unsigned max_ampdu_len,
161 u16 max_ampdu_frames, u16 ampdu_len, u16 ampdu_frames,
162 u16 dma_len),
163 TP_ARGS(dev, max_ampdu_len, max_ampdu_frames, ampdu_len, ampdu_frames,
164 dma_len),
165 TP_STRUCT__entry(
166 __string(dev, dev_name(dev))
167 __field(unsigned, max_ampdu_len)
168 __field(u16, max_ampdu_frames)
169 __field(u16, ampdu_len)
170 __field(u16, ampdu_frames)
171 __field(u16, dma_len)
172 ),
173 TP_fast_assign(
174 __assign_str(dev, dev_name(dev));
175 __entry->max_ampdu_len = max_ampdu_len;
176 __entry->max_ampdu_frames = max_ampdu_frames;
177 __entry->ampdu_len = ampdu_len;
178 __entry->ampdu_frames = ampdu_frames;
179 __entry->dma_len = dma_len;
180 ),
181 TP_printk("[%s] ampdu session max_len=%u max_frames=%u len=%u frames=%u dma_len=%u",
182 __get_str(dev), __entry->max_ampdu_len,
183 __entry->max_ampdu_frames, __entry->ampdu_len,
184 __entry->ampdu_frames, __entry->dma_len)
185);
186
187#undef TRACE_SYSTEM
188#define TRACE_SYSTEM brcmsmac_msg
189
190#define MAX_MSG_LEN 100
191
192DECLARE_EVENT_CLASS(brcms_msg_event,
193 TP_PROTO(struct va_format *vaf),
194 TP_ARGS(vaf),
195 TP_STRUCT__entry(
196 __dynamic_array(char, msg, MAX_MSG_LEN)
197 ),
198 TP_fast_assign(
199 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
200 MAX_MSG_LEN, vaf->fmt,
201 *vaf->va) >= MAX_MSG_LEN);
202 ),
203 TP_printk("%s", __get_str(msg))
204);
205
206DEFINE_EVENT(brcms_msg_event, brcms_info,
207 TP_PROTO(struct va_format *vaf),
208 TP_ARGS(vaf)
209);
210
211DEFINE_EVENT(brcms_msg_event, brcms_warn,
212 TP_PROTO(struct va_format *vaf),
213 TP_ARGS(vaf)
214);
215
216DEFINE_EVENT(brcms_msg_event, brcms_err,
217 TP_PROTO(struct va_format *vaf),
218 TP_ARGS(vaf)
219);
220
221DEFINE_EVENT(brcms_msg_event, brcms_crit,
222 TP_PROTO(struct va_format *vaf),
223 TP_ARGS(vaf)
224);
225
226TRACE_EVENT(brcms_dbg,
227 TP_PROTO(u32 level, const char *func, struct va_format *vaf),
228 TP_ARGS(level, func, vaf),
229 TP_STRUCT__entry(
230 __field(u32, level)
231 __string(func, func)
232 __dynamic_array(char, msg, MAX_MSG_LEN)
233 ),
234 TP_fast_assign(
235 __entry->level = level;
236 __assign_str(func, func);
237 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
238 MAX_MSG_LEN, vaf->fmt,
239 *vaf->va) >= MAX_MSG_LEN);
240 ),
241 TP_printk("%s: %s", __get_str(func), __get_str(msg))
242);
243 39
244#endif /* __TRACE_BRCMSMAC_H */ 40#endif /* __TRACE_BRCMSMAC_H */
245
246#ifdef CONFIG_BRCM_TRACING
247
248#undef TRACE_INCLUDE_PATH
249#define TRACE_INCLUDE_PATH .
250#undef TRACE_INCLUDE_FILE
251#define TRACE_INCLUDE_FILE brcms_trace_events
252
253#include <trace/define_trace.h>
254
255#endif /* CONFIG_BRCM_TRACING */
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace-data.h b/drivers/net/wireless/iwlwifi/iwl-devtrace-data.h
new file mode 100644
index 000000000000..04e6649340b8
--- /dev/null
+++ b/drivers/net/wireless/iwlwifi/iwl-devtrace-data.h
@@ -0,0 +1,79 @@
1/******************************************************************************
2 *
3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
20 *
21 * Contact Information:
22 * Intel Linux Wireless <ilw@linux.intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 *****************************************************************************/
26
27#if !defined(__IWLWIFI_DEVICE_TRACE_DATA) || defined(TRACE_HEADER_MULTI_READ)
28#define __IWLWIFI_DEVICE_TRACE_DATA
29
30#include <linux/tracepoint.h>
31
32#undef TRACE_SYSTEM
33#define TRACE_SYSTEM iwlwifi_data
34
35TRACE_EVENT(iwlwifi_dev_tx_data,
36 TP_PROTO(const struct device *dev,
37 struct sk_buff *skb,
38 void *data, size_t data_len),
39 TP_ARGS(dev, skb, data, data_len),
40 TP_STRUCT__entry(
41 DEV_ENTRY
42
43 __dynamic_array(u8, data, iwl_trace_data(skb) ? data_len : 0)
44 ),
45 TP_fast_assign(
46 DEV_ASSIGN;
47 if (iwl_trace_data(skb))
48 memcpy(__get_dynamic_array(data), data, data_len);
49 ),
50 TP_printk("[%s] TX frame data", __get_str(dev))
51);
52
53TRACE_EVENT(iwlwifi_dev_rx_data,
54 TP_PROTO(const struct device *dev,
55 const struct iwl_trans *trans,
56 void *rxbuf, size_t len),
57 TP_ARGS(dev, trans, rxbuf, len),
58 TP_STRUCT__entry(
59 DEV_ENTRY
60
61 __dynamic_array(u8, data,
62 len - iwl_rx_trace_len(trans, rxbuf, len))
63 ),
64 TP_fast_assign(
65 size_t offs = iwl_rx_trace_len(trans, rxbuf, len);
66 DEV_ASSIGN;
67 if (offs < len)
68 memcpy(__get_dynamic_array(data),
69 ((u8 *)rxbuf) + offs, len - offs);
70 ),
71 TP_printk("[%s] RX frame data", __get_str(dev))
72);
73#endif /* __IWLWIFI_DEVICE_TRACE_DATA */
74
75#undef TRACE_INCLUDE_PATH
76#define TRACE_INCLUDE_PATH .
77#undef TRACE_INCLUDE_FILE
78#define TRACE_INCLUDE_FILE iwl-devtrace-data
79#include <trace/define_trace.h>
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace-io.h b/drivers/net/wireless/iwlwifi/iwl-devtrace-io.h
new file mode 100644
index 000000000000..f62c54485852
--- /dev/null
+++ b/drivers/net/wireless/iwlwifi/iwl-devtrace-io.h
@@ -0,0 +1,155 @@
1/******************************************************************************
2 *
3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
20 *
21 * Contact Information:
22 * Intel Linux Wireless <ilw@linux.intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 *****************************************************************************/
26
27#if !defined(__IWLWIFI_DEVICE_TRACE_IO) || defined(TRACE_HEADER_MULTI_READ)
28#define __IWLWIFI_DEVICE_TRACE_IO
29
30#include <linux/tracepoint.h>
31
32#undef TRACE_SYSTEM
33#define TRACE_SYSTEM iwlwifi_io
34
35TRACE_EVENT(iwlwifi_dev_ioread32,
36 TP_PROTO(const struct device *dev, u32 offs, u32 val),
37 TP_ARGS(dev, offs, val),
38 TP_STRUCT__entry(
39 DEV_ENTRY
40 __field(u32, offs)
41 __field(u32, val)
42 ),
43 TP_fast_assign(
44 DEV_ASSIGN;
45 __entry->offs = offs;
46 __entry->val = val;
47 ),
48 TP_printk("[%s] read io[%#x] = %#x",
49 __get_str(dev), __entry->offs, __entry->val)
50);
51
52TRACE_EVENT(iwlwifi_dev_iowrite8,
53 TP_PROTO(const struct device *dev, u32 offs, u8 val),
54 TP_ARGS(dev, offs, val),
55 TP_STRUCT__entry(
56 DEV_ENTRY
57 __field(u32, offs)
58 __field(u8, val)
59 ),
60 TP_fast_assign(
61 DEV_ASSIGN;
62 __entry->offs = offs;
63 __entry->val = val;
64 ),
65 TP_printk("[%s] write io[%#x] = %#x)",
66 __get_str(dev), __entry->offs, __entry->val)
67);
68
69TRACE_EVENT(iwlwifi_dev_iowrite32,
70 TP_PROTO(const struct device *dev, u32 offs, u32 val),
71 TP_ARGS(dev, offs, val),
72 TP_STRUCT__entry(
73 DEV_ENTRY
74 __field(u32, offs)
75 __field(u32, val)
76 ),
77 TP_fast_assign(
78 DEV_ASSIGN;
79 __entry->offs = offs;
80 __entry->val = val;
81 ),
82 TP_printk("[%s] write io[%#x] = %#x)",
83 __get_str(dev), __entry->offs, __entry->val)
84);
85
86TRACE_EVENT(iwlwifi_dev_iowrite_prph32,
87 TP_PROTO(const struct device *dev, u32 offs, u32 val),
88 TP_ARGS(dev, offs, val),
89 TP_STRUCT__entry(
90 DEV_ENTRY
91 __field(u32, offs)
92 __field(u32, val)
93 ),
94 TP_fast_assign(
95 DEV_ASSIGN;
96 __entry->offs = offs;
97 __entry->val = val;
98 ),
99 TP_printk("[%s] write PRPH[%#x] = %#x)",
100 __get_str(dev), __entry->offs, __entry->val)
101);
102
103TRACE_EVENT(iwlwifi_dev_ioread_prph32,
104 TP_PROTO(const struct device *dev, u32 offs, u32 val),
105 TP_ARGS(dev, offs, val),
106 TP_STRUCT__entry(
107 DEV_ENTRY
108 __field(u32, offs)
109 __field(u32, val)
110 ),
111 TP_fast_assign(
112 DEV_ASSIGN;
113 __entry->offs = offs;
114 __entry->val = val;
115 ),
116 TP_printk("[%s] read PRPH[%#x] = %#x",
117 __get_str(dev), __entry->offs, __entry->val)
118);
119
120TRACE_EVENT(iwlwifi_dev_irq,
121 TP_PROTO(const struct device *dev),
122 TP_ARGS(dev),
123 TP_STRUCT__entry(
124 DEV_ENTRY
125 ),
126 TP_fast_assign(
127 DEV_ASSIGN;
128 ),
129 /* TP_printk("") doesn't compile */
130 TP_printk("%d", 0)
131);
132
133TRACE_EVENT(iwlwifi_dev_ict_read,
134 TP_PROTO(const struct device *dev, u32 index, u32 value),
135 TP_ARGS(dev, index, value),
136 TP_STRUCT__entry(
137 DEV_ENTRY
138 __field(u32, index)
139 __field(u32, value)
140 ),
141 TP_fast_assign(
142 DEV_ASSIGN;
143 __entry->index = index;
144 __entry->value = value;
145 ),
146 TP_printk("[%s] read ict[%d] = %#.8x",
147 __get_str(dev), __entry->index, __entry->value)
148);
149#endif /* __IWLWIFI_DEVICE_TRACE_IO */
150
151#undef TRACE_INCLUDE_PATH
152#define TRACE_INCLUDE_PATH .
153#undef TRACE_INCLUDE_FILE
154#define TRACE_INCLUDE_FILE iwl-devtrace-io
155#include <trace/define_trace.h>
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h b/drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h
new file mode 100644
index 000000000000..6cb66a988271
--- /dev/null
+++ b/drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h
@@ -0,0 +1,200 @@
1/******************************************************************************
2 *
3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
20 *
21 * Contact Information:
22 * Intel Linux Wireless <ilw@linux.intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 *****************************************************************************/
26
27#if !defined(__IWLWIFI_DEVICE_TRACE_IWLWIFI) || defined(TRACE_HEADER_MULTI_READ)
28#define __IWLWIFI_DEVICE_TRACE_IWLWIFI
29
30#include <linux/tracepoint.h>
31
32#undef TRACE_SYSTEM
33#define TRACE_SYSTEM iwlwifi
34
35TRACE_EVENT(iwlwifi_dev_hcmd,
36 TP_PROTO(const struct device *dev,
37 struct iwl_host_cmd *cmd, u16 total_size,
38 struct iwl_cmd_header *hdr),
39 TP_ARGS(dev, cmd, total_size, hdr),
40 TP_STRUCT__entry(
41 DEV_ENTRY
42 __dynamic_array(u8, hcmd, total_size)
43 __field(u32, flags)
44 ),
45 TP_fast_assign(
46 int i, offset = sizeof(*hdr);
47
48 DEV_ASSIGN;
49 __entry->flags = cmd->flags;
50 memcpy(__get_dynamic_array(hcmd), hdr, sizeof(*hdr));
51
52 for (i = 0; i < IWL_MAX_CMD_TBS_PER_TFD; i++) {
53 if (!cmd->len[i])
54 continue;
55 memcpy((u8 *)__get_dynamic_array(hcmd) + offset,
56 cmd->data[i], cmd->len[i]);
57 offset += cmd->len[i];
58 }
59 ),
60 TP_printk("[%s] hcmd %#.2x (%ssync)",
61 __get_str(dev), ((u8 *)__get_dynamic_array(hcmd))[0],
62 __entry->flags & CMD_ASYNC ? "a" : "")
63);
64
65TRACE_EVENT(iwlwifi_dev_rx,
66 TP_PROTO(const struct device *dev, const struct iwl_trans *trans,
67 void *rxbuf, size_t len),
68 TP_ARGS(dev, trans, rxbuf, len),
69 TP_STRUCT__entry(
70 DEV_ENTRY
71 __dynamic_array(u8, rxbuf, iwl_rx_trace_len(trans, rxbuf, len))
72 ),
73 TP_fast_assign(
74 DEV_ASSIGN;
75 memcpy(__get_dynamic_array(rxbuf), rxbuf,
76 iwl_rx_trace_len(trans, rxbuf, len));
77 ),
78 TP_printk("[%s] RX cmd %#.2x",
79 __get_str(dev), ((u8 *)__get_dynamic_array(rxbuf))[4])
80);
81
82TRACE_EVENT(iwlwifi_dev_tx,
83 TP_PROTO(const struct device *dev, struct sk_buff *skb,
84 void *tfd, size_t tfdlen,
85 void *buf0, size_t buf0_len,
86 void *buf1, size_t buf1_len),
87 TP_ARGS(dev, skb, tfd, tfdlen, buf0, buf0_len, buf1, buf1_len),
88 TP_STRUCT__entry(
89 DEV_ENTRY
90
91 __field(size_t, framelen)
92 __dynamic_array(u8, tfd, tfdlen)
93
94 /*
95 * Do not insert between or below these items,
96 * we want to keep the frame together (except
97 * for the possible padding).
98 */
99 __dynamic_array(u8, buf0, buf0_len)
100 __dynamic_array(u8, buf1, iwl_trace_data(skb) ? 0 : buf1_len)
101 ),
102 TP_fast_assign(
103 DEV_ASSIGN;
104 __entry->framelen = buf0_len + buf1_len;
105 memcpy(__get_dynamic_array(tfd), tfd, tfdlen);
106 memcpy(__get_dynamic_array(buf0), buf0, buf0_len);
107 if (!iwl_trace_data(skb))
108 memcpy(__get_dynamic_array(buf1), buf1, buf1_len);
109 ),
110 TP_printk("[%s] TX %.2x (%zu bytes)",
111 __get_str(dev), ((u8 *)__get_dynamic_array(buf0))[0],
112 __entry->framelen)
113);
114
115TRACE_EVENT(iwlwifi_dev_ucode_error,
116 TP_PROTO(const struct device *dev, u32 desc, u32 tsf_low,
117 u32 data1, u32 data2, u32 line, u32 blink1,
118 u32 blink2, u32 ilink1, u32 ilink2, u32 bcon_time,
119 u32 gp1, u32 gp2, u32 gp3, u32 ucode_ver, u32 hw_ver,
120 u32 brd_ver),
121 TP_ARGS(dev, desc, tsf_low, data1, data2, line,
122 blink1, blink2, ilink1, ilink2, bcon_time, gp1, gp2,
123 gp3, ucode_ver, hw_ver, brd_ver),
124 TP_STRUCT__entry(
125 DEV_ENTRY
126 __field(u32, desc)
127 __field(u32, tsf_low)
128 __field(u32, data1)
129 __field(u32, data2)
130 __field(u32, line)
131 __field(u32, blink1)
132 __field(u32, blink2)
133 __field(u32, ilink1)
134 __field(u32, ilink2)
135 __field(u32, bcon_time)
136 __field(u32, gp1)
137 __field(u32, gp2)
138 __field(u32, gp3)
139 __field(u32, ucode_ver)
140 __field(u32, hw_ver)
141 __field(u32, brd_ver)
142 ),
143 TP_fast_assign(
144 DEV_ASSIGN;
145 __entry->desc = desc;
146 __entry->tsf_low = tsf_low;
147 __entry->data1 = data1;
148 __entry->data2 = data2;
149 __entry->line = line;
150 __entry->blink1 = blink1;
151 __entry->blink2 = blink2;
152 __entry->ilink1 = ilink1;
153 __entry->ilink2 = ilink2;
154 __entry->bcon_time = bcon_time;
155 __entry->gp1 = gp1;
156 __entry->gp2 = gp2;
157 __entry->gp3 = gp3;
158 __entry->ucode_ver = ucode_ver;
159 __entry->hw_ver = hw_ver;
160 __entry->brd_ver = brd_ver;
161 ),
162 TP_printk("[%s] #%02d %010u data 0x%08X 0x%08X line %u, "
163 "blink 0x%05X 0x%05X ilink 0x%05X 0x%05X "
164 "bcon_tm %010u gp 0x%08X 0x%08X 0x%08X uCode 0x%08X "
165 "hw 0x%08X brd 0x%08X",
166 __get_str(dev), __entry->desc, __entry->tsf_low,
167 __entry->data1,
168 __entry->data2, __entry->line, __entry->blink1,
169 __entry->blink2, __entry->ilink1, __entry->ilink2,
170 __entry->bcon_time, __entry->gp1, __entry->gp2,
171 __entry->gp3, __entry->ucode_ver, __entry->hw_ver,
172 __entry->brd_ver)
173);
174
175TRACE_EVENT(iwlwifi_dev_ucode_event,
176 TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev),
177 TP_ARGS(dev, time, data, ev),
178 TP_STRUCT__entry(
179 DEV_ENTRY
180
181 __field(u32, time)
182 __field(u32, data)
183 __field(u32, ev)
184 ),
185 TP_fast_assign(
186 DEV_ASSIGN;
187 __entry->time = time;
188 __entry->data = data;
189 __entry->ev = ev;
190 ),
191 TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u",
192 __get_str(dev), __entry->time, __entry->data, __entry->ev)
193);
194#endif /* __IWLWIFI_DEVICE_TRACE_IWLWIFI */
195
196#undef TRACE_INCLUDE_PATH
197#define TRACE_INCLUDE_PATH .
198#undef TRACE_INCLUDE_FILE
199#define TRACE_INCLUDE_FILE iwl-devtrace-iwlwifi
200#include <trace/define_trace.h>
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h b/drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h
new file mode 100644
index 000000000000..a3b3c2465f89
--- /dev/null
+++ b/drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h
@@ -0,0 +1,97 @@
1/******************************************************************************
2 *
3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
20 *
21 * Contact Information:
22 * Intel Linux Wireless <ilw@linux.intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 *****************************************************************************/
26
27#if !defined(__IWLWIFI_DEVICE_TRACE_MSG) || defined(TRACE_HEADER_MULTI_READ)
28#define __IWLWIFI_DEVICE_TRACE_MSG
29
30#include <linux/tracepoint.h>
31
32#undef TRACE_SYSTEM
33#define TRACE_SYSTEM iwlwifi_msg
34
35#define MAX_MSG_LEN 110
36
37DECLARE_EVENT_CLASS(iwlwifi_msg_event,
38 TP_PROTO(struct va_format *vaf),
39 TP_ARGS(vaf),
40 TP_STRUCT__entry(
41 __dynamic_array(char, msg, MAX_MSG_LEN)
42 ),
43 TP_fast_assign(
44 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
45 MAX_MSG_LEN, vaf->fmt,
46 *vaf->va) >= MAX_MSG_LEN);
47 ),
48 TP_printk("%s", __get_str(msg))
49);
50
51DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_err,
52 TP_PROTO(struct va_format *vaf),
53 TP_ARGS(vaf)
54);
55
56DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_warn,
57 TP_PROTO(struct va_format *vaf),
58 TP_ARGS(vaf)
59);
60
61DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_info,
62 TP_PROTO(struct va_format *vaf),
63 TP_ARGS(vaf)
64);
65
66DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_crit,
67 TP_PROTO(struct va_format *vaf),
68 TP_ARGS(vaf)
69);
70
71TRACE_EVENT(iwlwifi_dbg,
72 TP_PROTO(u32 level, bool in_interrupt, const char *function,
73 struct va_format *vaf),
74 TP_ARGS(level, in_interrupt, function, vaf),
75 TP_STRUCT__entry(
76 __field(u32, level)
77 __field(u8, in_interrupt)
78 __string(function, function)
79 __dynamic_array(char, msg, MAX_MSG_LEN)
80 ),
81 TP_fast_assign(
82 __entry->level = level;
83 __entry->in_interrupt = in_interrupt;
84 __assign_str(function, function);
85 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
86 MAX_MSG_LEN, vaf->fmt,
87 *vaf->va) >= MAX_MSG_LEN);
88 ),
89 TP_printk("%s", __get_str(msg))
90);
91#endif /* __IWLWIFI_DEVICE_TRACE_MSG */
92
93#undef TRACE_INCLUDE_PATH
94#define TRACE_INCLUDE_PATH .
95#undef TRACE_INCLUDE_FILE
96#define TRACE_INCLUDE_FILE iwl-devtrace-msg
97#include <trace/define_trace.h>
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h b/drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h
new file mode 100644
index 000000000000..10839fae9cd9
--- /dev/null
+++ b/drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h
@@ -0,0 +1,81 @@
1/******************************************************************************
2 *
3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
20 *
21 * Contact Information:
22 * Intel Linux Wireless <ilw@linux.intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 *****************************************************************************/
26
27#if !defined(__IWLWIFI_DEVICE_TRACE_UCODE) || defined(TRACE_HEADER_MULTI_READ)
28#define __IWLWIFI_DEVICE_TRACE_UCODE
29
30#include <linux/tracepoint.h>
31
32#undef TRACE_SYSTEM
33#define TRACE_SYSTEM iwlwifi_ucode
34
35TRACE_EVENT(iwlwifi_dev_ucode_cont_event,
36 TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev),
37 TP_ARGS(dev, time, data, ev),
38 TP_STRUCT__entry(
39 DEV_ENTRY
40
41 __field(u32, time)
42 __field(u32, data)
43 __field(u32, ev)
44 ),
45 TP_fast_assign(
46 DEV_ASSIGN;
47 __entry->time = time;
48 __entry->data = data;
49 __entry->ev = ev;
50 ),
51 TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u",
52 __get_str(dev), __entry->time, __entry->data, __entry->ev)
53);
54
55TRACE_EVENT(iwlwifi_dev_ucode_wrap_event,
56 TP_PROTO(const struct device *dev, u32 wraps, u32 n_entry, u32 p_entry),
57 TP_ARGS(dev, wraps, n_entry, p_entry),
58 TP_STRUCT__entry(
59 DEV_ENTRY
60
61 __field(u32, wraps)
62 __field(u32, n_entry)
63 __field(u32, p_entry)
64 ),
65 TP_fast_assign(
66 DEV_ASSIGN;
67 __entry->wraps = wraps;
68 __entry->n_entry = n_entry;
69 __entry->p_entry = p_entry;
70 ),
71 TP_printk("[%s] wraps=#%02d n=0x%X p=0x%X",
72 __get_str(dev), __entry->wraps, __entry->n_entry,
73 __entry->p_entry)
74);
75#endif /* __IWLWIFI_DEVICE_TRACE_UCODE */
76
77#undef TRACE_INCLUDE_PATH
78#define TRACE_INCLUDE_PATH .
79#undef TRACE_INCLUDE_FILE
80#define TRACE_INCLUDE_FILE iwl-devtrace-ucode
81#include <trace/define_trace.h>
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace.h b/drivers/net/wireless/iwlwifi/iwl-devtrace.h
index 78bd41bf34b0..b87acd6a229b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-devtrace.h
+++ b/drivers/net/wireless/iwlwifi/iwl-devtrace.h
@@ -24,7 +24,7 @@
24 * 24 *
25 *****************************************************************************/ 25 *****************************************************************************/
26 26
27#if !defined(__IWLWIFI_DEVICE_TRACE) || defined(TRACE_HEADER_MULTI_READ) 27#ifndef __IWLWIFI_DEVICE_TRACE
28#include <linux/skbuff.h> 28#include <linux/skbuff.h>
29#include <linux/ieee80211.h> 29#include <linux/ieee80211.h>
30#include <net/cfg80211.h> 30#include <net/cfg80211.h>
@@ -80,436 +80,10 @@ static inline void trace_ ## name(proto) {}
80#define DEV_ENTRY __string(dev, dev_name(dev)) 80#define DEV_ENTRY __string(dev, dev_name(dev))
81#define DEV_ASSIGN __assign_str(dev, dev_name(dev)) 81#define DEV_ASSIGN __assign_str(dev, dev_name(dev))
82 82
83#undef TRACE_SYSTEM 83#include "iwl-devtrace-io.h"
84#define TRACE_SYSTEM iwlwifi_io 84#include "iwl-devtrace-ucode.h"
85#include "iwl-devtrace-msg.h"
86#include "iwl-devtrace-data.h"
87#include "iwl-devtrace-iwlwifi.h"
85 88
86TRACE_EVENT(iwlwifi_dev_ioread32,
87 TP_PROTO(const struct device *dev, u32 offs, u32 val),
88 TP_ARGS(dev, offs, val),
89 TP_STRUCT__entry(
90 DEV_ENTRY
91 __field(u32, offs)
92 __field(u32, val)
93 ),
94 TP_fast_assign(
95 DEV_ASSIGN;
96 __entry->offs = offs;
97 __entry->val = val;
98 ),
99 TP_printk("[%s] read io[%#x] = %#x",
100 __get_str(dev), __entry->offs, __entry->val)
101);
102
103TRACE_EVENT(iwlwifi_dev_iowrite8,
104 TP_PROTO(const struct device *dev, u32 offs, u8 val),
105 TP_ARGS(dev, offs, val),
106 TP_STRUCT__entry(
107 DEV_ENTRY
108 __field(u32, offs)
109 __field(u8, val)
110 ),
111 TP_fast_assign(
112 DEV_ASSIGN;
113 __entry->offs = offs;
114 __entry->val = val;
115 ),
116 TP_printk("[%s] write io[%#x] = %#x)",
117 __get_str(dev), __entry->offs, __entry->val)
118);
119
120TRACE_EVENT(iwlwifi_dev_iowrite32,
121 TP_PROTO(const struct device *dev, u32 offs, u32 val),
122 TP_ARGS(dev, offs, val),
123 TP_STRUCT__entry(
124 DEV_ENTRY
125 __field(u32, offs)
126 __field(u32, val)
127 ),
128 TP_fast_assign(
129 DEV_ASSIGN;
130 __entry->offs = offs;
131 __entry->val = val;
132 ),
133 TP_printk("[%s] write io[%#x] = %#x)",
134 __get_str(dev), __entry->offs, __entry->val)
135);
136
137TRACE_EVENT(iwlwifi_dev_iowrite_prph32,
138 TP_PROTO(const struct device *dev, u32 offs, u32 val),
139 TP_ARGS(dev, offs, val),
140 TP_STRUCT__entry(
141 DEV_ENTRY
142 __field(u32, offs)
143 __field(u32, val)
144 ),
145 TP_fast_assign(
146 DEV_ASSIGN;
147 __entry->offs = offs;
148 __entry->val = val;
149 ),
150 TP_printk("[%s] write PRPH[%#x] = %#x)",
151 __get_str(dev), __entry->offs, __entry->val)
152);
153
154TRACE_EVENT(iwlwifi_dev_ioread_prph32,
155 TP_PROTO(const struct device *dev, u32 offs, u32 val),
156 TP_ARGS(dev, offs, val),
157 TP_STRUCT__entry(
158 DEV_ENTRY
159 __field(u32, offs)
160 __field(u32, val)
161 ),
162 TP_fast_assign(
163 DEV_ASSIGN;
164 __entry->offs = offs;
165 __entry->val = val;
166 ),
167 TP_printk("[%s] read PRPH[%#x] = %#x",
168 __get_str(dev), __entry->offs, __entry->val)
169);
170
171TRACE_EVENT(iwlwifi_dev_irq,
172 TP_PROTO(const struct device *dev),
173 TP_ARGS(dev),
174 TP_STRUCT__entry(
175 DEV_ENTRY
176 ),
177 TP_fast_assign(
178 DEV_ASSIGN;
179 ),
180 /* TP_printk("") doesn't compile */
181 TP_printk("%d", 0)
182);
183
184TRACE_EVENT(iwlwifi_dev_ict_read,
185 TP_PROTO(const struct device *dev, u32 index, u32 value),
186 TP_ARGS(dev, index, value),
187 TP_STRUCT__entry(
188 DEV_ENTRY
189 __field(u32, index)
190 __field(u32, value)
191 ),
192 TP_fast_assign(
193 DEV_ASSIGN;
194 __entry->index = index;
195 __entry->value = value;
196 ),
197 TP_printk("[%s] read ict[%d] = %#.8x",
198 __get_str(dev), __entry->index, __entry->value)
199);
200
201#undef TRACE_SYSTEM
202#define TRACE_SYSTEM iwlwifi_ucode
203
204TRACE_EVENT(iwlwifi_dev_ucode_cont_event,
205 TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev),
206 TP_ARGS(dev, time, data, ev),
207 TP_STRUCT__entry(
208 DEV_ENTRY
209
210 __field(u32, time)
211 __field(u32, data)
212 __field(u32, ev)
213 ),
214 TP_fast_assign(
215 DEV_ASSIGN;
216 __entry->time = time;
217 __entry->data = data;
218 __entry->ev = ev;
219 ),
220 TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u",
221 __get_str(dev), __entry->time, __entry->data, __entry->ev)
222);
223
224TRACE_EVENT(iwlwifi_dev_ucode_wrap_event,
225 TP_PROTO(const struct device *dev, u32 wraps, u32 n_entry, u32 p_entry),
226 TP_ARGS(dev, wraps, n_entry, p_entry),
227 TP_STRUCT__entry(
228 DEV_ENTRY
229
230 __field(u32, wraps)
231 __field(u32, n_entry)
232 __field(u32, p_entry)
233 ),
234 TP_fast_assign(
235 DEV_ASSIGN;
236 __entry->wraps = wraps;
237 __entry->n_entry = n_entry;
238 __entry->p_entry = p_entry;
239 ),
240 TP_printk("[%s] wraps=#%02d n=0x%X p=0x%X",
241 __get_str(dev), __entry->wraps, __entry->n_entry,
242 __entry->p_entry)
243);
244
245#undef TRACE_SYSTEM
246#define TRACE_SYSTEM iwlwifi_msg
247
248#define MAX_MSG_LEN 110
249
250DECLARE_EVENT_CLASS(iwlwifi_msg_event,
251 TP_PROTO(struct va_format *vaf),
252 TP_ARGS(vaf),
253 TP_STRUCT__entry(
254 __dynamic_array(char, msg, MAX_MSG_LEN)
255 ),
256 TP_fast_assign(
257 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
258 MAX_MSG_LEN, vaf->fmt,
259 *vaf->va) >= MAX_MSG_LEN);
260 ),
261 TP_printk("%s", __get_str(msg))
262);
263
264DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_err,
265 TP_PROTO(struct va_format *vaf),
266 TP_ARGS(vaf)
267);
268
269DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_warn,
270 TP_PROTO(struct va_format *vaf),
271 TP_ARGS(vaf)
272);
273
274DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_info,
275 TP_PROTO(struct va_format *vaf),
276 TP_ARGS(vaf)
277);
278
279DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_crit,
280 TP_PROTO(struct va_format *vaf),
281 TP_ARGS(vaf)
282);
283
284TRACE_EVENT(iwlwifi_dbg,
285 TP_PROTO(u32 level, bool in_interrupt, const char *function,
286 struct va_format *vaf),
287 TP_ARGS(level, in_interrupt, function, vaf),
288 TP_STRUCT__entry(
289 __field(u32, level)
290 __field(u8, in_interrupt)
291 __string(function, function)
292 __dynamic_array(char, msg, MAX_MSG_LEN)
293 ),
294 TP_fast_assign(
295 __entry->level = level;
296 __entry->in_interrupt = in_interrupt;
297 __assign_str(function, function);
298 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
299 MAX_MSG_LEN, vaf->fmt,
300 *vaf->va) >= MAX_MSG_LEN);
301 ),
302 TP_printk("%s", __get_str(msg))
303);
304
305#undef TRACE_SYSTEM
306#define TRACE_SYSTEM iwlwifi_data
307
308TRACE_EVENT(iwlwifi_dev_tx_data,
309 TP_PROTO(const struct device *dev,
310 struct sk_buff *skb,
311 void *data, size_t data_len),
312 TP_ARGS(dev, skb, data, data_len),
313 TP_STRUCT__entry(
314 DEV_ENTRY
315
316 __dynamic_array(u8, data, iwl_trace_data(skb) ? data_len : 0)
317 ),
318 TP_fast_assign(
319 DEV_ASSIGN;
320 if (iwl_trace_data(skb))
321 memcpy(__get_dynamic_array(data), data, data_len);
322 ),
323 TP_printk("[%s] TX frame data", __get_str(dev))
324);
325
326TRACE_EVENT(iwlwifi_dev_rx_data,
327 TP_PROTO(const struct device *dev,
328 const struct iwl_trans *trans,
329 void *rxbuf, size_t len),
330 TP_ARGS(dev, trans, rxbuf, len),
331 TP_STRUCT__entry(
332 DEV_ENTRY
333
334 __dynamic_array(u8, data,
335 len - iwl_rx_trace_len(trans, rxbuf, len))
336 ),
337 TP_fast_assign(
338 size_t offs = iwl_rx_trace_len(trans, rxbuf, len);
339 DEV_ASSIGN;
340 if (offs < len)
341 memcpy(__get_dynamic_array(data),
342 ((u8 *)rxbuf) + offs, len - offs);
343 ),
344 TP_printk("[%s] RX frame data", __get_str(dev))
345);
346
347#undef TRACE_SYSTEM
348#define TRACE_SYSTEM iwlwifi
349
350TRACE_EVENT(iwlwifi_dev_hcmd,
351 TP_PROTO(const struct device *dev,
352 struct iwl_host_cmd *cmd, u16 total_size,
353 struct iwl_cmd_header *hdr),
354 TP_ARGS(dev, cmd, total_size, hdr),
355 TP_STRUCT__entry(
356 DEV_ENTRY
357 __dynamic_array(u8, hcmd, total_size)
358 __field(u32, flags)
359 ),
360 TP_fast_assign(
361 int i, offset = sizeof(*hdr);
362
363 DEV_ASSIGN;
364 __entry->flags = cmd->flags;
365 memcpy(__get_dynamic_array(hcmd), hdr, sizeof(*hdr));
366
367 for (i = 0; i < IWL_MAX_CMD_TBS_PER_TFD; i++) {
368 if (!cmd->len[i])
369 continue;
370 memcpy((u8 *)__get_dynamic_array(hcmd) + offset,
371 cmd->data[i], cmd->len[i]);
372 offset += cmd->len[i];
373 }
374 ),
375 TP_printk("[%s] hcmd %#.2x (%ssync)",
376 __get_str(dev), ((u8 *)__get_dynamic_array(hcmd))[0],
377 __entry->flags & CMD_ASYNC ? "a" : "")
378);
379
380TRACE_EVENT(iwlwifi_dev_rx,
381 TP_PROTO(const struct device *dev, const struct iwl_trans *trans,
382 void *rxbuf, size_t len),
383 TP_ARGS(dev, trans, rxbuf, len),
384 TP_STRUCT__entry(
385 DEV_ENTRY
386 __dynamic_array(u8, rxbuf, iwl_rx_trace_len(trans, rxbuf, len))
387 ),
388 TP_fast_assign(
389 DEV_ASSIGN;
390 memcpy(__get_dynamic_array(rxbuf), rxbuf,
391 iwl_rx_trace_len(trans, rxbuf, len));
392 ),
393 TP_printk("[%s] RX cmd %#.2x",
394 __get_str(dev), ((u8 *)__get_dynamic_array(rxbuf))[4])
395);
396
397TRACE_EVENT(iwlwifi_dev_tx,
398 TP_PROTO(const struct device *dev, struct sk_buff *skb,
399 void *tfd, size_t tfdlen,
400 void *buf0, size_t buf0_len,
401 void *buf1, size_t buf1_len),
402 TP_ARGS(dev, skb, tfd, tfdlen, buf0, buf0_len, buf1, buf1_len),
403 TP_STRUCT__entry(
404 DEV_ENTRY
405
406 __field(size_t, framelen)
407 __dynamic_array(u8, tfd, tfdlen)
408
409 /*
410 * Do not insert between or below these items,
411 * we want to keep the frame together (except
412 * for the possible padding).
413 */
414 __dynamic_array(u8, buf0, buf0_len)
415 __dynamic_array(u8, buf1, iwl_trace_data(skb) ? 0 : buf1_len)
416 ),
417 TP_fast_assign(
418 DEV_ASSIGN;
419 __entry->framelen = buf0_len + buf1_len;
420 memcpy(__get_dynamic_array(tfd), tfd, tfdlen);
421 memcpy(__get_dynamic_array(buf0), buf0, buf0_len);
422 if (!iwl_trace_data(skb))
423 memcpy(__get_dynamic_array(buf1), buf1, buf1_len);
424 ),
425 TP_printk("[%s] TX %.2x (%zu bytes)",
426 __get_str(dev), ((u8 *)__get_dynamic_array(buf0))[0],
427 __entry->framelen)
428);
429
430TRACE_EVENT(iwlwifi_dev_ucode_error,
431 TP_PROTO(const struct device *dev, u32 desc, u32 tsf_low,
432 u32 data1, u32 data2, u32 line, u32 blink1,
433 u32 blink2, u32 ilink1, u32 ilink2, u32 bcon_time,
434 u32 gp1, u32 gp2, u32 gp3, u32 ucode_ver, u32 hw_ver,
435 u32 brd_ver),
436 TP_ARGS(dev, desc, tsf_low, data1, data2, line,
437 blink1, blink2, ilink1, ilink2, bcon_time, gp1, gp2,
438 gp3, ucode_ver, hw_ver, brd_ver),
439 TP_STRUCT__entry(
440 DEV_ENTRY
441 __field(u32, desc)
442 __field(u32, tsf_low)
443 __field(u32, data1)
444 __field(u32, data2)
445 __field(u32, line)
446 __field(u32, blink1)
447 __field(u32, blink2)
448 __field(u32, ilink1)
449 __field(u32, ilink2)
450 __field(u32, bcon_time)
451 __field(u32, gp1)
452 __field(u32, gp2)
453 __field(u32, gp3)
454 __field(u32, ucode_ver)
455 __field(u32, hw_ver)
456 __field(u32, brd_ver)
457 ),
458 TP_fast_assign(
459 DEV_ASSIGN;
460 __entry->desc = desc;
461 __entry->tsf_low = tsf_low;
462 __entry->data1 = data1;
463 __entry->data2 = data2;
464 __entry->line = line;
465 __entry->blink1 = blink1;
466 __entry->blink2 = blink2;
467 __entry->ilink1 = ilink1;
468 __entry->ilink2 = ilink2;
469 __entry->bcon_time = bcon_time;
470 __entry->gp1 = gp1;
471 __entry->gp2 = gp2;
472 __entry->gp3 = gp3;
473 __entry->ucode_ver = ucode_ver;
474 __entry->hw_ver = hw_ver;
475 __entry->brd_ver = brd_ver;
476 ),
477 TP_printk("[%s] #%02d %010u data 0x%08X 0x%08X line %u, "
478 "blink 0x%05X 0x%05X ilink 0x%05X 0x%05X "
479 "bcon_tm %010u gp 0x%08X 0x%08X 0x%08X uCode 0x%08X "
480 "hw 0x%08X brd 0x%08X",
481 __get_str(dev), __entry->desc, __entry->tsf_low,
482 __entry->data1,
483 __entry->data2, __entry->line, __entry->blink1,
484 __entry->blink2, __entry->ilink1, __entry->ilink2,
485 __entry->bcon_time, __entry->gp1, __entry->gp2,
486 __entry->gp3, __entry->ucode_ver, __entry->hw_ver,
487 __entry->brd_ver)
488);
489
490TRACE_EVENT(iwlwifi_dev_ucode_event,
491 TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev),
492 TP_ARGS(dev, time, data, ev),
493 TP_STRUCT__entry(
494 DEV_ENTRY
495
496 __field(u32, time)
497 __field(u32, data)
498 __field(u32, ev)
499 ),
500 TP_fast_assign(
501 DEV_ASSIGN;
502 __entry->time = time;
503 __entry->data = data;
504 __entry->ev = ev;
505 ),
506 TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u",
507 __get_str(dev), __entry->time, __entry->data, __entry->ev)
508);
509#endif /* __IWLWIFI_DEVICE_TRACE */ 89#endif /* __IWLWIFI_DEVICE_TRACE */
510
511#undef TRACE_INCLUDE_PATH
512#define TRACE_INCLUDE_PATH .
513#undef TRACE_INCLUDE_FILE
514#define TRACE_INCLUDE_FILE iwl-devtrace
515#include <trace/define_trace.h>
diff --git a/drivers/usb/host/xhci-trace.h b/drivers/usb/host/xhci-trace.h
index dde3959b7a33..59c05653b2ea 100644
--- a/drivers/usb/host/xhci-trace.h
+++ b/drivers/usb/host/xhci-trace.h
@@ -14,6 +14,13 @@
14#undef TRACE_SYSTEM 14#undef TRACE_SYSTEM
15#define TRACE_SYSTEM xhci-hcd 15#define TRACE_SYSTEM xhci-hcd
16 16
17/*
18 * The TRACE_SYSTEM_VAR defaults to TRACE_SYSTEM, but must be a
19 * legitimate C variable. It is not exported to user space.
20 */
21#undef TRACE_SYSTEM_VAR
22#define TRACE_SYSTEM_VAR xhci_hcd
23
17#if !defined(__XHCI_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) 24#if !defined(__XHCI_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
18#define __XHCI_TRACE_H 25#define __XHCI_TRACE_H
19 26
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index ac78910d7416..f8e8b34dc427 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -124,7 +124,10 @@
124#define FTRACE_EVENTS() . = ALIGN(8); \ 124#define FTRACE_EVENTS() . = ALIGN(8); \
125 VMLINUX_SYMBOL(__start_ftrace_events) = .; \ 125 VMLINUX_SYMBOL(__start_ftrace_events) = .; \
126 *(_ftrace_events) \ 126 *(_ftrace_events) \
127 VMLINUX_SYMBOL(__stop_ftrace_events) = .; 127 VMLINUX_SYMBOL(__stop_ftrace_events) = .; \
128 VMLINUX_SYMBOL(__start_ftrace_enum_maps) = .; \
129 *(_ftrace_enum_map) \
130 VMLINUX_SYMBOL(__stop_ftrace_enum_maps) = .;
128#else 131#else
129#define FTRACE_EVENTS() 132#define FTRACE_EVENTS()
130#endif 133#endif
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index c674ee8f7fca..112cf49d9576 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -202,7 +202,7 @@ enum trace_reg {
202struct ftrace_event_call; 202struct ftrace_event_call;
203 203
204struct ftrace_event_class { 204struct ftrace_event_class {
205 char *system; 205 const char *system;
206 void *probe; 206 void *probe;
207#ifdef CONFIG_PERF_EVENTS 207#ifdef CONFIG_PERF_EVENTS
208 void *perf_probe; 208 void *perf_probe;
@@ -285,7 +285,7 @@ struct ftrace_event_call {
285 struct tracepoint *tp; 285 struct tracepoint *tp;
286 }; 286 };
287 struct trace_event event; 287 struct trace_event event;
288 const char *print_fmt; 288 char *print_fmt;
289 struct event_filter *filter; 289 struct event_filter *filter;
290 void *mod; 290 void *mod;
291 void *data; 291 void *data;
diff --git a/include/linux/module.h b/include/linux/module.h
index b03485bcb82a..c883b86ea964 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -338,6 +338,8 @@ struct module {
338#ifdef CONFIG_EVENT_TRACING 338#ifdef CONFIG_EVENT_TRACING
339 struct ftrace_event_call **trace_events; 339 struct ftrace_event_call **trace_events;
340 unsigned int num_trace_events; 340 unsigned int num_trace_events;
341 struct trace_enum_map **trace_enums;
342 unsigned int num_trace_enums;
341#endif 343#endif
342#ifdef CONFIG_FTRACE_MCOUNT_RECORD 344#ifdef CONFIG_FTRACE_MCOUNT_RECORD
343 unsigned int num_ftrace_callsites; 345 unsigned int num_ftrace_callsites;
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index c72851328ca9..a5f7f3ecafa3 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -36,6 +36,12 @@ struct tracepoint {
36 struct tracepoint_func __rcu *funcs; 36 struct tracepoint_func __rcu *funcs;
37}; 37};
38 38
39struct trace_enum_map {
40 const char *system;
41 const char *enum_string;
42 unsigned long enum_value;
43};
44
39extern int 45extern int
40tracepoint_probe_register(struct tracepoint *tp, void *probe, void *data); 46tracepoint_probe_register(struct tracepoint *tp, void *probe, void *data);
41extern int 47extern int
@@ -87,6 +93,8 @@ extern void syscall_unregfunc(void);
87 93
88#define PARAMS(args...) args 94#define PARAMS(args...) args
89 95
96#define TRACE_DEFINE_ENUM(x)
97
90#endif /* _LINUX_TRACEPOINT_H */ 98#endif /* _LINUX_TRACEPOINT_H */
91 99
92/* 100/*
diff --git a/include/trace/events/9p.h b/include/trace/events/9p.h
index a0666362c111..633ee9ee9778 100644
--- a/include/trace/events/9p.h
+++ b/include/trace/events/9p.h
@@ -6,76 +6,95 @@
6 6
7#include <linux/tracepoint.h> 7#include <linux/tracepoint.h>
8 8
9#define P9_MSG_T \
10 EM( P9_TLERROR, "P9_TLERROR" ) \
11 EM( P9_RLERROR, "P9_RLERROR" ) \
12 EM( P9_TSTATFS, "P9_TSTATFS" ) \
13 EM( P9_RSTATFS, "P9_RSTATFS" ) \
14 EM( P9_TLOPEN, "P9_TLOPEN" ) \
15 EM( P9_RLOPEN, "P9_RLOPEN" ) \
16 EM( P9_TLCREATE, "P9_TLCREATE" ) \
17 EM( P9_RLCREATE, "P9_RLCREATE" ) \
18 EM( P9_TSYMLINK, "P9_TSYMLINK" ) \
19 EM( P9_RSYMLINK, "P9_RSYMLINK" ) \
20 EM( P9_TMKNOD, "P9_TMKNOD" ) \
21 EM( P9_RMKNOD, "P9_RMKNOD" ) \
22 EM( P9_TRENAME, "P9_TRENAME" ) \
23 EM( P9_RRENAME, "P9_RRENAME" ) \
24 EM( P9_TREADLINK, "P9_TREADLINK" ) \
25 EM( P9_RREADLINK, "P9_RREADLINK" ) \
26 EM( P9_TGETATTR, "P9_TGETATTR" ) \
27 EM( P9_RGETATTR, "P9_RGETATTR" ) \
28 EM( P9_TSETATTR, "P9_TSETATTR" ) \
29 EM( P9_RSETATTR, "P9_RSETATTR" ) \
30 EM( P9_TXATTRWALK, "P9_TXATTRWALK" ) \
31 EM( P9_RXATTRWALK, "P9_RXATTRWALK" ) \
32 EM( P9_TXATTRCREATE, "P9_TXATTRCREATE" ) \
33 EM( P9_RXATTRCREATE, "P9_RXATTRCREATE" ) \
34 EM( P9_TREADDIR, "P9_TREADDIR" ) \
35 EM( P9_RREADDIR, "P9_RREADDIR" ) \
36 EM( P9_TFSYNC, "P9_TFSYNC" ) \
37 EM( P9_RFSYNC, "P9_RFSYNC" ) \
38 EM( P9_TLOCK, "P9_TLOCK" ) \
39 EM( P9_RLOCK, "P9_RLOCK" ) \
40 EM( P9_TGETLOCK, "P9_TGETLOCK" ) \
41 EM( P9_RGETLOCK, "P9_RGETLOCK" ) \
42 EM( P9_TLINK, "P9_TLINK" ) \
43 EM( P9_RLINK, "P9_RLINK" ) \
44 EM( P9_TMKDIR, "P9_TMKDIR" ) \
45 EM( P9_RMKDIR, "P9_RMKDIR" ) \
46 EM( P9_TRENAMEAT, "P9_TRENAMEAT" ) \
47 EM( P9_RRENAMEAT, "P9_RRENAMEAT" ) \
48 EM( P9_TUNLINKAT, "P9_TUNLINKAT" ) \
49 EM( P9_RUNLINKAT, "P9_RUNLINKAT" ) \
50 EM( P9_TVERSION, "P9_TVERSION" ) \
51 EM( P9_RVERSION, "P9_RVERSION" ) \
52 EM( P9_TAUTH, "P9_TAUTH" ) \
53 EM( P9_RAUTH, "P9_RAUTH" ) \
54 EM( P9_TATTACH, "P9_TATTACH" ) \
55 EM( P9_RATTACH, "P9_RATTACH" ) \
56 EM( P9_TERROR, "P9_TERROR" ) \
57 EM( P9_RERROR, "P9_RERROR" ) \
58 EM( P9_TFLUSH, "P9_TFLUSH" ) \
59 EM( P9_RFLUSH, "P9_RFLUSH" ) \
60 EM( P9_TWALK, "P9_TWALK" ) \
61 EM( P9_RWALK, "P9_RWALK" ) \
62 EM( P9_TOPEN, "P9_TOPEN" ) \
63 EM( P9_ROPEN, "P9_ROPEN" ) \
64 EM( P9_TCREATE, "P9_TCREATE" ) \
65 EM( P9_RCREATE, "P9_RCREATE" ) \
66 EM( P9_TREAD, "P9_TREAD" ) \
67 EM( P9_RREAD, "P9_RREAD" ) \
68 EM( P9_TWRITE, "P9_TWRITE" ) \
69 EM( P9_RWRITE, "P9_RWRITE" ) \
70 EM( P9_TCLUNK, "P9_TCLUNK" ) \
71 EM( P9_RCLUNK, "P9_RCLUNK" ) \
72 EM( P9_TREMOVE, "P9_TREMOVE" ) \
73 EM( P9_RREMOVE, "P9_RREMOVE" ) \
74 EM( P9_TSTAT, "P9_TSTAT" ) \
75 EM( P9_RSTAT, "P9_RSTAT" ) \
76 EM( P9_TWSTAT, "P9_TWSTAT" ) \
77 EMe(P9_RWSTAT, "P9_RWSTAT" )
78
79/* Define EM() to export the enums to userspace via TRACE_DEFINE_ENUM() */
80#undef EM
81#undef EMe
82#define EM(a, b) TRACE_DEFINE_ENUM(a);
83#define EMe(a, b) TRACE_DEFINE_ENUM(a);
84
85P9_MSG_T
86
87/*
88 * Now redefine the EM() and EMe() macros to map the enums to the strings
89 * that will be printed in the output.
90 */
91#undef EM
92#undef EMe
93#define EM(a, b) { a, b },
94#define EMe(a, b) { a, b }
95
9#define show_9p_op(type) \ 96#define show_9p_op(type) \
10 __print_symbolic(type, \ 97 __print_symbolic(type, P9_MSG_T)
11 { P9_TLERROR, "P9_TLERROR" }, \
12 { P9_RLERROR, "P9_RLERROR" }, \
13 { P9_TSTATFS, "P9_TSTATFS" }, \
14 { P9_RSTATFS, "P9_RSTATFS" }, \
15 { P9_TLOPEN, "P9_TLOPEN" }, \
16 { P9_RLOPEN, "P9_RLOPEN" }, \
17 { P9_TLCREATE, "P9_TLCREATE" }, \
18 { P9_RLCREATE, "P9_RLCREATE" }, \
19 { P9_TSYMLINK, "P9_TSYMLINK" }, \
20 { P9_RSYMLINK, "P9_RSYMLINK" }, \
21 { P9_TMKNOD, "P9_TMKNOD" }, \
22 { P9_RMKNOD, "P9_RMKNOD" }, \
23 { P9_TRENAME, "P9_TRENAME" }, \
24 { P9_RRENAME, "P9_RRENAME" }, \
25 { P9_TREADLINK, "P9_TREADLINK" }, \
26 { P9_RREADLINK, "P9_RREADLINK" }, \
27 { P9_TGETATTR, "P9_TGETATTR" }, \
28 { P9_RGETATTR, "P9_RGETATTR" }, \
29 { P9_TSETATTR, "P9_TSETATTR" }, \
30 { P9_RSETATTR, "P9_RSETATTR" }, \
31 { P9_TXATTRWALK, "P9_TXATTRWALK" }, \
32 { P9_RXATTRWALK, "P9_RXATTRWALK" }, \
33 { P9_TXATTRCREATE, "P9_TXATTRCREATE" }, \
34 { P9_RXATTRCREATE, "P9_RXATTRCREATE" }, \
35 { P9_TREADDIR, "P9_TREADDIR" }, \
36 { P9_RREADDIR, "P9_RREADDIR" }, \
37 { P9_TFSYNC, "P9_TFSYNC" }, \
38 { P9_RFSYNC, "P9_RFSYNC" }, \
39 { P9_TLOCK, "P9_TLOCK" }, \
40 { P9_RLOCK, "P9_RLOCK" }, \
41 { P9_TGETLOCK, "P9_TGETLOCK" }, \
42 { P9_RGETLOCK, "P9_RGETLOCK" }, \
43 { P9_TLINK, "P9_TLINK" }, \
44 { P9_RLINK, "P9_RLINK" }, \
45 { P9_TMKDIR, "P9_TMKDIR" }, \
46 { P9_RMKDIR, "P9_RMKDIR" }, \
47 { P9_TRENAMEAT, "P9_TRENAMEAT" }, \
48 { P9_RRENAMEAT, "P9_RRENAMEAT" }, \
49 { P9_TUNLINKAT, "P9_TUNLINKAT" }, \
50 { P9_RUNLINKAT, "P9_RUNLINKAT" }, \
51 { P9_TVERSION, "P9_TVERSION" }, \
52 { P9_RVERSION, "P9_RVERSION" }, \
53 { P9_TAUTH, "P9_TAUTH" }, \
54 { P9_RAUTH, "P9_RAUTH" }, \
55 { P9_TATTACH, "P9_TATTACH" }, \
56 { P9_RATTACH, "P9_RATTACH" }, \
57 { P9_TERROR, "P9_TERROR" }, \
58 { P9_RERROR, "P9_RERROR" }, \
59 { P9_TFLUSH, "P9_TFLUSH" }, \
60 { P9_RFLUSH, "P9_RFLUSH" }, \
61 { P9_TWALK, "P9_TWALK" }, \
62 { P9_RWALK, "P9_RWALK" }, \
63 { P9_TOPEN, "P9_TOPEN" }, \
64 { P9_ROPEN, "P9_ROPEN" }, \
65 { P9_TCREATE, "P9_TCREATE" }, \
66 { P9_RCREATE, "P9_RCREATE" }, \
67 { P9_TREAD, "P9_TREAD" }, \
68 { P9_RREAD, "P9_RREAD" }, \
69 { P9_TWRITE, "P9_TWRITE" }, \
70 { P9_RWRITE, "P9_RWRITE" }, \
71 { P9_TCLUNK, "P9_TCLUNK" }, \
72 { P9_RCLUNK, "P9_RCLUNK" }, \
73 { P9_TREMOVE, "P9_TREMOVE" }, \
74 { P9_RREMOVE, "P9_RREMOVE" }, \
75 { P9_TSTAT, "P9_TSTAT" }, \
76 { P9_RSTAT, "P9_RSTAT" }, \
77 { P9_TWSTAT, "P9_TWSTAT" }, \
78 { P9_RWSTAT, "P9_RWSTAT" })
79 98
80TRACE_EVENT(9p_client_req, 99TRACE_EVENT(9p_client_req,
81 TP_PROTO(struct p9_client *clnt, int8_t type, int tag), 100 TP_PROTO(struct p9_client *clnt, int8_t type, int tag),
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 1faecea101f3..572e6503394a 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -962,7 +962,7 @@ TRACE_EVENT(alloc_extent_state,
962 __entry->ip = IP 962 __entry->ip = IP
963 ), 963 ),
964 964
965 TP_printk("state=%p; mask = %s; caller = %pF", __entry->state, 965 TP_printk("state=%p; mask = %s; caller = %pS", __entry->state,
966 show_gfp_flags(__entry->mask), (void *)__entry->ip) 966 show_gfp_flags(__entry->mask), (void *)__entry->ip)
967); 967);
968 968
@@ -982,7 +982,7 @@ TRACE_EVENT(free_extent_state,
982 __entry->ip = IP 982 __entry->ip = IP
983 ), 983 ),
984 984
985 TP_printk(" state=%p; caller = %pF", __entry->state, 985 TP_printk(" state=%p; caller = %pS", __entry->state,
986 (void *)__entry->ip) 986 (void *)__entry->ip)
987); 987);
988 988
diff --git a/include/trace/events/ext3.h b/include/trace/events/ext3.h
index 6797b9de90ed..7f20707849bb 100644
--- a/include/trace/events/ext3.h
+++ b/include/trace/events/ext3.h
@@ -144,7 +144,7 @@ TRACE_EVENT(ext3_mark_inode_dirty,
144 __entry->ip = IP; 144 __entry->ip = IP;
145 ), 145 ),
146 146
147 TP_printk("dev %d,%d ino %lu caller %pF", 147 TP_printk("dev %d,%d ino %lu caller %pS",
148 MAJOR(__entry->dev), MINOR(__entry->dev), 148 MAJOR(__entry->dev), MINOR(__entry->dev),
149 (unsigned long) __entry->ino, (void *)__entry->ip) 149 (unsigned long) __entry->ino, (void *)__entry->ip)
150); 150);
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 6e5abd6d38a2..47fca36ee426 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -240,7 +240,7 @@ TRACE_EVENT(ext4_mark_inode_dirty,
240 __entry->ip = IP; 240 __entry->ip = IP;
241 ), 241 ),
242 242
243 TP_printk("dev %d,%d ino %lu caller %pF", 243 TP_printk("dev %d,%d ino %lu caller %pS",
244 MAJOR(__entry->dev), MINOR(__entry->dev), 244 MAJOR(__entry->dev), MINOR(__entry->dev),
245 (unsigned long) __entry->ino, (void *)__entry->ip) 245 (unsigned long) __entry->ino, (void *)__entry->ip)
246); 246);
@@ -1762,7 +1762,7 @@ TRACE_EVENT(ext4_journal_start,
1762 __entry->rsv_blocks = rsv_blocks; 1762 __entry->rsv_blocks = rsv_blocks;
1763 ), 1763 ),
1764 1764
1765 TP_printk("dev %d,%d blocks, %d rsv_blocks, %d caller %pF", 1765 TP_printk("dev %d,%d blocks, %d rsv_blocks, %d caller %pS",
1766 MAJOR(__entry->dev), MINOR(__entry->dev), 1766 MAJOR(__entry->dev), MINOR(__entry->dev),
1767 __entry->blocks, __entry->rsv_blocks, (void *)__entry->ip) 1767 __entry->blocks, __entry->rsv_blocks, (void *)__entry->ip)
1768); 1768);
@@ -1784,7 +1784,7 @@ TRACE_EVENT(ext4_journal_start_reserved,
1784 __entry->blocks = blocks; 1784 __entry->blocks = blocks;
1785 ), 1785 ),
1786 1786
1787 TP_printk("dev %d,%d blocks, %d caller %pF", 1787 TP_printk("dev %d,%d blocks, %d caller %pS",
1788 MAJOR(__entry->dev), MINOR(__entry->dev), 1788 MAJOR(__entry->dev), MINOR(__entry->dev),
1789 __entry->blocks, (void *)__entry->ip) 1789 __entry->blocks, (void *)__entry->ip)
1790); 1790);
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 5422dbfaf97d..36f4536b6149 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -9,6 +9,36 @@
9#define show_dev(entry) MAJOR(entry->dev), MINOR(entry->dev) 9#define show_dev(entry) MAJOR(entry->dev), MINOR(entry->dev)
10#define show_dev_ino(entry) show_dev(entry), (unsigned long)entry->ino 10#define show_dev_ino(entry) show_dev(entry), (unsigned long)entry->ino
11 11
12TRACE_DEFINE_ENUM(NODE);
13TRACE_DEFINE_ENUM(DATA);
14TRACE_DEFINE_ENUM(META);
15TRACE_DEFINE_ENUM(META_FLUSH);
16TRACE_DEFINE_ENUM(CURSEG_HOT_DATA);
17TRACE_DEFINE_ENUM(CURSEG_WARM_DATA);
18TRACE_DEFINE_ENUM(CURSEG_COLD_DATA);
19TRACE_DEFINE_ENUM(CURSEG_HOT_NODE);
20TRACE_DEFINE_ENUM(CURSEG_WARM_NODE);
21TRACE_DEFINE_ENUM(CURSEG_COLD_NODE);
22TRACE_DEFINE_ENUM(NO_CHECK_TYPE);
23TRACE_DEFINE_ENUM(GC_GREEDY);
24TRACE_DEFINE_ENUM(GC_CB);
25TRACE_DEFINE_ENUM(FG_GC);
26TRACE_DEFINE_ENUM(BG_GC);
27TRACE_DEFINE_ENUM(LFS);
28TRACE_DEFINE_ENUM(SSR);
29TRACE_DEFINE_ENUM(__REQ_RAHEAD);
30TRACE_DEFINE_ENUM(__REQ_WRITE);
31TRACE_DEFINE_ENUM(__REQ_SYNC);
32TRACE_DEFINE_ENUM(__REQ_NOIDLE);
33TRACE_DEFINE_ENUM(__REQ_FLUSH);
34TRACE_DEFINE_ENUM(__REQ_FUA);
35TRACE_DEFINE_ENUM(__REQ_PRIO);
36TRACE_DEFINE_ENUM(__REQ_META);
37TRACE_DEFINE_ENUM(CP_UMOUNT);
38TRACE_DEFINE_ENUM(CP_FASTBOOT);
39TRACE_DEFINE_ENUM(CP_SYNC);
40TRACE_DEFINE_ENUM(CP_DISCARD);
41
12#define show_block_type(type) \ 42#define show_block_type(type) \
13 __print_symbolic(type, \ 43 __print_symbolic(type, \
14 { NODE, "NODE" }, \ 44 { NODE, "NODE" }, \
diff --git a/include/trace/events/intel-sst.h b/include/trace/events/intel-sst.h
index 76c72d3f1902..edc24e6dea1b 100644
--- a/include/trace/events/intel-sst.h
+++ b/include/trace/events/intel-sst.h
@@ -1,6 +1,13 @@
1#undef TRACE_SYSTEM 1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM intel-sst 2#define TRACE_SYSTEM intel-sst
3 3
4/*
5 * The TRACE_SYSTEM_VAR defaults to TRACE_SYSTEM, but must be a
6 * legitimate C variable. It is not exported to user space.
7 */
8#undef TRACE_SYSTEM_VAR
9#define TRACE_SYSTEM_VAR intel_sst
10
4#if !defined(_TRACE_INTEL_SST_H) || defined(TRACE_HEADER_MULTI_READ) 11#if !defined(_TRACE_INTEL_SST_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_INTEL_SST_H 12#define _TRACE_INTEL_SST_H
6 13
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index 3608bebd3d9c..ff8f6c091a15 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -9,19 +9,34 @@
9struct irqaction; 9struct irqaction;
10struct softirq_action; 10struct softirq_action;
11 11
12#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq } 12#define SOFTIRQ_NAME_LIST \
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(BLOCK_IOPOLL) \
19 softirq_name(TASKLET) \
20 softirq_name(SCHED) \
21 softirq_name(HRTIMER) \
22 softirq_name_end(RCU)
23
24#undef softirq_name
25#undef softirq_name_end
26
27#define softirq_name(sirq) TRACE_DEFINE_ENUM(sirq##_SOFTIRQ);
28#define softirq_name_end(sirq) TRACE_DEFINE_ENUM(sirq##_SOFTIRQ);
29
30SOFTIRQ_NAME_LIST
31
32#undef softirq_name
33#undef softirq_name_end
34
35#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq },
36#define softirq_name_end(sirq) { sirq##_SOFTIRQ, #sirq }
37
13#define show_softirq_name(val) \ 38#define show_softirq_name(val) \
14 __print_symbolic(val, \ 39 __print_symbolic(val, SOFTIRQ_NAME_LIST)
15 softirq_name(HI), \
16 softirq_name(TIMER), \
17 softirq_name(NET_TX), \
18 softirq_name(NET_RX), \
19 softirq_name(BLOCK), \
20 softirq_name(BLOCK_IOPOLL), \
21 softirq_name(TASKLET), \
22 softirq_name(SCHED), \
23 softirq_name(HRTIMER), \
24 softirq_name(RCU))
25 40
26/** 41/**
27 * irq_handler_entry - called immediately before the irq action handler 42 * irq_handler_entry - called immediately before the irq action handler
diff --git a/include/trace/events/migrate.h b/include/trace/events/migrate.h
index dd2b5467d905..539b25a76111 100644
--- a/include/trace/events/migrate.h
+++ b/include/trace/events/migrate.h
@@ -7,18 +7,40 @@
7#include <linux/tracepoint.h> 7#include <linux/tracepoint.h>
8 8
9#define MIGRATE_MODE \ 9#define MIGRATE_MODE \
10 {MIGRATE_ASYNC, "MIGRATE_ASYNC"}, \ 10 EM( MIGRATE_ASYNC, "MIGRATE_ASYNC") \
11 {MIGRATE_SYNC_LIGHT, "MIGRATE_SYNC_LIGHT"}, \ 11 EM( MIGRATE_SYNC_LIGHT, "MIGRATE_SYNC_LIGHT") \
12 {MIGRATE_SYNC, "MIGRATE_SYNC"} 12 EMe(MIGRATE_SYNC, "MIGRATE_SYNC")
13
13 14
14#define MIGRATE_REASON \ 15#define MIGRATE_REASON \
15 {MR_COMPACTION, "compaction"}, \ 16 EM( MR_COMPACTION, "compaction") \
16 {MR_MEMORY_FAILURE, "memory_failure"}, \ 17 EM( MR_MEMORY_FAILURE, "memory_failure") \
17 {MR_MEMORY_HOTPLUG, "memory_hotplug"}, \ 18 EM( MR_MEMORY_HOTPLUG, "memory_hotplug") \
18 {MR_SYSCALL, "syscall_or_cpuset"}, \ 19 EM( MR_SYSCALL, "syscall_or_cpuset") \
19 {MR_MEMPOLICY_MBIND, "mempolicy_mbind"}, \ 20 EM( MR_MEMPOLICY_MBIND, "mempolicy_mbind") \
20 {MR_NUMA_MISPLACED, "numa_misplaced"}, \ 21 EM( MR_NUMA_MISPLACED, "numa_misplaced") \
21 {MR_CMA, "cma"} 22 EMe(MR_CMA, "cma")
23
24/*
25 * First define the enums in the above macros to be exported to userspace
26 * via TRACE_DEFINE_ENUM().
27 */
28#undef EM
29#undef EMe
30#define EM(a, b) TRACE_DEFINE_ENUM(a);
31#define EMe(a, b) TRACE_DEFINE_ENUM(a);
32
33MIGRATE_MODE
34MIGRATE_REASON
35
36/*
37 * Now redefine the EM() and EMe() macros to map the enums to the strings
38 * that will be printed in the output.
39 */
40#undef EM
41#undef EMe
42#define EM(a, b) {a, b},
43#define EMe(a, b) {a, b}
22 44
23TRACE_EVENT(mm_migrate_pages, 45TRACE_EVENT(mm_migrate_pages,
24 46
diff --git a/include/trace/events/module.h b/include/trace/events/module.h
index 81c4c183d348..28c45997e451 100644
--- a/include/trace/events/module.h
+++ b/include/trace/events/module.h
@@ -84,7 +84,7 @@ DECLARE_EVENT_CLASS(module_refcnt,
84 __assign_str(name, mod->name); 84 __assign_str(name, mod->name);
85 ), 85 ),
86 86
87 TP_printk("%s call_site=%pf refcnt=%d", 87 TP_printk("%s call_site=%ps refcnt=%d",
88 __get_str(name), (void *)__entry->ip, __entry->refcnt) 88 __get_str(name), (void *)__entry->ip, __entry->refcnt)
89); 89);
90 90
@@ -121,7 +121,7 @@ TRACE_EVENT(module_request,
121 __assign_str(name, name); 121 __assign_str(name, name);
122 ), 122 ),
123 123
124 TP_printk("%s wait=%d call_site=%pf", 124 TP_printk("%s wait=%d call_site=%ps",
125 __get_str(name), (int)__entry->wait, (void *)__entry->ip) 125 __get_str(name), (int)__entry->wait, (void *)__entry->ip)
126); 126);
127 127
diff --git a/include/trace/events/random.h b/include/trace/events/random.h
index 805af6db41cc..4684de344c5d 100644
--- a/include/trace/events/random.h
+++ b/include/trace/events/random.h
@@ -22,7 +22,7 @@ TRACE_EVENT(add_device_randomness,
22 __entry->IP = IP; 22 __entry->IP = IP;
23 ), 23 ),
24 24
25 TP_printk("bytes %d caller %pF", 25 TP_printk("bytes %d caller %pS",
26 __entry->bytes, (void *)__entry->IP) 26 __entry->bytes, (void *)__entry->IP)
27); 27);
28 28
@@ -43,7 +43,7 @@ DECLARE_EVENT_CLASS(random__mix_pool_bytes,
43 __entry->IP = IP; 43 __entry->IP = IP;
44 ), 44 ),
45 45
46 TP_printk("%s pool: bytes %d caller %pF", 46 TP_printk("%s pool: bytes %d caller %pS",
47 __entry->pool_name, __entry->bytes, (void *)__entry->IP) 47 __entry->pool_name, __entry->bytes, (void *)__entry->IP)
48); 48);
49 49
@@ -82,7 +82,7 @@ TRACE_EVENT(credit_entropy_bits,
82 ), 82 ),
83 83
84 TP_printk("%s pool: bits %d entropy_count %d entropy_total %d " 84 TP_printk("%s pool: bits %d entropy_count %d entropy_total %d "
85 "caller %pF", __entry->pool_name, __entry->bits, 85 "caller %pS", __entry->pool_name, __entry->bits,
86 __entry->entropy_count, __entry->entropy_total, 86 __entry->entropy_count, __entry->entropy_total,
87 (void *)__entry->IP) 87 (void *)__entry->IP)
88); 88);
@@ -207,7 +207,7 @@ DECLARE_EVENT_CLASS(random__get_random_bytes,
207 __entry->IP = IP; 207 __entry->IP = IP;
208 ), 208 ),
209 209
210 TP_printk("nbytes %d caller %pF", __entry->nbytes, (void *)__entry->IP) 210 TP_printk("nbytes %d caller %pS", __entry->nbytes, (void *)__entry->IP)
211); 211);
212 212
213DEFINE_EVENT(random__get_random_bytes, get_random_bytes, 213DEFINE_EVENT(random__get_random_bytes, get_random_bytes,
@@ -242,7 +242,7 @@ DECLARE_EVENT_CLASS(random__extract_entropy,
242 __entry->IP = IP; 242 __entry->IP = IP;
243 ), 243 ),
244 244
245 TP_printk("%s pool: nbytes %d entropy_count %d caller %pF", 245 TP_printk("%s pool: nbytes %d entropy_count %d caller %pS",
246 __entry->pool_name, __entry->nbytes, __entry->entropy_count, 246 __entry->pool_name, __entry->nbytes, __entry->entropy_count,
247 (void *)__entry->IP) 247 (void *)__entry->IP)
248); 248);
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index b9c1dc6c825a..fd1a02cb3c82 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -179,27 +179,53 @@ DEFINE_EVENT(rpc_task_queued, rpc_task_wakeup,
179 179
180); 180);
181 181
182/*
183 * First define the enums in the below macros to be exported to userspace
184 * via TRACE_DEFINE_ENUM().
185 */
186#undef EM
187#undef EMe
188#define EM(a, b) TRACE_DEFINE_ENUM(a);
189#define EMe(a, b) TRACE_DEFINE_ENUM(a);
190
191#define RPC_SHOW_SOCKET \
192 EM( SS_FREE, "FREE" ) \
193 EM( SS_UNCONNECTED, "UNCONNECTED" ) \
194 EM( SS_CONNECTING, "CONNECTING," ) \
195 EM( SS_CONNECTED, "CONNECTED," ) \
196 EMe(SS_DISCONNECTING, "DISCONNECTING" )
197
182#define rpc_show_socket_state(state) \ 198#define rpc_show_socket_state(state) \
183 __print_symbolic(state, \ 199 __print_symbolic(state, RPC_SHOW_SOCKET)
184 { SS_FREE, "FREE" }, \ 200
185 { SS_UNCONNECTED, "UNCONNECTED" }, \ 201RPC_SHOW_SOCKET
186 { SS_CONNECTING, "CONNECTING," }, \ 202
187 { SS_CONNECTED, "CONNECTED," }, \ 203#define RPC_SHOW_SOCK \
188 { SS_DISCONNECTING, "DISCONNECTING" }) 204 EM( TCP_ESTABLISHED, "ESTABLISHED" ) \
205 EM( TCP_SYN_SENT, "SYN_SENT" ) \
206 EM( TCP_SYN_RECV, "SYN_RECV" ) \
207 EM( TCP_FIN_WAIT1, "FIN_WAIT1" ) \
208 EM( TCP_FIN_WAIT2, "FIN_WAIT2" ) \
209 EM( TCP_TIME_WAIT, "TIME_WAIT" ) \
210 EM( TCP_CLOSE, "CLOSE" ) \
211 EM( TCP_CLOSE_WAIT, "CLOSE_WAIT" ) \
212 EM( TCP_LAST_ACK, "LAST_ACK" ) \
213 EM( TCP_LISTEN, "LISTEN" ) \
214 EMe( TCP_CLOSING, "CLOSING" )
189 215
190#define rpc_show_sock_state(state) \ 216#define rpc_show_sock_state(state) \
191 __print_symbolic(state, \ 217 __print_symbolic(state, RPC_SHOW_SOCK)
192 { TCP_ESTABLISHED, "ESTABLISHED" }, \ 218
193 { TCP_SYN_SENT, "SYN_SENT" }, \ 219RPC_SHOW_SOCK
194 { TCP_SYN_RECV, "SYN_RECV" }, \ 220
195 { TCP_FIN_WAIT1, "FIN_WAIT1" }, \ 221/*
196 { TCP_FIN_WAIT2, "FIN_WAIT2" }, \ 222 * Now redefine the EM() and EMe() macros to map the enums to the strings
197 { TCP_TIME_WAIT, "TIME_WAIT" }, \ 223 * that will be printed in the output.
198 { TCP_CLOSE, "CLOSE" }, \ 224 */
199 { TCP_CLOSE_WAIT, "CLOSE_WAIT" }, \ 225#undef EM
200 { TCP_LAST_ACK, "LAST_ACK" }, \ 226#undef EMe
201 { TCP_LISTEN, "LISTEN" }, \ 227#define EM(a, b) {a, b},
202 { TCP_CLOSING, "CLOSING" }) 228#define EMe(a, b) {a, b}
203 229
204DECLARE_EVENT_CLASS(xs_socket_event, 230DECLARE_EVENT_CLASS(xs_socket_event,
205 231
diff --git a/include/trace/events/tlb.h b/include/trace/events/tlb.h
index 0e7635765153..4250f364a6ca 100644
--- a/include/trace/events/tlb.h
+++ b/include/trace/events/tlb.h
@@ -7,11 +7,31 @@
7#include <linux/mm_types.h> 7#include <linux/mm_types.h>
8#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
9 9
10#define TLB_FLUSH_REASON \ 10#define TLB_FLUSH_REASON \
11 { TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" }, \ 11 EM( TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" ) \
12 { TLB_REMOTE_SHOOTDOWN, "remote shootdown" }, \ 12 EM( TLB_REMOTE_SHOOTDOWN, "remote shootdown" ) \
13 { TLB_LOCAL_SHOOTDOWN, "local shootdown" }, \ 13 EM( TLB_LOCAL_SHOOTDOWN, "local shootdown" ) \
14 { TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" } 14 EMe( TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" )
15
16/*
17 * First define the enums in TLB_FLUSH_REASON to be exported to userspace
18 * via TRACE_DEFINE_ENUM().
19 */
20#undef EM
21#undef EMe
22#define EM(a,b) TRACE_DEFINE_ENUM(a);
23#define EMe(a,b) TRACE_DEFINE_ENUM(a);
24
25TLB_FLUSH_REASON
26
27/*
28 * Now redefine the EM() and EMe() macros to map the enums to the strings
29 * that will be printed in the output.
30 */
31#undef EM
32#undef EMe
33#define EM(a,b) { a, b },
34#define EMe(a,b) { a, b }
15 35
16TRACE_EVENT_CONDITION(tlb_flush, 36TRACE_EVENT_CONDITION(tlb_flush,
17 37
diff --git a/include/trace/events/v4l2.h b/include/trace/events/v4l2.h
index b9bb1f204693..20112170ff11 100644
--- a/include/trace/events/v4l2.h
+++ b/include/trace/events/v4l2.h
@@ -6,33 +6,58 @@
6 6
7#include <linux/tracepoint.h> 7#include <linux/tracepoint.h>
8 8
9#define show_type(type) \ 9/* Enums require being exported to userspace, for user tool parsing */
10 __print_symbolic(type, \ 10#undef EM
11 { V4L2_BUF_TYPE_VIDEO_CAPTURE, "VIDEO_CAPTURE" }, \ 11#undef EMe
12 { V4L2_BUF_TYPE_VIDEO_OUTPUT, "VIDEO_OUTPUT" }, \ 12#define EM(a, b) TRACE_DEFINE_ENUM(a);
13 { V4L2_BUF_TYPE_VIDEO_OVERLAY, "VIDEO_OVERLAY" }, \ 13#define EMe(a, b) TRACE_DEFINE_ENUM(a);
14 { V4L2_BUF_TYPE_VBI_CAPTURE, "VBI_CAPTURE" }, \ 14
15 { V4L2_BUF_TYPE_VBI_OUTPUT, "VBI_OUTPUT" }, \ 15#define show_type(type) \
16 { V4L2_BUF_TYPE_SLICED_VBI_CAPTURE, "SLICED_VBI_CAPTURE" }, \ 16 __print_symbolic(type, SHOW_TYPE)
17 { V4L2_BUF_TYPE_SLICED_VBI_OUTPUT, "SLICED_VBI_OUTPUT" }, \ 17
18 { V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY, "VIDEO_OUTPUT_OVERLAY" },\ 18#define SHOW_TYPE \
19 { V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, "VIDEO_CAPTURE_MPLANE" },\ 19 EM( V4L2_BUF_TYPE_VIDEO_CAPTURE, "VIDEO_CAPTURE" ) \
20 { V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, "VIDEO_OUTPUT_MPLANE" }, \ 20 EM( V4L2_BUF_TYPE_VIDEO_OUTPUT, "VIDEO_OUTPUT" ) \
21 { V4L2_BUF_TYPE_SDR_CAPTURE, "SDR_CAPTURE" }, \ 21 EM( V4L2_BUF_TYPE_VIDEO_OVERLAY, "VIDEO_OVERLAY" ) \
22 { V4L2_BUF_TYPE_PRIVATE, "PRIVATE" }) 22 EM( V4L2_BUF_TYPE_VBI_CAPTURE, "VBI_CAPTURE" ) \
23 EM( V4L2_BUF_TYPE_VBI_OUTPUT, "VBI_OUTPUT" ) \
24 EM( V4L2_BUF_TYPE_SLICED_VBI_CAPTURE, "SLICED_VBI_CAPTURE" ) \
25 EM( V4L2_BUF_TYPE_SLICED_VBI_OUTPUT, "SLICED_VBI_OUTPUT" ) \
26 EM( V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY, "VIDEO_OUTPUT_OVERLAY" ) \
27 EM( V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, "VIDEO_CAPTURE_MPLANE" ) \
28 EM( V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, "VIDEO_OUTPUT_MPLANE" ) \
29 EM( V4L2_BUF_TYPE_SDR_CAPTURE, "SDR_CAPTURE" ) \
30 EMe(V4L2_BUF_TYPE_PRIVATE, "PRIVATE" )
31
32SHOW_TYPE
23 33
24#define show_field(field) \ 34#define show_field(field) \
25 __print_symbolic(field, \ 35 __print_symbolic(field, SHOW_FIELD)
26 { V4L2_FIELD_ANY, "ANY" }, \ 36
27 { V4L2_FIELD_NONE, "NONE" }, \ 37#define SHOW_FIELD \
28 { V4L2_FIELD_TOP, "TOP" }, \ 38 EM( V4L2_FIELD_ANY, "ANY" ) \
29 { V4L2_FIELD_BOTTOM, "BOTTOM" }, \ 39 EM( V4L2_FIELD_NONE, "NONE" ) \
30 { V4L2_FIELD_INTERLACED, "INTERLACED" }, \ 40 EM( V4L2_FIELD_TOP, "TOP" ) \
31 { V4L2_FIELD_SEQ_TB, "SEQ_TB" }, \ 41 EM( V4L2_FIELD_BOTTOM, "BOTTOM" ) \
32 { V4L2_FIELD_SEQ_BT, "SEQ_BT" }, \ 42 EM( V4L2_FIELD_INTERLACED, "INTERLACED" ) \
33 { V4L2_FIELD_ALTERNATE, "ALTERNATE" }, \ 43 EM( V4L2_FIELD_SEQ_TB, "SEQ_TB" ) \
34 { V4L2_FIELD_INTERLACED_TB, "INTERLACED_TB" }, \ 44 EM( V4L2_FIELD_SEQ_BT, "SEQ_BT" ) \
35 { V4L2_FIELD_INTERLACED_BT, "INTERLACED_BT" }) 45 EM( V4L2_FIELD_ALTERNATE, "ALTERNATE" ) \
46 EM( V4L2_FIELD_INTERLACED_TB, "INTERLACED_TB" ) \
47 EMe( V4L2_FIELD_INTERLACED_BT, "INTERLACED_BT" )
48
49SHOW_FIELD
50
51/*
52 * Now redefine the EM() and EMe() macros to map the enums to the strings
53 * that will be printed in the output.
54 */
55#undef EM
56#undef EMe
57#define EM(a, b) {a, b},
58#define EMe(a, b) {a, b}
59
60/* V4L2_TC_TYPE_* are macros, not defines, they do not need processing */
36 61
37#define show_timecode_type(type) \ 62#define show_timecode_type(type) \
38 __print_symbolic(type, \ 63 __print_symbolic(type, \
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index 5a14ead59696..880dd7437172 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -23,15 +23,32 @@
23 {I_REFERENCED, "I_REFERENCED"} \ 23 {I_REFERENCED, "I_REFERENCED"} \
24 ) 24 )
25 25
26/* enums need to be exported to user space */
27#undef EM
28#undef EMe
29#define EM(a,b) TRACE_DEFINE_ENUM(a);
30#define EMe(a,b) TRACE_DEFINE_ENUM(a);
31
26#define WB_WORK_REASON \ 32#define WB_WORK_REASON \
27 {WB_REASON_BACKGROUND, "background"}, \ 33 EM( WB_REASON_BACKGROUND, "background") \
28 {WB_REASON_TRY_TO_FREE_PAGES, "try_to_free_pages"}, \ 34 EM( WB_REASON_TRY_TO_FREE_PAGES, "try_to_free_pages") \
29 {WB_REASON_SYNC, "sync"}, \ 35 EM( WB_REASON_SYNC, "sync") \
30 {WB_REASON_PERIODIC, "periodic"}, \ 36 EM( WB_REASON_PERIODIC, "periodic") \
31 {WB_REASON_LAPTOP_TIMER, "laptop_timer"}, \ 37 EM( WB_REASON_LAPTOP_TIMER, "laptop_timer") \
32 {WB_REASON_FREE_MORE_MEM, "free_more_memory"}, \ 38 EM( WB_REASON_FREE_MORE_MEM, "free_more_memory") \
33 {WB_REASON_FS_FREE_SPACE, "fs_free_space"}, \ 39 EM( WB_REASON_FS_FREE_SPACE, "fs_free_space") \
34 {WB_REASON_FORKER_THREAD, "forker_thread"} 40 EMe(WB_REASON_FORKER_THREAD, "forker_thread")
41
42WB_WORK_REASON
43
44/*
45 * Now redefine the EM() and EMe() macros to map the enums to the strings
46 * that will be printed in the output.
47 */
48#undef EM
49#undef EMe
50#define EM(a,b) { a, b },
51#define EMe(a,b) { a, b }
35 52
36struct wb_writeback_work; 53struct wb_writeback_work;
37 54
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 41bf65f04dd9..37d4b10b111d 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -18,6 +18,34 @@
18 18
19#include <linux/ftrace_event.h> 19#include <linux/ftrace_event.h>
20 20
21#ifndef TRACE_SYSTEM_VAR
22#define TRACE_SYSTEM_VAR TRACE_SYSTEM
23#endif
24
25#define __app__(x, y) str__##x##y
26#define __app(x, y) __app__(x, y)
27
28#define TRACE_SYSTEM_STRING __app(TRACE_SYSTEM_VAR,__trace_system_name)
29
30#define TRACE_MAKE_SYSTEM_STR() \
31 static const char TRACE_SYSTEM_STRING[] = \
32 __stringify(TRACE_SYSTEM)
33
34TRACE_MAKE_SYSTEM_STR();
35
36#undef TRACE_DEFINE_ENUM
37#define TRACE_DEFINE_ENUM(a) \
38 static struct trace_enum_map __used __initdata \
39 __##TRACE_SYSTEM##_##a = \
40 { \
41 .system = TRACE_SYSTEM_STRING, \
42 .enum_string = #a, \
43 .enum_value = a \
44 }; \
45 static struct trace_enum_map __used \
46 __attribute__((section("_ftrace_enum_map"))) \
47 *TRACE_SYSTEM##_##a = &__##TRACE_SYSTEM##_##a
48
21/* 49/*
22 * DECLARE_EVENT_CLASS can be used to add a generic function 50 * DECLARE_EVENT_CLASS can be used to add a generic function
23 * handlers for events. That is, if all events have the same 51 * handlers for events. That is, if all events have the same
@@ -105,7 +133,6 @@
105 133
106#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 134#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
107 135
108
109/* 136/*
110 * Stage 2 of the trace events. 137 * Stage 2 of the trace events.
111 * 138 *
@@ -122,6 +149,9 @@
122 * The size of an array is also encoded, in the higher 16 bits of <item>. 149 * The size of an array is also encoded, in the higher 16 bits of <item>.
123 */ 150 */
124 151
152#undef TRACE_DEFINE_ENUM
153#define TRACE_DEFINE_ENUM(a)
154
125#undef __field 155#undef __field
126#define __field(type, item) 156#define __field(type, item)
127 157
@@ -539,7 +569,7 @@ static inline notrace int ftrace_get_offsets_##call( \
539 * .trace = ftrace_raw_output_<call>, <-- stage 2 569 * .trace = ftrace_raw_output_<call>, <-- stage 2
540 * }; 570 * };
541 * 571 *
542 * static const char print_fmt_<call>[] = <TP_printk>; 572 * static char print_fmt_<call>[] = <TP_printk>;
543 * 573 *
544 * static struct ftrace_event_class __used event_class_<template> = { 574 * static struct ftrace_event_class __used event_class_<template> = {
545 * .system = "<system>", 575 * .system = "<system>",
@@ -690,9 +720,9 @@ static inline void ftrace_test_probe_##call(void) \
690#undef DECLARE_EVENT_CLASS 720#undef DECLARE_EVENT_CLASS
691#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 721#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
692_TRACE_PERF_PROTO(call, PARAMS(proto)); \ 722_TRACE_PERF_PROTO(call, PARAMS(proto)); \
693static const char print_fmt_##call[] = print; \ 723static char print_fmt_##call[] = print; \
694static struct ftrace_event_class __used __refdata event_class_##call = { \ 724static struct ftrace_event_class __used __refdata event_class_##call = { \
695 .system = __stringify(TRACE_SYSTEM), \ 725 .system = TRACE_SYSTEM_STRING, \
696 .define_fields = ftrace_define_fields_##call, \ 726 .define_fields = ftrace_define_fields_##call, \
697 .fields = LIST_HEAD_INIT(event_class_##call.fields),\ 727 .fields = LIST_HEAD_INIT(event_class_##call.fields),\
698 .raw_init = trace_event_raw_init, \ 728 .raw_init = trace_event_raw_init, \
@@ -719,7 +749,7 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
719#undef DEFINE_EVENT_PRINT 749#undef DEFINE_EVENT_PRINT
720#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ 750#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
721 \ 751 \
722static const char print_fmt_##call[] = print; \ 752static char print_fmt_##call[] = print; \
723 \ 753 \
724static struct ftrace_event_call __used event_##call = { \ 754static struct ftrace_event_call __used event_##call = { \
725 .class = &event_class_##template, \ 755 .class = &event_class_##template, \
@@ -735,6 +765,7 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
735 765
736#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 766#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
737 767
768#undef TRACE_SYSTEM_VAR
738 769
739#ifdef CONFIG_PERF_EVENTS 770#ifdef CONFIG_PERF_EVENTS
740 771
diff --git a/kernel/module.c b/kernel/module.c
index ec53f594e9c9..650b038ae520 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2770,6 +2770,9 @@ static int find_module_sections(struct module *mod, struct load_info *info)
2770 mod->trace_events = section_objs(info, "_ftrace_events", 2770 mod->trace_events = section_objs(info, "_ftrace_events",
2771 sizeof(*mod->trace_events), 2771 sizeof(*mod->trace_events),
2772 &mod->num_trace_events); 2772 &mod->num_trace_events);
2773 mod->trace_enums = section_objs(info, "_ftrace_enum_map",
2774 sizeof(*mod->trace_enums),
2775 &mod->num_trace_enums);
2773#endif 2776#endif
2774#ifdef CONFIG_TRACING 2777#ifdef CONFIG_TRACING
2775 mod->trace_bprintk_fmt_start = section_objs(info, "__trace_printk_fmt", 2778 mod->trace_bprintk_fmt_start = section_objs(info, "__trace_printk_fmt",
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index a5da09c899dd..fedbdd7d5d1e 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -599,6 +599,34 @@ config RING_BUFFER_STARTUP_TEST
599 599
600 If unsure, say N 600 If unsure, say N
601 601
602config TRACE_ENUM_MAP_FILE
603 bool "Show enum mappings for trace events"
604 depends on TRACING
605 help
606 The "print fmt" of the trace events will show the enum names instead
607 of their values. This can cause problems for user space tools that
608 use this string to parse the raw data as user space does not know
609 how to convert the string to its value.
610
611 To fix this, there's a special macro in the kernel that can be used
612 to convert the enum into its value. If this macro is used, then the
613 print fmt strings will have the enums converted to their values.
614
615 If something does not get converted properly, this option can be
616 used to show what enums the kernel tried to convert.
617
618 This option is for debugging the enum conversions. A file is created
619 in the tracing directory called "enum_map" that will show the enum
620 names matched with their values and what trace event system they
621 belong too.
622
623 Normally, the mapping of the strings to values will be freed after
624 boot up or module load. With this option, they will not be freed, as
625 they are needed for the "enum_map" file. Enabling this option will
626 increase the memory footprint of the running kernel.
627
628 If unsure, say N
629
602endif # FTRACE 630endif # FTRACE
603 631
604endif # TRACING_SUPPORT 632endif # TRACING_SUPPORT
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 5a2e0b53af30..02bece4a99ea 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -249,6 +249,19 @@ static void update_function_graph_func(void);
249static inline void update_function_graph_func(void) { } 249static inline void update_function_graph_func(void) { }
250#endif 250#endif
251 251
252
253static ftrace_func_t ftrace_ops_get_list_func(struct ftrace_ops *ops)
254{
255 /*
256 * If this is a dynamic ops or we force list func,
257 * then it needs to call the list anyway.
258 */
259 if (ops->flags & FTRACE_OPS_FL_DYNAMIC || FTRACE_FORCE_LIST_FUNC)
260 return ftrace_ops_list_func;
261
262 return ftrace_ops_get_func(ops);
263}
264
252static void update_ftrace_function(void) 265static void update_ftrace_function(void)
253{ 266{
254 ftrace_func_t func; 267 ftrace_func_t func;
@@ -270,7 +283,7 @@ static void update_ftrace_function(void)
270 * then have the mcount trampoline call the function directly. 283 * then have the mcount trampoline call the function directly.
271 */ 284 */
272 } else if (ftrace_ops_list->next == &ftrace_list_end) { 285 } else if (ftrace_ops_list->next == &ftrace_list_end) {
273 func = ftrace_ops_get_func(ftrace_ops_list); 286 func = ftrace_ops_get_list_func(ftrace_ops_list);
274 287
275 } else { 288 } else {
276 /* Just use the default ftrace_ops */ 289 /* Just use the default ftrace_ops */
@@ -5209,13 +5222,6 @@ static void ftrace_ops_recurs_func(unsigned long ip, unsigned long parent_ip,
5209ftrace_func_t ftrace_ops_get_func(struct ftrace_ops *ops) 5222ftrace_func_t ftrace_ops_get_func(struct ftrace_ops *ops)
5210{ 5223{
5211 /* 5224 /*
5212 * If this is a dynamic ops or we force list func,
5213 * then it needs to call the list anyway.
5214 */
5215 if (ops->flags & FTRACE_OPS_FL_DYNAMIC || FTRACE_FORCE_LIST_FUNC)
5216 return ftrace_ops_list_func;
5217
5218 /*
5219 * If the func handles its own recursion, call it directly. 5225 * If the func handles its own recursion, call it directly.
5220 * Otherwise call the recursion protected function that 5226 * Otherwise call the recursion protected function that
5221 * will call the ftrace ops function. 5227 * will call the ftrace ops function.
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 5040d44fe5a3..0315d43176d8 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -2679,7 +2679,7 @@ static DEFINE_PER_CPU(unsigned int, current_context);
2679 2679
2680static __always_inline int trace_recursive_lock(void) 2680static __always_inline int trace_recursive_lock(void)
2681{ 2681{
2682 unsigned int val = this_cpu_read(current_context); 2682 unsigned int val = __this_cpu_read(current_context);
2683 int bit; 2683 int bit;
2684 2684
2685 if (in_interrupt()) { 2685 if (in_interrupt()) {
@@ -2696,18 +2696,14 @@ static __always_inline int trace_recursive_lock(void)
2696 return 1; 2696 return 1;
2697 2697
2698 val |= (1 << bit); 2698 val |= (1 << bit);
2699 this_cpu_write(current_context, val); 2699 __this_cpu_write(current_context, val);
2700 2700
2701 return 0; 2701 return 0;
2702} 2702}
2703 2703
2704static __always_inline void trace_recursive_unlock(void) 2704static __always_inline void trace_recursive_unlock(void)
2705{ 2705{
2706 unsigned int val = this_cpu_read(current_context); 2706 __this_cpu_and(current_context, __this_cpu_read(current_context) - 1);
2707
2708 val--;
2709 val &= this_cpu_read(current_context);
2710 this_cpu_write(current_context, val);
2711} 2707}
2712 2708
2713#else 2709#else
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index bcfa2add6dda..91eecaaa43e0 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -125,6 +125,42 @@ enum ftrace_dump_mode ftrace_dump_on_oops;
125/* When set, tracing will stop when a WARN*() is hit */ 125/* When set, tracing will stop when a WARN*() is hit */
126int __disable_trace_on_warning; 126int __disable_trace_on_warning;
127 127
128#ifdef CONFIG_TRACE_ENUM_MAP_FILE
129/* Map of enums to their values, for "enum_map" file */
130struct trace_enum_map_head {
131 struct module *mod;
132 unsigned long length;
133};
134
135union trace_enum_map_item;
136
137struct trace_enum_map_tail {
138 /*
139 * "end" is first and points to NULL as it must be different
140 * than "mod" or "enum_string"
141 */
142 union trace_enum_map_item *next;
143 const char *end; /* points to NULL */
144};
145
146static DEFINE_MUTEX(trace_enum_mutex);
147
148/*
149 * The trace_enum_maps are saved in an array with two extra elements,
150 * one at the beginning, and one at the end. The beginning item contains
151 * the count of the saved maps (head.length), and the module they
152 * belong to if not built in (head.mod). The ending item contains a
153 * pointer to the next array of saved enum_map items.
154 */
155union trace_enum_map_item {
156 struct trace_enum_map map;
157 struct trace_enum_map_head head;
158 struct trace_enum_map_tail tail;
159};
160
161static union trace_enum_map_item *trace_enum_maps;
162#endif /* CONFIG_TRACE_ENUM_MAP_FILE */
163
128static int tracing_set_tracer(struct trace_array *tr, const char *buf); 164static int tracing_set_tracer(struct trace_array *tr, const char *buf);
129 165
130#define MAX_TRACER_SIZE 100 166#define MAX_TRACER_SIZE 100
@@ -3910,6 +3946,182 @@ static const struct file_operations tracing_saved_cmdlines_size_fops = {
3910 .write = tracing_saved_cmdlines_size_write, 3946 .write = tracing_saved_cmdlines_size_write,
3911}; 3947};
3912 3948
3949#ifdef CONFIG_TRACE_ENUM_MAP_FILE
3950static union trace_enum_map_item *
3951update_enum_map(union trace_enum_map_item *ptr)
3952{
3953 if (!ptr->map.enum_string) {
3954 if (ptr->tail.next) {
3955 ptr = ptr->tail.next;
3956 /* Set ptr to the next real item (skip head) */
3957 ptr++;
3958 } else
3959 return NULL;
3960 }
3961 return ptr;
3962}
3963
3964static void *enum_map_next(struct seq_file *m, void *v, loff_t *pos)
3965{
3966 union trace_enum_map_item *ptr = v;
3967
3968 /*
3969 * Paranoid! If ptr points to end, we don't want to increment past it.
3970 * This really should never happen.
3971 */
3972 ptr = update_enum_map(ptr);
3973 if (WARN_ON_ONCE(!ptr))
3974 return NULL;
3975
3976 ptr++;
3977
3978 (*pos)++;
3979
3980 ptr = update_enum_map(ptr);
3981
3982 return ptr;
3983}
3984
3985static void *enum_map_start(struct seq_file *m, loff_t *pos)
3986{
3987 union trace_enum_map_item *v;
3988 loff_t l = 0;
3989
3990 mutex_lock(&trace_enum_mutex);
3991
3992 v = trace_enum_maps;
3993 if (v)
3994 v++;
3995
3996 while (v && l < *pos) {
3997 v = enum_map_next(m, v, &l);
3998 }
3999
4000 return v;
4001}
4002
4003static void enum_map_stop(struct seq_file *m, void *v)
4004{
4005 mutex_unlock(&trace_enum_mutex);
4006}
4007
4008static int enum_map_show(struct seq_file *m, void *v)
4009{
4010 union trace_enum_map_item *ptr = v;
4011
4012 seq_printf(m, "%s %ld (%s)\n",
4013 ptr->map.enum_string, ptr->map.enum_value,
4014 ptr->map.system);
4015
4016 return 0;
4017}
4018
4019static const struct seq_operations tracing_enum_map_seq_ops = {
4020 .start = enum_map_start,
4021 .next = enum_map_next,
4022 .stop = enum_map_stop,
4023 .show = enum_map_show,
4024};
4025
4026static int tracing_enum_map_open(struct inode *inode, struct file *filp)
4027{
4028 if (tracing_disabled)
4029 return -ENODEV;
4030
4031 return seq_open(filp, &tracing_enum_map_seq_ops);
4032}
4033
4034static const struct file_operations tracing_enum_map_fops = {
4035 .open = tracing_enum_map_open,
4036 .read = seq_read,
4037 .llseek = seq_lseek,
4038 .release = seq_release,
4039};
4040
4041static inline union trace_enum_map_item *
4042trace_enum_jmp_to_tail(union trace_enum_map_item *ptr)
4043{
4044 /* Return tail of array given the head */
4045 return ptr + ptr->head.length + 1;
4046}
4047
4048static void
4049trace_insert_enum_map_file(struct module *mod, struct trace_enum_map **start,
4050 int len)
4051{
4052 struct trace_enum_map **stop;
4053 struct trace_enum_map **map;
4054 union trace_enum_map_item *map_array;
4055 union trace_enum_map_item *ptr;
4056
4057 stop = start + len;
4058
4059 /*
4060 * The trace_enum_maps contains the map plus a head and tail item,
4061 * where the head holds the module and length of array, and the
4062 * tail holds a pointer to the next list.
4063 */
4064 map_array = kmalloc(sizeof(*map_array) * (len + 2), GFP_KERNEL);
4065 if (!map_array) {
4066 pr_warning("Unable to allocate trace enum mapping\n");
4067 return;
4068 }
4069
4070 mutex_lock(&trace_enum_mutex);
4071
4072 if (!trace_enum_maps)
4073 trace_enum_maps = map_array;
4074 else {
4075 ptr = trace_enum_maps;
4076 for (;;) {
4077 ptr = trace_enum_jmp_to_tail(ptr);
4078 if (!ptr->tail.next)
4079 break;
4080 ptr = ptr->tail.next;
4081
4082 }
4083 ptr->tail.next = map_array;
4084 }
4085 map_array->head.mod = mod;
4086 map_array->head.length = len;
4087 map_array++;
4088
4089 for (map = start; (unsigned long)map < (unsigned long)stop; map++) {
4090 map_array->map = **map;
4091 map_array++;
4092 }
4093 memset(map_array, 0, sizeof(*map_array));
4094
4095 mutex_unlock(&trace_enum_mutex);
4096}
4097
4098static void trace_create_enum_file(struct dentry *d_tracer)
4099{
4100 trace_create_file("enum_map", 0444, d_tracer,
4101 NULL, &tracing_enum_map_fops);
4102}
4103
4104#else /* CONFIG_TRACE_ENUM_MAP_FILE */
4105static inline void trace_create_enum_file(struct dentry *d_tracer) { }
4106static inline void trace_insert_enum_map_file(struct module *mod,
4107 struct trace_enum_map **start, int len) { }
4108#endif /* !CONFIG_TRACE_ENUM_MAP_FILE */
4109
4110static void trace_insert_enum_map(struct module *mod,
4111 struct trace_enum_map **start, int len)
4112{
4113 struct trace_enum_map **map;
4114
4115 if (len <= 0)
4116 return;
4117
4118 map = start;
4119
4120 trace_event_enum_update(map, len);
4121
4122 trace_insert_enum_map_file(mod, start, len);
4123}
4124
3913static ssize_t 4125static ssize_t
3914tracing_set_trace_read(struct file *filp, char __user *ubuf, 4126tracing_set_trace_read(struct file *filp, char __user *ubuf,
3915 size_t cnt, loff_t *ppos) 4127 size_t cnt, loff_t *ppos)
@@ -6527,6 +6739,88 @@ struct dentry *tracing_init_dentry(void)
6527 return NULL; 6739 return NULL;
6528} 6740}
6529 6741
6742extern struct trace_enum_map *__start_ftrace_enum_maps[];
6743extern struct trace_enum_map *__stop_ftrace_enum_maps[];
6744
6745static void __init trace_enum_init(void)
6746{
6747 int len;
6748
6749 len = __stop_ftrace_enum_maps - __start_ftrace_enum_maps;
6750 trace_insert_enum_map(NULL, __start_ftrace_enum_maps, len);
6751}
6752
6753#ifdef CONFIG_MODULES
6754static void trace_module_add_enums(struct module *mod)
6755{
6756 if (!mod->num_trace_enums)
6757 return;
6758
6759 /*
6760 * Modules with bad taint do not have events created, do
6761 * not bother with enums either.
6762 */
6763 if (trace_module_has_bad_taint(mod))
6764 return;
6765
6766 trace_insert_enum_map(mod, mod->trace_enums, mod->num_trace_enums);
6767}
6768
6769#ifdef CONFIG_TRACE_ENUM_MAP_FILE
6770static void trace_module_remove_enums(struct module *mod)
6771{
6772 union trace_enum_map_item *map;
6773 union trace_enum_map_item **last = &trace_enum_maps;
6774
6775 if (!mod->num_trace_enums)
6776 return;
6777
6778 mutex_lock(&trace_enum_mutex);
6779
6780 map = trace_enum_maps;
6781
6782 while (map) {
6783 if (map->head.mod == mod)
6784 break;
6785 map = trace_enum_jmp_to_tail(map);
6786 last = &map->tail.next;
6787 map = map->tail.next;
6788 }
6789 if (!map)
6790 goto out;
6791
6792 *last = trace_enum_jmp_to_tail(map)->tail.next;
6793 kfree(map);
6794 out:
6795 mutex_unlock(&trace_enum_mutex);
6796}
6797#else
6798static inline void trace_module_remove_enums(struct module *mod) { }
6799#endif /* CONFIG_TRACE_ENUM_MAP_FILE */
6800
6801static int trace_module_notify(struct notifier_block *self,
6802 unsigned long val, void *data)
6803{
6804 struct module *mod = data;
6805
6806 switch (val) {
6807 case MODULE_STATE_COMING:
6808 trace_module_add_enums(mod);
6809 break;
6810 case MODULE_STATE_GOING:
6811 trace_module_remove_enums(mod);
6812 break;
6813 }
6814
6815 return 0;
6816}
6817
6818static struct notifier_block trace_module_nb = {
6819 .notifier_call = trace_module_notify,
6820 .priority = 0,
6821};
6822#endif /* CONFIG_MODULES */
6823
6530static __init int tracer_init_tracefs(void) 6824static __init int tracer_init_tracefs(void)
6531{ 6825{
6532 struct dentry *d_tracer; 6826 struct dentry *d_tracer;
@@ -6551,6 +6845,14 @@ static __init int tracer_init_tracefs(void)
6551 trace_create_file("saved_cmdlines_size", 0644, d_tracer, 6845 trace_create_file("saved_cmdlines_size", 0644, d_tracer,
6552 NULL, &tracing_saved_cmdlines_size_fops); 6846 NULL, &tracing_saved_cmdlines_size_fops);
6553 6847
6848 trace_enum_init();
6849
6850 trace_create_enum_file(d_tracer);
6851
6852#ifdef CONFIG_MODULES
6853 register_module_notifier(&trace_module_nb);
6854#endif
6855
6554#ifdef CONFIG_DYNAMIC_FTRACE 6856#ifdef CONFIG_DYNAMIC_FTRACE
6555 trace_create_file("dyn_ftrace_total_info", 0444, d_tracer, 6857 trace_create_file("dyn_ftrace_total_info", 0444, d_tracer,
6556 &ftrace_update_tot_cnt, &tracing_dyn_info_fops); 6858 &ftrace_update_tot_cnt, &tracing_dyn_info_fops);
@@ -6877,7 +7179,7 @@ void __init trace_init(void)
6877 tracepoint_printk = 0; 7179 tracepoint_printk = 0;
6878 } 7180 }
6879 tracer_alloc_buffers(); 7181 tracer_alloc_buffers();
6880 trace_event_init(); 7182 trace_event_init();
6881} 7183}
6882 7184
6883__init static int clear_boot_tracer(void) 7185__init static int clear_boot_tracer(void)
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index d951deddec89..d2612016de94 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -1309,8 +1309,10 @@ static inline void init_ftrace_syscalls(void) { }
1309 1309
1310#ifdef CONFIG_EVENT_TRACING 1310#ifdef CONFIG_EVENT_TRACING
1311void trace_event_init(void); 1311void trace_event_init(void);
1312void trace_event_enum_update(struct trace_enum_map **map, int len);
1312#else 1313#else
1313static inline void __init trace_event_init(void) { } 1314static inline void __init trace_event_init(void) { }
1315static inlin void trace_event_enum_update(struct trace_enum_map **map, int len) { }
1314#endif 1316#endif
1315 1317
1316extern struct trace_iterator *tracepoint_print_iter; 1318extern struct trace_iterator *tracepoint_print_iter;
diff --git a/kernel/trace/trace_entries.h b/kernel/trace/trace_entries.h
index e2d027ac66a2..ee7b94a4810a 100644
--- a/kernel/trace/trace_entries.h
+++ b/kernel/trace/trace_entries.h
@@ -223,7 +223,7 @@ FTRACE_ENTRY(bprint, bprint_entry,
223 __dynamic_array( u32, buf ) 223 __dynamic_array( u32, buf )
224 ), 224 ),
225 225
226 F_printk("%pf: %s", 226 F_printk("%ps: %s",
227 (void *)__entry->ip, __entry->fmt), 227 (void *)__entry->ip, __entry->fmt),
228 228
229 FILTER_OTHER 229 FILTER_OTHER
@@ -238,7 +238,7 @@ FTRACE_ENTRY(print, print_entry,
238 __dynamic_array( char, buf ) 238 __dynamic_array( char, buf )
239 ), 239 ),
240 240
241 F_printk("%pf: %s", 241 F_printk("%ps: %s",
242 (void *)__entry->ip, __entry->buf), 242 (void *)__entry->ip, __entry->buf),
243 243
244 FILTER_OTHER 244 FILTER_OTHER
@@ -253,7 +253,7 @@ FTRACE_ENTRY(bputs, bputs_entry,
253 __field( const char *, str ) 253 __field( const char *, str )
254 ), 254 ),
255 255
256 F_printk("%pf: %s", 256 F_printk("%ps: %s",
257 (void *)__entry->ip, __entry->str), 257 (void *)__entry->ip, __entry->str),
258 258
259 FILTER_OTHER 259 FILTER_OTHER
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 0d2e47370ee7..7da1dfeb322e 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1704,6 +1704,125 @@ __register_event(struct ftrace_event_call *call, struct module *mod)
1704 return 0; 1704 return 0;
1705} 1705}
1706 1706
1707static char *enum_replace(char *ptr, struct trace_enum_map *map, int len)
1708{
1709 int rlen;
1710 int elen;
1711
1712 /* Find the length of the enum value as a string */
1713 elen = snprintf(ptr, 0, "%ld", map->enum_value);
1714 /* Make sure there's enough room to replace the string with the value */
1715 if (len < elen)
1716 return NULL;
1717
1718 snprintf(ptr, elen + 1, "%ld", map->enum_value);
1719
1720 /* Get the rest of the string of ptr */
1721 rlen = strlen(ptr + len);
1722 memmove(ptr + elen, ptr + len, rlen);
1723 /* Make sure we end the new string */
1724 ptr[elen + rlen] = 0;
1725
1726 return ptr + elen;
1727}
1728
1729static void update_event_printk(struct ftrace_event_call *call,
1730 struct trace_enum_map *map)
1731{
1732 char *ptr;
1733 int quote = 0;
1734 int len = strlen(map->enum_string);
1735
1736 for (ptr = call->print_fmt; *ptr; ptr++) {
1737 if (*ptr == '\\') {
1738 ptr++;
1739 /* paranoid */
1740 if (!*ptr)
1741 break;
1742 continue;
1743 }
1744 if (*ptr == '"') {
1745 quote ^= 1;
1746 continue;
1747 }
1748 if (quote)
1749 continue;
1750 if (isdigit(*ptr)) {
1751 /* skip numbers */
1752 do {
1753 ptr++;
1754 /* Check for alpha chars like ULL */
1755 } while (isalnum(*ptr));
1756 /*
1757 * A number must have some kind of delimiter after
1758 * it, and we can ignore that too.
1759 */
1760 continue;
1761 }
1762 if (isalpha(*ptr) || *ptr == '_') {
1763 if (strncmp(map->enum_string, ptr, len) == 0 &&
1764 !isalnum(ptr[len]) && ptr[len] != '_') {
1765 ptr = enum_replace(ptr, map, len);
1766 /* Hmm, enum string smaller than value */
1767 if (WARN_ON_ONCE(!ptr))
1768 return;
1769 /*
1770 * No need to decrement here, as enum_replace()
1771 * returns the pointer to the character passed
1772 * the enum, and two enums can not be placed
1773 * back to back without something in between.
1774 * We can skip that something in between.
1775 */
1776 continue;
1777 }
1778 skip_more:
1779 do {
1780 ptr++;
1781 } while (isalnum(*ptr) || *ptr == '_');
1782 /*
1783 * If what comes after this variable is a '.' or
1784 * '->' then we can continue to ignore that string.
1785 */
1786 if (*ptr == '.' || (ptr[0] == '-' && ptr[1] == '>')) {
1787 ptr += *ptr == '.' ? 1 : 2;
1788 goto skip_more;
1789 }
1790 /*
1791 * Once again, we can skip the delimiter that came
1792 * after the string.
1793 */
1794 continue;
1795 }
1796 }
1797}
1798
1799void trace_event_enum_update(struct trace_enum_map **map, int len)
1800{
1801 struct ftrace_event_call *call, *p;
1802 const char *last_system = NULL;
1803 int last_i;
1804 int i;
1805
1806 down_write(&trace_event_sem);
1807 list_for_each_entry_safe(call, p, &ftrace_events, list) {
1808 /* events are usually grouped together with systems */
1809 if (!last_system || call->class->system != last_system) {
1810 last_i = 0;
1811 last_system = call->class->system;
1812 }
1813
1814 for (i = last_i; i < len; i++) {
1815 if (call->class->system == map[i]->system) {
1816 /* Save the first system if need be */
1817 if (!last_i)
1818 last_i = i;
1819 update_event_printk(call, map[i]);
1820 }
1821 }
1822 }
1823 up_write(&trace_event_sem);
1824}
1825
1707static struct ftrace_event_file * 1826static struct ftrace_event_file *
1708trace_create_new_event(struct ftrace_event_call *call, 1827trace_create_new_event(struct ftrace_event_call *call,
1709 struct trace_array *tr) 1828 struct trace_array *tr)
@@ -1915,7 +2034,7 @@ static int trace_module_notify(struct notifier_block *self,
1915 2034
1916static struct notifier_block trace_module_nb = { 2035static struct notifier_block trace_module_nb = {
1917 .notifier_call = trace_module_notify, 2036 .notifier_call = trace_module_notify,
1918 .priority = 0, 2037 .priority = 1, /* higher than trace.c module notify */
1919}; 2038};
1920#endif /* CONFIG_MODULES */ 2039#endif /* CONFIG_MODULES */
1921 2040
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c
index 12e2b99be862..174a6a71146c 100644
--- a/kernel/trace/trace_export.c
+++ b/kernel/trace/trace_export.c
@@ -177,7 +177,7 @@ struct ftrace_event_call __used event_##call = { \
177 }, \ 177 }, \
178 .event.type = etype, \ 178 .event.type = etype, \
179 .print_fmt = print, \ 179 .print_fmt = print, \
180 .flags = TRACE_EVENT_FL_IGNORE_ENABLE | TRACE_EVENT_FL_USE_CALL_FILTER, \ 180 .flags = TRACE_EVENT_FL_IGNORE_ENABLE, \
181}; \ 181}; \
182struct ftrace_event_call __used \ 182struct ftrace_event_call __used \
183__attribute__((section("_ftrace_events"))) *__event_##call = &event_##call; 183__attribute__((section("_ftrace_events"))) *__event_##call = &event_##call;
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index ed998fbf09ce..9ba3f43f580e 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -250,7 +250,7 @@ DEFINE_FETCH_symbol(string_size)
250#define fetch_file_offset_string_size NULL 250#define fetch_file_offset_string_size NULL
251 251
252/* Fetch type information table */ 252/* Fetch type information table */
253const struct fetch_type kprobes_fetch_type_table[] = { 253static const struct fetch_type kprobes_fetch_type_table[] = {
254 /* Special types */ 254 /* Special types */
255 [FETCH_TYPE_STRING] = __ASSIGN_FETCH_TYPE("string", string, string, 255 [FETCH_TYPE_STRING] = __ASSIGN_FETCH_TYPE("string", string, string,
256 sizeof(u32), 1, "__data_loc char[]"), 256 sizeof(u32), 1, "__data_loc char[]"),
@@ -760,7 +760,8 @@ static int create_trace_kprobe(int argc, char **argv)
760 760
761 /* Parse fetch argument */ 761 /* Parse fetch argument */
762 ret = traceprobe_parse_probe_arg(arg, &tk->tp.size, parg, 762 ret = traceprobe_parse_probe_arg(arg, &tk->tp.size, parg,
763 is_return, true); 763 is_return, true,
764 kprobes_fetch_type_table);
764 if (ret) { 765 if (ret) {
765 pr_info("Parse error at argument[%d]. (%d)\n", i, ret); 766 pr_info("Parse error at argument[%d]. (%d)\n", i, ret);
766 goto error; 767 goto error;
diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index b983b2fd2ca1..1769a81da8a7 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -356,17 +356,14 @@ static int parse_probe_vars(char *arg, const struct fetch_type *t,
356 356
357/* Recursive argument parser */ 357/* Recursive argument parser */
358static int parse_probe_arg(char *arg, const struct fetch_type *t, 358static int parse_probe_arg(char *arg, const struct fetch_type *t,
359 struct fetch_param *f, bool is_return, bool is_kprobe) 359 struct fetch_param *f, bool is_return, bool is_kprobe,
360 const struct fetch_type *ftbl)
360{ 361{
361 const struct fetch_type *ftbl;
362 unsigned long param; 362 unsigned long param;
363 long offset; 363 long offset;
364 char *tmp; 364 char *tmp;
365 int ret = 0; 365 int ret = 0;
366 366
367 ftbl = is_kprobe ? kprobes_fetch_type_table : uprobes_fetch_type_table;
368 BUG_ON(ftbl == NULL);
369
370 switch (arg[0]) { 367 switch (arg[0]) {
371 case '$': 368 case '$':
372 ret = parse_probe_vars(arg + 1, t, f, is_return, is_kprobe); 369 ret = parse_probe_vars(arg + 1, t, f, is_return, is_kprobe);
@@ -447,7 +444,7 @@ static int parse_probe_arg(char *arg, const struct fetch_type *t,
447 dprm->fetch_size = get_fetch_size_function(t, 444 dprm->fetch_size = get_fetch_size_function(t,
448 dprm->fetch, ftbl); 445 dprm->fetch, ftbl);
449 ret = parse_probe_arg(arg, t2, &dprm->orig, is_return, 446 ret = parse_probe_arg(arg, t2, &dprm->orig, is_return,
450 is_kprobe); 447 is_kprobe, ftbl);
451 if (ret) 448 if (ret)
452 kfree(dprm); 449 kfree(dprm);
453 else { 450 else {
@@ -505,15 +502,12 @@ static int __parse_bitfield_probe_arg(const char *bf,
505 502
506/* String length checking wrapper */ 503/* String length checking wrapper */
507int traceprobe_parse_probe_arg(char *arg, ssize_t *size, 504int traceprobe_parse_probe_arg(char *arg, ssize_t *size,
508 struct probe_arg *parg, bool is_return, bool is_kprobe) 505 struct probe_arg *parg, bool is_return, bool is_kprobe,
506 const struct fetch_type *ftbl)
509{ 507{
510 const struct fetch_type *ftbl;
511 const char *t; 508 const char *t;
512 int ret; 509 int ret;
513 510
514 ftbl = is_kprobe ? kprobes_fetch_type_table : uprobes_fetch_type_table;
515 BUG_ON(ftbl == NULL);
516
517 if (strlen(arg) > MAX_ARGSTR_LEN) { 511 if (strlen(arg) > MAX_ARGSTR_LEN) {
518 pr_info("Argument is too long.: %s\n", arg); 512 pr_info("Argument is too long.: %s\n", arg);
519 return -ENOSPC; 513 return -ENOSPC;
@@ -535,7 +529,8 @@ int traceprobe_parse_probe_arg(char *arg, ssize_t *size,
535 } 529 }
536 parg->offset = *size; 530 parg->offset = *size;
537 *size += parg->type->size; 531 *size += parg->type->size;
538 ret = parse_probe_arg(arg, parg->type, &parg->fetch, is_return, is_kprobe); 532 ret = parse_probe_arg(arg, parg->type, &parg->fetch, is_return,
533 is_kprobe, ftbl);
539 534
540 if (ret >= 0 && t != NULL) 535 if (ret >= 0 && t != NULL)
541 ret = __parse_bitfield_probe_arg(t, parg->type, &parg->fetch); 536 ret = __parse_bitfield_probe_arg(t, parg->type, &parg->fetch);
diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
index 19aff635841a..ab283e146b70 100644
--- a/kernel/trace/trace_probe.h
+++ b/kernel/trace/trace_probe.h
@@ -229,13 +229,6 @@ ASSIGN_FETCH_FUNC(file_offset, ftype), \
229#define FETCH_TYPE_STRING 0 229#define FETCH_TYPE_STRING 0
230#define FETCH_TYPE_STRSIZE 1 230#define FETCH_TYPE_STRSIZE 1
231 231
232/*
233 * Fetch type information table.
234 * It's declared as a weak symbol due to conditional compilation.
235 */
236extern __weak const struct fetch_type kprobes_fetch_type_table[];
237extern __weak const struct fetch_type uprobes_fetch_type_table[];
238
239#ifdef CONFIG_KPROBE_EVENT 232#ifdef CONFIG_KPROBE_EVENT
240struct symbol_cache; 233struct symbol_cache;
241unsigned long update_symbol_cache(struct symbol_cache *sc); 234unsigned long update_symbol_cache(struct symbol_cache *sc);
@@ -333,7 +326,8 @@ find_event_file_link(struct trace_probe *tp, struct ftrace_event_file *file)
333} 326}
334 327
335extern int traceprobe_parse_probe_arg(char *arg, ssize_t *size, 328extern int traceprobe_parse_probe_arg(char *arg, ssize_t *size,
336 struct probe_arg *parg, bool is_return, bool is_kprobe); 329 struct probe_arg *parg, bool is_return, bool is_kprobe,
330 const struct fetch_type *ftbl);
337 331
338extern int traceprobe_conflict_field_name(const char *name, 332extern int traceprobe_conflict_field_name(const char *name,
339 struct probe_arg *args, int narg); 333 struct probe_arg *args, int narg);
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index 7dc1c8abecd6..74865465e0b7 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -196,7 +196,7 @@ DEFINE_FETCH_file_offset(string)
196DEFINE_FETCH_file_offset(string_size) 196DEFINE_FETCH_file_offset(string_size)
197 197
198/* Fetch type information table */ 198/* Fetch type information table */
199const struct fetch_type uprobes_fetch_type_table[] = { 199static const struct fetch_type uprobes_fetch_type_table[] = {
200 /* Special types */ 200 /* Special types */
201 [FETCH_TYPE_STRING] = __ASSIGN_FETCH_TYPE("string", string, string, 201 [FETCH_TYPE_STRING] = __ASSIGN_FETCH_TYPE("string", string, string,
202 sizeof(u32), 1, "__data_loc char[]"), 202 sizeof(u32), 1, "__data_loc char[]"),
@@ -535,7 +535,8 @@ static int create_trace_uprobe(int argc, char **argv)
535 535
536 /* Parse fetch argument */ 536 /* Parse fetch argument */
537 ret = traceprobe_parse_probe_arg(arg, &tu->tp.size, parg, 537 ret = traceprobe_parse_probe_arg(arg, &tu->tp.size, parg,
538 is_return, false); 538 is_return, false,
539 uprobes_fetch_type_table);
539 if (ret) { 540 if (ret) {
540 pr_info("Parse error at argument[%d]. (%d)\n", i, ret); 541 pr_info("Parse error at argument[%d]. (%d)\n", i, ret);
541 goto error; 542 goto error;
diff --git a/net/mac80211/trace.c b/net/mac80211/trace.c
index 386e45d8a958..edfe0c170a1c 100644
--- a/net/mac80211/trace.c
+++ b/net/mac80211/trace.c
@@ -8,6 +8,7 @@
8#include "debug.h" 8#include "debug.h"
9#define CREATE_TRACE_POINTS 9#define CREATE_TRACE_POINTS
10#include "trace.h" 10#include "trace.h"
11#include "trace_msg.h"
11 12
12#ifdef CONFIG_MAC80211_MESSAGE_TRACING 13#ifdef CONFIG_MAC80211_MESSAGE_TRACING
13void __sdata_info(const char *fmt, ...) 14void __sdata_info(const char *fmt, ...)
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 263a9561eb26..755a5388dbca 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -2312,44 +2312,6 @@ TRACE_EVENT(drv_tdls_recv_channel_switch,
2312 ) 2312 )
2313); 2313);
2314 2314
2315#ifdef CONFIG_MAC80211_MESSAGE_TRACING
2316#undef TRACE_SYSTEM
2317#define TRACE_SYSTEM mac80211_msg
2318
2319#define MAX_MSG_LEN 100
2320
2321DECLARE_EVENT_CLASS(mac80211_msg_event,
2322 TP_PROTO(struct va_format *vaf),
2323
2324 TP_ARGS(vaf),
2325
2326 TP_STRUCT__entry(
2327 __dynamic_array(char, msg, MAX_MSG_LEN)
2328 ),
2329
2330 TP_fast_assign(
2331 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
2332 MAX_MSG_LEN, vaf->fmt,
2333 *vaf->va) >= MAX_MSG_LEN);
2334 ),
2335
2336 TP_printk("%s", __get_str(msg))
2337);
2338
2339DEFINE_EVENT(mac80211_msg_event, mac80211_info,
2340 TP_PROTO(struct va_format *vaf),
2341 TP_ARGS(vaf)
2342);
2343DEFINE_EVENT(mac80211_msg_event, mac80211_dbg,
2344 TP_PROTO(struct va_format *vaf),
2345 TP_ARGS(vaf)
2346);
2347DEFINE_EVENT(mac80211_msg_event, mac80211_err,
2348 TP_PROTO(struct va_format *vaf),
2349 TP_ARGS(vaf)
2350);
2351#endif
2352
2353#endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */ 2315#endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
2354 2316
2355#undef TRACE_INCLUDE_PATH 2317#undef TRACE_INCLUDE_PATH
diff --git a/net/mac80211/trace_msg.h b/net/mac80211/trace_msg.h
new file mode 100644
index 000000000000..768f7c22a190
--- /dev/null
+++ b/net/mac80211/trace_msg.h
@@ -0,0 +1,53 @@
1#ifdef CONFIG_MAC80211_MESSAGE_TRACING
2
3#if !defined(__MAC80211_MSG_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
4#define __MAC80211_MSG_DRIVER_TRACE
5
6#include <linux/tracepoint.h>
7#include <net/mac80211.h>
8#include "ieee80211_i.h"
9
10#undef TRACE_SYSTEM
11#define TRACE_SYSTEM mac80211_msg
12
13#define MAX_MSG_LEN 100
14
15DECLARE_EVENT_CLASS(mac80211_msg_event,
16 TP_PROTO(struct va_format *vaf),
17
18 TP_ARGS(vaf),
19
20 TP_STRUCT__entry(
21 __dynamic_array(char, msg, MAX_MSG_LEN)
22 ),
23
24 TP_fast_assign(
25 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
26 MAX_MSG_LEN, vaf->fmt,
27 *vaf->va) >= MAX_MSG_LEN);
28 ),
29
30 TP_printk("%s", __get_str(msg))
31);
32
33DEFINE_EVENT(mac80211_msg_event, mac80211_info,
34 TP_PROTO(struct va_format *vaf),
35 TP_ARGS(vaf)
36);
37DEFINE_EVENT(mac80211_msg_event, mac80211_dbg,
38 TP_PROTO(struct va_format *vaf),
39 TP_ARGS(vaf)
40);
41DEFINE_EVENT(mac80211_msg_event, mac80211_err,
42 TP_PROTO(struct va_format *vaf),
43 TP_ARGS(vaf)
44);
45#endif /* !__MAC80211_MSG_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
46
47#undef TRACE_INCLUDE_PATH
48#define TRACE_INCLUDE_PATH .
49#undef TRACE_INCLUDE_FILE
50#define TRACE_INCLUDE_FILE trace_msg
51#include <trace/define_trace.h>
52
53#endif
diff --git a/samples/trace_events/trace-events-sample.h b/samples/trace_events/trace-events-sample.h
index a2c8b02b6359..8965d1bb8811 100644
--- a/samples/trace_events/trace-events-sample.h
+++ b/samples/trace_events/trace-events-sample.h
@@ -22,7 +22,25 @@
22 * protection, just like TRACE_INCLUDE_FILE. 22 * protection, just like TRACE_INCLUDE_FILE.
23 */ 23 */
24#undef TRACE_SYSTEM 24#undef TRACE_SYSTEM
25#define TRACE_SYSTEM sample 25#define TRACE_SYSTEM sample-trace
26
27/*
28 * TRACE_SYSTEM is expected to be a C valid variable (alpha-numeric
29 * and underscore), although it may start with numbers. If for some
30 * reason it is not, you need to add the following lines:
31 */
32#undef TRACE_SYSTEM_VAR
33#define TRACE_SYSTEM_VAR sample_trace
34/*
35 * But the above is only needed if TRACE_SYSTEM is not alpha-numeric
36 * and underscored. By default, TRACE_SYSTEM_VAR will be equal to
37 * TRACE_SYSTEM. As TRACE_SYSTEM_VAR must be alpha-numeric, if
38 * TRACE_SYSTEM is not, then TRACE_SYSTEM_VAR must be defined with
39 * only alpha-numeric and underscores.
40 *
41 * The TRACE_SYSTEM_VAR is only used internally and not visible to
42 * user space.
43 */
26 44
27/* 45/*
28 * Notice that this file is not protected like a normal header. 46 * Notice that this file is not protected like a normal header.
@@ -180,8 +198,30 @@ static inline int __length_of(const int *list)
180 ; 198 ;
181 return i; 199 return i;
182} 200}
201
202enum {
203 TRACE_SAMPLE_FOO = 2,
204 TRACE_SAMPLE_BAR = 4,
205 TRACE_SAMPLE_ZOO = 8,
206};
183#endif 207#endif
184 208
209/*
210 * If enums are used in the TP_printk(), their names will be shown in
211 * format files and not their values. This can cause problems with user
212 * space programs that parse the format files to know how to translate
213 * the raw binary trace output into human readable text.
214 *
215 * To help out user space programs, any enum that is used in the TP_printk()
216 * should be defined by TRACE_DEFINE_ENUM() macro. All that is needed to
217 * be done is to add this macro with the enum within it in the trace
218 * header file, and it will be converted in the output.
219 */
220
221TRACE_DEFINE_ENUM(TRACE_SAMPLE_FOO);
222TRACE_DEFINE_ENUM(TRACE_SAMPLE_BAR);
223TRACE_DEFINE_ENUM(TRACE_SAMPLE_ZOO);
224
185TRACE_EVENT(foo_bar, 225TRACE_EVENT(foo_bar,
186 226
187 TP_PROTO(const char *foo, int bar, const int *lst, 227 TP_PROTO(const char *foo, int bar, const int *lst,
@@ -206,7 +246,47 @@ TRACE_EVENT(foo_bar,
206 __assign_bitmask(cpus, cpumask_bits(mask), num_possible_cpus()); 246 __assign_bitmask(cpus, cpumask_bits(mask), num_possible_cpus());
207 ), 247 ),
208 248
209 TP_printk("foo %s %d %s %s (%s)", __entry->foo, __entry->bar, 249 TP_printk("foo %s %d %s %s %s %s (%s)", __entry->foo, __entry->bar,
250
251/*
252 * Notice here the use of some helper functions. This includes:
253 *
254 * __print_symbolic( variable, { value, "string" }, ... ),
255 *
256 * The variable is tested against each value of the { } pair. If
257 * the variable matches one of the values, then it will print the
258 * string in that pair. If non are matched, it returns a string
259 * version of the number (if __entry->bar == 7 then "7" is returned).
260 */
261 __print_symbolic(__entry->bar,
262 { 0, "zero" },
263 { TRACE_SAMPLE_FOO, "TWO" },
264 { TRACE_SAMPLE_BAR, "FOUR" },
265 { TRACE_SAMPLE_ZOO, "EIGHT" },
266 { 10, "TEN" }
267 ),
268
269/*
270 * __print_flags( variable, "delim", { value, "flag" }, ... ),
271 *
272 * This is similar to __print_symbolic, except that it tests the bits
273 * of the value. If ((FLAG & variable) == FLAG) then the string is
274 * printed. If more than one flag matches, then each one that does is
275 * also printed with delim in between them.
276 * If not all bits are accounted for, then the not found bits will be
277 * added in hex format: 0x506 will show BIT2|BIT4|0x500
278 */
279 __print_flags(__entry->bar, "|",
280 { 1, "BIT1" },
281 { 2, "BIT2" },
282 { 4, "BIT3" },
283 { 8, "BIT4" }
284 ),
285/*
286 * __print_array( array, len, element_size )
287 *
288 * This prints out the array that is defined by __array in a nice format.
289 */
210 __print_array(__get_dynamic_array(list), 290 __print_array(__get_dynamic_array(list),
211 __get_dynamic_array_len(list), 291 __get_dynamic_array_len(list),
212 sizeof(int)), 292 sizeof(int)),
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index afe20ed9fac8..2c0bd8f2aad0 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -3976,7 +3976,7 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc
3976 if (asprintf(&arg->atom.atom, "%lld", ip) < 0) 3976 if (asprintf(&arg->atom.atom, "%lld", ip) < 0)
3977 goto out_free; 3977 goto out_free;
3978 3978
3979 /* skip the first "%pf: " */ 3979 /* skip the first "%ps: " */
3980 for (ptr = fmt + 5, bptr = data + field->offset; 3980 for (ptr = fmt + 5, bptr = data + field->offset;
3981 bptr < data + size && *ptr; ptr++) { 3981 bptr < data + size && *ptr; ptr++) {
3982 int ls = 0; 3982 int ls = 0;