blob: 4250f364a6caad06a436636bf2a33a05aa442dbf [file] [log] [blame]
Dave Hansend17d8f92014-07-31 08:40:59 -07001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM tlb
3
4#if !defined(_TRACE_TLB_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_TLB_H
6
7#include <linux/mm_types.h>
8#include <linux/tracepoint.h>
9
Steven Rostedt (Red Hat)23b97662015-03-24 18:15:57 -040010#define TLB_FLUSH_REASON \
11 EM( TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" ) \
12 EM( TLB_REMOTE_SHOOTDOWN, "remote shootdown" ) \
13 EM( TLB_LOCAL_SHOOTDOWN, "local 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 }
Dave Hansend17d8f92014-07-31 08:40:59 -070035
Steven Rostedt (Red Hat)6c8465a2015-02-06 14:18:19 -050036TRACE_EVENT_CONDITION(tlb_flush,
Dave Hansend17d8f92014-07-31 08:40:59 -070037
38 TP_PROTO(int reason, unsigned long pages),
39 TP_ARGS(reason, pages),
40
Steven Rostedt (Red Hat)6c8465a2015-02-06 14:18:19 -050041 TP_CONDITION(cpu_online(smp_processor_id())),
42
Dave Hansend17d8f92014-07-31 08:40:59 -070043 TP_STRUCT__entry(
44 __field( int, reason)
45 __field(unsigned long, pages)
46 ),
47
48 TP_fast_assign(
49 __entry->reason = reason;
50 __entry->pages = pages;
51 ),
52
53 TP_printk("pages:%ld reason:%s (%d)",
54 __entry->pages,
55 __print_symbolic(__entry->reason, TLB_FLUSH_REASON),
56 __entry->reason)
57);
58
59#endif /* _TRACE_TLB_H */
60
61/* This part must be outside protection */
62#include <trace/define_trace.h>