From: Wang Wensheng <wangwensheng4@huawei.com>
To: <linux-kernel@vger.kernel.org>, <rostedt@goodmis.org>,
<mhiramat@kernel.org>, <mark.rutland@arm.com>
Cc: <xuqiang36@huawei.com>, <weiyongjun1@huawei.com>,
<wangwensheng4@huawei.com>
Subject: [PATCH -next 1/3] ftrace: Fix the possible incorrect kernel message
Date: Wed, 9 Nov 2022 09:44:32 +0000 [thread overview]
Message-ID: <20221109094434.84046-2-wangwensheng4@huawei.com> (raw)
In-Reply-To: <20221109094434.84046-1-wangwensheng4@huawei.com>
If the number of mcount entries is an integer multiple of
ENTRIES_PER_PAGE, the page count showing on the console would be wrong.
Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
---
kernel/trace/ftrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index fbf2543111c0..c571c2813c11 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -7401,7 +7401,7 @@ void __init ftrace_init(void)
}
pr_info("ftrace: allocating %ld entries in %ld pages\n",
- count, count / ENTRIES_PER_PAGE + 1);
+ count, DIV_ROUND_UP(count, ENTRIES_PER_PAGE));
ret = ftrace_process_locs(NULL,
__start_mcount_loc,
--
2.17.1
next prev parent reply other threads:[~2022-11-09 9:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 9:44 [PATCH -next 0/3] Optimize code for ftrace Wang Wensheng
2022-11-09 9:44 ` Wang Wensheng [this message]
2022-11-09 9:44 ` [PATCH -next 2/3] ftrace: Optimize the allocation for mcount entries Wang Wensheng
2022-11-09 9:44 ` [PATCH -next 3/3] ftrace: Delete unused variable ftrace_update_time Wang Wensheng
2022-11-17 20:36 ` Steven Rostedt
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=20221109094434.84046-2-wangwensheng4@huawei.com \
--to=wangwensheng4@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=weiyongjun1@huawei.com \
--cc=xuqiang36@huawei.com \
/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®