[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAADnVQKYEk0yWzSoubV3_6G0Sx2ZA6KwERE+Cyg0nYKCRSEvEQ@mail.gmail.com>
Date: Wed, 26 Feb 2020 08:31:23 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Toke Høiland-Jørgensen <toke@...hat.com>
Cc: Luigi Rizzo <lrizzo@...gle.com>,
LKML <linux-kernel@...r.kernel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Naveen N . Rao" <naveen.n.rao@...ux.ibm.com>, ardb@...nel.org,
rizzo@....unipi.it, Paolo Abeni <pabeni@...hat.com>,
giuseppe.lettieri@...pi.it,
Jesper Dangaard Brouer <hawk@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v3 0/2] kstats: kernel metric collector
On Wed, Feb 26, 2020 at 7:03 AM Toke Høiland-Jørgensen <toke@...hat.com> wrote:
>
> > The tracepoint/kprobe/kretprobe solution is much more expensive --
> > from my measurements, the hooks that invoke the various handlers take
> > ~250ns with hot cache, 1500+ns with cold cache, and tracing an empty
> > function this way reports 90ns with hot cache, 500ns with cold cache.
>
> I think it would be good if you could include an equivalent BPF-based
> implementation of your instrumentation example so people can (a) see the
> difference for themselves and get a better idea of how the approaches
> differ in a concrete case and (b) quantify the difference in performance
> between the two implementations.
+1
kprobe/kretprobe are expensive.
That was the reason we switched to bpf fentry/fexit based on bpf trampoline.
The overhead is close to zero. Currently it's used to collect stats for
bpf programs themselves, but the framework is there to collect these
stats for any kernel function. Please see:
https://lore.kernel.org/bpf/20200213210115.1455809-1-songliubraving@fb.com/T/#mae90f23e545f03bde837239e159909f4e4a1acaa
One of the ideas that came up during discussion is to
teach 'perf stat' to do the same.
So the kernel has all the facilities to instrument itself.
Only user space work left.
Powered by blists - more mailing lists