Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp102408rwe; Fri, 26 Aug 2022 01:16:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR6jhzyFHRGaIlv93hw1dZsR6MNiVU+MyvcLPv3txmXKIMS/VQVGzLjkUABol1RjUSdpQsHh X-Received: by 2002:a17:90a:4fa3:b0:1fb:a751:6a71 with SMTP id q32-20020a17090a4fa300b001fba7516a71mr3202119pjh.157.1661501817023; Fri, 26 Aug 2022 01:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661501817; cv=none; d=google.com; s=arc-20160816; b=nzrOuuwtmk7fhEvCSWP5RuR7jImI0TpZg/mFfVp8TTDwRcLFTD/cQm1QrbHX4FtxtA huuwoxuYVgu+rKDIWAZoQTE/23cOg9x27ZgB95tJk/GqcZTSkBTe5ECsJKL6RqmJoe/n wYogX8rQtDPtH2GAPB36E4RJUaOQN5sBDWk6L60MqeJ5yrcVsV+5Qs6bEx3tB+KzOW1H 8eJuzj/QMIe/ynnnmQEd6qMS/X6O+u3eP0h80f1Ttts2bG1FiwlG7rfpdMnjF3Mk74zN /U/marYUtSFIDdW1/+82RE2nqFJgPceB4/eDm+iCE/OfT6fENc5lIAn3SiOz03Fx1YB/ xpXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=YKvx6Cj1xYUX2DCCsWQM+Zo2QVYcF66rAfcZQEp7iEQ=; b=R9Q87pggAB+s19nQvY0+f2/X3YKCGuIgBWeD3TNGd7/QPxHOuyC3FyninzNntmg764 ziwlZ1c9N5m+HKr+J4ND0XsP51NIR8lzFne/twqRrs6UfkoiCHmMeotJMjFM7KwpENDE V/uFsJV58BqfmbJWi36aa/qrbbfzqhSaSYpDSQHjocMyLOdPhrNeJi3shuXTlzUI1053 9RIaXZD4kSITPA81KV9JHGReyd13nRlbd1EEvVl3+H+guqJBNzuws3QI8g/uoaXWo8D/ JxuHCVQNoyEizuc7Jbs047a18IhwpTlzfntz7pEzC9sCsHY9CxUL6i1009qwj603ADwR wqCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=T42JkRey; 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 l70-20020a638849000000b0041a3b20ba0esi1204828pgd.383.2022.08.26.01.16.46; Fri, 26 Aug 2022 01:16:57 -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=T42JkRey; 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 S1343491AbiHZIBH (ORCPT + 99 others); Fri, 26 Aug 2022 04:01:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241772AbiHZIBF (ORCPT ); Fri, 26 Aug 2022 04:01:05 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB01FD3ECE; Fri, 26 Aug 2022 01:01:03 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id k9so886516wri.0; Fri, 26 Aug 2022 01:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc; bh=YKvx6Cj1xYUX2DCCsWQM+Zo2QVYcF66rAfcZQEp7iEQ=; b=T42JkReyAMSo4VSqTWGrerpNlXhidixAmat1mZ0sQX1NCfY85uNUSkEv188VYmQoZv tr94poynOv2itOtjfretoErIELTWi2u1CcgLTxj13h7TNV7+V1cpnCrl2/kM37TyL8w6 sAlgiW0FfnJUCwWa2xqAI+SeLsFzljhoO4ECrsxFTPNmrL3xO2F28KnuXhtH1/TIsbPF pbhYYtri0YLLPUO75mC3QZ2k85W2/81CBLyHcBkQf8rdCJc+OBinKqOWYUaHneaZ8bzR K1yNCLfCf2VC0c1sU6HihdvfKDACL1oyCXYjnnfolQUugZCy6SJxOC6HJPAdZOAszwsj VcjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc; bh=YKvx6Cj1xYUX2DCCsWQM+Zo2QVYcF66rAfcZQEp7iEQ=; b=6d5vJp3s3PIizdsEM6IYY8/feqmFfNm7cxfPJQ1Wv+0SliHGuGCX0A4duNpmKHA5hx 9ZfDNE2q1A99jVZhYn0mSDJx3ui1V9r9GwyG9FT9U8jmliFguvQh7oIQijFDHhRp2W97 uPtbLcwvH0BR0b9VCz+soWqf02wYIFz/2yFl5Ku5QxDSrbRrgWQiD7rfdgLD5iIFuFje CuB4POo0B/xUapQFCvfxuAvtnO0FUGUzOYScs95p1aY0NrMQRk/wuq9Oz1TslIIvvDVJ pCIszl9NJGMc3k8qFNnWomVN6n8DqUIvURbtz1+lWv2bzQbSnOhnorgPR2yQBvnqK1lt ihwQ== X-Gm-Message-State: ACgBeo1DPaduIlEgg6COHfsFSyCDJr8CVU3baofJJMwh6912hSagg6Ca pl3M3LGLMQ/Uybb28JrjGBI= X-Received: by 2002:a5d:64e2:0:b0:225:79d3:d6d9 with SMTP id g2-20020a5d64e2000000b0022579d3d6d9mr3873080wri.240.1661500862157; Fri, 26 Aug 2022 01:01:02 -0700 (PDT) Received: from krava ([193.85.244.190]) by smtp.gmail.com with ESMTPSA id o1-20020a5d6701000000b0022571d43d32sm1239859wru.21.2022.08.26.01.01.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Aug 2022 01:01:01 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Fri, 26 Aug 2022 10:00:58 +0200 To: Alexei Starovoitov Cc: Jiri Olsa , Steven Rostedt , Peter Zijlstra , 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 Subject: Re: [RFC] ftrace: Add support to keep some functions out of ftrace Message-ID: References: <20220818165024.433f56fd@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Aug 23, 2022 at 10:23:24AM -0700, Alexei Starovoitov wrote: > On Fri, Aug 19, 2022 at 4:45 AM Jiri Olsa wrote: > > > > On Thu, Aug 18, 2022 at 11:32:55PM +0200, Jiri Olsa wrote: > > > On Thu, Aug 18, 2022 at 02:00:21PM -0700, Alexei Starovoitov wrote: > > > > On Thu, Aug 18, 2022 at 1:50 PM Steven Rostedt wrote: > > > > > > > > > > On Thu, 18 Aug 2022 22:27:07 +0200 > > > > > Jiri Olsa wrote: > > > > > > > > > > > ok, so the problem with __attribute__((patchable_function_entry(5))) is that > > > > > > it puts function address into __patchable_function_entries section, which is > > > > > > one of ftrace locations source: > > > > > > > > > > > > #define MCOUNT_REC() . = ALIGN(8); \ > > > > > > __start_mcount_loc = .; \ > > > > > > KEEP(*(__mcount_loc)) \ > > > > > > KEEP(*(__patchable_function_entries)) \ > > > > > > __stop_mcount_loc = .; \ > > > > > > ... > > > > > > > > > > > > > > > > > > it looks like __patchable_function_entries is used for other than x86 archs, > > > > > > so we perhaps we could have x86 specific MCOUNT_REC macro just with > > > > > > __mcount_loc section? > > > > > > > > > > So something like this: > > > > > > > > > > #ifdef CONFIG_X86 > > > > > # define NON_MCOUNT_PATCHABLE KEEP(*(__patchable_function_entries)) > > > > > # define MCOUNT_PATCHABLE > > > > > #else > > > > > # define NON_MCOUNT_PATCHABLE > > > > > # define MCOUNT_PATCHABLE KEEP(*(__patchable_function_entries)) > > > > > #endif > > > > > > > > > > #define MCOUNT_REC() . = ALIGN(8); \ > > > > > __start_mcount_loc = .; \ > > > > > KEEP(*(__mcount_loc)) \ > > > > > MCOUNT_PATCHABLE \ > > > > > __stop_mcount_loc = .; \ > > > > > NON_MCOUNT_PATCHABLE \ > > > > > ... > > > > > > > > > > ?? > > > > > > > > That's what more or less Peter's patch is doing: > > > > Here it is again for reference: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=8d075bdf11193f1d276bf19fa56b4b8dfe24df9e > > > > > > ah nice, and discards the __patchable_function_entries section, great > > > > > > > tested change below with Peter's change above and it seems to work, > > once it get merged I'll send full patch > > Peter, > what is the ETA to land your changes? > That particular commit is detached in your git tree. > Did you move it to a different branch? > > Just trying to figure out the logistics to land Jiri's fix below. > We can take it into bpf-next, since it's harmless as-is, > but it won't have an effect until your change lands. > Sounds like they both will get in during the next merge window? I discussed with Peter and I'll send his change together with my fix jirka