mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: jim.cromie@gmail.com
To: jbaron@redhat.com
Cc: linux-kernel@vger.kernel.org, Jim Cromie <jim.cromie@gmail.com>
Subject: [PATCH 11/16] dynamic_debug: print ram usage by ddebug tables if verbose
Date: Sun, 25 Mar 2012 17:25:49 -0600	[thread overview]
Message-ID: <1332717954-5775-12-git-send-email-jim.cromie@gmail.com> (raw)
In-Reply-To: <1332717954-5775-1-git-send-email-jim.cromie@gmail.com>

From: Jim Cromie <jim.cromie@gmail.com>

Print ram usage of dynamic-debug so user knows cost of enabling
CONFIG_DYNAMIC_DEBUG.  Only counts cost of pr_debug in builtins, not
those in loadable modules.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
 lib/dynamic_debug.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 5f0d31f..38bd4d66 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -970,7 +970,7 @@ static int __init dynamic_debug_init(void)
 	const char *modname = NULL;
 	char *cmdline;
 	int ret = 0;
-	int n = 0;
+	int n = 0, entries = 0, modct = 0;
 
 	if (__start___verbose == __stop___verbose) {
 		pr_warn("_ddebug table is empty in a "
@@ -981,7 +981,9 @@ static int __init dynamic_debug_init(void)
 	modname = iter->modname;
 	iter_start = iter;
 	for (; iter < __stop___verbose; iter++) {
+		entries++;
 		if (strcmp(modname, iter->modname)) {
+			modct++;
 			ret = ddebug_add_module(iter_start, n, modname);
 			if (ret)
 				goto out_err;
@@ -996,6 +998,9 @@ static int __init dynamic_debug_init(void)
 		goto out_err;
 
 	ddebug_init_success = 1;
+	vpr_info("%d modules, %d entries in ddebug tables, %d bytes used\n",
+		modct, entries, modct * sizeof(struct ddebug_table)
+		+ __stop___verbose - __start___verbose);
 
 	/* apply ddebug_query boot param, dont unload tables on err */
 	if (ddebug_setup_string[0] != '\0') {
-- 
1.7.7.6


  parent reply	other threads:[~2012-03-25 23:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-25 23:25 [00/16] enable pr_debug during module initialization jim.cromie
2012-03-25 23:25 ` [PATCH 01/16] init: trivial tweaks to initcall_levels jim.cromie
2012-03-25 23:25 ` [PATCH 02/16] dynamic_debug: fix leading spaces jim.cromie
2012-03-25 23:25 ` [PATCH 03/16] dynamic_debug: replace if (verbose) pr_info with macro vpr_info jim.cromie
2012-03-25 23:25 ` [PATCH 04/16] dynamic_debug: change ddebug_query core param to dyndbg jim.cromie
2012-03-25 23:25 ` [PATCH 05/16] params: add param-name to parse_one's pr_debug() jim.cromie
2012-03-25 23:25 ` [PATCH 06/16] params: add 3rd arg to option handler callback signature jim.cromie
2012-03-25 23:25 ` [PATCH 07/16] dynamic_debug: make dynamic-debug work for module initialization jim.cromie
2012-03-25 23:25 ` [PATCH 08/16] dynamic_debug: deprecate ddebug_query, suggest dyndbg instead jim.cromie
2012-03-25 23:25 ` [PATCH 09/16] dynamic_debug: combine parse_args callbacks together jim.cromie
2012-03-25 23:25 ` [PATCH 10/16] dynamic_debug: simplify dynamic_debug_init error exit jim.cromie
2012-03-25 23:25 ` jim.cromie [this message]
2012-03-25 23:25 ` [PATCH 12/16] pnp: if CONFIG_DYNAMIC_DEBUG, use pnp.dyndbg instead of pnp.debug jim.cromie
2012-03-25 23:25 ` [PATCH 13/16] dynamic_debug: add modname arg to exec_query callchain jim.cromie
2012-03-25 23:25 ` [PATCH 14/16] dynamic_debug: update Documentation/*, Kconfig.debug jim.cromie
2012-03-25 23:25 ` [PATCH 15/16] dynamic_debug: init with early_initcall, not arch_initcall jim.cromie
2012-03-25 23:25 ` [PATCH 16/16] dynamic_debug: drop deprecated ddebug_query param, code jim.cromie

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=1332717954-5775-12-git-send-email-jim.cromie@gmail.com \
    --to=jim.cromie@gmail.com \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.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

Powered by JetHome