Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Using XPERF for profiling - Part 2

Don_Burn_1Don_Burn_1 Member Posts: 4,311
Thanks to Scott's excellent instructions, I got profiling to work with
XPERF. But this just leads to additional questions:

1. Is there a way to get a printed report for XPERF? Every time I've
tried it in the past I have never figured out a way. Sorry without
being able to record data for a run in a easily distributable file this
is worthless. No, saving the ETL files and distributing them is not an
option with clients. I once suggested to a manager they down load
XPERF, fortunately they really liked me as a consultant or I would have
been out of there.

2. I can get to the function level with XPERF, but the most useful data
for kernrate for me is the bucket data which XPERF seems to ignore.
XPERF reminds me of KrView which I tried several times and always
rejected since it hid the info I most desired.

3. Does XPERF have a way to control it, like kernrate can do with the
global events? I cannot find anything like that in the documentation,
and I have used the events in several benchmarks over the years.

I hope someone out there can fill in this, right now I see little value
in XPERF as a profiler without all of the above.


Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

Comments

  • Scott_Noone_(OSR)Scott_Noone_(OSR) Administrator Posts: 3,135
    There might be other answers for the these questions, but here's what I've
    seen based on my experience:

    > 1. Is there a way to get a printed report for XPERF?

    All of the options that I have seen for getting the output in to a text file
    are under xperf -help processing. The trick to the syntax is:

    xperf -i foo.etl -o output.txt -a ReportType

    The report types are labeled as "actions" and listed at the end of the -help
    processing output. For example:

    xperf -i kernel.etl -o c:\foo\kernel.txt -a cpudisk

    The output file is optional, if you leave it out everything goes to stdout.
    The -a switch is also optional but the resulting file is information
    overload.

    > 2. I can get to the function level with XPERF, but the most useful data
    > for kernrate for me is the bucket data which XPERF seems to ignore.
    > XPERF reminds me of KrView which I tried several times and always
    > rejected since it hid the info I most desired.

    Apparently the fact that xperfview only shows the function name and not
    function+offset or source line info is a known issue/feature request. The
    best you can do is get the sampled IP from the Address column and do your
    own resolution if you still have the target available (this would be painful
    and I can't imagine doing it in general).

    > 3. Does XPERF have a way to control it, like kernrate can do with the
    > global events? I cannot find anything like that in the documentation,
    > and I have used the events in several benchmarks over the years.

    I haven't seen anything either. The "mark" option is the only thing that
    I've seen that's even close. You can do:

    xperf -m "Start of test"
    <do whatever>
    xperf -m "End of test"

    And that will generate a checkpoints graph in the ETL file. You can then
    overlay that graph on any other graph in xperfview (Right Click->Overlay
    Graph->Marks->Mark). Not nearly the control that you had in kernrate, but
    you can at least annotate a particular time period in the graph so that you
    can isolate your analysis.


    -scott


    --
    Scott Noone
    Consulting Associate
    OSR Open Systems Resources, Inc.
    http://www.osronline.com


    "Don Burn" <xxxxx@acm.org> wrote in message news:xxxxx@ntdev...
    > Thanks to Scott's excellent instructions, I got profiling to work with
    > XPERF. But this just leads to additional questions:
    >
    > 1. Is there a way to get a printed report for XPERF? Every time I've
    > tried it in the past I have never figured out a way. Sorry without
    > being able to record data for a run in a easily distributable file this
    > is worthless. No, saving the ETL files and distributing them is not an
    > option with clients. I once suggested to a manager they down load
    > XPERF, fortunately they really liked me as a consultant or I would have
    > been out of there.
    >
    > 2. I can get to the function level with XPERF, but the most useful data
    > for kernrate for me is the bucket data which XPERF seems to ignore.
    > XPERF reminds me of KrView which I tried several times and always
    > rejected since it hid the info I most desired.
    >
    > 3. Does XPERF have a way to control it, like kernrate can do with the
    > global events? I cannot find anything like that in the documentation,
    > and I have used the events in several benchmarks over the years.
    >
    > I hope someone out there can fill in this, right now I see little value
    > in XPERF as a profiler without all of the above.
    >
    >
    > Don Burn (MVP, Windows DKD)
    > Windows Filesystem and Driver Consulting
    > Website: http://www.windrvr.com
    > Blog: http://msmvps.com/blogs/WinDrvr
    >
    >
    >
    >
    >

    -scott
    OSR

  • Pavel_LebedinskyPavel_Lebedinsky Member - All Emails Posts: 435
    > 2. I can get to the function level with XPERF, but the most useful data
    > for kernrate for me is the bucket data which XPERF seems to ignore.
    > XPERF reminds me of KrView which I tried several times and always
    > rejected since it hid the info I most desired.

    It's not quite the same thing, but if you drag the Address column to the
    left of the yellow bar you can group samples on a per-instruction basis
    (effectively making it a bucket of size 1). I used this a while ago to track
    down a global variable in the kernel that was responsible for something
    like 15% of CPU cycles under a particular load due to cache contention.

    I think kernrate is great for simlpe reports, but xperf is better when
    you actually need to get to the root of a problem. The ability to capture
    stack traces alone makes it more useful than kernrate for me. And in
    addition to that, xperf exposes lots of different events and has some nice
    data aggregation capabilities.

    --
    Pavel Lebedinsky/Windows Fundamentals Test
    This posting is provided "AS IS" with no warranties, and confers no rights.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Developing Minifilters 29 July 2019 OSR Seminar Space
Writing WDF Drivers 23 Sept 2019 OSR Seminar Space
Kernel Debugging 21 Oct 2019 OSR Seminar Space
Internals & Software Drivers 18 Nov 2019 Dulles, VA