lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <E852B54E-AEA6-4C2C-A756-DA9325C35FEE@fb.com>
Date:   Thu, 7 Mar 2019 17:20:26 +0000
From:   Song Liu <songliubraving@...com>
To:     Jiri Olsa <jolsa@...hat.com>
CC:     "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
        Networking <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "ast@...nel.org" <ast@...nel.org>,
        "daniel@...earbox.net" <daniel@...earbox.net>,
        Kernel Team <Kernel-team@...com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "acme@...hat.com" <acme@...hat.com>,
        "jolsa@...nel.org" <jolsa@...nel.org>,
        "namhyung@...nel.org" <namhyung@...nel.org>
Subject: Re: [PATCH v6 perf,bpf 06/15] perf, bpf: save bpf_prog_info in a
 rbtree in perf_env



> On Mar 7, 2019, at 6:05 AM, Jiri Olsa <jolsa@...hat.com> wrote:
> 
> On Tue, Mar 05, 2019 at 11:13:50PM -0800, Song Liu wrote:
>> bpf_prog_info contains information necessary to annotate bpf programs.
>> This patch saves bpf_prog_info for bpf programs loaded in the system.
>> 
>> Some big picture of the next few patches:
>> 
>> To fully annotate BPF programs with source code mapping, 4 different
>> information are needed:
>>    1) PERF_RECORD_KSYMBOL
>>    2) PERF_RECORD_BPF_EVENT
>>    3) bpf_prog_info
>>    4) btf
>> 
>> Before this set, 1) and 2) in the list are already saved to perf.data
>> file. For BPF programs that are already loaded before perf run, 1) and 2)
>> are synthesized by perf_event__synthesize_bpf_events(). For short living
>> BPF programs, 1) and 2) are generated by kernel.
>> 
>> This set handles 3) and 4) from the list. Again, it is necessary to handle
>> existing BPF program and short living program separately.
>> 
>> This patch handles 3) for exising BPF programs while synthesizing 1) and
>> 2) in perf_event__synthesize_bpf_events(). These data are stored in
>> perf_env. The next patch saves these data from perf_env to perf.data as
>> headers.
>> 
>> Similarly, the two patches after the next saves 4) of existing BPF
>> programs to perf_env and perf.data.
>> 
>> Another patch later will handle 3) and 4) for short living BPF programs
>> by monitoring 1) and 2) in a dedicate thread.
>> 
> 
> thanks for the changelog
> 
> SNIP
> 
>> +
>> +		/* save bpf_prog_info to env */
>> +		info_node = malloc(sizeof(struct bpf_prog_info_node));
>> +
>> +		/*
>> +		 * Do not bail out for !info_node, as we still want to
>> +		 * call  perf_tool__process_synth_event()
>> +		 */
> 
> well, we are out of memory, so I dont think perf_tool__process_synth_event
> will get too far.. also the perf_env data would be inconsistent with what
> you store as event.. how can that work?
> 
> jirka

Yeah, that makes sense. Let's bail out then. 

Thanks,
Song

>> +		if (info_node) {
>> +			info_node->info_linear = info_linear;
>> +			perf_env__insert_bpf_prog_info(env, info_node);
>> +			info_linear = NULL;
>> +		}
> 
> SNIP

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ