Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp997697iob; Fri, 13 May 2022 19:04:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3OpaAhU6/gUzTYXybLKRvDwuc/8HIAix7VSUmdOdkR5cLHeavO1v/eVfAKK6DNex+1cf7 X-Received: by 2002:a05:600c:1986:b0:394:867f:984c with SMTP id t6-20020a05600c198600b00394867f984cmr17352087wmq.20.1652493895683; Fri, 13 May 2022 19:04:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652493895; cv=none; d=google.com; s=arc-20160816; b=o5GCXS5E3h0xUfDd57Il/lRiHAmjxNtWGsxnxexw3Mav+rT1WAtedrAX9vVJcJ786w rSij5Rudl5LXbw0naK2zhBXlIHVVA3S4owL3Q9/k7bZxb/06UvxdTpeNhrnvwYrJIIrB 3pthwToRMRCAN36WeYKhq4qBXLCzeyr/Fi/yRLPH9cQs/UAAm6OGdhHoArkJ5gR1HKsE c2WRuctSzPTbvO9fG4zgqUP8AKMrng+w3gh4jO8V3s6yve6MGCpaEAMEA9UNPu94j+YK 4KGOStm6QCPjcr8/dVyAXBrrX5S8sJ5zJkGTD+O5L82fL9DHDgRSEUdILGdJoGpKEPCN wBow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-topic:thread-index :content-transfer-encoding:mime-version:subject:message-id:cc:to :from:date:dkim-signature:dkim-filter; bh=b8yL8neDJhlV2sjQpyvNupaaXTDO2BcJvNnSgYVO3HE=; b=SXDYFmXCHcdMlgq0c4cp/WboWjqhj3tGd/eeSg72dplWO6Shq+wVAqWav9vgiK01Bb JzYsymB9roBnrSLVuRdsckX4uOyoyABfIaXpj5uqrYO531RpfxCiboAml4Z2Sa9chnue NY0NzuDtw3LBdtQLlulzXNQ6mbuLB8Ezlk89Tjqh+tn8xJHLjJikHGFoUVlMT9xtValL VA2uqpRBI3DgL73Zb4Wj9dYzj+oA2AZDL+eD4uVPeTPwod8+QNYDyx+OTOqujE2vx6JZ fU20nENPObVLrlIragHL58xSJyz9mWPQk2wR9HDtT0n50Q0f8s3OXHynlkoYxskI/QE2 qU1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=PR6XAF8f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a22-20020a05600c2d5600b003943512e579si3441213wmg.98.2022.05.13.19.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:04:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=PR6XAF8f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 29E32484356; Fri, 13 May 2022 17:25:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356079AbiELPrZ (ORCPT + 99 others); Thu, 12 May 2022 11:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356075AbiELPrY (ORCPT ); Thu, 12 May 2022 11:47:24 -0400 Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB9FB50E39; Thu, 12 May 2022 08:47:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id E6D623DD7FF; Thu, 12 May 2022 11:47:19 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id zv6jl3wRXIH2; Thu, 12 May 2022 11:47:19 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 4CA1F3DD747; Thu, 12 May 2022 11:47:19 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 4CA1F3DD747 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1652370439; bh=b8yL8neDJhlV2sjQpyvNupaaXTDO2BcJvNnSgYVO3HE=; h=Date:From:To:Message-ID:MIME-Version; b=PR6XAF8fpA4u4SkoAhpdVi3lX+oLTj1NYpqtmcQ0d/hSJsg3ge5JgXyEWaDms5oqd Czjrd1tXO3IvbfsoP23U3bN4v8n8k6ClX+2TzeKiJ8puR8eb/zJoxVjNVrBQDoLjNg DLIloGp0I1CpORwhaXNPbTQfwJqT/OWNwi9+VbC1v2Q0hta5p6viBKAeMCvT7l97tf alxO8BkqRF0oftk2Rio5L27DLIw/zgcnPV7ZXy2djC0bEeSPRywgCmHNIE7nFEAC9V Fa31Fh/zOBZ1dQuN/AXJb+Aeld0K39be+yjKFvdfIjDGkI5HKxOGNVRJPdIGWY1Zr/ NQC3FcNIrBnEw== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 5OO_J6WMzGUp; Thu, 12 May 2022 11:47:19 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 3F6473DD9B0; Thu, 12 May 2022 11:47:19 -0400 (EDT) Date: Thu, 12 May 2022 11:47:19 -0400 (EDT) From: Mathieu Desnoyers To: Beau Belgrave Cc: rostedt , Masami Hiramatsu , linux-trace-devel , linux-kernel , Primiano Tucci Message-ID: <1651771383.54437.1652370439159.JavaMail.zimbra@efficios.com> Subject: Feedback on user-events UAPI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_4257 (ZimbraWebClient - FF100 (Linux)/8.8.15_GA_4257) Thread-Index: o6f5mOT0knDiVDPdCZsAQKF6xvC6vQ== Thread-Topic: Feedback on user-events UAPI X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Beau, I have queued a few questions I would like to discuss with respect to the proposed user events UAPI. I originally planned to expand further on them, but I now think it's best if I ask away right now and we clarify things through discussion: First, I find it odd that the event enable bitmask and the event ID and payload type registration must be combined. I can think of various use-cases where other tracers would be interested to use the event-enable bitmask facility without polluting the event ID/payload registration data structures with useless data. Can those be split into two distinct independent ABIs ? I can't help but notice that this new user-space instrumentation infrastructure/ABI can only be used for tracing user-space through kernel tracers. Considering that ABIs dictated by the kernel usually end up being de facto standards, I am concerned that if it is unable to allow purely user-space tracers to use it, then all applications will end up being statically instrumented in ways that prevent user-space tracers from hooking efficiently on the static instrumentation. As I have replied in an earlier thread, purely user-space tracers are not just marginally faster than kernel tracers for tracing user-space. They are an order of magnitude faster as soon as all the proper configuration steps are taken to ensure there are no system calls on the tracer fast path. Therefore, it would be sad to effectively dismiss efficient tracer implementations for the sake of easiness of implementation of today's user-event ABI. This will cause a precedent we will be stuck with later. Linux kernel developers involved in implementation of instrumentation within Linux have spent a lot of effort to make sure the instrumentation is orthogonal to the tracing technology (tracepoints, kprobe, kretprobe...). I understand that making sure the user-space instrumentation ABI keeps this orthogonal is a lot more work, but nobody said that exposing ABIs to user-space was easy. ;-) The other point I would like to raise is container awareness. I can't help but notice that the user events ABI is exposed to trace all containers, with the intent to be used (consumed) from some privileged namespace (e.g. root pid namespace). This works in use-cases where the user of the tracing data controls the entire machine (all containers), but not so much if the user is a single tenant within a multi-tenants systems. I would expect that a proper namespace-aware facility would take care of making sure that a trace consumer could observe what is instrumented within its own container, and within nested containers as well. The fact that all container questions are entirely dismissed, thus keeping a event-enable bitmask registry and event ID/type registry global to the entire system, is not compatible with consuming traces from a non-privileged container, and I suspect this may also be used as a side-channel to learn information about what other containers are doing in a multi-tenant system. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com