path: root/tools
diff options
authorVlastimil Babka <>2016-03-15 14:55:52 -0700
committerLinus Torvalds <>2016-03-15 16:55:16 -0700
commit420adbe9fc1a45187cfa74df9dbfd72272c4e2fa (patch)
tree5d8907a9a6b87441c65252da969575cd5cb21b8d /tools
parent14e0a214d62d284ff40b1fd7d687cb66fca9fc67 (diff)
mm, tracing: unify mm flags handling in tracepoints and printk
In tracepoints, it's possible to print gfp flags in a human-friendly format through a macro show_gfp_flags(), which defines a translation array and passes is to __print_flags(). Since the following patch will introduce support for gfp flags printing in printk(), it would be nice to reuse the array. This is not straightforward, since __print_flags() can't simply reference an array defined in a .c file such as mm/debug.c - it has to be a macro to allow the macro magic to communicate the format to userspace tools such as trace-cmd. The solution is to create a macro __def_gfpflag_names which is used both in show_gfp_flags(), and to define the gfpflag_names[] array in mm/debug.c. On the other hand, mm/debug.c also defines translation tables for page flags and vma flags, and desire was expressed (but not implemented in this series) to use these also from tracepoints. Thus, this patch also renames the events/gfpflags.h file to events/mmflags.h and moves the table definitions there, using the same macro approach as for gfpflags. This allows translating all three kinds of mm-specific flags both in tracepoints and printk. Signed-off-by: Vlastimil Babka <> Reviewed-by: Michal Hocko <> Cc: Steven Rostedt <> Cc: Peter Zijlstra <> Cc: Arnaldo Carvalho de Melo <> Cc: Ingo Molnar <> Cc: Rasmus Villemoes <> Cc: Joonsoo Kim <> Cc: Minchan Kim <> Cc: Sasha Levin <> Cc: "Kirill A. Shutemov" <> Cc: Mel Gorman <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'tools')
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 83343ed30e8f..c9cb3be47cff 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -602,7 +602,7 @@ static int gfpcmp(const void *a, const void *b)
return fa->flags - fb->flags;
-/* see include/trace/events/gfpflags.h */
+/* see include/trace/events/mmflags.h */
static const struct {
const char *original;
const char *compact;