blob: b4d8e7dc38f880d0fe955c59543319edb7d186b5 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Dave Hansend17d8f92014-07-31 08:40:59 -07002#undef TRACE_SYSTEM
3#define TRACE_SYSTEM tlb
4
5#if !defined(_TRACE_TLB_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_TLB_H
7
8#include <linux/mm_types.h>
9#include <linux/tracepoint.h>
10
Steven Rostedt (Red Hat)23b97662015-03-24 18:15:57 -040011#define TLB_FLUSH_REASON \
12 EM( TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" ) \
13 EM( TLB_REMOTE_SHOOTDOWN, "remote shootdown" ) \
14 EM( TLB_LOCAL_SHOOTDOWN, "local shootdown" ) \
Mel Gorman5b742832015-09-04 15:47:29 -070015 EM( TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" ) \
16 EMe( TLB_REMOTE_SEND_IPI, "remote ipi send" )
Steven Rostedt (Red Hat)23b97662015-03-24 18:15:57 -040017
18/*
19 * First define the enums in TLB_FLUSH_REASON to be exported to userspace
20 * via TRACE_DEFINE_ENUM().
21 */
22#undef EM
23#undef EMe
24#define EM(a,b) TRACE_DEFINE_ENUM(a);
25#define EMe(a,b) TRACE_DEFINE_ENUM(a);
26
27TLB_FLUSH_REASON
28
29/*
30 * Now redefine the EM() and EMe() macros to map the enums to the strings
31 * that will be printed in the output.
32 */
33#undef EM
34#undef EMe
35#define EM(a,b) { a, b },
36#define EMe(a,b) { a, b }
Dave Hansend17d8f92014-07-31 08:40:59 -070037
Steven Rostedt (Red Hat)633f6f52016-02-19 13:59:54 -050038TRACE_EVENT(tlb_flush,
Dave Hansend17d8f92014-07-31 08:40:59 -070039
40 TP_PROTO(int reason, unsigned long pages),
41 TP_ARGS(reason, pages),
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>