Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2265712pxb; Fri, 25 Mar 2022 14:14:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxY6leBYMnb5YYe5NfSWAuG9jZH6AFavm2C6+m7w7OviMtro1nwmb8pIC9NZrQ7WlTBP2rI X-Received: by 2002:a63:2315:0:b0:382:88ab:7ab1 with SMTP id j21-20020a632315000000b0038288ab7ab1mr1133840pgj.246.1648242846773; Fri, 25 Mar 2022 14:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648242846; cv=none; d=google.com; s=arc-20160816; b=HjcBOxJidvpYQCHgsGrFbIMUWaPdVepbXByTknLi8lvKJnErR0ZzqXUArmwLGy24m5 I0CGWdbmZvvEGL+9lLgjJc7PONOoslKtyNZquGxnjYIlp30dbQnPTH64Zb9TD1S//j9B cnmdNw2MTsExXwZwwOtGQJDhuEhlomAmzi5QbCSh1EAgpuN+/ZtRVA6dMXFg8Bg51Txg GQ4qweWMLdcGUb5eryATJVxh/wQWWhKbWngackqlLJ4WYxmZ05BnLrH0JzE8u31OTvsg q/UQNq/4oAPX/VDH7Q7swCq15pqqh4AcABML40syBzexk0FixeDCmsIqd0vHwQOykHQC xGrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=SRRKHN6wWSWXlqOEXfCFzLcVklTCgEF59R+vZciu3sI=; b=i2hryoiYE4lsnpLTpisfEDM6qFW3ybvqrHg32pIO/pfeDGQ3nhScWe/L99oWKWeagj vs3Kkt/EFe1mVcrSYZsBae2UWGZhQOPeEJrRbPBuy4gyV6jMxB0BfoHg7uIkR+GQl+mc ojEdtFIoNNMTfBMDZ4JMyHG9d0RWNT+bc6QZq9Q9AH56uPokBtQ0glfxyDkNg8Wv/s1p QQg0SjLY3nmfK+oVkKzraj2+mXGbxrh0D4tawxZxREqRNNtATO2obUY4OyDi5r+fhJYL TCcHz+xabN8LGMuh+F5uV6HCpAc2hueZ97+yZN3gJGFPNkYFqbXeYq4Dpl3lvAWBghyk 3eHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=RQR4hHIL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t8-20020aa79468000000b004fa3a8dff8asi4277722pfq.65.2022.03.25.14.14.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 14:14:06 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=RQR4hHIL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9F089427D6; Fri, 25 Mar 2022 13:46:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232430AbiCYUsI (ORCPT + 99 others); Fri, 25 Mar 2022 16:48:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232420AbiCYUsH (ORCPT ); Fri, 25 Mar 2022 16:48:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90EC817E1D for ; Fri, 25 Mar 2022 13:46:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E68F861D61 for ; Fri, 25 Mar 2022 20:46:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0282C004DD; Fri, 25 Mar 2022 20:46:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1648241191; bh=LQFKt10LSmaGE3MEo4zcNZRff2M+N1aNeUHBztWpOKU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RQR4hHILpnUkhfu7+xcMiRIk0v6yjyvIksOfM5LPSTaUIq8cNLk0oV//EXe/qB4TA wb6Xx6B86gAcULNcU2IBwbfuhjAyTB7Mqxmu/jC1WIUVC69FLplcSGiCgEkUrF5sHC Vz/3RusidENiid01E61425EVB8K4qKlLLgEfFkyQ= Date: Fri, 25 Mar 2022 13:46:29 -0700 From: Andrew Morton To: andrey.konovalov@linux.dev Cc: Marco Elver , Alexander Potapenko , Catalin Marinas , Will Deacon , Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Mark Rutland , Vincenzo Frascino , Sami Tolvanen , Peter Collingbourne , Evgenii Stepanov , Florian Mayer , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: Re: [PATCH v2 1/4] stacktrace: add interface based on shadow call stack Message-Id: <20220325134629.99699c921bb8c8db413e8e35@linux-foundation.org> In-Reply-To: <21e3e20ea58e242e3c82c19abbfe65b579e0e4b8.1648049113.git.andreyknvl@google.com> References: <21e3e20ea58e242e3c82c19abbfe65b579e0e4b8.1648049113.git.andreyknvl@google.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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,NICE_REPLY_A,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 On Wed, 23 Mar 2022 16:32:52 +0100 andrey.konovalov@linux.dev wrote: > From: Andrey Konovalov > > Add a new interface stack_trace_save_shadow() for collecting stack traces > by copying frames from the Shadow Call Stack. > > Collecting stack traces this way is significantly faster: boot time > of a defconfig build with KASAN enabled gets descreased by ~30%. > > The few patches following this one add an implementation of > stack_trace_save_shadow() for arm64. > > The implementation of the added interface is not meant to use > stack_trace_consume_fn to avoid making a function call for each > collected frame to further improve performance. > > ... > > @@ -108,4 +111,16 @@ static inline int stack_trace_save_tsk_reliable(struct task_struct *tsk, > } > #endif > > +#if defined(CONFIG_STACKTRACE) && defined(CONFIG_HAVE_SHADOW_STACKTRACE) > +int stack_trace_save_shadow(unsigned long *store, unsigned int size, > + unsigned int skipnr); > +#else > +static inline int stack_trace_save_shadow(unsigned long *store, > + unsigned int size, > + unsigned int skipnr) > +{ > + return -ENOSYS; > +} > +#endif checkpatch sayeth "WARNING: ENOSYS means 'invalid syscall nr' and nothing else". checkpatch also picked up a typo in a changelog. Useful thing to run, is checkpatch.