mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <shuahkh@osg.samsung.com>
To: rostedt@goodmis.org, mingo@redhat.com, gregkh@linuxfoundation.org
Cc: Shuah Khan <shuahkh@osg.samsung.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] kobject tracepoints
Date: Tue,  6 Sep 2016 11:49:22 -0600	[thread overview]
Message-ID: <cover.1473174684.git.shuahkh@osg.samsung.com> (raw)

Add kobject trace points to track kobject operations: init, add, set_name,
init_and_add, create_and_add, move, rename, get, put, cleanup, and del.

Kobject trace points can aid in debugging, generating status and graphs
on kobjects in the kernel and their hierarchy.

This patch series adds kobject tracepoints and adds calls to tracepoints
from kobject init, add, set_name, init_and_add, create_and_add, move,
rename, get, put, cleanup, and del operations.

A suggestion to provide more visibility into kboject lifetimes came out of
a discussion at my Embedded data structure lifetime talk at LinuxCon NA in
Toronto. As I thought about on how to provide visibility, I decided adding
traces provides a boot and run-time facility to trace kobject operations
without needing compile special kernels and also without impacting run-time
unless trace is enabled. Hence, this resulting patch series.

Example traces:

<...>-13632 [003] d... 11296.965114: kobject_get: KOBJECT: 1:0:0:0 (f
fff88034aeb1348) state=1 parent= target1:0:0 (ffff88038c875db8) counter= 19
           <...>-13632 [003] d... 11296.965167: kobject_get: KOBJECT: 1:0:0:0 (ffff88034aeb1348) state=1 parent= target1:0:0 (ffff88038c875db8) counter= 20
           <...>-13632 [003] d... 11296.965218: kobject_get: KOBJECT: 1:0:0:0 (ffff88034aeb1348) state=1 parent= target1:0:0 (ffff88038c875db8) counter= 21
           <...>-13632 [003] d... 11296.965269: kobject_get: KOBJECT: 1:0:0:0 (ffff88034aeb1348) state=1 parent= target1:0:0 (ffff88038c875db8) counter= 22
          <idle>-0     [006] ..s. 11296.965378: kobject_put: KOBJECT: 1:0:0:0 (ffff88034aeb1348) state=1 parent= target1:0:0 (ffff88038c875db8) counter= 21
          <idle>-0     [006] .Ns. 11296.965542: kobject_put: KOBJECT: 1:0:0:0 (ffff88034aeb1348) state=1 parent= target1:0:0 (ffff88038c875db8) counter= 20
     ksoftirqd/6-46    [006] ..s. 11296.965633: kobject_put: KOBJECT: 1:0:0:0 (ffff88034aeb1348) state=1 parent= target1:0:0 (ffff88038c875db8) counter= 19
     ksoftirqd/6-46    [006] ..s. 11296.965703: kobject_put: KOBJECT: 1:0:0:0 (ffff88034aeb1348) state=1 parent= target1:0:0 (ffff88038c875db8) counter= 18

Shuah Khan (3):
  kobject: add kobject trace points
  kobject: add kobject trace prototypes
  kobject: Add calls to kobject trace points

 include/trace/events/kobject.h | 259 +++++++++++++++++++++++++++++++++++++++++
 lib/Makefile                   |   2 +-
 lib/kobject.c                  |  22 ++++
 lib/kobject_traces.c           |  32 +++++
 4 files changed, 314 insertions(+), 1 deletion(-)
 create mode 100644 include/trace/events/kobject.h
 create mode 100644 lib/kobject_traces.c

-- 
2.7.4

             reply	other threads:[~2016-09-06 17:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 17:49 Shuah Khan [this message]
2016-09-06 17:49 ` [PATCH 1/3] kobject: add kobject trace points Shuah Khan
2016-09-06 18:05   ` Steven Rostedt
2016-09-07 23:25     ` Shuah Khan
2016-09-06 17:49 ` [PATCH 2/3] kobject: add kobject trace prototypes Shuah Khan
2016-09-06 17:49 ` [PATCH 3/3] kobject: Add calls to kobject trace points Shuah Khan
2016-09-06 19:30 ` [PATCH 0/3] kobject tracepoints Greg KH
2016-09-06 20:19   ` Shuah Khan
2016-09-07  5:48     ` Greg KH

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=cover.1473174684.git.shuahkh@osg.samsung.com \
    --to=shuahkh@osg.samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.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

all inboxes | Powered by JetHome®