Skip to content

Commit

Permalink
tools/bootconfig: Show the number of bootconfig nodes
Browse files Browse the repository at this point in the history
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.

Link: http://lkml.kernel.org/r/158091061337.27924.10886706631693823982.stgit@devnote2

Signed-off-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
mhiramat authored and rostedt committed Feb 5, 2020
1 parent 597c0e3 commit 0f0d0a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/bootconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -788,6 +789,8 @@ int __init xbc_init(char *buf)

if (ret < 0)
xbc_destroy_all();
else
ret = xbc_node_num;

return ret;
}
Expand Down
1 change: 1 addition & 0 deletions tools/bootconfig/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 0f0d0a7

Please sign in to comment.