lkml.org 
[lkml]   [2010]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 2/3] Add tracing_off_event() calls to BUG() and WARN() paths
    Date
    This change adds tracing_off_event() calls, which stop debug tracing,
    when a BUG() or WARN() function is called. The stoppage depends on
    commandline paramenter tracing_off={bug,warn,none}. The default is
    "bug", so only the BUG() paths will stop tracing.

    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
    ---
    kernel/panic.c | 4 +++-
    lib/bug.c | 2 ++
    2 files changed, 5 insertions(+), 1 deletions(-)

    diff --git a/kernel/panic.c b/kernel/panic.c
    index 13d966b..f0ff321 100644
    --- a/kernel/panic.c
    +++ b/kernel/panic.c
    @@ -319,7 +319,7 @@ int oops_may_print(void)
    */
    void oops_enter(void)
    {
    - tracing_off();
    + tracing_off_event(TRACE_EVENT_BUG);
    /* can't trust the integrity of the kernel anymore: */
    debug_locks_off();
    do_oops_enter_exit();
    @@ -369,6 +369,8 @@ static void warn_slowpath_common(const char *file, int line, void *caller, struc
    {
    const char *board;

    + tracing_off_event(TRACE_EVENT_WARN);
    +
    printk(KERN_WARNING "------------[ cut here ]------------\n");
    printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
    board = dmi_get_system_info(DMI_PRODUCT_NAME);
    diff --git a/lib/bug.c b/lib/bug.c
    index 300e41a..457c1eb 100644
    --- a/lib/bug.c
    +++ b/lib/bug.c
    @@ -154,6 +154,8 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
    warning = (bug->flags & BUGFLAG_WARNING) != 0;
    }

    + tracing_off_event(warning ? TRACE_EVENT_WARN : TRACE_EVENT_BUG);
    +
    if (warning) {
    /* this is a WARN_ON rather than BUG/BUG_ON */
    if (file)
    --
    1.6.3.3


    \
     
     \ /
      Last update: 2010-03-18 14:51    [W:0.034 / U:59.012 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site