public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Mike Galbraith <efault@gmx.de>, Paul Mackerras <paulus@samba.org>,
	Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Subject: Re: [PATCH 6/6] perf tools: Bring linear set of section headers for features
Date: Wed, 11 Nov 2009 17:49:37 +0100	[thread overview]
Message-ID: <20091111164933.GB5255@nowhere> (raw)
In-Reply-To: <1257920404.23203.0.camel@twins>

On Wed, Nov 11, 2009 at 07:20:04AM +0100, Peter Zijlstra wrote:
> On Wed, 2009-11-11 at 04:51 +0100, Frederic Weisbecker wrote:
> > Build a set of section headers for features right after the datas.
> > Each implemented feature will have one of such section header that
> > provides the offset and the size of the data manipulated by the feature.
> > 
> > The trace informations have moved after the data and are recorded
> > on exit time.
> > 
> > The new layout is as follows:
> > 
> >  -----------------------
> >                              ___
> >  [ magic               ]      |
> >  [ header size         ]      |
> >  [ attr size           ]      |
> >  [ attr content offset ]      |
> >  [ attr content size   ]      |
> >  [ data offset         ]  File Headers
> >  [ data size           ]      |
> >  [ event_types offset  ]      |
> >  [ event_types size    ]      |
> >  [ feature bitmap      ]      v 
> > 
> >  [ attr section        ]
> >  [ events section      ]
> > 
> >                              ___
> >  [         X           ]      |
> >  [         X           ]      |
> >  [         X           ]    Datas
> >  [         X           ]      |
> >  [         X           ]      v
> > 
> >                              ___
> >  [ Feature 1 offset    ]      |
> >  [ Feature 1 size      ] Features headers
> >  [ Feature 2 offset    ]      |
> >  [ Feature 2 size      ]      v
> > 
> >  [ Feature 1 content   ]
> >  [ Feature 2 content   ]
> >  -----------------------
> > 
> > We have as many feature's section headers as we have features in use for
> > the current file.
> > 
> > Say Feat 1 and Feat 3 are used by the file, but not Feat 2. Then the
> > feature headers will be like follows:
> > 
> > [ Feature 1 offset    ]      |
> > [ Feature 1 size      ] Features headers
> > [ Feature 3 offset    ]      |
> > [ Feature 3 size      ]      v
> > 
> > There is no hole to cover Feature 2 that is not in use here. We only
> > need to cover the needed headers in order, from the lowest feature bit
> > to the highest.
> > 
> > Currently we have two features: HEADER_TRACE_INFO and HEADER_BUILD_ID.
> > Both have their contents that follow the feature headers. Putting the
> > contents right after the feature headers is not mandatory though.
> > While we keep the feature headers right after the data and in order,
> > their offsets can point everywhere. We have just put the two above
> > feature contents in the end of the file for convenience.
> > 
> > The purpose of this layout change is to have a file format that scales
> > while keeping it simple: having such linear feature headers is less
> > error prone wrt forward/backward compatibility as the content of a
> > feature can be put anywhere, its location can even change by the
> > time, it's fine because its headers will tell where it is. And we know
> > how to find these headers, following the above rules.
> 
> Does do mess up append though... be sure to add some magic for that.


Yep. It seems to work. What happens is that trace information are
re-computed. The same goes for build id I guess.

What happens is that the appended datas override the features sections
and headers, but this is fine because we rewrite them in the end.

But these both need to support appending mode internally (ie: append
the new informtions on top of exisiting ones instead of redo the whole)
and then rewrite the whole at exit like it's done currently.


  reply	other threads:[~2009-11-11 16:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-11  3:51 [PATCH 1/6] perf tools: Synthetize the targeted process Frederic Weisbecker
2009-11-11  3:51 ` [PATCH 2/6] perf tools: Move the build-id storage operations to headers Frederic Weisbecker
2009-11-11  7:43   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-11  3:51 ` [PATCH 3/6] perf tools: Split up build id saving into fetch and write Frederic Weisbecker
2009-11-11  7:43   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-11  3:51 ` [PATCH 4/6] perf tools: Read the build-ids from the header layer Frederic Weisbecker
2009-11-11  7:43   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-11  3:51 ` [PATCH 5/6] perf tools: Use perf_header__set/has_feat whenever possible Frederic Weisbecker
2009-11-11  7:43   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-11  3:51 ` [PATCH 6/6] perf tools: Bring linear set of section headers for features Frederic Weisbecker
2009-11-11  6:20   ` Peter Zijlstra
2009-11-11 16:49     ` Frederic Weisbecker [this message]
2009-11-11 17:32       ` Arnaldo Carvalho de Melo
2009-11-11  7:44   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-11  7:42 ` [tip:perf/core] perf tools: Synthetize the targeted process tip-bot for Frederic Weisbecker

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=20091111164933.GB5255@nowhere \
    --to=fweisbec@gmail.com \
    --cc=acme@redhat.com \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mitake@dcl.info.waseda.ac.jp \
    --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