Android O storaged issue

390 views
Skip to first unread message

Wei Wang

unread,
Apr 24, 2018, 11:59:42 AM4/24/18
to android-platform
Hi All:
   Now we will use Google common-kernel-4.9 and I noticed Android O added storaged monitor mechanism.

   Below is the coresponing source code:

std::unordered_map<uint32_t, struct uid_info> uid_monitor::get_uid_io_stats_locked()

std::vector<std::string> fields = Split(io_stats[i], " ");
if (fields.size() < 11 ||
!ParseUint(fields[0], &u.uid) ||
!ParseUint(fields[1], &u.io[FOREGROUND].rchar) ||
!ParseUint(fields[2], &u.io[FOREGROUND].wchar) ||
!ParseUint(fields[3], &u.io[FOREGROUND].read_bytes) ||
!ParseUint(fields[4], &u.io[FOREGROUND].write_bytes) ||
!ParseUint(fields[5], &u.io[BACKGROUND].rchar) ||
!ParseUint(fields[6], &u.io[BACKGROUND].wchar) ||
!ParseUint(fields[7], &u.io[BACKGROUND].read_bytes) ||
!ParseUint(fields[8], &u.io[BACKGROUND].write_bytes) ||
!ParseUint(fields[9], &u.io[FOREGROUND].fsync) ||
!ParseUint(fields[10], &u.io[BACKGROUND].fsync)) {
LOG_TO(SYSTEM, WARNING) << "Invalid I/O stats: \""
<< io_stats[i] << "\"";
continue;
}
2. https://android.googlesource.com/kernel/common/+/android-4.9/drivers/misc/uid_sys_stats.c

static void show_io_uid_tasks(struct seq_file *m, struct uid_entry *uid_entry)
{
struct task_entry *task_entry;
unsigned long bkt_task;
hash_for_each(uid_entry->task_entries, bkt_task, task_entry, hash) {
/* Separated by comma because space exists in task comm */
seq_printf(m, "task,%s,%lu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu\n",
task_entry->comm,
(unsigned long)task_entry->pid,
task_entry->io[UID_STATE_FOREGROUND].rchar,
task_entry->io[UID_STATE_FOREGROUND].wchar,
task_entry->io[UID_STATE_FOREGROUND].read_bytes,
task_entry->io[UID_STATE_FOREGROUND].write_bytes,
task_entry->io[UID_STATE_BACKGROUND].rchar,
task_entry->io[UID_STATE_BACKGROUND].wchar,
task_entry->io[UID_STATE_BACKGROUND].read_bytes,
task_entry->io[UID_STATE_BACKGROUND].write_bytes,
task_entry->io[UID_STATE_FOREGROUND].fsync,
task_entry->io[UID_STATE_BACKGROUND].fsync);
}
}



When the kernel output format to /proc/uid_io/stats is task,%s,%lu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu\n, but storaged 's parsing format is like 'com.android.vending 2170 60 0 0 219904796 38693092 174436352 18944000'.
Storaged will get parsing error and print lots of the below error message in logcat:

W//system/bin/storaged( 2057): Invalid I/O stats: "task,kworker/u8:2,1397,0,0,0,0,0,0,0,0,0,0"


My Question is :
Does the kernel is wrong or storaged is not match the common-kernel 4.9?

Does anyone have idea about this problem?





jin xia

unread,
Apr 28, 2018, 11:11:29 AM4/28/18
to android-platform
disable kernel's CONFIG_UID_SYS_STATS_DEBUG will solve the problem.

在 2018年4月24日星期二 UTC+8下午11:59:42,Wei Wang写道:

abu.alanoud

unread,
Oct 13, 2018, 10:51:13 PM10/13/18
to android-platform
Reply all
Reply to author
Forward
0 new messages