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: <ZwlU2lpeekYntrGd@google.com>
Date: Fri, 11 Oct 2024 09:39:54 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Ben Gainey <Ben.Gainey@....com>
Cc: "acme@...nel.org" <acme@...nel.org>,
	"irogers@...gle.com" <irogers@...gle.com>,
	"kan.liang@...ux.intel.com" <kan.liang@...ux.intel.com>,
	"jolsa@...nel.org" <jolsa@...nel.org>,
	"peterz@...radead.org" <peterz@...radead.org>,
	"adrian.hunter@...el.com" <adrian.hunter@...el.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-perf-users@...r.kernel.org" <linux-perf-users@...r.kernel.org>,
	"mingo@...nel.org" <mingo@...nel.org>
Subject: Re: [PATCH] perf evsel: Fix missing inherit + sample read check

On Fri, Oct 11, 2024 at 08:02:04AM +0000, Ben Gainey wrote:
> On Tue, 2024-10-08 at 23:22 -0700, Namhyung Kim wrote:
> > It should not clear the inherit bit simply because the kernel doesn't
> > support the sample read with it.  IOW the inherit bit should be kept
> > when the sample read is not requested for the event.
> 
> 
> Ah, sorry. Good spot.

Thanks for the review, can I translate it your Acked-by?

Thanks,
Namhyung
 
> > 
> > Fixes: 90035d3cd876cb71 ("tools/perf: Allow inherit +
> > PERF_SAMPLE_READ when opening events")
> > Cc: Ben Gainey <ben.gainey@....com>
> > Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> > ---
> >  tools/perf/util/evsel.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> > index d8fd493af01458b7..507f526ccbbcfc36 100644
> > --- a/tools/perf/util/evsel.c
> > +++ b/tools/perf/util/evsel.c
> > @@ -2112,7 +2112,8 @@ static int __evsel__prepare_open(struct evsel
> > *evsel, struct perf_cpu_map *cpus,
> >  
> >  static void evsel__disable_missing_features(struct evsel *evsel)
> >  {
> > - if (perf_missing_features.inherit_sample_read)
> > + if (perf_missing_features.inherit_sample_read && evsel-
> > >core.attr.inherit &&
> > +     (evsel->core.attr.sample_type & PERF_SAMPLE_READ))
> >   evsel->core.attr.inherit = 0;
> >   if (perf_missing_features.branch_counters)
> >   evsel->core.attr.branch_sample_type &=
> > ~PERF_SAMPLE_BRANCH_COUNTERS;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ