Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2542953imm; Thu, 16 Aug 2018 11:11:09 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyVQ1OSuVlDEXdqMV03lmj9KFqfHpUCbLdz18yXpw60NHe/efKe7jLpkM9Z9sH1u6lTtaFU X-Received: by 2002:a63:c046:: with SMTP id z6-v6mr29945964pgi.114.1534443069392; Thu, 16 Aug 2018 11:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534443069; cv=none; d=google.com; s=arc-20160816; b=ooJVeHbzA8HL/koh/1DZ7GcEWuf7O88ZpkmUH0tUm9/tBEH2pNkG/6foHGxX+4WzB9 CFDfhtK7liFfo3mMDy737KM8CdZ41GWXVey4RjqOO3lWVh4XUdQ/L+X65A4lYxv2iM7q uVD3KZNNDhgxISClYWfHSi3wJv5wxsPHi0oAliiBtCCJp6tnJUzy3yq4d5AhlaeXnPe0 56TQqJRzrlbamF1Rtls2uoa1dKDEIu7QlGYR3kZD5hE8KpZMqlxUYYuLAwpf1JyLM0W6 UYcPREAyUdQ2gC4ePVOkVMKJYOusZQnvbRwPuZYmJh9z5gNNS1nsa2/+3PuIYW3B+8pL oxyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date:dkim-signature:arc-authentication-results; bh=QrIreBWahnaGYpLIhPt+QkS9c/2WucQokh1MB6y83ts=; b=fP2svAmlDZXjptRsapOf0m+oMQdMFAzRVtzvCvPNTbpDBJduJg6Cnh0lIU3oBHKauV 1llsW/keWpyNavpJp5OXfEJSOmqKFCymgMiVXatInozZhE8h5eNwCz2PMnZyocsaXn7T /HjlKwVQpZRPfIhi4qxqEGHbgG3GoqikaEVDgse4CEIZvu7xwPZSbqhROzTIo2YdSs5m JRAnlsDt3Ey7Nsew/MHDHdZi4advfsreOhDXk6nBsdwc4r034lEZRNaL6HlnKQRqh4V+ us08XtKT+AwGEfVjqmX4QwwvfUs4jMemUUtf8hbr0VXZQzzwoFrbLYOtVJeoRQTUwaPv x6rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@waldekranz-com.20150623.gappssmtp.com header.s=20150623 header.b=rkWfcDn7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f15-v6si22427709pli.194.2018.08.16.11.10.53; Thu, 16 Aug 2018 11:11:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@waldekranz-com.20150623.gappssmtp.com header.s=20150623 header.b=rkWfcDn7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390595AbeHPMp1 (ORCPT + 99 others); Thu, 16 Aug 2018 08:45:27 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44502 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390567AbeHPMp0 (ORCPT ); Thu, 16 Aug 2018 08:45:26 -0400 Received: by mail-lj1-f193.google.com with SMTP id q127-v6so3148180ljq.11 for ; Thu, 16 Aug 2018 02:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=waldekranz-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QrIreBWahnaGYpLIhPt+QkS9c/2WucQokh1MB6y83ts=; b=rkWfcDn7J5yJCksVrXeKMVa8rJB2qRcdkVo5Tyhhhr0IVzvrHnVJhIjo8cCxB9YnJK fMiH201YON2uU+KBn1mwLfeG6egQm5Ujf2nVKPCuaPNPqI1isWRbhAxiJs/SpOZvtklr Yk4heDUyKMmeTlCnefDDc2jrZZWS5lFHSG1fHDCSI1jz3wsQfQu0I82TflSiYZPJA7nj Ru3T7xnjS+TGU6fRBod4PkFSnPKVjlgBCUlu4cweg/WCz1xsOA8FTNGUfDflve/lmzkC 9J8WgyKk2d3QLNn28bQhlSHYU5P+N/0lJ0YpbsM73+0sJO5oYmPJKOgP2Mzp24PNeTY9 BbeA== 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:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QrIreBWahnaGYpLIhPt+QkS9c/2WucQokh1MB6y83ts=; b=KXKwtYSRsv9+8d0nMW3gQ/YX1VVO0hyXk/0b7yQvicbYCF31EG3+t2IagLJ50sdNL+ zw4hUgJizbPd2A4HuONmnYDAqW63H+PJ3T7OjsQm3h7+FVJTLO/m0oZAJ1IIEiK1F5M3 6u6NcaC/e7P1hi3Z91kyur+K39Yt2fj3ZiVaCqU+JHo47YsBhiugoQATZFIL6Tx+fpVv R3ZDhz9ZxvL5V5BTtvUykrWlHz0R5cDBuricKOnIJrpUKtmKz6rnvZDLkS0QGimMVRc9 ByIUTj1VsGN2GitB/0n3noQu2VJd02BsIC3WGgHtGGBUT8qdSRm7YYJVZBQ6zbdGBYTh eLhA== X-Gm-Message-State: AOUpUlE5eMYGVfsydElGvx0CvstWNZjq7Kbzi2WZsLyRtLps51kk+5Tg Ybxrq/EQ2V4a1ma44pRG6P/JKg== X-Received: by 2002:a2e:44c6:: with SMTP id b67-v6mr20225815ljf.102.1534412882568; Thu, 16 Aug 2018 02:48:02 -0700 (PDT) Received: from gmail.com (static-193-12-47-89.cust.tele2.se. [193.12.47.89]) by smtp.gmail.com with ESMTPSA id n6-v6sm4933424lfi.24.2018.08.16.02.48.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Aug 2018 02:48:01 -0700 (PDT) Date: Thu, 16 Aug 2018 11:48:00 +0200 From: Tobias Waldekranz To: Andrew Lunn , Florian Fainelli , "David S. Miller" , Steven Rostedt , Ingo Molnar , open list , "open list:ETHERNET PHY LIBRARY" Subject: Re: [PATCH] net: phy: add tracepoints Message-ID: <20180816094800.GA3136@gmail.com> References: <20180816093418.2621-1-tobias@waldekranz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180816093418.2621-1-tobias@waldekranz.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 16, 2018 at 11:34:15AM +0200, Tobias Waldekranz wrote: > Two tracepoints for now: > > * `phy_interrupt` Pretty self-explanatory. > > * `phy_state_change` Whenever the PHY's state machine is run, trace > the old and the new state. > > Signed-off-by: Tobias Waldekranz > --- > drivers/net/phy/phy.c | 4 +++ > include/trace/events/phy.h | 68 ++++++++++++++++++++++++++++++++++++++ > 2 files changed, 72 insertions(+) > create mode 100644 include/trace/events/phy.h > > diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c > index 9aabfa1a455a..8d22926f3962 100644 > --- a/drivers/net/phy/phy.c > +++ b/drivers/net/phy/phy.c > @@ -38,6 +38,9 @@ > > #include > > +#define CREATE_TRACE_POINTS > +#include > + > #define PHY_STATE_STR(_state) \ > case PHY_##_state: \ > return __stringify(_state); \ > @@ -1039,6 +1042,7 @@ void phy_state_machine(struct work_struct *work) > if (err < 0) > phy_error(phydev); > > + trace_phy_state_change(phydev, old_state); > if (old_state != phydev->state) > phydev_dbg(phydev, "PHY state change %s -> %s\n", > phy_state_to_str(old_state), > diff --git a/include/trace/events/phy.h b/include/trace/events/phy.h > new file mode 100644 > index 000000000000..7ba6c0dda47e > --- /dev/null > +++ b/include/trace/events/phy.h > @@ -0,0 +1,68 @@ > +#undef TRACE_SYSTEM > +#define TRACE_SYSTEM phy > + > +#if !defined(_TRACE_PHY_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_PHY_H > + > +#include > + > +TRACE_EVENT(phy_interrupt, > + TP_PROTO(int irq, struct phy_device *phydev), > + TP_ARGS(irq, phydev), > + TP_STRUCT__entry( > + __field(int, irq) > + __field(int, addr) > + __field(int, state) > + __array(char, ifname, IFNAMSIZ) > + ), > + TP_fast_assign( > + __entry->irq = irq; > + __entry->addr = phydev->mdio.addr; > + __entry->state = phydev->state; > + if (phydev->attached_dev) > + memcpy(__entry->ifname, > + netdev_name(phydev->attached_dev), > + IFNAMSIZ); > + else > + memset(__entry->ifname, 0, IFNAMSIZ); > + ), > + TP_printk("phy-%d-irq irq=%d ifname=%16s state=%d", > + __entry->addr, > + __entry->irq, > + __entry->ifname, > + __entry->state > + ) > + ); > + > +TRACE_EVENT(phy_state_change, > + TP_PROTO(struct phy_device *phydev, enum phy_state old_state), > + TP_ARGS(phydev, old_state), > + TP_STRUCT__entry( > + __field(int, addr) > + __field(int, state) > + __field(int, old_state) > + __array(char, ifname, IFNAMSIZ) > + ), > + TP_fast_assign( > + __entry->addr = phydev->mdio.addr; > + __entry->state = phydev->state; > + __entry->old_state = old_state; > + if (phydev->attached_dev) > + memcpy(__entry->ifname, > + netdev_name(phydev->attached_dev), > + IFNAMSIZ); > + else > + memset(__entry->ifname, 0, IFNAMSIZ); > + ), > + TP_printk("phy-%d-change ifname=%16s old_state=%d state=%d", > + __entry->addr, > + __entry->ifname, > + __entry->old_state, > + __entry->state > + ) > + ); > + > +#endif /* _TRACE_PHY_H */ > + > +/* This part must be outside protection */ > +#include > -- > 2.17.1 > This was sent in error. A v2 will follow. I had not used get_maintainers.pl before, sorry about the noise! -- Thanks - wkz