Commit 1e298c28 authored by Yury Khmel's avatar Yury Khmel Committed by Commit Bot

arc: Disable gem info reading on Intel kernel v5.4+

This to keep in sync with go/ssufd
Main reasons are:
   * v5.4 reading of this file is slow.
   * file forwat has been changed and it is not clear for now how to
     deal with it.

BUG=b/170215628
TEST=Locally on eve-kernelnext

Change-Id: I80e17014a5bdb67d13b3089e8cd09b5c4bc29612
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2516242
Commit-Queue: Yury Khmel <khmel@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823597}
parent 341aef47
......@@ -9,12 +9,14 @@
#include <unistd.h>
#include "base/bind.h"
#include "base/cpu.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "base/no_destructor.h"
#include "base/strings/string_util.h"
#include "base/system/sys_info.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/task_runner_util.h"
......@@ -244,10 +246,22 @@ struct ArcSystemStatCollector::SystemReadersContext {
LOG(ERROR) << "Failed to open mem info file: " << kMemoryInfoPath;
}
context->system_readers[SystemReader::kGemInfo].reset(
open(kGemInfoPath, O_RDONLY));
if (!context->system_readers[SystemReader::kGemInfo].is_valid()) {
LOG(ERROR) << "Failed to open gem info file: " << kGemInfoPath;
// Reading i915_gem_objects on Intel platform with kernel 5.4 is slow and is
// prohibited. Also it changes reporting format.
// TODO(b/170397975): Update if i915_gem_objects reading time is improved.
const bool is_newer_kernel =
base::StartsWith(base::SysInfo::KernelVersion(), "5.");
const bool is_intel_cpu = base::CPU().vendor_name() == "GenuineIntel";
if (!is_newer_kernel || !is_intel_cpu) {
context->system_readers[SystemReader::kGemInfo].reset(
open(kGemInfoPath, O_RDONLY));
if (!context->system_readers[SystemReader::kGemInfo].is_valid()) {
LOG(ERROR) << "Failed to open gem info file: " << kGemInfoPath;
}
} else {
LOG(ERROR) << "Reading gem info from: " << kGemInfoPath
<< " is disabled.";
}
const base::FilePath& cpu_temp_path = GetCpuTemperaturePathOnFileThread();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment