One of my goals this quarter is running mochitests and reftests with ThreadSanitizer (TSan), reporting any races that it finds, and either fixing some of them myself or convincing other people to fix them. As more and more components of the browser use threads in earnest (parts of the JavaScript engine, including the GC graphics networking Web features like indexedDB, workers, and WebRTC I have probably left out some others), preventing and/or fixing data races become more and more important as a way of ensuring both correctness and stability. We use a fair number of automated tools for memory errors ( AddressSanitizer/Leak Sanitizer for use-after-free and buffer overflows custom leak checking on refcounted objects Valgrind tests and Julian Seward’s mochitests on Valgrind periodic testing), but we do very little in terms of checking for data races between threads. Perhaps sampling something different (if that’s possible) would correlate better. One might have turned on discrete graphics in a laptop, or high-resolution timers on Windows, for instance, but that wouldn’t necessarily be reflected in a CPU profile. Taking logs along with running a sampling-based stack profiler and then attempting to correlate the two might assist in providing insight, but it’s not obvious to me that stacks of where you’re spending CPU time are necessarily correlated with power usage. I think this sort of tool is the primary use case of Power Gadget in diagnosing power problems: it helps you see whether you might be using too much power, but it doesn’t provide insight into why you’re using that power. Roberto Vitillo and Joel Maher wrote a tool called energia that compares energy usage between different browsers on pre-selected sets of pages Power Gadget is one of the tools that can be used for gathering energy statistics. I like Power Gadget more than Joulemeter: Power Gadget is cross-platform, captures more detailed statistics, and seems a little more straightforward in explaining how power usage is measured. The CSV file also logs the power consumption of all “packages” (i.e. While the default mode of operation is to draw pretty graphs detailing this information in a window, Power Gadget can also log detailed statistics to a CSV file of your choice, taking samples every ~100ms. As a side benefit, it also keeps track of the frequency and temperature of your CPU. It works by sampling energy counters maintained by the processor itself to estimate energy usage. Power Gadget is cross-platform, and despite some dire comments on the download page above, I’ve had no trouble running it on Windows 7 and OS X Yosemite (though I do have older CPUs in both of those machines). CSV logfiles can be captured for later analysis, taking samples every second or so. Statistics about individual apps are also obtainable, though only power draw based on CPU usage is measured (estimated). Desktop computers can use a WattsUp power meter in lieu of running off battery. I’m not entirely sure what the calibration step does, but since you’re required to be running on battery, I presume that it somehow obtains statistics about how your battery drains, and then apportions power drain between the individual components. Perhaps things like wifi?) A calibration step is required for trying to measure anything. (No, I’m not sure what “base” is, either. Joulemeter is advertised as “a software tool that estimates the power consumption of your computer.” Estimates for the power usage of individual components (CPU/monitor/disk/”base”) are provided while you’re running the tool. In the continuing evaluation of how Firefox’s energy usage might be measured and improved, I looked at two programs, Microsoft Research’s Joulemeter and Intel’s Power Gadget.Īs you might expect, Joulemeter only works on Windows.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |