Bug 1203811 - Clarify two error messages in tools/power/rapl. r=heycam.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 10 Sep 2015 23:12:31 -0700
changeset 261914 0831bdc0a4358ba605934700f793b8acab4904b0
parent 261913 44d375dd46bb6119a5ab2a8807bd985791494daf
child 261915 0f290d4c9fbb58e2ccd18063f7cd01a527621968
push id29355
push usercbook@mozilla.com
push dateFri, 11 Sep 2015 14:37:04 +0000
treeherdermozilla-central@19f806034f67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1203811
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1203811 - Clarify two error messages in tools/power/rapl. r=heycam.
tools/power/rapl.cpp
--- a/tools/power/rapl.cpp
+++ b/tools/power/rapl.cpp
@@ -467,17 +467,19 @@ public:
 
   Domain(const char* aName, uint32_t aType, IsOptional aOptional = NonOptional)
   {
     uint64_t config;
     if (!ReadValueFromPowerFile("events/energy-", aName, "", "event=%llx",
          &config)) {
       // Failure is allowed for optional domains.
       if (aOptional == NonOptional) {
-        Abort("failed to open file for non-optional domain '%s'", aName);
+        Abort("failed to open file for non-optional domain '%s'\n"
+              "- Is your kernel version 3.14 or later, as required? "
+              "Run |uname -r| to see.", aName);
       }
       mIsSupported = false;
       return;
     }
 
     mIsSupported = true;
 
     ReadValueFromPowerFile("events/energy-", aName, ".scale", "%lf",
@@ -496,18 +498,18 @@ public:
     attr.size = uint32_t(sizeof(attr));
     attr.config = config;
 
     // Measure all processes/threads. The specified CPU doesn't matter.
     mFd = perf_event_open(&attr, /* pid = */ -1, /* cpu = */ 0,
                           /* group_fd = */ -1, /* flags = */ 0);
     if (mFd < 0) {
       Abort("perf_event_open() failed\n"
-            "Did you run as root or "
-            "set /proc/sys/kernel/perf_event_paranoid to 0?");
+            "- Did you run as root (e.g. with |sudo|) or set\n"
+            "  /proc/sys/kernel/perf_event_paranoid to 0, as required?");
     }
 
     mPrevTicks = 0;
   }
 
   ~Domain()
   {
     if (mIsSupported) {