Ignore:
Timestamp:
Apr 30, 2009, 2:02:19 PM (16 years ago)
Author:
[email protected]
Message:

2009-04-30 Gavin Barraclough <[email protected]>

Reviewed by Oliver Hunt.

Two quick improvements to SamplingFlags mechanism.

SamplingFlags::ScopedFlag class to provide support for automagically
clearing a flag as it goes out of scope, and add a little more detail
to the output generated by the tool.

  • bytecode/SamplingTool.cpp: (JSC::SamplingFlags::stop):
  • bytecode/SamplingTool.h: (JSC::SamplingFlags::ScopedFlag::ScopedFlag): (JSC::SamplingFlags::ScopedFlag::~ScopedFlag):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecode/SamplingTool.cpp

    r43047 r43087  
    6767        total += s_flagCounts[i];
    6868
    69     printf("SamplingFlags: sample count with flags set:\n");
    70     for (unsigned i = 0; i <= 32; ++i)
    71         printf("  [ %02d ] : %lld\t\t(%03.2f%%)\n", i, s_flagCounts[i], (100.0 * s_flagCounts[i]) / total);
    72     printf("\n\n");
     69    if (total) {
     70        printf("\nSamplingFlags: sample counts with flags set: (%lld total)\n", total);
     71        for (unsigned i = 0; i <= 32; ++i) {
     72            if (s_flagCounts[i])
     73                printf("  [ %02d ] : %lld\t\t(%03.2f%%)\n", i, s_flagCounts[i], (100.0 * s_flagCounts[i]) / total);
     74        }
     75        printf("\n");
     76    } else
     77    printf("\nSamplingFlags: no samples.\n\n");
    7378}
    7479uint64_t SamplingFlags::s_flagCounts[33];
Note: See TracChangeset for help on using the changeset viewer.