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]
Date:   Thu, 7 May 2020 14:02:24 -0300
From:   Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To:     Alexey Budankov <alexey.budankov@...ux.intel.com>
Cc:     Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>,
        Jiri Olsa <jolsa@...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 v2 09/11] perf record: implement control commands handling

Em Thu, May 07, 2020 at 11:58:45AM +0300, Alexey Budankov escreveu:
> 
> On 06.05.2020 23:23, Arnaldo Carvalho de Melo wrote:
> > Em Wed, May 06, 2020 at 09:29:05PM +0300, Alexey Budankov escreveu:
> >>
> >> Implement handling of 'enable' and 'disable' control commands
> >> coming from control file descriptor.
> >>
> >> Signed-off-by: Alexey Budankov <alexey.budankov@...ux.intel.com>
> >> ---
> >>  tools/perf/builtin-record.c | 18 +++++++++++++++++-
> >>  1 file changed, 17 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> >> index 8a14e68b86ad..2278a3efc747 100644
> >> --- a/tools/perf/builtin-record.c
> >> +++ b/tools/perf/builtin-record.c
> >> @@ -1496,6 +1496,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
> >>  	bool disabled = false, draining = false;
> >>  	int fd;
> >>  	float ratio = 0;
> >> +	enum evlist_ctl_cmd cmd = CTL_CMD_UNSUPPORTED;
> >>  
> >>  	atexit(record__sig_exit);
> >>  	signal(SIGCHLD, sig_handler);
> >> @@ -1793,8 +1794,23 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
> >>  			 * Propagate error, only if there's any. Ignore positive
> >>  			 * number of returned events and interrupt error.
> >>  			 */
> >> -			if (err > 0 || (err < 0 && errno == EINTR))
> >> +			if (err > 0 || (err < 0 && errno == EINTR)) {
> >>  				err = 0;
> >> +				if (perf_evlist__ctlfd_process(rec->evlist, &cmd) > 0) {
> >> +					switch (cmd) {
> >> +					case CTL_CMD_ENABLE:
> >> +						pr_info(PERF_EVLIST__ENABLED_MSG);
> >> +						break;
> >> +					case CTL_CMD_DISABLE:
> >> +						pr_info(PERF_EVLIST__DISABLED_MSG);
> >> +						break;
> >> +					case CTL_CMD_ACK:
> >> +					case CTL_CMD_UNSUPPORTED:
> > 
> > Shouldn't we have a pr_debug() or even pr_err() for the unsupported one?
> 
> It already exists on lower level, at perf_evlist__ctlfd_process() (see patch 02/11).

oic
 
> ~Alexey

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ