From patchwork Fri Apr 14 08:22:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 8174 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp221723vqo; Fri, 14 Apr 2023 01:32:50 -0700 (PDT) X-Google-Smtp-Source: AKy350ZpIKxKK8BW3KsJQ983XTa+Oum1DyZoRN+CmJpAzYjkwDPN+CKmlu+FKRvKZ0aRV4hhTdbY X-Received: by 2002:a17:902:f9cc:b0:1a5:f36:ae09 with SMTP id kz12-20020a170902f9cc00b001a50f36ae09mr2189326plb.7.1681461170505; Fri, 14 Apr 2023 01:32:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681461170; cv=none; d=google.com; s=arc-20160816; b=Glr/iLWmqyH6bQN3X43AQOpiEMOnrpWOqR6rHaa9t39LkKxTvJQDMM3vgHWPA9kv1d wkH7pmR0PXyqryFGR+QlsSQHrjammC6bzLwLnPreJmke4s7dMYGAGccwYAcX303hgju0 7abQMaTNbz0Ybts5P9og04JSec+vWYKS4nYqsW60GoJ47pbbgrD/x1hA+UnZIZ7nZZlb y3x+N3+Cw7HZGCaJdTze39fpz7hguIKz+93N2r1dtapNvAq8eP1t3yXtzsY1Gy/P/VqQ BQYYsw87QHloWK/gcK0SbjXO+2ZU6IZp4p/Qr0NH6GnqdydOSbewUM5sXQLDL0+m+1YU eqwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=JUKscNpmYbZT9TbkdIcYb4MMV5GbFHoC7j4KvHM7Wo0=; b=YPzFGMlGtIBlrNbMDidDhGKx4vCxMB7xx/kwxY0eYi6yNIkh6VXXCIMVpG9e1TnIvt v/XJ57SY53vQNJJ15AEU2SlcV6IhA2aOinoIB8b+UQkYW1l8j2JyLWysPuDoWbdkJBlw jDwQbSgi/wrt939qghVCyVpSPjjIksIoORPh9bkhLH48RrEp/VCc2bh7ekhZF7zpJeGX YtqEE8iWcTGJVEA5AHi0PT1wTFWNo6ttpXA2E3LdHfH5QzdrpetfkslIYNmGWNZarChj imypCkrHrkAXrLrll056NZE8pZ2mIxEXG85i4Y5gXXx/VtkbHBS1EkYuuZKR3RMO7Wt2 w+fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="N4IhTVO/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t5-20020a17090a950500b0024664356ef7si6756604pjo.152.2023.04.14.01.32.38; Fri, 14 Apr 2023 01:32:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="N4IhTVO/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230172AbjDNIX3 (ORCPT + 99 others); Fri, 14 Apr 2023 04:23:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbjDNIXY (ORCPT ); Fri, 14 Apr 2023 04:23:24 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CAF95B9F; Fri, 14 Apr 2023 01:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681460602; x=1712996602; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=IR3enTULW+0dSiranrN8ej6IJa0hU4y3yttWFJiFMng=; b=N4IhTVO/7jObHl/8HIZGX3wzi4lDwHtiMS/oRc5UGtvUX6Vrep1abd17 ryLnFdzGo7dJNyYJCeVCaJ2lvq7Fbqs5N8ukTaaCRId1gJHsG2Ms83/ig 1+ivbjD4wnF+lKyth1yasmasvuCfRNwdzqyj1ZNkqB5/Pkv/kCU7WEyte I8EDuq4Zr+1Cf/peSm+x3Pg/L9so6Ot1VhfIMIGrKrJbCANRD0HZUWuTA dUluisUxj5byJaeOuOAeID5MEHNVlqq18RiFPNuQfQgF5256eckxYYoFv QKmv+tBqLBzJUOhXK/R8qGJeqqZh3lFzdlHLluG3G7AvgO31OOr+I8SYk A==; X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="430708078" X-IronPort-AV: E=Sophos;i="5.99,195,1677571200"; d="scan'208";a="430708078" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2023 01:23:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="683267437" X-IronPort-AV: E=Sophos;i="5.99,195,1677571200"; d="scan'208";a="683267437" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.249.34.252]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2023 01:23:16 -0700 From: Adrian Hunter To: Peter Zijlstra Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RFC 0/5] perf: Add ioctl to emit sideband events Date: Fri, 14 Apr 2023 11:22:55 +0300 Message-Id: <20230414082300.34798-1-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763139828019123338?= X-GMAIL-MSGID: =?utf-8?q?1763139828019123338?= Hi Here is a stab at adding an ioctl for sideband events. This is to overcome races when reading the same information from /proc. To keep it simple, the ioctl is limited to emitting existing sideband events (fork, namespaces, comm, mmap) to an already active context. There are not yet any perf tools patches at this stage. Adrian Hunter (5): perf: Add ioctl to emit sideband events perf: Add fork to the sideband ioctl perf: Add namespaces to the sideband ioctl perf: Add comm to the sideband ioctl perf: Add mmap to the sideband ioctl include/uapi/linux/perf_event.h | 19 ++- kernel/events/core.c | 315 +++++++++++++++++++++++++++++++++------- 2 files changed, 280 insertions(+), 54 deletions(-) Regards Adrian