[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+fCnZfbDnC+tii5g+FGMDrMAz2vPmp-3LJG8q3T4psRJi3N4Q@mail.gmail.com>
Date: Tue, 29 Mar 2022 20:36:09 +0200
From: Andrey Konovalov <andreyknvl@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: andrey.konovalov@...ux.dev, Marco Elver <elver@...gle.com>,
Alexander Potapenko <glider@...gle.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Dmitry Vyukov <dvyukov@...gle.com>,
Andrey Ryabinin <ryabinin.a.a@...il.com>,
kasan-dev <kasan-dev@...glegroups.com>,
Mark Rutland <mark.rutland@....com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Sami Tolvanen <samitolvanen@...gle.com>,
Peter Collingbourne <pcc@...gle.com>,
Evgenii Stepanov <eugenis@...gle.com>,
Florian Mayer <fmayer@...gle.com>,
Linux Memory Management List <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>,
Andrey Konovalov <andreyknvl@...gle.com>
Subject: Re: [PATCH v2 1/4] stacktrace: add interface based on shadow call stack
On Fri, Mar 25, 2022 at 9:46 PM Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> On Wed, 23 Mar 2022 16:32:52 +0100 andrey.konovalov@...ux.dev wrote:
>
> > From: Andrey Konovalov <andreyknvl@...gle.com>
> >
> > 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".
This is done deliberately to mimic stack_trace_save_tsk_reliable().
I'll mention this in the changelog.
> checkpatch also picked up a typo in a changelog. Useful thing to run,
> is checkpatch.
My bad, I ran it on diff instead of the patch. Will fix in v3. Thanks!
Powered by blists - more mailing lists