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: <a1fd0e15-026f-6f84-ef82-9c01b7d9d48e@linux.intel.com>
Date:   Thu, 2 Apr 2020 18:20:05 +0300
From:   Alexey Budankov <alexey.budankov@...ux.intel.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Arnaldo Carvalho de Melo <acme@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Andi Kleen <ak@...ux.intel.com>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 2/8] perf evlist: implement control command handling
 functions


On 02.04.2020 17:17, Jiri Olsa wrote:
> On Fri, Mar 27, 2020 at 11:46:43AM +0300, Alexey Budankov wrote:
> 
> SNIP
> 
>> +
>> +int perf_evlist__ctlfd_process(struct evlist *evlist, enum evlist_ctl_cmd *cmd)
>> +{
>> +	int err = 0;
>> +	int ctlfd_pos = evlist->ctl_fd_pos;
>> +	struct pollfd *entries = evlist->core.pollfd.entries;
>> +
>> +	if (!entries[ctlfd_pos].revents)
>> +		return 0;
>> +
>> +	if (entries[ctlfd_pos].revents & POLLIN) {
>> +		err = perf_evlist__ctlfd_recv(evlist, cmd);
>> +		if (err > 0) {
>> +			switch (*cmd) {
>> +			case CTL_CMD_RESUME:
>> +				evlist__enable(evlist);
>> +				break;
>> +			case CTL_CMD_PAUSE:
>> +				evlist__disable(evlist);
>> +				break;
> 
> would CTL_CMD_ENABLE, CTL_CMD_DISABLE be better fit in here?

Makes sense. Let's have it named like the corresponding ioctls, for clarity.

> 
> especialy because we have the 'pause' ioctl for sampling,
> which I was thinking initialy you are using for record,
> 
> and it's still might be better fit for sampling than disable, no?

PAUSE_OUTPUT ioctl doesn't stop NMIs but it should be avoided 
in order not to affect workload execution during paused intervals.

PERF_EVENT_IOC_PAUSE_OUTPUT (since Linux 4.7)
              This allows pausing and resuming the event's ring-buffer.  A
              paused ring-buffer does not prevent generation of samples, but
              simply discards them.  The discarded samples are considered
              lost, and cause a PERF_RECORD_LOST sample to be generated when
              possible.  An overflow signal may still be triggered by the
              discarded sample even though the ring-buffer remains empty.

              The argument is an unsigned 32-bit integer.  A nonzero value
              pauses the ring-buffer, while a zero value resumes the ring-
              buffer.

~Alexey

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ