From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751658AbdKVFex (ORCPT ); Wed, 22 Nov 2017 00:34:53 -0500 Received: from mga04.intel.com ([192.55.52.120]:47852 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751375AbdKVFev (ORCPT ); Wed, 22 Nov 2017 00:34:51 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,436,1505804400"; d="scan'208";a="4623557" Subject: Re: [PATCH v1 8/9] perf stat: Remove --per-thread pid/tid limitation 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: <1511189024-19908-1-git-send-email-yao.jin@linux.intel.com> <1511189024-19908-9-git-send-email-yao.jin@linux.intel.com> <20171121151823.GL20440@krava> From: "Jin, Yao" Message-ID: <152b6f56-1f8d-fb9c-fe9d-0fe4ed799cc1@linux.intel.com> Date: Wed, 22 Nov 2017 13:34:49 +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: <20171121151823.GL20440@krava> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/21/2017 11:18 PM, Jiri Olsa wrote: > On Mon, Nov 20, 2017 at 10:43:43PM +0800, Jin Yao wrote: > > SNIP > >> diff --git a/tools/perf/util/target.h b/tools/perf/util/target.h >> index 446aa7a..6ef01a8 100644 >> --- a/tools/perf/util/target.h >> +++ b/tools/perf/util/target.h >> @@ -64,6 +64,11 @@ static inline bool target__none(struct target *target) >> return !target__has_task(target) && !target__has_cpu(target); >> } >> >> +static inline bool target__has_per_thread(struct target *target) >> +{ >> + return target->system_wide && target->per_thread; >> +} > > this is confusing.. has_per_thread depends on system_wide? > This patch series only supports to get per-thread data for the whole system. So I add checking of system_wide here. >> + >> static inline bool target__uses_dummy_map(struct target *target) >> { >> bool use_dummy = false; >> @@ -73,6 +78,8 @@ static inline bool target__uses_dummy_map(struct target *target) >> else if (target__has_task(target) || >> (!target__has_cpu(target) && !target->uses_mmap)) >> use_dummy = true; >> + else if (target__has_per_thread(target)) >> + use_dummy = true; > > why do we need dummy_map for this? please comment > We need dummy_map here. That's similar to the processing of '--per-thread -p -t'. We need a dummy map to help us to aggregate counts per-thread. Thanks Jin Yao > thanks, > jirka >