]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ftrace: Use macros for numbers in ftrace rec shift bits
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Wed, 7 May 2014 16:42:28 +0000 (12:42 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 30 Jun 2014 14:09:55 +0000 (10:09 -0400)
As new flags will be added to the ftrace dynamic record, and since
the flags field is also a counter, converting the numbers used to
do the shifting and masking into a set of macros where we only need
to deal with the max bit count of the counter and the number of bits
for the flags will prevent mistakes in the future.

Dealing with only two numbers is much easier than updating all the
macros that deal with shifting and masking.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
include/linux/ftrace.h

index 404a686a364434ca33eb356b98eb54794d606712..e4e7df422021855bad8a35dc737bde8b6aaa187e 100644 (file)
@@ -322,8 +322,11 @@ enum {
        FTRACE_FL_REGS_EN       = (1UL << 31)
 };
 
-#define FTRACE_FL_MASK         (0x7UL << 29)
-#define FTRACE_REF_MAX         ((1UL << 29) - 1)
+#define FTRACE_REF_MAX_SHIFT   29
+#define FTRACE_FL_BITS         3
+#define FTRACE_FL_MASKED_BITS  ((1UL << FTRACE_FL_BITS) - 1)
+#define FTRACE_FL_MASK         (FTRACE_FL_MASKED_BITS << FTRACE_REF_MAX_SHIFT)
+#define FTRACE_REF_MAX         ((1UL << FTRACE_REF_MAX_SHIFT) - 1)
 
 struct dyn_ftrace {
        unsigned long           ip; /* address of mcount call-site */