linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: David Ahern <dsahern@gmail.com>,
	linux-kernel@vger.kernel.org,
	Adrian Hunter <adrian.hunter@intel.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>, Mike Galbraith <efault@gmx.de>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 04/10] perf machine: Introduce synthesize_threads method out of open coded equivalent
Date: Tue, 12 Nov 2013 13:44:42 +0100	[thread overview]
Message-ID: <20131112124442.GB13057@gmail.com> (raw)
In-Reply-To: <20131112113427.GA4053@ghostprotocols.net>


* Arnaldo Carvalho de Melo <acme@ghostprotocols.net> wrote:

> Em Mon, Nov 11, 2013 at 09:50:45PM +0100, Ingo Molnar escreveu:
> > * 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?
> 
> In some cases that is ok, that is why I didn't call it 'perf_machine', 
> just 'machine', in others, like 'perf_event', I thought 'event' would be 
> too general when somebody tries to use this code together with other 
> libraries.

I think 'event' as a variable name is generally unused by libraries, 
exactly because so much random code uses it.

The only unfortunate C library land grabs I've run into are 'time' [by 
glibc] and 'y0' [by libm].

What I was suggesting here was more like an event__*() namespace - there 
shouldn't be any collision with public functions from libraries, public 
functions are generally either well established, or prefixed with a 
library name.

These are perf-internal function names, so using event__*() should be fine 
- assuming there are no counter arguments.

Thanks,

	Ingo

  reply	other threads:[~2013-11-12 12:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11 20:22 [GIT PULL 00/10] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 01/10] perf ui tui progress: Don't force a refresh during progress update Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 02/10] perf evsel: Remove idx parm from constructor Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 03/10] perf record: Synthesize non-exec MMAP records when --data used Arnaldo Carvalho de Melo
2013-11-11 20:38   ` David Ahern
2013-11-11 21:02     ` Vince Weaver
2013-11-11 20:22 ` [PATCH 04/10] perf machine: Introduce synthesize_threads method out of open coded equivalent Arnaldo Carvalho de Melo
2013-11-11 20:40   ` David Ahern
2013-11-11 20:50     ` Ingo Molnar
2013-11-12 11:34       ` Arnaldo Carvalho de Melo
2013-11-12 12:44         ` Ingo Molnar [this message]
2013-11-12 21:57         ` [tip:perf/urgent] perf target: Shorten perf_target__ to target__ tip-bot for Arnaldo Carvalho de Melo
2014-01-12 18:33         ` [tip:perf/core] perf tools: Rename 'perf_record_opts' to ' record_opts tip-bot for Arnaldo Carvalho de Melo
2014-01-12 18:35         ` [tip:perf/core] perf report: Rename 'perf_report' to 'report' tip-bot for Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 05/10] perf machine: Simplify synthesize_threads method Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 06/10] perf tools: Prevent condition that all sort keys are elided Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 07/10] perf record: Use correct return type for write() Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 08/10] perf record: Move existing write_output into helper function Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 09/10] perf tests: Check return of perf_evlist__open sw clock event period test Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 10/10] perf tests: Use lower sample_freq in " Arnaldo Carvalho de Melo
2013-11-11 20:45   ` David Ahern
2013-11-12  7:07   ` Adrian Hunter
2013-11-12  8:40     ` Namhyung Kim
2013-11-12 11:59       ` Arnaldo Carvalho de Melo
2013-11-12 14:41     ` Arnaldo Carvalho de Melo
2013-11-15  6:03       ` Namhyung Kim
2013-11-12 21:56     ` [tip:perf/urgent] perf tests: Compensate lower sample freq with longer test loop tip-bot for Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131112124442.GB13057@gmail.com \
    --to=mingo@kernel.org \
    --cc=acme@ghostprotocols.net \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).