Skip to content

Commit 9d32a79

Browse files
Hsin-yu ChaoChromeos LUCI
Hsin-yu Chao
authored and
Chromeos LUCI
committed
main thread log: Add set display rotation event
If this ever cause problem, we can see this event around the suspicious timestamp in main thread event dump. BUG=b:329545142 TEST=Trigger SetDisplayRotation, then cras_test_client --dump_main Change-Id: Iab00e81895ec8a42c083d6a51240ac7159fa72ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/5541554 Commit-Queue: ChromeOS Auto Retry <[email protected]> Reviewed-by: Curtis Malainey <[email protected]> Tested-by: [email protected] <[email protected]> Reviewed-by: Yu-Hsuan Hsu <[email protected]> Reviewed-by: Li-Yu Yu <[email protected]> Tested-by: Hsinyu Chao <[email protected]>
1 parent 56c7ee1 commit 9d32a79

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

cras/deprecated/cras_test_client/cras_test_client.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,9 @@ static void show_mainlog_tag(const struct main_thread_event_log* log,
13381338
case MAIN_THREAD_OUTPUT_NODE_VOLUME:
13391339
printf("%-30s dev %u volume %u\n", "OUTPUT_NODE_VOLUME", data1, data2);
13401340
break;
1341+
case MAIN_THREAD_SET_DISPLAY_ROTATION:
1342+
printf("%-30s id %u rotation %u\n", "SET_DISPLAY_ROTATION", data1, data2);
1343+
break;
13411344
case MAIN_THREAD_SET_OUTPUT_USER_MUTE:
13421345
printf("%-30s mute %u\n", "SET_OUTPUT_USER_MUTE", data1);
13431346
break;

cras/include/cras_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ enum MAIN_THREAD_LOG_EVENTS {
362362
MAIN_THREAD_INPUT_NODE_GAIN,
363363
// When output node volume changes.
364364
MAIN_THREAD_OUTPUT_NODE_VOLUME,
365+
// When display rotation is set.
366+
MAIN_THREAD_SET_DISPLAY_ROTATION,
365367
// When output mute state is set.
366368
MAIN_THREAD_SET_OUTPUT_USER_MUTE,
367369
// When system resumes and notifies CRAS.

cras/src/server/cras_dbus_control.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ static DBusHandlerResult handle_set_display_rotation(DBusConnection* conn,
317317
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
318318
}
319319

320+
MAINLOG(main_log, MAIN_THREAD_SET_DISPLAY_ROTATION, id, rotation, 0);
321+
320322
if (!cras_validate_screen_rotation(rotation)) {
321323
syslog(LOG_WARNING, "Invalid display rotation received: %u", rotation);
322324
} else {

0 commit comments

Comments
 (0)