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: <20150519062452.GD21663@sejong>
Date:	Tue, 19 May 2015 15:24:52 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	LKML <linux-kernel@...r.kernel.org>,
	David Ahern <dsahern@...il.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Andi Kleen <andi@...stfloor.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 04/40] perf tools: Create separate mmap for dummy
 tracking event

Hi Jiri,

On Mon, May 18, 2015 at 08:07:13PM +0200, Jiri Olsa wrote:
> On Mon, May 18, 2015 at 09:30:19AM +0900, Namhyung Kim wrote:
> 
> SNIP
> 
> > -static int perf_evlist__alloc_mmap(struct perf_evlist *evlist)
> > +static int perf_evlist__alloc_mmap(struct perf_evlist *evlist, bool track_mmap)
> >  {
> >  	evlist->nr_mmaps = cpu_map__nr(evlist->cpus);
> >  	if (cpu_map__empty(evlist->cpus))
> >  		evlist->nr_mmaps = thread_map__nr(evlist->threads);
> >  	evlist->mmap = zalloc(evlist->nr_mmaps * sizeof(struct perf_mmap));
> > -	return evlist->mmap != NULL ? 0 : -ENOMEM;
> > +	if (evlist->mmap == NULL)
> > +		return -ENOMEM;
> > +
> > +	if (track_mmap) {
> > +		evlist->track_mmap = calloc(evlist->nr_mmaps,
> > +					    sizeof(struct perf_mmap));
> > +		if (evlist->track_mmap == NULL) {
> > +			zfree(&evlist->mmap);
> > +			return -ENOMEM;
> > +		}
> > +	}
> > +	return 0;
> >  }
> >  
> >  struct mmap_params {
> > -	int prot;
> > -	int mask;
> > +	int	prot;
> > +	size_t	len;
> >  	struct auxtrace_mmap_params auxtrace_mp;
> >  };
> >  
> > -static int __perf_evlist__mmap(struct perf_evlist *evlist, int idx,
> > +static int __perf_evlist__mmap(struct perf_evlist *evlist __maybe_unused,
> > +			       struct perf_mmap *pmmap,
> >  			       struct mmap_params *mp, int fd)
> 
> hum, looks like this patch should be separated to:
> 
>  - one that makes __perf_evlist__mmap use perf_mmap directly
>    and moves auxtrace_mmap__mmap..
>    also __perf_evlist__mmap should be renamed (perf_mmap__mmap? ;-) )
>    and evlist arg removed, because it's not used..
> 
>  - one that adds dummy tracing events mmapping
> 
> maybe also separate the code that alloc and free evlist->track_mmap
> with perf_evlist__mmap_desc stuff, might help the readability..

OK, will do.

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ