Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp448639ybg; Wed, 23 Oct 2019 00:15:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaVsvZkC2Q+VwIHcVSrgB+NR63ZKhHUCV9Yz2XMdOHEJg5SqCiJCPbHW+TjnLItpQckUkR X-Received: by 2002:a17:906:4ac8:: with SMTP id u8mr31780204ejt.193.1571814956598; Wed, 23 Oct 2019 00:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571814956; cv=none; d=google.com; s=arc-20160816; b=gvJoa84REd+ceelQGPgMogoOIxV64JUACDZ/BhSJMp0u2Vt8EYprj0mRlYz/jUmFfi QCl0D4OvDqFFmyG6iE6HouJ3hu63X3VM/daposBwDRAmcuZ9EkNXPkrqqGBpjF9NiiHJ fafoh19sVUyxife9/G7bqpjNrtEgynZsnU4F/Y+tFQdByOwS3xd+r9AyUyUYR+p7KtLg Y8vHZoQYds0gerlqgfORpkpsv+vlOqR9EZE+eqaajx3FL7nqfaEbbeutJyIaGFn5/wBt vXE2IUgULv7PXV/QV//QcA9mFjXnB/tM51ibVNxSetH2xtxzO57czJd48dEYA719yR76 dNhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:references:cc:to:from:subject; bh=IQoIjzXU1xOZJvXOhsN+5mRTar48rFCZXv8QHGqLAH8=; b=uq2oEkgsE/gdu1UaaNcipkHwhSbJIuHO0QsRzPVq2t1Ux/wDV+1gI7tu0QTWfvty2y 2pyrF5mxjZ96TtUjf2nnfA387gsIb6dTDelqXw3I+BKaRHzYrlwYGzZwSD3iw7uXQCL4 evLZTgKLfHzdqE/v2bc2pgAUXqgcaTnITo8HUC4U9xBQ84FZSRDIGEhRuzPBVvK0wMHj TTftmiNbeBqIsSm5tSi+SXdjmkNHn3Zo3VL++Wqq29Zk9uk4zTsW2r+AAMogEnE/rrUz UpOsq85wpFxkjWO4jQ1udFm5Jh382ZQijEZ8gFaZetyEqn7n4zILBAaGS8Cf7Brx810N 6NUg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si12978290edx.302.2019.10.23.00.15.32; Wed, 23 Oct 2019 00:15:56 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389809AbfJWHMB (ORCPT + 99 others); Wed, 23 Oct 2019 03:12:01 -0400 Received: from mga07.intel.com ([134.134.136.100]:11778 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389090AbfJWHMA (ORCPT ); Wed, 23 Oct 2019 03:12:00 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Oct 2019 00:11:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,219,1569308400"; d="scan'208";a="196694574" Received: from linux.intel.com ([10.54.29.200]) by fmsmga008.fm.intel.com with ESMTP; 23 Oct 2019 00:11:59 -0700 Received: from [10.249.230.188] (abudanko-mobl.ccr.corp.intel.com [10.249.230.188]) by linux.intel.com (Postfix) with ESMTP id D701958029F; Wed, 23 Oct 2019 00:11:55 -0700 (PDT) Subject: [PATCH v5 2/4] perf/x86: install platform specific swap_task_ctx adapter From: Alexey Budankov To: Peter Zijlstra Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Andi Kleen , Kan Liang , Stephane Eranian , Ian Rogers , Song Liu , linux-kernel References: Organization: Intel Corp. Message-ID: Date: Wed, 23 Oct 2019 10:11:54 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bridge perf core and x86 swap_task_ctx() method calls. Signed-off-by: Alexey Budankov --- arch/x86/events/core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 7b21455d7504..6e3f0c18908e 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -2243,6 +2243,13 @@ static void x86_pmu_sched_task(struct perf_event_context *ctx, bool sched_in) x86_pmu.sched_task(ctx, sched_in); } +static void x86_pmu_swap_task_ctx(struct perf_event_context *prev, + struct perf_event_context *next) +{ + if (x86_pmu.swap_task_ctx) + x86_pmu.swap_task_ctx(prev, next); +} + void perf_check_microcode(void) { if (x86_pmu.check_microcode) @@ -2297,6 +2304,7 @@ static struct pmu pmu = { .event_idx = x86_pmu_event_idx, .sched_task = x86_pmu_sched_task, .task_ctx_size = sizeof(struct x86_perf_task_context), + .swap_task_ctx = x86_pmu_swap_task_ctx, .check_period = x86_pmu_check_period, .aux_output_match = x86_pmu_aux_output_match, -- 2.20.1