Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2189019pxa; Mon, 3 Aug 2020 09:34:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxbgu7eB+FHak22i3BH8RNyQfSP3kdOetaAgOCx9zaeFwunmk2DdBwcjbUeUP5cfHJN3uh X-Received: by 2002:a17:906:5596:: with SMTP id y22mr11530507ejp.471.1596472461187; Mon, 03 Aug 2020 09:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596472461; cv=none; d=google.com; s=arc-20160816; b=V9DkLuUyJiiRZdhiJHLorby3gNoWH1+e1GgjGm1QDzKPDgqYJWJLZX7PMYWomWr9YW oN6bPjQIGOjqDyakyheNTzsSPHzZJjy6vosTr0njWZvP0ttQ6Nj2M1/ZG+I+Mv/ZvNRH QDndc+syByE3xk9uayUHRCus1HsCKyV/uFfwMnngNojKSENQ7JsNGVZq+GmAftujZLbQ X03qkmmaWHnvlTP/mNdCgtll3jVwwrHWDuFif1/FZRQj62A8UJbUvLDUo3t8aLoiP7lE AbZpYtUX4Ku/HGT4qbbORyT80zyCSnad9nd5fPWtkAmQQN2Nh9amr78pGdpDxC1bJFkh AmUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ZrsVGmEonw8RlzrjbIL0se7EVy203/PdgKAT5NhYH9U=; b=vOixkzIrHCMJQD8ID2K/mTFnBxkNYl38evn625bTn4F5SC5iPqgWD8ETmEzrxlwWU4 AZHrGqH+yt3hQSF5yqatJ7+F3URjYIBwKcv/mzWo0HsVPsS//0LO5TUqLnLies+FzxeK 0W4VkgEHBdHhp2DhECxUXmY+KP4+5vOgE+Z0o3/ydobSBeUHZCucHRH0nJou8lT+NdQd BQ7P2ryA/ldVrF/0NPUqK73prJB9NmHpYfXpNKI07VbaGyrkTpXX5R17XuFHCDLaQ/UZ 39Fpzlx/ylXDBAUaafXzn+cSdrd6kAV7oJ6TeLD0s5K94cWo3Jya3F/X+rbDFvkp4JT2 rlpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EuzrSyZx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si11313970ejk.194.2020.08.03.09.33.58; Mon, 03 Aug 2020 09:34:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EuzrSyZx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726130AbgHCQdk (ORCPT + 99 others); Mon, 3 Aug 2020 12:33:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725945AbgHCQdj (ORCPT ); Mon, 3 Aug 2020 12:33:39 -0400 Received: from mail-vk1-xa43.google.com (mail-vk1-xa43.google.com [IPv6:2607:f8b0:4864:20::a43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15AEEC06174A for ; Mon, 3 Aug 2020 09:33:39 -0700 (PDT) Received: by mail-vk1-xa43.google.com with SMTP id q72so1210592vkb.11 for ; Mon, 03 Aug 2020 09:33:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ZrsVGmEonw8RlzrjbIL0se7EVy203/PdgKAT5NhYH9U=; b=EuzrSyZx2O9WjU4B/dBgt6g2qnGt7FmJ53XV6UBNMRexm1Ii6XSUrrzJfGvy9OTU2M maTa4Wp9YJ6b092D3ecVEcnbxlzAw8DQNSe0Q3FWUkv9MNnOJ3ZQCyzbb+RqTe4lDjAK BFQv+NKZWB6TsIq/7yvND0QeQJuyi7NhAlvCWMNm0RWKm3nj5cxYRwzRaV/Lyox20Tz+ wRv2i+kklqMQsKooBSZBjLGXFsB5Mo2/GHH25ZE1OPOhcqz8AAgxCC0DliJWesp2J6FO +fzW6YY9JgId7v7deB+ExovkiaIRNHeZ8FdhLAsQnDy3WC5Uf5ots1Bt+c04iZnJsy8g QoTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZrsVGmEonw8RlzrjbIL0se7EVy203/PdgKAT5NhYH9U=; b=QU7m6mY8lV5OR6WBKKIP5G/UEVr/SgpFzhJNQlhct/84PwsBueJk1Od31Ek04NI3Qs Ah9TO1y104cQvWNlAk0UDI86ngFY0iUyW6uMcvfeUX67AHblWBsJZx0c/urHZqPphMQv 1mVJlCgd+3mr6SENwiVF2bZrP2n+6H0uAJ93nB8qe+ceU87G/19j+asvR/xj1TkVjg9z v0NHxlymcGEivnhdaC4XgD8FWl76Dzary5uu/X39Cu/OtFDzz/+wz5wn1nspuT3zLTnf 3LDjWKWJLm0oUP+Wj7xv2BpMlAXaDT5lx6CQ0PxjN4EwmkMi/jNnH38l8Awmr/8F74Pd Ei+w== X-Gm-Message-State: AOAM530OW9Oc0OXH9mOGGExew27MZmpoJP40CSRxvKeWTR1jPPuHsb6g n6XpI567m/6Aia8evz3Z7saylA== X-Received: by 2002:a05:6122:1353:: with SMTP id f19mr12642301vkp.38.1596472418034; Mon, 03 Aug 2020 09:33:38 -0700 (PDT) Received: from google.com (182.71.196.35.bc.googleusercontent.com. [35.196.71.182]) by smtp.gmail.com with ESMTPSA id k74sm2802571vka.16.2020.08.03.09.33.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 09:33:37 -0700 (PDT) Date: Mon, 3 Aug 2020 16:33:34 +0000 From: Kalesh Singh To: Steven Rostedt Cc: Jonathan Corbet , Sumit Semwal , Alexander Viro , Ingo Molnar , 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 , Hridya Valsaraju , Ioannis Ilkos , John Stultz , kernel-team@android.com Subject: Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events Message-ID: <20200803163334.GA3212137@google.com> References: <20200803144719.3184138-1-kaleshsingh@google.com> <20200803144719.3184138-3-kaleshsingh@google.com> <20200803113239.194eb86f@oasis.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200803113239.194eb86f@oasis.local.home> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 03, 2020 at 11:32:39AM -0400, Steven Rostedt wrote: > On Mon, 3 Aug 2020 14:47:19 +0000 > Kalesh Singh 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 > Thanks for the comments Steve. I'll remove the task arg. > > + __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; > > + ), > > +