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

On Mon, Dec 29, 2014 at 03:44:21PM +0200, Adrian Hunter wrote:
> > @@ -843,9 +889,22 @@ static int perf_evlist__mmap_per_evsel(struct perf_evlist *evlist, int idx,
> >  
> >  		fd = FD(evsel, cpu, thread);
> >  
> > -		if (*output == -1) {
> > +		if (perf_evsel__is_dummy_tracking(evsel)) {
> > +			struct mmap_params track_mp = {
> > +				.prot	= mp->prot,
> > +				.len	= TRACK_MMAP_SIZE,
> > +			};
> > +
> > +			if (__perf_evlist__mmap(evlist, &evlist->track_mmap[idx],
> > +						&track_mp, fd) < 0)
> > +				return -1;
> > +
> > +			/* mark idx as track mmap idx (negative) */
> > +			idx = track_mmap_idx(idx);
> 
> Do you not still need to do SET_OUTPUT when there are multiple cpus and
> multiple pids?

You're right.  I just considered simple cases, will fix.

Thanks,
Namhyung


> 
> 
> > +		} else if (*output == -1) {
> >  			*output = fd;
> > -			if (__perf_evlist__mmap(evlist, idx, mp, *output) < 0)
> > +			if (__perf_evlist__mmap(evlist, &evlist->mmap[idx],
> > +						mp, *output) < 0)
> >  				return -1;
> >  		} else {
> >  			if (ioctl(fd, PERF_EVENT_IOC_SET_OUTPUT, *output) != 0)
> > @@ -874,6 +933,11 @@ static int perf_evlist__mmap_per_evsel(struct perf_evlist *evlist, int idx,
> >  			perf_evlist__set_sid_idx(evlist, evsel, idx, cpu,
> >  						 thread);
> >  		}
> > +
> > +		if (mp->track && perf_evsel__is_dummy_tracking(evsel)) {
> > +			/* restore idx as normal idx (positive) */
> > +			idx = track_mmap_idx(idx);
> > +		}
> >  	}
> >  
> >  	return 0;
--
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