lkml.org 
[lkml]   [2012]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 11/16] dynamic_debug: print ram usage by ddebug tables if verbose
    Date
    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


    \
     
     \ /
      Last update: 2012-03-26 01:31    [W:0.045 / U:1.232 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site