Skip to content

Commit fda5e3f

Browse files
committed
Merge tag 'trace-v6.13-rc7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull tracing fix from Steven Rostedt: "Fix regression in GFP output in trace events It was reported that the GFP flags in trace events went from human readable to just their hex values: gfp_flags=GFP_HIGHUSER_MOVABLE|__GFP_COMP to gfp_flags=0x140cca This was caused by a change that added the use of enums in calculating the GFP flags. As defines get translated into their values in the trace event format files, the user space tooling could easily convert the GFP flags into their symbols via the __print_flags() helper macro. The problem is that enums do not get converted, and the names of the enums show up in the format files and user space tooling cannot translate them. Add TRACE_DEFINE_ENUM() around the enums used for GFP flags which is the tracing infrastructure macro that informs the tracing subsystem what the values for enums and it can then expose that to user space" * tag 'trace-v6.13-rc7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing: gfp: Fix the GFP enum values shown for user space tracing tools
2 parents 5955239 + 60295b9 commit fda5e3f

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

include/trace/events/mmflags.h

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,69 @@
1313
* Thus most bits set go first.
1414
*/
1515

16+
/* These define the values that are enums (the bits) */
17+
#define TRACE_GFP_FLAGS_GENERAL \
18+
TRACE_GFP_EM(DMA) \
19+
TRACE_GFP_EM(HIGHMEM) \
20+
TRACE_GFP_EM(DMA32) \
21+
TRACE_GFP_EM(MOVABLE) \
22+
TRACE_GFP_EM(RECLAIMABLE) \
23+
TRACE_GFP_EM(HIGH) \
24+
TRACE_GFP_EM(IO) \
25+
TRACE_GFP_EM(FS) \
26+
TRACE_GFP_EM(ZERO) \
27+
TRACE_GFP_EM(DIRECT_RECLAIM) \
28+
TRACE_GFP_EM(KSWAPD_RECLAIM) \
29+
TRACE_GFP_EM(WRITE) \
30+
TRACE_GFP_EM(NOWARN) \
31+
TRACE_GFP_EM(RETRY_MAYFAIL) \
32+
TRACE_GFP_EM(NOFAIL) \
33+
TRACE_GFP_EM(NORETRY) \
34+
TRACE_GFP_EM(MEMALLOC) \
35+
TRACE_GFP_EM(COMP) \
36+
TRACE_GFP_EM(NOMEMALLOC) \
37+
TRACE_GFP_EM(HARDWALL) \
38+
TRACE_GFP_EM(THISNODE) \
39+
TRACE_GFP_EM(ACCOUNT) \
40+
TRACE_GFP_EM(ZEROTAGS)
41+
42+
#ifdef CONFIG_KASAN_HW_TAGS
43+
# define TRACE_GFP_FLAGS_KASAN \
44+
TRACE_GFP_EM(SKIP_ZERO) \
45+
TRACE_GFP_EM(SKIP_KASAN)
46+
#else
47+
# define TRACE_GFP_FLAGS_KASAN
48+
#endif
49+
50+
#ifdef CONFIG_LOCKDEP
51+
# define TRACE_GFP_FLAGS_LOCKDEP \
52+
TRACE_GFP_EM(NOLOCKDEP)
53+
#else
54+
# define TRACE_GFP_FLAGS_LOCKDEP
55+
#endif
56+
57+
#ifdef CONFIG_SLAB_OBJ_EXT
58+
# define TRACE_GFP_FLAGS_SLAB \
59+
TRACE_GFP_EM(NO_OBJ_EXT)
60+
#else
61+
# define TRACE_GFP_FLAGS_SLAB
62+
#endif
63+
64+
#define TRACE_GFP_FLAGS \
65+
TRACE_GFP_FLAGS_GENERAL \
66+
TRACE_GFP_FLAGS_KASAN \
67+
TRACE_GFP_FLAGS_LOCKDEP \
68+
TRACE_GFP_FLAGS_SLAB
69+
70+
#undef TRACE_GFP_EM
71+
#define TRACE_GFP_EM(a) TRACE_DEFINE_ENUM(___GFP_##a##_BIT);
72+
73+
TRACE_GFP_FLAGS
74+
75+
/* Just in case these are ever used */
76+
TRACE_DEFINE_ENUM(___GFP_UNUSED_BIT);
77+
TRACE_DEFINE_ENUM(___GFP_LAST_BIT);
78+
1679
#define gfpflag_string(flag) {(__force unsigned long)flag, #flag}
1780

1881
#define __def_gfpflag_names \

0 commit comments

Comments
 (0)