]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/compiler.h
Merge branch 'omap-pool'
[linux-2.6-omap-h63xx.git] / include / linux / compiler.h
index d95da1020f1c95d7b392eecb7739a0393e79c4a3..37bcb50a4d7c85b1ac203982cc71f11e75511cde 100644 (file)
@@ -68,6 +68,7 @@ struct ftrace_branch_data {
                        unsigned long miss;
                        unsigned long hit;
                };
+               unsigned long miss_hit[2];
        };
 };
 
@@ -75,7 +76,8 @@ struct ftrace_branch_data {
  * Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code
  * to disable branch tracing on a per file basis.
  */
-#if defined(CONFIG_TRACE_BRANCH_PROFILING) && !defined(DISABLE_BRANCH_PROFILING)
+#if defined(CONFIG_TRACE_BRANCH_PROFILING) \
+    && !defined(DISABLE_BRANCH_PROFILING) && !defined(__CHECKER__)
 void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
 
 #define likely_notrace(x)      __builtin_expect(!!(x), 1)
@@ -113,7 +115,9 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
  * "Define 'is'", Bill Clinton
  * "Define 'if'", Steven Rostedt
  */
-#define if(cond) if (__builtin_constant_p((cond)) ? !!(cond) :         \
+#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
+#define __trace_if(cond) \
+       if (__builtin_constant_p((cond)) ? !!(cond) :                   \
        ({                                                              \
                int ______r;                                            \
                static struct ftrace_branch_data                        \
@@ -125,10 +129,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
                                .line = __LINE__,                       \
                        };                                              \
                ______r = !!(cond);                                     \
-               if (______r)                                            \
-                       ______f.hit++;                                  \
-               else                                                    \
-                       ______f.miss++;                                 \
+               ______f.miss_hit[______r]++;                                    \
                ______r;                                                \
        }))
 #endif /* CONFIG_PROFILE_ALL_BRANCHES */