Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4047886ybg; Fri, 25 Oct 2019 12:33:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+Adfu01f8MtuKvz8WGvAErEZEO0DvUIlAB+h7kCAjIqr/btphgfyUgFG0cewkpb4leva7 X-Received: by 2002:aa7:d714:: with SMTP id t20mr5918091edq.129.1572032025853; Fri, 25 Oct 2019 12:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572032025; cv=none; d=google.com; s=arc-20160816; b=c+vsegaxfVaks3CbdQDrvP5GuzOtKKEdIeXkzHYxmnE5DjXVH9quFtvGwqasj2Rszj DB2aM8DICN+6mhxyBidSOu1/q3DamYaaoGAdnQ3RawgxMyvYZi9JAwdeKcrqSwAlFCou PgkBrJ1xHH0PoLmG8SM/WUG0zGAveJSN1yGVNf50uKb7NYcxlwEXwGVEUBMtHcUJgWmv ZYbOHXB8bet3bCyvIRVbGQdskjWlKYLGefQVY94GQeKj/nV3OYN0f9s+j1TeVYRDhqfd XSm2m43mUjtrxOAp8pTfry4L1z6l8gQmy4tNciRVuG136eXSNoED1IRRp3u6wVgYZUAl IbbQ== 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=EJIowu0brm4iGMiXMq8K9FGyVRW0vmjnc5JpYz/w8W3LZBJaUJLPMVGx44AoPqCZGt 5iyrYG2MhUn9xZ++qXdJ5aJGRDjzG5N4UNyT742Ip60xTikLexziAfJaEJbsSF6vUE+B DW1BOxFEZ1a4a7qI7MMqOnmIkmx3hTq/cM+yczlL24OD2ZnStfcAVwiDk7J/e/OzAINr 49BWNH/nhizPKcMBEUaxyME6CayLGuM87t6jwK49kRp4DkZMnyptZBQHNIy8WhpdeYGw NTtlu9uzvaK76UQ5bqBDFrAoYTgVDZMq1ljZUb/+erRGzsMhAlYC6+gorIjQW8HL0PUi Skog== 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 s20si1713871eju.421.2019.10.25.12.33.22; Fri, 25 Oct 2019 12:33:45 -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 S2408005AbfJYI7G (ORCPT + 99 others); Fri, 25 Oct 2019 04:59:06 -0400 Received: from mga01.intel.com ([192.55.52.88]:1920 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405717AbfJYI7F (ORCPT ); Fri, 25 Oct 2019 04:59:05 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2019 01:59:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,228,1569308400"; d="scan'208";a="282203232" Received: from linux.intel.com ([10.54.29.200]) by orsmga001.jf.intel.com with ESMTP; 25 Oct 2019 01:59:05 -0700 Received: from [10.125.252.238] (abudanko-mobl.ccr.corp.intel.com [10.125.252.238]) by linux.intel.com (Postfix) with ESMTP id 778F458042B; Fri, 25 Oct 2019 01:59:02 -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: <6fa20503-b5ad-16c7-260e-5243509176bc@linux.intel.com> Organization: Intel Corp. Message-ID: <073ee661-72cb-b046-4b10-d13cf5c3789b@linux.intel.com> Date: Fri, 25 Oct 2019 11:59:01 +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: <6fa20503-b5ad-16c7-260e-5243509176bc@linux.intel.com> 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