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: <C534B006-3EF4-4DAB-B3D8-2944257000AC@linux.vnet.ibm.com>
Date:   Wed, 29 Jul 2020 20:41:27 +0530
From:   Athira Rajeev <atrajeev@...ux.vnet.ibm.com>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:     Jiri Olsa <jolsa@...hat.com>, Ian Rogers <irogers@...gle.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        Andrii Nakryiko <andriin@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...omium.org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Andi Kleen <ak@...ux.intel.com>, linux-kernel@...r.kernel.org,
        netdev@...r.kernel.org, bpf@...r.kernel.org,
        Stephane Eranian <eranian@...gle.com>,
        David Sharp <dhsharp@...gle.com>
Subject: Re: [PATCH v2 1/5] perf record: Set PERF_RECORD_PERIOD if attr->freq
 is set.



> On 28-Jul-2020, at 9:33 PM, Arnaldo Carvalho de Melo <acme@...nel.org> wrote:
> 
> Em Tue, Jul 28, 2020 at 05:43:47PM +0200, Jiri Olsa escreveu:
>> On Tue, Jul 28, 2020 at 01:57:30AM -0700, Ian Rogers wrote:
>>> From: David Sharp <dhsharp@...gle.com>
>>> 
>>> evsel__config() would only set PERF_RECORD_PERIOD if it set attr->freq
>>> from perf record options. When it is set by libpfm events, it would not
>>> get set. This changes evsel__config to see if attr->freq is set outside of
>>> whether or not it changes attr->freq itself.
>>> 
>>> Signed-off-by: David Sharp <dhsharp@...gle.com>
>>> Signed-off-by: Ian Rogers <irogers@...gle.com>
>> 
>> Acked-by: Jiri Olsa <jolsa@...hat.com>
> 
> So, somebody else complained that its not PERF_RECORD_PERIOD (there is
> no such thing) that is being set, its PERF_SAMPLE_PERIOD.

Hi Arnaldo

Thanks for adding in that correction.

Athira
> 
> Since you acked it I merged it now, with that correction,
> 
> - Arnaldo
> 
>> thanks,
>> jirka
>> 
>>> ---
>>> tools/perf/util/evsel.c | 7 ++++++-
>>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
>>> index ef802f6d40c1..811f538f7d77 100644
>>> --- a/tools/perf/util/evsel.c
>>> +++ b/tools/perf/util/evsel.c
>>> @@ -979,13 +979,18 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts,
>>> 	if (!attr->sample_period || (opts->user_freq != UINT_MAX ||
>>> 				     opts->user_interval != ULLONG_MAX)) {
>>> 		if (opts->freq) {
>>> -			evsel__set_sample_bit(evsel, PERIOD);
>>> 			attr->freq		= 1;
>>> 			attr->sample_freq	= opts->freq;
>>> 		} else {
>>> 			attr->sample_period = opts->default_interval;
>>> 		}
>>> 	}
>>> +	/*
>>> +	 * If attr->freq was set (here or earlier), ask for period
>>> +	 * to be sampled.
>>> +	 */
>>> +	if (attr->freq)
>>> +		evsel__set_sample_bit(evsel, PERIOD);
>>> 
>>> 	if (opts->no_samples)
>>> 		attr->sample_freq = 0;
>>> -- 
>>> 2.28.0.163.g6104cc2f0b6-goog
>>> 
>> 
> 
> -- 
> 
> - Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ