[lkml]   [2009]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Subjectperf_events: zero time running and enabled, but non-zero count
    Hi folks,

    First let me state that I'm working with a Linux kernel which is a couple of
    weeks old and came from Linus' post-2.6.31 release tree. It does contain the
    name change from perf_counter to perf_event, for example.

    I'm working on some optimizations of PAPI's use of perf_events. In particular I
    want to speed up the reading of events. To do this, I am doing two things:
    1) Not disabling and enabling the counters around reading the counters. In
    other words, read them on the fly.
    2) Use the PERF_FORMAT_GROUP option so that I can read up an entire group of
    counters in one syscall.

    This seems to be working fairly well, except it seems that sometimes the "time
    running" and "time enabled" values that I read up are zero, even though the
    count is non-zero. The case I'm looking at has three groups, and it's the third
    group, containing a single event, which is getting the zero enabled/running values.

    One experiment that I just now tried was to put the code back in that
    disables/re-enables the counters around the code that reads the counters. This
    seems to have fixed the problem, but causes a performance degradation, of course.

    Is this expected behavior? Should I be able to read the counts, and times on
    the fly like I want to be able to do?

    Thanks for your consideration of this issue.

    - Corey

    Corey Ashford
    Software Engineer
    IBM Linux Technology Center, Linux Toolchain
    Beaverton, OR

     \ /
      Last update: 2009-10-23 21:19    [W:0.047 / U:10.280 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site