Message ID | 20230212153250.1099136-1-vdonnefort@google.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1948309wrn; Sun, 12 Feb 2023 07:41:49 -0800 (PST) X-Google-Smtp-Source: AK7set+ioMqVmZlDqmjRvMuXIj912lESaFidaNOAenJvgfbTZF14g9qhUIqhhAYRJ8hOJEMVJVH4 X-Received: by 2002:a05:6a20:bc8a:b0:bd:8f4:991b with SMTP id fx10-20020a056a20bc8a00b000bd08f4991bmr19005143pzb.56.1676216509033; Sun, 12 Feb 2023 07:41:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676216509; cv=none; d=google.com; s=arc-20160816; b=fjL1VMWGcP6h52VptA+M6OJ4SQIeB57X/yaLOTdtftKIdWy7YoI4A1Jd5GJWdvvfJM R1LfNJyFv3RbN/j5YB8Xsd4f2G82OqzgY5LMD3Yheg/emloUrOiIzEf1LpMgzr8np0lx JaIZfJCeliizV4vILY/wzU+1Lv05y5siGG1jCgnoQUanupckDzy0L8+ZqJndUdrCVbE1 1PvnlGGT8LhmPjUkdHW6jlQVNnr9HPZwLW3qB6ZSUqTiim9fWWk7KzwQ2jXv47MEf8g0 0zyoCGMJANiTu1zWuEgyzCz0FMiLGVKmDPwjGUuNUzYVwC3BvS+PJX85VkPbS2Mjbgtn sx1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=g1HftSdGyS004IfwkhWh+8a8ByAjMnKCXMzaWQVPz6Y=; b=CXI9mw6QSjKswG9TRz/rhYNejzGhQHlT21kl7IbcNtcGUVBakxBmhfS44uYvR6tuL8 cZlAK399lQdBkXgxFbbO5r0TUhFs/ykoY9XZqq3FuwA6eCeyOru/z4mpBgqPOFRuRY0G wkjWnhKdRRQ/nwAMLOb5dVeGRTN2lTN7dXCQX7YrfmlWbkIuiK2D0Rt8zXOLrYTW5sFy iHTkhjPOmLKzEGtO+suH9kldeFKsdPCo7x/83HTRpwTZiz2eOiCzmlyGrkdT/A1VZd2w mZthH3e9QUHxtO4vDzHznzBSsvI/N9vaIRj/R9JHSiYwwjgd5rMVdfGYth9xfzh0lGxv 1VyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=rHkr2bcz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020aa79405000000b005a8a8b5d18bsi2646872pfo.37.2023.02.12.07.41.36; Sun, 12 Feb 2023 07:41:49 -0800 (PST) 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=@google.com header.s=20210112 header.b=rHkr2bcz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229700AbjBLPdL (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Sun, 12 Feb 2023 10:33:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbjBLPdK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 12 Feb 2023 10:33:10 -0500 Received: from mail-wm1-x349.google.com (mail-wm1-x349.google.com [IPv6:2a00:1450:4864:20::349]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E74AC14C for <linux-kernel@vger.kernel.org>; Sun, 12 Feb 2023 07:33:06 -0800 (PST) Received: by mail-wm1-x349.google.com with SMTP id r14-20020a05600c35ce00b003e10bfcd160so5405389wmq.6 for <linux-kernel@vger.kernel.org>; Sun, 12 Feb 2023 07:33:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=g1HftSdGyS004IfwkhWh+8a8ByAjMnKCXMzaWQVPz6Y=; b=rHkr2bczWXfZ1Rf97Gh0VrrFih+78H7JeiMK7C/qRIz9lQ1udj+40H1Rh/TFQvsh8P UjPF2XgYEV4WGLGM7+Z27spRJQdJdE51gA1M2u3NWYD3OvkLTKrMh17ymzJ1HdY4f5zd ryWPpriPCJW1oiX+Ee8j35kimhfGgbekolQF9p6SJexZfFg1/oeRZK/Q8vgf0/6hHvvZ IdiQs1JKNCKvGZ50Dgo4UPz1Fap8bguAfbjHIejQMOFNsjiunNdgOf/QtFgp1C9bkpsA 08nAcd4yCu2xJrZhpmqLODzvYbv5H+ab5mPIQR5kSxo4f6D5elGvL9J5tyr5RUJP2DJd /PjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=g1HftSdGyS004IfwkhWh+8a8ByAjMnKCXMzaWQVPz6Y=; b=LInne4NJp5TQ8K/9PFeDsZn7DCc+ooGRA+aH7CFbusv8MGD4z7Gp/Cz4vk8w0Vdbvh P6yXOQlYWRUFrpUuxVm3EReLqNJ/ialKRNSrbaIUsNZrLd5NsCCXM673DQbLoVPLtu82 J5hraIVZaxGb20DipqDtLGtO4z6dQ4UT0HC30SYfYU72a386t/u0cGM9x4GBuBylO+sY E80N3X5RbSPLJrHj+k6bLddUuPOyofH5lAfED5pXu179moMlfKuZtDgm93ke3fwTAn3C d36+nJ4+iFzOQ360zEB/gHLO4ill7VamBr36E7u7PvcJLLmKasWLC/2PjaxYXPjyqQi9 BiYQ== X-Gm-Message-State: AO0yUKV8cLgU7325XtNr7mBuvpOWn5A52DkzzzgIoaWCmXxOx1C5+K1y 8Jw9LQB/GTE+bcd3skPiB71DCQ9LNsoUp0Rd X-Received: from vdonnefort.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:2eea]) (user=vdonnefort job=sendgmr) by 2002:a05:600c:2045:b0:3dc:5ad2:86ed with SMTP id p5-20020a05600c204500b003dc5ad286edmr939213wmg.33.1676215984389; Sun, 12 Feb 2023 07:33:04 -0800 (PST) Date: Sun, 12 Feb 2023 15:32:48 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.39.1.581.gbfd45094c4-goog Message-ID: <20230212153250.1099136-1-vdonnefort@google.com> Subject: [RFC PATCH 0/2] Introducing trace buffer mapping by user-space From: Vincent Donnefort <vdonnefort@google.com> To: rostedt@goodmis.org, mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: kernel-team@android.com, Vincent Donnefort <vdonnefort@google.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757640402565865744?= X-GMAIL-MSGID: =?utf-8?q?1757640402565865744?= |
Series |
Introducing trace buffer mapping by user-space
|
|
Message
Vincent Donnefort
Feb. 12, 2023, 3:32 p.m. UTC
Hi all, We (Android folks) have been recently working on bringing tracing to the pKVM hypervisor (more about pKVM? [1] [2]) reusing as much as possible the tracefs support already available in the host. More specifically, sharing the ring_buffer_per_cpu between the kernel and the hypervisor, the later being the writer while the former is only reading. After presenting this endeavour at the tracingsummit, end of last year [3], Steven observed this is a similar problem to another idea he had a while ago: mapping the tracing ring buffers directly into userspace. The tracing ring-buffer can be stored or sent to network without any copy via splice. However the later doesn't allow real time processing of the traces by userspace without a copy, which can only be achieved by letting userspace map directly the ring-buffer. And indeed, in both ideas, we have a ring-buffer, an entity being the writer, the other being a reader and both share the ring buffer pages while having different VA spaces. So here's an RFC bringing userspace mapping of a ring-buffer and if it doesn't cover the pKVM hypervisor it nonetheless brings building blocks that will be reused later. Any feedback very much appreciated. Vincent [1] https://lwn.net/Articles/836693/ [2] https://www.youtube.com/watch?v=9npebeVFbFw [3] https://tracingsummit.org/ts/2022/hypervisortracing/