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  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]
Date:   Thu, 5 Mar 2020 20:03:02 +0000
From:   Song Liu <songliubraving@...com>
To:     Jiri Olsa <jolsa@...hat.com>
CC:     Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
        "Quentin Monnet" <quentin@...valent.com>,
        Kernel Team <Kernel-team@...com>,
        "ast@...nel.org" <ast@...nel.org>,
        "daniel@...earbox.net" <daniel@...earbox.net>,
        "arnaldo.melo@...il.com" <arnaldo.melo@...il.com>,
        "jolsa@...nel.org" <jolsa@...nel.org>
Subject: Re: [PATCH v4 bpf-next 1/4] bpftool: introduce "prog profile" command



> On Mar 4, 2020, at 12:38 PM, Jiri Olsa <jolsa@...hat.com> wrote:
> 
> On Wed, Mar 04, 2020 at 10:07:07AM -0800, Song Liu wrote:
> 
> SNIP
> 
>> +
>> +#include "profiler.skel.h"
>> +
>> +#define SAMPLE_PERIOD  0x7fffffffffffffffULL
>> +struct profile_metric {
>> +	const char *name;
>> +	struct bpf_perf_event_value val;
>> +	struct perf_event_attr attr;
>> +	bool selected;
>> +
>> +	/* calculate ratios like instructions per cycle */
>> +	const int ratio_metric; /* 0 for N/A, 1 for index 0 (cycles) */
>> +	const char *ratio_desc;
>> +	const float ratio_mul;
>> +} metrics[] = {
>> +	{
>> +		.name = "cycles",
>> +		.attr = {
>> +			.sample_period = SAMPLE_PERIOD,
> 
> I don't think you need to set sample_period for counting.. why?
> 
>> +			.type = PERF_TYPE_HARDWARE,
>> +			.config = PERF_COUNT_HW_CPU_CYCLES,
> 
> you could also add .exclude_user = 1

Fixed this in v5. Thanks!
Song

Powered by blists - more mailing lists