thread id along with pid in logcat

3,255 views
Skip to first unread message

kiranbobbu

unread,
Jul 3, 2011, 9:24:24 AM7/3/11
to android-ndk
how to get threadid along with pid in logs from logcat?

Dmitry Suzdalev

unread,
Jul 5, 2011, 6:29:31 AM7/5/11
to andro...@googlegroups.com
Log.d(LOG_TAG, Thread.currentThread().getId()) ? :)

On 3 July 2011 17:24, kiranbobbu <uand...@gmail.com> wrote:
how to get threadid along with pid in logs from logcat?

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


Glenn Kasten

unread,
Jul 5, 2011, 10:29:44 AM7/5/11
to android-ndk
logcat -v thread
see Controlling Log Output Format of
http://developer.android.com/intl/fr/guide/developing/tools/adb.html

fadden

unread,
Jul 6, 2011, 4:32:03 PM7/6/11
to android-ndk
On Jul 5, 7:29 am, Glenn Kasten <gkas...@android.com> wrote:
> logcat -v thread
> see Controlling Log Output Format ofhttp://developer.android.com/intl/fr/guide/developing/tools/adb.html

The "-v thread" format is a little bizarre. Newer versions of Android
have "-v threadtime", e.g.:

07-06 12:05:01.240 179 193 I Blah blah blah

(pid=179, tid=193)

Thread.currentThread().getId() is likely not what you want, as that's
just a serial number generated within the java.lang.Thread class and
not related to the Linux tid.
Reply all
Reply to author
Forward
0 new messages