From: Wei Yang <richard.weiyang@linux.alibaba.com>
To: rostedt@goodmis.org, mingo@redhat.com
Cc: linux-kernel@vger.kernel.org,
Wei Yang <richard.weiyang@linux.alibaba.com>
Subject: [PATCH 3/6] ftrace: simplify the dyn_ftrace->flags macro
Date: Mon, 31 Aug 2020 11:11:01 +0800 [thread overview]
Message-ID: <20200831031104.23322-4-richard.weiyang@linux.alibaba.com> (raw)
In-Reply-To: <20200831031104.23322-1-richard.weiyang@linux.alibaba.com>
All the three macro are defined to be used for ftrace_rec_count(). This
can be achieved by (flags & FTRACE_REF_MAX) directly.
Since no other places would use those macros, remove them for clarity.
Also it fixes a typo in the comment.
Signed-off-by: Wei Yang <richard.weiyang@linux.alibaba.com>
---
include/linux/ftrace.h | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 3e3fe779a8c2..23c4d6526998 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -433,7 +433,7 @@ bool is_ftrace_trampoline(unsigned long addr);
* DIRECT - there is a direct function to call
*
* When a new ftrace_ops is registered and wants a function to save
- * pt_regs, the rec->flag REGS is set. When the function has been
+ * pt_regs, the rec->flags REGS is set. When the function has been
* set up to save regs, the REG_EN flag is set. Once a function
* starts saving regs it will do so until all ftrace_ops are removed
* from tracing that function.
@@ -451,12 +451,9 @@ enum {
};
#define FTRACE_REF_MAX_SHIFT 23
-#define FTRACE_FL_BITS 9
-#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)
-#define ftrace_rec_count(rec) ((rec)->flags & ~FTRACE_FL_MASK)
+#define ftrace_rec_count(rec) ((rec)->flags & FTRACE_REF_MAX)
struct dyn_ftrace {
unsigned long ip; /* address of mcount call-site */
--
2.20.1 (Apple Git-117)
next prev parent reply other threads:[~2020-08-31 3:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-31 3:10 [PATCH 0/6] ftrace: trivial cleanup Wei Yang
2020-08-31 3:10 ` [PATCH 1/6] ftrace: define seq_file only for FMODE_READ Wei Yang
2020-10-06 14:36 ` Steven Rostedt
2020-10-08 3:34 ` Wei Yang
2020-08-31 3:11 ` [PATCH 2/6] ftrace: use fls() to get the bits for dup_hash() Wei Yang
2020-08-31 3:11 ` Wei Yang [this message]
2020-08-31 3:11 ` [PATCH 4/6] ftrace: simplify the calculation of page number for ftrace_page->records Wei Yang
2020-08-31 3:11 ` [PATCH 5/6] ftrace: replace do_for_each_ftrace_rec() with for_ftrace_rec_iter() Wei Yang
2020-10-06 14:42 ` Steven Rostedt
2020-10-08 3:34 ` Wei Yang
2020-08-31 3:11 ` [PATCH 6/6] ftrace: ftrace_global_list is renamed to ftrace_ops_list Wei Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200831031104.23322-4-richard.weiyang@linux.alibaba.com \
--to=richard.weiyang@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®