[BetterBatteryStats] mag01:
He's quite right though

- Nexus 5

- Android 5.0 (LRX21O) - clean install from factory image with full wipe

- Rooted via Chainfire's CF-Auto-Root (SuperSU 2.20) - e.g. quite minimal modification to the kernel with (mostly) Enforcing SELinux policy preserved

- No other system modifications

- BetterBatteryStats 2.0.0.0B3

It's clearly getting selinux denials, in this case most likely just switching to the more privileged context will do that.

Below is some sample log from my brief test with few hopefully useful hints

1. here you're within context u:r:servicemanager:s0 while target is within highly privileged u:r:init:s0 - you will probably need to switch to u:r:init:s0 as well

avc: denied { search } for name="10295" dev="proc" ino=49298 scontext=u:r:servicemanager:s0 tcontext=u:r:init:s0 tclass=dir

2. here you're within very restricted u:r:untrusted_app:s0 and perhaps u:r:platform_app:s0 or even u:r:system_app:s0 (or in the worst case u:r:init:s0) might allow what you need

avc: denied { read } for comm=4173796E635461736B202334 name="wakeup_sources" dev="debugfs" ino=17 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:debugfs:s0 tclass=file

avc: denied { read } for name="wakeup_sources" dev="debugfs" ino=17 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:debugfs:s0 tclass=file

3. (EDIT: this one isn't probably yours) here you're within restricted u:r:shell:s0 (unprivileged shell) and will probably need to switch to more privileged u:r:init_shell:s0

avc: denied { write } for name="system@framework@boot.art" dev="mmcblk0p28" ino=491524 scontext=u:r:shell:s0 tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file

Actually some of these operations are most likely not executed as root and just executing them as root might be all what's needed.

full sample log;

11-13 21:41:18.070 9502 10212 I StatsProvider: Trace: Calling root operations2014-11-13 21:41:18
11-13 21:41:18.294 169 169 W servicemanager: type=1400 audit(0.0:49): avc: denied { search } for name="10295" dev="proc" ino=49298 scontext=u:r:servicemanager:s0 tcontext=u:r:init:s0 tclass=dir
11-13 21:41:18.303 169 169 E ServiceManager: SELinux: getpidcon(pid=10295) failed to retrieve pid context.
11-13 21:41:18.303 169 169 E ServiceManager: find_service('alarm') uid=0 - PERMISSION DENIED
11-13 21:41:18.387 9502 10212 I StatsProvider: Accessing Alarms in API mode
11-13 21:41:18.390 9502 10212 I StatsProvider: Trace: Finished root operations2014-11-13 21:41:18
11-13 21:41:18.390 9502 10212 I ReferenceStore: Serializing reference ref_current
11-13 21:41:18.390 9502 10212 I StatsActivity: LoadStatData: refreshing display for stats ref_boot to ref_current
11-13 21:41:18.390 9502 10212 I ReferenceStore: Retrieved reference from cache: Reference ref_boot created 34 s (Wl: 0 elements; KWl: 0elements; NetS: 1 elements; Alrm: 0 elements; Proc: 14 elements; Oth: 9 elements; CPU: 9 elements)
11-13 21:41:18.390 9502 10212 I ReferenceStore: Retrieved reference from cache: Reference ref_current created 2 h 4 m 29 s (Wl: 0 elements; KWl: 0elements; NetS: 16 elements; Alrm: 0 elements; Proc: 6 elements; Oth: 4 elements; CPU: 15 elements)
11-13 21:41:18.394 10212 10212 W com.asksven.betterbatterystats_xdaedition: type=1400 audit(0.0:50): avc: denied { read } for comm=4173796E635461736B202334 name="wakeup_sources" dev="debugfs" ino=17 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:debugfs:s0 tclass=file
11-13 21:41:18.398 9502 10212 D libsuperuser: [libsuperuser][C][SU%] START
11-13 21:41:18.433 9502 10212 D libsuperuser: [libsuperuser][C][SU+] cat /sys/kernel/debug/wakeup_sources
11-13 21:41:18.447 9502 10296 I ReferenceStore: Saved ref ref_current
...
11-13 21:41:18.624 10305 10305 W app_process: type=1400 audit(0.0:51): avc: denied { write } for name="system@framework@boot.art" dev="mmcblk0p28" ino=491524 scontext=u:r:shell:s0 tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file
11-13 21:41:18.629 10305 10305 D AndroidRuntime:
11-13 21:41:18.629 10305 10305 D AndroidRuntime: >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
11-13 21:41:18.632 10305 10305 D AndroidRuntime: CheckJNI is OFF
11-13 21:41:18.714 9502 10212 D libsuperuser: [libsuperuser][C][SU%] END
11-13 21:41:18.714 9502 10212 E StatsActivity: Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.FileReader.close()' on a null object reference
11-13 21:41:18.714 9502 10212 E StatsActivity: at com.asksven.android.common.kernelutils.WakeupSources.fileExists(WakeupSources.java:218)
11-13 21:41:18.714 9502 10212 E StatsActivity: at com.asksven.betterbatterystats.data.StatsProvider.getNativeKernelWakelockStatList(StatsProvider.java:850)
11-13 21:41:18.714 9502 10212 E StatsActivity: at com.asksven.betterbatterystats.data.StatsProvider.getStatList(StatsProvider.java:179)
11-13 21:41:18.714 9502 10212 E StatsActivity: at com.asksven.betterbatterystats.StatsActivity$LoadStatData.doInBackground(StatsActivity.java:891)
11-13 21:41:18.714 9502 10212 E StatsActivity: at com.asksven.betterbatterystats.StatsActivity$LoadStatData.doInBackground(StatsActivity.java:1)
11-13 21:41:18.714 9502 10212 E StatsActivity: at android.os.AsyncTask$2.call(AsyncTask.java:288)
11-13 21:41:18.714 9502 10212 E StatsActivity: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
11-13 21:41:18.714 9502 10212 E StatsActivity: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
11-13 21:41:18.714 9502 10212 E StatsActivity: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
11-13 21:41:18.714 9502 10212 E StatsActivity: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
11-13 21:41:18.714 9502 10212 E StatsActivity: at java.lang.Thread.run(Thread.java:818)
11-13 21:41:18.725 10305 10305 D AndroidRuntime: Calling main entry com.android.commands.am.Am
11-13 21:41:18.744 9502 9502 W tats_xdaedition: type=1400 audit(0.0:52): avc: denied { read } for name="wakeup_sources" dev="debugfs" ino=17 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:debugfs:s0 tclass=file
11-13 21:41:18.747 9502 9502 I ReferenceStore: Retrieved reference from cache: Reference ref_boot created 34 s (Wl: 0 elements; KWl: 0elements; NetS: 1 elements; Alrm: 0 elements; Proc: 14 elements; Oth: 9 elements; CPU: 9 elements)
11-13 21:41:18.747 9502 9502 I ReferenceStore: Retrieved reference from cache: Reference ref_current created 2 h 4 m 29 s (Wl: 0 elements; KWl: 0elements; NetS: 16 elements; Alrm: 0 elements; Proc: 6 elements; Oth: 4 elements; CPU: 15 elements)
11-13 21:41:18.747 9502 9502 I StatsActivity: Since 2 h 3 m 55 s Bat.: -3% [1,5%/h]
11-13 21:41:18.748 9502 9502 I ReferenceStore: Retrieved reference from cache: Reference ref_boot created 34 s (Wl: 0 elements; KWl: 0elements; NetS: 1 elements; Alrm: 0 elements; Proc: 14 elements; Oth: 9 elements; CPU: 9 elements)
11-13 21:41:18.748 9502 9502 I ReferenceStore: Retrieved reference from cache: Reference ref_current created 2 h 4 m 29 s (Wl: 0 elements; KWl: 0elements; NetS: 16 elements; Alrm: 0 elements; Proc: 6 elements; Oth: 4 elements; CPU: 15 elements)
11-13 21:41:18.749 9502 9502 D libsuperuser: [libsuperuser][G] Application attempted to run a shell command from the main thread
11-13 21:41:18.749 9502 9502 W System.err: com.asksven.andoid.common.contrib.ShellOnMainThreadException: Application attempted to run a shell command from the main thread
11-13 21:41:18.749 9502 9502 W System.err: at com.asksven.andoid.common.contrib.Shell.run(Shell.java:110)
11-13 21:41:18.749 9502 9502 W System.err: at com.asksven.andoid.common.contrib.Shell$SU.run(Shell.java:287)
11-13 21:41:18.749 9502 9502 W System.err: at com.asksven.android.common.kernelutils.WakeupSources.fileExists(WakeupSources.java:201)
11-13 21:41:18.749 9502 9502 W System.err: at com.asksven.betterbatterystats.data.StatsProvider.getNativeKernelWakelockStatList(StatsProvider.java:850)
11-13 21:41:18.749 9502 9502 W System.err: at com.asksven.betterbatterystats.data.StatsProvider.getStatList(StatsProvider.java:179)
11-13 21:41:18.749 9502 9502 W System.err: at com.asksven.betterbatterystats.StatsActivity$LoadStatData.onPostExecute(StatsActivity.java:984)
11-13 21:41:18.749 9502 9502 W System.err: at com.asksven.betterbatterystats.StatsActivity$LoadStatData.onPostExecute(StatsActivity.java:1)
11-13 21:41:18.749 9502 9502 W System.err: at android.os.AsyncTask.finish(AsyncTask.java:632)
11-13 21:41:18.749 9502 9502 W System.err: at android.os.AsyncTask.access$600(AsyncTask.java:177)
11-13 21:41:18.749 9502 9502 W System.err: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
11-13 21:41:18.749 9502 9502 W System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
11-13 21:41:18.749 9502 9502 W System.err: at android.os.Looper.loop(Looper.java:135)
11-13 21:41:18.749 9502 9502 W System.err: at android.app.ActivityThread.main(ActivityThread.java:5221)
11-13 21:41:18.749 9502 9502 W System.err: at java.lang.reflect.Method.invoke(Native Method)
11-13 21:41:18.750 9502 9502 W System.err: at java.lang.reflect.Method.invoke(Method.java:372)
11-13 21:41:18.750 9502 9502 W System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
11-13 21:41:18.750 9502 9502 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)