linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Kalesh Singh <kaleshsingh@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Ingo Molnar <mingo@redhat.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, linux-fsdevel@vger.kernel.org,
	Suren Baghdasaryan <surenb@google.com>,
	Hridya Valsaraju <hridya@google.com>,
	Ioannis Ilkos <ilkos@google.com>,
	John Stultz <john.stultz@linaro.org>,
	kernel-team@android.com
Subject: Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events
Date: Mon, 3 Aug 2020 11:32:39 -0400	[thread overview]
Message-ID: <20200803113239.194eb86f@oasis.local.home> (raw)
In-Reply-To: <20200803144719.3184138-3-kaleshsingh@google.com>

On Mon,  3 Aug 2020 14:47:19 +0000
Kalesh Singh <kaleshsingh@google.com> wrote:

> +DECLARE_EVENT_CLASS(dma_buf_ref_template,
> +
> +	TP_PROTO(struct task_struct *task, struct file *filp),
> +
> +	TP_ARGS(task,  filp),
> +
> +	TP_STRUCT__entry(
> +		__field(u32, tgid)
> +		__field(u32, pid)

I only see "current" passed in as "task". Why are you recording the pid
and tgid as these are available by the tracing infrastructure.

At least the pid is saved at every event. You can see the tgid when
enabling the "record_tgid".

 # trace-cmd start -e all -O record_tgid
 # trace-cmd show

# tracer: nop
#
# entries-in-buffer/entries-written: 39750/39750   #P:8
#
#                                      _-----=> irqs-off
#                                     / _----=> need-resched
#                                    | / _---=> hardirq/softirq
#                                    || / _--=> preempt-depth
#                                    ||| /     delay
#           TASK-PID    TGID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |        |      |   ||||       |         |
       trace-cmd-28284 (28284) [005] .... 240338.934671: sys_exit: NR 1 = 1
     kworker/3:2-27891 (27891) [003] d... 240338.934671: timer_start: timer=00000000d643debd function=delayed_work_timer_fn expires=4535008893 [timeout=1981] cpu=3 idx=186 flags=I
       trace-cmd-28284 (28284) [005] .... 240338.934672: sys_write -> 0x1
     kworker/3:2-27891 (27891) [003] .... 240338.934672: workqueue_execute_end: work struct 000000008fddd403: function psi_avgs_work
     kworker/3:2-27891 (27891) [003] .... 240338.934673: workqueue_execute_start: work struct 00000000111c941e: function dbs_work_handler
     kworker/3:2-27891 (27891) [003] .... 240338.934673: workqueue_execute_end: work struct 00000000111c941e: function dbs_work_handler
     kworker/3:2-27891 (27891) [003] d... 240338.934673: rcu_utilization: Start context switch
     kworker/3:2-27891 (27891) [003] d... 240338.934673: rcu_utilization: End context switch

-- Steve

> +		__field(u64, size)
> +		__field(s64, count)
> +		__string(exp_name, dma_buffer(filp)->exp_name)
> +		__string(name, dma_buffer(filp)->name ? dma_buffer(filp)->name : UNKNOWN)
> +		__field(u64, i_ino)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->tgid = task->tgid;
> +		__entry->pid = task->pid;
> +		__entry->size = dma_buffer(filp)->size;
> +		__entry->count = file_count(filp);
> +		__assign_str(exp_name, dma_buffer(filp)->exp_name);
> +		__assign_str(name, dma_buffer(filp)->name ? dma_buffer(filp)->name : UNKNOWN);
> +		__entry->i_ino = filp->f_inode->i_ino;
> +	),
> +

  reply	other threads:[~2020-08-03 15:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03 14:47 [PATCH 0/2] Per process tracking of dma buffers Kalesh Singh
2020-08-03 14:47 ` [PATCH 1/2] fs: Add fd_install file operation Kalesh Singh
2020-08-03 16:34   ` Christoph Hellwig
2020-08-03 18:26     ` Kalesh Singh
2020-08-03 22:18   ` Al Viro
2020-08-04  0:30   ` Joel Fernandes
2020-08-04 13:54     ` Kalesh Singh
2020-08-03 14:47 ` [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events Kalesh Singh
2020-08-03 15:32   ` Steven Rostedt [this message]
2020-08-03 16:33     ` Kalesh Singh
2020-08-03 15:41   ` Matthew Wilcox
2020-08-03 16:00     ` Suren Baghdasaryan
2020-08-03 16:12       ` Matthew Wilcox
2020-08-03 16:22         ` Suren Baghdasaryan
2020-08-03 22:28           ` Al Viro
2020-08-04  1:09             ` Al Viro
2020-08-04  2:10               ` Suren Baghdasaryan
2020-08-04 15:44               ` Kalesh Singh
2020-08-04 18:27                 ` Al Viro
2020-08-04 20:42                   ` Kalesh Singh
2020-08-04 20:26             ` Daniel Vetter

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=20200803113239.194eb86f@oasis.local.home \
    --to=rostedt@goodmis.org \
    --cc=corbet@lwn.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hridya@google.com \
    --cc=ilkos@google.com \
    --cc=john.stultz@linaro.org \
    --cc=kaleshsingh@google.com \
    --cc=kernel-team@android.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sumit.semwal@linaro.org \
    --cc=surenb@google.com \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).