utils: Refactor findFiles()

The findFiles() iterates the directory recursively. For CPU sensor it
was using depth 6 to iterate the PECI devices, and it results in
iterating all the devices in /sys/bus/platform because it contains a
symlink of `subsystem` to `/sys/bus/platform`.

Refactor this function and make sure it skips iterating if a subdir does
not match the regex.

Tested: On g220a, the iterated files reduce from about 40000 to 400,
        and the function execution time reduces from 30s+ to about 0.5s.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I7eada897a0f2c76c405a4efc0a081e00b48070e1
diff --git a/include/Utils.hpp b/include/Utils.hpp
index bb15bb0..0a89d13 100644
--- a/include/Utils.hpp
+++ b/include/Utils.hpp
@@ -55,7 +55,7 @@
                          const std::set<std::string>& permitSet);
 std::set<std::string> getPermitSet(const SensorBaseConfigMap& config);
 bool findFiles(const std::filesystem::path& dirPath,
-               const std::string& matchString,
+               std::string_view matchString,
                std::vector<std::filesystem::path>& foundPaths,
                int symlinkDepth = 1);
 bool isPowerOn(void);