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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200125154628.3wiaqym45ltmxcu5@ast-mbp>
Date:   Sat, 25 Jan 2020 07:46:30 -0800
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Daniel Xu <dxu@...uu.xyz>
Cc:     bpf@...r.kernel.org, ast@...nel.org, daniel@...earbox.net,
        songliubraving@...com, yhs@...com, andriin@...com,
        linux-kernel@...r.kernel.org, kernel-team@...com,
        peterz@...radead.org, mingo@...hat.com, acme@...nel.org
Subject: Re: [PATCH v4 bpf-next 1/3] bpf: Add bpf_perf_prog_read_branches()
 helper

On Fri, Jan 24, 2020 at 01:17:03PM -0800, Daniel Xu wrote:
> + *
> + * int bpf_perf_prog_read_branches(struct bpf_perf_event_data *ctx, void *buf, u32 buf_size, u64 flags)
> + *	Description
> + *		For an eBPF program attached to a perf event, retrieve the
> + *		branch records (struct perf_branch_entry) associated to *ctx*
> + *		and store it in	the buffer pointed by *buf* up to size
> + *		*buf_size* bytes.
> + *
> + *		The *flags* can be set to **BPF_F_GET_BR_SIZE** to instead
> + *		return the number of bytes required to store all the branch
> + *		entries. If this flag is set, *buf* may be NULL.
> + *	Return
> + *		On success, number of bytes written to *buf*. On error, a
> + *		negative value.
> + *
> + *		**-EINVAL** if arguments invalid or **buf_size** not a multiple
> + *		of sizeof(struct perf_branch_entry).
> + *
> + *		**-ENOENT** if architecture does not support branch records.

the patches look good, but I'm struggling to decode the names.
perf_prog_read_branches... perf_prog means that it's for bpf prog that is of
'perf' type? I don't think any other helper has such prefix.
read branches... branches? they are branch records or branch entries.
How about bpf_read_branch_records() ?

I think BPF_F_GET_BR_SIZE is too cryptic.
How about BPF_F_GET_BRANCH_RECORDS_SIZE ?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ