Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3237630pxk; Mon, 21 Sep 2020 08:33:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyePHIwl8di1adKVORPkcHFfQ/4JT1dUgci3NJyGCgEOvScpuS1bmVDVnpRz229jqawmTcH X-Received: by 2002:a05:6402:228c:: with SMTP id cw12mr247399edb.174.1600702428582; Mon, 21 Sep 2020 08:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600702428; cv=none; d=google.com; s=arc-20160816; b=rdnBl40NYvPE+ETppa9IomeqfxBjiVmukYHath9L0/MmdoZ9wv4FNCSbAp2Xu9z9D9 gW8qK3WsC7m+WUuMskBoadoIEsifHyVye3A4dYBfMfPMZgBmLd1io+korwjvUeCApVWC YvwE5yCmOsXXzEEEujEC4DIMDfs2W3h2DRzQpephHcYlNqHoZ5lHyRNcD0Da+2NSzDNU L3dHmmfcV4+M+wtsS6cYj6brRWBepWu7HVbQlmKu2O8Hy3t0X9P/xFRGchkQGYGqkpwr Ev1bqHN05oM+GobBkPpTmLjRmqwong/gWKL/NmNYfhvF9Y0Bnfih/UrMo+G7Ih/DlHy+ SYFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=PgPw/ntjnH0F8rtfRqkERRZPscIc4jsUwQViERSi3D4=; b=RzpYLBm2BxFJ6xUKoL+2PUA0pORIxu/+lU3VrDX1z6NMVDI1yE2exAQewS2g+pnmeZ KkrXQIPtEXWRgCvx01GWtvNUrxDkZTdhBNBLs//Qw/s29mWtgrfcO6G+jEb0zmyNj3SS 4aP+jiixlbyU1CxOfUsK79K3Ya8JqlxyrcS+OvVPzliDFeDPQPwPUqZur3zxywFEJRC+ jWt1S0F/9iK5FNFvG6o+WDd4+KJWRAKrMdRSQtdK4a3dwfLJpPxRuDVB0LERJS5RGm/0 fzGiOndY1zZtVV18kYW0waEhQn8s0r/ftPTwMP755aKFePZN0V6W4vaIhYvHvnfL4Det ReVg== 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 jo13si8145007ejb.200.2020.09.21.08.33.24; Mon, 21 Sep 2020 08:33:48 -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 S1727901AbgIUP3Q (ORCPT + 99 others); Mon, 21 Sep 2020 11:29:16 -0400 Received: from mga05.intel.com ([192.55.52.43]:52273 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727893AbgIUP3K (ORCPT ); Mon, 21 Sep 2020 11:29:10 -0400 IronPort-SDR: 2bycYRSquEJC9BaXtBgFo1zMPgPSwbsUZ+cb37k5/QTp7cW5kR92sHyi2yWnBh0UMEY5GHTSBh xCZenfg6acJA== X-IronPort-AV: E=McAfee;i="6000,8403,9751"; a="245243272" X-IronPort-AV: E=Sophos;i="5.77,286,1596524400"; d="scan'208";a="245243272" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2020 08:29:10 -0700 IronPort-SDR: fGL/VDz9CSi/KR+Z/LSudQoBwIE7mDVqIUS7SI5b6oEFzD3jU6QZXkWGBx55RCJJR33nMHslP9 TVNs44JuqVIQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,286,1596524400"; d="scan'208";a="309079409" Received: from labuser-ice-lake-client-platform.jf.intel.com ([10.54.55.65]) by orsmga006.jf.intel.com with ESMTP; 21 Sep 2020 08:29:09 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, linux-kernel@vger.kernel.org Cc: mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, eranian@google.com, ak@linux.intel.com, dave.hansen@intel.com, kirill.shutemov@linux.intel.com, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, Kan Liang Subject: [PATCH V8 3/4] powerpc/perf: Support PERF_SAMPLE_DATA_PAGE_SIZE Date: Mon, 21 Sep 2020 08:26:52 -0700 Message-Id: <20200921152653.3924-4-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200921152653.3924-1-kan.liang@linux.intel.com> References: <20200921152653.3924-1-kan.liang@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang The new sample type, PERF_SAMPLE_DATA_PAGE_SIZE, requires the virtual address. Update the data->addr if the sample type is set. Signed-off-by: Kan Liang --- arch/powerpc/perf/core-book3s.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c index 78fe34986594..ce22bd23082d 100644 --- a/arch/powerpc/perf/core-book3s.c +++ b/arch/powerpc/perf/core-book3s.c @@ -2065,6 +2065,9 @@ static struct pmu power_pmu = { .sched_task = power_pmu_sched_task, }; +#define PERF_SAMPLE_ADDR_TYPE (PERF_SAMPLE_ADDR | \ + PERF_SAMPLE_PHYS_ADDR | \ + PERF_SAMPLE_DATA_PAGE_SIZE) /* * A counter has overflowed; update its count and record * things if requested. Note that interrupts are hard-disabled @@ -2120,8 +2123,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val, perf_sample_data_init(&data, ~0ULL, event->hw.last_period); - if (event->attr.sample_type & - (PERF_SAMPLE_ADDR | PERF_SAMPLE_PHYS_ADDR)) + if (event->attr.sample_type & PERF_SAMPLE_ADDR_TYPE) perf_get_data_addr(event, regs, &data.addr); if (event->attr.sample_type & PERF_SAMPLE_BRANCH_STACK) { -- 2.17.1