Commit dcbbb2fd authored by Kartik Hegde's avatar Kartik Hegde Committed by Commit Bot

Remove fetching lsb contents from chrome

Partners will frequently share debug logs to provide context when filing
a bug or diagnosing a problem. Feedback reports have this information,
but it's not stored in any of the files that are packaged up with debug
logs.

This commit follows the CL below, which makes debugd responsible for
fetching the lsb release contents:
https://chromium-review.googlesource.com/c/chromiumos/platform2/+/1217083

BUG=chromium:880851
TEST=Manually checked chrome://system to ensure that lsb release
contents are present even after removing them from the chrome source.
Also checked that chrome://system loads properly and with correct output
when both debugd and chrome are reporting the lsb release contents.

Change-Id: I4651c5168c26ac696d5799c44126e5dcd6b4ce19
Reviewed-on: https://chromium-review.googlesource.com/1217344Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Reviewed-by: default avatarDan Erat <derat@chromium.org>
Reviewed-by: default avatarMike Frysinger <vapier@chromium.org>
Reviewed-by: default avatarJustin TerAvest <teravest@chromium.org>
Commit-Queue: Kartik Hegde <khegde@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594453}
parent 537a208c
......@@ -118,12 +118,7 @@ class BASE_EXPORT SysInfo {
static size_t VMAllocationGranularity();
#if defined(OS_CHROMEOS)
typedef std::map<std::string, std::string> LsbReleaseMap;
// Returns the contents of /etc/lsb-release as a map.
static const LsbReleaseMap& GetLsbReleaseMap();
// If |key| is present in the LsbReleaseMap, sets |value| and returns true.
// Set |value| and return true if LsbRelease contains information about |key|.
static bool GetLsbReleaseValue(const std::string& key, std::string* value);
// Convenience function for GetLsbReleaseValue("CHROMEOS_RELEASE_BOARD",...).
......
......@@ -88,7 +88,7 @@ class ChromeOSVersionInfo {
}
bool GetLsbReleaseValue(const std::string& key, std::string* value) {
SysInfo::LsbReleaseMap::const_iterator iter = lsb_release_map_.find(key);
LsbReleaseMap::const_iterator iter = lsb_release_map_.find(key);
if (iter == lsb_release_map_.end())
return false;
*value = iter->second;
......@@ -104,9 +104,6 @@ class ChromeOSVersionInfo {
}
const Time& lsb_release_time() const { return lsb_release_time_; }
const SysInfo::LsbReleaseMap& lsb_release_map() const {
return lsb_release_map_;
}
bool is_running_on_chromeos() const { return is_running_on_chromeos_; }
private:
......@@ -154,8 +151,9 @@ class ChromeOSVersionInfo {
}
}
using LsbReleaseMap = std::map<std::string, std::string>;
Time lsb_release_time_;
SysInfo::LsbReleaseMap lsb_release_map_;
LsbReleaseMap lsb_release_map_;
int32_t major_version_;
int32_t minor_version_;
int32_t bugfix_version_;
......@@ -196,11 +194,6 @@ std::string SysInfo::KernelVersion() {
return std::string(info.release);
}
// static
const SysInfo::LsbReleaseMap& SysInfo::GetLsbReleaseMap() {
return GetChromeOSVersionInfo().lsb_release_map();
}
// static
bool SysInfo::GetLsbReleaseValue(const std::string& key, std::string* value) {
return GetChromeOSVersionInfo().GetLsbReleaseValue(key, value);
......
......@@ -1800,8 +1800,6 @@ source_set("chromeos") {
"system_logs/device_event_log_source.h",
"system_logs/iwlwifi_dump_log_source.cc",
"system_logs/iwlwifi_dump_log_source.h",
"system_logs/lsb_release_log_source.cc",
"system_logs/lsb_release_log_source.h",
"system_logs/single_debug_daemon_log_source.cc",
"system_logs/single_debug_daemon_log_source.h",
"system_logs/single_log_file_log_source.cc",
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/system_logs/lsb_release_log_source.h"
#include <memory>
#include "base/sys_info.h"
namespace system_logs {
LsbReleaseLogSource::LsbReleaseLogSource() : SystemLogsSource("LsbRelease") {
}
LsbReleaseLogSource::~LsbReleaseLogSource() {
}
void LsbReleaseLogSource::Fetch(SysLogsSourceCallback callback) {
DCHECK(!callback.is_null());
auto response = std::make_unique<SystemLogsResponse>();
const base::SysInfo::LsbReleaseMap& lsb_map =
base::SysInfo::GetLsbReleaseMap();
for (base::SysInfo::LsbReleaseMap::const_iterator iter = lsb_map.begin();
iter != lsb_map.end(); ++iter) {
(*response)[iter->first] = iter->second;
}
std::move(callback).Run(std::move(response));
}
} // namespace system_logs
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_LSB_RELEASE_LOG_SOURCE_H_
#define CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_LSB_RELEASE_LOG_SOURCE_H_
#include "base/macros.h"
#include "components/feedback/system_logs/system_logs_source.h"
namespace system_logs {
// Fetches release information form /etc/lsb-release file.
class LsbReleaseLogSource : public SystemLogsSource {
public:
LsbReleaseLogSource();
~LsbReleaseLogSource() override;
// SystemLogsSource override.
void Fetch(SysLogsSourceCallback callback) override;
private:
DISALLOW_COPY_AND_ASSIGN(LsbReleaseLogSource);
};
} // namespace system_logs
#endif // CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_LSB_RELEASE_LOG_SOURCE_H_
......@@ -14,7 +14,6 @@
#include "chrome/browser/chromeos/system_logs/dbus_log_source.h"
#include "chrome/browser/chromeos/system_logs/debug_daemon_log_source.h"
#include "chrome/browser/chromeos/system_logs/device_event_log_source.h"
#include "chrome/browser/chromeos/system_logs/lsb_release_log_source.h"
#include "chrome/browser/chromeos/system_logs/touch_log_source.h"
#endif
......@@ -31,7 +30,6 @@ SystemLogsFetcher* BuildAboutSystemLogsFetcher() {
fetcher->AddSource(std::make_unique<CommandLineLogSource>());
fetcher->AddSource(std::make_unique<DBusLogSource>());
fetcher->AddSource(std::make_unique<DeviceEventLogSource>());
fetcher->AddSource(std::make_unique<LsbReleaseLogSource>());
fetcher->AddSource(std::make_unique<TouchLogSource>());
// Debug Daemon data source - currently only this data source supports
......
......@@ -16,7 +16,6 @@
#include "chrome/browser/chromeos/system_logs/debug_daemon_log_source.h"
#include "chrome/browser/chromeos/system_logs/device_event_log_source.h"
#include "chrome/browser/chromeos/system_logs/iwlwifi_dump_log_source.h"
#include "chrome/browser/chromeos/system_logs/lsb_release_log_source.h"
#include "chrome/browser/chromeos/system_logs/touch_log_source.h"
#endif
......@@ -35,7 +34,6 @@ SystemLogsFetcher* BuildChromeSystemLogsFetcher() {
fetcher->AddSource(std::make_unique<DBusLogSource>());
fetcher->AddSource(std::make_unique<DeviceEventLogSource>());
fetcher->AddSource(std::make_unique<IwlwifiDumpChecker>());
fetcher->AddSource(std::make_unique<LsbReleaseLogSource>());
fetcher->AddSource(std::make_unique<TouchLogSource>());
// Debug Daemon data source - currently only this data source supports
......
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