lkml.org 
[lkml]   [2013]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/10] perf machine: Introduce synthesize_threads method out of open coded equivalent

* David Ahern <dsahern@gmail.com> wrote:

> On 11/11/13, 1:22 PM, Arnaldo Carvalho de Melo wrote:
> >+ if (perf_target__has_task(target))
> >+ return perf_event__synthesize_thread_map(tool, threads, process, machine, data_mmap);
> >+ else if (perf_target__has_cpu(target))
> >+ return perf_event__synthesize_threads(tool, process, machine, data_mmap);
>
>
> Getting kind of long on the line lengths...

Maybe we could start losing most of the perf_ prefixes - it's all about
perf here, so it does not really add much information, does it?

that would turn it into:

if (target__has_task(target))
return event__synthesize_thread_map(tool, threads, process, machine, data_mmap);
else if (target__has_cpu(target))
return event__synthesize_threads(tool, process, machine, data_mmap);

Another trick would be to combine (tool, machine) into a single helper
struct (struct context *ctx?), if that is mostly a constant combination
describing tool environment, which gets passed deep inside the guts of
functions.

Thanks,

Ingo


\
 
 \ /
  Last update: 2013-11-11 22:21    [W:0.186 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site