Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2568545rwb; Mon, 15 Aug 2022 07:33:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR7+i0ttj+VLvfj1TqfrYfYESVPJrXVTzQnVk2RTVOEte7P7+DMKz5Q3cemN0+bsiN7VVm8F X-Received: by 2002:a05:6402:4241:b0:43d:a7c9:8b21 with SMTP id g1-20020a056402424100b0043da7c98b21mr14968009edb.374.1660574028541; Mon, 15 Aug 2022 07:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660574028; cv=none; d=google.com; s=arc-20160816; b=cYsQbFhH77ysOlkcqKkuGV1Jmknieyjgb3lr5t0O2SuJI0EIeViZ9ZUObxsqdfNDNm GqlYNYDxY+cTUnuknBOIES0VdzwKHx1pa/RAYrxRaGcVMy10o4kK4gZmkc0B8jSgN+eu TPMWojuXTtefyhuOMlDLKSJobU4bmHfiqHh4fm05RwLDpDyx5sp8zkEG+7qyEWW2VuuN /4Am/3oV6c/OZxecSTZoc7v3hVbQGuXYI9EOflW85GxiFelVvG1sTAuWLhQaU7CGL1d/ iBalEL+VKEyFwdo8G/ce6YQ+mEndusQ0DvWk1gvm8UkUbtkKc5uRUKXubWsQbDmhoDyj YOug== 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=rBv/EtKNQsu4Ho+mwFizya2hNYTglt1r0iIr17ai3ek=; b=b/X8kolrjz9awxUrx+Yq0mCxz2pZ5FQxTDCIA2HfgMLMr7S88m8TpJT/CXcojZx9oc AM+trshTTFmVhznUdhMtJgNiWCTI5DGDVslL/3fI1TilY/qcLUb3j3Y85jo5OXUGV3FU HrjLEt6spV+3dfHIHH6PHq7fEOOEgq3DagOQJVfdnVXEUeGinoSaRbLHe01T5sChL+Ve T4uHgPyUG0GGMIleXgGJ8BaBYSOvoUmkMPiy0SR32VVrtw7d856ISJ9G/XXfq89ecOEY Axfoa2O+PhoEV88v4hn4G8NfBpy4DKcEyND1MEjYcFmwGGpkU4GFcNy0zWc3KteGl482 Fwpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XAmu8c+L; 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 y20-20020a056402359400b0043c30afc919si9566400edc.438.2022.08.15.07.33.16; Mon, 15 Aug 2022 07:33:48 -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=XAmu8c+L; 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 S243003AbiHOOZm (ORCPT + 99 others); Mon, 15 Aug 2022 10:25:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243054AbiHOOZj (ORCPT ); Mon, 15 Aug 2022 10:25:39 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 665B612754; Mon, 15 Aug 2022 07:25:37 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id gb36so13771610ejc.10; Mon, 15 Aug 2022 07:25:37 -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=rBv/EtKNQsu4Ho+mwFizya2hNYTglt1r0iIr17ai3ek=; b=XAmu8c+LAk9Me1I3vra7NnsGvniBdp+S2b9omehR1nhcQxN9Bb95QkntR9TKvTjq9v dDga6p7dKng0JuNRhOD5tJtj1xF7wSxxEu7BdbG0L/LxGSpF9scTn9oGdIj7O0Wntz/u /44VyfRzPPrBRXFS+oMoa1+7/kyakvryt9hlAr6kmrGK4NcjnGNnz6RLtck6FfleOi/9 sLVHTEjX540xrimptqjvmJ7roqkzHkcDWbx/yW7ECEUHxHEkOnXUqPWh4DmtYQqAtPkj PRcqaGBM70vBhy3AFzILaUEa4M5CECgbXnZq4YqJYHzlL2kKwW7waF692Lak2X3afYVV w7MQ== 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=rBv/EtKNQsu4Ho+mwFizya2hNYTglt1r0iIr17ai3ek=; b=2Ru7EB2it4KBjLcKnjuAv1IhN0I9w9Vg3bF4ZZFGawJxHQT3fClf4pDZrC7VvGY6/O 9xDp7ECtpbqYTbhx0rLnKj+31IdlUYdzjMo6mBdD8FpP/g6v/IBQPtyF7TLtolZmXIIC 3/IN/ioA4eejhWCs5eqOL1fmclS6L3WfppIlR/0Sv5jBcGikRWfUwFDQmOob3JPAVMHI vcXcR7LPhLowwYne4JEp6LOUuAp6VuyKwTxFkO/hSipCDsjnjW/OOyPWVMNyD7TizICL NRNk1J9e60L9w/kgTCBdSmYRGqxClwhxeyxj2k9C7AfTFSAcrGVIL8QJDM8xcNI4zzDA gJVw== X-Gm-Message-State: ACgBeo1PdHGgTNGB88engf2NKIEJQQUoryNwBZZAvFHHK3eETc99ZFxK p1EUFoF2sOpwELQuwX2YyevrwiclArRXEYG25C6LTwHr1mg= X-Received: by 2002:a17:907:7b94:b0:731:1b11:c241 with SMTP id ne20-20020a1709077b9400b007311b11c241mr10722633ejc.676.1660573535816; Mon, 15 Aug 2022 07:25:35 -0700 (PDT) MIME-Version: 1.0 References: <20220722120854.3cc6ec4b@gandalf.local.home> <20220722122548.2db543ca@gandalf.local.home> <20220722174120.688768a3@gandalf.local.home> <20220813150252.5aa63650@rorschach.local.home> In-Reply-To: From: Alexei Starovoitov Date: Mon, 15 Aug 2022 07:25:24 -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 5:37 AM Peter Zijlstra wrote: > > On Mon, Aug 15, 2022 at 11:44:32AM +0200, Jiri Olsa wrote: > > On Mon, Aug 15, 2022 at 10:03:17AM +0200, Peter Zijlstra wrote: > > > On Sat, Aug 13, 2022 at 03:02:52PM -0400, Steven Rostedt wrote: > > > > On Fri, 12 Aug 2022 23:18:15 +0200 > > > > Jiri Olsa wrote: > > > > > > > > > the patch below moves the bpf function into sepatate object and switches > > > > > off the -mrecord-mcount for it.. so the function gets profile call > > > > > generated but it's not visible to ftrace > > > > > > Why ?!? > > > > there's bpf dispatcher code that updates bpf_dispatcher_xdp_func > > function with bpf_arch_text_poke and that can race with ftrace update > > if the function is traced > > I thought bpf_arch_text_poke() wasn't allowed to touch kernel code and > ftrace is in full control of it ? ftrace is not in "full control" of nop5 and must not be. Soon we will have nop5 in the middle of the function. ftrace must not touch it.