From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Tom Zanussi <zanussi@kernel.org>,
Peter Zijlstra <peterz@infradead.org>
Subject: [PATCH 3/4] tools/bootconfig: Show the number of bootconfig nodes
Date: Wed, 5 Feb 2020 22:50:13 +0900 [thread overview]
Message-ID: <158091061337.27924.10886706631693823982.stgit@devnote2> (raw)
In-Reply-To: <158091058484.27924.11216788166827115442.stgit@devnote2>
Show the number of bootconfig nodes when applying new bootconfig to
initrd.
Since there are limitations of bootconfig not only in its filesize,
but also the number of nodes, the number should be shown when applying
so that user can get the feeling of scale of current bootconfig.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
lib/bootconfig.c | 5 ++++-
tools/bootconfig/main.c | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/bootconfig.c b/lib/bootconfig.c
index a98ae136529c..afb2e767e6fe 100644
--- a/lib/bootconfig.c
+++ b/lib/bootconfig.c
@@ -728,7 +728,8 @@ void __init xbc_destroy_all(void)
*
* This parses the boot config text in @buf. @buf must be a
* null terminated string and smaller than XBC_DATA_MAX.
- * Return 0 if succeeded, or -errno if there is any error.
+ * Return the number of stored nodes (>0) if succeeded, or -errno
+ * if there is any error.
*/
int __init xbc_init(char *buf)
{
@@ -788,6 +789,8 @@ int __init xbc_init(char *buf)
if (ret < 0)
xbc_destroy_all();
+ else
+ ret = xbc_node_num;
return ret;
}
diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index 91c9a5c0c499..47f488458328 100644
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -268,6 +268,7 @@ int apply_xbc(const char *path, const char *xbc_path)
return ret;
}
printf("Apply %s to %s\n", xbc_path, path);
+ printf("\tNumber of nodes: %d\n", ret);
printf("\tSize: %u bytes\n", (unsigned int)size);
printf("\tChecksum: %d\n", (unsigned int)csum);
next prev parent reply other threads:[~2020-02-05 13:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-05 13:49 [PATCH 0/4] bootconfig: Show more error information Masami Hiramatsu
2020-02-05 13:49 ` [PATCH 1/4] bootconfig: Use bootconfig instead of boot config Masami Hiramatsu
2020-02-05 13:50 ` [PATCH 2/4] bootconfig: Add more parse error messages Masami Hiramatsu
2020-02-05 13:50 ` Masami Hiramatsu [this message]
2020-02-05 13:50 ` [PATCH 4/4] bootconfig: Show the number of nodes on boot message Masami Hiramatsu
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=158091061337.27924.10886706631693823982.stgit@devnote2 \
--to=mhiramat@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=zanussi@kernel.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