[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200803113239.194eb86f@oasis.local.home>
Date: Mon, 3 Aug 2020 11:32:39 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Kalesh Singh <kaleshsingh@...gle.com>
Cc: Jonathan Corbet <corbet@....net>,
Sumit Semwal <sumit.semwal@...aro.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Ingo Molnar <mingo@...hat.com>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
dri-devel@...ts.freedesktop.org, linaro-mm-sig@...ts.linaro.org,
linux-fsdevel@...r.kernel.org,
Suren Baghdasaryan <surenb@...gle.com>,
Hridya Valsaraju <hridya@...gle.com>,
Ioannis Ilkos <ilkos@...gle.com>,
John Stultz <john.stultz@...aro.org>, kernel-team@...roid.com
Subject: Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events
On Mon, 3 Aug 2020 14:47:19 +0000
Kalesh Singh <kaleshsingh@...gle.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;
> + ),
> +
Powered by blists - more mailing lists