# Tracing main thread messages

DevFeed: [Tracing main thread messages](<https://devfeed.tech/articles/tracing-main-thread-messages-25631.md>)

Original publisher: [Read original article](<https://blog.p-y.wtf/tracing-main-thread-messages>)

Author: Pierre-Yves Ricau

Published: 2022-01-27T19:53:56Z

Content type: tutorial

Language: en

Sources: [Py's blog](<https://devfeed.tech/sources/py-s-blog.md>)

Topics: [tracing](<https://devfeed.tech/topics/tracing.md>), [Android](<https://devfeed.tech/topics/android.md>), [Logging](<https://devfeed.tech/topics/logging.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [logger](<https://devfeed.tech/tags/logger.md>), [main-thread](<https://devfeed.tech/tags/main-thread.md>), [perfetto](<https://devfeed.tech/tags/perfetto.md>), [performance](<https://devfeed.tech/tags/performance.md>), [tracing](<https://devfeed.tech/tags/tracing.md>)

## AI overview

This tutorial explains how to inspect Android main-thread activity in Perfetto traces. It uses the seldom-used Looper.setMessageLogging() API to log message dispatches and adds trace sections for each main-thread message with the AndroidX tracing library.

## Source excerpt

👋 Hi, this is P.Y., I work as an Android Engineer at Block, the non-fungible company formerly known as Square. I spend a lot of time focusing on performance and try to share my experience with deep-d