Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5bbc9a27 authored by Carmen Jackson's avatar Carmen Jackson
Browse files

Fix logic error in atrace when detecting available categories.

A category should be marked as available "only if all its required /sys/
files are writeable and if enabling the category will enable one or more
tracing tags or /sys/ files". The previous code didn't check that one or
more file was enabled, and therefore would always mark a category available
if all of their files were optional, even if none of those were
writeable.

Bug: 120621110
Test: Manual
Change-Id: Iee2984f7cb3591dcd0b3a376d95754d1abaea5be
parent b690b5a7
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -439,14 +439,10 @@ static bool isCategorySupported(const TracingCategory& category)
        const char* path = category.sysfiles[i].path;
        bool req = category.sysfiles[i].required == REQ;
        if (path != nullptr) {
            if (req) {
                if (!fileIsWritable(path)) {
                    return false;
                } else {
                    ok = true;
                }
            } else {
            if (fileIsWritable(path)) {
                ok = true;
            } else if (req) {
                return false;
            }
        }
    }