Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2185240imm; Thu, 7 Jun 2018 06:48:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIbAyJqOFu0VYbtc9qaOTwgu49qze5TNBP72pTtnfWN0jTETHwdpe6KdphZfvEkT8efhiXD X-Received: by 2002:a62:701:: with SMTP id b1-v6mr1895118pfd.252.1528379282125; Thu, 07 Jun 2018 06:48:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528379282; cv=none; d=google.com; s=arc-20160816; b=ufCd/LI8yiaelK++qn8RYQ5im348dK3HJKMq/wdHxzf00YxbrqG4YZSepEiuF8ACMh H/yKAVyWnu1sSX9J1MBfGfzqzpbF/7F4vejMhlTHj9ji52Vfq0ftXl6UlPppZTDvxsNb BnKXt9IC1oQ3dtNNXmjWhlwAuq/1bL0zgTc7/ZtWnnPUwXO4RFJiDntDWH5xvr0yfF1m D1COwiAIGpuuQedXkLOxlnxurex3VDUJU6SpDULmcvXZJ+8LnzQZu3YfV4cXlU4gZWg1 lPxz/au2AAaN/vV+aksW/UuGi4LFfK53IQfFpcMWjrqYyWe30WFU5CNShc02ZOkZ3RDE fubQ== 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:cc :to:from:date:dkim-signature:arc-authentication-results; bh=lPBedv139C0qk/qc6vVCr4F6qEu3IUmIH/7NOwLZTDQ=; b=cbjgVl8R9QrpPn+WtK5S4jJJFUfTdU0XUYKJEHH27zMp5zS+mlOZF8pW5ax49ryTd0 +2We35NxF54WTzfz1/UELhF4I00vPgCsJe+f0ENqUEB3moiEokFCegF+1ADHFPfsyCt5 lfyJx95QcCTxTJdhuox/R4Hu5yETJsfw5nJtqg7ve7qUjEMqDQoxU2HIAND7dRmvZk2H NpMAJVOFEFu6kbCw1hVyMkP4t3k6XlJCVWTujrKzXVYe+cGU7MMPtJAVSf1G+dFDQiRW bPtJXk7LeJVLRIzdrLPi902nYupT8Vvm3C49Hbsg2tvxFnkaCdUgzUS/+3SfaeuWMqPR Ipvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U+xxUOGD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y18-v6si6599410pgv.388.2018.06.07.06.47.47; Thu, 07 Jun 2018 06:48:02 -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=@kernel.org header.s=default header.b=U+xxUOGD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932663AbeFGNp6 (ORCPT + 99 others); Thu, 7 Jun 2018 09:45:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:57660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753088AbeFGNp5 (ORCPT ); Thu, 7 Jun 2018 09:45:57 -0400 Received: from jouet.infradead.org (unknown [190.15.121.82]) (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 BA79C2086E; Thu, 7 Jun 2018 13:45:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528379157; bh=9+UR/Djv9T1yG9zK+kmVcweUbtZOLEhk5tcf2Fsf9MM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U+xxUOGD5m550saYjWFcRBlnaMHF4DiAsmMGi8ql58+I9N1oBNAyHZ+hwe3a6+EFV 5iw59CGQW6ARWdqxmlQHzhjcSy6ZIDP7JghnUWffDY8Aq3Q96itruiAUFVJxipKfg/ st/ZHPJhCz3xsz1oSPeiEkWDnYpOo2aKh9z22afg= Received: by jouet.infradead.org (Postfix, from userid 1000) id 4930E1468B9; Thu, 7 Jun 2018 10:45:54 -0300 (-03) Date: Thu, 7 Jun 2018 10:45:54 -0300 From: Arnaldo Carvalho de Melo To: Paul Clarke Cc: Ravi Bangoria , Ingo Molnar , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Alexander Shishkin , Jiri Olsa , Michael Ellerman , Namhyung Kim , "Naveen N . Rao" , Arnaldo Carvalho de Melo Subject: Re: [PATCH 42/46] perf script powerpc: Python script for hypervisor call statistics Message-ID: <20180607134554.GD30317@kernel.org> References: <20180605175030.32549-1-acme@kernel.org> <20180605175030.32549-43-acme@kernel.org> <5856a13c-7a34-f4f4-d5f2-100f626a213f@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Jun 07, 2018 at 08:41:46AM -0500, Paul Clarke escreveu: > On 06/07/2018 12:34 AM, Ravi Bangoria wrote: > > On 06/06/2018 08:23 PM, Paul Clarke wrote: > >> On 06/05/2018 12:50 PM, Arnaldo Carvalho de Melo wrote: > >>> From: Ravi Bangoria > >>> > >>> Add python script to show hypervisor call statistics. Ex, > >>> > >>> # perf record -a -e "{powerpc:hcall_entry,powerpc:hcall_exit}" > >>> # perf script -s scripts/python/powerpc-hcalls.py > >>> hcall count min(ns) max(ns) avg(ns) > >>> -------------------------------------------------------------------- > >>> H_RANDOM 82 838 1164 904 > >>> H_PUT_TCE 47 1078 5928 2003 > >>> H_EOI 266 1336 3546 1654 > >>> H_ENTER 28 1646 4038 1952 > >>> H_PUT_TCE_INDIRECT 230 2166 18168 6109 > >>> H_IPI 238 1072 3232 1688 > >>> H_SEND_LOGICAL_LAN 42 5488 21366 7694 > >>> H_STUFF_TCE 294 986 6210 3591 > >>> H_XIRR 266 2286 6990 3783 > >>> H_PROTECT 10 2196 3556 2555 > >>> H_VIO_SIGNAL 294 1028 2784 1311 > >>> H_ADD_LOGICAL_LAN_BUFFER 53 1978 3450 2600 > >>> H_SEND_CRQ 77 1762 7240 2447 > >> > >> This translation from HCALL code to mnemonic is more generally useful. Is there a good way to make the "hcall_table_lookup" function more generally available, like "syscall_name" in scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py ? It's even simpler than the syscall ID-to-name mapping, because the HCALL codes are constant, unlike syscall IDs which vary between arches. > >> > > > > Right, but I don't see any other python script for hcalls. So, I thought > > to add it in the script itself. Let me know if you are planning to add > > any :) We will move it in a generic module. > We're already doing the same thing in an external script. > (https://github.com/open-power-sdk/curt/blob/master/curt.py#L264 > revision 107c97c3aadba3177bc8cf35b06ba165e6ac557f.) > ...which reminds me that I should consider sending that script to > linux-perf-users to see if it's interesting enough to be included > upstream. If you don't have any restriction, then its interesting to have it included, I think, this way we can find these kinds of needed common infrastructure more easily, and also when doing changes take into account existing scripts. - Arnaldo