From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753263AbdLFAal (ORCPT ); Tue, 5 Dec 2017 19:30:41 -0500 Received: from mga04.intel.com ([192.55.52.120]:3325 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753143AbdLFAak (ORCPT ); Tue, 5 Dec 2017 19:30:40 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,365,1508828400"; d="scan'208";a="340298" Subject: Re: [PATCH v9 3/5] perf utils: use pmu->is_uncore to detect PMU UNCORE devices To: Arnaldo Carvalho de Melo Cc: Ganapatrao Kulkarni , Ganapatrao Kulkarni , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Will Deacon , catalin.marinas@arm.com, mark.rutland@arm.com, Alexander Shishkin , Peter Zijlstra , Ingo Molnar , jnair@caviumnetworks.com, Zhangshaokun , Jonathan.Cameron@huawei.com, Robert Richter , "Jin, Yao" References: <20171016183222.25750-1-ganapatrao.kulkarni@cavium.com> <20171016183222.25750-4-ganapatrao.kulkarni@cavium.com> <6fdad34d-1612-0447-e58e-5c748f92668d@linux.intel.com> <1f79aa3c-a061-7c55-5d3e-f13638be01ad@linux.intel.com> <20171205184242.GA19952@kernel.org> From: "Jin, Yao" Message-ID: <71db0255-af9b-968a-7baa-238d7146f069@linux.intel.com> Date: Wed, 6 Dec 2017 08:30:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171205184242.GA19952@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/6/2017 2:42 AM, Arnaldo Carvalho de Melo wrote: > Em Tue, Dec 05, 2017 at 08:35:22PM +0800, Jin, Yao escreveu: >> A quick test with the new patch 'fix_json_v9_2.patch' shows it working. > > I'll take this as a Tested-by: you, ok? > Hi Arnaldo, I didn't do a full test for this patch and for the whole patch series. I just do a quick test and it shows that the regression issue which was found in 'perf stat --per-thread' test case is disappear. If you think it's enough for adding Tested-by, that's fine for me. :) Thanks Jin Yao >> See the log: >> >> root@skl:/tmp# perf stat --per-thread -p 10322 -M CPI,IPC >> ^C >> Performance counter stats for process id '10322': >> >> vmstat-10322 1,879,654 inst_retired.any # >> 0.8 CPI >> vmstat-10322 1,565,807 cycles >> vmstat-10322 1,879,654 inst_retired.any # >> 1.2 IPC >> vmstat-10322 1,565,807 cpu_clk_unhalted.thread >> >> 2.850291804 seconds time elapsed >> >> Thanks for fixing it quickly. >> >> Thanks >> Jin Yao >> >> On 12/5/2017 3:23 PM, Jin, Yao wrote: >>> Hi, >>> >>> I applied the diff but it's failed. >>> >>> jinyao@skl:~/skl-ws/perf-dev/lck-4594/src$ patch -p1 < 1.pat >>> patching file tools/perf/util/pmu.c >>> patch: **** malformed patch at line 41: *head, struct perf_pmu *pmu) >>> >>> Could you send the patch as attachment to me in another mail thread? >>> >>> to yao.jin@linux.intel.com >>> cc yao.jin@intel.com >>> >>> Thanks >>> Jin Yao >>> >>> On 12/5/2017 3:12 PM, Ganapatrao Kulkarni wrote: >>>> diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c >>>> index 5ad8a18..57e38fd 100644 >>>> --- a/tools/perf/util/pmu.c >>>> +++ b/tools/perf/util/pmu.c >>>> @@ -538,6 +538,34 @@ static bool pmu_is_uncore(const char *name) >>>>   } >>>> >>>>   /* >>>> + *  PMU CORE devices have different name other than cpu in sysfs on some >>>> + *  platforms. looking for possible sysfs files to identify as core >>>> device. >>>> + */ >>>> +static int is_pmu_core(const char *name) >>>> +{ >>>> + struct stat st; >>>> + char path[PATH_MAX]; >>>> + const char *sysfs = sysfs__mountpoint(); >>>> + >>>> + if (!sysfs) >>>> + return 0; >>>> + >>>> + /* Look for cpu sysfs (x86 and others) */ >>>> + scnprintf(path, PATH_MAX, "%s/bus/event_source/devices/cpu", sysfs); >>>> + if ((stat(path, &st) == 0) && >>>> + (strncmp(name, "cpu", strlen("cpu")) == 0)) >>>> + return 1; >>>> + >>>> + /* Look for cpu sysfs (specific to arm) */ >>>> + scnprintf(path, PATH_MAX, "%s/bus/event_source/devices/%s/cpus", >>>> + sysfs, name); >>>> + if (stat(path, &st) == 0) >>>> + return 1; >>>> + >>>> + return 0; >>>> +} >>>> + >>>> +/* >>>>    * Return the CPU id as a raw string. >>>>    * >>>>    * Each architecture should provide a more precise id string that >>>> @@ -641,7 +669,7 @@ static void pmu_add_cpu_aliases(struct list_head >>>> *head, struct perf_pmu *pmu) >>>>    break; >>>>    } >>>> >>>> - if (pmu->is_uncore) { >>>> + if (!is_pmu_core(name)) { >>>>    /* check for uncore devices */ >>>>    if (pe->pmu == NULL) >>>>    continue; From mboxrd@z Thu Jan 1 00:00:00 1970 From: yao.jin@linux.intel.com (Jin, Yao) Date: Wed, 6 Dec 2017 08:30:37 +0800 Subject: [PATCH v9 3/5] perf utils: use pmu->is_uncore to detect PMU UNCORE devices In-Reply-To: <20171205184242.GA19952@kernel.org> References: <20171016183222.25750-1-ganapatrao.kulkarni@cavium.com> <20171016183222.25750-4-ganapatrao.kulkarni@cavium.com> <6fdad34d-1612-0447-e58e-5c748f92668d@linux.intel.com> <1f79aa3c-a061-7c55-5d3e-f13638be01ad@linux.intel.com> <20171205184242.GA19952@kernel.org> Message-ID: <71db0255-af9b-968a-7baa-238d7146f069@linux.intel.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 12/6/2017 2:42 AM, Arnaldo Carvalho de Melo wrote: > Em Tue, Dec 05, 2017 at 08:35:22PM +0800, Jin, Yao escreveu: >> A quick test with the new patch 'fix_json_v9_2.patch' shows it working. > > I'll take this as a Tested-by: you, ok? > Hi Arnaldo, I didn't do a full test for this patch and for the whole patch series. I just do a quick test and it shows that the regression issue which was found in 'perf stat --per-thread' test case is disappear. If you think it's enough for adding Tested-by, that's fine for me. :) Thanks Jin Yao >> See the log: >> >> root at skl:/tmp# perf stat --per-thread -p 10322 -M CPI,IPC >> ^C >> Performance counter stats for process id '10322': >> >> vmstat-10322 1,879,654 inst_retired.any # >> 0.8 CPI >> vmstat-10322 1,565,807 cycles >> vmstat-10322 1,879,654 inst_retired.any # >> 1.2 IPC >> vmstat-10322 1,565,807 cpu_clk_unhalted.thread >> >> 2.850291804 seconds time elapsed >> >> Thanks for fixing it quickly. >> >> Thanks >> Jin Yao >> >> On 12/5/2017 3:23 PM, Jin, Yao wrote: >>> Hi, >>> >>> I applied the diff but it's failed. >>> >>> jinyao at skl:~/skl-ws/perf-dev/lck-4594/src$ patch -p1 < 1.pat >>> patching file tools/perf/util/pmu.c >>> patch: **** malformed patch at line 41: *head, struct perf_pmu *pmu) >>> >>> Could you send the patch as attachment to me in another mail thread? >>> >>> to yao.jin at linux.intel.com >>> cc yao.jin at intel.com >>> >>> Thanks >>> Jin Yao >>> >>> On 12/5/2017 3:12 PM, Ganapatrao Kulkarni wrote: >>>> diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c >>>> index 5ad8a18..57e38fd 100644 >>>> --- a/tools/perf/util/pmu.c >>>> +++ b/tools/perf/util/pmu.c >>>> @@ -538,6 +538,34 @@ static bool pmu_is_uncore(const char *name) >>>> ? } >>>> >>>> ? /* >>>> + *? PMU CORE devices have different name other than cpu in sysfs on some >>>> + *? platforms. looking for possible sysfs files to identify as core >>>> device. >>>> + */ >>>> +static int is_pmu_core(const char *name) >>>> +{ >>>> + struct stat st; >>>> + char path[PATH_MAX]; >>>> + const char *sysfs = sysfs__mountpoint(); >>>> + >>>> + if (!sysfs) >>>> + return 0; >>>> + >>>> + /* Look for cpu sysfs (x86 and others) */ >>>> + scnprintf(path, PATH_MAX, "%s/bus/event_source/devices/cpu", sysfs); >>>> + if ((stat(path, &st) == 0) && >>>> + (strncmp(name, "cpu", strlen("cpu")) == 0)) >>>> + return 1; >>>> + >>>> + /* Look for cpu sysfs (specific to arm) */ >>>> + scnprintf(path, PATH_MAX, "%s/bus/event_source/devices/%s/cpus", >>>> + sysfs, name); >>>> + if (stat(path, &st) == 0) >>>> + return 1; >>>> + >>>> + return 0; >>>> +} >>>> + >>>> +/* >>>> ?? * Return the CPU id as a raw string. >>>> ?? * >>>> ?? * Each architecture should provide a more precise id string that >>>> @@ -641,7 +669,7 @@ static void pmu_add_cpu_aliases(struct list_head >>>> *head, struct perf_pmu *pmu) >>>> ?? break; >>>> ?? } >>>> >>>> - if (pmu->is_uncore) { >>>> + if (!is_pmu_core(name)) { >>>> ?? /* check for uncore devices */ >>>> ?? if (pe->pmu == NULL) >>>> ?? continue;