mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Jean Pihet <jean.pihet@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@infradead.org>,
	Robert Richter <rric@kernel.org>, Ingo Molnar <mingo@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Tomasz Nowicki <tomasz.nowicki@linaro.org>
Subject: Re: [PATCH v3 00/12] perf, persistent: Add persistent events
Date: Sat, 29 Mar 2014 10:42:50 +0100	[thread overview]
Message-ID: <20140329094250.GA11987@nazgul.tnic> (raw)
In-Reply-To: <CAFrcx1kdVQmNETtUoLJNdtMbzZ4bPSxHq8R-PwOdd=vEu6L9Zw@mail.gmail.com>

On Fri, Mar 28, 2014 at 03:54:11PM +0100, Jean Pihet wrote:
> Hi,
> 
> Now that the feature is resurfacing, I would like to take over the
> task for persistent events.
> What is the status of the series, is it close to acceptance?
> 
> AFAICS the patch RFC 12/12 was under discussion, mainly about the
> naming of the ioctls (latest e-mail is in favor of CLAIM/UNCLAIM).
> 
> Any thoughts?
> 
> Let me rebase the code against the latest mainline and re-start the discussion.

That's nice, cool. However, before this thing goes upstream, Ingo wanted
to have also a user for the events, i.e. persistent events integrated
in perf tool. For that, perf tool functionality has to be made generic
enough and thus usable for other tools.

I have started doing that but other stuff preempted me, as it happens :(.
Here's how a splitup would look like, from an older email from Ingo. In
any case, this would need further discussion but I think it is a good
start.

I'm willing to help out as time permits and I'd venture a guess that
Robert would do that too, so please CC us your submissions.

Thanks!

--
>From mingo.kernel.org@gmail.com Tue Nov 26 19:17:58 2013
Date: Tue, 26 Nov 2013 19:17:45 +0100
From: Ingo Molnar <mingo@kernel.org>
To: Borislav Petkov <bp@alien8.de>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>, LKML
 <linux-kernel@vger.kernel.org>, Borislav Petkov <bp@suse.de>, Jiri Olsa
 <jolsa@redhat.com>, Peter Zijlstra <peterz@infradead.org>, Robert Richter
 <rric@kernel.org>
Subject: Re: [PATCH] perf: Move fs.* to generic lib/lk/
Message-ID: <20131126181745.GD9958@gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8
Status: RO
X-Status: A


* Borislav Petkov <bp@alien8.de> wrote:

> On Fri, Nov 22, 2013 at 04:39:11PM +0100, Ingo Molnar wrote:
>
> > I see no problem with that - it's basically like util/*.c is, just 
> > between tools.
> 
> But why? Why it is a good thing to have to pay attention to linking 
> to 10 minilibs when you're using 10 utilities for your tool instead 
> of a small number of topic libraries, 2-3 tops?

It's a single line added to the Makefile, the moment a .h is used for 
the first time. That's not any appreciable overhead.

This would also allow us to farm out most of tools/perf/util/ into 
tools/lib/, without any noticeable changes in build performance or 
build dependencies. Down the line it would (hopefully) result in code 
improvements to these infrastructure bits, sourced from different 
tools.

> What's wrong with the split:
> 
> * generic stuff
> * trace events
> * perf events
> 
> ?

Well, the natural evolution of interfaces ended up with such a split 
up:

comet:~/tip/tools/perf> ls util/*.h
util/annotate.h   util/hist.h           util/strbuf.h
util/build-id.h   util/intlist.h        util/strfilter.h
util/cache.h      util/levenshtein.h    util/strlist.h
util/callchain.h  util/machine.h        util/svghelper.h
util/cgroup.h     util/map.h            util/symbol.h
util/color.h      util/parse-events.h   util/target.h
util/comm.h       util/parse-options.h  util/thread.h
util/cpumap.h     util/perf_regs.h      util/thread_map.h
util/data.h       util/pmu.h            util/tool.h
util/debug.h      util/probe-event.h    util/top.h
util/dso.h        util/probe-finder.h   util/trace-event.h
util/dwarf-aux.h  util/pstack.h         util/types.h
util/event.h      util/quote.h          util/unwind.h
util/evlist.h     util/rblist.h         util/util.h
util/evsel.h      util/run-command.h    util/values.h
util/exec_cmd.h   util/session.h        util/vdso.h
util/fs.h         util/sigchain.h       util/xyarray.h
util/header.h     util/sort.h
util/help.h       util/stat.h

If we want additional structure to it then it should be done via the 
namespace, not by forcing them into bigger .a's. So this kind of extra 
structure makes sense:

  api/types/rbtree.h
  api/types/strbuf.h
  api/formats/dwarf/unwind.h
  api/kernel/pmu.h
  api/kernel/cgroup.h
  api/kernel/debugfs.h

But stuffing them into types.a, formats.a, kernel.a, not so much.

> With "generic stuff" being something like glibc. There's hardly a 
> tool that needs/links to *all* of glibs's functionality yet glibs 
> doesn't get split. Do you see what I mean?

glibc being such a catch-all library is:

 - partly a historic artifact caused by other constraints that don't 
   affect our tooling landscape here

 - partly a political artifact caused by thinking that does not affect 
   our tooling landscape

 - partly a technological mistake.

There's no need for us to repeat that, at least at this stage.

> > What dependencies do you mean? The only constraint is to not make 
> > it circular - but that's easy to do if they are nicely separated 
> > per concept. I don't think rbtree.h ever wants to include cmdline 
> > processing or debugfs processing.
> 
> But if you have a single .a library, you don't care about which 
> minilibrary to link to what. You basically do take libkapi.a and 
> you're good to go - no need to hunt every dependency.

You still need to figure out the .h file - at that point, when you are 
using it for the first time in your tool project, you add the .c file 
to the Makefile - it's not hard and there are real advantages.

> With the split above, for example, libkapi.a links to glibc only. 
> libtraceevent.a and libperfevent.a both link to libkapi.a and glibc. 
> It is all nice and clean.

It does not look that nice and clean once I consider all the nice 
helpers that exist in util/*.[ch] - and which we'd like to share as 
well.

Thanks,

	Ingo

      reply	other threads:[~2014-03-29  9:43 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-22 14:13 Robert Richter
2013-08-22 14:13 ` [PATCH v3 01/12] perf, mmap: Factor out ring_buffer_detach_all() Robert Richter
2013-08-22 14:13 ` [PATCH v3 02/12] perf, mmap: Factor out try_get_event()/put_event() Robert Richter
2013-08-22 14:13 ` [PATCH v3 03/12] perf, mmap: Factor out perf_alloc/free_rb() Robert Richter
2013-08-22 14:13 ` [PATCH v3 04/12] perf, mmap: Factor out perf_get_fd() Robert Richter
2013-08-22 14:13 ` [PATCH v3 05/12] perf: Add persistent events Robert Richter
2013-08-22 14:13 ` [PATCH v3 06/12] mce, x86: Enable " Robert Richter
2013-08-22 14:13 ` [PATCH v3 07/12] perf, persistent: Implementing a persistent pmu Robert Richter
2013-08-22 14:13 ` [PATCH v3 08/12] perf, persistent: Exposing persistent events using sysfs Robert Richter
2013-08-22 18:00   ` Vince Weaver
2013-08-23  9:37     ` Robert Richter
2013-08-23 16:39       ` Vince Weaver
2013-08-27 11:16         ` Robert Richter
2013-08-22 14:13 ` [PATCH v3 09/12] perf, persistent: Use unique event ids Robert Richter
2013-08-22 14:13 ` [PATCH v3 10/12] perf, persistent: Implement reference counter for events Robert Richter
2013-08-22 14:13 ` [PATCH v3 11/12] perf, persistent: Dynamically resize list of sysfs entries Robert Richter
2013-08-22 14:13 ` [PATCH v3 12/12] [RFC] perf, persistent: ioctl functions to control persistency Robert Richter
2013-08-22 18:18   ` Vince Weaver
2013-08-23  9:11     ` Borislav Petkov
2013-08-23  9:45       ` Robert Richter
2013-08-23 10:44         ` Robert Richter
2013-08-23 11:34           ` Borislav Petkov
2013-08-23 17:07             ` Vince Weaver
2013-08-23 19:39               ` Borislav Petkov
2013-08-23 21:08                 ` Vince Weaver
2013-08-23 21:09                   ` Borislav Petkov
2013-08-27 11:54                   ` Robert Richter
2013-08-27 12:22                     ` Borislav Petkov
2013-08-27 12:41                       ` Robert Richter
2013-08-27 12:48                         ` Borislav Petkov
2013-08-23 10:07     ` Robert Richter
2013-08-27 12:17       ` Robert Richter
2013-08-24  9:38 ` [PATCH v3 00/12] perf, persistent: Add persistent events Borislav Petkov
2013-08-27 12:27   ` Robert Richter
2013-08-27 12:38     ` Borislav Petkov
2014-03-28 14:54       ` Jean Pihet
2014-03-29  9:42         ` Borislav Petkov [this message]

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=20140329094250.GA11987@nazgul.tnic \
    --to=bp@alien8.de \
    --cc=acme@infradead.org \
    --cc=jean.pihet@linaro.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rric@kernel.org \
    --cc=tomasz.nowicki@linaro.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

all inboxes | Powered by JetHome®