Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / trace / events / memcg.h
blobdfe2f51019b4c126064759d68c23108644b52ba8
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM memcg
5 #if !defined(_TRACE_MEMCG_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_MEMCG_H
8 #include <linux/memcontrol.h>
9 #include <linux/tracepoint.h>
12 DECLARE_EVENT_CLASS(memcg_rstat_stats,
14 TP_PROTO(struct mem_cgroup *memcg, int item, int val),
16 TP_ARGS(memcg, item, val),
18 TP_STRUCT__entry(
19 __field(u64, id)
20 __field(int, item)
21 __field(int, val)
24 TP_fast_assign(
25 __entry->id = cgroup_id(memcg->css.cgroup);
26 __entry->item = item;
27 __entry->val = val;
30 TP_printk("memcg_id=%llu item=%d val=%d",
31 __entry->id, __entry->item, __entry->val)
34 DEFINE_EVENT(memcg_rstat_stats, mod_memcg_state,
36 TP_PROTO(struct mem_cgroup *memcg, int item, int val),
38 TP_ARGS(memcg, item, val)
41 DEFINE_EVENT(memcg_rstat_stats, mod_memcg_lruvec_state,
43 TP_PROTO(struct mem_cgroup *memcg, int item, int val),
45 TP_ARGS(memcg, item, val)
48 DECLARE_EVENT_CLASS(memcg_rstat_events,
50 TP_PROTO(struct mem_cgroup *memcg, int item, unsigned long val),
52 TP_ARGS(memcg, item, val),
54 TP_STRUCT__entry(
55 __field(u64, id)
56 __field(int, item)
57 __field(unsigned long, val)
60 TP_fast_assign(
61 __entry->id = cgroup_id(memcg->css.cgroup);
62 __entry->item = item;
63 __entry->val = val;
66 TP_printk("memcg_id=%llu item=%d val=%lu",
67 __entry->id, __entry->item, __entry->val)
70 DEFINE_EVENT(memcg_rstat_events, count_memcg_events,
72 TP_PROTO(struct mem_cgroup *memcg, int item, unsigned long val),
74 TP_ARGS(memcg, item, val)
77 TRACE_EVENT(memcg_flush_stats,
79 TP_PROTO(struct mem_cgroup *memcg, s64 stats_updates,
80 bool force, bool needs_flush),
82 TP_ARGS(memcg, stats_updates, force, needs_flush),
84 TP_STRUCT__entry(
85 __field(u64, id)
86 __field(s64, stats_updates)
87 __field(bool, force)
88 __field(bool, needs_flush)
91 TP_fast_assign(
92 __entry->id = cgroup_id(memcg->css.cgroup);
93 __entry->stats_updates = stats_updates;
94 __entry->force = force;
95 __entry->needs_flush = needs_flush;
98 TP_printk("memcg_id=%llu stats_updates=%lld force=%d needs_flush=%d",
99 __entry->id, __entry->stats_updates,
100 __entry->force, __entry->needs_flush)
103 #endif /* _TRACE_MEMCG_H */
105 /* This part must be outside protection */
106 #include <trace/define_trace.h>