lkml.org 
[lkml]   [2011]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[tip:perf/core] tracing: fix event_subsystem ref counting
    Commit-ID:  cb59974742aea24adf6637eb0c4b8e7b48bca6fb
    Gitweb: http://git.kernel.org/tip/cb59974742aea24adf6637eb0c4b8e7b48bca6fb
    Author: Ilya Dryomov <idryomov@gmail.com>
    AuthorDate: Mon, 31 Oct 2011 11:07:42 +0200
    Committer: Steven Rostedt <rostedt@goodmis.org>
    CommitDate: Mon, 5 Dec 2011 13:28:44 -0500

    tracing: fix event_subsystem ref counting

    Fix a bug introduced by e9dbfae5, which prevents event_subsystem from
    ever being released.

    Ref_count was added to keep track of subsystem users, not for counting
    events. Subsystem is created with ref_count = 1, so there is no need to
    increment it for every event, we have nr_events for that. Fix this by
    touching ref_count only when we actually have a new user -
    subsystem_open().

    Cc: stable@vger.kernel.org
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Link: http://lkml.kernel.org/r/1320052062-7846-1-git-send-email-idryomov@gmail.com
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    ---
    kernel/trace/trace_events.c | 1 -
    1 files changed, 0 insertions(+), 1 deletions(-)

    diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
    index 581876f..c212a7f 100644
    --- a/kernel/trace/trace_events.c
    +++ b/kernel/trace/trace_events.c
    @@ -1078,7 +1078,6 @@ event_subsystem_dir(const char *name, struct dentry *d_events)
    /* First see if we did not already create this dir */
    list_for_each_entry(system, &event_subsystems, list) {
    if (strcmp(system->name, name) == 0) {
    - __get_system(system);
    system->nr_events++;
    return system->entry;
    }

    \
     
     \ /
      Last update: 2011-12-06 07:27    [W:0.022 / U:153.652 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site