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: <ZuGNhhzlTaAQaZXj@x1>
Date: Wed, 11 Sep 2024 09:31:02 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: James Clark <james.clark@...aro.org>
Cc: Changbin Du <changbin.du@...wei.com>,
	Mark Rutland <mark.rutland@....com>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	"Liang, Kan" <kan.liang@...ux.intel.com>,
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>, Namhyung Kim <namhyung@...nel.org>
Subject: Re: [PATCH v2] perf ftrace: Detect whether ftrace is enabled on
 system

On Wed, Sep 11, 2024 at 11:15:19AM +0100, James Clark wrote:
> On 11/09/2024 11:01, Changbin Du wrote:
> > To make error messages more accurate, this change detects whether ftrace is
> > enabled on system by checking trace file "set_ftrace_pid".

<SNIP>

> > @@ -1583,6 +1601,11 @@ int cmd_ftrace(int argc, const char **argv)
> >   	if (!check_ftrace_capable())
> >   		return -1;
> > +	if (!is_ftrace_supported()) {
> > +		pr_err("ftrace is not supported on this system\n");
> > +		return -ENOTSUP;
> > +	}
> > +
> >   	ret = perf_config(perf_ftrace_config, &ftrace);
> >   	if (ret < 0)
> >   		return -1;
> 
> Reviewed-by: James Clark <james.clark@...aro.org>

Applied and added these comments:

Committer testing:

Doing it in an unprivileged toolbox container on Fedora 40:

Before:

  acme@...ber:~/git/perf-tools-next$ toolbox enter perf
  ⬢[acme@...lbox perf-tools-next]$ sudo su -
  ⬢[root@...lbox ~]# ~acme/bin/perf ftrace
  failed to reset ftrace
  ⬢[root@...lbox ~]#

After this patch:

  ⬢[root@...lbox ~]# ~acme/bin/perf ftrace
  ftrace is not supported on this system
  ⬢[root@...lbox ~]#

Maybe we could check if we are in such as situation, inside an
unprivileged container, and provide a HINT line?

Reviewed-by: James Clark <james.clark@...aro.org>
Signed-off-by: Changbin Du <changbin.du@...wei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ