List:Internals« Previous MessageNext Message »
From:ghazel Date:July 9 2011 2:14pm
Subject:Re: "OS thread id" removed
View as plain text  
On Sat, Jul 9, 2011 at 7:00 AM, Davi Arnaut <davi.arnaut@stripped> wrote:
> Hi,
>
> On 7/6/11 1:50 PM, ghazel@stripped wrote:
>> First off, where can I find a real commit message? Second, is there no
>> way to get the OS thread id now? It was very handy when tying MySQL
>> thread id to OS thread id for debugging with gdb.
>
> How did you tie the MySQL thread id to the OS thread id? InnoDB did not
> actually provide the OS thread id, it provide the value of the thread
> descriptor. It was handy for locating the THD object? What exactly did
> it help with?

The "show engine innodb status" transaction output list(ed) both the
"MySQL thread id" and the "OS thread id":
---TRANSACTION CF5F643A, ACTIVE 14 sec, process no 410, OS thread id 1493494080
2 lock struct(s), heap size 376, 1 row lock(s)
MySQL thread id 928182, query id 43574254 localhost root User sleep
select sleep(200)

When represented in hex, 1493494080 is 0x5904e940 which matches the
identifier printed by gdb:

Thread 11 (Thread 0x5904e940 (LWP 1113)):
#0  0x00002aaaaacd4150 in pthread_cond_timedwait@@GLIBC_2.3.2 () from
/lib64/libpthread.so.0
#1  0x00000000006907fd in Interruptible_wait::wait(st_mysql_cond*,
st_mysql_mutex*) ()
#2  0x000000000069e0ed in Item_func_sleep::val_int() ()
#3  0x0000000000659d02 in Item::send(Protocol*, String*) ()
#4  0x00000000004f9f54 in Protocol::send_result_set_row(List<Item>*) ()
#5  0x00000000005306c0 in select_send::send_data(List<Item>&) ()
#6  0x00000000005908cb in JOIN::exec() ()
#7  0x0000000000591da0 in mysql_select(THD*, Item***, TABLE_LIST*,
unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*,
Item*, st_order*, unsigned long long, select_result*,
st_select_lex_unit*, st_select_lex*) ()
...


-Greg
Thread
"OS thread id" removedghazel6 Jul
  • Re: "OS thread id" removedKristian Nielsen6 Jul
    • Re: "OS thread id" removedSergei Golubchik6 Jul
  • Re: "OS thread id" removedDavi Arnaut9 Jul
    • Re: "OS thread id" removedghazel9 Jul
      • Re: "OS thread id" removedDavi Arnaut9 Jul
        • Re: "OS thread id" removedghazel9 Jul
          • Re: "OS thread id" removedDavi Arnaut9 Jul
            • Re: "OS thread id" removedghazel9 Jul
Re: "OS thread id" removedMARK CALLAGHAN6 Jul