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, 11 Jan 2018 21:29:21 +0000
From:   "Liang, Kan" <kan.liang@...el.com>
To:     Jiri Olsa <jolsa@...hat.com>
CC:     "acme@...nel.org" <acme@...nel.org>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "wangnan0@...wei.com" <wangnan0@...wei.com>,
        "jolsa@...nel.org" <jolsa@...nel.org>,
        "namhyung@...nel.org" <namhyung@...nel.org>,
        "ak@...ux.intel.com" <ak@...ux.intel.com>,
        "yao.jin@...ux.intel.com" <yao.jin@...ux.intel.com>
Subject: RE: [PATCH V3 08/12] perf top: check per event overwrite term

> On Thu, Dec 21, 2017 at 10:08:50AM -0800, kan.liang@...el.com wrote:
> > From: Kan Liang <kan.liang@...el.com>
> >
> > Per event overwrite term is not forbidden in perf top, which can bring
> > problems. Because perf top only support non-overwrite mode.
> >
> > Check and forbid inconsistent per event overwrite term in the evlist.
> > Make it possible to support either non-overwrite or overwrite mode.
> > The overwrite mode is forbidden now, which will be removed when the
> > overwrite mode is supported later.
> >
> > Signed-off-by: Kan Liang <kan.liang@...el.com>
> > ---
> >  tools/perf/builtin-top.c | 60
> ++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 60 insertions(+)
> >
> > diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
> > index c6ccda5..4b85e7b 100644
> > --- a/tools/perf/builtin-top.c
> > +++ b/tools/perf/builtin-top.c
> > @@ -881,6 +881,56 @@ static void perf_top__mmap_read(struct perf_top
> *top)
> >  		perf_top__mmap_read_idx(top, i);
> >  }
> >
> > +/*
> > + * Check per event overwrite term.
> > + * perf top supports consistent mode for all events.
> > + * Return -1 if the per event terms set but not consistent.
> 
> please list the rules for overwrite in the comment
> are they just top specific?

Yes, it's only for perf top.
It doesn't support that some events are overwrite mode and other events are
non-overwrite mode.
I will refine the comments.

> 
> SNIP
> 
> > +			if (evsel == perf_evlist__first(evlist))
> > +				overwrite = set;
> > +			else
> > +				return -1;
> > +		}
> > +	}
> > +
> > +	if ((overwrite >= 0) && (opts->overwrite != overwrite))
> > +		opts->overwrite = overwrite;
> > +
> > +	return 0;
> > +}
> > +
> >  static int perf_top__start_counters(struct perf_top *top)
> >  {
> >  	char msg[BUFSIZ];
> > @@ -890,6 +940,16 @@ static int perf_top__start_counters(struct
> perf_top *top)
> >
> >  	perf_evlist__config(evlist, opts, &callchain_param);
> 
> so perf_evlist__config uses opts->overwrite, which you set
> in your perf_top_overwrite_check call.. I'd think you need
> to call it sooner
>

User may set per-event mode, which is processed in perf_evlist__config
It's possible that the per-event mode is not same as opts->overwrite.
If so, perf_evlist__config actually uses per-event mode.

perf_top_overwrite_check will do the check. If the per-event mode is
inconsistent as opts->overwrite, updating the opts->overwrite.

It has to be called after the perf_evlist__config.

Thanks,
Kan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ