diff options
| author | Jiao, Joey <jiangenj@qti.qualcomm.com> | 2025-04-01 10:07:35 +0800 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-04-03 20:12:52 +0000 |
| commit | 1740c7073193e88243d7cac815c7fff1c7f5eabd (patch) | |
| tree | b938244c9f2d288fd403c489489802dd187dc931 /vm/adb | |
| parent | 8d95605b891f89e61af902d2d4a85b1930fc6699 (diff) | |
vm/adb: change printk level to allow findConsole
Diffstat (limited to 'vm/adb')
| -rw-r--r-- | vm/adb/adb.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vm/adb/adb.go b/vm/adb/adb.go index 8889f7397..77b0a8c55 100644 --- a/vm/adb/adb.go +++ b/vm/adb/adb.go @@ -156,7 +156,15 @@ func (pool *Pool) Create(workdir string, index int) (vmimpl.Instance, error) { log.Logf(0, "associating adb device %v with console cmd `%v`", inst.device, inst.consoleCmd) } else { if inst.console == "" { + // More verbose log level is required, otherwise echo to /dev/kmsg won't show. + level, err := inst.adb("shell", "cat /proc/sys/kernel/printk") + if err != nil { + return nil, fmt.Errorf("failed to read /proc/sys/kernel/printk: %w", err) + } + inst.adb("shell", "echo 8 > /proc/sys/kernel/printk") inst.console = findConsole(inst.adbBin, inst.device) + // Verbose kmsg slows down system, so disable it after findConsole. + inst.adb("shell", fmt.Sprintf("echo %v > /proc/sys/kernel/printk", string(level))) } log.Logf(0, "associating adb device %v with console %v", inst.device, inst.console) } |
