lkml.org 
[lkml]   [2020]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 2/8] perf evlist: implement control command handling functions
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?

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?

jirka

> + case CTL_CMD_ACK:
> + case CTL_CMD_UNSUPPORTED:
> + default:
> + pr_debug("ctlfd: unsupported %d\n", *cmd);
> + break;
> + }
> + if (!(*cmd == CTL_CMD_ACK || *cmd == CTL_CMD_UNSUPPORTED))
> + perf_evlist__ctlfd_ack(evlist);
> + }
> + }
> +

SNIP

\
 
 \ /
  Last update: 2020-04-02 16:18    [W:0.104 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site