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

Commit 791e6f83 authored by Connor O'Brien's avatar Connor O'Brien Committed by Steven Moreland
Browse files

libtimeinstate: fix map names



The maps defined by the time_in_state.c BPF program now have names
ending with "_map", so update our calls to bpf_obj_get() to reflect
that.

Test: libtimeinstate_test passes
Bug: 78498733
Change-Id: If13df157c0245561eee3efa2a9c5a04f339ca194
Signed-off-by: default avatarConnor O'Brien <connoro@google.com>
(cherry picked from commit cf9bc5fd)
Merged-In: If13df157c0245561eee3efa2a9c5a04f339ca194
parent 6f435621
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ static bool initGlobals() {
        gPolicyCpus.emplace_back(cpus);
    }

    gMapFd = unique_fd{bpf_obj_get(BPF_FS_PATH "map_time_in_state_uid_times")};
    gMapFd = unique_fd{bpf_obj_get(BPF_FS_PATH "map_time_in_state_uid_times_map")};
    if (gMapFd < 0) return false;

    gInitialized = true;
@@ -196,7 +196,7 @@ bool getUidsCpuFreqTimes(
        std::unordered_map<uint32_t, std::vector<std::vector<uint64_t>>> *freqTimeMap) {
    if (!gInitialized && !initGlobals()) return false;

    int fd = bpf_obj_get(BPF_FS_PATH "map_time_in_state_uid_times");
    int fd = bpf_obj_get(BPF_FS_PATH "map_time_in_state_uid_times_map");
    if (fd < 0) return false;
    BpfMap<time_key_t, val_t> m(fd);