Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp661110imm; Wed, 4 Jul 2018 03:53:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd5QO5SbA+8H34NI3/mP39NhAjMmJ7UXaI8JZ6vV6Q7eeJuIjmsrxgId3lndoinj7rS30Yc X-Received: by 2002:a17:902:6903:: with SMTP id j3-v6mr1571834plk.313.1530701613601; Wed, 04 Jul 2018 03:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530701613; cv=none; d=google.com; s=arc-20160816; b=Xxm0S8e1ofm5ddPEdRwP08hUkRro5QkfYJgXaM5IYsgRkadLSsRsQbGoQY64UdeYQh WffTRKfSIk921m0qRZJOPcqqg/oHQ41HBk2ijzgA9kmsekDP3rILjt4AvU1+FNPfEZDs GoBwKJ79flIv1v1uT0z3IALXk7tAwkr2N+tU0cn4XwTNA7zrUxDYlHptJFUXYHXeHkVx roWvSXamXxLQquDQF2QIHi8funisOrhGi44yfqap38iUv6iKkaV7F5o3gwfI84L5ORJM tvbf07MSCgRSkzczwsxPxVTL62z+isC77po8Ha+EGLvCdVAftR5ILghGtjiu5KlM95SV 0pYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from :arc-authentication-results; bh=jCaQpiYsABrJZLNFD4+sJvDUQDehrTynYisMHXhpgBo=; b=u9Om8th1EA7fpk9nosImdfiMspdiRkGxhwyOSKwN62ilV3WnUowlsRb3DrwsdyvjCP I2t/aD4UJt8p3OwINwcecEP9JfR4YMlaYpJJ0HLtCzXP17OiBiAOCSihcQ/UWm79H8MF yDsVE2Mf2SYpqgjnPpN8cuIXqr0+NlawU25dxiaFTTjkl2AISYG6Uielny0cjPj1RnQO njdCEbWTtlP+rMgmYHRzZcFPe6TlADx2tkcFgJaA/ahbMDrnUHvL/V67Y+zm9ZVItVgm hBHgR4IUj1t149FTpzNC7xqvZ8KzMBaMDUyFAbrnH1bAlD62ymmbiRIOmQTdPpByBKds qAAQ== 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 q68-v6si3585964pfl.317.2018.07.04.03.53.19; Wed, 04 Jul 2018 03:53:33 -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 S933844AbeGDKva (ORCPT + 99 others); Wed, 4 Jul 2018 06:51:30 -0400 Received: from mga05.intel.com ([192.55.52.43]:25702 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753300AbeGDKv2 (ORCPT ); Wed, 4 Jul 2018 06:51:28 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jul 2018 03:51:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,306,1526367600"; d="scan'208";a="72191011" Received: from um.fi.intel.com (HELO um) ([10.237.72.212]) by orsmga002.jf.intel.com with ESMTP; 04 Jul 2018 03:51:23 -0700 From: Alexander Shishkin To: Mathieu Poirier Cc: Peter Zijlstra , Arnaldo Carvalho de Melo , Ingo Molnar , Thomas Gleixner , schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, Will Deacon , Mark Rutland , Jiri Olsa , Namhyung Kim , Adrian Hunter , ast@kernel.org, Greg KH , "H. Peter Anvin" , linux-s390@vger.kernel.org, Linux Kernel Mailing List , linux-arm-kernel Subject: Re: [PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel In-Reply-To: References: <1530570810-28929-1-git-send-email-mathieu.poirier@linaro.org> <1530570810-28929-6-git-send-email-mathieu.poirier@linaro.org> <20180703100348.fy43f4fosw3fdc6i@um.fi.intel.com> User-Agent: Notmuch/0.27 (http://notmuchmail.org) Emacs/25.2.2 (x86_64-pc-linux-gnu) Date: Wed, 04 Jul 2018 13:51:22 +0300 Message-ID: <87bmbn6zpx.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mathieu Poirier writes: > Hi Alex, Hi Mathieu, > On Tue, 3 Jul 2018 at 04:03, Alexander Shishkin > wrote: >> >> On Mon, Jul 02, 2018 at 04:33:29PM -0600, Mathieu Poirier wrote: >> > This patch follows what has been done for filters by adding an ioctl() >> > option to communicate to the kernel arbitrary PMU specific configuration >> > that don't fit in the conventional struct perf_event_attr to the kernel. >> >> Ok, so what *is* the PMU specific configuration that doesn't fit in the >> attribute and needs to be re-configured by the driver using the generation >> tracking? >> > > In this patchset I'm am after the specification of sink information > for each event, i.e what sink a CPU is supposed to use for the > session. I simply don't see putting something that PMU specific in > the generic perf_event_attr structure. I also intend to use the same > ioctl mechanism to communicate complex tracer configuration for > sequencers, counters and input events. I don't see a nice way of > doing that from the perf_event_attr, and that is even without thinking > about the different flavours of tracers out there, all with their own > features. Yes, the sequencers and counters seem tricky. Here's a wild idea: can the sequencer/counter configuration be expressed as an eBPF program? Or, can an eBPF program be used to program those? > I've looked around and the only clean way I found to support this is > via an ioctl(). That way each tracer can easily identify the sink it > should be using without smearing the perf_event_attr structure. I > would be happy to explore a different avenue should you think of > something. Yes, I also have something similar on my todo list and I was previously thinking along the lines of pipe()/splice(). As in, you take the AUX event file descriptor and feed it to the sink, at which point the trace path is configured. I need to dig up the notes that I made back in the day to continue this conversation in more concrete terms. Regards, -- Alex