From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75063C43603 for ; Wed, 18 Dec 2019 12:09:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3BAEE2146E for ; Wed, 18 Dec 2019 12:09:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CP9aKSRC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BAEE2146E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hFPdMUzkaJ0dBJ4oVO5/Yd2agKLRnMdJYYMDDz9nBo8=; b=CP9aKSRCu7MedP gZ6Ug2YrYLXjra8W1FdQ8TvCkU5RafuYwJJYsSDz6xzfOA9MPlrKxFiKbAQcrGWMEz12JCPiLHvHf bqnQTiRskjpX8b5Rd4siWf0O/q/6RWpU+uKgyTIqbigRbtX/9fJ2xYadn1jmdVcLnzwtiLPtNY0z/ fHNeUWhD8Las99699zV+DVALwypA3DWVZ3zu7zRaCx/v4NwvhXggfqjuutzMGQtvug7tMett9u33d hAR+jfCzKwDrHs6IZIzooXTnY7rnSFdDjd4UZc8esNRQ7eSMIg+rDgEAXWs5ye8CZ/NRSL/kVGQ04 R98Jqjuru9sY30NmOIUg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ihY8d-0002E4-Nd; Wed, 18 Dec 2019 12:09:11 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ihY8b-0002DG-2j for linux-arm-kernel@lists.infradead.org; Wed, 18 Dec 2019 12:09:10 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2C5F930E; Wed, 18 Dec 2019 04:09:07 -0800 (PST) Received: from bogus (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 290633F6CF; Wed, 18 Dec 2019 04:09:06 -0800 (PST) Date: Wed, 18 Dec 2019 12:09:00 +0000 From: Sudeep Holla To: Jim Quinlan Subject: Re: [PATCH 1/2] include: trace: Add SCMI header with trace events Message-ID: <20191218120900.GA28599@bogus> References: <20191216161650.21844-1-lukasz.luba@arm.com> <20191216161650.21844-1-lukasz.luba@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191216161650.21844-1-lukasz.luba@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191218_040909_167651_57E537AE X-CRM114-Status: GOOD ( 19.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, rostedt@goodmis.org, mingo@redhat.com, lukasz.luba@arm.com, Sudeep Holla , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Dec 16, 2019 at 05:15:54PM -0500, Jim Quinlan wrote: > From: Lukasz Luba > > + > +TRACE_EVENT(scmi_xfer_begin, > + TP_PROTO(u8 id, u8 protocol_id, u16 seq, bool poll), > + TP_ARGS(id, protocol_id, seq, poll), > + > + TP_STRUCT__entry( > + __field(u8, id) > + __field(u8, protocol_id) > + __field(u16, seq) > + __field(bool, poll) > + ), > + > + TP_fast_assign( > + __entry->id = id; > + __entry->protocol_id = protocol_id; > + __entry->seq = seq; > + __entry->poll = poll; > + ), > + > + TP_printk("id=%u protocol_id=%u seq=%u poll=%u", __entry->id, > + __entry->protocol_id, __entry->seq, __entry->poll) > +); > + > +TRACE_EVENT(scmi_xfer_end, > + TP_PROTO(u8 id, u8 protocol_id, u16 seq, u32 status), > + TP_ARGS(id, protocol_id, seq, status), > + > + TP_STRUCT__entry( > + __field(u8, id) > + __field(u8, protocol_id) > + __field(u16, seq) > + __field(u32, status) > + ), > + > + TP_fast_assign( > + __entry->id = id; > + __entry->protocol_id = protocol_id; > + __entry->seq = seq; > + __entry->status = status; > + ), > + > + TP_printk("id=%u protocol_id=%u seq=%u status=%u", __entry->id, > + __entry->protocol_id, __entry->seq, __entry->status) > +); > > Hello, > > When there are multiple messages in the mbox queue, I've found it > a chore matching up the 'begin' event with the 'end' event for each > SCMI msg. The id (command) may not be unique, the proto_id may not be > unique, and the seq may not be unique. I agree on id and proto_id part easily and the seq may not be unique if and only if the previous command has completed. > The combination of the three may not be unique. Not 100% sure on that. I remember one of the issue you reported where OS times out and platform may still be processing it. That's one of the case where seq id may get re-assigned, but now that's fixed and the scenario may not happen. I am trying to understand why you think it is not unique ? > Would it make sense to assign a monotonically increasing ID to each > msg so that one can easily match the two events for each msg? I am not sure if we need to maintain a tracker/counter just for trace purposes. > This id could be the result of an atomic increment and > could be stored in the xfer structure. Of course, it would be one of > the values printed out in the events. > > Also, would you consider a third event, right after the > scmi_fetch_response() invocation in scmi_rx_callback()? I've found > this to be insightful in situations where we were debugging a timeout. > > I'm fine if you elect not to do the above; I just wanted to post > this for your consideration. > I am interested in the scenario we can make use of this and also help in testing it if we add this. I am not against it but I don't see the need for it. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel