lkml.org 
[lkml]   [2015]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/40] perf tools: Create separate mmap for dummy tracking event
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..

jirka


\
 
 \ /
  Last update: 2015-05-18 20:41    [W:0.320 / U:1.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site