From mboxrd@z Thu Jan 1 00:00:00 1970 From: Koki Sanagi Subject: [RFC PATCH v2 2/5] napi: convert trace_napi_poll to TRACE_EVENT Date: Thu, 24 Jun 2010 17:17:33 +0900 Message-ID: <4C23149D.6080703@jp.fujitsu.com> References: <4C2312A8.9060903@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: davem@davemloft.net, scott.a.mcmillan@intel.com, kaneshige.kenji@jp.fujitsu.com, izumi.taku@jp.fujitsu.com To: netdev@vger.kernel.org Return-path: Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:53905 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752028Ab0FXIRh (ORCPT ); Thu, 24 Jun 2010 04:17:37 -0400 Received: from m5.gw.fujitsu.co.jp ([10.0.50.75]) by fgwmail7.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o5O8HZaG018329 for (envelope-from sanagi.koki@jp.fujitsu.com); Thu, 24 Jun 2010 17:17:36 +0900 Received: from smail (m5 [127.0.0.1]) by outgoing.m5.gw.fujitsu.co.jp (Postfix) with ESMTP id 8B4FD45DE52 for ; Thu, 24 Jun 2010 17:17:35 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (s5.gw.fujitsu.co.jp [10.0.50.95]) by m5.gw.fujitsu.co.jp (Postfix) with ESMTP id 2790245DE4F for ; Thu, 24 Jun 2010 17:17:35 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id 973111DB803C for ; Thu, 24 Jun 2010 17:17:33 +0900 (JST) Received: from m108.s.css.fujitsu.com (m108.s.css.fujitsu.com [10.249.87.108]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id 474E91DB803F for ; Thu, 24 Jun 2010 17:17:30 +0900 (JST) In-Reply-To: <4C2312A8.9060903@jp.fujitsu.com> Sender: netdev-owner@vger.kernel.org List-ID: This patch converts trace_napi_poll from DECLARE_EVENT to TRACE_EVENT. This lets you know how long napi_poll takes. -0 [001] 241302.750777: napi_poll: napi poll on napi struct f6acc480 for device eth3 -0 [000] 241302.852389: napi_poll: napi poll on napi struct f5d0d70c for device eth1 -0 [000] 241302.852389: napi_poll: napi poll on napi struct f5d0d20c for device eth1 This is a same patch Neil Horman submitted. http://marc.info/?l=linux-kernel&m=125978157926853&w=2 Signed-off-by: Koki Sanagi --- include/trace/events/napi.h | 23 +++++++++++++++++++++-- 1 files changed, 21 insertions(+), 2 deletions(-) diff --git a/include/trace/events/napi.h b/include/trace/events/napi.h index 188deca..512a057 100644 --- a/include/trace/events/napi.h +++ b/include/trace/events/napi.h @@ -6,10 +6,29 @@ #include #include +#include + +#define NO_DEV "(no_device)" + +TRACE_EVENT(napi_poll, -DECLARE_TRACE(napi_poll, TP_PROTO(struct napi_struct *napi), - TP_ARGS(napi)); + + TP_ARGS(napi), + + TP_STRUCT__entry( + __field( struct napi_struct *, napi) + __string( dev_name, napi->dev ? napi->dev->name : NO_DEV) + ), + + TP_fast_assign( + __entry->napi = napi; + __assign_str(dev_name, napi->dev ? napi->dev->name : NO_DEV); + ), + + TP_printk("napi poll on napi struct %p for device %s", + __entry->napi, __get_str(dev_name)) +); #endif /* _TRACE_NAPI_H_ */