Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2669216rwb; Mon, 15 Aug 2022 09:15:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR5sjP+W+dc6fGgTUu/uuPq7F//0+hVST21r9E41XF/CXHzMiiGRxAosspneSyc9/6CdQy6b X-Received: by 2002:a17:902:ef46:b0:168:bac3:2fd4 with SMTP id e6-20020a170902ef4600b00168bac32fd4mr17367122plx.132.1660580140972; Mon, 15 Aug 2022 09:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660580140; cv=none; d=google.com; s=arc-20160816; b=Hr7PPqIUQbuwd2N7eWfkY5oU+rz2EdSKcWkrRyFUgGTyJF/tU9+i6Z3EYjJYtxrAdl pwSNN4dkKdqr5BlNOeQtwFVc2s4P2qqTxoOuqqIOzOh0zDD4JbsHeH6Hsi0qm993vbuC nYwer6piMeIkX6lThGuJP6OVG7oDogKUzZ/to9eCh3YfYMIfOmHwUrPoh6oGMwJ71t44 0ze4wkLQDgc1qIAltk1AwBixbIq4nNiIYIsBP1669oh6GWjYhY21zv7lZli4tEeNingc C4BGcpMopbI4a0bEEUIvNPztbaQey5FYCOEAufAVs3rgE4i0agNMzqSh5nj8M6S8dKv/ BOhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=G4cO6s3qScJFyAmSKt+kQ7AhUurhwnO0tt2HqC4K7iw=; b=x1t6iFuC9Hc4SIipn/jZTguSsLEnkYYaPu+2cr/KBG3X+3EBfzr0liHd02yJah3YRC h4I4sCtJJ/F/FLyT2/D/EU8pK30GQOTCZwHhH6WXfVX7Oytsdp9XKmRkqkRoXUj/Ycr6 9A0sQVh7iF8A5ui+8emVYAOtB7iIqZN15mCeAYYNpn3GwAxDmO1JQqY9ZyFNxisNSVOv VCrucr1cui3GUT0iXaXTqmJPkFZao6AYk3De4JIc16SWh2MiZkyqSuGYsnZ1Aw+l3fUs ZBgNr7GTnS+AaWwsx2S9qM3Yys2kevgMgcMT07ZhUElA4oVfgz4mR7vY2Vu4cu4yzlXr rQnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lamXrIt0; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a17090322c700b0016d17cde503si10952084plg.143.2022.08.15.09.15.29; Mon, 15 Aug 2022 09:15:40 -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=@gmail.com header.s=20210112 header.b=lamXrIt0; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230487AbiHOPt2 (ORCPT + 99 others); Mon, 15 Aug 2022 11:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbiHOPtZ (ORCPT ); Mon, 15 Aug 2022 11:49:25 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 338F013DE8; Mon, 15 Aug 2022 08:49:24 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id w3so10100964edc.2; Mon, 15 Aug 2022 08:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=G4cO6s3qScJFyAmSKt+kQ7AhUurhwnO0tt2HqC4K7iw=; b=lamXrIt0Q5Jv7XJgyzmy2ynQ9YMY3vsYI92trxy20BtU7Rl6iT4T+EX+k37pUT8+H9 ywVe7Spo7TWEM6qTJDxVHaX6NoSwVr77URHonRkpPwPWjy6owlQVs/B1BzNj+OJKDIIo +usxso8YEHXodCllQDcISisGCPEtIRLcqVCwwqabd0oJn7IwXPNQdJsCMPFjVI7GmTK5 a0O7Yi0uKYCBig1WLzJJtzzYAY/AWL9zG4SpGEjz/tBMcCC6IN50ytCAL5uHGRKaDaPn BkPxVGzLM2HLc6+3QG0u+pKhMbzjCI6v+Q5T3Vi5J9/BFiQnucAqrHMBs3hzOtbeTnL2 6zeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=G4cO6s3qScJFyAmSKt+kQ7AhUurhwnO0tt2HqC4K7iw=; b=pWBhDGwWvRw8rcNDNNmH430sKIZ5FoG+6ydIC6jA93EmFhYDZRC1zAF0PmBdp1o7BG Tb3AW+MngJAkZqU9etuN3UWNtrVbY1IxqoAVvFr6Qlev2BhhDCco+wuwjrP0vqjm1orT F8KUZbJncvVsvviAhQ4VeOZe4U/Yrnvk8f0KUfIuVYCSnqT16P05xDQDCU6IJ33Y0WBZ gq75EAK2R2Xz2NWtwIlzZzaq8+Py76iPthb3lgkE1QYV1p7CXkEmKBLFErHTl61othFs TexeCa9vQXG58R9W9+tSZoJevoofZb4+nejgBwGupOfBvdUHE9oyhESrwO72IazvVH/v DLEQ== X-Gm-Message-State: ACgBeo2t+1TyiRRjhx8ut4H3KKJP6opXrpQmaQAW27GXV45WKgpkSEts f2iK4SpdE/KyDpti1mnMV6nvrrOObRkV9BgOI7U= X-Received: by 2002:aa7:d60b:0:b0:43c:f7ab:3c8f with SMTP id c11-20020aa7d60b000000b0043cf7ab3c8fmr15070755edr.6.1660578562710; Mon, 15 Aug 2022 08:49:22 -0700 (PDT) MIME-Version: 1.0 References: <20220813150252.5aa63650@rorschach.local.home> In-Reply-To: From: Alexei Starovoitov Date: Mon, 15 Aug 2022 08:49:11 -0700 Message-ID: Subject: Re: [RFC] ftrace: Add support to keep some functions out of ftrace To: Peter Zijlstra Cc: Jiri Olsa , Steven Rostedt , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Ingo Molnar , bpf , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , LKML , Josh Poimboeuf Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 On Mon, Aug 15, 2022 at 8:41 AM Peter Zijlstra wrote: > > On Mon, Aug 15, 2022 at 05:28:02PM +0200, Peter Zijlstra wrote: > > On Mon, Aug 15, 2022 at 08:17:42AM -0700, Alexei Starovoitov wrote: > > > It's hiding a fake function from ftrace, since it's not a function > > > and ftrace infra shouldn't show it tracing logs. > > > In other words it's a _notrace_ function with nop5. > > > > Then make it a notrace function with a nop5 in it. That isn't hard. > > > > The whole problem is that it isn't a notrace function and you're abusing > > a __fentry__ site. > > https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?h=x86/fineibt&id=8d075bdf11193f1d276bf19fa56b4b8dfe24df9e Brand new stuff. Awesome. That should fit perfectly. > foo.c: > > __attribute__((__no_instrument_function__)) > __attribute__((patchable_function_entry(5))) Interesting. Didn't know about this attribute. > void my_func(void) > { > } > > void my_foo(void) > { > } Great. Jiri, could you please revise your patch with this approach?