Merge 9b79917f8b3124404abb76522cb52bdeb207c5b4 on remote branch
Change-Id: I51225de4de69f449f7661976f0a1edc20661de91
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index 7de5c78..a7e9626 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -153,42 +153,8 @@
namespace details {
-/*
- * Returns the age of the current process by reading /proc/self/stat and comparing starttime to the
- * current time. This is useful for measuring how long it took a HAL to register itself.
- */
-__attribute__((noinline)) static long getProcessAgeMs() {
- constexpr const int PROCFS_STAT_STARTTIME_INDEX = 21;
- std::string content;
- android::base::ReadFileToString("/proc/self/stat", &content, false);
- auto stats = android::base::Split(content, " ");
- if (stats.size() <= PROCFS_STAT_STARTTIME_INDEX) {
- LOG(INFO) << "Could not read starttime from /proc/self/stat";
- return -1;
- }
- const std::string& startTimeString = stats[PROCFS_STAT_STARTTIME_INDEX];
- static const int64_t ticksPerSecond = sysconf(_SC_CLK_TCK);
- const int64_t uptime = android::uptimeMillis();
-
- unsigned long long startTimeInClockTicks = 0;
- if (android::base::ParseUint(startTimeString, &startTimeInClockTicks)) {
- long startTimeMs = 1000ULL * startTimeInClockTicks / ticksPerSecond;
- return uptime - startTimeMs;
- }
- return -1;
-}
-
static void onRegistrationImpl(const std::string& descriptor, const std::string& instanceName) {
- long halStartDelay = getProcessAgeMs();
- if (halStartDelay >= 0) {
- // The "start delay" printed here is an estimate of how long it took the HAL to go from
- // process creation to registering itself as a HAL. Actual start time could be longer
- // because the process might not have joined the threadpool yet, so it might not be ready to
- // process transactions.
- LOG(INFO) << "Registered " << descriptor << "/" << instanceName << " (start delay of "
- << halStartDelay << "ms)";
- }
-
+ LOG(INFO) << "Registered " << descriptor << "/" << instanceName;
tryShortenProcessName(descriptor);
}