Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4053890pxj; Mon, 24 May 2021 22:42:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfeuI/XJVWkqDz5cKVgxsH7YIW3TeUcfVKaY5ZDvRYWl576Lft3yGi2Vny4w+wJfqBI7sm X-Received: by 2002:a17:906:9bd6:: with SMTP id de22mr26530369ejc.382.1621921325774; Mon, 24 May 2021 22:42:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621921325; cv=none; d=google.com; s=arc-20160816; b=u2cmlVt1yFePuYEAcMVdogKf9i5iN5HCjohUw3BquJ9X8a/BPrTFGrycpv6mscACO7 PWx2b67rUD8txMXbsYndFGPSkMwI12PJQh8bTya3Ztd6C7/+gwYk4qHmoPy4vofgRSL9 zp8ZxZTpj3zF7iC0w04+vTrW81C8K7Mk1/L1xkfHmzMne/YSI7XshGeL23H8yq204tk5 gH0RaessmaQewoBqpu+eMCLNZWHnOI24ttXAHFh7Rzj64MuyfHQr6Dh1PfZcODf9E7G4 S3MSHKnixPlGKJz/bgKCqLfs2PGkP7z5kYX+8AqgwSXgegwHUCUiZNdvAsPApP0ybMV8 qyfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=x+hsp663YmNirTE70XKBGaTFGIHYinqaEkVs4XbwEK0=; b=gIocWKRtM+NJSGGkGNoLFBanQ1/2p5cRgBugSltIu1xbaUbpeW3DNstoJrx/uPkC8c KJIZEy7p3DFvkGe3JUfu5yHwQZmNtw3ucESPzvS4UGgnWd6mYUSxgLQ2RREkT8kQkN26 LMio589Z7Hnw5T9hNBRmFgvaRRnsCR79rYnBIDoPK6BI0XswLPtVaH7O5tnTOGmyc0lX DZ0hJnjblG1zHeKJMOjmGkXAAi3EslNNuIwL5P1RVP61PljJ4eS+ZrCKY+9RdkawpDeu mv4eq8G6TGJ+mJLXcqGDY5s0u2MwoOwBGQFrsUtJyv2UL/7axRoUmiwgF/BoRkZwFYq+ +IWQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k24si14837072ejq.376.2021.05.24.22.41.42; Mon, 24 May 2021 22:42:05 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230501AbhEYFla (ORCPT + 99 others); Tue, 25 May 2021 01:41:30 -0400 Received: from mga09.intel.com ([134.134.136.24]:48048 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbhEYFl3 (ORCPT ); Tue, 25 May 2021 01:41:29 -0400 IronPort-SDR: PjzDN90RX/has5WXYi2NrRtiPs2TDyOTgu4HpRWAmft4lkUoKP2h1EbMiyIGMPcxKfzkHi/k2a BhC89Dzofb6g== X-IronPort-AV: E=McAfee;i="6200,9189,9994"; a="202126755" X-IronPort-AV: E=Sophos;i="5.82,327,1613462400"; d="scan'208";a="202126755" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2021 22:40:00 -0700 IronPort-SDR: Ev44/IgM1T+58J6F+93wdRRKbmcyaOlwChtxRlPWYkqpvUUaBE3GPkylGrGyvbcZXHXLYBh4nn lE4G+yLJRPdQ== X-IronPort-AV: E=Sophos;i="5.82,327,1613462400"; d="scan'208";a="442388439" Received: from unknown (HELO [10.239.159.33]) ([10.239.159.33]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2021 22:39:57 -0700 Subject: Re: [PATCH v1 2/5] perf tools: Support pmu name in perf_mem_events__name To: Jiri Olsa Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com References: <20210520070040.710-1-yao.jin@linux.intel.com> <20210520070040.710-3-yao.jin@linux.intel.com> From: "Jin, Yao" Message-ID: Date: Tue, 25 May 2021 13:39:55 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiri, On 5/25/2021 1:20 AM, Jiri Olsa wrote: > On Thu, May 20, 2021 at 03:00:37PM +0800, Jin Yao wrote: > > SNIP > >> --- a/tools/perf/arch/x86/util/mem-events.c >> +++ b/tools/perf/arch/x86/util/mem-events.c >> @@ -4,10 +4,10 @@ >> #include "mem-events.h" >> >> static char mem_loads_name[100]; >> -static bool mem_loads_name__init; >> +static char mem_stores_name[100]; >> >> #define MEM_LOADS_AUX 0x8203 >> -#define MEM_LOADS_AUX_NAME "{cpu/mem-loads-aux/,cpu/mem-loads,ldlat=%u/pp}:S" >> +#define MEM_LOADS_AUX_NAME "{%s/mem-loads-aux/,%s/mem-loads,ldlat=%u/}:P" >> >> bool is_mem_loads_aux_event(struct evsel *leader) >> { >> @@ -22,28 +22,34 @@ bool is_mem_loads_aux_event(struct evsel *leader) >> return leader->core.attr.config == MEM_LOADS_AUX; >> } >> >> -char *perf_mem_events__name(int i) >> +char *perf_mem_events__name(int i, char *pmu_name) >> { >> struct perf_mem_event *e = perf_mem_events__ptr(i); >> >> if (!e) >> return NULL; >> >> - if (i == PERF_MEM_EVENTS__LOAD) { >> - if (mem_loads_name__init) >> - return mem_loads_name; >> - >> - mem_loads_name__init = true; >> + if (!pmu_name) >> + pmu_name = (char *)"cpu"; >> >> - if (pmu_have_event("cpu", "mem-loads-aux")) { >> + if (i == PERF_MEM_EVENTS__LOAD) { >> + if (pmu_have_event(pmu_name, "mem-loads-aux")) { >> scnprintf(mem_loads_name, sizeof(mem_loads_name), >> - MEM_LOADS_AUX_NAME, perf_mem_events__loads_ldlat); >> + MEM_LOADS_AUX_NAME, pmu_name, pmu_name, >> + perf_mem_events__loads_ldlat); >> } else { >> scnprintf(mem_loads_name, sizeof(mem_loads_name), >> - e->name, perf_mem_events__loads_ldlat); >> + e->name, pmu_name, >> + perf_mem_events__loads_ldlat); >> } >> return mem_loads_name; >> } >> >> + if (i == PERF_MEM_EVENTS__STORE) { >> + scnprintf(mem_stores_name, sizeof(mem_stores_name), >> + e->name, pmu_name); >> + return mem_stores_name; >> + } > > so the patch also adds mem_stores_name and removes mem_loads_name__init, > that should be explained or more likely in separated patches > > jirka > I will not remove mem_loads_name__init in order to keep the original behavior for non-hybrid platform. I can move the mem_store to a separate patch. Thanks Jin Yao