lkml.org 
[lkml]   [2010]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/2] perf tools: Add reference timestamp to perf header
    Em Mon, Dec 13, 2010 at 06:09:26PM +0100, Frederic Weisbecker escreveu:
    > On Mon, Dec 13, 2010 at 02:48:54PM -0200, Arnaldo Carvalho de Melo wrote:
    > > Em Mon, Dec 13, 2010 at 04:54:56PM +0100, Frederic Weisbecker escreveu:
    > > > On Mon, Dec 13, 2010 at 07:39:24AM -0700, David S. Ahern wrote:
    > > > > On 12/12/10 13:16, Frederic Weisbecker wrote:
    > > > > >> int perf_session__create_kernel_maps(struct perf_session *self)
    > > > > >> {
    > > > > >> int ret = machine__create_kernel_maps(&self->host_machine);
    > > > > >> @@ -167,6 +190,9 @@ struct perf_session *perf_session__new(const char *filename, int mode, bool forc
    > > > > >> */
    > > > > >> if (perf_session__create_kernel_maps(self) < 0)
    > > > > >> goto out_delete;
    > > > > >> +
    > > > > >> + if (perf_session__create_ref_time(self) < 0)
    > > > > >> + goto out_delete;
    > >
    > > > > > So, it does record it anytime?
    > >
    > > > > Simplest to always add it the header as it does no harm if not used.
    > > > > To make it conditional means adding an input parameter to
    > > > > perf_session__new() and then updating all the callers.
    > >
    > > > > Is the preference to make it conditional?
    > >
    > > > No, I suspect the overhead is plain unnoticeable. And if it becomes
    > > > any problem one day, we can still make that conditional later.
    > >
    > > Right, but it just ocurred to me, can't we encode this in the file stat?
    > > Also, how do we deal with:
    > >
    > > $ perf record --help
    > > <SNIP>
    > > -A, --append
    > > Append to the output file to do incremental profiling.
    > > <SNIP>
    > >
    > > ?
    > >
    > > I now think this should be implemented as a PERF_RECORD_WALL_CLOCK
    > > synthesized event, to be inserted just before we start collecting the
    > > other events.
    > >
    > > That way, when --appending, we just insert another and use that from
    > > that point on.
    > >
    > > Look at tools/perf/util/event.h, enum perf_user_event_type and look how
    > > those are synthesized.
    >
    > (Adding peterz)

    Adding tglx

    > Right, but Peter wanted us to get rid of these user events types.
    > I guess we can't really do this as new perf tools must be able
    > to support old perf files.
    >
    > So this should be the last one to add. Something like PERF_RECORD_GEN_EVT
    > that has a field in its headers containing a sub-type which can be this
    > wall clock but can also host about everything in the future.
    >
    > This way we don't propagate more the possible overlap with the kernel.

    That works for me. I would call it:

    PERF_RECORD_SYNTH

    our ioctl ;-)

    But whatever, just a name.

    - Arnaldo


    \
     
     \ /
      Last update: 2010-12-13 18:17    [W:0.029 / U:0.588 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site