Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2560586pxu; Mon, 7 Dec 2020 09:31:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwISglSgNQJwsX7od+c8nRA4d5GGJD1K0zUqwcnRIaP4I0Z8G/mg/NfK5bM4LZCoAAwZVeP X-Received: by 2002:a17:906:6a92:: with SMTP id p18mr5915103ejr.308.1607362310289; Mon, 07 Dec 2020 09:31:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607362310; cv=none; d=google.com; s=arc-20160816; b=cCGIaqVOivKx7TaCf3YKPtgVdFC3re2YM5Yb9OcjnywPCR1rE02YGtPlPs6nTy9uAE VdtkuKEbo3O1WkK9vdpCOPrQFBtSjRRK8ls0Ye+hqBZ0MVH5selUnjaHKTvzqtood9dz OIxjq2gq99240eZWWhxFFhqjL7FJrAw6DuNWzR/W2ytOAH/rzc5oRL9MlqByUczTGaD2 lc85nmQ/f2o7j+vnUwVy/vGS6Wn6qto9XL3rm1nl22eHzqJ+Epmz62vu8EYhx+EfNUT/ spiCRkb2U44ryq3WsozLu/h6wG9/oqE7XLJdiBoQRU1qEratNmE2cFKm+nYH4dDJYVFD dusQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=D5ig0DP2Ye6TVLz94HHG6cuJJcmtqqCzFSQIM2JqpPY=; b=gAjw2sjbttkx8Sm3TUxLohF19ekwiGwp1Pz4jZnjEikTvPwpvpRk/ob6nRwGHb2i/q CL4w4/bx2mGvMucV41GFiFYpGbTIeGtwO67TqFpJhERm2zr/nGBcGMj+kZHDo5L1uziR w50XuzCgeSajC6zP6S2zzkldEkPFCq90MFKdgG28BMFALONOxYqKt9ucbgDWoJO64n7S oVOiL4KY85+6fGTRbbOuPbccz7K3Y4a8P5QiQDgKHdsmO81Djy2+Aib/44Rme7vq4IOs RaJDLEDBXva6ZfIcpKjDnRPJsHPZ5cbBSiPsYDFuqFvVey0FY/rOXn91+n62VCFvPe3p NKbw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si6852258ejy.309.2020.12.07.09.31.23; Mon, 07 Dec 2020 09:31:50 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727235AbgLGR1r (ORCPT + 99 others); Mon, 7 Dec 2020 12:27:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:40476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725918AbgLGR1r (ORCPT ); Mon, 7 Dec 2020 12:27:47 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5FC412388D; Mon, 7 Dec 2020 17:27:05 +0000 (UTC) Date: Mon, 7 Dec 2020 12:27:03 -0500 From: Steven Rostedt To: Avri Altman Cc: Bean Huo , "alim.akhtar@samsung.com" , "asutoshd@codeaurora.org" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "stanley.chu@mediatek.com" , "beanhuo@micron.com" , "bvanassche@acm.org" , "tomas.winkler@intel.com" , "cang@codeaurora.org" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v1 3/3] scsi: ufs: Make UPIU trace easier differentiate among CDB, OSF, and TM Message-ID: <20201207122703.0190adf9@gandalf.local.home> In-Reply-To: References: <20201206164226.6595-1-huobean@gmail.com> <20201206164226.6595-4-huobean@gmail.com> <20201207103708.66897ef3@gandalf.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 7 Dec 2020 16:40:51 +0000 Avri Altman wrote: > > > > On Mon, 7 Dec 2020 07:57:27 +0000 > > Avri Altman wrote: > > > > > > > > > > TP_printk( > > > > - "%s: %s: HDR:%s, CDB:%s", > > > > + "%s: %s: HDR:%s, %s:%s", > > > > __get_str(str), __get_str(dev_name), > > > > __print_hex(__entry->hdr, sizeof(__entry->hdr)), > > > > + __get_str(tsf_type), > > > This breaks what current parsers expects. > > > Why str is not enough to distinguish between the command? > > > > Hopefully it shouldn't. Reading from user space should use the > > libtraceevent library, that reads the format files and extracts the raw > > data to find the fields. As long as the field exists, it should not break > > user space parsers. If it does, please let me know, and I'll gladly help > > change the user space code to use libtraceevent :-) > Hi Steve, > Thanks. I wasn't aware of libtraceevent - is this a new thing? Actually, it's been around almost as long as ftrace. But unfortunately, it's just now becoming a separate library. It was originally developed for trace-cmd, but has been copied into perf, power-top and rasdaemon. But this copying is inefficient and a maintenance nightmare, and we finally have the library as a stand alone, and hopefully will be delivered by distributions (I believe they are packaging it). https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/ Looks like distros are starting to catch on. https://packages.debian.org/unstable/libtraceevent-dev We are currently working on libtracefs https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ Which will make it a lot easier for applications to interact with the tracefs file system. I'm hoping to have this ready for distros by the end of the year. We have applications coming that depend on these. > > We have a relatively sophisticated analysis platform that utilizes raw traces, > Among which the upiu trace is the most important and informative. > > This tool has evolved over the years, adding more and more parsers per need, > and the users are picking the appropriate parser per the trace they used. > > We will surely be glad to adopt new tracing capabilities, I think libtraceevent and libtracefs would be a much welcome addition for upiu trace as it would be reading raw data (very fast), and have an API that makes doing so much simpler. For example, I just wrote a quick program that checks what files an application opens (this is not in anyway production ready): http://rostedt.org/code/show-open-files.c > But we would prefer not to break anything. Of course! And again, I would be happy to help out in converting to this libraries. It will make your applications more robust, as they make it so that you do not need to rely on the order of fields. Note, there's plans on making these libraries python modules as well (to have python scripts enable and read ftrace data). -- Steve