[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180920133628.GQ24142@hirez.programming.kicks-ass.net>
Date: Thu, 20 Sep 2018 15:36:28 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Alexei Starovoitov <ast@...nel.org>
Cc: "David S . Miller" <davem@...emloft.net>, daniel@...earbox.net,
acme@...nel.org, netdev@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH bpf-next 2/3] bpf: emit RECORD_MMAP events for bpf prog
load/unload
On Thu, Sep 20, 2018 at 10:44:24AM +0200, Peter Zijlstra wrote:
> On Wed, Sep 19, 2018 at 03:39:34PM -0700, Alexei Starovoitov wrote:
> > void bpf_prog_kallsyms_del(struct bpf_prog *fp)
> > {
> > + unsigned long symbol_start, symbol_end;
> > + /* mmap_record.filename cannot be NULL and has to be u64 aligned */
> > + char buf[sizeof(u64)] = {};
> > +
> > if (!bpf_prog_kallsyms_candidate(fp))
> > return;
> >
> > spin_lock_bh(&bpf_lock);
> > bpf_prog_ksym_node_del(fp->aux);
> > spin_unlock_bh(&bpf_lock);
> > + bpf_get_prog_addr_region(fp, &symbol_start, &symbol_end);
> > + perf_event_mmap_bpf_prog(symbol_start, symbol_end - symbol_start,
> > + buf, sizeof(buf));
> > }
>
> So perf doesn't normally issue unmap events.. We've talked about doing
> that, but so far it's never really need needed I think.
>
> I feels a bit weird to start issuing unmap events for this.
FWIW:
https://lkml.kernel.org/r/20170127130702.GI6515@twins.programming.kicks-ass.net
has talk of PERF_RECORD_MUNMAP
Powered by blists - more mailing lists